You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

353 lines
9.3KB

  1. \PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
  2. \PassOptionsToPackage{hyphens}{url}
  3. $if(colorlinks)$
  4. \PassOptionsToPackage{usenames,dvipsnames}{color}
  5. $endif$
  6. %
  7. \documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(papersize)$$papersize$paper,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
  8. $if(beamerarticle)$
  9. \usepackage{beamerarticle} % needs to be loaded first
  10. $endif$
  11. $if(fontfamily)$
  12. \usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
  13. $else$
  14. \usepackage{lmodern}
  15. $endif$
  16. $if(linestretch)$
  17. \usepackage{setspace}
  18. \setstretch{$linestretch$}
  19. $endif$
  20. \usepackage{amssymb,amsmath}
  21. \usepackage{ifxetex,ifluatex}
  22. \usepackage{fixltx2e} % provides \textsubscript
  23. \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  24. \usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc}
  25. \usepackage[utf8]{inputenc}
  26. $if(euro)$
  27. \usepackage{eurosym}
  28. $endif$
  29. \else % if luatex or xelatex
  30. $if(mathspec)$
  31. \ifxetex
  32. \usepackage{mathspec}
  33. \else
  34. \usepackage{unicode-math}
  35. \fi
  36. $else$
  37. \usepackage{unicode-math}
  38. $endif$
  39. \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
  40. $for(fontfamilies)$
  41. \newfontfamily{$fontfamilies.name$}[$fontfamilies.options$]{$fontfamilies.font$}
  42. $endfor$
  43. $if(euro)$
  44. \newcommand{\euro}{€}
  45. $endif$
  46. $if(mainfont)$
  47. \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
  48. $else$
  49. \setmainfont{LinLibertineO}
  50. $endif$
  51. $if(sansfont)$
  52. \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$}
  53. $else$
  54. \setsansfont{Carlito}
  55. $endif$
  56. $if(monofont)$
  57. \setmonofont[Mapping=tex-ansi$if(monofontoptions)$,$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$endif$]{$monofont$}
  58. $else$
  59. \setmonofont[Mapping=tex-ansi]{DejaVuSansMono}
  60. $endif$
  61. $if(mathfont)$
  62. $if(mathspec)$
  63. \ifxetex
  64. \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
  65. \else
  66. \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
  67. \fi
  68. $else$
  69. \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
  70. $endif$
  71. $endif$
  72. $if(CJKmainfont)$
  73. \ifxetex
  74. \usepackage{xeCJK}
  75. \setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
  76. \fi
  77. $endif$
  78. $if(luatexjapresetoptions)$
  79. \ifluatex
  80. \usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset}
  81. \fi
  82. $endif$
  83. $if(CJKmainfont)$
  84. \ifluatex
  85. \usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec}
  86. \setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
  87. \fi
  88. $endif$
  89. \fi
  90. % use upquote if available, for straight quotes in verbatim environments
  91. \IfFileExists{upquote.sty}{\usepackage{upquote}}{}
  92. % use microtype if available
  93. \IfFileExists{microtype.sty}{%
  94. \usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype}
  95. \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
  96. }{}
  97. $if(indent)$
  98. $else$
  99. % \IfFileExists{parskip.sty}{%
  100. % \usepackage{parskip}
  101. % }{% else
  102. % \setlength{\parindent}{0pt}
  103. % \setlength{\parskip}{6pt plus 2pt minus 1pt}
  104. % }
  105. $endif$
  106. $if(verbatim-in-note)$
  107. \usepackage{fancyvrb}
  108. $endif$
  109. \usepackage{hyperref}
  110. \hypersetup{
  111. $if(title-meta)$
  112. pdftitle={$title-meta$},
  113. $endif$
  114. $if(author-meta)$
  115. pdfauthor={$author-meta$},
  116. $endif$
  117. $if(keywords)$
  118. pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$},
  119. $endif$
  120. $if(colorlinks)$
  121. colorlinks=true,
  122. linkcolor=$if(linkcolor)$$linkcolor$$else$Maroon$endif$,
  123. citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$,
  124. urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$,
  125. $else$
  126. pdfborder={0 0 0},
  127. $endif$
  128. breaklinks=true}
  129. % \urlstyle{same} % don't use monospace font for urls
  130. $if(verbatim-in-note)$
  131. \VerbatimFootnotes % allows verbatim text in footnotes
  132. $endif$
  133. $if(geometry)$
  134. \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
  135. $else$
  136. \usepackage{geometry}
  137. \geometry{paper=a4paper, left=2.5cm, right=2cm, bottom=3.5cm, foot=2cm, top=3.5cm, head=2cm}
  138. $endif$
  139. $if(natbib)$
  140. \usepackage[$natbiboptions$]{natbib}
  141. \bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
  142. $endif$
  143. $if(biblatex)$
  144. \usepackage[$if(biblio-style)$style=$biblio-style$,$endif$$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$]{biblatex}
  145. $for(bibliography)$
  146. \addbibresource{$bibliography$}
  147. $endfor$
  148. $endif$
  149. $if(listings)$
  150. \usepackage{listings}
  151. \usepackage{xcolor}
  152. \input{syntax.tex}
  153. \newcommand{\passthrough}[1]{#1}
  154. $endif$
  155. $if(lhs)$
  156. \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
  157. $endif$
  158. $if(highlighting-macros)$
  159. $highlighting-macros$
  160. $endif$
  161. $if(tables)$
  162. \usepackage{longtable,booktabs}
  163. % Fix footnotes in tables (requires footnote package)
  164. \IfFileExists{footnote.sty}{\usepackage{footnote}\makesavenoteenv{longtable}}{}
  165. $endif$
  166. \usepackage{graphicx,grffile}
  167. \makeatletter
  168. \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
  169. \def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
  170. \makeatother
  171. % Scale images if necessary, so that they will not overflow the page
  172. % margins by default, and it is still possible to overwrite the defaults
  173. % using explicit options in \includegraphics[width, height, ...]{}
  174. \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
  175. % SIunits
  176. \usepackage{siunitx}
  177. % vectors done right
  178. \renewcommand{\vec}[1]{\ensuremath\mathbf{#1}}
  179. % headers y footers a medida
  180. \usepackage{lastpage}
  181. \usepackage{fancyhdr}
  182. \pagestyle{fancy}
  183. \fancyhf{} % clear all header and footer fields
  184. $if(title)$
  185. \lhead{$title$}
  186. $endif$
  187. \lfoot{\scriptsize{$if(date)$ $date$ $endif$ / $if(hash)$ \texttt{$hash$} $endif$}}
  188. \rfoot{\thepage/\pageref{LastPage}}
  189. \rhead{\includegraphics[height=10pt]{logo}}
  190. \renewcommand{\headrulewidth}{0.0pt}
  191. \renewcommand{\footrulewidth}{0.4pt}
  192. \fancypagestyle{plain}{%
  193. \fancyhf{} % clear all header and footer fields
  194. $if(hash)$
  195. % \lhead{\scriptsize{\texttt{$hash$}}}
  196. \rfoot{\scriptsize{\texttt{$hash$}}}
  197. $endif$
  198. \renewcommand{\headrulewidth}{0pt}
  199. \renewcommand{\footrulewidth}{0pt}}
  200. $if(links-as-notes)$
  201. % Make links footnotes instead of hotlinks:
  202. \DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}}
  203. $endif$
  204. $if(strikeout)$
  205. \usepackage[normalem]{ulem}
  206. % avoid problems with \sout in headers with hyperref:
  207. \pdfstringdefDisableCommands{\renewcommand{\sout}{}}
  208. $endif$
  209. \setlength{\emergencystretch}{3em} % prevent overfull lines
  210. \providecommand{\tightlist}{%
  211. \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
  212. $if(numbersections)$
  213. \setcounter{secnumdepth}{$if(secnumdepth)$$secnumdepth$$else$5$endif$}
  214. $else$
  215. \setcounter{secnumdepth}{0}
  216. $endif$
  217. $if(subparagraph)$
  218. $else$
  219. % Redefines (sub)paragraphs to behave more like sections
  220. \ifx\paragraph\undefined\else
  221. \let\oldparagraph\paragraph
  222. \renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
  223. \fi
  224. \ifx\subparagraph\undefined\else
  225. \let\oldsubparagraph\subparagraph
  226. \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
  227. \fi
  228. $endif$
  229. $if(lang)$
  230. \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  231. \usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
  232. $if(babel-newcommands)$
  233. $babel-newcommands$
  234. $endif$
  235. \else
  236. % load polyglossia as late as possible as it *could* call bidi if RTL lang (e.g. Hebrew or Arabic)
  237. \usepackage{polyglossia}
  238. \setmainlanguage[$polyglossia-lang.options$]{$polyglossia-lang.name$}
  239. $for(polyglossia-otherlangs)$
  240. \setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$}
  241. $endfor$
  242. \fi
  243. $endif$
  244. $if(dir)$
  245. \ifxetex
  246. % load bidi as late as possible as it modifies e.g. graphicx
  247. $if(latex-dir-rtl)$
  248. \usepackage[RTLdocument]{bidi}
  249. $else$
  250. \usepackage{bidi}
  251. $endif$
  252. \fi
  253. \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  254. \TeXXeTstate=1
  255. \newcommand{\RL}[1]{\beginR #1\endR}
  256. \newcommand{\LR}[1]{\beginL #1\endL}
  257. \newenvironment{RTL}{\beginR}{\endR}
  258. \newenvironment{LTR}{\beginL}{\endL}
  259. \fi
  260. $endif$
  261. \usepackage{subfig}
  262. % set default figure placement to htbp
  263. \makeatletter
  264. \def\fps@figure{htbp}
  265. \makeatother
  266. $for(header-includes)$
  267. $header-includes$
  268. $endfor$
  269. $if(title)$
  270. \title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
  271. $endif$
  272. $if(subtitle)$
  273. \providecommand{\subtitle}[1]{}
  274. \subtitle{$subtitle$}
  275. $endif$
  276. $if(author)$
  277. \author{$for(author)$$author$$sep$ \and $endfor$}
  278. $endif$
  279. $if(institute)$
  280. \providecommand{\institute}[1]{}
  281. \institute{$for(institute)$$institute$$sep$ \and $endfor$}
  282. $endif$
  283. \date{$date$}
  284. \begin{document}
  285. % \thispagestyle{empty}
  286. % \thispagestyle{plain}
  287. \thispagestyle{fancy}
  288. $if(title)$
  289. \maketitle
  290. $endif$
  291. $if(abstract)$
  292. \begin{abstract}
  293. $abstract$
  294. \end{abstract}
  295. $endif$
  296. $for(include-before)$
  297. $include-before$
  298. $endfor$
  299. $if(toc)$
  300. {
  301. $if(colorlinks)$
  302. \hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$black$endif$}
  303. $endif$
  304. \setcounter{tocdepth}{$toc-depth$}
  305. \tableofcontents
  306. }
  307. $endif$
  308. $if(lot)$
  309. \listoftables
  310. $endif$
  311. $if(lof)$
  312. \listoffigures
  313. $endif$
  314. $body$
  315. $if(natbib)$
  316. $if(bibliography)$
  317. $if(biblio-title)$
  318. $if(book-class)$
  319. \renewcommand\bibname{$biblio-title$}
  320. $else$
  321. \renewcommand\refname{$biblio-title$}
  322. $endif$
  323. $endif$
  324. \bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
  325. $endif$
  326. $endif$
  327. $if(biblatex)$
  328. \printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
  329. $endif$
  330. $for(include-after)$
  331. $include-after$
  332. $endfor$
  333. \end{document}