eisvogel.latex 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088
  1. %%
  2. % Copyright (c) 2017 - 2023, Pascal Wagler;
  3. % Copyright (c) 2014 - 2023, John MacFarlane
  4. %
  5. % All rights reserved.
  6. %
  7. % Redistribution and use in source and binary forms, with or without
  8. % modification, are permitted provided that the following conditions
  9. % are met:
  10. %
  11. % - Redistributions of source code must retain the above copyright
  12. % notice, this list of conditions and the following disclaimer.
  13. %
  14. % - Redistributions in binary form must reproduce the above copyright
  15. % notice, this list of conditions and the following disclaimer in the
  16. % documentation and/or other materials provided with the distribution.
  17. %
  18. % - Neither the name of John MacFarlane nor the names of other
  19. % contributors may be used to endorse or promote products derived
  20. % from this software without specific prior written permission.
  21. %
  22. % THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  23. % "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  24. % LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  25. % FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  26. % COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  27. % INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  28. % BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  29. % LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  30. % CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  31. % LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  32. % ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  33. % POSSIBILITY OF SUCH DAMAGE.
  34. %%
  35. %%
  36. % This is the Eisvogel pandoc LaTeX template.
  37. %
  38. % For usage information and examples visit the official GitHub page:
  39. % https://github.com/Wandmalfarbe/pandoc-latex-template
  40. %%
  41. % Options for packages loaded elsewhere
  42. \PassOptionsToPackage{unicode$for(hyperrefoptions)$,$hyperrefoptions$$endfor$}{hyperref}
  43. \PassOptionsToPackage{hyphens}{url}
  44. \PassOptionsToPackage{dvipsnames,svgnames,x11names,table}{xcolor}
  45. $if(CJKmainfont)$
  46. \PassOptionsToPackage{space}{xeCJK}
  47. $endif$
  48. %
  49. \documentclass[
  50. $if(fontsize)$
  51. $fontsize$,
  52. $endif$
  53. $if(papersize)$
  54. $papersize$paper,
  55. $else$
  56. paper=a4,
  57. $endif$
  58. $if(beamer)$
  59. ignorenonframetext,
  60. $if(handout)$
  61. handout,
  62. $endif$
  63. $if(aspectratio)$
  64. aspectratio=$aspectratio$,
  65. $endif$
  66. $endif$
  67. $for(classoption)$
  68. $classoption$$sep$,
  69. $endfor$
  70. ,captions=tableheading
  71. ]{$if(beamer)$$documentclass$$else$$if(book)$scrbook$else$scrartcl$endif$$endif$}
  72. $if(beamer)$
  73. $if(background-image)$
  74. \usebackgroundtemplate{%
  75. \includegraphics[width=\paperwidth]{$background-image$}%
  76. }
  77. % In beamer background-image does not work well when other images are used, so this is the workaround
  78. \pgfdeclareimage[width=\paperwidth,height=\paperheight]{background}{$background-image$}
  79. \usebackgroundtemplate{\pgfuseimage{background}}
  80. $endif$
  81. \usepackage{pgfpages}
  82. \setbeamertemplate{caption}[numbered]
  83. \setbeamertemplate{caption label separator}{: }
  84. \setbeamercolor{caption name}{fg=normal text.fg}
  85. \beamertemplatenavigationsymbols$if(navigation)$$navigation$$else$empty$endif$
  86. $for(beameroption)$
  87. \setbeameroption{$beameroption$}
  88. $endfor$
  89. % Prevent slide breaks in the middle of a paragraph
  90. \widowpenalties 1 10000
  91. \raggedbottom
  92. $if(section-titles)$
  93. \setbeamertemplate{part page}{
  94. \centering
  95. \begin{beamercolorbox}[sep=16pt,center]{part title}
  96. \usebeamerfont{part title}\insertpart\par
  97. \end{beamercolorbox}
  98. }
  99. \setbeamertemplate{section page}{
  100. \centering
  101. \begin{beamercolorbox}[sep=12pt,center]{part title}
  102. \usebeamerfont{section title}\insertsection\par
  103. \end{beamercolorbox}
  104. }
  105. \setbeamertemplate{subsection page}{
  106. \centering
  107. \begin{beamercolorbox}[sep=8pt,center]{part title}
  108. \usebeamerfont{subsection title}\insertsubsection\par
  109. \end{beamercolorbox}
  110. }
  111. \AtBeginPart{
  112. \frame{\partpage}
  113. }
  114. \AtBeginSection{
  115. \ifbibliography
  116. \else
  117. \frame{\sectionpage}
  118. \fi
  119. }
  120. \AtBeginSubsection{
  121. \frame{\subsectionpage}
  122. }
  123. $endif$
  124. $endif$
  125. $if(beamerarticle)$
  126. \usepackage{beamerarticle} % needs to be loaded first
  127. $endif$
  128. \usepackage{amsmath,amssymb}
  129. $if(linestretch)$
  130. \usepackage{setspace}
  131. $else$
  132. % Use setspace anyway because we change the default line spacing.
  133. % The spacing is changed early to affect the titlepage and the TOC.
  134. \usepackage{setspace}
  135. \setstretch{1.2}
  136. $endif$
  137. \usepackage{iftex}
  138. \ifPDFTeX
  139. \usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}
  140. \usepackage[utf8]{inputenc}
  141. \usepackage{textcomp} % provide euro and other symbols
  142. \else % if luatex or xetex
  143. $if(mathspec)$
  144. \ifXeTeX
  145. \usepackage{mathspec} % this also loads fontspec
  146. \else
  147. \usepackage{unicode-math} % this also loads fontspec
  148. \fi
  149. $else$
  150. \usepackage{unicode-math} % this also loads fontspec
  151. $endif$
  152. \defaultfontfeatures{Scale=MatchLowercase}$-- must come before Beamer theme
  153. \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
  154. \fi
  155. $if(fontfamily)$
  156. $else$
  157. $-- Set default font before Beamer theme so the theme can override it
  158. \usepackage{lmodern}
  159. $endif$
  160. $-- Set Beamer theme before user font settings so they can override theme
  161. $if(beamer)$
  162. $if(theme)$
  163. \usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$}
  164. $endif$
  165. $if(colortheme)$
  166. \usecolortheme{$colortheme$}
  167. $endif$
  168. $if(fonttheme)$
  169. \usefonttheme{$fonttheme$}
  170. $endif$
  171. $if(mainfont)$
  172. \usefonttheme{serif} % use mainfont rather than sansfont for slide text
  173. $endif$
  174. $if(innertheme)$
  175. \useinnertheme{$innertheme$}
  176. $endif$
  177. $if(outertheme)$
  178. \useoutertheme{$outertheme$}
  179. $endif$
  180. $endif$
  181. $-- User font settings (must come after default font and Beamer theme)
  182. $if(fontfamily)$
  183. \usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
  184. $endif$
  185. \ifPDFTeX\else
  186. % xetex/luatex font selection
  187. $if(mainfont)$
  188. \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
  189. $endif$
  190. $if(sansfont)$
  191. \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$}
  192. $endif$
  193. $if(monofont)$
  194. \setmonofont[$for(monofontoptions)$$monofontoptions$$sep$,$endfor$]{$monofont$}
  195. $endif$
  196. $for(fontfamilies)$
  197. \newfontfamily{$fontfamilies.name$}[$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$]{$fontfamilies.font$}
  198. $endfor$
  199. $if(mathfont)$
  200. $if(mathspec)$
  201. \ifXeTeX
  202. \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
  203. \else
  204. \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
  205. \fi
  206. $else$
  207. \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
  208. $endif$
  209. $endif$
  210. $if(CJKmainfont)$
  211. \ifXeTeX
  212. \usepackage{xeCJK}
  213. \setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
  214. $if(CJKsansfont)$
  215. \setCJKsansfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKsansfont$}
  216. $endif$
  217. $if(CJKmonofont)$
  218. \setCJKmonofont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmonofont$}
  219. $endif$
  220. \fi
  221. $endif$
  222. $if(luatexjapresetoptions)$
  223. \ifLuaTeX
  224. \usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset}
  225. \fi
  226. $endif$
  227. $if(CJKmainfont)$
  228. \ifLuaTeX
  229. \usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec}
  230. \setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
  231. \fi
  232. $endif$
  233. \fi
  234. $if(zero-width-non-joiner)$
  235. %% Support for zero-width non-joiner characters.
  236. \makeatletter
  237. \def\zerowidthnonjoiner{%
  238. % Prevent ligatures and adjust kerning, but still support hyphenating.
  239. \texorpdfstring{%
  240. \TextOrMath{\nobreak\discretionary{-}{}{\kern.03em}%
  241. \ifvmode\else\nobreak\hskip\z@skip\fi}{}%
  242. }{}%
  243. }
  244. \makeatother
  245. \ifPDFTeX
  246. \DeclareUnicodeCharacter{200C}{\zerowidthnonjoiner}
  247. \else
  248. \catcode`^^^^200c=\active
  249. \protected\def ^^^^200c{\zerowidthnonjoiner}
  250. \fi
  251. %% End of ZWNJ support
  252. $endif$
  253. % Use upquote if available, for straight quotes in verbatim environments
  254. \IfFileExists{upquote.sty}{\usepackage{upquote}}{}
  255. \IfFileExists{microtype.sty}{% use microtype if available
  256. \usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype}
  257. \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
  258. }{}
  259. $if(indent)$
  260. $else$
  261. \makeatletter
  262. \@ifundefined{KOMAClassName}{% if non-KOMA class
  263. \IfFileExists{parskip.sty}{%
  264. \usepackage{parskip}
  265. }{% else
  266. \setlength{\parindent}{0pt}
  267. \setlength{\parskip}{6pt plus 2pt minus 1pt}}
  268. }{% if KOMA class
  269. \KOMAoptions{parskip=half}}
  270. \makeatother
  271. $endif$
  272. $if(verbatim-in-note)$
  273. \usepackage{fancyvrb}
  274. $endif$
  275. \usepackage{xcolor}
  276. \definecolor{default-linkcolor}{HTML}{A50000}
  277. \definecolor{default-filecolor}{HTML}{A50000}
  278. \definecolor{default-citecolor}{HTML}{4077C0}
  279. \definecolor{default-urlcolor}{HTML}{4077C0}
  280. $if(footnotes-pretty)$
  281. % load footmisc in order to customize footnotes (footmisc has to be loaded before hyperref, cf. https://tex.stackexchange.com/a/169124/144087)
  282. \usepackage[hang,flushmargin,bottom,multiple]{footmisc}
  283. \setlength{\footnotemargin}{0.8em} % set space between footnote nr and text
  284. \setlength{\footnotesep}{\baselineskip} % set space between multiple footnotes
  285. \setlength{\skip\footins}{0.3cm} % set space between page content and footnote
  286. \setlength{\footskip}{0.9cm} % set space between footnote and page bottom
  287. $endif$
  288. $if(geometry)$
  289. $if(beamer)$
  290. \geometry{$for(geometry)$$geometry$$sep$,$endfor$}
  291. $else$
  292. \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
  293. $endif$
  294. $else$
  295. $if(beamer)$
  296. $else$
  297. \usepackage[margin=2.5cm,includehead=true,includefoot=true,centering,$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
  298. $endif$
  299. $endif$
  300. $if(titlepage-logo)$
  301. \usepackage[export]{adjustbox}
  302. \usepackage{graphicx}
  303. $endif$
  304. $if(beamer)$
  305. \newif\ifbibliography
  306. $endif$
  307. $if(listings)$
  308. \usepackage{listings}
  309. \newcommand{\passthrough}[1]{#1}
  310. \lstset{defaultdialect=[5.3]Lua}
  311. \lstset{defaultdialect=[x86masm]Assembler}
  312. $endif$
  313. $if(listings-no-page-break)$
  314. \usepackage{etoolbox}
  315. \BeforeBeginEnvironment{lstlisting}{\par\noindent\begin{minipage}{\linewidth}}
  316. \AfterEndEnvironment{lstlisting}{\end{minipage}\par\addvspace{\topskip}}
  317. $endif$
  318. $if(lhs)$
  319. \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
  320. $endif$
  321. $if(highlighting-macros)$
  322. $highlighting-macros$
  323. % Workaround/bugfix from jannick0.
  324. % See https://github.com/jgm/pandoc/issues/4302#issuecomment-360669013)
  325. % or https://github.com/Wandmalfarbe/pandoc-latex-template/issues/2
  326. %
  327. % Redefine the verbatim environment 'Highlighting' to break long lines (with
  328. % the help of fvextra). Redefinition is necessary because it is unlikely that
  329. % pandoc includes fvextra in the default template.
  330. \usepackage{fvextra}
  331. \DefineVerbatimEnvironment{Highlighting}{Verbatim}{breaklines,fontsize=$if(code-block-font-size)$$code-block-font-size$$else$\small$endif$,commandchars=\\\{\}}
  332. $endif$
  333. $if(tables)$
  334. \usepackage{longtable,booktabs,array}
  335. $if(multirow)$
  336. \usepackage{multirow}
  337. $endif$
  338. \usepackage{calc} % for calculating minipage widths
  339. $if(beamer)$
  340. \usepackage{caption}
  341. % Make caption package work with longtable
  342. \makeatletter
  343. \def\fnum@table{\tablename~\thetable}
  344. \makeatother
  345. $else$
  346. % Correct order of tables after \paragraph or \subparagraph
  347. \usepackage{etoolbox}
  348. \makeatletter
  349. \patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
  350. \makeatother
  351. % Allow footnotes in longtable head/foot
  352. \IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
  353. \makesavenoteenv{longtable}
  354. $endif$
  355. $endif$
  356. % add backlinks to footnote references, cf. https://tex.stackexchange.com/questions/302266/make-footnote-clickable-both-ways
  357. $if(footnotes-disable-backlinks)$
  358. $else$
  359. \usepackage{footnotebackref}
  360. $endif$
  361. $if(graphics)$
  362. \usepackage{graphicx}
  363. \makeatletter
  364. \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
  365. \def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
  366. \makeatother
  367. % Scale images if necessary, so that they will not overflow the page
  368. % margins by default, and it is still possible to overwrite the defaults
  369. % using explicit options in \includegraphics[width, height, ...]{}
  370. \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
  371. % Set default figure placement to htbp
  372. \makeatletter
  373. % Make use of float-package and set default placement for figures to H.
  374. % The option H means 'PUT IT HERE' (as opposed to the standard h option which means 'You may put it here if you like').
  375. \usepackage{float}
  376. \floatplacement{figure}{$if(float-placement-figure)$$float-placement-figure$$else$H$endif$}
  377. \makeatother
  378. $endif$
  379. $if(svg)$
  380. \usepackage{svg}
  381. $endif$
  382. $if(strikeout)$
  383. $-- also used for underline
  384. \ifLuaTeX
  385. \usepackage{luacolor}
  386. \usepackage[soul]{lua-ul}
  387. \else
  388. \usepackage{soul}
  389. \fi
  390. $endif$
  391. \setlength{\emergencystretch}{3em} % prevent overfull lines
  392. \providecommand{\tightlist}{%
  393. \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
  394. $if(numbersections)$
  395. \setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$}
  396. $else$
  397. \setcounter{secnumdepth}{-\maxdimen} % remove section numbering
  398. $endif$
  399. $if(subfigure)$
  400. \usepackage{subcaption}
  401. $endif$
  402. $if(beamer)$
  403. $else$
  404. $if(block-headings)$
  405. % Make \paragraph and \subparagraph free-standing
  406. \ifx\paragraph\undefined\else
  407. \let\oldparagraph\paragraph
  408. \renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
  409. \fi
  410. \ifx\subparagraph\undefined\else
  411. \let\oldsubparagraph\subparagraph
  412. \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
  413. \fi
  414. $endif$
  415. $endif$
  416. $if(pagestyle)$
  417. \pagestyle{$pagestyle$}
  418. $endif$
  419. $if(csl-refs)$
  420. \newlength{\cslhangindent}
  421. \setlength{\cslhangindent}{1.5em}
  422. \newlength{\csllabelwidth}
  423. \setlength{\csllabelwidth}{3em}
  424. \newlength{\cslentryspacingunit} % times entry-spacing
  425. \setlength{\cslentryspacingunit}{\parskip}
  426. \newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing
  427. {% don't indent paragraphs
  428. \setlength{\parindent}{0pt}
  429. % turn on hanging indent if param 1 is 1
  430. \ifodd #1
  431. \let\oldpar\par
  432. \def\par{\hangindent=\cslhangindent\oldpar}
  433. \fi
  434. % set entry spacing
  435. \setlength{\parskip}{#2\cslentryspacingunit}
  436. }%
  437. {}
  438. \usepackage{calc}
  439. \newcommand{\CSLBlock}[1]{#1\hfill\break}
  440. \newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
  441. \newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break}
  442. \newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
  443. $endif$
  444. $if(lang)$
  445. \ifLuaTeX
  446. \usepackage[bidi=basic]{babel}
  447. \else
  448. \usepackage[bidi=default]{babel}
  449. \fi
  450. $if(babel-lang)$
  451. \babelprovide[main,import]{$babel-lang$}
  452. $if(mainfont)$
  453. \ifPDFTeX
  454. \else
  455. \babelfont{rm}[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
  456. \fi
  457. $endif$
  458. $endif$
  459. $for(babel-otherlangs)$
  460. \babelprovide[import]{$babel-otherlangs$}
  461. $endfor$
  462. $for(babelfonts/pairs)$
  463. \babelfont[$babelfonts.key$]{rm}{$babelfonts.value$}
  464. $endfor$
  465. % get rid of language-specific shorthands (see #6817):
  466. \let\LanguageShortHands\languageshorthands
  467. \def\languageshorthands#1{}
  468. $endif$
  469. $for(header-includes)$
  470. $header-includes$
  471. $endfor$
  472. \ifLuaTeX
  473. \usepackage{selnolig} % disable illegal ligatures
  474. \fi
  475. $if(dir)$
  476. \ifPDFTeX
  477. \TeXXeTstate=1
  478. \newcommand{\RL}[1]{\beginR #1\endR}
  479. \newcommand{\LR}[1]{\beginL #1\endL}
  480. \newenvironment{RTL}{\beginR}{\endR}
  481. \newenvironment{LTR}{\beginL}{\endL}
  482. \fi
  483. $endif$
  484. $if(natbib)$
  485. \usepackage[$natbiboptions$]{natbib}
  486. \bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
  487. $endif$
  488. $if(biblatex)$
  489. \usepackage[$if(biblio-style)$style=$biblio-style$,$endif$$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex}
  490. $for(bibliography)$
  491. \addbibresource{$bibliography$}
  492. $endfor$
  493. $endif$
  494. $if(nocite-ids)$
  495. \nocite{$for(nocite-ids)$$it$$sep$, $endfor$}
  496. $endif$
  497. $if(csquotes)$
  498. \usepackage{csquotes}
  499. $endif$
  500. \IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
  501. \IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
  502. \urlstyle{$if(urlstyle)$$urlstyle$$else$same$endif$}
  503. $if(links-as-notes)$
  504. % Make links footnotes instead of hotlinks:
  505. \DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}}
  506. $endif$
  507. $if(verbatim-in-note)$
  508. \VerbatimFootnotes % allow verbatim text in footnotes
  509. $endif$
  510. \hypersetup{
  511. $if(title-meta)$
  512. pdftitle={$title-meta$},
  513. $endif$
  514. $if(author-meta)$
  515. pdfauthor={$author-meta$},
  516. $endif$
  517. $if(lang)$
  518. pdflang={$lang$},
  519. $endif$
  520. $if(subject)$
  521. pdfsubject={$subject$},
  522. $endif$
  523. $if(keywords)$
  524. pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$},
  525. $endif$
  526. $if(colorlinks)$
  527. colorlinks=true,
  528. linkcolor={$if(linkcolor)$$linkcolor$$else$default-linkcolor$endif$},
  529. filecolor={$if(filecolor)$$filecolor$$else$default-filecolor$endif$},
  530. citecolor={$if(citecolor)$$citecolor$$else$default-citecolor$endif$},
  531. urlcolor={$if(urlcolor)$$urlcolor$$else$default-urlcolor$endif$},
  532. $else$
  533. hidelinks,
  534. $endif$
  535. breaklinks=true,
  536. pdfcreator={LaTeX via pandoc with the Eisvogel template}}
  537. $if(title)$
  538. \title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
  539. $endif$
  540. $if(subtitle)$
  541. $if(beamer)$
  542. $else$
  543. \usepackage{etoolbox}
  544. \makeatletter
  545. \providecommand{\subtitle}[1]{% add subtitle to \maketitle
  546. \apptocmd{\@title}{\par {\large #1 \par}}{}{}
  547. }
  548. \makeatother
  549. $endif$
  550. \subtitle{$subtitle$}
  551. $endif$
  552. \author{$for(author)$$author$$sep$ \and $endfor$}
  553. \date{$date$}
  554. $if(beamer)$
  555. $if(institute)$
  556. \institute{$for(institute)$$institute$$sep$ \and $endfor$}
  557. $endif$
  558. $if(titlegraphic)$
  559. \titlegraphic{\includegraphics{$titlegraphic$}}
  560. $endif$
  561. $if(logo)$
  562. \logo{\includegraphics{$logo$}}
  563. $endif$
  564. $endif$
  565. %%
  566. %% added
  567. %%
  568. $if(page-background)$
  569. \usepackage[pages=all]{background}
  570. $endif$
  571. %
  572. % for the background color of the title page
  573. %
  574. $if(titlepage)$
  575. \usepackage{pagecolor}
  576. \usepackage{afterpage}
  577. $if(titlepage-background)$
  578. \usepackage{tikz}
  579. $endif$
  580. $if(geometry)$
  581. $else$
  582. \usepackage[margin=2.5cm,includehead=true,includefoot=true,centering]{geometry}
  583. $endif$
  584. $endif$
  585. %
  586. % break urls
  587. %
  588. \PassOptionsToPackage{hyphens}{url}
  589. %
  590. % When using babel or polyglossia with biblatex, loading csquotes is recommended
  591. % to ensure that quoted texts are typeset according to the rules of your main language.
  592. %
  593. \usepackage{csquotes}
  594. %
  595. % captions
  596. %
  597. \definecolor{caption-color}{HTML}{777777}
  598. $if(beamer)$
  599. $else$
  600. \usepackage[font={stretch=1.2}, textfont={color=caption-color}, position=top, skip=4mm, labelfont=bf, singlelinecheck=false, justification=$if(caption-justification)$$caption-justification$$else$raggedright$endif$]{caption}
  601. \setcapindent{0em}
  602. $endif$
  603. %
  604. % blockquote
  605. %
  606. \definecolor{blockquote-border}{RGB}{221,221,221}
  607. \definecolor{blockquote-text}{RGB}{119,119,119}
  608. \usepackage{mdframed}
  609. \newmdenv[rightline=false,bottomline=false,topline=false,linewidth=3pt,linecolor=blockquote-border,skipabove=\parskip]{customblockquote}
  610. \renewenvironment{quote}{\begin{customblockquote}\list{}{\rightmargin=0em\leftmargin=0em}%
  611. \item\relax\color{blockquote-text}\ignorespaces}{\unskip\unskip\endlist\end{customblockquote}}
  612. %
  613. % Source Sans Pro as the de­fault font fam­ily
  614. % Source Code Pro for monospace text
  615. %
  616. % 'default' option sets the default
  617. % font family to Source Sans Pro, not \sfdefault.
  618. %
  619. \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  620. $if(fontfamily)$
  621. $else$
  622. \usepackage[default]{sourcesanspro}
  623. \usepackage{sourcecodepro}
  624. $endif$
  625. \else % if not pdftex
  626. $if(mainfont)$
  627. $else$
  628. \usepackage[default]{sourcesanspro}
  629. \usepackage{sourcecodepro}
  630. % XeLaTeX specific adjustments for straight quotes: https://tex.stackexchange.com/a/354887
  631. % This issue is already fixed (see https://github.com/silkeh/latex-sourcecodepro/pull/5) but the
  632. % fix is still unreleased.
  633. % TODO: Remove this workaround when the new version of sourcecodepro is released on CTAN.
  634. \ifxetex
  635. \makeatletter
  636. \defaultfontfeatures[\ttfamily]
  637. { Numbers = \sourcecodepro@figurestyle,
  638. Scale = \SourceCodePro@scale,
  639. Extension = .otf }
  640. \setmonofont
  641. [ UprightFont = *-\sourcecodepro@regstyle,
  642. ItalicFont = *-\sourcecodepro@regstyle It,
  643. BoldFont = *-\sourcecodepro@boldstyle,
  644. BoldItalicFont = *-\sourcecodepro@boldstyle It ]
  645. {SourceCodePro}
  646. \makeatother
  647. \fi
  648. $endif$
  649. \fi
  650. %
  651. % heading color
  652. %
  653. \definecolor{heading-color}{RGB}{40,40,40}
  654. $if(beamer)$
  655. $else$
  656. \addtokomafont{section}{\color{heading-color}}
  657. $endif$
  658. % When using the classes report, scrreprt, book,
  659. % scrbook or memoir, uncomment the following line.
  660. %\addtokomafont{chapter}{\color{heading-color}}
  661. %
  662. % variables for title, author and date
  663. %
  664. $if(beamer)$
  665. $else$
  666. \usepackage{titling}
  667. \title{$title$}
  668. \author{$for(author)$$author$$sep$, $endfor$}
  669. \date{$date$}
  670. $endif$
  671. %
  672. % tables
  673. %
  674. $if(tables)$
  675. \definecolor{table-row-color}{HTML}{F5F5F5}
  676. \definecolor{table-rule-color}{HTML}{999999}
  677. %\arrayrulecolor{black!40}
  678. \arrayrulecolor{table-rule-color} % color of \toprule, \midrule, \bottomrule
  679. \setlength\heavyrulewidth{0.3ex} % thickness of \toprule, \bottomrule
  680. \renewcommand{\arraystretch}{1.3} % spacing (padding)
  681. $if(table-use-row-colors)$
  682. % TODO: This doesn't work anymore. I don't know why.
  683. % Reset rownum counter so that each table
  684. % starts with the same row colors.
  685. % https://tex.stackexchange.com/questions/170637/restarting-rowcolors
  686. %
  687. % Unfortunately the colored cells extend beyond the edge of the
  688. % table because pandoc uses @-expressions (@{}) like so:
  689. %
  690. % \begin{longtable}[]{@{}ll@{}}
  691. % \end{longtable}
  692. %
  693. % https://en.wikibooks.org/wiki/LaTeX/Tables#.40-expressions
  694. \let\oldlongtable\longtable
  695. \let\endoldlongtable\endlongtable
  696. \renewenvironment{longtable}{
  697. \rowcolors{3}{}{table-row-color!100} % row color
  698. \oldlongtable} {
  699. \endoldlongtable
  700. \global\rownum=0\relax}
  701. $endif$
  702. $endif$
  703. %
  704. % remove paragraph indention
  705. %
  706. \setlength{\parindent}{0pt}
  707. \setlength{\parskip}{6pt plus 2pt minus 1pt}
  708. \setlength{\emergencystretch}{3em} % prevent overfull lines
  709. %
  710. %
  711. % Listings
  712. %
  713. %
  714. $if(listings)$
  715. %
  716. % general listing colors
  717. %
  718. \definecolor{listing-background}{HTML}{F7F7F7}
  719. \definecolor{listing-rule}{HTML}{B3B2B3}
  720. \definecolor{listing-numbers}{HTML}{B3B2B3}
  721. \definecolor{listing-text-color}{HTML}{000000}
  722. \definecolor{listing-keyword}{HTML}{435489}
  723. \definecolor{listing-keyword-2}{HTML}{1284CA} % additional keywords
  724. \definecolor{listing-keyword-3}{HTML}{9137CB} % additional keywords
  725. \definecolor{listing-identifier}{HTML}{435489}
  726. \definecolor{listing-string}{HTML}{00999A}
  727. \definecolor{listing-comment}{HTML}{8E8E8E}
  728. \lstdefinestyle{eisvogel_listing_style}{
  729. language = java,
  730. $if(listings-disable-line-numbers)$
  731. xleftmargin = 0.6em,
  732. framexleftmargin = 0.4em,
  733. $else$
  734. numbers = left,
  735. xleftmargin = 2.7em,
  736. framexleftmargin = 2.5em,
  737. $endif$
  738. backgroundcolor = \color{listing-background},
  739. basicstyle = \color{listing-text-color}\linespread{1.0}%
  740. \lst@ifdisplaystyle%
  741. $if(code-block-font-size)$$code-block-font-size$$else$\small$endif$%
  742. \fi\ttfamily{},
  743. breaklines = true,
  744. frame = single,
  745. framesep = 0.19em,
  746. rulecolor = \color{listing-rule},
  747. frameround = ffff,
  748. tabsize = 4,
  749. numberstyle = \color{listing-numbers},
  750. aboveskip = 1.0em,
  751. belowskip = 0.1em,
  752. abovecaptionskip = 0em,
  753. belowcaptionskip = 1.0em,
  754. keywordstyle = {\color{listing-keyword}\bfseries},
  755. keywordstyle = {[2]\color{listing-keyword-2}\bfseries},
  756. keywordstyle = {[3]\color{listing-keyword-3}\bfseries\itshape},
  757. sensitive = true,
  758. identifierstyle = \color{listing-identifier},
  759. commentstyle = \color{listing-comment},
  760. stringstyle = \color{listing-string},
  761. showstringspaces = false,
  762. escapeinside = {/*@}{@*/}, % Allow LaTeX inside these special comments
  763. literate =
  764. {á}{{\'a}}1 {é}{{\'e}}1 {í}{{\'i}}1 {ó}{{\'o}}1 {ú}{{\'u}}1
  765. {Á}{{\'A}}1 {É}{{\'E}}1 {Í}{{\'I}}1 {Ó}{{\'O}}1 {Ú}{{\'U}}1
  766. {à}{{\`a}}1 {è}{{\`e}}1 {ì}{{\`i}}1 {ò}{{\`o}}1 {ù}{{\`u}}1
  767. {À}{{\`A}}1 {È}{{\`E}}1 {Ì}{{\`I}}1 {Ò}{{\`O}}1 {Ù}{{\`U}}1
  768. {ä}{{\"a}}1 {ë}{{\"e}}1 {ï}{{\"i}}1 {ö}{{\"o}}1 {ü}{{\"u}}1
  769. {Ä}{{\"A}}1 {Ë}{{\"E}}1 {Ï}{{\"I}}1 {Ö}{{\"O}}1 {Ü}{{\"U}}1
  770. {â}{{\^a}}1 {ê}{{\^e}}1 {î}{{\^i}}1 {ô}{{\^o}}1 {û}{{\^u}}1
  771. {Â}{{\^A}}1 {Ê}{{\^E}}1 {Î}{{\^I}}1 {Ô}{{\^O}}1 {Û}{{\^U}}1
  772. {œ}{{\oe}}1 {Œ}{{\OE}}1 {æ}{{\ae}}1 {Æ}{{\AE}}1 {ß}{{\ss}}1
  773. {ç}{{\c c}}1 {Ç}{{\c C}}1 {ø}{{\o}}1 {å}{{\r a}}1 {Å}{{\r A}}1
  774. {€}{{\EUR}}1 {£}{{\pounds}}1 {«}{{\guillemotleft}}1
  775. {»}{{\guillemotright}}1 {ñ}{{\~n}}1 {Ñ}{{\~N}}1 {¿}{{?`}}1
  776. {…}{{\ldots}}1 {≥}{{>=}}1 {≤}{{<=}}1 {„}{{\glqq}}1 {“}{{\grqq}}1
  777. {”}{{''}}1
  778. }
  779. \lstset{style=eisvogel_listing_style}
  780. %
  781. % Java (Java SE 12, 2019-06-22)
  782. %
  783. \lstdefinelanguage{Java}{
  784. morekeywords={
  785. % normal keywords (without data types)
  786. abstract,assert,break,case,catch,class,continue,default,
  787. do,else,enum,exports,extends,final,finally,for,if,implements,
  788. import,instanceof,interface,module,native,new,package,private,
  789. protected,public,requires,return,static,strictfp,super,switch,
  790. synchronized,this,throw,throws,transient,try,volatile,while,
  791. % var is an identifier
  792. var
  793. },
  794. morekeywords={[2] % data types
  795. % primitive data types
  796. boolean,byte,char,double,float,int,long,short,
  797. % String
  798. String,
  799. % primitive wrapper types
  800. Boolean,Byte,Character,Double,Float,Integer,Long,Short
  801. % number types
  802. Number,AtomicInteger,AtomicLong,BigDecimal,BigInteger,DoubleAccumulator,DoubleAdder,LongAccumulator,LongAdder,Short,
  803. % other
  804. Object,Void,void
  805. },
  806. morekeywords={[3] % literals
  807. % reserved words for literal values
  808. null,true,false,
  809. },
  810. sensitive,
  811. morecomment = [l]//,
  812. morecomment = [s]{/*}{*/},
  813. morecomment = [s]{/**}{*/},
  814. morestring = [b]",
  815. morestring = [b]',
  816. }
  817. \lstdefinelanguage{XML}{
  818. morestring = [b]",
  819. moredelim = [s][\bfseries\color{listing-keyword}]{<}{\ },
  820. moredelim = [s][\bfseries\color{listing-keyword}]{</}{>},
  821. moredelim = [l][\bfseries\color{listing-keyword}]{/>},
  822. moredelim = [l][\bfseries\color{listing-keyword}]{>},
  823. morecomment = [s]{<?}{?>},
  824. morecomment = [s]{<!--}{-->},
  825. commentstyle = \color{listing-comment},
  826. stringstyle = \color{listing-string},
  827. identifierstyle = \color{listing-identifier}
  828. }
  829. $endif$
  830. %
  831. % header and footer
  832. %
  833. $if(beamer)$
  834. $else$
  835. $if(disable-header-and-footer)$
  836. $else$
  837. \usepackage[headsepline,footsepline]{scrlayer-scrpage}
  838. \newpairofpagestyles{eisvogel-header-footer}{
  839. \clearpairofpagestyles
  840. \ihead*{$if(header-left)$$header-left$$else$$title$$endif$}
  841. \chead*{$if(header-center)$$header-center$$else$$endif$}
  842. \ohead*{$if(header-right)$$header-right$$else$$date$$endif$}
  843. \ifoot*{$if(footer-left)$$footer-left$$else$$for(author)$$author$$sep$, $endfor$$endif$}
  844. \cfoot*{$if(footer-center)$$footer-center$$else$$endif$}
  845. \ofoot*{$if(footer-right)$$footer-right$$else$\thepage$endif$}
  846. \addtokomafont{pageheadfoot}{\upshape}
  847. }
  848. \pagestyle{eisvogel-header-footer}
  849. $if(book)$
  850. \deftripstyle{ChapterStyle}{}{}{}{}{\pagemark}{}
  851. \renewcommand*{\chapterpagestyle}{ChapterStyle}
  852. $endif$
  853. $if(page-background)$
  854. \backgroundsetup{
  855. scale=1,
  856. color=black,
  857. opacity=$if(page-background-opacity)$$page-background-opacity$$else$0.2$endif$,
  858. angle=0,
  859. contents={%
  860. \includegraphics[width=\paperwidth,height=\paperheight]{$page-background$}
  861. }%
  862. }
  863. $endif$
  864. $endif$
  865. $endif$
  866. %%
  867. %% end added
  868. %%
  869. \begin{document}
  870. %%
  871. %% begin titlepage
  872. %%
  873. $if(beamer)$
  874. $else$
  875. $if(titlepage)$
  876. \begin{titlepage}
  877. $if(titlepage-background)$
  878. \newgeometry{top=2cm, right=4cm, bottom=3cm, left=4cm}
  879. $else$
  880. \newgeometry{left=6cm}
  881. $endif$
  882. $if(titlepage-color)$
  883. \definecolor{titlepage-color}{HTML}{$titlepage-color$}
  884. \newpagecolor{titlepage-color}\afterpage{\restorepagecolor}
  885. $endif$
  886. $if(titlepage-background)$
  887. \tikz[remember picture,overlay] \node[inner sep=0pt] at (current page.center){\includegraphics[width=\paperwidth,height=\paperheight]{$titlepage-background$}};
  888. $endif$
  889. \newcommand{\colorRule}[3][black]{\textcolor[HTML]{#1}{\rule{#2}{#3}}}
  890. \begin{flushleft}
  891. \noindent
  892. \\[-1em]
  893. \color[HTML]{$if(titlepage-text-color)$$titlepage-text-color$$else$5F5F5F$endif$}
  894. \makebox[0pt][l]{\colorRule[$if(titlepage-rule-color)$$titlepage-rule-color$$else$435488$endif$]{1.3\textwidth}{$if(titlepage-rule-height)$$titlepage-rule-height$$else$4$endif$pt}}
  895. \par
  896. \noindent
  897. $if(titlepage-background)$
  898. % The titlepage with a background image has other text spacing and text size
  899. {
  900. \setstretch{2}
  901. \vfill
  902. \vskip -8em
  903. \noindent {\huge \textbf{\textsf{$title$}}}
  904. $if(subtitle)$
  905. \vskip 1em
  906. {\Large \textsf{$subtitle$}}
  907. $endif$
  908. \vskip 2em
  909. \noindent {\Large \textsf{$for(author)$$author$$sep$, $endfor$} \vskip 0.6em \textsf{$date$}}
  910. \vfill
  911. }
  912. $else$
  913. {
  914. \setstretch{1.4}
  915. \vfill
  916. \noindent {\huge \textbf{\textsf{$title$}}}
  917. $if(subtitle)$
  918. \vskip 1em
  919. {\Large \textsf{$subtitle$}}
  920. $endif$
  921. \vskip 2em
  922. \noindent {\Large \textsf{$for(author)$$author$$sep$, $endfor$}}
  923. \vfill
  924. }
  925. $endif$
  926. $if(titlepage-logo)$
  927. \noindent
  928. \includegraphics[width=$if(logo-width)$$logo-width$$else$35mm$endif$, left]{$titlepage-logo$}
  929. $endif$
  930. $if(titlepage-background)$
  931. $else$
  932. \textsf{$date$}
  933. $endif$
  934. \end{flushleft}
  935. \end{titlepage}
  936. \restoregeometry
  937. \pagenumbering{arabic}
  938. $endif$
  939. $endif$
  940. %%
  941. %% end titlepage
  942. %%
  943. $if(has-frontmatter)$
  944. \frontmatter
  945. $endif$
  946. $if(title)$
  947. $if(beamer)$
  948. \frame{\titlepage}
  949. % don't generate the default title
  950. % $else$
  951. % \maketitle
  952. $endif$
  953. $if(abstract)$
  954. \begin{abstract}
  955. $abstract$
  956. \end{abstract}
  957. $endif$
  958. $endif$
  959. $if(first-chapter)$
  960. \setcounter{chapter}{$first-chapter$}
  961. \addtocounter{chapter}{-1}
  962. $endif$
  963. $for(include-before)$
  964. $include-before$
  965. $endfor$
  966. $if(toc)$
  967. $if(toc-title)$
  968. \renewcommand*\contentsname{$toc-title$}
  969. $endif$
  970. $if(beamer)$
  971. \begin{frame}[allowframebreaks]
  972. $if(toc-title)$
  973. \frametitle{$toc-title$}
  974. $endif$
  975. \tableofcontents[hideallsubsections]
  976. \end{frame}
  977. $if(toc-own-page)$
  978. \newpage
  979. $endif$
  980. $else$
  981. {
  982. $if(colorlinks)$
  983. \hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$$endif$}
  984. $endif$
  985. \setcounter{tocdepth}{$toc-depth$}
  986. \tableofcontents
  987. $if(toc-own-page)$
  988. \newpage
  989. $endif$
  990. }
  991. $endif$
  992. $endif$
  993. $if(lof)$
  994. \listoffigures
  995. $endif$
  996. $if(lot)$
  997. \listoftables
  998. $endif$
  999. $if(linestretch)$
  1000. \setstretch{$linestretch$}
  1001. $endif$
  1002. $if(has-frontmatter)$
  1003. \mainmatter
  1004. $endif$
  1005. $body$
  1006. $if(has-frontmatter)$
  1007. \backmatter
  1008. $endif$
  1009. $if(natbib)$
  1010. $if(bibliography)$
  1011. $if(biblio-title)$
  1012. $if(has-chapters)$
  1013. \renewcommand\bibname{$biblio-title$}
  1014. $else$
  1015. \renewcommand\refname{$biblio-title$}
  1016. $endif$
  1017. $endif$
  1018. $if(beamer)$
  1019. \begin{frame}[allowframebreaks]{$biblio-title$}
  1020. \bibliographytrue
  1021. $endif$
  1022. \bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
  1023. $if(beamer)$
  1024. \end{frame}
  1025. $endif$
  1026. $endif$
  1027. $endif$
  1028. $if(biblatex)$
  1029. $if(beamer)$
  1030. \begin{frame}[allowframebreaks]{$biblio-title$}
  1031. \bibliographytrue
  1032. \printbibliography[heading=none]
  1033. \end{frame}
  1034. $else$
  1035. \printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
  1036. $endif$
  1037. $endif$
  1038. $for(include-after)$
  1039. $include-after$
  1040. $endfor$
  1041. \end{document}