-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path9.3.6-zotero.Rmd
83 lines (56 loc) · 7.27 KB
/
9.3.6-zotero.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
## Zotero and Better BibTeX {- #zotero}
Our Bookdown workflow uses the open-source [Zotero bibliography manager](http://zotero.org), with the [Better BibTeX extension](https://retorque.re/zotero-better-bibtex/), to simplify the process of creating source notes and a bibliography. Rather than typing full references directly into the text, you can insert a short citation key into the book manuscript, and the tools will automatically generate the desired references in your preferred format (we like Chicago-style endnotes), with an alphabetized bibliography of all sources cited at the end.
After you've installed the tools, here's an overview of the workflow:
- Create an entry for each source (book, journal article, document, etc.) in your Zotero library.
- Select and upload your preferred citation style in `.csl` format.
- For each source, Better BibTeX generates a unique citation key, similar to `tyackOneBestSystem1974`, which you can paste with formatting to create a note in the book manuscript.
- Each time before you build your book inside Bookdown, export your Zotero library or collection in `.bib` format into your Bookdown repository, which supplies the reference data to match your citation keys in the text.
Here are more detailed instructions to install, set up, and use Zotero and Better BibTeX in a Bookdown workflow. Remember that this workflow may not be ideal for novice computer users. But if you have multiple citations, it will save you time in the long run.
1. Download and install [Zotero](http://zotero.org) for Mac, Windows, or Linux. Add connectors to your preferred browsers to automatically upload bibliographic data for your sources.
2. Install the [Better BibTeX extension](https://retorque.re/zotero-better-bibtex/installation/) and follow all of the site's instructions for initial setup.
3. At the top of each entry in Zotero, the extension will generate a unique citation code, such as `tyackOneBestSystem1974`.
4. Copy and paste the citation code into your Markdown text, and add a caret, square brackets, and the at symbol `^[@tyackOneBestSystem1974]`. See more options in the Style Guide. Or to use Zotero's drag-and-drop quick-copy feature, you can set Zotero preferences > Export > Better BibTeX Quick Copy, and also if desired, set Better BibTeX preferences > Export > Quick-Copy > Pandoc citation format.
Tip: If you use R Studio's built-in text editor, see this [blog post on how it supports Zotero citations](https://blog.rstudio.com/2020/11/09/rstudio-1-4-preview-citations/).
5. Go to the [Zotero Style Repository](https://www.zotero.org/styles) to find your preferred citation style (such as `chicago-fullnote-bibliography.csl`). Upload this file to your Bookdown repository, and also add it to your book's `index.Rmd` settings for both the HTML and PDF editions.
6. Each time before your build your book in Bookdown, export an updated Zotero bibliography (in `.bib` format) from your Zotero library or collection, and upload into your Bookdown repo, following these steps:
- A. Select Library > Right-click to export the collection
- B. Select format > Better BibLaTeX (*IMPORTANT*: We use this setting, rather than "Better BibTex", because "Better BibLaTex" includes full dates in newspaper citations, and URLs). Also, we leave all of the checkboxes blank during the export, and do *not* select "keep updated". This means that if your Better BibTex citation codes suddenly change in Zotero because the author, title, or year changed, then you are responsible for running find-and-replace to make these edits in the text of the book.
- C. Save the output in `.bib` format, save into your book repo, and be sure to add the same filename to your settings in `index.Rmd`, as shown in these excerpts:
```
bibliography: ontheline.bib
citation-style: chicago-fullnote-bibliography.csl
...
output:
bookdown::gitbook:
...
pandoc_args: [ "--csl", "chicago-fullnote-bibliography.csl" ]
...
bookdown::pdf_book:
...
citation_package: default
pandoc_args: [ "--csl", "chicago-fullnote-bibliography.csl" ]
```
In our Bookdown workflow, which uses the Chicago full-note bibliography style, this Zotero source type entries appear correctly formatted:
- Book
- Book chapter
- Journal article
- Newspaper
- Thesis
- Report
- Web page
- Blog post -- But we avoid this because Zotero Chicago-style entry inserts "(blog)" into citation title. Instead, we prefer to reset the type to Web page.
- Document -- Use this all-purpose entry in place of other types: Law case, Presentation, Interview, Video recording, Television broadcast, etc. Insert important details (such as the archival location information) in the Publisher field.
To help other researchers find items cited in this book, include URLs in Zotero entries whenever feasible, even if not required by convention. For example, some print-only books and documents are hard to locate, so include an OCLC WorldCat permalink to make them easier to find (example: http://www.worldcat.org/oclc/20683509). Also, if a print source has been digitized by HathiTrust, Google Books, or the Internet Archive, add one of these URLs to the Zotero entry.
Reminder: Chicago full-note works exactly as it was designed, meaning that the second instance of a citation currently appears as an abbreviated note (author, with title when appropriate).
Demo:
Here's a text-only note, with no Zotero citation.^[This is a note, with no bibliographic reference.]
To create a note with citations only, separate Zotero/BibTeX citation keys with semi-colons: ^[@tyackOneBestSystem1974; @jacksonCrabgrassFrontierSuburbanization1985]
Since notes also may include text and punctuation in Markdown syntax, always insert a caret symbol prior to the brackets to demarcate a note:^[Compare how urban education appears in @tyackOneBestSystem1974, p. 123 versus suburban schooling in @jacksonCrabgrassFrontierSuburbanization1985, p. 234.]
Remember that the `chicago-fullnote-bibliography.csl` format is designed to automatically shorten the note after it its first reference.
### Customized to restart endnote numbering in each chapter & subchapter {-}
Note that this publication contains customized code in `style.css` to restart endnote numbering in each chapter and subchapter (aka section), to match a traditional history book publication. See [relevant code on GitHub](https://github.com/OnTheLine/otl-bookdown/blob/main/css/style.css#L80).
TODO: Fix known issue: Using Bookdown version 0.16 as of January 2020, note numbering with customized code appears differently across editions, and needs to be addressed prior to final PDF publication:
- In the Web HTML edition, customized code in `style.css` renumbers endnotes at the beginning of each chapter (e.g. 2) and subchapter (e.g. 2.1), as desired by the author.
- But in the PDF edition, endnote renumbering begins only at each chapter, not subchapter, regardless of the custom CSS code. Probably need to change a Pandoc LaTeX setting.
- In the MS Word edition, footnotes (rather than endnotes) are continuously numbered without breaks across the entire document, regardless of the custom CSS code.
- Also, avoid placing notes in image captions, since URLs cause an extra } symbol to appear when generating PDF version, which crashes the build. Instead, place dynamic reference in the body text immediately before the image, along with footnote ref.