0
---
title: "My R Notebook"
standalone: true
format:
  docx:
    reference_docx: ~/FCD/custom-reference-doc.docx
    header: My Header. This is a custom header for my Word file.
    footer: Page &p; of &P;
---

```{r setup, include=FALSE}
# Load required libraries
library(ggplot2)
library(readr)
library(dplyr)
library(tidyr)
```

This way it didn't work

r2evans
  • 141,215
  • 6
  • 77
  • 149
  • 1
    https://stackoverflow.com/a/46027537/3358272, the point being that Word documents require you to pre-determine the header/footer in the reference template file. I don't know of a way to dynamically define header/footer at runtime. – r2evans Apr 14 '23 at 12:33

0 Answers0