How can I use latex packages in R markdown beamer?

北城余情 提交于 2019-12-01 15:01:02

问题


I want to include latex packages in R markdown pdf and beamer.

Could you help me in including usepackage command in rmarkdown beamer file?

Thanks a lot.


回答1:


A simple solution would be to have your header setup like this:

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



回答2:


The YAML header of the Rmd would look like:

---
title: "Habits"
output:
  pdf_document:
    includes:
      in_header: header.tex
---

Then, in the file header.tex, include any usepackage statements you need, eg. \usepackage{pdflscape}

See http://rmarkdown.rstudio.com/pdf_document_format.html for more information.



来源:https://stackoverflow.com/questions/27514610/how-can-i-use-latex-packages-in-r-markdown-beamer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!