R markdown presentations with output format beamer
can make use of
template.tex
in_header: preamble.tex
, before_body: before_body.tex
and after_body: after_body.tex
which can be implemented in the rmarkdown::beamer_presentation
through the YAML-header as follows:
theme: "THEMENAME"
template: template.tex
includes:
- in_header: preamble.tex
- before_body: before_body.tex
- after_body: after_body.tex
What are the specific purposes of these files? That is, what contents should go in each of these files, how do they add or modify the final presentation, and which of the files are equivalent and possibly redundant?
If I understand the rmarkdown lingo correctly, they use the term template for the instructions how the markdown document will be translated into tex, eg the default beamer_presentation template for example defines how information from your yaml-header is used in the tex document, eg that whatever you put down for title will be translated into \title{...}
. It also contains a hole kitchen sink of packages rmarkdown loads by default, many of which make no sense with beamer.
the include hooks offer possibilities to smuggle additional latex code into your document. The difference between the different options is where they will be executed in the intermediate tex document. For example in_header
will be included at the end of the preamble. Which of them to use will depend on what you want to add. For most things in_header
will be fine.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.