In the yaml
of a quarto
document I have:
---
title: "Hey!"
author:
- name: Birdy Bird
affiliations:
- University of Birds
- University of Hummingbirds
format: pdf
editor: visual
---
When I render this file using Rstudio
IDE, I get:
I was expecting the affiliations with their numbers (e.g. 1, 2 as superscripts) to show up somewhere.
R version:
> sessionInfo()
R version 4.2.2 (2022-10-31)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.1
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.2.2 tools_4.2.2
Rstudio version
> rstudioapi::versionInfo()
$citation
To cite RStudio in publications use:
Posit team (2022). RStudio: Integrated Development Environment for R. Posit Software, PBC, Boston, MA. URL
http://www.posit.co/.
A BibTeX entry for LaTeX users is
@Manual{,
title = {RStudio: Integrated Development Environment for R},
author = {{Posit team}},
organization = {Posit Software, PBC},
address = {Boston, MA},
year = {2022},
url = {http://www.posit.co/},
}
$mode
[1] "desktop"
$version
[1] ‘2022.12.0.353’
$long_version
[1] "2022.12.0 353"
$release_name
[1] "Elsbeth Geranium"
Quarto version:
> quarto::quarto_version()
[1] ‘1.2.269’
CodePudding user response:
I am facing the the same issue. The HTML output includes author metadata, but the PDF output does not. Apparently this can solve this by including template partials that define the author meta data to include.
In the YAML header you will need:
format:
pdf:
keep-tex: true
template-partials:
- _extensions\partials\title.tex
In the title.tex file you need something like:
\title{$title$}
\author{
$for(by-author)$
{$by-author.name.literal$} \\
$for(by-author.affiliations)$
$it.name$ \\
$it.country$
$endfor$ \\
$if(by-author.email)$\href{mailto:$by-author.email$}{$by-author.email$}$endif$
\and
$endfor$}
\date{$date$}
I had this working in the past, but unfortunately it is no longer working (not sure why)...
More information about template partials can be obtained here:
Explore the authblk
docs to know about ways to control affiliations formatting.