Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

552 lines
13KB

  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. $if(fontfamily)$
  93. \usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
  94. $else$
  95. \usepackage{lmodern}
  96. $endif$
  97. $if(linestretch)$
  98. \usepackage{setspace}
  99. $endif$
  100. \usepackage{amssymb,amsmath}
  101. \usepackage{ifxetex,ifluatex}
  102. \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  103. \usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}
  104. \usepackage[utf8]{inputenc}
  105. \usepackage{textcomp} % provide euro and other symbols
  106. \else % if luatex or xetex
  107. $if(mathspec)$
  108. \ifxetex
  109. \usepackage{mathspec}
  110. \else
  111. \usepackage{unicode-math}
  112. \fi
  113. $else$
  114. \usepackage{unicode-math}
  115. $endif$
  116. % \defaultfontfeatures{Scale=MatchLowercase}
  117. \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
  118. $if(mainfont)$
  119. \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
  120. $else$
  121. \setmainfont{LinLibertineO}
  122. $endif$
  123. $if(sansfont)$
  124. \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$}
  125. $else$
  126. \setsansfont{Carlito}
  127. $endif$
  128. $if(monofont)$
  129. \setmonofont[$for(monofontoptions)$$monofontoptions$$sep$,$endfor$]{$monofont$}
  130. $else$
  131. \setmonofont[Mapping=tex-ansi]{DejaVuSansMono}
  132. $endif$
  133. $for(fontfamilies)$
  134. \newfontfamily{$fontfamilies.name$}[$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$]{$fontfamilies.font$}
  135. $endfor$
  136. $if(mathfont)$
  137. $if(mathspec)$
  138. \ifxetex
  139. \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
  140. \else
  141. \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
  142. \fi
  143. $else$
  144. \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
  145. $endif$
  146. $endif$
  147. $if(CJKmainfont)$
  148. \ifxetex
  149. \usepackage{xeCJK}
  150. \setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
  151. \fi
  152. $endif$
  153. $if(luatexjapresetoptions)$
  154. \ifluatex
  155. \usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset}
  156. \fi
  157. $endif$
  158. $if(CJKmainfont)$
  159. \ifluatex
  160. \usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec}
  161. \setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
  162. \fi
  163. $endif$
  164. \fi
  165. $if(beamer)$
  166. $if(theme)$
  167. \usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$}
  168. $endif$
  169. $if(colortheme)$
  170. \usecolortheme{$colortheme$}
  171. $endif$
  172. $if(fonttheme)$
  173. \usefonttheme{$fonttheme$}
  174. $endif$
  175. $if(mainfont)$
  176. \usefonttheme{serif} % use mainfont rather than sansfont for slide text
  177. $endif$
  178. $if(innertheme)$
  179. \useinnertheme{$innertheme$}
  180. $endif$
  181. $if(outertheme)$
  182. \useoutertheme{$outertheme$}
  183. $endif$
  184. $endif$
  185. % Use upquote if available, for straight quotes in verbatim environments
  186. \IfFileExists{upquote.sty}{\usepackage{upquote}}{}
  187. \IfFileExists{microtype.sty}{% use microtype if available
  188. \usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype}
  189. \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
  190. }{}
  191. $if(indent)$
  192. $else$
  193. \makeatletter
  194. \@ifundefined{KOMAClassName}{% if non-KOMA class
  195. \IfFileExists{parskip.sty}{%
  196. \usepackage{parskip}
  197. }{% else
  198. \setlength{\parindent}{0pt}
  199. \setlength{\parskip}{6pt plus 2pt minus 1pt}}
  200. }{% if KOMA class
  201. \KOMAoptions{parskip=half}}
  202. \makeatother
  203. $endif$
  204. $if(verbatim-in-note)$
  205. \usepackage{fancyvrb}
  206. $endif$
  207. \usepackage{xcolor}
  208. \IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
  209. \IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
  210. \hypersetup{
  211. $if(title-meta)$
  212. pdftitle={$title-meta$},
  213. $endif$
  214. $if(author-meta)$
  215. pdfauthor={$author-meta$},
  216. $endif$
  217. $if(lang)$
  218. pdflang={$lang$},
  219. $endif$
  220. $if(subject)$
  221. pdfsubject={$subject$},
  222. $endif$
  223. $if(keywords)$
  224. pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$},
  225. $endif$
  226. $if(colorlinks)$
  227. colorlinks=true,
  228. linkcolor=$if(linkcolor)$$linkcolor$$else$Maroon$endif$,
  229. filecolor=$if(filecolor)$$filecolor$$else$Maroon$endif$,
  230. citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$,
  231. urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$,
  232. $else$
  233. hidelinks,
  234. $endif$
  235. pdfcreator={LaTeX via pandoc}}
  236. \urlstyle{same} % disable monospaced font for URLs
  237. $if(verbatim-in-note)$
  238. \VerbatimFootnotes % allow verbatim text in footnotes
  239. $endif$
  240. $if(geometry)$
  241. $if(beamer)$
  242. \geometry{$for(geometry)$$geometry$$sep$,$endfor$}
  243. $else$
  244. \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
  245. $endif$
  246. $endif$
  247. $if(beamer)$
  248. \newif\ifbibliography
  249. $endif$
  250. $if(listings)$
  251. \usepackage{listings}
  252. \newcommand{\passthrough}[1]{#1}
  253. \lstset{defaultdialect=[5.3]Lua}
  254. \lstset{defaultdialect=[x86masm]Assembler}
  255. $endif$
  256. $if(lhs)$
  257. \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
  258. $endif$
  259. $if(highlighting-macros)$
  260. $highlighting-macros$
  261. $endif$
  262. $if(tables)$
  263. \usepackage{longtable,booktabs}
  264. $if(beamer)$
  265. \usepackage{caption}
  266. % Make caption package work with longtable
  267. \makeatletter
  268. \def\fnum@table{\tablename~\thetable}
  269. \makeatother
  270. $else$
  271. % Correct order of tables after \paragraph or \subparagraph
  272. \usepackage{etoolbox}
  273. \makeatletter
  274. \patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
  275. \makeatother
  276. % Allow footnotes in longtable head/foot
  277. \IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
  278. \makesavenoteenv{longtable}
  279. $endif$
  280. $endif$
  281. $if(graphics)$
  282. \usepackage{graphicx}
  283. \makeatletter
  284. \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
  285. \def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
  286. \makeatother
  287. % Scale images if necessary, so that they will not overflow the page
  288. % margins by default, and it is still possible to overwrite the defaults
  289. % using explicit options in \includegraphics[width, height, ...]{}
  290. \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
  291. % Set default figure placement to htbp
  292. \makeatletter
  293. \def\fps@figure{htbp}
  294. \makeatother
  295. $endif$
  296. % headers y footers a medida
  297. \usepackage{lastpage}
  298. \usepackage{fancyhdr}
  299. \pagestyle{fancy}
  300. \fancyhf{} % clear all header and footer fields
  301. \renewcommand{\headrulewidth}{0.0pt}
  302. \fancyhead[RO]{\slshape \rightmark}
  303. \fancyhead[LE]{\slshape \leftmark}
  304. \fancyfoot[LE,RO]{\scriptsize{$if(date)$ $date$ $endif$---$if(hash)$ \texttt{$hash$} $endif$}}
  305. \fancyfoot[C]{\thepage}
  306. $if(links-as-notes)$
  307. % Make links footnotes instead of hotlinks:
  308. \DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}}
  309. $endif$
  310. $if(strikeout)$
  311. \usepackage[normalem]{ulem}
  312. % Avoid problems with \sout in headers with hyperref
  313. \pdfstringdefDisableCommands{\renewcommand{\sout}{}}
  314. $endif$
  315. \setlength{\emergencystretch}{3em} % prevent overfull lines
  316. \providecommand{\tightlist}{%
  317. \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
  318. $if(numbersections)$
  319. \setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$}
  320. $else$
  321. \setcounter{secnumdepth}{-\maxdimen} % remove section numbering
  322. $endif$
  323. $if(beamer)$
  324. $else$
  325. $if(block-headings)$
  326. % Make \paragraph and \subparagraph free-standing
  327. \ifx\paragraph\undefined\else
  328. \let\oldparagraph\paragraph
  329. \renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
  330. \fi
  331. \ifx\subparagraph\undefined\else
  332. \let\oldsubparagraph\subparagraph
  333. \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
  334. \fi
  335. $endif$
  336. $endif$
  337. $if(pagestyle)$
  338. \pagestyle{$pagestyle$}
  339. $endif$
  340. $for(header-includes)$
  341. $header-includes$
  342. $endfor$
  343. $if(lang)$
  344. \ifxetex
  345. % Load polyglossia as late as possible: uses bidi with RTL langages (e.g. Hebrew, Arabic)
  346. \usepackage{polyglossia}
  347. \setmainlanguage[$polyglossia-lang.options$]{$polyglossia-lang.name$}
  348. $for(polyglossia-otherlangs)$
  349. \setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$}
  350. $endfor$
  351. \else
  352. \usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
  353. $if(babel-newcommands)$
  354. $babel-newcommands$
  355. $endif$
  356. \fi
  357. $endif$
  358. $if(dir)$
  359. \ifxetex
  360. % Load bidi as late as possible as it modifies e.g. graphicx
  361. \usepackage{bidi}
  362. \fi
  363. \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  364. \TeXXeTstate=1
  365. \newcommand{\RL}[1]{\beginR #1\endR}
  366. \newcommand{\LR}[1]{\beginL #1\endL}
  367. \newenvironment{RTL}{\beginR}{\endR}
  368. \newenvironment{LTR}{\beginL}{\endL}
  369. \fi
  370. $endif$
  371. $if(natbib)$
  372. \usepackage[$natbiboptions$]{natbib}
  373. \bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
  374. $endif$
  375. $if(biblatex)$
  376. \usepackage[$if(biblio-style)$style=$biblio-style$,$endif$$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex}
  377. $for(bibliography)$
  378. \addbibresource{$bibliography$}
  379. $endfor$
  380. $endif$
  381. \usepackage{subfig}
  382. % SIunits
  383. \usepackage{siunitx}
  384. % set default figure placement to htbp
  385. \makeatletter
  386. %\def\fps@figure{htbp}
  387. \pretocmd\env@cases{\def\@rowc@lors{}}{}{}
  388. \pretocmd\start@align{\def\@rowc@lors{}}{}{}
  389. \makeatother
  390. % fuente para los captions de figuras
  391. \usepackage{caption}
  392. \renewcommand{\captionfont}{\sf\small}
  393. \renewcommand{\captionlabelfont}{\bf\sf}
  394. $if(csl-refs)$
  395. \newlength{\cslhangindent}
  396. \setlength{\cslhangindent}{1.5em}
  397. \newenvironment{cslreferences}%
  398. {$if(csl-hanging-indent)$\setlength{\parindent}{0pt}%
  399. \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces$endif$}%
  400. {\par}
  401. $endif$
  402. $if(title)$
  403. \title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
  404. $endif$
  405. $if(subtitle)$
  406. $if(beamer)$
  407. $else$
  408. \usepackage{etoolbox}
  409. \makeatletter
  410. \providecommand{\subtitle}[1]{% add subtitle to \maketitle
  411. \apptocmd{\@title}{\par {\large #1 \par}}{}{}
  412. }
  413. \makeatother
  414. $endif$
  415. \subtitle{$subtitle$}
  416. $endif$
  417. \author{$for(author)$$author$$sep$ \and $endfor$}
  418. \date{$date$}
  419. $if(beamer)$
  420. $if(institute)$
  421. \institute{$for(institute)$$institute$$sep$ \and $endfor$}
  422. $endif$
  423. $if(titlegraphic)$
  424. \titlegraphic{\includegraphics{$titlegraphic$}}
  425. $endif$
  426. $if(logo)$
  427. \logo{\includegraphics{$logo$}}
  428. $endif$
  429. $endif$
  430. \include{syntax}
  431. \renewcommand\vec[1]{\mathbf{#1}}
  432. \begin{document}
  433. % \thispagestyle{empty}
  434. % \thispagestyle{plain}
  435. $if(has-frontmatter)$
  436. \frontmatter
  437. $endif$
  438. $if(title)$
  439. $if(beamer)$
  440. \frame{\titlepage}
  441. $else$
  442. \maketitle
  443. $endif$
  444. $if(abstract)$
  445. \begin{abstract}
  446. $abstract$
  447. \end{abstract}
  448. $endif$
  449. $endif$
  450. $for(include-before)$
  451. $include-before$
  452. $endfor$
  453. $if(toc)$
  454. $if(toc-title)$
  455. \renewcommand*\contentsname{$toc-title$}
  456. $endif$
  457. $if(beamer)$
  458. \begin{frame}[allowframebreaks]
  459. $if(toc-title)$
  460. \frametitle{$toc-title$}
  461. $endif$
  462. \tableofcontents[hideallsubsections]
  463. \end{frame}
  464. $else$
  465. {
  466. $if(colorlinks)$
  467. \hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$$endif$}
  468. $endif$
  469. \setcounter{tocdepth}{$toc-depth$}
  470. \tableofcontents
  471. \newpage
  472. }
  473. $endif$
  474. $endif$
  475. $if(lot)$
  476. \listoftables
  477. \pagebreak
  478. $endif$
  479. $if(lof)$
  480. \listoffigures
  481. \pagebreak
  482. $endif$
  483. $if(linestretch)$
  484. \setstretch{$linestretch$}
  485. $endif$
  486. $if(has-frontmatter)$
  487. \mainmatter
  488. $endif$
  489. % vectors done right
  490. \renewcommand{\vec}[1]{\ensuremath\mathbf{#1}}
  491. % \setcounter{topnumber}{2}
  492. % \setcounter{bottomnumber}{2}
  493. % \setcounter{totalnumber}{4}
  494. % \renewcommand{\topfraction}{0.80}
  495. % \renewcommand{\bottomfraction}{0.80}
  496. % \renewcommand{\textfraction}{0.20}
  497. \renewcommand{\floatpagefraction}{0.65}
  498. $body$
  499. $if(has-frontmatter)$
  500. \backmatter
  501. $endif$
  502. $if(natbib)$
  503. $if(bibliography)$
  504. $if(biblio-title)$
  505. $if(has-chapters)$
  506. \renewcommand\bibname{$biblio-title$}
  507. $else$
  508. \renewcommand\refname{$biblio-title$}
  509. $endif$
  510. $endif$
  511. $if(beamer)$
  512. \begin{frame}[allowframebreaks]{$biblio-title$}
  513. \bibliographytrue
  514. $endif$
  515. \bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
  516. $if(beamer)$
  517. \end{frame}
  518. $endif$
  519. $endif$
  520. $endif$
  521. $if(biblatex)$
  522. $if(beamer)$
  523. \begin{frame}[allowframebreaks]{$biblio-title$}
  524. \bibliographytrue
  525. \printbibliography[heading=none]
  526. \end{frame}
  527. $else$
  528. \printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
  529. $endif$
  530. $endif$
  531. $for(include-after)$
  532. $include-after$
  533. $endfor$
  534. \end{document}