1 \documentclass[$if(fontsize)$$fontsize$,$endif$
%
2 $if(lang)$$lang$,$endif$
%
5 \usepackage{ifxetex,ifluatex
}
6 \usepackage[T1]{fontenc}
7 \usepackage[utf8
]{inputenc}
11 \setkomafont{sectioning
}{\normalfont\bfseries}
12 \setkomafont{descriptionlabel
}{\normalfont}
13 \setkomafont{caption
}{\normalfont\small}
15 $if(highlighting-macros)$
19 $if(verbatim-in-note)$
24 % Redefine labelwidth for lists; otherwise, the enumerate package will cause
25 % markers to extend beyond the left margin.
29 \renewcommand{\@listi
}
30 {\setlength{\labelwidth}{4em
}}%
35 \usepackage{enumerate
}
40 \usepackage{float
} % provides the H option for float placement
42 % pandoc uses \medskip between table rows which looks ugly
44 doinside=
{\let\medskip\relax}}
54 % We will generate all images so they have a width 0.6\maxwidth. This means
55 % that they will get their normal width if they fit onto the page, but are
56 % scaled down if they would overflow this limit.
60 \ifdim\Gin@nat@width>
\linewidth
68 \let\Oldincludegraphics\includegraphics
69 \renewcommand{\includegraphics}[1]{%
70 \Oldincludegraphics[width=
0.6\maxwidth]{#1}}
74 \usepackage[setpagesize=false,
% page size defined by xetex
75 unicode=false,
% unicode breaks when used with xetex
78 linkcolor=blue
]{hyperref
}
80 \usepackage[unicode=true,
82 linkcolor=blue
]{hyperref
}
83 \usepackage{microtype
}
85 \hypersetup{breaklinks=true, pdfborder=
{0 0 0}}
87 % We want the names `section 2', `subsection 4.1', and the like in local
88 % links, omitting the original link text. To do that, we redefine \href.
91 \let\original@href
\href
93 % Here is the new \href wrapper. We check whether the first token is \#.
94 % If yes, we call \autoref, otherwise the original \href macro. \@nil is a
95 % delimiter token which we need, because we call the arguments in
96 % \modified@href without braces so that we can split off the first token.
98 \modified@href
#1\@nil
}
100 % Using \expandafter makes TeX finish the \if clause before one of the
101 % \almost@xxx macros picks up the arguments.
102 \def\modified@href
#1#2\@nil
{%
104 \expandafter\almost@autoref
106 \expandafter\almost@original@href
110 % We normalize \_ in the reference (argument #2), which we put into
111 % parentheses after the label (argument #3). Argument #1 holds \# which we
113 \def\almost@autoref
#1#2#3{%
114 #3 (
\hyper@normalise
\autoref{#2})
}
116 % For a non-local link, unify the split off first character with the
117 % remaining part of the link.
118 \def\almost@original@href
#1#2{%
119 \original@href
{#1#2}}
124 \newcommand{\textsubscr}[1]{%
125 \ensuremath{_
{\scriptsize\textrm{#1}}}}
128 \setlength{\parindent}{0pt
}
129 \setlength{\parskip}{6pt plus
2pt minus
1pt
}
130 \setlength{\emergencystretch}{3em
} % prevent overfull lines
132 % We want a break after the description label (if there is one).
135 \let\original@item\@item
136 \def\description@item
[#1]{%
150 \addpenalty\@beginparpenalty
152 \addvspace{-
\parskip}%
155 \addpenalty\@itempenalty
162 \global\@newlistfalse
164 \global\@inlabelfalse
176 \clubpenalty \@clubpenalty
182 \refstepcounter\@listctr
185 \sbox\@tempboxa
{\makelabel{#1}}%
186 \global\setbox\@labels
\hbox{%
191 \ifdim \wd\@tempboxa >
\labelwidth
194 \hbox to
\labelwidth {\unhbox\@tempboxa
}%
198 \def\reserved@b
{\@itemlabel
}%
199 \ifx\reserved@a
\reserved@b
205 \renewenvironment{description
}{%
206 \list{}{\labelwidth\z@
\itemindent-
\leftmargin
207 \let\makelabel\descriptionlabel
208 \let\@item
\description@item
}%
210 \let\@item
\original@item
216 % we want block quotes formatted as italic
217 \renewenvironment{quote
}{%
218 \list{}{\rightmargin\leftmargin}%
229 \setcounter{secnumdepth
}{0}
232 $if(verbatim-in-note)$
233 \VerbatimFootnotes % allows verbatim text in footnotes
238 \usepackage{polyglossia
}
239 \setmainlanguage{$mainlang$
}
241 \usepackage[$lang$
]{babel
}
245 $for(header-includes)$
252 \author{$for(author)$$author$$sep$
\and $endfor$
}
254 \date{Version $version$
}
262 $for(include-before)$