如何在R markdown beamer中使用latex包?

11

我希望在R Markdown PDF和Beamer中包含LaTeX包。

请问可以帮我将usepackage命令包含在rmarkdown beamer文件中吗?

非常感谢。

2个回答

18

一个简单的解决方案是将您的标题设置为以下内容:

---
title: "Document title"
author: "Author's name"
date: "Document date"
output: beamer_presentation
header-includes:
- \usepackage[brazil]{babel}
- \usepackage{graphicx}
- \usepackage[a4paper]{geometry}
---

8
Rmd的YAML头应该如下所示:
---
title: "Habits"
output:
  pdf_document:
    includes:
      in_header: header.tex
---

接下来,在文件头部header.tex中,包含任何你需要的usepackage语句,例如:\usepackage{pdflscape}

更多信息请查看http://rmarkdown.rstudio.com/pdf_document_format.html


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接