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