Latest version and bugreports on Github: https://github.com/exporl/kuleuven-templates/
This repository contains R/Markdown, Markdown and LaTeX templates for presentations and posters according to the KU Leuven Corporate Design. Next to the actual templates, a build system based on R, Pandoc, TeX Live and GNU Make is provided.
Examples:
- Presentation with R figures: presentation-r-example.pdf
- Presentation: presentation-example.pdf
- Poster with R figures: poster-r-example.pdf
- Poster: poster-example.pdf
- Paper with R figures: paper-r-example.pdf
Comments, bug reports and pull requests welcome!
- R/Markdown, plain Markdown or LaTeX
- Linux
- Windows
- Using the R/Markdown, plain Markdown and LaTeX templates in RStudio
- Using the LaTeX templates in Texmaker
- Online editors
- New Pandoc variables
- New Markdown commands
The templates are available in three versions.
If you care about the reproducibility of your research, and want to be able to
analyze your data and generate your figures in the same place where you write
your text, R/Markdown should fit the bill quite nicely.
If you are using RStudio, you can just click the Knit
button to compile your R/Markdown document.
- R/Markdown presentation: Rmd → markdown → tex → pdf, handouts, Powerpoint
- R/Markdown poster: Rmd → markdown → tex → pdf
- R/Markdown paper: Rmd → markdown → tex → pdf
If you need something that is a easier on the eyes than LaTeX and allows very easy customization of the templates, but don't want to go the full way to R/Markdown, take a look at the plain Markdown examples:
- Markdown presentation: markdown → tex → pdf, handouts, Powerpoint
- Markdown poster: markdown → tex → pdf
If you are already experienced in LaTeX, and you don't want to bother with all that fancy new R/Markdown stuff, you can start with the LaTeX templates:
The easiest way to use the templates in Linux is with the included Makefile, although it is also possible to directly call Rmarkdown, Pandoc or LaTeX.
To get started, install dependencies (for an Ubuntu 14.04LTS system, other distros should be very similar):
To use the included build system based on GNU Make:
sudo apt-get install make
For the LaTeX templates:
sudo apt-get install texlive texlive-latex-recommended texlive-science texlive-bibtex-extra imagemagick
To be able to create backup versions of posters (A4) and presentations (Powerpoint):
sudo apt-get install ghostscript posterazor libreoffice
For the plain Markdown templates:
sudo apt-get install pandoc python-pandocfilters
If you use ubuntu 14.04 or older, you need to install the python-pandocfilters package manually from a next release (http://packages.ubuntu.com/search?keywords=python-pandocfilters), e.g.:
wget http://de.archive.ubuntu.com/ubuntu/pool/universe/p/python-pandocfilters/python-pandocfilters_1.2.2-1_all.deb
dpkg -i python-pandocfilters*.deb
To use R/Markdown:
sudo apt-get install r-base-dev r-recommended
You can clone the templates without history with
git clone --depth=1 https://github.com/exporl/kuleuven-templates && rm -rf kuleuven-templates/.git*
The included build system automatically transforms R/Markdown → plain Markdown → LaTeX → PDF. Building happens in a temporary directory under /tmp. Any eps/tikz files placed in the root and figures/ directories are automatically converted to pdf files there.
You can slightly configure the build system by copying the included Makefile.local-example to Makefile.local.
BUILDDIR=.build
: Use a local build dirBIBSOURCE=$(HOME)/path/to/mendeley.bib
: Define a bib source to automatically copy the reference database on changesCOPYPDF=no
: Leave the pdf file in the temp directory and don't copy it to the source directoryLATEX=lualatex
: Use lualatex instead of pdflatex
Several Make targets are available:
make
,make all
,make pdflatex
: callmake pdflatex-<basename>
for all .Rmd, .markdown and .tex found in the current directorymake pdfview
,make clean
,make ondemand
: similar as above, for for thepdfview-<basename>
,clean-<basename>
andondemand-<basename>
targetsmake <basename>.markdown
: convert an R/Markdown file to plain Markdown by evaluating any embedded R code with knitrmake <basename>.tex
: convert a plain Markdown file to LaTeX with Pandoc; any lines in the Markdown file that start with%%
are transformed into options for Pandocpdflatex-<basename>
: convert an R/Markdown, plain Markdown or LaTeX file to PDF by calling pdflatex and bibtex in addition to the appropriate steps above; you might need to call this multiple times to get all references and bib entries resolved correctlyondemand-<basename>
: watch for changes to any R/Markdown, plain Markdown or LaTeX files in the current directory and callmake pdflatex-<basename>
on themhandouts-<basename>
: create a LaTeX/Beamer handout version of a presentation, check below for how to configure which figures of animations to includeppt-<basename>
: create a PowerPoint version of your presentation by creating images for each slide and combining them with LibreOfficea4version-<basename>
: create a backup A4 version of your poster in case you forget that poster tube on the plane again with PosteRazor
While it is possible to use Cygwin to get the Linux setup above working quite well, this is not covered here as most people on Windows do not have experience in a Unix environment.
There is an automatic installer available in the windows-installer directory. Make sure to run it as administrator and to restart your session afterwards. You might need to change some of the download locations if newer versions of the dependencies have been released.
You can also manually download them:
- Install a LaTeX distribution, e.g. MiKTeX
- Install Texmaker
- Install R
- Install RStudio
- Install Python 2
- Install Python filter support for Pandoc:
on a Windows command prompt, type
pip install pandocfilters
- Install Git
- Install SumatraPDF for auto-refresh of PDF previews
Afterwards, add the Python directory to the system PATH variable.
Before you start, switch the default document encoding to UTF-8 with Tools
→ Global Options
→ General
→ Default Text Encoding
→ UTF-8
.
Now you can compile any R/Markdown (Knit
), plain Markdown (Preview
), or LaTeX (Compile PDF
) file with a click on the corresponding toolbar button.
If you create a new project in the upper-right corner, you can use Git version control to keep track of your changes.
Open a LaTeX file, and you are good to go.
An older version of the templates can be found on ShareLaTeX.
sectiontoc
: table of contents before each sectionsubsectiontoc
: table of contents before each subsectionmulticolstoc
: two-column layout of table of contentssectiontitle
: show the slide title and current sectionsubsectiontitle
: show the slide title and current section + subsectiongridcanvas
: centimeter grid in the background
Various new Markdown commands (mostly of the form [command=param]
) are
provided by the Pandoc filters found in templates/*-filters.py
.
Most of them need to be put in their own paragraph only consisting of the
command itself.
-
![*<anim>{option}caption]({options}figure,{options}figure...)
: figures*
: starred figure environment (normally spans 2 columns)<anim>
: beamer animation specification: slide to show the figure, starting from 1, if you don't want a figure to appear in the handouts specify slide 0 for handouts with something like<2|handout:0>
<option>
: LaTeX figure options, use the shortcutsh
(horizontal fill),v
(vertical fill),f
(fill) ands
(slide fill) to do the Right Thing
If multiple animation/option settings are defined next to the caption, they get spread across the figures. Paragraphs that only consist of figures with the same caption get collapsed into one float.
Examples:
![](figure)
: basic figure, no float![{h}](figure)
: basic figure, no float, scaled to fit slide width![caption](figure)
: basic figure, put into a float![*caption](figure)
: basic figure, put into a column-spanning float![{options}caption](figure)
: basic figure in float, custom options![{options}caption](figure1,figure2)
: two figures in one float, custom options for all![{options1}{options2}caption](figure1,figure2)
: two figures in one float, custom options per figure![caption]({options1}figure1,{options2}figure2)
: two figures in one float, custom options per figure![<1><2>caption](figure1,figure2)
: two figures in one float, with animation![<1><2>caption](figure1)![<1><2>caption](figure2)
: two figures with same caption in one paragraph get collapsed into one float
##### header5
: draft paragraph heading shown as margin note##### *header5
: draft paragraph heading not shown anywhere[ipe]
: start a new in-paragraph enumeration, use \item for the individual items[/ipe]
: end an in-paragraph enumeration
# header1
: start a new section## header1
: start a new subjection### header3
: start a new slide[columns=...]
: start a new column set with the given number of columns[column]
: start a new column with equal width[column=...]
: start a new column with given fraction of the line width[/columns]
: end a column set
The following commands need to be at the end of a frame.
[notoc]
: no table of contents before sections/subsections (default)[sectiontoc]
: table of contents before each section[subsectiontoc]
: table of contents before each subsection[largefooter]
: large footer with KU Leuven logo (default)[emptyfooter]
: large footer with KU Leuven logo, but no page number[smallfooter]
: transparent footer with just a page number[nofooter]
: empty footer (no page number)[nosupertitle]
: show only the slide title (default)[sectiontitle]
: show the slide title and current section[subsectiontitle]
: show the slide title and current section + subsection[plaincanvas]
: empty background (default)[gridcanvas]
: centimeter grid in the background[includeslides=file.pdf]
: include fullpage slides from pdf file. Uses \includepdf from pdfpages.
# header1
: start a new block## header1
: ignored for compatibility with the presentation template### header3
: start a new structural section (\structure)[columns=...]
: start a new column set with the given number of columns[column]
: start a new column with equal width[column=...]
: start a new column with given fraction of the line width[/columns]
: end a column set[ipe]
: start a new in-paragraph enumeration, use \item for the individual items[/ipe]
: end an in-paragraph enumeration
- example sound file
- restore tikz helpers