[doc] Activate display of Nyiakeng Puachue Hmong.
[ttfautohint.git] / doc / template.tex
blobd023afe4c119eccb1b2345c2b3f3103dfefef0d4
1 % For non-ASCII characters, this template has only been tested with XeTeX.
3 \documentclass[$if(fontsize)$$fontsize$,$endif$%
4 $if(lang)$$lang$,$endif$%
5 DIV=13]{scrreprt}
7 \usepackage{ifxetex,ifluatex}
8 \usepackage[T1]{fontenc}
9 \usepackage{fixltx2e}
10 \usepackage{libertine}
12 \ifxetex
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$
185 $endif$
187 $if(verbatim-in-note)$
188 \usepackage{fancyvrb}
189 $endif$
191 $if(fancy-enums)$
192 % Redefine labelwidth for lists; otherwise, the enumerate package will cause
193 % markers to extend beyond the left margin.
194 \makeatletter
196 \AtBeginDocument{%
197 \renewcommand{\@listi}
198 {\setlength{\labelwidth}{4em}}%
201 \makeatother
203 \usepackage{enumerate}
204 $endif$
206 $if(tables)$
207 % We use a patched version of longtable until a serious clash with
208 % floats get fixed.
209 \usepackage{longtable-patched}
210 \usepackage{booktabs}
212 % pandoc inserts \addlinespace after each line...
213 \defaultaddspace=1pt
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.
222 %\aboverulesep=0.3em
223 %\belowrulesep=0.3em
224 $endif$
226 $if(url)$
227 \usepackage{url}
228 $endif$
230 $if(graphics)$
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.
236 \makeatletter
238 \def\maxwidth{%
239 \ifdim\Gin@nat@width>\linewidth
240 \linewidth
241 \else
242 \Gin@nat@width
243 \fi}
245 \makeatother
247 \let\Oldincludegraphics\includegraphics
248 \renewcommand{\includegraphics}[1]{%
249 \Oldincludegraphics[width=0.6\maxwidth]{#1}}
250 $endif$
252 \ifxetex
253 \usepackage[setpagesize=false, % page size defined by xetex
254 unicode=false, % unicode breaks when used with xetex
255 xetex,
256 colorlinks=true,
257 linkcolor=blue]{hyperref}
258 \else
259 \usepackage[unicode=true,
260 colorlinks=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$},
269 pdfborder={0 0 0}}
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
273 % \hyperref.
274 \makeatletter
276 % We transform
278 % \hyperref[foo]{bar}
280 % into
282 % bar (\autoref{foo})
284 \def\label@hyperref[#1]#2{%
285 #2 (\autoref{#1})}
287 % pandoc >= 1.15.2 uses \hyperlink instead.
289 \def\hyperlink#1#2{%
290 #2 (\autoref{#1})}
293 \makeatother
295 $if(subscript)$
296 \newcommand{\textsubscr}[1]{%
297 \ensuremath{_{\scriptsize\textrm{#1}}}}
298 $endif$
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).
316 \makeatletter
318 \let\original@item\@item
319 \def\description@item[#1]{%
320 \if@noparitem
321 \@donoparitem
322 \else
323 \if@inlabel
324 \indent \par
326 \ifhmode
327 \unskip\unskip \par
329 \if@newlist
330 \if@nobreak
331 \@nbitem
332 \else
333 \addpenalty\@beginparpenalty
334 \addvspace\@topsep
335 \addvspace{-\parskip}%
337 \else
338 \addpenalty\@itempenalty
339 \addvspace\itemsep
341 \global\@inlabeltrue
343 \everypar{%
344 \@minipagefalse
345 \global\@newlistfalse
346 \if@inlabel
347 \global\@inlabelfalse
348 {\setbox\z@\lastbox
349 \ifvoid\z@
350 \kern-\itemindent
351 \fi}%
352 \box\@labels
353 \penalty\z@
355 \if@nobreak
356 \@nobreakfalse
357 \clubpenalty \@M
358 \else
359 \clubpenalty \@clubpenalty
360 \everypar{}%
361 \fi}%
362 \if@noitemarg
363 \@noitemargfalse
364 \if@nmbrlist
365 \refstepcounter\@listctr
368 \sbox\@tempboxa{\makelabel{#1}}%
369 \global\setbox\@labels\hbox{%
370 \unhbox\@labels
371 \hskip \itemindent
372 \hskip -\labelwidth
373 \hskip -\labelsep
374 \ifdim \wd\@tempboxa >\labelwidth
375 \box\@tempboxa
376 \else
377 \hbox to\labelwidth {\unhbox\@tempboxa}%
379 \hskip \labelsep}%
380 \def\reserved@a{#1}%
381 \def\reserved@b{\@itemlabel}%
382 \ifx\reserved@a \reserved@b
383 \else
384 \leavevmode\\
386 \ignorespaces}
388 \renewenvironment{description}{%
389 \list{}{\labelwidth\z@ \itemindent-\leftmargin
390 \let\makelabel\descriptionlabel
391 \let\@item\description@item}%
393 \let\@item\original@item
394 \endlist
397 \makeatother
399 % we want block quotes formatted as italic
400 \renewenvironment{quote}{%
401 \list{}{\rightmargin\leftmargin}%
402 \item\relax
405 \endlist
410 $if(numbersections)$
411 \setcounter{secnumdepth}{5}
412 $else$
413 \setcounter{secnumdepth}{0}
414 $endif$
416 $if(verbatim-in-note)$
417 \VerbatimFootnotes % allows verbatim text in footnotes
418 $endif$
420 $if(lang)$
421 \ifxetex
422 \usepackage{polyglossia}
423 \setmainlanguage{$mainlang$}
424 \else
425 \usepackage[$lang$]{babel}
427 $endif$
429 $for(header-includes)$
430 $header-includes$
431 $endfor$
433 $if(title)$
434 \title{$title$}
435 $endif$
436 \author{$for(author)$$author$$sep$ \and $endfor$}
437 $if(version)$
438 \date{Version $version$}
439 $endif$
441 \begin{document}
442 $if(title)$
443 \maketitle
444 $endif$
446 $for(include-before)$
447 $include-before$
448 $endfor$
450 $if(toc)$
451 \tableofcontents
452 $endif$
454 $body$
456 $for(include-after)$
457 $include-after$
458 $endfor$
460 \end{document}