Search code examples
latexr-markdownbibtexcitations

Rmarkdown Latex citation (Harvard style) within footnote


I am writing my thesis in Rmarkdown and Latex with a seperate literature.bib file that contains the bibtex sources. I now have a footnote and I would like to have a citation like in the normal text, but within the footnote. Is there any package to achieve that? When i just try it, like I would have a citation in the normal text, the footnote stops beeing a footnote when i render to pdf. The citation style I use is the Harvard citation style, so only something like this appears and should appear in the footnote:

enter image description here

The rest of information is than provided under the heading References at the end of the document. Thanks in advance! I appreciate any help...!

Here a minimal reproducable example:

--> This is the code for the main .rmd file

---
output: 
  bookdown::pdf_document2:
    toc: no
papersize: a4
geometry: margin = 1in
fontsize: 11pt
bibliography: literatur.bib
---

#TEST

This is just an example @test.\footnote{I would also like to have a citation here in this footnote!!}

\newpage
# References
<div id="refs"></div>

-->This is the code for the literatur.bib file

@online{test,
  author = {PACER},
  title = {Service Center},
  url = {https://pcl.uscourts.gov},
  urldate = {2021-09-10}
}

Hope that is helpful?!


Solution

  • If you use markdown syntax for the footnote, you can also insert the citation via markdown syntax:

    ---
    output: 
      bookdown::pdf_document2:
        toc: no
    papersize: a4
    geometry: margin = 1in
    fontsize: 11pt
    bibliography: literatur.bib
    ---
    
    #TEST
    
    This is just an example @test.^[I would also like to have a citation here in this footnote!! See [@test]]
    
    \newpage
    # References
    <div id="refs"></div>
    

    enter image description here