It's possible to reference and produce reference lists in Markdown if you are using Zotero as your reference manager. In order to get this working there are a few prerequisites you will need to fulfill. We will show this in detail in the sections below but here ss a quick overview of what you need to make this work.
Create a working folder for all the files that need to work together. This folder needs to have the following files in the same place to get everything working:
Zotero
Rstudio
First of all we will need to download and install the Better BibTex-plugin to Zotero
The next step is to install the plugin to Zotero.
Install packages needed to make things work
install.packages("pandoc")
rbbt
remotes::install_github("paleolimbot/rbbt")
tinytex
tinytex::install_tinytex()
Now it's time to create your markdown document in RStudio
Citations can be added to your markdown in both source and visual mode by typing the @sign and and the citation key from Zotero. I have used the key format auth.lower + year in these examples.
Explanation | Format | Example |
Add one citation in parenthesis, i.e. (Sternberg & Wagner, 1991) | [@key] | [@sternberg1991] |
Add several citations in same parenthesis, i.e. (Gladwell, 2022; Zuboff, 2019; Selznick, 1957) | [@key1; @ke2; @key3] | [@gladwell2002; @zuboff2019; @selznick1957] |
Authors in text and the publishing year in parenthesis, i.e. Sternberg & Wagner (1991) | @key | @sternberg1991 |
It's also possible to add citations in visual mode by selecting Insert -> Citation
The reference list will be populated when you knit your document. The references will be inserted in the end of the document.
Error reading bibliography file example2.bib: (line 12491, column 33): unexpected '\8217' Error: pandoc document conversion failed with error 25 Execution halted
This error indicates that there are some characters in your .bib-file that will need to be changed. This could be ', -, or something else.