We can add multiple authors to an R Markdown document within the YAML frontmatter in a number of ways. If we simply want to list them on the same line, we can provide a single string to the document, e.g.,
---
title: "Untitled"
author: "John Doe, Jane Doe"
---
Alternatively, if we wish each entry to be on its own line, we can provide a list of entries to the YAML field. This can be useful if you wish to include further information about each author such as an email address or institution, e.g.,
---
author:
- John Doe, Institution One
- Jane Doe, Institution Two
---
We can make use of the Markdown syntax ^[]
to add additional information as a footnote to the document. This may be more useful if you have extended information that you wish to include for each author, such as providing a contact Email and address. The exact behavior will depend on the output format:
---
author:
- John Doe^[Institution One, john@example.org]
- Jane Doe^[Institution Two, jane@example.org]
---
Certain R Markdown templates will allow you to specify additional parameters directly within the YAML. For example, the Distill output format allows url
, affiliation
, and affiliation_url
to be specified. After you install the distill package (Dervieux et al. 2023):
install.packages("distill")
you can use the Distill format with detailed author information, e.g.,
---
title: "Distill for R Markdown"
author:
- name: "JJ Allaire"
url: https://github.com/jjallaire
affiliation: RStudio
affiliation_url: https://www.rstudio.com
output: distill::distill_article
---
References
Dervieux, Christophe, JJ Allaire, Rich Iannone, Alison Presmanes Hill, and Yihui Xie. 2023. Distill: R Markdown Format for Scientific and Technical Writing. https://github.com/rstudio/distill.