1 \documentclass[$if(fontsize)$$fontsize$,$endif$
%
2 $if(lang)$$lang$,$endif$
%
5 \usepackage{ifxetex,ifluatex
}
6 \usepackage[T1]{fontenc}
7 \usepackage[utf8
]{inputenc}
11 % Libertine Mono is too ugly...
12 \renewcommand{\ttfamily}{\fontfamily{cmtt
}\selectfont}
14 \setkomafont{sectioning
}{\normalfont\bfseries}
15 \setkomafont{descriptionlabel
}{\normalfont}
16 \setkomafont{caption
}{\normalfont\small}
18 $if(highlighting-macros)$
22 $if(verbatim-in-note)$
27 % Redefine labelwidth for lists; otherwise, the enumerate package will cause
28 % markers to extend beyond the left margin.
32 \renewcommand{\@listi
}
33 {\setlength{\labelwidth}{4em
}}%
38 \usepackage{enumerate
}
43 \usepackage{float
} % provides the H option for float placement
45 % pandoc uses \medskip between table rows which looks ugly
47 doinside=
{\let\medskip\relax}}
57 % We will generate all images so they have a width 0.6\maxwidth. This means
58 % that they will get their normal width if they fit onto the page, but are
59 % scaled down if they would overflow this limit.
63 \ifdim\Gin@nat@width>
\linewidth
71 \let\Oldincludegraphics\includegraphics
72 \renewcommand{\includegraphics}[1]{%
73 \Oldincludegraphics[width=
0.6\maxwidth]{#1}}
77 \usepackage[setpagesize=false,
% page size defined by xetex
78 unicode=false,
% unicode breaks when used with xetex
81 linkcolor=blue
]{hyperref
}
83 \usepackage[unicode=true,
85 linkcolor=blue
]{hyperref
}
86 \usepackage{microtype
}
88 \hypersetup{breaklinks=true, pdfborder=
{0 0 0}}
90 % We want the names `section 2', `subsection 4.1', and the like in local
91 % links, omitting the original link text. To do that, we redefine \href.
94 \let\original@href
\href
96 % Here is the new \href wrapper. We check whether the first token is \#.
97 % If yes, we call \autoref, otherwise the original \href macro. \@nil is a
98 % delimiter token which we need, because we call the arguments in
99 % \modified@href without braces so that we can split off the first token.
101 \modified@href
#1\@nil
}
103 % Using \expandafter makes TeX finish the \if clause before one of the
104 % \almost@xxx macros picks up the arguments.
105 \def\modified@href
#1#2\@nil
{%
107 \expandafter\almost@autoref
109 \expandafter\almost@original@href
113 % We normalize \_ in the reference (argument #2), which we put into
114 % parentheses after the label (argument #3). Argument #1 holds \# which we
116 \def\almost@autoref
#1#2#3{%
117 #3 (
\hyper@normalise
\autoref{#2})
}
119 % For a non-local link, unify the split off first character with the
120 % remaining part of the link.
121 \def\almost@original@href
#1#2{%
122 \original@href
{#1#2}}
127 \newcommand{\textsubscr}[1]{%
128 \ensuremath{_
{\scriptsize\textrm{#1}}}}
131 \setlength{\parindent}{0pt
}
132 \setlength{\parskip}{6pt plus
2pt minus
1pt
}
133 \setlength{\emergencystretch}{3em
} % prevent overfull lines
135 % We want a break after the description label (if there is one).
138 \let\original@item\@item
139 \def\description@item
[#1]{%
153 \addpenalty\@beginparpenalty
155 \addvspace{-
\parskip}%
158 \addpenalty\@itempenalty
165 \global\@newlistfalse
167 \global\@inlabelfalse
179 \clubpenalty \@clubpenalty
185 \refstepcounter\@listctr
188 \sbox\@tempboxa
{\makelabel{#1}}%
189 \global\setbox\@labels
\hbox{%
194 \ifdim \wd\@tempboxa >
\labelwidth
197 \hbox to
\labelwidth {\unhbox\@tempboxa
}%
201 \def\reserved@b
{\@itemlabel
}%
202 \ifx\reserved@a
\reserved@b
208 \renewenvironment{description
}{%
209 \list{}{\labelwidth\z@
\itemindent-
\leftmargin
210 \let\makelabel\descriptionlabel
211 \let\@item
\description@item
}%
213 \let\@item
\original@item
219 % we want block quotes formatted as italic
220 \renewenvironment{quote
}{%
221 \list{}{\rightmargin\leftmargin}%
232 \setcounter{secnumdepth
}{0}
235 $if(verbatim-in-note)$
236 \VerbatimFootnotes % allows verbatim text in footnotes
241 \usepackage{polyglossia
}
242 \setmainlanguage{$mainlang$
}
244 \usepackage[$lang$
]{babel
}
248 $for(header-includes)$
255 \author{$for(author)$$author$$sep$
\and $endfor$
}
257 \date{Version $version$
}
265 $for(include-before)$