default.latex 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  1. \PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
  2. \PassOptionsToPackage{hyphens}{url}
  3. $if(colorlinks)$
  4. \PassOptionsToPackage{dvipsnames,svgnames*,x11names*}{xcolor}
  5. $endif$
  6. %
  7. \documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(papersize)$$papersize$paper,$endif$$if(beamer)$ignorenonframetext,$if(handout)$handout,$endif$$if(aspectratio)$aspectratio=$aspectratio$,$endif$$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
  8. $if(beamer)$
  9. \setbeamertemplate{caption}[numbered]
  10. \setbeamertemplate{caption label separator}{: }
  11. \setbeamercolor{caption name}{fg=normal text.fg}
  12. \beamertemplatenavigationsymbols$if(navigation)$$navigation$$else$empty$endif$
  13. $endif$
  14. $if(beamerarticle)$
  15. \usepackage{beamerarticle} % needs to be loaded first
  16. $endif$
  17. $if(fontfamily)$
  18. \usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
  19. $else$
  20. \usepackage{lmodern}
  21. $endif$
  22. $if(linestretch)$
  23. \usepackage{setspace}
  24. \setstretch{$linestretch$}
  25. $endif$
  26. \usepackage{amssymb,amsmath}
  27. \usepackage{ifxetex,ifluatex}
  28. \usepackage{fixltx2e} % provides \textsubscript
  29. \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  30. \usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}
  31. \usepackage[utf8]{inputenc}
  32. \usepackage{textcomp} % provides euro and other symbols
  33. \else % if luatex or xelatex
  34. $if(mathspec)$
  35. \ifxetex
  36. \usepackage{mathspec}
  37. \else
  38. \usepackage{unicode-math}
  39. \fi
  40. $else$
  41. \usepackage{unicode-math}
  42. $endif$
  43. \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
  44. $for(fontfamilies)$
  45. \newfontfamily{$fontfamilies.name$}[$fontfamilies.options$]{$fontfamilies.font$}
  46. $endfor$
  47. $if(mainfont)$
  48. \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
  49. $endif$
  50. $if(sansfont)$
  51. \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$}
  52. $endif$
  53. $if(monofont)$
  54. \setmonofont[Mapping=tex-ansi$if(monofontoptions)$,$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$endif$]{$monofont$}
  55. $endif$
  56. $if(mathfont)$
  57. $if(mathspec)$
  58. \ifxetex
  59. \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
  60. \else
  61. \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
  62. \fi
  63. $else$
  64. \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
  65. $endif$
  66. $endif$
  67. $if(CJKmainfont)$
  68. \ifxetex
  69. \usepackage{xeCJK}
  70. \setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
  71. \fi
  72. $endif$
  73. $if(luatexjapresetoptions)$
  74. \ifluatex
  75. \usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset}
  76. \fi
  77. $endif$
  78. $if(CJKmainfont)$
  79. \ifluatex
  80. \usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec}
  81. \setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
  82. \fi
  83. $endif$
  84. \fi
  85. $if(beamer)$
  86. $if(theme)$
  87. \usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$}
  88. $endif$
  89. $if(colortheme)$
  90. \usecolortheme{$colortheme$}
  91. $endif$
  92. $if(fonttheme)$
  93. \usefonttheme{$fonttheme$}
  94. $endif$
  95. $if(mainfont)$
  96. \usefonttheme{serif} % use mainfont rather than sansfont for slide text
  97. $endif$
  98. $if(innertheme)$
  99. \useinnertheme{$innertheme$}
  100. $endif$
  101. $if(outertheme)$
  102. \useoutertheme{$outertheme$}
  103. $endif$
  104. $endif$
  105. % use upquote if available, for straight quotes in verbatim environments
  106. \IfFileExists{upquote.sty}{\usepackage{upquote}}{}
  107. % use microtype if available
  108. \IfFileExists{microtype.sty}{%
  109. \usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype}
  110. \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
  111. }{}
  112. $if(indent)$
  113. $else$
  114. \IfFileExists{parskip.sty}{%
  115. \usepackage{parskip}
  116. }{% else
  117. \setlength{\parindent}{0pt}
  118. \setlength{\parskip}{6pt plus 2pt minus 1pt}
  119. }
  120. $endif$
  121. $if(verbatim-in-note)$
  122. \usepackage{fancyvrb}
  123. $endif$
  124. $if(colorlinks)$
  125. \usepackage{xcolor}
  126. $endif$
  127. \usepackage{hyperref}
  128. \hypersetup{
  129. $if(title-meta)$
  130. pdftitle={$title-meta$},
  131. $endif$
  132. $if(author-meta)$
  133. pdfauthor={$author-meta$},
  134. $endif$
  135. $if(keywords)$
  136. pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$},
  137. $endif$
  138. $if(colorlinks)$
  139. colorlinks=true,
  140. linkcolor=$if(linkcolor)$$linkcolor$$else$Maroon$endif$,
  141. citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$,
  142. urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$,
  143. $else$
  144. pdfborder={0 0 0},
  145. $endif$
  146. breaklinks=true}
  147. \urlstyle{same} % don't use monospace font for urls
  148. $if(verbatim-in-note)$
  149. \VerbatimFootnotes % allows verbatim text in footnotes
  150. $endif$
  151. $if(geometry)$
  152. \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
  153. $endif$
  154. $if(beamer)$
  155. \newif\ifbibliography
  156. $endif$
  157. $if(natbib)$
  158. \usepackage[$natbiboptions$]{natbib}
  159. \bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
  160. $endif$
  161. $if(biblatex)$
  162. \usepackage[$if(biblio-style)$style=$biblio-style$,$endif$$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex}
  163. $for(bibliography)$
  164. \addbibresource{$bibliography$}
  165. $endfor$
  166. $endif$
  167. $if(listings)$
  168. \usepackage{listings}
  169. \newcommand{\passthrough}[1]{#1}
  170. $endif$
  171. $if(lhs)$
  172. \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
  173. $endif$
  174. $if(highlighting-macros)$
  175. $highlighting-macros$
  176. $endif$
  177. $if(tables)$
  178. \usepackage{longtable,booktabs}
  179. $if(beamer)$
  180. \usepackage{caption}
  181. % These lines are needed to make table captions work with longtable:
  182. \makeatletter
  183. \def\fnum@table{\tablename~\thetable}
  184. \makeatother
  185. $else$
  186. % Fix footnotes in tables (requires footnote package)
  187. \IfFileExists{footnote.sty}{\usepackage{footnote}\makesavenoteenv{longtable}}{}
  188. $endif$
  189. $endif$
  190. $if(graphics)$
  191. \usepackage{graphicx,grffile}
  192. \makeatletter
  193. \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
  194. \def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
  195. \makeatother
  196. % Scale images if necessary, so that they will not overflow the page
  197. % margins by default, and it is still possible to overwrite the defaults
  198. % using explicit options in \includegraphics[width, height, ...]{}
  199. \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
  200. $endif$
  201. $if(beamer)$
  202. % Prevent slide breaks in the middle of a paragraph:
  203. \widowpenalties 1 10000
  204. \raggedbottom
  205. $if(section-titles)$
  206. \AtBeginPart{
  207. \let\insertpartnumber\relax
  208. \let\partname\relax
  209. \frame{\partpage}
  210. }
  211. \AtBeginSection{
  212. \ifbibliography
  213. \else
  214. \let\insertsectionnumber\relax
  215. \let\sectionname\relax
  216. \frame{\sectionpage}
  217. \fi
  218. }
  219. \AtBeginSubsection{
  220. \let\insertsubsectionnumber\relax
  221. \let\subsectionname\relax
  222. \frame{\subsectionpage}
  223. }
  224. $endif$
  225. $endif$
  226. $if(links-as-notes)$
  227. % Make links footnotes instead of hotlinks:
  228. \DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}}
  229. $endif$
  230. $if(strikeout)$
  231. \usepackage[normalem]{ulem}
  232. % avoid problems with \sout in headers with hyperref:
  233. \pdfstringdefDisableCommands{\renewcommand{\sout}{}}
  234. $endif$
  235. \setlength{\emergencystretch}{3em} % prevent overfull lines
  236. \providecommand{\tightlist}{%
  237. \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
  238. $if(numbersections)$
  239. \setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$}
  240. $else$
  241. \setcounter{secnumdepth}{0}
  242. $endif$
  243. $if(beamer)$
  244. $else$
  245. $if(subparagraph)$
  246. $else$
  247. % Redefines (sub)paragraphs to behave more like sections
  248. \ifx\paragraph\undefined\else
  249. \let\oldparagraph\paragraph
  250. \renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
  251. \fi
  252. \ifx\subparagraph\undefined\else
  253. \let\oldsubparagraph\subparagraph
  254. \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
  255. \fi
  256. $endif$
  257. $endif$
  258. % set default figure placement to htbp
  259. \makeatletter
  260. \def\fps@figure{htbp}
  261. \makeatother
  262. $for(header-includes)$
  263. $header-includes$
  264. $endfor$
  265. $if(lang)$
  266. \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  267. \usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
  268. $if(babel-newcommands)$
  269. $babel-newcommands$
  270. $endif$
  271. \else
  272. % load polyglossia as late as possible as it *could* call bidi if RTL lang (e.g. Hebrew or Arabic)
  273. \usepackage{polyglossia}
  274. \setmainlanguage[$polyglossia-lang.options$]{$polyglossia-lang.name$}
  275. $for(polyglossia-otherlangs)$
  276. \setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$}
  277. $endfor$
  278. \fi
  279. $endif$
  280. $if(dir)$
  281. \ifxetex
  282. % load bidi as late as possible as it modifies e.g. graphicx
  283. $if(latex-dir-rtl)$
  284. \usepackage[RTLdocument]{bidi}
  285. $else$
  286. \usepackage{bidi}
  287. $endif$
  288. \fi
  289. \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  290. \TeXXeTstate=1
  291. \newcommand{\RL}[1]{\beginR #1\endR}
  292. \newcommand{\LR}[1]{\beginL #1\endL}
  293. \newenvironment{RTL}{\beginR}{\endR}
  294. \newenvironment{LTR}{\beginL}{\endL}
  295. \fi
  296. $endif$
  297. $if(title)$
  298. \title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
  299. $endif$
  300. $if(subtitle)$
  301. \providecommand{\subtitle}[1]{}
  302. \subtitle{$subtitle$}
  303. $endif$
  304. $if(author)$
  305. \author{$for(author)$$author$$sep$ \and $endfor$}
  306. $endif$
  307. $if(institute)$
  308. \providecommand{\institute}[1]{}
  309. \institute{$for(institute)$$institute$$sep$ \and $endfor$}
  310. $endif$
  311. \date{\small $date$}
  312. $if(beamer)$
  313. $if(titlegraphic)$
  314. \titlegraphic{\includegraphics{$titlegraphic$}}
  315. $endif$
  316. $if(logo)$
  317. \logo{\includegraphics{$logo$}}
  318. $endif$
  319. $endif$
  320. \begin{document}
  321. $if(title)$
  322. $if(beamer)$
  323. \frame{\titlepage}
  324. $else$
  325. \maketitle
  326. $endif$
  327. $if(abstract)$
  328. \begin{abstract}
  329. $abstract$
  330. \end{abstract}
  331. $endif$
  332. $endif$
  333. $for(include-before)$
  334. $include-before$
  335. $endfor$
  336. $if(toc)$
  337. $if(beamer)$
  338. \begin{frame}
  339. \tableofcontents[hideallsubsections]
  340. \end{frame}
  341. $else$
  342. {
  343. $if(colorlinks)$
  344. \hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$$endif$}
  345. $endif$
  346. \setcounter{tocdepth}{$toc-depth$}
  347. \tableofcontents
  348. }
  349. $endif$
  350. $endif$
  351. $if(lot)$
  352. \listoftables
  353. $endif$
  354. $if(lof)$
  355. \listoffigures
  356. $endif$
  357. $body$
  358. \clearpage
  359. $if(natbib)$
  360. $if(bibliography)$
  361. $if(biblio-title)$
  362. $if(book-class)$
  363. \renewcommand\bibname{$biblio-title$}
  364. $else$
  365. \renewcommand\refname{$biblio-title$}
  366. $endif$
  367. $endif$
  368. $if(beamer)$
  369. \begin{frame}[allowframebreaks]{$biblio-title$}
  370. \bibliographytrue
  371. $endif$
  372. \bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
  373. $if(beamer)$
  374. \end{frame}
  375. $endif$
  376. $endif$
  377. $endif$
  378. $if(biblatex)$
  379. $if(beamer)$
  380. \begin{frame}[allowframebreaks]{$biblio-title$}
  381. \bibliographytrue
  382. \printbibliography[heading=none]
  383. \end{frame}
  384. $else$
  385. \printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
  386. $endif$
  387. $endif$
  388. $for(include-after)$
  389. $include-after$
  390. $endfor$
  391. \end{document}