prefix.tex (10683B) download
1% Options for packages loaded elsewhere
2\PassOptionsToPackage{unicode$for(hyperrefoptions)$,$hyperrefoptions$$endfor$}{hyperref}
3\PassOptionsToPackage{hyphens}{url}
4%
5\documentclass[
6$if(fontsize)$
7 $fontsize$,
8$endif$
9$if(papersize)$
10 $papersize$paper,
11$endif$
12$for(classoption)$
13 $classoption$$sep$,
14$endfor$
15]{$documentclass$}
16\usepackage{amsmath,amssymb}
17$if(linestretch)$
18\usepackage{setspace}
19$endif$
20\usepackage{iftex}
21$if(mathspec)$
22 \ifXeTeX
23 \usepackage{mathspec} % this also loads fontspec
24 \else
25 \usepackage{unicode-math} % this also loads fontspec
26 \fi
27$else$
28 \usepackage{unicode-math} % this also loads fontspec
29$endif$
30 \defaultfontfeatures{Scale=MatchLowercase}$-- must come before Beamer theme
31 \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
32$if(fontfamily)$
33$else$
34$-- Set default font before Beamer theme so the theme can override it
35\usepackage{lmodern}
36$endif$
37$-- User font settings (must come after default font and Beamer theme)
38$if(fontfamily)$
39\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
40$endif$
41$if(mainfont)$
42 \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
43$endif$
44$if(sansfont)$
45 \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$}
46$endif$
47$if(monofont)$
48 \setmonofont[$for(monofontoptions)$$monofontoptions$$sep$,$endfor$]{$monofont$}
49$endif$
50$for(fontfamilies)$
51 \newfontfamily{$fontfamilies.name$}[$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$]{$fontfamilies.font$}
52$endfor$
53$if(mathfont)$
54$if(mathspec)$
55 \ifXeTeX
56 \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
57 \else
58 \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
59 \fi
60$else$
61 \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
62$endif$
63$endif$
64$if(CJKmainfont)$
65 \ifXeTeX
66 \usepackage{xeCJK}
67 \setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
68 $if(CJKsansfont)$
69 \setCJKsansfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKsansfont$}
70 $endif$
71 $if(CJKmonofont)$
72 \setCJKmonofont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmonofont$}
73 $endif$
74 \fi
75$endif$
76$if(luatexjapresetoptions)$
77 \ifLuaTeX
78 \usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset}
79 \fi
80$endif$
81$if(CJKmainfont)$
82 \ifLuaTeX
83 \usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec}
84 \setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
85 \fi
86$endif$
87$if(zero-width-non-joiner)$
88%% Support for zero-width non-joiner characters.
89\makeatletter
90\def\zerowidthnonjoiner{%
91 % Prevent ligatures and adjust kerning, but still support hyphenating.
92 \texorpdfstring{%
93 \TextOrMath{\nobreak\discretionary{-}{}{\kern.03em}%
94 \ifvmode\else\nobreak\hskip\z@skip\fi}{}%
95 }{}%
96}
97\makeatother
98\catcode`^^^^200c=\active
99\protected\def ^^^^200c{\zerowidthnonjoiner}
100%% End of ZWNJ support
101$endif$
102% Use upquote if available, for straight quotes in verbatim environments
103\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
104\IfFileExists{microtype.sty}{% use microtype if available
105 \usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype}
106 \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
107}{}
108$if(indent)$
109$else$
110\makeatletter
111\@ifundefined{KOMAClassName}{% if non-KOMA class
112 \IfFileExists{parskip.sty}{%
113 \usepackage{parskip}
114 }{% else
115 \setlength{\parindent}{0pt}
116 \setlength{\parskip}{6pt plus 2pt minus 1pt}}
117}{% if KOMA class
118 \KOMAoptions{parskip=half}}
119\makeatother
120$endif$
121$if(verbatim-in-note)$
122\usepackage{fancyvrb}
123$endif$
124\usepackage{xcolor}
125$if(geometry)$
126\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
127$endif$
128$if(listings)$
129\usepackage{listings}
130\newcommand{\passthrough}[1]{#1}
131\lstset{defaultdialect=[5.3]Lua}
132\lstset{defaultdialect=[x86masm]Assembler}
133$endif$
134$if(lhs)$
135\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
136$endif$
137$if(highlighting-macros)$
138$highlighting-macros$
139$endif$
140$if(tables)$
141\usepackage{longtable,booktabs,array}
142$if(multirow)$
143\usepackage{multirow}
144$endif$
145\usepackage{calc} % for calculating minipage widths
146$if(beamer)$
147\usepackage{caption}
148% Make caption package work with longtable
149\makeatletter
150\def\fnum@table{\tablename~\thetable}
151\makeatother
152$else$
153% Correct order of tables after \paragraph or \subparagraph
154\usepackage{etoolbox}
155\makeatletter
156\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
157\makeatother
158% Allow footnotes in longtable head/foot
159\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
160\makesavenoteenv{longtable}
161$endif$
162$endif$
163$if(graphics)$
164\usepackage{graphicx}
165\makeatletter
166\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
167\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
168\makeatother
169% Scale images if necessary, so that they will not overflow the page
170% margins by default, and it is still possible to overwrite the defaults
171% using explicit options in \includegraphics[width, height, ...]{}
172\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
173% Set default figure placement to htbp
174\makeatletter
175\def\fps@figure{htbp}
176\makeatother
177$endif$
178$if(svg)$
179\usepackage{svg}
180$endif$
181$if(strikeout)$
182$-- also used for underline
183\ifLuaTeX
184 \usepackage{luacolor}
185 \usepackage[soul]{lua-ul}
186\else
187 \usepackage{soul}
188$if(CJKmainfont)$
189 \ifXeTeX
190 % soul's \st doesn't work for CJK:
191 \usepackage{xeCJKfntef}
192 \renewcommand{\st}[1]{\sout{#1}}
193 \fi
194$endif$
195\fi
196$endif$
197\setlength{\emergencystretch}{3em} % prevent overfull lines
198\providecommand{\tightlist}{%
199 \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
200$if(numbersections)$
201\setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$}
202$else$
203\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
204$endif$
205$if(subfigure)$
206\usepackage{subcaption}
207$endif$
208$if(beamer)$
209$else$
210$if(block-headings)$
211% Make \paragraph and \subparagraph free-standing
212\ifx\paragraph\undefined\else
213 \let\oldparagraph\paragraph
214 \renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
215\fi
216\ifx\subparagraph\undefined\else
217 \let\oldsubparagraph\subparagraph
218 \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
219\fi
220$endif$
221$endif$
222$if(pagestyle)$
223\pagestyle{$pagestyle$}
224$endif$
225$if(csl-refs)$
226% definitions for citeproc citations
227\NewDocumentCommand\citeproctext{}{}
228\NewDocumentCommand\citeproc{mm}{%
229 \begingroup\def\citeproctext{#2}\cite{#1}\endgroup}
230\makeatletter
231 % allow citations to break across lines
232 \let\@cite@ofmt\@firstofone
233 % avoid brackets around text for \cite:
234 \def\@biblabel#1{}
235 \def\@cite#1#2{{#1\if@tempswa , #2\fi}}
236\makeatother
237\newlength{\cslhangindent}
238\setlength{\cslhangindent}{1.5em}
239\newlength{\csllabelwidth}
240\setlength{\csllabelwidth}{3em}
241\newenvironment{CSLReferences}[2] % #1 hanging-indent, #2 entry-spacing
242 {\begin{list}{}{%
243 \setlength{\itemindent}{0pt}
244 \setlength{\leftmargin}{0pt}
245 \setlength{\parsep}{0pt}
246 % turn on hanging indent if param 1 is 1
247 \ifodd #1
248 \setlength{\leftmargin}{\cslhangindent}
249 \setlength{\itemindent}{-1\cslhangindent}
250 \fi
251 % set entry spacing
252 \setlength{\itemsep}{#2\baselineskip}}}
253 {\end{list}}
254\usepackage{calc}
255\newcommand{\CSLBlock}[1]{\hfill\break\parbox[t]{\linewidth}{\strut\ignorespaces#1\strut}}
256\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{\strut#1\strut}}
257\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{\strut#1\strut}}
258\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
259$endif$
260$if(lang)$
261\ifLuaTeX
262\usepackage[bidi=basic]{babel}
263\else
264\usepackage[bidi=default]{babel}
265\fi
266$if(babel-lang)$
267\babelprovide[main,import]{$babel-lang$}
268$if(mainfont)$
269\babelfont{rm}[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
270$endif$
271$endif$
272$for(babel-otherlangs)$
273\babelprovide[import]{$babel-otherlangs$}
274$endfor$
275$for(babelfonts/pairs)$
276\babelfont[$babelfonts.key$]{rm}{$babelfonts.value$}
277$endfor$
278% get rid of language-specific shorthands (see #6817):
279\let\LanguageShortHands\languageshorthands
280\def\languageshorthands#1{}
281$endif$
282$for(packages)$
283\usepackage{$packages$}
284$endfor$
285$for(newcommands/pairs)$
286\newcommand{\$it.key$}{$it.value$}
287$endfor$
288$for(header-includes)$
289$header-includes$
290$endfor$
291\ifLuaTeX
292 \usepackage{selnolig} % disable illegal ligatures
293\fi
294$if(dir)$
295$endif$
296$if(natbib)$
297\usepackage[$natbiboptions$]{natbib}
298\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
299$endif$
300$if(biblatex)$
301\usepackage[$if(biblio-style)$style=$biblio-style$,$endif$$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex}
302$for(bibliography)$
303\addbibresource{$bibliography$}
304$endfor$
305$endif$
306$if(nocite-ids)$
307\nocite{$for(nocite-ids)$$it$$sep$, $endfor$}
308$endif$
309$if(csquotes)$
310\usepackage{csquotes}
311$endif$
312\usepackage{bookmark}
313\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
314\urlstyle{$if(urlstyle)$$urlstyle$$else$same$endif$}
315$if(links-as-notes)$
316% Make links footnotes instead of hotlinks:
317\DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}}
318$endif$
319$if(verbatim-in-note)$
320\VerbatimFootnotes % allow verbatim text in footnotes
321$endif$
322\hypersetup{
323$if(title-meta)$
324 pdftitle={$title-meta$},
325$endif$
326$if(author-meta)$
327 pdfauthor={$author-meta$},
328$endif$
329$if(lang)$
330 pdflang={$lang$},
331$endif$
332$if(subject)$
333 pdfsubject={$subject$},
334$endif$
335$if(keywords)$
336 pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$},
337$endif$
338$if(colorlinks)$
339 colorlinks=true,
340 linkcolor={$if(linkcolor)$$linkcolor$$else$Maroon$endif$},
341 filecolor={$if(filecolor)$$filecolor$$else$Maroon$endif$},
342 citecolor={$if(citecolor)$$citecolor$$else$Blue$endif$},
343 urlcolor={$if(urlcolor)$$urlcolor$$else$Blue$endif$},
344$else$
345$if(boxlinks)$
346$else$
347 hidelinks,
348$endif$
349$endif$
350 pdfcreator={LaTeX via pandoc}}
351
352$if(title)$
353\title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
354\newpage
355$endif$
356$if(subtitle)$
357$if(beamer)$
358$else$
359\usepackage{etoolbox}
360\makeatletter
361\providecommand{\subtitle}[1]{% add subtitle to \maketitle
362 \apptocmd{\@title}{\par {\large #1 \par}}{}{}
363}
364\makeatother
365$endif$
366\subtitle{$subtitle$}
367$endif$
368\author{$for(author)$$author$$sep$ \and $endfor$}
369\date{$date$}
370$if(beamer)$
371$if(institute)$
372\institute{$for(institute)$$institute$$sep$ \and $endfor$}
373$endif$
374$if(titlegraphic)$
375\titlegraphic{\includegraphics{$titlegraphic$}}
376$endif$
377$if(logo)$
378\logo{\includegraphics{$logo$}}
379$endif$
380$endif$