This is a custom pandoc beamer template for the SG presentation style. Included is also a sample Rmarkdown presentation highlithing basic usage.
Pandoc is basically a tool to convert files from one markup to another. For more information refer to the official documentation
In our case the .Rmd file, which is in the RMarkdown format, is converted to a latex file by pandoc. The latter is then compiled to a pdf via pdflatex. Hence, the execution workflow is RMarkdown >> pandoc >> latex >> pdf
- test-presentation.Rmd - the most important part of the presentation is its YAML header (this is the header enclosed by — lines in the very beginning of the file).
The header gets processed by pandoc following the rules defined in SG_ETHclass.tex.
It is trivial to add new header keywords, e.g. custom shading colors - just ensure that the corresponding logic to handle them exists in SG_ETHclass.tex
For example the header keyword
title: My titlegets matched by the ruleif($title) \title{$title$}$endif$. The end result is that the\titlecommand will be written into the latex output with an argument corresponding to the supplied value in the .Rmd source. - SG_ETHclass.tex contains the custom template.
It reads the class definitions from the YAML header in the .Rmd source and translates them into appropriate latex commands.
The template file can contain raw latex, which will simply be written as it is or pandoc rules that match the YAML header.
Note that including keywords into the YAML header for which no rules exist in the template is ok (the keywords will simply be ignored).
You can modify the template as you wish, either by adding more raw latex or by defining new rules. In general, it is a good practice to define rules for entitities that change with each presentation, e.g. title, author, etc., and to fix raw latex code otherwise.
- notefilter.py - This is a custom Python filter that enables note and column environments in RMarkdown.
To insert a note page in your presentation, use the following markdown syntax:
[beginnote]
The following list is part of a note page
- This is item one
- This is item two
[endnote]Note that
[beginnote]and[endnote]should be separated by one empty line from the contents of the note pageSimilarly to create a slide with two columns:
[begincolumns]
[column=0.5]
Some text in the first column
[column=0.5]
More text in the second column
[endcolumns]
Again, the keywords enclosed by
[]brackets should be separated by one line from the content.
Save the custom template SG_ETHclass.tex and the python filter notefilter.py in a directory of your choice, preferrably in /usr/share/texmf/tex/latex/sg-ethbeamer/.
Make sure to enter the full path to this template in the YAML header of test-presentation.Rmd. The location of test-presentation.Rmd itself is irrelevant.