This page:
http://rmarkdown.rstudio.com/authoring_bibliographies_and_citations.html
describes adding citations and a generated bibliography to regular rmarkdown
documents. When authoring presentations using rmarkdown
, this method works for ioslides, slidify, and beamer presentations.
The approach of adding a bibliography: line to the front matter of the presentation does not work for the newer "Rpres" presentations.
How can you add a bibliography to an Rpres rmarkdown
presentation file?
I suspect that the answer is that this is not supported by the templates or build options for Rpres files. If that is the case, then pointers on where to patch to add the --bibliography=
option to the call to pandoc
would be appreciated.
My environment includes
Inserting Citations. You insert citations by either using the Insert -> Citation command or by using markdown syntax directly (e.g. [@cite] or @cite ) . Citations go inside square brackets and are separated by semicolons.
Use the toolbar button or the keyboard shortcut to show the Insert Citation dialog: Note that you can insert multiple citations by using the add button on the right side of the item display. If you insert citations from Zotero, DOI look-up, or a search then they are automatically added to your document bibliography.
In Zotero follow this path: Tools>Add-Ons>Gear Icon>Install Add-On From File…. Then go to the folder you installed the Better Bibtex file in. Select the Better Bibtex . xpi file, click “Install Now” in the Zotero pop-up, and follow the system setup.
To create a new R Presentation you execute the New File -> R Presentation command: After specifying the location to save the presentation, a new presentation will be created and a preview will show within the Presentation tab in the upper right corner of the IDE.
The knitcitations
package can be used to add citations and a bibliography using R commands. The following chunk gives a minimal .Rpres:
Using knitcitations
=======================================================
Example Citation
=======================================================
```{r, echo = FALSE}
library(knitcitations)
```
See the `knitcitations` vignette for details on how to add citations, such as
`r citep("10.1890/11-0011.1")`
Bibliography
========================================================
Use the `bibliography` function to add the bibliography.
```{r, echo=FALSE, results="asis"}
bibliography()
```
Here the bibliography is created on-the-fly and includes a LaTeX command that isn't parsed correctly. For more control you can use your own bibliography, e.g.
bib <- read.bibtex("references.bib")
citet(bib["bloggs2002"])
Note that we could have saved the bibliography created in the .Rpres example using write.bibtex
, then edited to create the final references.bib
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With