1 % This template only works with luatex or XeTeX if you use non-ASCII
4 \documentclass[$if(fontsize)$$fontsize$,$endif$
%
5 $if(lang)$$lang$,$endif$
%
8 \usepackage{ifxetex,ifluatex
}
9 \usepackage[T1]{fontenc}
11 \usepackage{libertine
}
13 % Libertine Mono is too ugly; we use lmodern instead
14 \renewcommand{\ttfamily}{\fontfamily{lmtt
}\selectfont}
16 \setkomafont{sectioning
}{\normalfont\bfseries}
17 \setkomafont{descriptionlabel
}{\normalfont}
18 \setkomafont{caption
}{\normalfont\small}
20 $if(highlighting-macros)$
24 $if(verbatim-in-note)$
29 % Redefine labelwidth for lists; otherwise, the enumerate package will cause
30 % markers to extend beyond the left margin.
34 \renewcommand{\@listi
}
35 {\setlength{\labelwidth}{4em
}}%
40 \usepackage{enumerate
}
44 % We use a patched version of longtable until a serious clash with
46 \usepackage{longtable-patched
}
49 % pandoc inserts \addlinespace after each line...
52 % XXX The \addlinespace macro, as used in the LaTeX code generated by
53 % pandoc, overrides any vertical space adjustments for \toprule and friends,
54 % which is quite unfortunate. I consider this a bug in pandoc 1.12.2.1.
55 % It's not too difficult to fix this, but I had to redefine a lot of
56 % booktabs commands, which I don't want. Since the layout degradation is
57 % minor, I simply wait until it gets fixed in pandoc.
70 % We will generate all images so they have a width 0.6\maxwidth. This means
71 % that they will get their normal width if they fit onto the page, but are
72 % scaled down if they would overflow this limit.
76 \ifdim\Gin@nat@width>
\linewidth
84 \let\Oldincludegraphics\includegraphics
85 \renewcommand{\includegraphics}[1]{%
86 \Oldincludegraphics[width=
0.6\maxwidth]{#1}}
90 \usepackage[setpagesize=false,
% page size defined by xetex
91 unicode=false,
% unicode breaks when used with xetex
94 linkcolor=blue
]{hyperref
}
96 \usepackage[unicode=true,
98 linkcolor=blue
]{hyperref
}
99 \usepackage{microtype
}
101 \hypersetup{breaklinks=true,
102 pdfauthor=
{$author-meta$
},
103 pdftitle=
{$title-meta$
},
106 % We want the names `section 2', `subsection 4.1', and the like in local
107 % links, omitting the original link text. To do that, we redefine
113 % \hyperref[foo]{bar}
117 % bar (\autoref{foo})
119 \def\label@hyperref
[#1]#2{%
125 \newcommand{\textsubscr}[1]{%
126 \ensuremath{_
{\scriptsize\textrm{#1}}}}
129 \setlength{\parindent}{0pt
}
130 \setlength{\parskip}{6pt plus
2pt minus
1pt
}
131 \setlength{\emergencystretch}{3em
} % prevent overfull lines
133 % We want a break after the description label (if there is one).
136 \let\original@item\@item
137 \def\description@item
[#1]{%
151 \addpenalty\@beginparpenalty
153 \addvspace{-
\parskip}%
156 \addpenalty\@itempenalty
163 \global\@newlistfalse
165 \global\@inlabelfalse
177 \clubpenalty \@clubpenalty
183 \refstepcounter\@listctr
186 \sbox\@tempboxa
{\makelabel{#1}}%
187 \global\setbox\@labels
\hbox{%
192 \ifdim \wd\@tempboxa >
\labelwidth
195 \hbox to
\labelwidth {\unhbox\@tempboxa
}%
199 \def\reserved@b
{\@itemlabel
}%
200 \ifx\reserved@a
\reserved@b
206 \renewenvironment{description
}{%
207 \list{}{\labelwidth\z@
\itemindent-
\leftmargin
208 \let\makelabel\descriptionlabel
209 \let\@item
\description@item
}%
211 \let\@item
\original@item
217 % we want block quotes formatted as italic
218 \renewenvironment{quote
}{%
219 \list{}{\rightmargin\leftmargin}%
229 \setcounter{secnumdepth
}{5}
231 \setcounter{secnumdepth
}{0}
234 $if(verbatim-in-note)$
235 \VerbatimFootnotes % allows verbatim text in footnotes
240 \usepackage{polyglossia
}
241 \setmainlanguage{$mainlang$
}
243 \usepackage[$lang$
]{babel
}
247 $for(header-includes)$
254 \author{$for(author)$$author$$sep$
\and $endfor$
}
256 \date{Version $version$
}
264 $for(include-before)$