eisvogel.latex 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077
  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. \makeatletter
  388. \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
  389. \def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
  390. \makeatother
  391. % Scale images if necessary, so that they will not overflow the page
  392. % margins by default, and it is still possible to overwrite the defaults
  393. % using explicit options in \includegraphics[width, height, ...]{}
  394. \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
  395. % Set default figure placement to htbp
  396. \makeatletter
  397. \def\fps@figure{htbp}
  398. \makeatother
  399. $endif$
  400. $if(links-as-notes)$
  401. % Make links footnotes instead of hotlinks:
  402. \DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}}
  403. $endif$
  404. $if(strikeout)$
  405. $-- also used for underline
  406. \usepackage[normalem]{ulem}
  407. % Avoid problems with \sout in headers with hyperref
  408. \pdfstringdefDisableCommands{\renewcommand{\sout}{}}
  409. $endif$
  410. \setlength{\emergencystretch}{3em} % prevent overfull lines
  411. \providecommand{\tightlist}{%
  412. \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
  413. $if(numbersections)$
  414. \setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$}
  415. $else$
  416. \setcounter{secnumdepth}{-\maxdimen} % remove section numbering
  417. $endif$
  418. $if(beamer)$
  419. $else$
  420. $if(block-headings)$
  421. % Make \paragraph and \subparagraph free-standing
  422. \ifx\paragraph\undefined\else
  423. \let\oldparagraph\paragraph
  424. \renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
  425. \fi
  426. \ifx\subparagraph\undefined\else
  427. \let\oldsubparagraph\subparagraph
  428. \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
  429. \fi
  430. $endif$
  431. $endif$
  432. $if(pagestyle)$
  433. \pagestyle{$pagestyle$}
  434. $endif$
  435. $if(csl-refs)$
  436. \newlength{\cslhangindent}
  437. \setlength{\cslhangindent}{1.5em}
  438. \newlength{\csllabelwidth}
  439. \setlength{\csllabelwidth}{3em}
  440. \newlength{\cslentryspacingunit} % times entry-spacing
  441. \setlength{\cslentryspacingunit}{\parskip}
  442. \newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing
  443. {% don't indent paragraphs
  444. \setlength{\parindent}{0pt}
  445. % turn on hanging indent if param 1 is 1
  446. \ifodd #1
  447. \let\oldpar\par
  448. \def\par{\hangindent=\cslhangindent\oldpar}
  449. \fi
  450. % set entry spacing
  451. \setlength{\parskip}{#2\cslentryspacingunit}
  452. }%
  453. {}
  454. \usepackage{calc}
  455. \newcommand{\CSLBlock}[1]{#1\hfill\break}
  456. \newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
  457. \newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break}
  458. \newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
  459. $endif$
  460. $for(header-includes)$
  461. $header-includes$
  462. $endfor$
  463. $if(lang)$
  464. \usepackage[$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
  465. % get rid of language-specific shorthands (see #6817):
  466. \let\LanguageShortHands\languageshorthands
  467. \def\languageshorthands#1{}
  468. $endif$
  469. \ifLuaTeX
  470. \usepackage{selnolig} % disable illegal ligatures
  471. \fi
  472. $if(dir)$
  473. \ifXeTeX
  474. % Load bidi as late as possible as it modifies e.g. graphicx
  475. \usepackage{bidi}
  476. \fi
  477. \ifPDFTeX
  478. \TeXXeTstate=1
  479. \newcommand{\RL}[1]{\beginR #1\endR}
  480. \newcommand{\LR}[1]{\beginL #1\endL}
  481. \newenvironment{RTL}{\beginR}{\endR}
  482. \newenvironment{LTR}{\beginL}{\endL}
  483. \fi
  484. $endif$
  485. $if(natbib)$
  486. \usepackage[$natbiboptions$]{natbib}
  487. \bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
  488. $endif$
  489. $if(biblatex)$
  490. \usepackage[$if(biblio-style)$style=$biblio-style$,$endif$$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex}
  491. $for(bibliography)$
  492. \addbibresource{$bibliography$}
  493. $endfor$
  494. $endif$
  495. $if(nocite-ids)$
  496. \nocite{$for(nocite-ids)$$it$$sep$, $endfor$}
  497. $endif$
  498. $if(csquotes)$
  499. \usepackage{csquotes}
  500. $endif$
  501. $if(title)$
  502. \title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
  503. $endif$
  504. $if(subtitle)$
  505. $if(beamer)$
  506. $else$
  507. \usepackage{etoolbox}
  508. \makeatletter
  509. \providecommand{\subtitle}[1]{% add subtitle to \maketitle
  510. \apptocmd{\@title}{\par {\large #1 \par}}{}{}
  511. }
  512. \makeatother
  513. $endif$
  514. \subtitle{$subtitle$}
  515. $endif$
  516. \author{$for(author)$$author$$sep$ \and $endfor$}
  517. \date{$date$}
  518. $if(beamer)$
  519. $if(institute)$
  520. \institute{$for(institute)$$institute$$sep$ \and $endfor$}
  521. $endif$
  522. $if(titlegraphic)$
  523. \titlegraphic{\includegraphics{$titlegraphic$}}
  524. $endif$
  525. $if(logo)$
  526. \logo{\includegraphics{$logo$}}
  527. $endif$
  528. $endif$
  529. %%
  530. %% added
  531. %%
  532. $if(page-background)$
  533. \usepackage[pages=all]{background}
  534. $endif$
  535. %
  536. % for the background color of the title page
  537. %
  538. $if(titlepage)$
  539. \usepackage{pagecolor}
  540. \usepackage{afterpage}
  541. $if(titlepage-background)$
  542. \usepackage{tikz}
  543. $endif$
  544. $if(geometry)$
  545. $else$
  546. \usepackage[margin=2.5cm,includehead=true,includefoot=true,centering]{geometry}
  547. $endif$
  548. $endif$
  549. %
  550. % break urls
  551. %
  552. \PassOptionsToPackage{hyphens}{url}
  553. %
  554. % When using babel or polyglossia with biblatex, loading csquotes is recommended
  555. % to ensure that quoted texts are typeset according to the rules of your main language.
  556. %
  557. \usepackage{csquotes}
  558. %
  559. % captions
  560. %
  561. \definecolor{caption-color}{HTML}{777777}
  562. $if(beamer)$
  563. $else$
  564. \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}
  565. \setcapindent{0em}
  566. $endif$
  567. %
  568. % blockquote
  569. %
  570. \definecolor{blockquote-border}{RGB}{221,221,221}
  571. \definecolor{blockquote-text}{RGB}{119,119,119}
  572. \usepackage{mdframed}
  573. \newmdenv[rightline=false,bottomline=false,topline=false,linewidth=3pt,linecolor=blockquote-border,skipabove=\parskip]{customblockquote}
  574. \renewenvironment{quote}{\begin{customblockquote}\list{}{\rightmargin=0em\leftmargin=0em}%
  575. \item\relax\color{blockquote-text}\ignorespaces}{\unskip\unskip\endlist\end{customblockquote}}
  576. %
  577. % Source Sans Pro as the de­fault font fam­ily
  578. % Source Code Pro for monospace text
  579. %
  580. % 'default' option sets the default
  581. % font family to Source Sans Pro, not \sfdefault.
  582. %
  583. \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  584. $if(fontfamily)$
  585. $else$
  586. \usepackage[default]{sourcesanspro}
  587. \usepackage{sourcecodepro}
  588. $endif$
  589. \else % if not pdftex
  590. $if(mainfont)$
  591. $else$
  592. \usepackage[default]{sourcesanspro}
  593. \usepackage{sourcecodepro}
  594. % XeLaTeX specific adjustments for straight quotes: https://tex.stackexchange.com/a/354887
  595. % This issue is already fixed (see https://github.com/silkeh/latex-sourcecodepro/pull/5) but the
  596. % fix is still unreleased.
  597. % TODO: Remove this workaround when the new version of sourcecodepro is released on CTAN.
  598. \ifxetex
  599. \makeatletter
  600. \defaultfontfeatures[\ttfamily]
  601. { Numbers = \sourcecodepro@figurestyle,
  602. Scale = \SourceCodePro@scale,
  603. Extension = .otf }
  604. \setmonofont
  605. [ UprightFont = *-\sourcecodepro@regstyle,
  606. ItalicFont = *-\sourcecodepro@regstyle It,
  607. BoldFont = *-\sourcecodepro@boldstyle,
  608. BoldItalicFont = *-\sourcecodepro@boldstyle It ]
  609. {SourceCodePro}
  610. \makeatother
  611. \fi
  612. $endif$
  613. \fi
  614. %
  615. % heading color
  616. %
  617. \definecolor{heading-color}{RGB}{40,40,40}
  618. $if(beamer)$
  619. $else$
  620. %\addtokomafont{section}{\color{heading-color}}
  621. \addtokomafont{section}{\color{default-uclcolor}}
  622. \addtokomafont{subsection}{\color{default-uclcolor}}
  623. \addtokomafont{subsubsection}{\color{default-uclcolor}}
  624. $endif$
  625. % When using the classes report, scrreprt, book,
  626. % scrbook or memoir, uncomment the following line.
  627. %\addtokomafont{chapter}{\color{heading-color}}
  628. %
  629. % variables for title, author and date
  630. %
  631. $if(beamer)$
  632. $else$
  633. \usepackage{titling}
  634. \title{$title$}
  635. \author{$for(author)$$author$$sep$, $endfor$}
  636. \date{$date$}
  637. $endif$
  638. %
  639. % tables
  640. %
  641. $if(tables)$
  642. \definecolor{table-row-color}{HTML}{F5F5F5}
  643. \definecolor{table-rule-color}{HTML}{999999}
  644. %\arrayrulecolor{black!40}
  645. \arrayrulecolor{table-rule-color} % color of \toprule, \midrule, \bottomrule
  646. \setlength\heavyrulewidth{0.3ex} % thickness of \toprule, \bottomrule
  647. \renewcommand{\arraystretch}{1.3} % spacing (padding)
  648. $if(table-use-row-colors)$
  649. % TODO: This doesn't work anymore. I don't know why.
  650. % Reset rownum counter so that each table
  651. % starts with the same row colors.
  652. % https://tex.stackexchange.com/questions/170637/restarting-rowcolors
  653. %
  654. % Unfortunately the colored cells extend beyond the edge of the
  655. % table because pandoc uses @-expressions (@{}) like so:
  656. %
  657. % \begin{longtable}[]{@{}ll@{}}
  658. % \end{longtable}
  659. %
  660. % https://en.wikibooks.org/wiki/LaTeX/Tables#.40-expressions
  661. \let\oldlongtable\longtable
  662. \let\endoldlongtable\endlongtable
  663. \renewenvironment{longtable}{
  664. \rowcolors{3}{}{table-row-color!100} % row color
  665. \oldlongtable} {
  666. \endoldlongtable
  667. \global\rownum=0\relax}
  668. $endif$
  669. $endif$
  670. %
  671. % remove paragraph indention
  672. %
  673. \setlength{\parindent}{0pt}
  674. \setlength{\parskip}{6pt plus 2pt minus 1pt}
  675. \setlength{\emergencystretch}{3em} % prevent overfull lines
  676. %
  677. %
  678. % Listings
  679. %
  680. %
  681. $if(listings)$
  682. %
  683. % general listing colors
  684. %
  685. \definecolor{listing-background}{HTML}{F7F7F7}
  686. \definecolor{listing-rule}{HTML}{B3B2B3}
  687. \definecolor{listing-numbers}{HTML}{B3B2B3}
  688. \definecolor{listing-text-color}{HTML}{000000}
  689. \definecolor{listing-keyword}{HTML}{435489}
  690. \definecolor{listing-keyword-2}{HTML}{1284CA} % additional keywords
  691. \definecolor{listing-keyword-3}{HTML}{9137CB} % additional keywords
  692. \definecolor{listing-identifier}{HTML}{435489}
  693. \definecolor{listing-string}{HTML}{00999A}
  694. \definecolor{listing-comment}{HTML}{8E8E8E}
  695. \lstdefinestyle{eisvogel_listing_style}{
  696. language = java,
  697. $if(listings-disable-line-numbers)$
  698. xleftmargin = 0.6em,
  699. framexleftmargin = 0.4em,
  700. $else$
  701. numbers = left,
  702. xleftmargin = 2.7em,
  703. framexleftmargin = 2.5em,
  704. $endif$
  705. backgroundcolor = \color{listing-background},
  706. basicstyle = \color{listing-text-color}\linespread{1.0}%
  707. \lst@ifdisplaystyle%
  708. $if(code-block-font-size)$$code-block-font-size$$else$\small$endif$%
  709. \fi\ttfamily{},
  710. breaklines = true,
  711. frame = single,
  712. framesep = 0.19em,
  713. rulecolor = \color{listing-rule},
  714. frameround = ffff,
  715. tabsize = 4,
  716. numberstyle = \color{listing-numbers},
  717. aboveskip = 1.0em,
  718. belowskip = 0.1em,
  719. abovecaptionskip = 0em,
  720. belowcaptionskip = 1.0em,
  721. keywordstyle = {\color{listing-keyword}\bfseries},
  722. keywordstyle = {[2]\color{listing-keyword-2}\bfseries},
  723. keywordstyle = {[3]\color{listing-keyword-3}\bfseries\itshape},
  724. sensitive = true,
  725. identifierstyle = \color{listing-identifier},
  726. commentstyle = \color{listing-comment},
  727. stringstyle = \color{listing-string},
  728. showstringspaces = false,
  729. escapeinside = {/*@}{@*/}, % Allow LaTeX inside these special comments
  730. literate =
  731. {á}{{\'a}}1 {é}{{\'e}}1 {í}{{\'i}}1 {ó}{{\'o}}1 {ú}{{\'u}}1
  732. {Á}{{\'A}}1 {É}{{\'E}}1 {Í}{{\'I}}1 {Ó}{{\'O}}1 {Ú}{{\'U}}1
  733. {à}{{\`a}}1 {è}{{\'e}}1 {ì}{{\`i}}1 {ò}{{\`o}}1 {ù}{{\`u}}1
  734. {À}{{\`A}}1 {È}{{\'E}}1 {Ì}{{\`I}}1 {Ò}{{\`O}}1 {Ù}{{\`U}}1
  735. {ä}{{\"a}}1 {ë}{{\"e}}1 {ï}{{\"i}}1 {ö}{{\"o}}1 {ü}{{\"u}}1
  736. {Ä}{{\"A}}1 {Ë}{{\"E}}1 {Ï}{{\"I}}1 {Ö}{{\"O}}1 {Ü}{{\"U}}1
  737. {â}{{\^a}}1 {ê}{{\^e}}1 {î}{{\^i}}1 {ô}{{\^o}}1 {û}{{\^u}}1
  738. {Â}{{\^A}}1 {Ê}{{\^E}}1 {Î}{{\^I}}1 {Ô}{{\^O}}1 {Û}{{\^U}}1
  739. {œ}{{\oe}}1 {Œ}{{\OE}}1 {æ}{{\ae}}1 {Æ}{{\AE}}1 {ß}{{\ss}}1
  740. {ç}{{\c c}}1 {Ç}{{\c C}}1 {ø}{{\o}}1 {å}{{\r a}}1 {Å}{{\r A}}1
  741. {€}{{\EUR}}1 {£}{{\pounds}}1 {«}{{\guillemotleft}}1
  742. {»}{{\guillemotright}}1 {ñ}{{\~n}}1 {Ñ}{{\~N}}1 {¿}{{?`}}1
  743. {…}{{\ldots}}1 {≥}{{>=}}1 {≤}{{<=}}1 {„}{{\glqq}}1 {“}{{\grqq}}1
  744. {”}{{''}}1
  745. }
  746. \lstset{style=eisvogel_listing_style}
  747. %
  748. % Java (Java SE 12, 2019-06-22)
  749. %
  750. \lstdefinelanguage{Java}{
  751. morekeywords={
  752. % normal keywords (without data types)
  753. abstract,assert,break,case,catch,class,continue,default,
  754. do,else,enum,exports,extends,final,finally,for,if,implements,
  755. import,instanceof,interface,module,native,new,package,private,
  756. protected,public,requires,return,static,strictfp,super,switch,
  757. synchronized,this,throw,throws,transient,try,volatile,while,
  758. % var is an identifier
  759. var
  760. },
  761. morekeywords={[2] % data types
  762. % primitive data types
  763. boolean,byte,char,double,float,int,long,short,
  764. % String
  765. String,
  766. % primitive wrapper types
  767. Boolean,Byte,Character,Double,Float,Integer,Long,Short
  768. % number types
  769. Number,AtomicInteger,AtomicLong,BigDecimal,BigInteger,DoubleAccumulator,DoubleAdder,LongAccumulator,LongAdder,Short,
  770. % other
  771. Object,Void,void
  772. },
  773. morekeywords={[3] % literals
  774. % reserved words for literal values
  775. null,true,false,
  776. },
  777. sensitive,
  778. morecomment = [l]//,
  779. morecomment = [s]{/*}{*/},
  780. morecomment = [s]{/**}{*/},
  781. morestring = [b]",
  782. morestring = [b]',
  783. }
  784. \lstdefinelanguage{XML}{
  785. morestring = [b]",
  786. moredelim = [s][\bfseries\color{listing-keyword}]{<}{\ },
  787. moredelim = [s][\bfseries\color{listing-keyword}]{</}{>},
  788. moredelim = [l][\bfseries\color{listing-keyword}]{/>},
  789. moredelim = [l][\bfseries\color{listing-keyword}]{>},
  790. morecomment = [s]{<?}{?>},
  791. morecomment = [s]{<!--}{-->},
  792. commentstyle = \color{listing-comment},
  793. stringstyle = \color{listing-string},
  794. identifierstyle = \color{listing-identifier}
  795. }
  796. $endif$
  797. %
  798. % header and footer
  799. %
  800. $if(beamer)$
  801. $else$
  802. $if(disable-header-and-footer)$
  803. $else$
  804. %\usepackage[headsepline,footsepline]{scrlayer-scrpage}
  805. \usepackage[headsepline]{scrlayer-scrpage}
  806. \newpairofpagestyles{eisvogel-header-footer}{
  807. \clearpairofpagestyles
  808. \ihead*{$if(header-left)$$header-left$$else$$title$$endif$}
  809. %\chead*{$if(header-center)$$header-center$$else$$endif$}
  810. %\ohead*{$if(header-right)$$header-right$$else$$date$$endif$}
  811. \ohead*{$if(header-right)$$header-right$$else$$for(author)$$author$$sep$, $endfor$$endif$}
  812. %\ifoot*{$if(footer-left)$$footer-left$$else$$for(author)$$author$$sep$, $endfor$$endif$}
  813. %\cfoot*{$if(footer-center)$$footer-center$$else$$endif$}
  814. \cfoot*{$if(footer-center)$$footer-center$$else$Page \thepage \hspace{1pt} sur \pageref{LastPage}$endif$}
  815. %\ofoot*{$if(footer-right)$$footer-right$$else$\thepage$endif$}
  816. \addtokomafont{pageheadfoot}{\upshape}
  817. }
  818. \pagestyle{eisvogel-header-footer}
  819. $if(book)$
  820. \deftripstyle{ChapterStyle}{}{}{}{}{\pagemark}{}
  821. \renewcommand*{\chapterpagestyle}{ChapterStyle}
  822. $endif$
  823. $if(page-background)$
  824. \backgroundsetup{
  825. scale=1,
  826. color=black,
  827. opacity=$if(page-background-opacity)$$page-background-opacity$$else$0.2$endif$,
  828. angle=0,
  829. contents={%
  830. \includegraphics[width=\paperwidth,height=\paperheight]{$page-background$}
  831. }%
  832. }
  833. $endif$
  834. $endif$
  835. $endif$
  836. %%
  837. %% end added
  838. %%
  839. \begin{document}
  840. %%
  841. %% begin titlepage
  842. %%
  843. $if(beamer)$
  844. $else$
  845. $if(titlepage)$
  846. \begin{titlepage}
  847. $if(titlepage-background)$
  848. \newgeometry{top=2cm, right=4cm, bottom=3cm, left=4cm}
  849. $else$
  850. \newgeometry{left=6cm}
  851. $endif$
  852. $if(titlepage-color)$
  853. \definecolor{titlepage-color}{HTML}{$titlepage-color$}
  854. \newpagecolor{titlepage-color}\afterpage{\restorepagecolor}
  855. $endif$
  856. $if(titlepage-background)$
  857. \tikz[remember picture,overlay] \node[inner sep=0pt] at (current page.center){\includegraphics[width=\paperwidth,height=\paperheight]{$titlepage-background$}};
  858. $endif$
  859. \newcommand{\colorRule}[3][black]{\textcolor[HTML]{#1}{\rule{#2}{#3}}}
  860. \begin{flushleft}
  861. \noindent
  862. \\[-1em]
  863. \color[HTML]{$if(titlepage-text-color)$$titlepage-text-color$$else$5F5F5F$endif$}
  864. %\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}}
  865. \par
  866. \noindent
  867. $if(titlepage-background)$
  868. % The titlepage with a background image has other text spacing and text size
  869. {
  870. \setstretch{2}
  871. \vfill
  872. \vskip -8em
  873. \noindent {\huge \textbf{\textsf{$title$}}}
  874. {\color{default-uclcolor} \rule{\linewidth}{0.5mm}}
  875. $if(subtitle)$
  876. \vskip 1em
  877. {\Large \textsf{\color{black}$subtitle$}}
  878. $endif$
  879. \vskip 2em
  880. \noindent {\large \textbf{$for(author)$$author$$sep$, $endfor$}}
  881. $if(option1)$
  882. \noindent {\textsf{\\$option1$}}
  883. $endif$
  884. $if(option2)$
  885. \noindent {\textsf{\\$option2$}}
  886. $endif$
  887. $if(option3)$
  888. \noindent {\textsf{\\$option3$}}
  889. $endif$
  890. $if(option4)$
  891. \noindent {\textsf{\\$option4$}}
  892. $endif$
  893. $if(option5)$
  894. \noindent {\textsf{\\$option5$}}
  895. $endif$
  896. $if(option6)$
  897. \noindent {\textsf{\\$option6$}}
  898. $endif$
  899. \noindent {\normalsize \vskip 0.6em \textsf{\color{black}$date$}}
  900. %\noindent {\normalsize \vskip 0.6em \textsf{\color{black}\today}}
  901. \vfill
  902. }
  903. $else$
  904. {
  905. \setstretch{1.4}
  906. \vfill
  907. \noindent {\huge \textbf{\textsf{$title$}}}
  908. $if(subtitle)$
  909. \vskip 1em
  910. {\Large \textsf{$subtitle$}}
  911. $endif$
  912. \vskip 2em
  913. \noindent {\Large \textsf{$for(author)$$author$$sep$, $endfor$}}
  914. \vfill
  915. }
  916. $endif$
  917. $if(titlepage-logo)$
  918. \noindent
  919. \includegraphics[width=$if(logo-width)$$logo-width$$else$35mm$endif$, left]{$titlepage-logo$}
  920. $endif$
  921. $if(titlepage-background)$
  922. $else$
  923. \textsf{\color{black}$date$}
  924. $endif$
  925. \end{flushleft}
  926. \end{titlepage}
  927. \restoregeometry
  928. \pagenumbering{arabic}
  929. $endif$
  930. $endif$
  931. %%
  932. %% end titlepage
  933. %%
  934. $if(has-frontmatter)$
  935. \frontmatter
  936. $endif$
  937. $if(title)$
  938. $if(beamer)$
  939. \frame{\titlepage}
  940. $endif$
  941. $if(abstract)$
  942. \begin{abstract}
  943. $abstract$
  944. \end{abstract}
  945. $endif$
  946. $endif$
  947. $if(first-chapter)$
  948. \setcounter{chapter}{$first-chapter$}
  949. \addtocounter{chapter}{-1}
  950. $endif$
  951. $for(include-before)$
  952. $include-before$
  953. $endfor$
  954. $if(toc)$
  955. $if(toc-title)$
  956. \renewcommand*\contentsname{$toc-title$}
  957. $endif$
  958. $if(beamer)$
  959. \begin{frame}[allowframebreaks]
  960. $if(toc-title)$
  961. \frametitle{$toc-title$}
  962. $endif$
  963. \tableofcontents[hideallsubsections]
  964. \end{frame}
  965. $if(toc-own-page)$
  966. \newpage
  967. $endif$
  968. $else$
  969. {
  970. $if(colorlinks)$
  971. \hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$$endif$}
  972. $endif$
  973. \setcounter{tocdepth}{$toc-depth$}
  974. \tableofcontents
  975. $if(toc-own-page)$
  976. \newpage
  977. $endif$
  978. }
  979. $endif$
  980. $endif$
  981. $if(lof)$
  982. \listoffigures
  983. $endif$
  984. $if(lot)$
  985. \listoftables
  986. $endif$
  987. $if(linestretch)$
  988. \setstretch{$linestretch$}
  989. $endif$
  990. $if(has-frontmatter)$
  991. \mainmatter
  992. $endif$
  993. $body$
  994. $if(has-frontmatter)$
  995. \backmatter
  996. $endif$
  997. $if(natbib)$
  998. $if(bibliography)$
  999. $if(biblio-title)$
  1000. $if(has-chapters)$
  1001. \renewcommand\bibname{$biblio-title$}
  1002. $else$
  1003. \renewcommand\refname{$biblio-title$}
  1004. $endif$
  1005. $endif$
  1006. $if(beamer)$
  1007. \begin{frame}[allowframebreaks]{$biblio-title$}
  1008. \bibliographytrue
  1009. $endif$
  1010. \bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
  1011. $if(beamer)$
  1012. \end{frame}
  1013. $endif$
  1014. $endif$
  1015. $endif$
  1016. $if(biblatex)$
  1017. $if(beamer)$
  1018. \begin{frame}[allowframebreaks]{$biblio-title$}
  1019. \bibliographytrue
  1020. \printbibliography[heading=none]
  1021. \end{frame}
  1022. $else$
  1023. \printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
  1024. $endif$
  1025. $endif$
  1026. $for(include-after)$
  1027. $include-after$
  1028. $endfor$
  1029. \end{document}