Zotero
Last updated
Last updated
I highly recommend you install the Zotero plugin for your browser. Then, whenever you're reading an article, you can click the button to save its information to your library. If a pdf is available, it will automatically download that.
One word of caution: zotero is not perfect and may not get all details correct! (It's rarely wrong, just sometimes missing or weirdly formatted) It's good to double-check!
Drag any item from your main library (or any subfolders) into a new folder to add that to your reference list. All items in subfolders still have an entry in the main library. This process does not create duplicate entries.
Having usable citation keys is an important part of having a usable workflow. You can find the citation key at the top of the entry for a reference.
I like using first author last name + publication year because it's easy for me to remember.
First, install BetterBibTeX.
Export the collection as BetterBibTeX, by right clicking the folder, selecting Export Collection, then saving it to your manuscript directory. This will create a .bib file.
Checking "keep updated" will instruct zotero to update the .bib file each time you update the collection in zotero.
Next, you can add this .bib file to your YAML header in the Rmarkdown.
You can now place in-text references in your Rmarkdown text using [@citationkey]
.
Tip: Use the "citr" add-in for RStudio to insert citations loaded from the reference file or directly from Zotero. Alternatively, if you use RStudio's visual editor, simply start typing "@" and a dropdown list will appear - no extra packages necessary.
Some benefits to using this integration:
Not having to manually type out citations
Not having to reorder citations in alphabetical order
Not having to worry about whether this is your first mention of a multi-author citation
A reference list will be automatically added to the end of the document in the citation style you selected. I like to add a page break (\newpage
) and a first-level header (# References
).
When you try to knit, Rmarkdown will tell you if your .bib file is missing any of the things you tried to cite in-text.
Those will generate in-text as your citation key, not as an APA-style reference.
Citations could be missing because:
You misspelled the cite-key
The cite-key is not what you expect (maybe you have 2 articles from that author from the same year. could it be [@bergelson2018
a
]
?)
The item is not in your collection. Add it!
Voila! Knit the Rmarkdown to get your reference list!
You can also generate a bibliography that you can paste anywhere you want. Right click on the collection, then select "Create Bibliography from Collection". You can choose the citation style and select how you'd like to save it. Selecting "Copy to Clipboard" will allow you to paste (Ctrl-V or Cmd-V) it into your document.
Note: unlike the other methods, this will copy ALL REFERENCES IN YOUR COLLECTION, not just the ones you used. It's therefore important to check that all in-text citations are in your reference list, and all references are citation in-text.