git.iko.soy/typeable/pandoc
on 34412cf help sign in
288 lines 7.8 kB history raw
1\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(papersize)$$papersize$paper,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
2$if(beamerarticle)$
3\usepackage{beamerarticle} % needs to be loaded first
4$endif$
5$if(fontfamily)$
6\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
7$else$
8\usepackage{lmodern}
9$endif$
10$if(linestretch)$
11\usepackage{setspace}
12\setstretch{$linestretch$}
13$endif$
14\usepackage{amssymb,amsmath}
15\usepackage{ifxetex,ifluatex}
16\usepackage{fixltx2e} % provides \textsubscript
17\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
18 \usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}
19 \usepackage[utf8]{inputenc}
20$if(euro)$
21 \usepackage{eurosym}
22$endif$
23\else % if luatex or xelatex
24$if(mathspec)$
25 \ifxetex
26 \usepackage{mathspec}
27 \else
28 \usepackage{unicode-math}
29 \fi
30$else$
31 \usepackage{unicode-math}
32$endif$
33 \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
34$for(fontfamilies)$
35 \newfontfamily{$fontfamilies.name$}[$fontfamilies.options$]{$fontfamilies.font$}
36$endfor$
37$if(euro)$
38 \newcommand{\euro}{€}
39$endif$
40$if(mainfont)$
41 \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
42$endif$
43$if(sansfont)$
44 \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$}
45$endif$
46$if(monofont)$
47 \setmonofont[Mapping=tex-ansi$if(monofontoptions)$,$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$endif$]{$monofont$}
48$endif$
49$if(mathfont)$
50$if(mathspec)$
51 \ifxetex
52 \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
53 \else
54 \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
55 \fi
56$else$
57 \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
58$endif$
59$endif$
60$if(CJKmainfont)$
61 \usepackage{xeCJK}
62 \setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
63$endif$
64\fi
65% use upquote if available, for straight quotes in verbatim environments
66\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
67% use microtype if available
68\IfFileExists{microtype.sty}{%
69\usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype}
70\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
71}{}
72\PassOptionsToPackage{hyphens}{url} % url is loaded by hyperref
73$if(verbatim-in-note)$
74\usepackage{fancyvrb}
75$endif$
76\usepackage[unicode=true]{hyperref}
77$if(colorlinks)$
78\PassOptionsToPackage{usenames,dvipsnames}{color} % color is loaded by hyperref
79$endif$
80\hypersetup{
81$if(title-meta)$
82 pdftitle={$title-meta$},
83$endif$
84$if(author-meta)$
85 pdfauthor={$author-meta$},
86$endif$
87$if(keywords)$
88 pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$},
89$endif$
90$if(colorlinks)$
91 colorlinks=true,
92 linkcolor=$if(linkcolor)$$linkcolor$$else$Maroon$endif$,
93 citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$,
94 urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$,
95$else$
96 pdfborder={0 0 0},
97$endif$
98 breaklinks=true}
99\urlstyle{same} % don't use monospace font for urls
100$if(verbatim-in-note)$
101\VerbatimFootnotes % allows verbatim text in footnotes
102$endif$
103$if(geometry)$
104\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
105$endif$
106$if(lang)$
107\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
108 \usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
109$if(babel-newcommands)$
110 $babel-newcommands$
111$endif$
112\else
113 \usepackage{polyglossia}
114 \setmainlanguage[$polyglossia-lang.options$]{$polyglossia-lang.name$}
115$for(polyglossia-otherlangs)$
116 \setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$}
117$endfor$
118\fi
119$endif$
120$if(natbib)$
121\usepackage{natbib}
122\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
123$endif$
124$if(biblatex)$
125\usepackage[$if(biblio-style)$style=$biblio-style$,$endif$$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex}
126$for(bibliography)$
127\addbibresource{$bibliography$}
128$endfor$
129$endif$
130$if(listings)$
131\usepackage{listings}
132$endif$
133$if(lhs)$
134\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
135$endif$
136$if(highlighting-macros)$
137$highlighting-macros$
138$endif$
139$if(tables)$
140\usepackage{longtable,booktabs}
141% Fix footnotes in tables (requires footnote package)
142\IfFileExists{footnote.sty}{\usepackage{footnote}\makesavenoteenv{long table}}{}
143$endif$
144$if(graphics)$
145\usepackage{graphicx,grffile}
146\makeatletter
147\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
148\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
149\makeatother
150% Scale images if necessary, so that they will not overflow the page
151% margins by default, and it is still possible to overwrite the defaults
152% using explicit options in \includegraphics[width, height, ...]{}
153\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
154$endif$
155$if(links-as-notes)$
156% Make links footnotes instead of hotlinks:
157\renewcommand{\href}[2]{#2\footnote{\url{#1}}}
158$endif$
159$if(strikeout)$
160\usepackage[normalem]{ulem}
161% avoid problems with \sout in headers with hyperref:
162\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
163$endif$
164$if(indent)$
165$else$
166\IfFileExists{parskip.sty}{%
167\usepackage{parskip}
168}{% else
169\setlength{\parindent}{0pt}
170\setlength{\parskip}{6pt plus 2pt minus 1pt}
172$endif$
173\setlength{\emergencystretch}{3em} % prevent overfull lines
174\providecommand{\tightlist}{%
175 \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
176$if(numbersections)$
177\setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$}
178$else$
179\setcounter{secnumdepth}{0}
180$endif$
181$if(subparagraph)$
182$else$
183% Redefines (sub)paragraphs to behave more like sections
184\ifx\paragraph\undefined\else
185\let\oldparagraph\paragraph
186\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
187\fi
188\ifx\subparagraph\undefined\else
189\let\oldsubparagraph\subparagraph
190\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
191\fi
192$endif$
193$if(dir)$
194\ifxetex
195 % load bidi as late as possible as it modifies e.g. graphicx
196 $if(latex-dir-rtl)$
197 \usepackage[RTLdocument]{bidi}
198 $else$
199 \usepackage{bidi}
200 $endif$
201\fi
202\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
203 \TeXXeTstate=1
204 \newcommand{\RL}[1]{\beginR #1\endR}
205 \newcommand{\LR}[1]{\beginL #1\endL}
206 \newenvironment{RTL}{\beginR}{\endR}
207 \newenvironment{LTR}{\beginL}{\endL}
208\fi
209$endif$
211% set default figure placement to htbp
212\makeatletter
213\def\fps@figure{htbp}
214\makeatother
216$for(header-includes)$
217$header-includes$
218$endfor$
220$if(title)$
221\title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
222$endif$
223$if(subtitle)$
224\providecommand{\subtitle}[1]{}
225\subtitle{$subtitle$}
226$endif$
227$if(author)$
228\author{$for(author)$$author$$sep$ \and $endfor$}
229$endif$
230$if(institute)$
231\providecommand{\institute}[1]{}
232\institute{$for(institute)$$institute$$sep$ \and $endfor$}
233$endif$
234\date{$date$}
236\begin{document}
237$if(title)$
238\maketitle
239$endif$
240$if(abstract)$
241\begin{abstract}
242$abstract$
243\end{abstract}
244$endif$
246$for(include-before)$
247$include-before$
249$endfor$
250$if(toc)$
252$if(colorlinks)$
253\hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$black$endif$}
254$endif$
255\setcounter{tocdepth}{$toc-depth$}
256\tableofcontents
258$endif$
259$if(lot)$
260\listoftables
261$endif$
262$if(lof)$
263\listoffigures
264$endif$
265$body$
267$if(natbib)$
268$if(bibliography)$
269$if(biblio-title)$
270$if(book-class)$
271\renewcommand\bibname{$biblio-title$}
272$else$
273\renewcommand\refname{$biblio-title$}
274$endif$
275$endif$
276\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
278$endif$
279$endif$
280$if(biblatex)$
281\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
283$endif$
284$for(include-after)$
285$include-after$
287$endfor$
288\end{document}