Reputation: 72803
I want to place Rmarkdown footnotes under the header Endnotes. Whereas References can be placed with <div id="refs"></div>
, that method seems not to work with footnotes, though. I opened the html
document produced by Rmarkdown that revealed footnotes are collected under a tag called <div class="footnotes"></div>
. I also tried <div id="footnotes"></div>
, but that won't work either. How do I do this right?
---
output: html_document
references:
- id: hawking_thermodynamics_1983
author:
- family: Hawking
given: S. W.
- family: Page
given: Don. N.
publisher: Communications in Mathematical Physics
title: Thermodynamics of Black Holes in Anti-de Sitter Space.
volume: 87
type: article-journal
issued:
year: 1983
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Section 1
Lorem ipsum dolor^[always look on the bright side of life] sit amet, consetetur
sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna
aliquyam erat, sed diam voluptua [@hawking_thermodynamics_1983].
## Endnotes
<div class="footnotes"></div>
## References
<div id="refs"></div>
## Appendix
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
Section 1
Lorem ipsum dolor1 sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua (Hawking and Page 1983).
Endnotes
References
Hawking, S. W., and Don. N. Page. 1983. “Thermodynamics of Black Holes in Anti-de Sitter Space.” 87.
Appendix
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
Upvotes: 1
Views: 2655
Reputation: 5910
In the context of a HTML document, JavaScript can be used.
For instance, this Rmd
file renders as you want.
---
output: html_document
references:
- id: hawking_thermodynamics_1983
author:
- family: Hawking
given: S. W.
- family: Page
given: Don. N.
publisher: Communications in Mathematical Physics
title: Thermodynamics of Black Holes in Anti-de Sitter Space.
volume: 87
type: article-journal
issued:
year: 1983
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Section 1
Lorem ipsum dolor^[always look on the bright side of life] sit amet, consetetur
sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna
aliquyam erat, sed diam voluptua [@hawking_thermodynamics_1983].
## Endnotes {#endnotes}
## References
<div id="refs"></div>
## Appendix
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
```{js, echo=FALSE}
$(document).ready(function() {
$('.footnotes ol').appendTo('#endnotes');
$('.footnotes').remove();
});
```
Here, the JS script moves the list of footnotes in the endnotes
section and finally removes the footnotes section.
Upvotes: 2