english.latex 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  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(dir)$
  8. $if(latex-dir-rtl)$
  9. \PassOptionsToPackage{RTLdocument}{bidi}
  10. $endif$
  11. $endif$
  12. $if(CJKmainfont)$
  13. \PassOptionsToPackage{space}{xeCJK}
  14. $endif$
  15. %
  16. \documentclass[
  17. $if(fontsize)$
  18. $fontsize$,
  19. $endif$
  20. $if(lang)$
  21. $babel-lang$,
  22. $endif$
  23. $if(papersize)$
  24. $papersize$paper,
  25. $endif$
  26. $if(beamer)$
  27. ignorenonframetext,
  28. $if(handout)$
  29. handout,
  30. $endif$
  31. $if(aspectratio)$
  32. aspectratio=$aspectratio$,
  33. $endif$
  34. $endif$
  35. $for(classoption)$
  36. $classoption$$sep$,
  37. $endfor$
  38. ]{$documentclass$}
  39. $if(beamer)$
  40. $if(background-image)$
  41. \usebackgroundtemplate{%
  42. \includegraphics[width=\paperwidth]{$background-image$}%
  43. }
  44. $endif$
  45. \usepackage{pgfpages}
  46. \setbeamertemplate{caption}[numbered]
  47. \setbeamertemplate{caption label separator}{: }
  48. \setbeamercolor{caption name}{fg=normal text.fg}
  49. \beamertemplatenavigationsymbols$if(navigation)$$navigation$$else$empty$endif$
  50. $for(beameroption)$
  51. \setbeameroption{$beameroption$}
  52. $endfor$
  53. % Prevent slide breaks in the middle of a paragraph
  54. \widowpenalties 1 10000
  55. \raggedbottom
  56. $if(section-titles)$
  57. \setbeamertemplate{part page}{
  58. \centering
  59. \begin{beamercolorbox}[sep=16pt,center]{part title}
  60. \usebeamerfont{part title}\insertpart\par
  61. \end{beamercolorbox}
  62. }
  63. \setbeamertemplate{section page}{
  64. \centering
  65. \begin{beamercolorbox}[sep=12pt,center]{part title}
  66. \usebeamerfont{section title}\insertsection\par
  67. \end{beamercolorbox}
  68. }
  69. \setbeamertemplate{subsection page}{
  70. \centering
  71. \begin{beamercolorbox}[sep=8pt,center]{part title}
  72. \usebeamerfont{subsection title}\insertsubsection\par
  73. \end{beamercolorbox}
  74. }
  75. \AtBeginPart{
  76. \frame{\partpage}
  77. }
  78. \AtBeginSection{
  79. \ifbibliography
  80. \else
  81. \frame{\sectionpage}
  82. \fi
  83. }
  84. \AtBeginSubsection{
  85. \frame{\subsectionpage}
  86. }
  87. $endif$
  88. $endif$
  89. $if(beamerarticle)$
  90. \usepackage{beamerarticle} % needs to be loaded first
  91. $endif$
  92. \usepackage{amsmath,amssymb}
  93. $if(fontfamily)$
  94. \usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
  95. $else$
  96. \usepackage{lmodern}
  97. $endif$
  98. $if(linestretch)$
  99. \usepackage{setspace}
  100. $endif$
  101. \usepackage{ifxetex,ifluatex}
  102. % my additions
  103. \usepackage{tgheros}
  104. \usepackage{mathptmx}
  105. % geometry
  106. \usepackage{geometry}
  107. \geometry{
  108. headsep=20pt,
  109. headheight=20pt,
  110. left=21mm,
  111. top=15mm,
  112. right=21mm,
  113. bottom=15mm,
  114. footskip=20pt,
  115. }
  116. \usepackage{hyperref}
  117. \hypersetup{
  118. colorlinks=true,
  119. linkcolor=blue,
  120. filecolor=magenta,
  121. urlcolor=cyan,
  122. }
  123. \usepackage{sectsty}
  124. \usepackage[english]{babel}
  125. \selectlanguage{english}
  126. \allsectionsfont{\sffamily}
  127. \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  128. \usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}
  129. \usepackage[utf8]{inputenc}
  130. \usepackage{textcomp} % provide euro and other symbols
  131. \else % if luatex or xetex
  132. $if(mathspec)$
  133. \ifxetex
  134. \usepackage{mathspec}
  135. \else
  136. \usepackage{unicode-math}
  137. \fi
  138. $else$
  139. \usepackage{unicode-math}
  140. $endif$
  141. \defaultfontfeatures{Scale=MatchLowercase}
  142. \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
  143. $if(mainfont)$
  144. \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
  145. $endif$
  146. $if(sansfont)$
  147. \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$}
  148. $endif$
  149. $if(monofont)$
  150. \setmonofont[$for(monofontoptions)$$monofontoptions$$sep$,$endfor$]{$monofont$}
  151. $endif$
  152. $for(fontfamilies)$
  153. \newfontfamily{$fontfamilies.name$}[$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$]{$fontfamilies.font$}
  154. $endfor$
  155. $if(mathfont)$
  156. $if(mathspec)$
  157. \ifxetex
  158. \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
  159. \else
  160. \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
  161. \fi
  162. $else$
  163. \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
  164. $endif$
  165. $endif$
  166. $if(CJKmainfont)$
  167. \ifxetex
  168. \usepackage{xeCJK}
  169. \setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
  170. \fi
  171. $endif$
  172. $if(luatexjapresetoptions)$
  173. \ifluatex
  174. \usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset}
  175. \fi
  176. $endif$
  177. $if(CJKmainfont)$
  178. \ifluatex
  179. \usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec}
  180. \setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
  181. \fi
  182. $endif$
  183. \fi
  184. $if(beamer)$
  185. $if(theme)$
  186. \usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$}
  187. $endif$
  188. $if(colortheme)$
  189. \usecolortheme{$colortheme$}
  190. $endif$
  191. $if(fonttheme)$
  192. \usefonttheme{$fonttheme$}
  193. $endif$
  194. $if(mainfont)$
  195. \usefonttheme{serif} % use mainfont rather than sansfont for slide text
  196. $endif$
  197. $if(innertheme)$
  198. \useinnertheme{$innertheme$}
  199. $endif$
  200. $if(outertheme)$
  201. \useoutertheme{$outertheme$}
  202. $endif$
  203. $endif$
  204. % Use upquote if available, for straight quotes in verbatim environments
  205. \IfFileExists{upquote.sty}{\usepackage{upquote}}{}
  206. \IfFileExists{microtype.sty}{% use microtype if available
  207. \usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype}
  208. \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
  209. }{}
  210. $if(indent)$
  211. $else$
  212. \makeatletter
  213. \@ifundefined{KOMAClassName}{% if non-KOMA class
  214. \IfFileExists{parskip.sty}{%
  215. \usepackage{parskip}
  216. }{% else
  217. \setlength{\parindent}{0pt}
  218. \setlength{\parskip}{6pt plus 2pt minus 1pt}}
  219. }{% if KOMA class
  220. \KOMAoptions{parskip=half}}
  221. \makeatother
  222. $endif$
  223. $if(verbatim-in-note)$
  224. \usepackage{fancyvrb}
  225. $endif$
  226. \usepackage{xcolor}
  227. \IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
  228. \IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
  229. \hypersetup{
  230. $if(title-meta)$
  231. pdftitle={$title-meta$},
  232. $endif$
  233. $if(author-meta)$
  234. pdfauthor={$author-meta$},
  235. $endif$
  236. $if(lang)$
  237. pdflang={$lang$},
  238. $endif$
  239. $if(subject)$
  240. pdfsubject={$subject$},
  241. $endif$
  242. $if(keywords)$
  243. pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$},
  244. $endif$
  245. $if(colorlinks)$
  246. colorlinks=true,
  247. linkcolor=$if(linkcolor)$$linkcolor$$else$Maroon$endif$,
  248. filecolor=$if(filecolor)$$filecolor$$else$Maroon$endif$,
  249. citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$,
  250. urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$,
  251. $else$
  252. hidelinks,
  253. $endif$
  254. pdfcreator={LaTeX via pandoc}}
  255. \urlstyle{same} % disable monospaced font for URLs
  256. $if(verbatim-in-note)$
  257. \VerbatimFootnotes % allow verbatim text in footnotes
  258. $endif$
  259. $if(geometry)$
  260. $if(beamer)$
  261. \geometry{$for(geometry)$$geometry$$sep$,$endfor$}
  262. $else$
  263. \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
  264. $endif$
  265. $endif$
  266. $if(beamer)$
  267. \newif\ifbibliography
  268. $endif$
  269. $if(listings)$
  270. \usepackage{listings}
  271. \newcommand{\passthrough}[1]{#1}
  272. \lstset{defaultdialect=[5.3]Lua}
  273. \lstset{defaultdialect=[x86masm]Assembler}
  274. $endif$
  275. $if(lhs)$
  276. \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
  277. $endif$
  278. $if(highlighting-macros)$
  279. $highlighting-macros$
  280. $endif$
  281. $if(tables)$
  282. \usepackage{longtable,booktabs,array}
  283. \usepackage{calc} % for calculating minipage widths
  284. $if(beamer)$
  285. \usepackage{caption}
  286. % Make caption package work with longtable
  287. \makeatletter
  288. \def\fnum@table{\tablename~\thetable}
  289. \makeatother
  290. $else$
  291. % Correct order of tables after \paragraph or \subparagraph
  292. \usepackage{etoolbox}
  293. \makeatletter
  294. \patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
  295. \makeatother
  296. % Allow footnotes in longtable head/foot
  297. \IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
  298. \makesavenoteenv{longtable}
  299. $endif$
  300. $endif$
  301. $if(graphics)$
  302. \usepackage{graphicx}
  303. \makeatletter
  304. \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
  305. \def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
  306. \makeatother
  307. % Scale images if necessary, so that they will not overflow the page
  308. % margins by default, and it is still possible to overwrite the defaults
  309. % using explicit options in \includegraphics[width, height, ...]{}
  310. \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
  311. % Set default figure placement to htbp
  312. \makeatletter
  313. \def\fps@figure{htbp}
  314. \makeatother
  315. $endif$
  316. $if(links-as-notes)$
  317. % Make links footnotes instead of hotlinks:
  318. \DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}}
  319. $endif$
  320. $if(strikeout)$
  321. \usepackage[normalem]{ulem}
  322. % Avoid problems with \sout in headers with hyperref
  323. \pdfstringdefDisableCommands{\renewcommand{\sout}{}}
  324. $endif$
  325. \setlength{\emergencystretch}{3em} % prevent overfull lines
  326. \providecommand{\tightlist}{%
  327. \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
  328. $if(numbersections)$
  329. \setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$}
  330. $else$
  331. \setcounter{secnumdepth}{-\maxdimen} % remove section numbering
  332. $endif$
  333. $if(beamer)$
  334. $else$
  335. $if(block-headings)$
  336. % Make \paragraph and \subparagraph free-standing
  337. \ifx\paragraph\undefined\else
  338. \let\oldparagraph\paragraph
  339. \renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
  340. \fi
  341. \ifx\subparagraph\undefined\else
  342. \let\oldsubparagraph\subparagraph
  343. \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
  344. \fi
  345. $endif$
  346. $endif$
  347. $if(pagestyle)$
  348. \pagestyle{$pagestyle$}
  349. $endif$
  350. $for(header-includes)$
  351. $header-includes$
  352. $endfor$
  353. $if(lang)$
  354. \ifxetex
  355. % Load polyglossia as late as possible: uses bidi with RTL langages (e.g. Hebrew, Arabic)
  356. \usepackage{polyglossia}
  357. \setmainlanguage[$for(polyglossia-lang.options)$$polyglossia-lang.options$$sep$,$endfor$]{$polyglossia-lang.name$}
  358. $for(polyglossia-otherlangs)$
  359. \setotherlanguage[$for(polyglossia-otherlangs.options)$$polyglossia-otherlangs.options$$sep$,$endfor$]{$polyglossia-otherlangs.name$}
  360. $endfor$
  361. \else
  362. \usepackage[$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
  363. % get rid of language-specific shorthands (see #6817):
  364. \let\LanguageShortHands\languageshorthands
  365. \def\languageshorthands#1{}
  366. $if(babel-newcommands)$
  367. $babel-newcommands$
  368. $endif$
  369. \fi
  370. $endif$
  371. \ifluatex
  372. \usepackage{selnolig} % disable illegal ligatures
  373. \fi
  374. $if(dir)$
  375. \ifxetex
  376. % Load bidi as late as possible as it modifies e.g. graphicx
  377. \usepackage{bidi}
  378. \fi
  379. \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  380. \TeXXeTstate=1
  381. \newcommand{\RL}[1]{\beginR #1\endR}
  382. \newcommand{\LR}[1]{\beginL #1\endL}
  383. \newenvironment{RTL}{\beginR}{\endR}
  384. \newenvironment{LTR}{\beginL}{\endL}
  385. \fi
  386. $endif$
  387. $if(natbib)$
  388. \usepackage[$natbiboptions$]{natbib}
  389. \bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
  390. $endif$
  391. $if(biblatex)$
  392. \usepackage[$if(biblio-style)$style=$biblio-style$,$endif$$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex}
  393. $for(bibliography)$
  394. \addbibresource{$bibliography$}
  395. $endfor$
  396. $endif$
  397. $if(csl-refs)$
  398. \newlength{\cslhangindent}
  399. \setlength{\cslhangindent}{1.5em}
  400. \newlength{\csllabelwidth}
  401. \setlength{\csllabelwidth}{3em}
  402. \newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing
  403. {% don't indent paragraphs
  404. \setlength{\parindent}{0pt}
  405. % turn on hanging indent if param 1 is 1
  406. \ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi
  407. % set entry spacing
  408. \ifnum #2 > 0
  409. \setlength{\parskip}{#2\baselineskip}
  410. \fi
  411. }%
  412. {}
  413. \usepackage{calc}
  414. \newcommand{\CSLBlock}[1]{#1\hfill\break}
  415. \newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
  416. \newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break}
  417. \newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
  418. $endif$
  419. $if(csquotes)$
  420. \usepackage{csquotes}
  421. $endif$
  422. $if(title)$
  423. \title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
  424. $endif$
  425. $if(subtitle)$
  426. $if(beamer)$
  427. $else$
  428. \usepackage{etoolbox}
  429. \makeatletter
  430. \providecommand{\subtitle}[1]{% add subtitle to \maketitle
  431. \apptocmd{\@title}{\par {\large #1 \par}}{}{}
  432. }
  433. \makeatother
  434. $endif$
  435. \subtitle{$subtitle$}
  436. $endif$
  437. \author{$for(author)$$author$$sep$ \and $endfor$}
  438. \date{$date$}
  439. $if(beamer)$
  440. $if(institute)$
  441. \institute{$for(institute)$$institute$$sep$ \and $endfor$}
  442. $endif$
  443. $if(titlegraphic)$
  444. \titlegraphic{\includegraphics{$titlegraphic$}}
  445. $endif$
  446. $if(logo)$
  447. \logo{\includegraphics{$logo$}}
  448. $endif$
  449. $endif$
  450. \begin{document}
  451. $if(has-frontmatter)$
  452. \frontmatter
  453. $endif$
  454. $if(title)$
  455. $if(beamer)$
  456. \frame{\titlepage}
  457. $else$
  458. \maketitle
  459. $endif$
  460. $if(abstract)$
  461. \begin{abstract}
  462. $abstract$
  463. \end{abstract}
  464. $endif$
  465. $endif$
  466. $for(include-before)$
  467. $include-before$
  468. $endfor$
  469. $if(toc)$
  470. $if(toc-title)$
  471. \renewcommand*\contentsname{$toc-title$}
  472. $endif$
  473. $if(beamer)$
  474. \begin{frame}[allowframebreaks]
  475. $if(toc-title)$
  476. \frametitle{$toc-title$}
  477. $endif$
  478. \tableofcontents[hideallsubsections]
  479. \end{frame}
  480. $else$
  481. {
  482. $if(colorlinks)$
  483. \hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$$endif$}
  484. $endif$
  485. \setcounter{tocdepth}{$toc-depth$}
  486. \tableofcontents
  487. }
  488. $endif$
  489. $endif$
  490. $if(lot)$
  491. \listoftables
  492. $endif$
  493. $if(lof)$
  494. \listoffigures
  495. $endif$
  496. $if(linestretch)$
  497. \setstretch{$linestretch$}
  498. $endif$
  499. $if(has-frontmatter)$
  500. \mainmatter
  501. $endif$
  502. $body$
  503. $if(has-frontmatter)$
  504. \backmatter
  505. $endif$
  506. $if(natbib)$
  507. $if(bibliography)$
  508. $if(biblio-title)$
  509. $if(has-chapters)$
  510. \renewcommand\bibname{$biblio-title$}
  511. $else$
  512. \renewcommand\refname{$biblio-title$}
  513. $endif$
  514. $endif$
  515. $if(beamer)$
  516. \begin{frame}[allowframebreaks]{$biblio-title$}
  517. \bibliographytrue
  518. $endif$
  519. \bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
  520. $if(beamer)$
  521. \end{frame}
  522. $endif$
  523. $endif$
  524. $endif$
  525. $if(biblatex)$
  526. $if(beamer)$
  527. \begin{frame}[allowframebreaks]{$biblio-title$}
  528. \bibliographytrue
  529. \printbibliography[heading=none]
  530. \end{frame}
  531. $else$
  532. \printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
  533. $endif$
  534. $endif$
  535. $for(include-after)$
  536. $include-after$
  537. $endfor$
  538. \end{document}