There are many 'R resources lists' to be found on the internet. Here, I just mention three that I liked.
For this example, we will use Mendeley. Mendeley is a free reference manager. If you are not yet using a reference manager, you start doing so right now. It will save you a lot of time in the future.
Go the the Mendeley website, download and install Mendeley and open the program. (note: if you already use a reference manager, check if it provides BibTeX output. We need a .bib file later.)
If this is your first time using Mendeley: you can simply drag and drop pdf files into Mendeley. It will automatically start searching the web for the meta data. If your pdf is a published paper, there will be a lot of meta data available.
Special thanks to Rosanna van Hespen for sharing her workflow online!
First, start a new .Rmd file.
Next, we need a file with all the references Mendeley is currently managing for you. At least 1 random paper and 1 self-made pdf. Mendeley can make a file containing this information: a .bib file. You can have Mendeley automatically updating this file for you, but as we are already syncing stuff with github, we will not make things this complicated for now. So, you will need to repeat this step if you add new papers to Mendeley.
Select the citations you want to include
choose an export location (the folder with your new .Rmd file)
Go back to your .Rmd file and change the YAML header: write ‘bibliography: library_projecticum.bib’ (or whatever is the name of your .bib file), so your header will look like something this:
title: "Untitled" output: html_document bibliography: library_projecticum.bib
VanLissa2021
knitr::include_graphics(here::here( "images", "mendeley_detailwindow.png" ) )
Scroll down a bit:
knitr::include_graphics(here::here( "images", "mendeley_citationkey.png" ) )
You can now cite papers it in your .Rmd using citation keys:
They said something really smart [@VanLissa2021].
or two people:
Some people agree with her [@dehaan08; @vangestel18].
or include additional information:
``` As do colleagues[see @teunis99, pp. 33-35; also @svanoef04, ch. 1].
or inline:
@smith04 [p. 33] says blah.
```
Use a minus sign if you don't want to include the names:
Van der Ploeg says so too [-@vdploeg04].
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.