aboutsummaryrefslogtreecommitdiff
path: root/_extensions/ruc-play/stylish-report/template.tex
blob: 26d8fe66872c2eee4a1644e71dad02bb4d213893 (plain)
  1. % Options for packages loaded elsewhere
  2. \PassOptionsToPackage{unicode$for(hyperrefoptions)$,$hyperrefoptions$$endfor$}{hyperref}
  3. \PassOptionsToPackage{hyphens}{url}
  4. $if(colorlinks)$
  5. \PassOptionsToPackage{dvipsnames,svgnames,x11names}{xcolor}
  6. $endif$
  7. $if(CJKmainfont)$
  8. \PassOptionsToPackage{space}{xeCJK}
  9. $endif$
  10. %
  11. $doc-class.tex()$
  12. $if(beamer)$
  13. $if(background-image)$
  14. \usebackgroundtemplate{%
  15.   \includegraphics[width=\paperwidth]{$background-image$}%
  16. }
  17. % In beamer background-image does not work well when other images are used, so this is the workaround
  18. \pgfdeclareimage[width=\paperwidth,height=\paperheight]{background}{$background-image$}
  19. \usebackgroundtemplate{\pgfuseimage{background}}
  20. $endif$
  21. \usepackage{pgfpages}
  22. \setbeamertemplate{caption}[numbered]
  23. \setbeamertemplate{caption label separator}{: }
  24. \setbeamercolor{caption name}{fg=normal text.fg}
  25. \beamertemplatenavigationsymbols$if(navigation)$$navigation$$else$empty$endif$
  26. $for(beameroption)$
  27. \setbeameroption{$beameroption$}
  28. $endfor$
  29. % Prevent slide breaks in the middle of a paragraph
  30. \widowpenalties 1 10000
  31. \raggedbottom
  32. $if(section-titles)$
  33. \setbeamertemplate{part page}{
  34. \centering
  35. \begin{beamercolorbox}[sep=16pt,center]{part title}
  36. \usebeamerfont{part title}\insertpart\par
  37. \end{beamercolorbox}
  38. }
  39. \setbeamertemplate{section page}{
  40. \centering
  41. \begin{beamercolorbox}[sep=12pt,center]{section title}
  42. \usebeamerfont{section title}\insertsection\par
  43. \end{beamercolorbox}
  44. }
  45. \setbeamertemplate{subsection page}{
  46. \centering
  47. \begin{beamercolorbox}[sep=8pt,center]{subsection title}
  48. \usebeamerfont{subsection title}\insertsubsection\par
  49. \end{beamercolorbox}
  50. }
  51. \AtBeginPart{
  52. \frame{\partpage}
  53. }
  54. \AtBeginSection{
  55. \ifbibliography
  56. \else
  57. \frame{\sectionpage}
  58. \fi
  59. }
  60. \AtBeginSubsection{
  61. \frame{\subsectionpage}
  62. }
  63. $endif$
  64. $endif$
  65. $if(beamerarticle)$
  66. \usepackage{beamerarticle} % needs to be loaded first
  67. $endif$
  68. \usepackage{amsmath,amssymb}
  69. $if(linestretch)$
  70. \usepackage{setspace}
  71. $endif$
  72. \usepackage{iftex}
  73. \ifPDFTeX
  74. \usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}
  75. \usepackage[utf8]{inputenc}
  76. \usepackage{textcomp} % provide euro and other symbols
  77. \else % if luatex or xetex
  78. $if(mathspec)$
  79. \ifXeTeX
  80. \usepackage{mathspec} % this also loads fontspec
  81. \else
  82. \usepackage{unicode-math} % this also loads fontspec
  83. \fi
  84. $else$
  85. \usepackage{unicode-math}
  86. $endif$
  87. \defaultfontfeatures{Scale=MatchLowercase}$-- must come before Beamer theme
  88. \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
  89. \fi
  90. $if(fontfamily)$
  91. $else$
  92. $-- Set default font before Beamer theme so the theme can override it
  93. \usepackage{lmodern}
  94. $endif$
  95. $-- Set Beamer theme before user font settings so they can override theme
  96. $if(beamer)$
  97. $if(theme)$
  98. \usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$}
  99. $endif$
  100. $if(colortheme)$
  101. \usecolortheme{$colortheme$}
  102. $endif$
  103. $if(fonttheme)$
  104. \usefonttheme{$fonttheme$}
  105. $endif$
  106. $if(mainfont)$
  107. \usefonttheme{serif} % use mainfont rather than sansfont for slide text
  108. $endif$
  109. $if(innertheme)$
  110. \useinnertheme{$innertheme$}
  111. $endif$
  112. $if(outertheme)$
  113. \useoutertheme{$outertheme$}
  114. $endif$
  115. $endif$
  116. $-- User font settings (must come after default font and Beamer theme)
  117. $if(fontfamily)$
  118. \usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
  119. $endif$
  120. \ifPDFTeX\else
  121. % xetex/luatex font selection
  122. $if(mainfont)$
  123. $if(mainfontfallback)$
  124. \ifLuaTeX
  125. \usepackage{luaotfload}
  126. \directlua{luaotfload.add_fallback("mainfontfallback",{
  127. $for(mainfontfallback)$"$mainfontfallback$"$sep$,$endfor$
  128. })}
  129. \fi
  130. $endif$
  131. \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$$if(mainfontfallback)$,RawFeature={fallback=mainfontfallback}$endif$]{$mainfont$}
  132. $endif$
  133. $if(sansfont)$
  134. $if(sansfontfallback)$
  135. \ifLuaTeX
  136. \usepackage{luaotfload}
  137. \directlua{luaotfload.add_fallback("sansfontfallback",{
  138. $for(sansfontfallback)$"$sansfontfallback$"$sep$,$endfor$
  139. })}
  140. \fi
  141. $endif$
  142. \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$$if(sansfontfallback)$,RawFeature={fallback=sansfontfallback}$endif$]{$sansfont$}
  143. $endif$
  144. $if(monofont)$
  145. $if(monofontfallback)$
  146. \ifLuaTeX
  147. \usepackage{luaotfload}
  148. \directlua{luaotfload.add_fallback("monofontfallback",{
  149. $for(monofontfallback)$"$monofontfallback$"$sep$,$endfor$
  150. })}
  151. \fi
  152. $endif$
  153. \setmonofont[$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$if(monofontfallback)$,RawFeature={fallback=monofontfallback}$endif$]{$monofont$}
  154. $endif$
  155. $for(fontfamilies)$
  156. \newfontfamily{$fontfamilies.name$}[$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$]{$fontfamilies.font$}
  157. $endfor$
  158. $if(mathfont)$
  159. $if(mathspec)$
  160. \ifXeTeX
  161. \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
  162. \else
  163. \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
  164. \fi
  165. $else$
  166. \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
  167. $endif$
  168. $endif$
  169. $if(CJKmainfont)$
  170. \ifXeTeX
  171. \usepackage{xeCJK}
  172. \setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
  173. $if(CJKsansfont)$
  174. \setCJKsansfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKsansfont$}
  175. $endif$
  176. $if(CJKmonofont)$
  177. \setCJKmonofont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmonofont$}
  178. $endif$
  179. \fi
  180. $endif$
  181. $if(luatexjapresetoptions)$
  182. \ifLuaTeX
  183. \usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset}
  184. \fi
  185. $endif$
  186. $if(CJKmainfont)$
  187. \ifLuaTeX
  188. \usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec}
  189. \setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
  190. \fi
  191. $endif$
  192. \fi
  193. $if(zero-width-non-joiner)$
  194. %% Support for zero-width non-joiner characters.
  195. \makeatletter
  196. \def\zerowidthnonjoiner{%
  197. % Prevent ligatures and adjust kerning, but still support hyphenating.
  198. \texorpdfstring{%
  199. \TextOrMath{\nobreak\discretionary{-}{}{\kern.03em}%
  200. \ifvmode\else\nobreak\hskip\z@skip\fi}{}%
  201. }{}%
  202. }
  203. \makeatother
  204. \ifPDFTeX
  205. \DeclareUnicodeCharacter{200C}{\zerowidthnonjoiner}
  206. \else
  207. \catcode`^^^^200c=\active
  208. \protected\def ^^^^200c{\zerowidthnonjoiner}
  209. \fi
  210. %% End of ZWNJ support
  211. $endif$
  212. % Use upquote if available, for straight quotes in verbatim environments
  213. \IfFileExists{upquote.sty}{\usepackage{upquote}}{}
  214. \IfFileExists{microtype.sty}{% use microtype if available
  215. \usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype}
  216. \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
  217. }{}
  218. $if(indent)$
  219. $else$
  220. \makeatletter
  221. \@ifundefined{KOMAClassName}{% if non-KOMA class
  222. \IfFileExists{parskip.sty}{%
  223. \usepackage{parskip}
  224. }{% else
  225. \setlength{\parindent}{0pt}
  226. \setlength{\parskip}{6pt plus 2pt minus 1pt}}
  227. }{% if KOMA class
  228. \KOMAoptions{parskip=half}}
  229. \makeatother
  230. $endif$
  231. $if(verbatim-in-note)$
  232. \usepackage{fancyvrb}
  233. $endif$
  234. \usepackage{xcolor}
  235. $if(geometry)$
  236. $if(beamer)$
  237. \geometry{$for(geometry)$$geometry$$sep$,$endfor$}
  238. $else$
  239. \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
  240. $endif$
  241. $endif$
  242. $if(beamer)$
  243. \newif\ifbibliography
  244. $endif$
  245. $if(listings)$
  246. \usepackage{listings}
  247. \newcommand{\passthrough}[1]{#1}
  248. \lstset{defaultdialect=[5.3]Lua}
  249. \lstset{defaultdialect=[x86masm]Assembler}
  250. $endif$
  251. $if(lhs)$
  252. \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
  253. $endif$
  254. $if(svg)$
  255. \usepackage{svg}
  256. $endif$
  257. $if(strikeout)$
  258. $-- also used for underline
  259. \ifLuaTeX
  260. \usepackage{luacolor}
  261. \usepackage[soul]{lua-ul}
  262. \else
  263. \usepackage{soul}
  264. $if(beamer)$
  265. \makeatletter
  266. \let\HL\hl
  267. \renewcommand\hl{% fix for beamer highlighting
  268. \let\set@color\beamerorig@set@color
  269. \let\reset@color\beamerorig@reset@color
  270. \HL}
  271. \makeatother
  272. $endif$
  273. $if(CJKmainfont)$
  274. \ifXeTeX
  275. % soul's \st doesn't work for CJK:
  276. \usepackage{xeCJKfntef}
  277. \renewcommand{\st}[1]{\sout{#1}}
  278. \fi
  279. $endif$
  280. \fi
  281. $endif$
  282. \setlength{\emergencystretch}{3em} % prevent overfull lines
  283. $if(numbersections)$
  284. \setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$}
  285. $else$
  286. \setcounter{secnumdepth}{-\maxdimen} % remove section numbering
  287. $endif$
  288. $if(beamer)$
  289. $else$
  290. $if(block-headings)$
  291. % Make \paragraph and \subparagraph free-standing
  292. \makeatletter
  293. \ifx\paragraph\undefined\else
  294. \let\oldparagraph\paragraph
  295. \renewcommand{\paragraph}{
  296. \@ifstar
  297. \xxxParagraphStar
  298. \xxxParagraphNoStar
  299. }
  300. \newcommand{\xxxParagraphStar}[1]{\oldparagraph*{#1}\mbox{}}
  301. \newcommand{\xxxParagraphNoStar}[1]{\oldparagraph{#1}\mbox{}}
  302. \fi
  303. \ifx\subparagraph\undefined\else
  304. \let\oldsubparagraph\subparagraph
  305. \renewcommand{\subparagraph}{
  306. \@ifstar
  307. \xxxSubParagraphStar
  308. \xxxSubParagraphNoStar
  309. }
  310. \newcommand{\xxxSubParagraphStar}[1]{\oldsubparagraph*{#1}\mbox{}}
  311. \newcommand{\xxxSubParagraphNoStar}[1]{\oldsubparagraph{#1}\mbox{}}
  312. \fi
  313. \makeatother
  314. $endif$
  315. $endif$
  316. $if(pagestyle)$
  317. \pagestyle{$pagestyle$}
  318. $endif$
  319. $pandoc.tex()$
  320. $if(lang)$
  321. \ifLuaTeX
  322. \usepackage[bidi=basic]{babel}
  323. \else
  324. \usepackage[bidi=default]{babel}
  325. \fi
  326. $if(babel-lang)$
  327. \babelprovide[main,import]{$babel-lang$}
  328. $if(mainfont)$
  329. \ifPDFTeX
  330. \else
  331. \babelfont{rm}[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$$if(mainfontfallback)$,RawFeature={fallback=mainfontfallback}$endif$]{$mainfont$}
  332. \fi
  333. $endif$
  334. $endif$
  335. $for(babel-otherlangs)$
  336. \babelprovide[import]{$babel-otherlangs$}
  337. $endfor$
  338. $for(babelfonts/pairs)$
  339. \babelfont[$babelfonts.key$]{rm}{$babelfonts.value$}
  340. $endfor$
  341. % get rid of language-specific shorthands (see #6817):
  342. \let\LanguageShortHands\languageshorthands
  343. \def\languageshorthands#1{}
  344. $if(selnolig-langs)$
  345. \ifLuaTeX
  346. \usepackage[$for(selnolig-langs)$$it$$sep$,$endfor$]{selnolig} % disable illegal ligatures
  347. \fi
  348. $endif$
  349. $endif$
  350. $if(dir)$
  351. \ifPDFTeX
  352. \TeXXeTstate=1
  353. \newcommand{\RL}[1]{\beginR #1\endR}
  354. \newcommand{\LR}[1]{\beginL #1\endL}
  355. \newenvironment{RTL}{\beginR}{\endR}
  356. \newenvironment{LTR}{\beginL}{\endL}
  357. \fi
  358. $endif$
  359. $if(biblio-config)$
  360. $if(natbib)$
  361. \usepackage[$natbiboptions$]{natbib}
  362. \bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
  363. $endif$
  364. $if(biblatex)$
  365. \usepackage[$if(biblio-style)$style=$biblio-style$,$endif$$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex}
  366. $for(bibliography)$
  367. \addbibresource{$bibliography$}
  368. $endfor$
  369. $endif$
  370. $endif$
  371. $if(nocite-ids)$
  372. \nocite{$for(nocite-ids)$$it$$sep$, $endfor$}
  373. $endif$
  374. $if(csquotes)$
  375. \usepackage{csquotes}
  376. $endif$
  377. \usepackage{bookmark}
  378. \IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
  379. \urlstyle{same} % disable monospaced font for URLs
  380. $if(links-as-notes)$
  381. % Make links footnotes instead of hotlinks:
  382. \DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}}
  383. $endif$
  384. $if(verbatim-in-note)$
  385. \VerbatimFootnotes % allow verbatim text in footnotes
  386. $endif$
  387. \hypersetup{
  388. $if(title-meta)$
  389. pdftitle={$title-meta$},
  390. $endif$
  391. $if(author-meta)$
  392. pdfauthor={$for(by-author)$$if(it.metadata.credit.supervision)$$else$$it.name.literal$$endif$$sep$,$endfor$},
  393. $endif$
  394. $if(lang)$
  395. pdflang={$lang$},
  396. $endif$
  397. $if(subject)$
  398. pdfsubject={$subject$},
  399. $endif$
  400. $if(keywords)$
  401. pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$},
  402. $endif$
  403. $if(colorlinks)$
  404. colorlinks=true,
  405. $if(linkcolor)$linkcolor={$linkcolor$}$endif$,
  406. $if(filecolor)$filecolor={$filecolor$}$endif$,
  407. $if(citecolor)$citecolor={$citecolor$}$endif$,
  408. $if(urlcolor)$urlcolor={$urlcolor$}$endif$,
  409. $else$
  410. $if(boxlinks)$
  411. $else$
  412. hidelinks,
  413. $endif$
  414. $endif$
  415. pdfcreator={LaTeX via pandoc}}
  416. $before-title.tex()$
  417. $title.tex()$
  418. \begin{document}
  419. $before-body.tex()$
  420. $for(include-before)$
  421. $include-before$
  422. $endfor$
  423. $toc.tex()$
  424. $if(linestretch)$
  425. \setstretch{$linestretch$}
  426. $endif$
  427. $if(has-frontmatter)$
  428. \mainmatter
  429. $endif$
  430. $body$
  431. $before-bib.tex()$
  432. $if(has-frontmatter)$
  433. \backmatter
  434. $endif$
  435. $biblio.tex()$
  436. $for(include-after)$
  437. $include-after$
  438. $endfor$
  439. $after-body.tex()$
  440. \end{document}