@@ -1,4 +1,7 @@
11\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(papersize)$$papersize$paper,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
2+$if(beamerarticle)$
3+\usepackage{beamerarticle} % needs to be loaded first
4+$endif$
25$if(fontfamily)$
36\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
47$else$
@@ -24,6 +27,9 @@ $endif$
2427 \usepackage{fontspec}
2528 \fi
2629 \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
30+$for(fontfamilies)$
31+ \newfontfamily{$fontfamilies.name$}[$fontfamilies.options$]{$fontfamilies.font$}
32+$endfor$
2733$if(euro)$
2834 \newcommand{\euro}{€}
2935$endif$
@@ -48,18 +54,18 @@ $endif$
4854\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
4955% use microtype if available
5056\IfFileExists{microtype.sty}{%
51−\usepackage{microtype}
57+\usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype}
5258\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
5359}{}
5460$if(geometry)$
5561\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
5662$endif$
5763\PassOptionsToPackage{hyphens}{url} % url is loaded by hyperref
58−\usepackage{hyperref}
64+\usepackage[unicode=true]{hyperref}
5965$if(colorlinks)$
6066\PassOptionsToPackage{usenames,dvipsnames}{color} % color is loaded by hyperref
6167$endif$
62−\hypersetup{unicode=true,
68+\hypersetup{
6369$if(title-meta)$
6470 pdftitle={$title-meta$},
6571$endif$
@@ -67,7 +73,7 @@ $if(author-meta)$
6773 pdfauthor={$author-meta$},
6874$endif$
6975$if(keywords)$
70− pdfkeywords={$for(keywords)$$keywords$$sep$; $endfor$},
76+ pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$},
7177$endif$
7278$if(colorlinks)$
7379 colorlinks=true,
@@ -98,8 +104,7 @@ $if(natbib)$
98104\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
99105$endif$
100106$if(biblatex)$
101−\usepackage$if(biblio-style)$[style=$biblio-style$]$endif${biblatex}
102−$if(biblatexoptions)$\ExecuteBibliographyOptions{$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$}$endif$
107+\usepackage[$if(biblio-style)$style=$biblio-style$,$endif$$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex}
103108$for(bibliography)$
104109\addbibresource{$bibliography$}
105110$endfor$
@@ -119,6 +124,8 @@ $if(verbatim-in-note)$
119124$endif$
120125$if(tables)$
121126\usepackage{longtable,booktabs}
127+% Fix footnotes in tables (requires footnote package)
128+\IfFileExists{footnote.sty}{\usepackage{footnote}\makesavenoteenv{long table}}{}
122129$endif$
123130$if(graphics)$
124131\usepackage{graphicx,grffile}
@@ -153,7 +160,7 @@ $endif$
153160\providecommand{\tightlist}{%
154161 \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
155162$if(numbersections)$
156−\setcounter{secnumdepth}{5}
163+\setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$}
157164$else$
158165\setcounter{secnumdepth}{0}
159166$endif$
@@ -186,6 +193,12 @@ $if(dir)$
186193 \newenvironment{LTR}{\beginL}{\endL}
187194\fi
188195$endif$
196+
197+% set default figure placement to htbp
198+\makeatletter
199+\def\fps@figure{htbp}
200+\makeatother
201+
189202$for(header-includes)$
190203$header-includes$
191204$endfor$
@@ -201,6 +214,7 @@ $if(author)$
201214\author{$for(author)$$author$$sep$ \and $endfor$}
202215$endif$
203216$if(institute)$
217+\providecommand{\institute}[1]{}
204218\institute{$for(institute)$$institute$$sep$ \and $endfor$}
205219$endif$
206220\date{$date$}