Skip to content
Discussion options

You must be logged in to vote

For latex, you can use this workaround: have the header/footer refer to a macro, that you define later on in the document

---
title: "Untitled"
format:
  pdf:
    keep-tex: true
    include-in-header:
      text: |
        \usepackage{scrlayer-scrpage}
        \rohead{\myname}
params:
  name: "John"

engine: knitr
---

# Chapter ONE

My name is `r params$name`

\newcommand{\myname}{`r params$name`}


\newpage

# Chapter TWO


Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@jhelvy
Comment options

@cscheid
Comment options

Comment options

You must be logged in to vote
3 replies
@cscheid
Comment options

@jhelvy
Comment options

@cscheid
Comment options

Answer selected by jhelvy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants