Is it possible to add a background image to a R Markdown (.rmd) file for PDF output?
I have scoured through Pandoc's R Markdown documentation but cannot find any mention of adding a background image.
Is it possible to add a background image to a R Markdown (.rmd) file for PDF output?
I have scoured through Pandoc's R Markdown documentation but cannot find any mention of adding a background image.
From this tex.SE answer: save the following as header.tex
(replacing image.jpg by the path to your background image):
\usepackage{background}
\backgroundsetup{
scale=1,
color=black,
opacity=0.4,
angle=0,
pages=all,
contents={%
\includegraphics[width=\paperwidth,height=\paperheight]{image.jpg}
}%
}
And add to your yaml:
---
output:
pdf_document:
includes:
in_header: header.tex
---
See the background
documentation for tips on how to customize the output.