I am trying to get the font in my Rmarkdown document to match that of the rest of my report. Essentially this creates the legend for my maps. The entire report is Rockwell, but I can not figure out how to change the font in the output of the pandoc.table. Below is my attempt by used panderOptions but it doesn't work.
---
tables: true
geometry: margin=1.0in
header-includes:
- \usepackage{lscape}
- \newcommand{\blandscape}{\begin{landscape}}
- \newcommand{\elandscape}{\end{landscape}}
- \newcommand{\bminione}{\begin{minipage}{0.75 \textwidth}}
- \newcommand{\bminitwo}{\begin{minipage}{0.25 \textwidth}}
- \newcommand{\emini}{\end{minipage}}
fig_caption: yes
mainfont: Rockwell
sansfont: Rockwell
---
\pagenumbering{gobble}
**`r paste(i)` Projects Legend**
```{r pdf,echo=FALSE,warning=FALSE,error=FALSE,results='asis'}
library(pander)
#Isolate Waterbody in loop
WaterBody <- Datasubset[Datasubset$SWIM.Waterbody == i,]
#Restoration Projects Only
WQProjects <- WaterBody
#Create column that corresponds to map shapefiles
WQProjects$rowname <- 1:nrow(WQProjects)
#Drop all columns except for the ones you want to print
WQProjects <- WQProjects[,c("rowname","Name","Status")]
#Name for columns
colnames(WQProjects) <- c("Map Number","Project Name", "Status")
#Numbers for rows
rownames(WQProjects) <- WQProjects$rowname
#Table format
panderOptions('graph.fontfamily','Rockwell')
panderOptions('graph.fontcolor','red')
pandoc.table(t = WQProjects,
split.tables = Inf,
split.cells = c(5,100,30),
justify = "left",
style = "multiline"
)
```
Test font
Thank you everyone for your help.