eisvogel.latex 30 KB

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