pandoc-templates/handin/template.tex

177 lines
4.3 KiB
TeX
Raw Normal View History

2016-11-10 14:13:26 +00:00
%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
2016-11-10 16:29:44 +00:00
%\documentclass[$fontsize$, a4paper]{article}
\documentclass[$fontsize$, a4paper, headings=small, markcase=upper]{scrartcl}
2016-11-10 14:13:26 +00:00
\usepackage{fontspec}
2016-11-23 21:48:44 +00:00
\usepackage{amsmath}
2016-11-10 14:13:26 +00:00
2016-11-10 16:29:44 +00:00
% KOMASCRIPT
%--------------------------------
\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
\DeclareRobustCommand*\cal{\@fontswitch\relax\mathcal}
\DeclareRobustCommand*\mit{\@fontswitch\relax\mathnormal}
\makeatletter
2016-11-10 14:13:26 +00:00
% LAYOUT
%--------------------------------
\usepackage{geometry}
\geometry{$geometry$}
% Trim excessive whitespace before lists
\usepackage{enumitem}
\setlist{nolistsep}
2016-11-10 16:29:44 +00:00
% Spacing after section headers
\RedeclareSectionCommand[
beforeskip=-\baselineskip,
afterskip=.1\baselineskip]{section}
\RedeclareSectionCommand[
beforeskip=-.75\baselineskip,
afterskip=.1\baselineskip]{subsection}
\RedeclareSectionCommand[
beforeskip=-.5\baselineskip,
afterskip=.1\baselineskip]{subsubsection}
\RedeclareSectionCommand[
beforeskip=.5\baselineskip,
afterskip=-1em]{paragraph}
\RedeclareSectionCommand[
beforeskip=-.5\baselineskip,
afterskip=-1em]{subparagraph}
% Multi-column support
$if(multicol)$
\usepackage{multicol}
\setlength{\columnsep}{$columnsep$}
$endif$
% Header and footer
\usepackage[headsepline,automark]{scrlayer-scrpage}
\pagestyle{scrheadings}
2016-11-23 21:48:44 +00:00
\ihead{$course$ - $title$$if(subtitle)$ - $subtitle$$endif$}
2016-11-10 16:29:44 +00:00
\ohead[]{\headmark}
\chead{}
%\renewcommand*{\titlepagestyle}{scrheadings}
2016-11-23 21:48:44 +00:00
% Figure floats
\usepackage{float}
\let\origfigure=\figure
\let\endorigfigure=\endfigure
\renewenvironment{figure}[1][]{%
\origfigure[H]
}{%
\endorigfigure
}
2016-11-10 14:13:26 +00:00
% LANGUAGE
%--------------------------------
$if(lang)$
\usepackage{polyglossia}
\setmainlanguage{$lang$}
$endif$
% TYPOGRAPHY
%--------------------------------
\usepackage{xunicode}
\usepackage{xltxtra}
\usepackage[protrusion=true,final]{microtype}
% converts LaTeX specials (quotes, dashes etc.) to Unicode
\defaultfontfeatures{Mapping=tex-text}
2016-11-23 21:48:44 +00:00
%\setromanfont [Ligatures={Common}, Numbers={OldStyle}]{$mainfont$}
\setromanfont[Ligatures={Common}]{$mainfont$}
\setsansfont[Scale=1]{$altfont$}
2016-11-10 14:13:26 +00:00
\setmonofont[Scale=0.8]{$monofont$}
% Set paragraph break
\setlength{\parskip}{$parskip$}
\setlength{\parindent}{$parindent$}
% Custom ampersand
\newcommand{\amper}{{\fontspec[Scale=.95]{$mainfont$}\selectfont\itshape\&}}
2016-11-10 16:29:44 +00:00
% Upper-case section headings
\renewcommand\sectionlinesformat[4]{%
2016-11-23 21:48:44 +00:00
\@hangfrom{\hskip#2#3}{\MakeUppercase{#4}}%
2016-11-10 16:29:44 +00:00
}
2016-11-23 21:48:44 +00:00
% Remove numbers from section headings
\renewcommand*{\sectionformat}{}
\renewcommand*{\subsectionformat}{}
\renewcommand*{\subsubsectionformat}{}
% Make section headings slightly bigger than subsection headings
\addtokomafont{section}{\large}
% Center sectionheads
%\let\raggedsection\centering
2016-11-10 14:13:26 +00:00
$if(mainfont)$
\setmainfont{$mainfont$}
$endif$
$if(altfont)$
\setsansfont{$altfont$}
$endif$
% Command required by how Pandoc handles the list conversion
\providecommand{\tightlist}{
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
% PDF SETUP
%--------------------------------
\usepackage[xetex, bookmarks, colorlinks, breaklinks]{hyperref}
\hypersetup
{
pdfauthor={$author$},
pdfsubject={$course$},
2016-11-10 16:29:44 +00:00
pdftitle={$course$ - $title$},
2016-11-10 14:13:26 +00:00
colorlinks,breaklinks,
filecolor=black,
2016-11-23 21:48:44 +00:00
urlcolor=[rgb]{0,0,0.7},
linkcolor=[rgb]{0,0,0.7},
citecolor=[rgb]{0,0,0.7}
%urlcolor=[rgb]{0.117,0.682,0.858},
%linkcolor=[rgb]{0.117,0.682,0.858},
%citecolor=[rgb]{0.117,0.682,0.858}
2016-11-10 14:13:26 +00:00
}
% To display custom date in the example
$if(customdate)$
\usepackage[$lang$]{datetime2}
\DTMsavedate{customdate}{$customdate$}
$endif$
% DOCUMENT
%--------------------------------
\begin{document}
2016-11-10 16:29:44 +00:00
\subject{\vspace{-6ex}$course$\vspace{-1.5ex}}
2016-11-23 21:48:44 +00:00
\title{$title$}
$if(subtitle)$
\subtitle{$subtitle$}
$endif$
\author{\vspace{-1ex}$author_name$, $author_group$, $author_id$}
2016-11-10 16:29:44 +00:00
\date{\vspace{-1ex}
2016-11-10 14:13:26 +00:00
\today}
2016-11-10 16:29:44 +00:00
%\begin{spacing}{1}
%\maketitle \end{spacing}
2016-11-10 14:13:26 +00:00
\maketitle
$if(multicol)$
\begin{multicols}{$columns$}
$endif$
$body$
$if(multicol)$
\end{multicols}
$endif$
\end{document}