I'm writing an R Markdown document in which there is a table. In the footnote of this table, I would like to cite an author. However, using @citationkey
does not work in this situation.
Does anybody know how to do it?
Here's a reproducible example (I included all LaTeX packages needed in kableExtra
but some of them may be unnecessary here):
---
title: "Untitled"
author: ""
date: ""
output:
bookdown::pdf_document2
bibliography: refs.bib
toc: false
header-includes:
- \usepackage[utf8]{inputenc}
- \usepackage[T1]{fontenc}
- \usepackage{booktabs}
- \usepackage{longtable}
- \usepackage{array}
- \usepackage{multirow}
- \usepackage{wrapfig}
- \usepackage{float}
- \usepackage{colortbl}
- \usepackage{pdflscape}
- \usepackage{tabu}
- \usepackage{threeparttable}
- \usepackage{threeparttablex}
- \usepackage[normalem]{ulem}
- \usepackage{makecell}
- \usepackage{xcolor}
---
Here, I can cite @abel2018.
```{r}
library(kableExtra)
kable(head(mtcars)) %>%
footnote(general = paste0("A footnote in which I would like to cite @abel2018."))
```
# References {-}
And the reference in refs.bib
:
@article{abel2018,
title = {Estimates of {{Global Bilateral Migration Flows}} by {{Gender}} between 1960 and 2015},
author = {Abel, Guy J.},
date = {2018-09},
journaltitle = {International Migration Review},
shortjournal = {International Migration Review},
volume = {52},
pages = {809--852},
doi = {10.1111/imre.12327},
url = {http://journals.sagepub.com/doi/10.1111/imre.12327},
urldate = {2019-12-14},
langid = {english},
number = {3}
}
Also asked on StackOverflow