Does anyone know if it is possible to include parameters in the header and / or footer text of a Quarto or RMarkdown document rendered to a pdf?
This issue shows how to include general text in the header and footer. But what I want to do is include a parameter in the header or footer.
In the example below, the parameter name
can be rendered in the main body, but I do not know if it is possible to include it in the header.
---
title: "Untitled"
format:
pdf:
include-in-header:
text: |
\usepackage{scrlayer-scrpage}
\rohead{Header text}
\lofoot{Footer text}
params:
name: "John"
---
# Chapter ONE
My name is `r params$name`
\newpage
# Chapter TWO
Edit: The reason why I want to use a parameters is because I need to pass a parameter while rendering, e.g. using quarto::quarto_render()
in R. I'm rendering multiple PDFs, and I'd like to insert a unique name in the header / footer of each one.