How can I use latex packages in R markdown beamer?
Asked Answered
O

2

11

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.

Outlaw answered 16/12, 2014 at 21:52 Comment(0)
H
18

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}
---
Hehre answered 2/6, 2015 at 18:41 Comment(0)
I
8

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.

Infanticide answered 15/1, 2015 at 17:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.