working directory
|--- reports
|----| my_report.Rmd
|--- www
|----| image.png
因此,Rmarkdown文件的标头如下所示:
output:
beamer_presentation:
keep_tex: true
includes:
in_header: header.txt
header-includes:
- \titlegraphic{\includegraphics[width=0.3\paperwidth]{`r paste0("dirname(getwd()),"image.png")`}}
标题包含的内容似乎被覆盖
下面的文件中给出了一个示例,在检查生成的.tex文件时,我发现
\usepackage{fancyhdr}
在标题中,但没有提到“\ titlegraphic”表达式。
标题.txt
\usepackage{fancyhdr}
示例:Rmd
title: Example 1
output:
beamer_presentation:
keep_tex: true
includes:
in_header: header.txt
header-includes:
\titlegraphic{\includegraphics[width=0.3\paperwidth]{`r paste0("just_an_example_","logo.png")`}}
---
### This is a test