是否可以将背景图像添加到R Markdown(.rmd)文件以进行PDF输出?
我已经通过Pandoc的R Markdown文档进行了搜索,但是没有找到添加背景图像的提及.
从这个tex.SE答案:保存以下内容header.tex(将image.jpg替换为背景图像的路径):
\usepackage{background}
\backgroundsetup{
scale=1,
color=black,
opacity=0.4,
angle=0,
pages=all,
contents={%
\includegraphics[width=\paperwidth,height=\paperheight]{image.jpg}
}%
}
Run Code Online (Sandbox Code Playgroud)
并添加到您的yaml:
---
output:
pdf_document:
includes:
in_header: header.tex
---
Run Code Online (Sandbox Code Playgroud)
有关如何自定义输出的提示,请参阅background文档.
| 归档时间: |
|
| 查看次数: |
1846 次 |
| 最近记录: |