Fix OTS warning about `maxp.maxSizeOfInstructions`.
[ttfautohint.git] / doc / template.tex
blob5a1c090c6e719ee118b17ba2ff73a5b905e43b4d
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{\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$
192 $endif$
194 $if(verbatim-in-note)$
195 \usepackage{fancyvrb}
196 $endif$
198 $if(fancy-enums)$
199 % Redefine labelwidth for lists; otherwise, the enumerate package will cause
200 % markers to extend beyond the left margin.
201 \makeatletter
203 \AtBeginDocument{%
204 \renewcommand{\@listi}
205 {\setlength{\labelwidth}{4em}}%
208 \makeatother
210 \usepackage{enumerate}
211 $endif$
213 $if(tables)$
214 \usepackage{longtable}
215 \usepackage{booktabs}
217 % pandoc inserts \addlinespace after each line...
218 \defaultaddspace=1pt
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.
227 %\aboverulesep=0.3em
228 %\belowrulesep=0.3em
229 $endif$
231 $if(url)$
232 \usepackage{url}
233 $endif$
235 $if(graphics)$
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.
241 \makeatletter
243 \def\maxwidth{%
244 \ifdim\Gin@nat@width>\linewidth
245 \linewidth
246 \else
247 \Gin@nat@width
248 \fi}
250 \makeatother
252 \let\Oldincludegraphics\includegraphics
253 \renewcommand{\includegraphics}[1]{%
254 \Oldincludegraphics[width=0.6\maxwidth]{#1}}
255 $endif$
257 \ifxetex
258 \usepackage[setpagesize=false, % page size defined by xetex
259 unicode=false, % unicode breaks when used with xetex
260 xetex,
261 colorlinks=true,
262 linkcolor=blue]{hyperref}
263 \else
264 \usepackage[unicode=true,
265 colorlinks=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$},
274 pdfborder={0 0 0}}
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
278 % \hyperref.
279 \makeatletter
281 % We transform
283 % \hyperref[foo]{bar}
285 % into
287 % bar (\autoref{foo})
289 \def\label@hyperref[#1]#2{%
290 #2 (\autoref{#1})}
292 % pandoc >= 1.15.2 uses \hyperlink instead.
294 \def\hyperlink#1#2{%
295 #2 (\autoref{#1})}
298 \makeatother
300 $if(subscript)$
301 \newcommand{\textsubscr}[1]{%
302 \ensuremath{_{\scriptsize\textrm{#1}}}}
303 $endif$
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).
321 \makeatletter
323 \let\original@item\@item
324 \def\description@item[#1]{%
325 \if@noparitem
326 \@donoparitem
327 \else
328 \if@inlabel
329 \indent \par
331 \ifhmode
332 \unskip\unskip \par
334 \if@newlist
335 \if@nobreak
336 \@nbitem
337 \else
338 \addpenalty\@beginparpenalty
339 \addvspace\@topsep
340 \addvspace{-\parskip}%
342 \else
343 \addpenalty\@itempenalty
344 \addvspace\itemsep
346 \global\@inlabeltrue
348 \everypar{%
349 \@minipagefalse
350 \global\@newlistfalse
351 \if@inlabel
352 \global\@inlabelfalse
353 {\setbox\z@\lastbox
354 \ifvoid\z@
355 \kern-\itemindent
356 \fi}%
357 \box\@labels
358 \penalty\z@
360 \if@nobreak
361 \@nobreakfalse
362 \clubpenalty \@M
363 \else
364 \clubpenalty \@clubpenalty
365 \everypar{}%
366 \fi}%
367 \if@noitemarg
368 \@noitemargfalse
369 \if@nmbrlist
370 \refstepcounter\@listctr
373 \sbox\@tempboxa{\makelabel{#1}}%
374 \global\setbox\@labels\hbox{%
375 \unhbox\@labels
376 \hskip \itemindent
377 \hskip -\labelwidth
378 \hskip -\labelsep
379 \ifdim \wd\@tempboxa >\labelwidth
380 \box\@tempboxa
381 \else
382 \hbox to\labelwidth {\unhbox\@tempboxa}%
384 \hskip \labelsep}%
385 \def\reserved@a{#1}%
386 \def\reserved@b{\@itemlabel}%
387 \ifx\reserved@a \reserved@b
388 \else
389 \leavevmode\\
391 \ignorespaces}
393 \renewenvironment{description}{%
394 \list{}{\labelwidth\z@ \itemindent-\leftmargin
395 \let\makelabel\descriptionlabel
396 \let\@item\description@item}%
398 \let\@item\original@item
399 \endlist
402 \makeatother
404 % we want block quotes formatted as italic
405 \renewenvironment{quote}{%
406 \list{}{\rightmargin\leftmargin}%
407 \item\relax
410 \endlist
415 $if(numbersections)$
416 \setcounter{secnumdepth}{5}
417 $else$
418 \setcounter{secnumdepth}{0}
419 $endif$
421 $if(verbatim-in-note)$
422 \VerbatimFootnotes % allows verbatim text in footnotes
423 $endif$
425 $if(lang)$
426 \ifxetex
427 \usepackage{polyglossia}
428 \setmainlanguage{$mainlang$}
429 \else
430 \usepackage[$lang$]{babel}
432 $endif$
434 $for(header-includes)$
435 $header-includes$
436 $endfor$
438 $if(title)$
439 \title{$title$}
440 $endif$
441 \author{$for(author)$$author$$sep$ \and $endfor$}
442 $if(version)$
443 \date{Version $version$}
444 $endif$
446 \begin{document}
447 $if(title)$
448 \maketitle
449 $endif$
451 $for(include-before)$
452 $include-before$
453 $endfor$
455 $if(toc)$
456 \tableofcontents
457 $endif$
459 $body$
461 $for(include-after)$
462 $include-after$
463 $endfor$
465 \end{document}