default.latex 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. \documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$lang$,$endif$$if(papersize)$$papersize$,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
  2. \usepackage[a4paper,margin=1.5cm]{geometry}
  3. % \geometry{a4paper}
  4. $if(fontfamily)$
  5. \usepackage{$fontfamily$}
  6. $else$
  7. \usepackage{lmodern}
  8. $endif$
  9. $if(linestretch)$
  10. \usepackage{setspace}
  11. \setstretch{$linestretch$}
  12. $endif$
  13. \usepackage{amssymb,amsmath}
  14. \usepackage{ifxetex,ifluatex}
  15. \usepackage{fixltx2e} % provides \textsubscript
  16. \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  17. \usepackage[T1]{fontenc}
  18. \usepackage[utf8]{inputenc}
  19. $if(euro)$
  20. \usepackage{eurosym}
  21. $endif$
  22. \else % if luatex or xelatex
  23. \ifxetex
  24. \usepackage{mathspec}
  25. \usepackage{xltxtra,xunicode}
  26. \else
  27. \usepackage{fontspec}
  28. \fi
  29. \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
  30. \newcommand{\euro}{€}
  31. $if(mainfont)$
  32. \setmainfont{$mainfont$}
  33. $endif$
  34. $if(sansfont)$
  35. \setsansfont{$sansfont$}
  36. $endif$
  37. $if(monofont)$
  38. \setmonofont[Mapping=tex-ansi]{$monofont$}
  39. $endif$
  40. $if(mathfont)$
  41. \setmathfont(Digits,Latin,Greek){$mathfont$}
  42. $endif$
  43. \fi
  44. % use upquote if available, for straight quotes in verbatim environments
  45. \IfFileExists{upquote.sty}{\usepackage{upquote}}{}
  46. % use microtype if available
  47. \IfFileExists{microtype.sty}{%
  48. \usepackage{microtype}
  49. \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
  50. }{}
  51. $if(geometry)$
  52. \usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
  53. $endif$
  54. $if(lang)$
  55. \ifxetex
  56. \usepackage{polyglossia}
  57. \setmainlanguage{$mainlang$}
  58. \else
  59. \usepackage[shorthands=off,$lang$]{babel}
  60. \fi
  61. $endif$
  62. $if(natbib)$
  63. \usepackage{natbib}
  64. \bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
  65. $endif$
  66. $if(biblatex)$
  67. \usepackage{biblatex}
  68. $if(biblio-files)$
  69. \bibliography{$biblio-files$}
  70. $endif$
  71. $endif$
  72. $if(listings)$
  73. \usepackage{listings}
  74. $endif$
  75. $if(lhs)$
  76. \lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
  77. $endif$
  78. $if(highlighting-macros)$
  79. $highlighting-macros$
  80. $endif$
  81. $if(verbatim-in-note)$
  82. \usepackage{fancyvrb}
  83. \VerbatimFootnotes
  84. $endif$
  85. $if(tables)$
  86. \usepackage{longtable,booktabs}
  87. $endif$
  88. $if(graphics)$
  89. \usepackage{graphicx}
  90. \makeatletter
  91. \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
  92. \def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
  93. \makeatother
  94. % Scale images if necessary, so that they will not overflow the page
  95. % margins by default, and it is still possible to overwrite the defaults
  96. % using explicit options in \includegraphics[width, height, ...]{}
  97. \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
  98. $endif$
  99. \ifxetex
  100. \usepackage[setpagesize=false, % page size defined by xetex
  101. unicode=false, % unicode breaks when used with xetex
  102. xetex]{hyperref}
  103. \else
  104. \usepackage[unicode=true]{hyperref}
  105. \fi
  106. \hypersetup{breaklinks=true,
  107. bookmarks=true,
  108. pdfauthor={$author-meta$},
  109. pdftitle={$title-meta$},
  110. colorlinks=true,
  111. citecolor=$if(citecolor)$$citecolor$$else$blue$endif$,
  112. urlcolor=$if(urlcolor)$$urlcolor$$else$blue$endif$,
  113. linkcolor=$if(linkcolor)$$linkcolor$$else$magenta$endif$,
  114. pdfborder={0 0 0}}
  115. \urlstyle{same} % don't use monospace font for urls
  116. $if(links-as-notes)$
  117. % Make links footnotes instead of hotlinks:
  118. \renewcommand{\href}[2]{#2\footnote{\url{#1}}}
  119. $endif$
  120. $if(strikeout)$
  121. \usepackage[normalem]{ulem}
  122. % avoid problems with \sout in headers with hyperref:
  123. \pdfstringdefDisableCommands{\renewcommand{\sout}{}}
  124. $endif$
  125. \setlength{\parindent}{0pt}
  126. \setlength{\parskip}{6pt plus 2pt minus 1pt}
  127. \setlength{\emergencystretch}{3em} % prevent overfull lines
  128. $if(numbersections)$
  129. \setcounter{secnumdepth}{5}
  130. $else$
  131. \setcounter{secnumdepth}{0}
  132. $endif$
  133. $if(verbatim-in-note)$
  134. \VerbatimFootnotes % allows verbatim text in footnotes
  135. $endif$
  136. $if(title)$
  137. \title{$title$$if(subtitle)$\\\vspace{0.5em}{\large $subtitle$}$endif$}
  138. $endif$
  139. $if(author)$
  140. \author{$for(author)$$author$$sep$ \and $endfor$}
  141. $endif$
  142. \date{$date$}
  143. $for(header-includes)$
  144. $header-includes$
  145. $endfor$
  146. \begin{document}
  147. $if(title)$
  148. \maketitle
  149. $endif$
  150. $if(abstract)$
  151. \begin{abstract}
  152. $abstract$
  153. \end{abstract}
  154. $endif$
  155. $for(include-before)$
  156. $include-before$
  157. $endfor$
  158. $if(toc)$
  159. {
  160. \hypersetup{linkcolor=black}
  161. \setcounter{tocdepth}{$toc-depth$}
  162. \tableofcontents
  163. }
  164. $endif$
  165. $if(lot)$
  166. \listoftables
  167. $endif$
  168. $if(lof)$
  169. \listoffigures
  170. $endif$
  171. $body$
  172. $if(natbib)$
  173. $if(biblio-files)$
  174. $if(biblio-title)$
  175. $if(book-class)$
  176. \renewcommand\bibname{$biblio-title$}
  177. $else$
  178. \renewcommand\refname{$biblio-title$}
  179. $endif$
  180. $endif$
  181. \bibliography{$biblio-files$}
  182. $endif$
  183. $endif$
  184. $if(biblatex)$
  185. \printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
  186. $endif$
  187. $for(include-after)$
  188. $include-after$
  189. $endfor$
  190. \end{document}