在Rmarkdown中修改乳胶模板

时间:2019-07-03 20:09:14

标签: latex r-markdown beamer

我可以修改Rmarkdown使用的默认Latex模板,以使用Beamer类将Rmd文件编译为pdf吗? 由于使用\includepdf(来自 pdfpages 包)遇到的困难,我问。检查生成的tex源表明,根本问题是\documentclass[ignorenonframetext,]{beamer}中的 ignorenonframetext 选项。 (对于我来说,每次手动更改tex来源都不可行)

简而言之:我想修改“ Rmd Beamer Latex模板”(如果存在)以更改默认的 ignorenonframetext

1 个答案:

答案 0 :(得分:0)

您无需修改​​模板,可以像这样使用\includepdf

---
output: 
  beamer_presentation:
    keep_tex: true
header-includes:
  - \usepackage{pdfpages}
  - \setbeamercolor{background canvas}{bg=}
  - \makeatletter\beamer@ignorenonframefalse\makeatother
---

test

``` {=latex}
\end{frame}
\includepdf[pages=1-10]{example-image-duck}
\begin{frame}
```

test
相关问题