1 % For non-ASCII characters, this template has only been tested with XeTeX.
3 \documentclass[$if(fontsize)$$fontsize$,$endif$
%
4 $if(lang)$$lang$,$endif$
%
7 \usepackage{ifxetex,ifluatex
}
8 \usepackage[T1]{fontenc}
10 \usepackage{libertine
}
13 % with newer releases of `fontspec', fonts should be defined before
14 % including `ucharclasses'
15 \newfontfamily{\adlamfont}[Script=Adlam
]{NotoSansAdlam-Regular.ttf
}
16 \newfontfamily{\arabicfont}[Script=Arabic
]{NotoSansArabic-Regular.ttf
}
17 \newfontfamily{\armenianfont}[Script=Armenian
]{NotoSansArmenian-Regular.ttf
}
18 \newfontfamily{\avestanfont}[Script=Avestan
]{NotoSansAvestan-Regular.ttf
}
19 \newfontfamily{\bamumfont}[Script=Bamum
]{NotoSansBamum-Regular.ttf
}
20 \newfontfamily{\bengalifont}[Script=Bengali
]{NotoSansBengali-Regular.ttf
}
21 \newfontfamily{\buhidfont}[Script=Buhid
]{NotoSansBuhid-Regular.ttf
}
22 \newfontfamily{\canadianfont}[Script=Canadian Syllabics
]{NotoSansCanadianAboriginal-Regular.ttf
}
23 \newfontfamily{\carianfont}[Script=Carian
]{NotoSansCarian-Regular.ttf
}
24 \newfontfamily{\chakmafont}[Script=Chakma
]{NotoSansChakma-Regular.ttf
}
25 \newfontfamily{\cherokeefont}[Script=Cherokee
]{NotoSansCherokee-Regular.ttf
}
26 \newfontfamily{\copticfont}[Script=Coptic
]{NotoSansCoptic-Regular.ttf
}
27 \newfontfamily{\cypriotfont}[Script=Cypriot Syllabary
]{NotoSansCypriot-Regular.ttf
}
28 \newfontfamily{\cyrillicfont}[Script=Cyrillic
]{NotoSans-Regular.ttf
}
29 \newfontfamily{\devanagarifont}[Script=Devanagari
]{NotoSansDevanagari-Regular.ttf
}
30 \newfontfamily{\deseretfont}[Script=Deseret
]{NotoSansDeseret-Regular.ttf
}
31 \newfontfamily{\ethiopicfont}[Script=Ethiopic
]{NotoSansEthiopic-Regular.ttf
}
32 \newfontfamily{\georgianfont}[Script=Georgian
]{NotoSansGeorgian-Regular.ttf
}
33 \newfontfamily{\glagoliticfont}[Script=Glagolitic
]{NotoSansGlagolitic-Regular.ttf
}
34 \newfontfamily{\gothicfont}[Script=Gothic
]{NotoSansGothic-Regular.ttf
}
35 \newfontfamily{\greekfont}[Script=Greek
]{NotoSans-Regular.ttf
}
36 \newfontfamily{\gujaratifont}[Script=Gujarati
]{NotoSansGujarati-Regular.ttf
}
37 \newfontfamily{\gurmukhifont}[Script=Gurmukhi
]{NotoSansGurmukhi-Regular.ttf
}
38 \newfontfamily{\hanififont}[Script=Hanifi Rohingya
]{NotoSansHanifiRohingya-Regular.ttf
}
39 \newfontfamily{\hebrewfont}[Script=Hebrew
]{NotoSansHebrew-Regular.ttf
}
40 % XXX no sans serif font yet available
41 \newfontfamily{\hmongpfont}[Script=Nyiakeng Puachue Hmong
]{NotoSerifNyiakengPuachueHmong-Regular.ttf
}
42 \newfontfamily{\kannadafont}[Script=Kannada
]{NotoSansKannada-Regular.ttf
}
43 \newfontfamily{\kayahlifont}[Script=Kayah Li
]{NotoSansKayahLi-Regular.ttf
}
44 \newfontfamily{\khmerfont}[Script=Khmer
]{NotoSansKhmer-Regular.ttf
}
45 \newfontfamily{\laofont}[Script=Lao
]{NotoSansLao-Regular.ttf
}
46 \newfontfamily{\latinfont}[Script=Latin
]{NotoSans-Regular.ttf
}
47 \newfontfamily{\lisufont}[Script=Lisu
]{NotoSansLisu-Regular.ttf
}
48 \newfontfamily{\malayalamfont}[Script=Malayalam
]{NotoSansMalayalam-Regular.ttf
}
49 \newfontfamily{\medefaidrinfont}[Script=Medefaidrin
]{NotoSansMedefaidrin-Regular.ttf
}
50 \newfontfamily{\mongolianfont}[Script=Mongolian
]{NotoSansMongolian-Regular.ttf
}
51 \newfontfamily{\myanmarfont}[Script=Myanmar
]{NotoSansMyanmar-Regular.ttf
}
52 \newfontfamily{\nkofont}[Script=N'Ko
]{NotoSansNKo-Regular.ttf
}
53 \newfontfamily{\olchikifont}[Script=Ol Chiki
]{NotoSansOlChiki-Regular.ttf
}
54 \newfontfamily{\oldturkicfont}[Script=Old Turkic
]{NotoSansOldTurkic-Regular.ttf
}
55 \newfontfamily{\osagefont}[Script=Osage
]{NotoSansOsage-Regular.ttf
}
56 \newfontfamily{\osmanyafont}[Script=Osmanya
]{NotoSansOsmanya-Regular.ttf
}
57 \newfontfamily{\saurashtrafont}[Script=Saurashtra
]{NotoSansSaurashtra-Regular.ttf
}
58 \newfontfamily{\shavianfont}[Script=Shavian
]{NotoSansShavian-Regular.ttf
}
59 \newfontfamily{\sinhalafont}[Script=Sinhala
]{NotoSansSinhala-Regular.ttf
}
60 \newfontfamily{\sundanesefont}[Script=Sundanese
]{NotoSansSundanese-Regular.ttf
}
61 \newfontfamily{\taivietfont}[Script=Tai Viet
]{NotoSansTaiViet-Regular.ttf
}
62 \newfontfamily{\tamilfont}[Script=Tamil
]{NotoSansTamil-Regular.ttf
}
63 \newfontfamily{\telugufont}[Script=Telugu
]{NotoSansTelugu-Regular.ttf
}
64 \newfontfamily{\thaifont}[Script=Thai
]{NotoSansThai-Regular.ttf
}
65 \newfontfamily{\tifinaghfont}[Script=Tifinagh
]{NotoSansTifinagh-Regular.ttf
}
66 \newfontfamily{\vaifont}[Script=Vai
]{NotoSansVai-Regular.ttf
}
67 % XXX no sans serif font available yet
68 \newfontfamily{\yezidifont}[Script=Yezidi
]{NotoSerifYezidi-Regular.ttf
}
70 \usepackage{ucharclasses
}
72 \setTransitionTo{Adlam
}{\begingroup\adlamfont}
73 \setTransitionFrom{Adlam
}{\endgroup}
74 \setTransitionTo{Arabic
}{\begingroup\arabicfont}
75 \setTransitionFrom{Arabic
}{\endgroup}
76 \setTransitionTo{Armenian
}{\begingroup\armenianfont}
77 \setTransitionFrom{Armenian
}{\endgroup}
78 \setTransitionTo{Avestan
}{\begingroup\avestanfont}
79 \setTransitionFrom{Avestan
}{\endgroup}
80 \setTransitionTo{Bamum
}{\begingroup\bamumfont}
81 \setTransitionFrom{Bamum
}{\endgroup}
82 \setTransitionTo{Bengali
}{\begingroup\bengalifont}
83 \setTransitionFrom{Bengali
}{\endgroup}
84 \setTransitionTo{Buhid
}{\begingroup\buhidfont}
85 \setTransitionFrom{Buhid
}{\endgroup}
86 \setTransitionsForCanadianSyllabics{\begingroup\canadianfont}{\endgroup}
87 \setTransitionTo{Carian
}{\begingroup\carianfont}
88 \setTransitionFrom{Carian
}{\endgroup}
89 \setTransitionTo{Chakma
}{\begingroup\chakmafont}
90 \setTransitionFrom{Chakma
}{\endgroup}
91 \setTransitionsForCherokeeFull{\begingroup\cherokeefont}{\endgroup}
92 \setTransitionTo{Coptic
}{\begingroup\copticfont}
93 \setTransitionFrom{Coptic
}{\endgroup}
94 \setTransitionTo{CypriotSyllabary
}{\begingroup\cypriotfont}
95 \setTransitionFrom{CypriotSyllabary
}{\endgroup}
96 % no transition for Cyrillic font; we do that manually
97 \setTransitionTo{Deseret
}{\begingroup\deseretfont}
98 \setTransitionFrom{Deseret
}{\endgroup}
99 \setTransitionsForDevanagari{\begingroup\devanagarifont}{\endgroup}
100 \setTransitionsForEthiopicFull{\begingroup\ethiopicfont}{\endgroup}
101 \setTransitionsForGeorgianFull{\begingroup\georgianfont}{\endgroup}
102 % in Noto, Glagolitic is not part of a Cyrillic font;
103 % we thus have to set up the ranges separately
104 \setTransitionTo{Glagolitic
}{\begingroup\glagoliticfont}
105 \setTransitionFrom{Glagolitic
}{\endgroup}
106 \setTransitionTo{GlagoliticSupplement
}{\begingroup\glagoliticfont}
107 \setTransitionFrom{GlagoliticSupplement
}{\endgroup}
108 \setTransitionTo{Gothic
}{\begingroup\gothicfont}
109 \setTransitionFrom{Gothic
}{\endgroup}
110 % no transition for Greek font; we do that manually
111 \setTransitionTo{Gujarati
}{\begingroup\gujaratifont}
112 \setTransitionFrom{Gujarati
}{\endgroup}
113 \setTransitionTo{Gurmukhi
}{\begingroup\gurmukhifont}
114 \setTransitionFrom{Gurmukhi
}{\endgroup}
115 \setTransitionTo{HanifiRohingya
}{\begingroup\hanififont}
116 \setTransitionFrom{HanifiRohingya
}{\endgroup}
117 \setTransitionTo{Hebrew
}{\begingroup\hebrewfont}
118 \setTransitionFrom{Hebrew
}{\endgroup}
119 \setTransitionTo{Kannada
}{\begingroup\kannadafont}
120 \setTransitionFrom{Kannada
}{\endgroup}
121 \setTransitionTo{KayahLi
}{\begingroup\kayahlifont}
122 \setTransitionFrom{KayahLi
}{\endgroup}
123 \setTransitionTo{Khmer
}{\begingroup\khmerfont}
124 \setTransitionFrom{Khmer
}{\endgroup}
125 \setTransitionTo{KhmerSymbols
}{\begingroup\khmerfont}
126 \setTransitionFrom{KhmerSymbols
}{\endgroup}
127 \setTransitionTo{Lao
}{\begingroup\laofont}
128 \setTransitionFrom{Lao
}{\endgroup}
129 % no transition for Latin font; we do that manually
130 \setTransitionTo{Lisu
}{\begingroup\lisufont}
131 \setTransitionFrom{Lisu
}{\endgroup}
132 \setTransitionTo{Malayalam
}{\begingroup\malayalamfont}
133 \setTransitionFrom{Malayalam
}{\endgroup}
134 \setTransitionTo{Medefaidrin
}{\begingroup\medefaidrinfont}
135 \setTransitionFrom{Medefaidrin
}{\endgroup}
136 % no transition for Mongolian font; we do that manually
137 \setTransitionsForMyanmarFull{\begingroup\myanmarfont}{\endgroup}
138 \setTransitionTo{NKo
}{\begingroup\nkofont}
139 \setTransitionFrom{NKo
}{\endgroup}
140 \setTransitionTo{NyiakengPuachueHmong
}{\begingroup\hmongpfont}
141 \setTransitionFrom{NyiakengPuachueHmong
}{\endgroup}
142 \setTransitionTo{OlChiki
}{\begingroup\olchikifont}
143 \setTransitionFrom{OlChiki
}{\endgroup}
144 \setTransitionTo{OldTurkic
}{\begingroup\oldturkicfont}
145 \setTransitionFrom{OldTurkic
}{\endgroup}
146 \setTransitionTo{Osage
}{\begingroup\osagefont}
147 \setTransitionFrom{Osage
}{\endgroup}
148 \setTransitionTo{Osmanya
}{\begingroup\osmanyafont}
149 \setTransitionFrom{Osmanya
}{\endgroup}
150 \setTransitionTo{Saurashtra
}{\begingroup\saurashtrafont}
151 \setTransitionFrom{Saurashtra
}{\endgroup}
152 \setTransitionTo{Shavian
}{\begingroup\shavianfont}
153 \setTransitionFrom{Shavian
}{\endgroup}
154 \setTransitionTo{Sinhala
}{\begingroup\sinhalafont}
155 \setTransitionFrom{Sinhala
}{\endgroup}
156 \setTransitionsForSundaneseFull{\begingroup\sundanesefont}{\endgroup}
157 \setTransitionTo{TaiViet
}{\begingroup\taivietfont}
158 \setTransitionFrom{TaiViet
}{\endgroup}
159 \setTransitionTo{Tamil
}{\begingroup\tamilfont}
160 \setTransitionFrom{Tamil
}{\endgroup}
161 \setTransitionTo{Telugu
}{\begingroup\telugufont}
162 \setTransitionFrom{Telugu
}{\endgroup}
163 \setTransitionTo{Thai
}{\begingroup\thaifont}
164 \setTransitionFrom{Thai
}{\endgroup}
165 \setTransitionTo{Tifinagh
}{\begingroup\tifinaghfont}
166 \setTransitionFrom{Tifinagh
}{\endgroup}
167 \setTransitionTo{Vai
}{\begingroup\vaifont}
168 \setTransitionFrom{Vai
}{\endgroup}
169 \setTransitionTo{Yezidi
}{\begingroup\yezidifont}
170 \setTransitionFrom{Yezidi
}{\endgroup}
172 % the next commands are needed for manually switching fonts
173 \def\Cyrillic{\begingroup\cyrillicfont}
174 \def\cyrillic{\endgroup}
175 \def\Greek{\begingroup\greekfont}
176 \def\greek{\endgroup}
177 \def\Latin{\begingroup\latinfont}
178 \def\latin{\endgroup}
179 \def\Mongolian{\begingroup\mongolianfont}
180 \def\mongolian{\endgroup}
183 % Libertine Mono is too ugly; we use lmodern instead
184 \renewcommand{\ttfamily}{\fontfamily{lmtt
}\selectfont}
186 \setkomafont{sectioning
}{\normalfont\bfseries}
187 \setkomafont{descriptionlabel
}{\normalfont}
188 \setkomafont{caption
}{\normalfont\small}
190 $if(highlighting-macros)$
191 $highlighting-macros$
194 $if(verbatim-in-note)$
195 \usepackage{fancyvrb
}
199 % Redefine labelwidth for lists; otherwise, the enumerate package will cause
200 % markers to extend beyond the left margin.
204 \renewcommand{\@listi
}
205 {\setlength{\labelwidth}{4em
}}%
210 \usepackage{enumerate
}
214 \usepackage{longtable
}
215 \usepackage{booktabs
}
217 % pandoc inserts \addlinespace after each line...
220 % XXX The \addlinespace macro, as used in the LaTeX code generated by
221 % pandoc, overrides any vertical space adjustments for \toprule and friends,
222 % which is quite unfortunate. I consider this a bug in pandoc 1.12.2.1.
223 % It's not too difficult to fix this, but I had to redefine a lot of
224 % booktabs commands, which I don't want. Since the layout degradation is
225 % minor, I simply wait until it gets fixed in pandoc.
236 \usepackage{graphicx}
238 % We will generate all images so they have a width 0.6\maxwidth. This means
239 % that they will get their normal width if they fit onto the page, but are
240 % scaled down if they would overflow this limit.
244 \ifdim\Gin@nat@width>
\linewidth
252 \let\Oldincludegraphics\includegraphics
253 \renewcommand{\includegraphics}[1]{%
254 \Oldincludegraphics[width=
0.6\maxwidth]{#1}}
258 \usepackage[setpagesize=false,
% page size defined by xetex
259 unicode=false,
% unicode breaks when used with xetex
262 linkcolor=blue
]{hyperref
}
264 \usepackage[unicode=true,
266 linkcolor=blue
]{hyperref
}
267 \usepackage{microtype
}
268 % don't apply protrusion to \texttt
269 \UseMicrotypeSet[protrusion
]{basicmath
}
271 \hypersetup{breaklinks=true,
272 pdfauthor=
{$author-meta$
},
273 pdftitle=
{$title-meta$
},
276 % We want the names `section 2', `subsection 4.1', and the like in local
277 % links, omitting the original link text. To do that, we redefine
283 % \hyperref[foo]{bar}
287 % bar (\autoref{foo})
289 \def\label@hyperref
[#1]#2{%
292 % pandoc >= 1.15.2 uses \hyperlink instead.
301 \newcommand{\textsubscr}[1]{%
302 \ensuremath{_
{\scriptsize\textrm{#1}}}}
305 \setlength{\parindent}{0pt
}
306 \setlength{\parskip}{6pt plus
2pt minus
1pt
}
307 \setlength{\emergencystretch}{4em
} % prevent overfull lines
308 \providecommand{\tightlist}{%
309 \setlength{\itemsep}{0pt
}%
310 \setlength{\parskip}{0pt
}}
312 % avoid float pages as much as possible
313 \renewcommand{\topfraction}{.99}
314 \renewcommand{\bottomfraction}{.99}
315 \setcounter{topnumber
}{9}
316 \setcounter{bottomnumber
}{9}
317 \renewcommand{\textfraction}{.1}
318 \renewcommand{\floatpagefraction}{.9}
320 % We want a break after the description label (if there is one).
323 \let\original@item\@item
324 \def\description@item
[#1]{%
338 \addpenalty\@beginparpenalty
340 \addvspace{-
\parskip}%
343 \addpenalty\@itempenalty
350 \global\@newlistfalse
352 \global\@inlabelfalse
364 \clubpenalty \@clubpenalty
370 \refstepcounter\@listctr
373 \sbox\@tempboxa
{\makelabel{#1}}%
374 \global\setbox\@labels
\hbox{%
379 \ifdim \wd\@tempboxa >
\labelwidth
382 \hbox to
\labelwidth {\unhbox\@tempboxa
}%
386 \def\reserved@b
{\@itemlabel
}%
387 \ifx\reserved@a
\reserved@b
393 \renewenvironment{description
}{%
394 \list{}{\labelwidth\z@
\itemindent-
\leftmargin
395 \let\makelabel\descriptionlabel
396 \let\@item
\description@item
}%
398 \let\@item
\original@item
404 % we want block quotes formatted as italic
405 \renewenvironment{quote
}{%
406 \list{}{\rightmargin\leftmargin}%
416 \setcounter{secnumdepth
}{5}
418 \setcounter{secnumdepth
}{0}
421 $if(verbatim-in-note)$
422 \VerbatimFootnotes % allows verbatim text in footnotes
427 \usepackage{polyglossia
}
428 \setmainlanguage{$mainlang$
}
430 \usepackage[$lang$
]{babel
}
434 $for(header-includes)$
441 \author{$for(author)$$author$$sep$
\and $endfor$
}
443 \date{Version $version$
}
451 $for(include-before)$