Chapter 8 Referencing
8.1 Adding citations
You can reference publications etc using the following syntax:
where bibcode
is the bibcode for the entry in your bib file (see Sec. 8.2). This will give the equivalent of the LaTeX \citet{}
command.
Example:
Scowcroft et al. (2016) showed that the SMC is a very elongated galaxy.
For \citep{}
, just put the citation in square brackets.
The first observations of SMC Cepheids were taken over 100 years ago (Leavitt & Pickering 1912).
8.2 Bibliography files
Assuming you’re using natbib style references you can pass the same bib file to bookdown.
Example bib file entry:
8.3 Reference style
The referencing style is controlled in the index.Rmd
file.
At the top of this file you’ll find the section that defines things like the book title, output format etc. The following lines are where you define the bib file names and referencing format. You can have multiple bib files.
The bibliography:
line points to your bib file. The csl:
line points to your style file. This book uses the ApJ style. Additional style files (e.g. PRL etc.) can be downloaded from zotero. link-citations: yes
creates links from the citations in the text to the reference list at the end of the chapter.
Any chapter that includes references will have a the reference list at the end. You can also include a separate reference list for the whole document. To make sure this goes right at the end I usually name my file 99-references.Rmd
. If you specify the ordering as described in Section 4.1.1 you need to make sure that the reference chapter is the last one in the list. The references file should contain the following text:
This will create an un-numbered section at the end of the book called ‘References’ that has the full reference list.