Permalink
Newer
100644
524 lines (516 sloc)
13 KB
2
\PassOptionsToPackage{unicode$for(hyperrefoptions)$,$hyperrefoptions$$endfor$}{hyperref}
3
\PassOptionsToPackage{hyphens}{url}
4
$if(colorlinks)$
5
\PassOptionsToPackage{dvipsnames,svgnames*,x11names*}{xcolor}
15
%
16
\documentclass[
17
$if(fontsize)$
18
$fontsize$,
19
$endif$
20
$if(lang)$
21
$babel-lang$,
22
$endif$
23
$if(papersize)$
24
$papersize$paper,
25
$endif$
26
$if(beamer)$
27
ignorenonframetext,
28
$if(handout)$
29
handout,
30
$endif$
31
$if(aspectratio)$
32
aspectratio=$aspectratio$,
33
$endif$
34
$endif$
35
$for(classoption)$
36
$classoption$$sep$,
37
$endfor$
38
]{$documentclass$}
46
\setbeamertemplate{caption}[numbered]
47
\setbeamertemplate{caption label separator}{: }
48
\setbeamercolor{caption name}{fg=normal text.fg}
49
\beamertemplatenavigationsymbols$if(navigation)$$navigation$$else$empty$endif$
54
\widowpenalties 1 10000
55
\raggedbottom
56
$if(section-titles)$
57
\setbeamertemplate{part page}{
58
\centering
59
\begin{beamercolorbox}[sep=16pt,center]{part title}
60
\usebeamerfont{part title}\insertpart\par
61
\end{beamercolorbox}
64
\centering
65
\begin{beamercolorbox}[sep=12pt,center]{part title}
66
\usebeamerfont{section title}\insertsection\par
67
\end{beamercolorbox}
70
\centering
71
\begin{beamercolorbox}[sep=8pt,center]{part title}
72
\usebeamerfont{subsection title}\insertsubsection\par
73
\end{beamercolorbox}
74
}
75
\AtBeginPart{
76
\frame{\partpage}
77
}
78
\AtBeginSection{
79
\ifbibliography
80
\else
81
\frame{\sectionpage}
82
\fi
83
}
84
\AtBeginSubsection{
85
\frame{\subsectionpage}
86
}
87
$endif$
88
$endif$
89
$if(beamerarticle)$
90
\usepackage{beamerarticle} % needs to be loaded first
91
$endif$
93
$if(fontfamily)$
94
\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
95
$else$
96
\usepackage{lmodern}
97
$endif$
98
$if(linestretch)$
99
\usepackage{setspace}
100
$endif$
101
\usepackage{ifxetex,ifluatex}
102
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
103
\usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}
104
\usepackage[utf8]{inputenc}
105
\usepackage{textcomp} % provide euro and other symbols
106
\else % if luatex or xetex
107
$if(mathspec)$
108
\ifxetex
109
\usepackage{mathspec}
110
\else
111
\usepackage{unicode-math}
112
\fi
113
$else$
114
\usepackage{unicode-math}
115
$endif$
116
\defaultfontfeatures{Scale=MatchLowercase}
117
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
127
$for(fontfamilies)$
128
\newfontfamily{$fontfamilies.name$}[$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$]{$fontfamilies.font$}
129
$endfor$
130
$if(mathfont)$
131
$if(mathspec)$
132
\ifxetex
133
\setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
134
\else
135
\setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
136
\fi
137
$else$
138
\setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
139
$endif$
140
$endif$
141
$if(CJKmainfont)$
142
\ifxetex
144
\setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
145
\fi
146
$endif$
147
$if(luatexjapresetoptions)$
148
\ifluatex
149
\usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset}
150
\fi
151
$endif$
152
$if(CJKmainfont)$
153
\ifluatex
154
\usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec}
155
\setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
156
\fi
157
$endif$
158
\fi
159
$if(beamer)$
160
$if(theme)$
161
\usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$}
162
$endif$
163
$if(colortheme)$
164
\usecolortheme{$colortheme$}
165
$endif$
166
$if(fonttheme)$
167
\usefonttheme{$fonttheme$}
168
$endif$
169
$if(mainfont)$
170
\usefonttheme{serif} % use mainfont rather than sansfont for slide text
171
$endif$
172
$if(innertheme)$
173
\useinnertheme{$innertheme$}
174
$endif$
175
$if(outertheme)$
176
\useoutertheme{$outertheme$}
177
$endif$
178
$endif$
181
\IfFileExists{microtype.sty}{% use microtype if available
182
\usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype}
183
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
187
\makeatletter
188
\@ifundefined{KOMAClassName}{% if non-KOMA class
189
\IfFileExists{parskip.sty}{%
190
\usepackage{parskip}
191
}{% else
192
\setlength{\parindent}{0pt}
193
\setlength{\parskip}{6pt plus 2pt minus 1pt}}
194
}{% if KOMA class
195
\KOMAoptions{parskip=half}}
196
\makeatother
197
$endif$
198
$if(verbatim-in-note)$
199
\usepackage{fancyvrb}
200
$endif$
201
\usepackage{xcolor}
202
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
203
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
221
colorlinks=true,
222
linkcolor=$if(linkcolor)$$linkcolor$$else$Maroon$endif$,
223
filecolor=$if(filecolor)$$filecolor$$else$Maroon$endif$,
224
citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$,
225
urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$,
241
$if(beamer)$
242
\newif\ifbibliography
243
$endif$
244
$if(listings)$
245
\usepackage{listings}
246
\newcommand{\passthrough}[1]{#1}
249
$endif$
250
$if(lhs)$
251
\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
252
$endif$
253
$if(highlighting-macros)$
254
$highlighting-macros$
255
$endif$
256
$if(tables)$
265
\makeatletter
266
\def\fnum@table{\tablename~\thetable}
267
\makeatother
268
$else$
269
% Correct order of tables after \paragraph or \subparagraph
270
\usepackage{etoolbox}
271
\makeatletter
272
\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
273
\makeatother
274
% Allow footnotes in longtable head/foot
275
\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
276
\makesavenoteenv{longtable}
281
\makeatletter
282
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
283
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
284
\makeatother
285
% Scale images if necessary, so that they will not overflow the page
286
% margins by default, and it is still possible to overwrite the defaults
287
% using explicit options in \includegraphics[width, height, ...]{}
288
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
289
% Set default figure placement to htbp
290
\makeatletter
291
\def\fps@figure{htbp}
292
\makeatother
293
$endif$
294
$if(links-as-notes)$
295
% Make links footnotes instead of hotlinks:
296
\DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}}
297
$endif$
298
$if(strikeout)$
299
\usepackage[normalem]{ulem}
304
\providecommand{\tightlist}{%
305
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
306
$if(numbersections)$
307
\setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$}
308
$else$
316
\let\oldparagraph\paragraph
317
\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
320
\let\oldsubparagraph\subparagraph
321
\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
322
\fi
323
$endif$
324
$endif$
325
$if(pagestyle)$
326
\pagestyle{$pagestyle$}
327
$endif$
328
$for(header-includes)$
329
$header-includes$
330
$endfor$
331
$if(lang)$
332
\ifxetex
333
% Load polyglossia as late as possible: uses bidi with RTL langages (e.g. Hebrew, Arabic)
335
\setmainlanguage[$for(polyglossia-lang.options)$$polyglossia-lang.options$$sep$,$endfor$]{$polyglossia-lang.name$}
337
\setotherlanguage[$for(polyglossia-otherlangs.options)$$polyglossia-otherlangs.options$$sep$,$endfor$]{$polyglossia-otherlangs.name$}
340
\usepackage[$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
341
% get rid of language-specific shorthands (see #6817):
342
\let\LanguageShortHands\languageshorthands
343
\def\languageshorthands#1{}
355
\usepackage{bidi}
356
\fi
357
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
358
\TeXXeTstate=1
359
\newcommand{\RL}[1]{\beginR #1\endR}
360
\newcommand{\LR}[1]{\beginL #1\endL}
361
\newenvironment{RTL}{\beginR}{\endR}
362
\newenvironment{LTR}{\beginL}{\endL}
363
\fi
364
$endif$
365
$if(natbib)$
366
\usepackage[$natbiboptions$]{natbib}
367
\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
368
$endif$
369
$if(biblatex)$
370
\usepackage[$if(biblio-style)$style=$biblio-style$,$endif$$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex}
371
$for(bibliography)$
372
\addbibresource{$bibliography$}
373
$endfor$
374
$endif$
375
$if(csl-refs)$
376
\newlength{\cslhangindent}
377
\setlength{\cslhangindent}{1.5em}
381
{% don't indent paragraphs
382
\setlength{\parindent}{0pt}
383
% turn on hanging indent if param 1 is 1
384
\ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi
385
% set entry spacing
386
\ifnum #2 > 0
400
401
$if(title)$
402
\title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
403
$endif$
404
$if(subtitle)$
405
$if(beamer)$
406
$else$
407
\usepackage{etoolbox}
408
\makeatletter
409
\providecommand{\subtitle}[1]{% add subtitle to \maketitle
410
\apptocmd{\@title}{\par {\large #1 \par}}{}{}
411
}
412
\makeatother
413
$endif$
414
\subtitle{$subtitle$}
415
$endif$
416
\author{$for(author)$$author$$sep$ \and $endfor$}
419
$if(institute)$
420
\institute{$for(institute)$$institute$$sep$ \and $endfor$}
421
$endif$
422
$if(titlegraphic)$
423
\titlegraphic{\includegraphics{$titlegraphic$}}
424
$endif$
425
$if(logo)$
426
\logo{\includegraphics{$logo$}}
427
$endif$
428
$endif$
429
430
\begin{document}
435
$if(beamer)$
436
\frame{\titlepage}
437
$else$
438
\maketitle
439
$endif$
440
$if(abstract)$
441
\begin{abstract}
442
$abstract$
443
\end{abstract}
444
$endif$
445
$endif$
446
447
$for(include-before)$
448
$include-before$
449
450
$endfor$
451
$if(toc)$
461
\end{frame}
462
$else$
463
{
464
$if(colorlinks)$
465
\hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$$endif$}
466
$endif$
467
\setcounter{tocdepth}{$toc-depth$}
468
\tableofcontents
469
}
470
$endif$
471
$endif$
472
$if(lot)$
473
\listoftables
474
$endif$
475
$if(lof)$
476
\listoffigures
477
$endif$
493
\renewcommand\bibname{$biblio-title$}
494
$else$
495
\renewcommand\refname{$biblio-title$}
496
$endif$
497
$endif$
498
$if(beamer)$
499
\begin{frame}[allowframebreaks]{$biblio-title$}
503
$if(beamer)$
504
\end{frame}
505
$endif$
506
507
$endif$
508
$endif$
509
$if(biblatex)$
510
$if(beamer)$
511
\begin{frame}[allowframebreaks]{$biblio-title$}