-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrmd_header_images.Rmd
33 lines (22 loc) · 985 Bytes
/
rmd_header_images.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
output:
pdf_document:
keep_tex: true
includes:
in_header: header.tex
---
To create a pdf with header from Rmarkdown, you need two things, the correct YAML header and a header.tex file.
Your YAML header should contain the follow at minimum:
output:
pdf_document:
includes:
in_header: header.tex
Each line is indented by two spaces. Another trick: Since Rmarkdown doesn't support indentation (adding spaces at the beginning of a line doesn't do anything), use ' ' to create spaces.
The header.tex file identifies, positions, and sizes the images within the header:
```{r engine='bash', echo=FALSE}
cat header.tex
```
### This is a section
What does the .tex file look like?
\subsection{Section 2}\label{Section 2}
This is a section created with latex. Use \\subsection{name}\\label{name}. Useful for adding sections around plots and tables generated inside of a chunk.