2013-07-17 15:05:45 -07:00
|
|
|
\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$lang$,$endif$$if(papersize)$$papersize$,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
|
2014-05-06 09:54:00 -07:00
|
|
|
$if(fontfamily)$
|
|
|
|
\usepackage{$fontfamily$}
|
|
|
|
$else$
|
2012-06-05 11:34:43 -07:00
|
|
|
\usepackage{lmodern}
|
2014-05-06 09:54:00 -07:00
|
|
|
$endif$
|
2014-05-06 10:16:09 -07:00
|
|
|
$if(linestretch)$
|
|
|
|
\usepackage{setspace}
|
|
|
|
\setstretch{$linestretch$}
|
|
|
|
$endif$
|
2011-07-19 12:02:59 -07:00
|
|
|
\usepackage{amssymb,amsmath}
|
2012-06-05 22:21:41 -07:00
|
|
|
\usepackage{ifxetex,ifluatex}
|
2012-04-21 09:57:45 -07:00
|
|
|
\usepackage{fixltx2e} % provides \textsubscript
|
2012-06-05 22:21:41 -07:00
|
|
|
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
|
2014-02-20 09:36:20 -08:00
|
|
|
\usepackage[T1]{fontenc}
|
2012-06-05 11:35:17 -07:00
|
|
|
\usepackage[utf8]{inputenc}
|
|
|
|
$if(euro)$
|
|
|
|
\usepackage{eurosym}
|
2012-03-15 14:38:21 -07:00
|
|
|
$endif$
|
2012-06-05 22:21:41 -07:00
|
|
|
\else % if luatex or xelatex
|
|
|
|
\ifxetex
|
2013-04-25 21:05:31 -07:00
|
|
|
\usepackage{mathspec}
|
2012-06-05 11:35:17 -07:00
|
|
|
\usepackage{xltxtra,xunicode}
|
2013-04-25 21:05:31 -07:00
|
|
|
\else
|
|
|
|
\usepackage{fontspec}
|
2012-06-05 11:35:17 -07:00
|
|
|
\fi
|
|
|
|
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
|
|
|
|
\newcommand{\euro}{€}
|
2012-03-15 10:47:19 -07:00
|
|
|
$if(mainfont)$
|
|
|
|
\setmainfont{$mainfont$}
|
2012-03-14 19:06:17 -07:00
|
|
|
$endif$
|
|
|
|
$if(sansfont)$
|
2012-03-14 18:49:48 -07:00
|
|
|
\setsansfont{$sansfont$}
|
2012-03-14 19:06:17 -07:00
|
|
|
$endif$
|
|
|
|
$if(monofont)$
|
2013-07-04 14:48:39 -07:00
|
|
|
\setmonofont[Mapping=tex-ansi]{$monofont$}
|
2012-03-15 14:38:21 -07:00
|
|
|
$endif$
|
|
|
|
$if(mathfont)$
|
2013-04-25 21:05:31 -07:00
|
|
|
\setmathfont(Digits,Latin,Greek){$mathfont$}
|
2012-03-14 19:06:17 -07:00
|
|
|
$endif$
|
2011-07-19 12:02:59 -07:00
|
|
|
\fi
|
2014-05-06 09:05:46 -07:00
|
|
|
% use upquote if available, for straight quotes in verbatim environments
|
|
|
|
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
|
2013-02-26 21:21:31 -05:00
|
|
|
% use microtype if available
|
|
|
|
\IfFileExists{microtype.sty}{\usepackage{microtype}}{}
|
2012-03-14 14:16:33 -07:00
|
|
|
$if(geometry)$
|
2012-03-15 10:47:19 -07:00
|
|
|
\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
|
2012-03-14 14:16:33 -07:00
|
|
|
$endif$
|
2011-07-19 12:02:59 -07:00
|
|
|
$if(natbib)$
|
|
|
|
\usepackage{natbib}
|
2013-07-20 10:51:18 -07:00
|
|
|
\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
|
2011-07-19 12:02:59 -07:00
|
|
|
$endif$
|
|
|
|
$if(biblatex)$
|
|
|
|
\usepackage{biblatex}
|
|
|
|
$if(biblio-files)$
|
|
|
|
\bibliography{$biblio-files$}
|
|
|
|
$endif$
|
|
|
|
$endif$
|
2011-12-23 18:23:48 -08:00
|
|
|
$if(listings)$
|
2011-07-19 12:02:59 -07:00
|
|
|
\usepackage{listings}
|
2011-12-23 18:23:48 -08:00
|
|
|
$endif$
|
|
|
|
$if(lhs)$
|
2011-07-19 12:02:59 -07:00
|
|
|
\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
|
|
|
|
$endif$
|
2011-12-23 17:46:53 -08:00
|
|
|
$if(highlighting-macros)$
|
|
|
|
$highlighting-macros$
|
|
|
|
$endif$
|
2011-07-19 12:02:59 -07:00
|
|
|
$if(verbatim-in-note)$
|
|
|
|
\usepackage{fancyvrb}
|
|
|
|
$endif$
|
|
|
|
$if(tables)$
|
2013-12-02 09:22:14 +00:00
|
|
|
\usepackage{longtable,booktabs}
|
2011-07-19 12:02:59 -07:00
|
|
|
$endif$
|
|
|
|
$if(graphics)$
|
|
|
|
\usepackage{graphicx}
|
|
|
|
\makeatletter
|
2014-04-11 17:22:45 -05:00
|
|
|
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
|
|
|
|
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
|
2011-07-19 12:02:59 -07:00
|
|
|
\makeatother
|
2014-04-11 17:22:45 -05:00
|
|
|
% Scale images if necessary, so that they will not overflow the page
|
|
|
|
% margins by default, and it is still possible to overwrite the defaults
|
|
|
|
% using explicit options in \includegraphics[width, height, ...]{}
|
|
|
|
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
|
2011-07-19 12:02:59 -07:00
|
|
|
$endif$
|
2012-06-05 22:21:41 -07:00
|
|
|
\ifxetex
|
2011-07-23 09:54:18 -07:00
|
|
|
\usepackage[setpagesize=false, % page size defined by xetex
|
|
|
|
unicode=false, % unicode breaks when used with xetex
|
2012-06-03 10:57:58 -07:00
|
|
|
xetex]{hyperref}
|
2011-07-23 09:54:18 -07:00
|
|
|
\else
|
2012-06-03 10:57:58 -07:00
|
|
|
\usepackage[unicode=true]{hyperref}
|
2011-07-23 09:54:18 -07:00
|
|
|
\fi
|
2012-06-03 10:57:58 -07:00
|
|
|
\hypersetup{breaklinks=true,
|
|
|
|
bookmarks=true,
|
|
|
|
pdfauthor={$author-meta$},
|
|
|
|
pdftitle={$title-meta$},
|
|
|
|
colorlinks=true,
|
2013-06-18 11:42:32 -05:00
|
|
|
citecolor=$if(citecolor)$$citecolor$$else$blue$endif$,
|
2012-06-08 10:56:57 -07:00
|
|
|
urlcolor=$if(urlcolor)$$urlcolor$$else$blue$endif$,
|
|
|
|
linkcolor=$if(linkcolor)$$linkcolor$$else$magenta$endif$,
|
2012-06-03 10:57:58 -07:00
|
|
|
pdfborder={0 0 0}}
|
2013-01-21 11:42:42 -08:00
|
|
|
\urlstyle{same} % don't use monospace font for urls
|
2012-06-05 10:04:36 -07:00
|
|
|
$if(links-as-notes)$
|
|
|
|
% Make links footnotes instead of hotlinks:
|
|
|
|
\renewcommand{\href}[2]{#2\footnote{\url{#1}}}
|
|
|
|
$endif$
|
2011-07-23 09:43:38 -07:00
|
|
|
$if(strikeout)$
|
|
|
|
\usepackage[normalem]{ulem}
|
|
|
|
% avoid problems with \sout in headers with hyperref:
|
|
|
|
\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
|
|
|
|
$endif$
|
2011-07-19 12:02:59 -07:00
|
|
|
\setlength{\parindent}{0pt}
|
|
|
|
\setlength{\parskip}{6pt plus 2pt minus 1pt}
|
2011-07-22 12:50:22 -07:00
|
|
|
\setlength{\emergencystretch}{3em} % prevent overfull lines
|
2011-07-19 12:02:59 -07:00
|
|
|
$if(numbersections)$
|
2013-02-18 08:49:37 -08:00
|
|
|
\setcounter{secnumdepth}{5}
|
2011-07-19 12:02:59 -07:00
|
|
|
$else$
|
|
|
|
\setcounter{secnumdepth}{0}
|
|
|
|
$endif$
|
|
|
|
$if(verbatim-in-note)$
|
|
|
|
\VerbatimFootnotes % allows verbatim text in footnotes
|
|
|
|
$endif$
|
2011-11-27 20:36:37 -08:00
|
|
|
$if(lang)$
|
2012-06-05 22:21:41 -07:00
|
|
|
\ifxetex
|
2012-03-04 18:42:42 -08:00
|
|
|
\usepackage{polyglossia}
|
2012-03-05 08:37:04 -08:00
|
|
|
\setmainlanguage{$mainlang$}
|
2012-03-04 18:42:42 -08:00
|
|
|
\else
|
|
|
|
\usepackage[$lang$]{babel}
|
|
|
|
\fi
|
2011-11-27 20:36:37 -08:00
|
|
|
$endif$
|
2011-07-19 12:02:59 -07:00
|
|
|
|
|
|
|
$if(title)$
|
2014-06-09 22:33:13 -07:00
|
|
|
\title{$title$$if(subtitle)$\\\vspace{0.5em}{\large $subtitle$}$endif$}
|
2013-06-21 22:48:49 -07:00
|
|
|
$endif$
|
2014-05-06 09:48:18 -07:00
|
|
|
$if(author)$
|
2011-07-21 10:10:51 -07:00
|
|
|
\author{$for(author)$$author$$sep$ \and $endfor$}
|
2014-05-06 09:48:18 -07:00
|
|
|
$endif$
|
2011-07-19 12:02:59 -07:00
|
|
|
\date{$date$}
|
2013-12-11 22:34:57 -08:00
|
|
|
$for(header-includes)$
|
|
|
|
$header-includes$
|
|
|
|
$endfor$
|
2011-07-19 12:02:59 -07:00
|
|
|
|
|
|
|
\begin{document}
|
|
|
|
$if(title)$
|
|
|
|
\maketitle
|
|
|
|
$endif$
|
2013-12-11 22:05:20 -08:00
|
|
|
$if(abstract)$
|
|
|
|
\begin{abstract}
|
|
|
|
$abstract$
|
|
|
|
\end{abstract}
|
|
|
|
$endif$
|
2011-07-19 12:02:59 -07:00
|
|
|
|
|
|
|
$for(include-before)$
|
|
|
|
$include-before$
|
|
|
|
|
|
|
|
$endfor$
|
|
|
|
$if(toc)$
|
2012-06-05 10:04:42 -07:00
|
|
|
{
|
|
|
|
\hypersetup{linkcolor=black}
|
2013-01-05 11:58:09 -08:00
|
|
|
\setcounter{tocdepth}{$toc-depth$}
|
2011-07-19 12:02:59 -07:00
|
|
|
\tableofcontents
|
2012-06-05 10:04:42 -07:00
|
|
|
}
|
2011-07-19 12:02:59 -07:00
|
|
|
$endif$
|
|
|
|
$body$
|
2011-07-30 17:03:03 -07:00
|
|
|
|
2011-07-19 12:02:59 -07:00
|
|
|
$if(natbib)$
|
2014-04-11 11:10:46 -07:00
|
|
|
$if(biblio-files)$
|
2011-07-19 12:02:59 -07:00
|
|
|
$if(biblio-title)$
|
|
|
|
$if(book-class)$
|
|
|
|
\renewcommand\bibname{$biblio-title$}
|
|
|
|
$else$
|
|
|
|
\renewcommand\refname{$biblio-title$}
|
|
|
|
$endif$
|
|
|
|
$endif$
|
|
|
|
\bibliography{$biblio-files$}
|
2014-04-11 11:10:46 -07:00
|
|
|
|
2011-07-19 12:02:59 -07:00
|
|
|
$endif$
|
|
|
|
$endif$
|
|
|
|
$if(biblatex)$
|
|
|
|
\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
|
2011-07-30 17:03:03 -07:00
|
|
|
|
2011-07-19 12:02:59 -07:00
|
|
|
$endif$
|
|
|
|
$for(include-after)$
|
|
|
|
$include-after$
|
|
|
|
|
2011-07-30 17:03:03 -07:00
|
|
|
$endfor$
|
2011-07-19 12:02:59 -07:00
|
|
|
\end{document}
|