How can I use latex packages in R markdown beamer?

ilker_arslan picture ilker_arslan · Dec 16, 2014 · Viewed 11.8k times · Source

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.

Answer

Waldir Leoncio picture Waldir Leoncio · Jun 2, 2015

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}
---