8 Zotero
Zotero is a free and open-source reference management software to manage bibliographic data and related research materials, such as PDF files.
- Take a look at the Zotero Tutorial .
- More helpful Zotero info here
8.1 Set up
Download Zotero and create an account. We will then share the New Graph library with you.
Install the Better BibTex add-on. In the Better BibTeX settings change the
citation key format
toauthEtal2.lower.replace(find=".",replace=_)+len+year+veryshorttitle(2) | title+year
, see 8.1.
- In the Better BibTeX settings, in the
export
tab, changeAdd URLs to BibTeX export
toin the URL field
, see 8.2.
- Install the ZotFile add-on and use the settings below:
- Insure that Rmarkdown is communicating with Zotero by navigating to tools/global options/R Markdown/Citations. See screenshot below.
8.2 Adding references to Zotero
Add references to zotero using the Zotero/Zotfiles plug-in. Make sure the metadata (authers, date, title) and pdf were transferred and if not add whats missing, sometimes not everything is transferred.
Do your best to add the reference to the correct collection, we try to keep them organized by subject. You can move a reference by holding Cmd
(Mac) or shift
(Windows/Linux).
To add metadata to a reference:
Right click the reference and select
create parent item
thenmanual entry
and input all metadataOnce complete, right click and select
Manage Attachments/Rename and Move
. This renaming ensures we are using Zotfile.
8.3 Inserting citations
Zotero makes it easy for us to insert citations into Rmarkdown documents. Zotero will only add citations that are referenced with a citation key to the references section at the end of the bookdown document, so for efficiency purposes we include the entire NewGraphEnvironment shared library even though not all references are used in each document.
Right click to export the entire NewGraphEnvironment shared library in Better bibTex format. Open the exported
*.bib
file in Rstudio, as well as the*.bib
files referenced in the YMAL of theindex.Rmd
file in the repo. Copy paste the exported*.bib
file content into the repo*.bib
file. If you only want to add a few references, add them to their own collection and export that way.Now in your document, just type the citation key for the reference and it will automatically add the citation for you. It will also add the reference to the references section at the end of the bookdown document.
For example, the citation key for MoE, (2011) was added and now you can see the citation in text as well as in the references section.
8.4 Updating citations
Sometimes when building a report you will run into an error saying that the citation key is not found (see error below). This is either because the citation has not been added to the *.bib
file or the citation key needs to be updated. To update the citation key, search for the reference in Zotero using the title or authors, then copy/paste the citation key and replace the old citation key in the Rmarkdown document. Make sure to update the *.bib
file following step 1 of [#inserting-citations]. If the citation is new and you are getting this error, double check that you have updated the *.bib
file with the new reference, following step 1 of [#inserting-citations].
[WARNING] Citeproc: citation bustard_schell2002ConservingMorice not found
[WARNING] Citeproc: citation flnro2013BulkleyRiver not found
[WARNING] Citeproc: citation flnro2013OverviewAngling not found