2015-12-23 13:28:59 -08:00
|
|
|
\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(papersize)$$papersize$paper,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
|
2014-05-06 09:54:00 -07:00
|
|
|
$if(fontfamily)$
|
2015-10-22 13:35:13 -04:00
|
|
|
\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
|
2014-05-06 09:54:00 -07:00
|
|
|
$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
|
2015-10-11 02:03:42 -04:00
|
|
|
\usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{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}
|
|
|
|
\else
|
|
|
|
\usepackage{fontspec}
|
2012-06-05 11:35:17 -07:00
|
|
|
\fi
|
2015-10-16 08:41:15 -04:00
|
|
|
\defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
|
2015-11-30 22:53:19 -05:00
|
|
|
$if(euro)$
|
2012-06-05 11:35:17 -07:00
|
|
|
\newcommand{\euro}{€}
|
2015-11-30 22:53:19 -05:00
|
|
|
$endif$
|
2012-03-15 10:47:19 -07:00
|
|
|
$if(mainfont)$
|
2015-10-22 13:35:13 -04:00
|
|
|
\setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
|
2012-03-14 19:06:17 -07:00
|
|
|
$endif$
|
|
|
|
$if(sansfont)$
|
2015-10-22 13:35:13 -04:00
|
|
|
\setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$}
|
2012-03-14 19:06:17 -07:00
|
|
|
$endif$
|
|
|
|
$if(monofont)$
|
2015-10-22 13:35:13 -04:00
|
|
|
\setmonofont[Mapping=tex-ansi$if(monofontoptions)$,$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$endif$]{$monofont$}
|
2012-03-15 14:38:21 -07:00
|
|
|
$endif$
|
|
|
|
$if(mathfont)$
|
2015-10-22 13:35:13 -04:00
|
|
|
\setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
|
2012-03-14 19:06:17 -07:00
|
|
|
$endif$
|
2015-06-02 22:53:58 +02:00
|
|
|
$if(CJKmainfont)$
|
|
|
|
\usepackage{xeCJK}
|
2015-10-22 13:35:13 -04:00
|
|
|
\setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
|
2015-06-02 22:53:58 +02: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
|
2014-08-20 08:14:53 -07:00
|
|
|
\IfFileExists{microtype.sty}{%
|
|
|
|
\usepackage{microtype}
|
|
|
|
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
|
|
|
|
}{}
|
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$
|
2015-10-19 18:21:58 -04:00
|
|
|
\usepackage{hyperref}
|
2015-11-30 22:46:50 -05:00
|
|
|
$if(colorlinks)$
|
2015-10-19 18:21:58 -04:00
|
|
|
\PassOptionsToPackage{usenames,dvipsnames}{color} % color is loaded by hyperref
|
2015-11-30 22:46:50 -05:00
|
|
|
$endif$
|
2015-11-09 11:10:47 -05:00
|
|
|
\hypersetup{unicode=true,
|
2015-10-22 13:35:13 -04:00
|
|
|
$if(title-meta)$
|
|
|
|
pdftitle={$title-meta$},
|
|
|
|
$endif$
|
|
|
|
$if(author-meta)$
|
|
|
|
pdfauthor={$author-meta$},
|
|
|
|
$endif$
|
|
|
|
$if(keywords)$
|
|
|
|
pdfkeywords={$for(keywords)$$keywords$$sep$; $endfor$},
|
|
|
|
$endif$
|
2015-11-09 11:10:47 -05:00
|
|
|
$if(colorlinks)$
|
2015-05-27 12:22:55 -07:00
|
|
|
colorlinks=true,
|
2015-11-09 11:10:47 -05:00
|
|
|
linkcolor=$if(linkcolor)$$linkcolor$$else$Maroon$endif$,
|
|
|
|
citecolor=$if(citecolor)$$citecolor$$else$Blue$endif$,
|
|
|
|
urlcolor=$if(urlcolor)$$urlcolor$$else$Blue$endif$,
|
|
|
|
$else$
|
|
|
|
pdfborder={0 0 0},
|
|
|
|
$endif$
|
|
|
|
breaklinks=true}
|
2015-05-27 12:22:55 -07:00
|
|
|
\urlstyle{same} % don't use monospace font for urls
|
2014-09-24 14:31:39 +02:00
|
|
|
$if(lang)$
|
2015-10-17 17:48:06 +02:00
|
|
|
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
|
2015-10-22 13:35:13 -04:00
|
|
|
\usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
|
|
|
|
$if(babel-newcommands)$
|
2015-10-17 17:48:06 +02:00
|
|
|
$babel-newcommands$
|
2015-10-22 13:35:13 -04:00
|
|
|
$endif$
|
2015-10-17 17:48:06 +02:00
|
|
|
\else
|
2014-09-24 14:31:39 +02:00
|
|
|
\usepackage{polyglossia}
|
2015-10-07 22:46:44 +02:00
|
|
|
\setmainlanguage[$polyglossia-lang.options$]{$polyglossia-lang.name$}
|
|
|
|
$for(polyglossia-otherlangs)$
|
|
|
|
\setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$}
|
|
|
|
$endfor$
|
2014-09-24 14:31:39 +02:00
|
|
|
\fi
|
|
|
|
$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)$
|
2015-12-15 10:57:37 +00:00
|
|
|
\usepackage$if(biblio-style)$[style=$biblio-style$]$endif${biblatex}
|
|
|
|
$if(biblatexoptions)$\ExecuteBibliographyOptions{$for(biblatexoptions)$$biblatexoptions$$sep$,$endfor$}$endif$
|
2015-05-11 21:13:25 -07:00
|
|
|
$for(bibliography)$
|
|
|
|
\addbibresource{$bibliography$}
|
|
|
|
$endfor$
|
2011-07-19 12:02:59 -07:00
|
|
|
$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}
|
2015-10-11 01:39:56 -04:00
|
|
|
\VerbatimFootnotes % allows verbatim text in footnotes
|
2011-07-19 12:02:59 -07:00
|
|
|
$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)$
|
2015-04-13 08:53:08 -07:00
|
|
|
\usepackage{graphicx,grffile}
|
2011-07-19 12:02:59 -07:00
|
|
|
\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 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$
|
2015-10-11 02:03:42 -04:00
|
|
|
$if(indent)$
|
|
|
|
$else$
|
2015-12-16 00:01:37 +00:00
|
|
|
\IfFileExists{parskip.sty}{%
|
2015-12-10 13:54:13 +00:00
|
|
|
\usepackage{parskip}
|
2015-12-16 00:01:37 +00:00
|
|
|
}{% else
|
2011-07-19 12:02:59 -07:00
|
|
|
\setlength{\parindent}{0pt}
|
|
|
|
\setlength{\parskip}{6pt plus 2pt minus 1pt}
|
2015-12-16 00:01:37 +00:00
|
|
|
}
|
2015-10-11 02:03:42 -04:00
|
|
|
$endif$
|
2011-07-22 12:50:22 -07:00
|
|
|
\setlength{\emergencystretch}{3em} % prevent overfull lines
|
2015-05-02 09:08:39 -07:00
|
|
|
\providecommand{\tightlist}{%
|
2015-04-17 19:22:28 -07:00
|
|
|
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
|
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$
|
2015-11-20 14:29:36 -08:00
|
|
|
$if(subparagraph)$
|
|
|
|
$else$
|
|
|
|
% Redefines (sub)paragraphs to behave more like sections
|
|
|
|
\ifx\paragraph\undefined\else
|
|
|
|
\let\oldparagraph\paragraph
|
|
|
|
\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
|
|
|
|
\fi
|
|
|
|
\ifx\subparagraph\undefined\else
|
|
|
|
\let\oldsubparagraph\subparagraph
|
|
|
|
\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
|
|
|
|
\fi
|
|
|
|
$endif$
|
2015-09-26 21:28:09 +02:00
|
|
|
$if(dir)$
|
|
|
|
\ifxetex
|
|
|
|
% load bidi as late as possible as it modifies e.g. graphicx
|
|
|
|
$if(latex-dir-rtl)$
|
|
|
|
\usepackage[RTLdocument]{bidi}
|
|
|
|
$else$
|
|
|
|
\usepackage{bidi}
|
|
|
|
$endif$
|
|
|
|
\fi
|
|
|
|
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
|
|
|
|
\TeXXeTstate=1
|
|
|
|
\newcommand{\RL}[1]{\beginR #1\endR}
|
|
|
|
\newcommand{\LR}[1]{\beginL #1\endL}
|
|
|
|
\newenvironment{RTL}{\beginR}{\endR}
|
|
|
|
\newenvironment{LTR}{\beginL}{\endL}
|
|
|
|
\fi
|
|
|
|
$endif$
|
2015-11-20 14:29:36 -08:00
|
|
|
$for(header-includes)$
|
|
|
|
$header-includes$
|
|
|
|
$endfor$
|
2011-07-19 12:02:59 -07:00
|
|
|
|
|
|
|
$if(title)$
|
2015-12-15 14:12:54 +00:00
|
|
|
\title{$title$$if(thanks)$\thanks{$thanks$}$endif$}
|
2015-11-20 14:26:12 -08:00
|
|
|
$endif$
|
|
|
|
$if(subtitle)$
|
|
|
|
\providecommand{\subtitle}[1]{}
|
|
|
|
\subtitle{$subtitle$}
|
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$}
|
2015-04-17 23:26:21 +03:00
|
|
|
|
2011-07-19 12:02:59 -07:00
|
|
|
\begin{document}
|
2015-08-11 11:46:47 -07:00
|
|
|
$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
|
|
|
{
|
2015-11-09 11:10:47 -05:00
|
|
|
$if(colorlinks)$
|
2015-04-01 17:46:53 +01:00
|
|
|
\hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$black$endif$}
|
2015-11-09 11:10:47 -05:00
|
|
|
$endif$
|
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$
|
2014-07-20 21:54:45 -07:00
|
|
|
$if(lot)$
|
|
|
|
\listoftables
|
|
|
|
$endif$
|
|
|
|
$if(lof)$
|
|
|
|
\listoffigures
|
|
|
|
$endif$
|
2011-07-19 12:02:59 -07:00
|
|
|
$body$
|
2011-07-30 17:03:03 -07:00
|
|
|
|
2011-07-19 12:02:59 -07:00
|
|
|
$if(natbib)$
|
2015-05-11 21:13:25 -07:00
|
|
|
$if(bibliography)$
|
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$
|
2015-05-11 21:13:25 -07:00
|
|
|
\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
|
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}
|