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{\mongolianfont}[Script=Mongolian
]{NotoSansMongolian-Regular.ttf
}
50 \newfontfamily{\myanmarfont}[Script=Myanmar
]{NotoSansMyanmar-Regular.ttf
}
51 \newfontfamily{\nkofont}[Script=N'Ko
]{NotoSansNKo-Regular.ttf
}
52 \newfontfamily{\olchikifont}[Script=Ol Chiki
]{NotoSansOlChiki-Regular.ttf
}
53 \newfontfamily{\oldturkicfont}[Script=Old Turkic
]{NotoSansOldTurkic-Regular.ttf
}
54 \newfontfamily{\osagefont}[Script=Osage
]{NotoSansOsage-Regular.ttf
}
55 \newfontfamily{\osmanyafont}[Script=Osmanya
]{NotoSansOsmanya-Regular.ttf
}
56 \newfontfamily{\saurashtrafont}[Script=Saurashtra
]{NotoSansSaurashtra-Regular.ttf
}
57 \newfontfamily{\shavianfont}[Script=Shavian
]{NotoSansShavian-Regular.ttf
}
58 \newfontfamily{\sinhalafont}[Script=Sinhala
]{NotoSansSinhala-Regular.ttf
}
59 \newfontfamily{\sundanesefont}[Script=Sundanese
]{NotoSansSundanese-Regular.ttf
}
60 \newfontfamily{\taivietfont}[Script=Tai Viet
]{NotoSansTaiViet-Regular.ttf
}
61 \newfontfamily{\tamilfont}[Script=Tamil
]{NotoSansTamil-Regular.ttf
}
62 \newfontfamily{\telugufont}[Script=Telugu
]{NotoSansTelugu-Regular.ttf
}
63 \newfontfamily{\thaifont}[Script=Thai
]{NotoSansThai-Regular.ttf
}
64 \newfontfamily{\tifinaghfont}[Script=Tifinagh
]{NotoSansTifinagh-Regular.ttf
}
65 \newfontfamily{\vaifont}[Script=Vai
]{NotoSansVai-Regular.ttf
}
67 \usepackage{ucharclasses
}
69 \setTransitionTo{Adlam
}{\begingroup\adlamfont}
70 \setTransitionFrom{Adlam
}{\endgroup}
71 \setTransitionTo{Arabic
}{\begingroup\arabicfont}
72 \setTransitionFrom{Arabic
}{\endgroup}
73 \setTransitionTo{Armenian
}{\begingroup\armenianfont}
74 \setTransitionFrom{Armenian
}{\endgroup}
75 \setTransitionTo{Avestan
}{\begingroup\avestanfont}
76 \setTransitionFrom{Avestan
}{\endgroup}
77 \setTransitionTo{Bamum
}{\begingroup\bamumfont}
78 \setTransitionFrom{Bamum
}{\endgroup}
79 \setTransitionTo{Bengali
}{\begingroup\bengalifont}
80 \setTransitionFrom{Bengali
}{\endgroup}
81 \setTransitionTo{Buhid
}{\begingroup\buhidfont}
82 \setTransitionFrom{Buhid
}{\endgroup}
83 \setTransitionsForCanadianSyllabics{\begingroup\canadianfont}{\endgroup}
84 \setTransitionTo{Carian
}{\begingroup\carianfont}
85 \setTransitionFrom{Carian
}{\endgroup}
86 \setTransitionTo{Chakma
}{\begingroup\chakmafont}
87 \setTransitionFrom{Chakma
}{\endgroup}
88 \setTransitionsForCherokeeFull{\begingroup\cherokeefont}{\endgroup}
89 \setTransitionTo{Coptic
}{\begingroup\copticfont}
90 \setTransitionFrom{Coptic
}{\endgroup}
91 \setTransitionTo{CypriotSyllabary
}{\begingroup\cypriotfont}
92 \setTransitionFrom{CypriotSyllabary
}{\endgroup}
93 % no transition for Cyrillic font; we do that manually
94 \setTransitionTo{Deseret
}{\begingroup\deseretfont}
95 \setTransitionFrom{Deseret
}{\endgroup}
96 \setTransitionsForDevanagari{\begingroup\devanagarifont}{\endgroup}
97 \setTransitionsForEthiopicFull{\begingroup\ethiopicfont}{\endgroup}
98 \setTransitionsForGeorgianFull{\begingroup\georgianfont}{\endgroup}
99 % in Noto, Glagolitic is not part of a Cyrillic font;
100 % we thus have to set up the ranges separately
101 \setTransitionTo{Glagolitic
}{\begingroup\glagoliticfont}
102 \setTransitionFrom{Glagolitic
}{\endgroup}
103 \setTransitionTo{GlagoliticSupplement
}{\begingroup\glagoliticfont}
104 \setTransitionFrom{GlagoliticSupplement
}{\endgroup}
105 \setTransitionTo{Gothic
}{\begingroup\gothicfont}
106 \setTransitionFrom{Gothic
}{\endgroup}
107 % no transition for Greek font; we do that manually
108 \setTransitionTo{Gujarati
}{\begingroup\gujaratifont}
109 \setTransitionFrom{Gujarati
}{\endgroup}
110 \setTransitionTo{Gurmukhi
}{\begingroup\gurmukhifont}
111 \setTransitionFrom{Gurmukhi
}{\endgroup}
112 \setTransitionTo{HanifiRohingya
}{\begingroup\hanififont}
113 \setTransitionFrom{HanifiRohingya
}{\endgroup}
114 \setTransitionTo{Hebrew
}{\begingroup\hebrewfont}
115 \setTransitionFrom{Hebrew
}{\endgroup}
116 \setTransitionTo{Kannada
}{\begingroup\kannadafont}
117 \setTransitionFrom{Kannada
}{\endgroup}
118 \setTransitionTo{KayahLi
}{\begingroup\kayahlifont}
119 \setTransitionFrom{KayahLi
}{\endgroup}
120 \setTransitionTo{Khmer
}{\begingroup\khmerfont}
121 \setTransitionFrom{Khmer
}{\endgroup}
122 \setTransitionTo{KhmerSymbols
}{\begingroup\khmerfont}
123 \setTransitionFrom{KhmerSymbols
}{\endgroup}
124 \setTransitionTo{Lao
}{\begingroup\laofont}
125 \setTransitionFrom{Lao
}{\endgroup}
126 % no transition for Latin font; we do that manually
127 \setTransitionTo{Lisu
}{\begingroup\lisufont}
128 \setTransitionFrom{Lisu
}{\endgroup}
129 \setTransitionTo{Malayalam
}{\begingroup\malayalamfont}
130 \setTransitionFrom{Malayalam
}{\endgroup}
131 % no transition for Mongolian font; we do that manually
132 \setTransitionsForMyanmarFull{\begingroup\myanmarfont}{\endgroup}
133 \setTransitionTo{NKo
}{\begingroup\nkofont}
134 \setTransitionFrom{NKo
}{\endgroup}
135 \setTransitionTo{NyiakengPuachueHmong
}{\begingroup\hmongpfont}
136 \setTransitionFrom{NyiakengPuachueHmong
}{\endgroup}
137 \setTransitionTo{OlChiki
}{\begingroup\olchikifont}
138 \setTransitionFrom{OlChiki
}{\endgroup}
139 \setTransitionTo{OldTurkic
}{\begingroup\oldturkicfont}
140 \setTransitionFrom{OldTurkic
}{\endgroup}
141 \setTransitionTo{Osage
}{\begingroup\osagefont}
142 \setTransitionFrom{Osage
}{\endgroup}
143 \setTransitionTo{Osmanya
}{\begingroup\osmanyafont}
144 \setTransitionFrom{Osmanya
}{\endgroup}
145 \setTransitionTo{Saurashtra
}{\begingroup\saurashtrafont}
146 \setTransitionFrom{Saurashtra
}{\endgroup}
147 \setTransitionTo{Shavian
}{\begingroup\shavianfont}
148 \setTransitionFrom{Shavian
}{\endgroup}
149 \setTransitionTo{Sinhala
}{\begingroup\sinhalafont}
150 \setTransitionFrom{Sinhala
}{\endgroup}
151 \setTransitionsForSundaneseFull{\begingroup\sundanesefont}{\endgroup}
152 \setTransitionTo{TaiViet
}{\begingroup\taivietfont}
153 \setTransitionFrom{TaiViet
}{\endgroup}
154 \setTransitionTo{Tamil
}{\begingroup\tamilfont}
155 \setTransitionFrom{Tamil
}{\endgroup}
156 \setTransitionTo{Telugu
}{\begingroup\telugufont}
157 \setTransitionFrom{Telugu
}{\endgroup}
158 \setTransitionTo{Thai
}{\begingroup\thaifont}
159 \setTransitionFrom{Thai
}{\endgroup}
160 \setTransitionTo{Tifinagh
}{\begingroup\tifinaghfont}
161 \setTransitionFrom{Tifinagh
}{\endgroup}
162 \setTransitionTo{Vai
}{\begingroup\vaifont}
163 \setTransitionFrom{Vai
}{\endgroup}
165 % the next commands are needed for manually switching fonts
166 \def\Cyrillic{\begingroup\cyrillicfont}
167 \def\cyrillic{\endgroup}
168 \def\Greek{\begingroup\greekfont}
169 \def\greek{\endgroup}
170 \def\Latin{\begingroup\latinfont}
171 \def\latin{\endgroup}
172 \def\Mongolian{\begingroup\mongolianfont}
173 \def\mongolian{\endgroup}
176 % Libertine Mono is too ugly; we use lmodern instead
177 \renewcommand{\ttfamily}{\fontfamily{lmtt
}\selectfont}
179 \setkomafont{sectioning
}{\normalfont\bfseries}
180 \setkomafont{descriptionlabel
}{\normalfont}
181 \setkomafont{caption
}{\normalfont\small}
183 $if(highlighting-macros)$
184 $highlighting-macros$
187 $if(verbatim-in-note)$
188 \usepackage{fancyvrb
}
192 % Redefine labelwidth for lists; otherwise, the enumerate package will cause
193 % markers to extend beyond the left margin.
197 \renewcommand{\@listi
}
198 {\setlength{\labelwidth}{4em
}}%
203 \usepackage{enumerate
}
207 % We use a patched version of longtable until a serious clash with
209 \usepackage{longtable-patched
}
210 \usepackage{booktabs
}
212 % pandoc inserts \addlinespace after each line...
215 % XXX The \addlinespace macro, as used in the LaTeX code generated by
216 % pandoc, overrides any vertical space adjustments for \toprule and friends,
217 % which is quite unfortunate. I consider this a bug in pandoc 1.12.2.1.
218 % It's not too difficult to fix this, but I had to redefine a lot of
219 % booktabs commands, which I don't want. Since the layout degradation is
220 % minor, I simply wait until it gets fixed in pandoc.
231 \usepackage{graphicx}
233 % We will generate all images so they have a width 0.6\maxwidth. This means
234 % that they will get their normal width if they fit onto the page, but are
235 % scaled down if they would overflow this limit.
239 \ifdim\Gin@nat@width>
\linewidth
247 \let\Oldincludegraphics\includegraphics
248 \renewcommand{\includegraphics}[1]{%
249 \Oldincludegraphics[width=
0.6\maxwidth]{#1}}
253 \usepackage[setpagesize=false,
% page size defined by xetex
254 unicode=false,
% unicode breaks when used with xetex
257 linkcolor=blue
]{hyperref
}
259 \usepackage[unicode=true,
261 linkcolor=blue
]{hyperref
}
262 \usepackage{microtype
}
263 % don't apply protrusion to \texttt
264 \UseMicrotypeSet[protrusion
]{basicmath
}
266 \hypersetup{breaklinks=true,
267 pdfauthor=
{$author-meta$
},
268 pdftitle=
{$title-meta$
},
271 % We want the names `section 2', `subsection 4.1', and the like in local
272 % links, omitting the original link text. To do that, we redefine
278 % \hyperref[foo]{bar}
282 % bar (\autoref{foo})
284 \def\label@hyperref
[#1]#2{%
287 % pandoc >= 1.15.2 uses \hyperlink instead.
296 \newcommand{\textsubscr}[1]{%
297 \ensuremath{_
{\scriptsize\textrm{#1}}}}
300 \setlength{\parindent}{0pt
}
301 \setlength{\parskip}{6pt plus
2pt minus
1pt
}
302 \setlength{\emergencystretch}{4em
} % prevent overfull lines
303 \providecommand{\tightlist}{%
304 \setlength{\itemsep}{0pt
}%
305 \setlength{\parskip}{0pt
}}
307 % avoid float pages as much as possible
308 \renewcommand{\topfraction}{.99}
309 \renewcommand{\bottomfraction}{.99}
310 \setcounter{topnumber
}{9}
311 \setcounter{bottomnumber
}{9}
312 \renewcommand{\textfraction}{.1}
313 \renewcommand{\floatpagefraction}{.9}
315 % We want a break after the description label (if there is one).
318 \let\original@item\@item
319 \def\description@item
[#1]{%
333 \addpenalty\@beginparpenalty
335 \addvspace{-
\parskip}%
338 \addpenalty\@itempenalty
345 \global\@newlistfalse
347 \global\@inlabelfalse
359 \clubpenalty \@clubpenalty
365 \refstepcounter\@listctr
368 \sbox\@tempboxa
{\makelabel{#1}}%
369 \global\setbox\@labels
\hbox{%
374 \ifdim \wd\@tempboxa >
\labelwidth
377 \hbox to
\labelwidth {\unhbox\@tempboxa
}%
381 \def\reserved@b
{\@itemlabel
}%
382 \ifx\reserved@a
\reserved@b
388 \renewenvironment{description
}{%
389 \list{}{\labelwidth\z@
\itemindent-
\leftmargin
390 \let\makelabel\descriptionlabel
391 \let\@item
\description@item
}%
393 \let\@item
\original@item
399 % we want block quotes formatted as italic
400 \renewenvironment{quote
}{%
401 \list{}{\rightmargin\leftmargin}%
411 \setcounter{secnumdepth
}{5}
413 \setcounter{secnumdepth
}{0}
416 $if(verbatim-in-note)$
417 \VerbatimFootnotes % allows verbatim text in footnotes
422 \usepackage{polyglossia
}
423 \setmainlanguage{$mainlang$
}
425 \usepackage[$lang$
]{babel
}
429 $for(header-includes)$
436 \author{$for(author)$$author$$sep$
\and $endfor$
}
438 \date{Version $version$
}
446 $for(include-before)$