pandoc-templates/handin/template.tex

149 lines
3.7 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-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}
\ihead{$course$ - $title$}
\ohead[]{\headmark}
\chead{}
%\renewcommand*{\titlepagestyle}{scrheadings}
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}
\setromanfont [Ligatures={Common}, Numbers={OldStyle}]{$mainfont$}
\setsansfont[Scale=0.9]{$altfont$}
\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]{%
\@hangfrom{\hskip#2 #3}{\MakeUppercase{#4}}%
}
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,
urlcolor=[rgb]{0.117,0.682,0.858},
linkcolor=[rgb]{0.117,0.682,0.858},
linkcolor=[rgb]{0.117,0.682,0.858},
citecolor=[rgb]{0.117,0.682,0.858}
}
% 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}}
\title{$title$\vspace{-1ex}}
2016-11-10 14:13:26 +00:00
\author{$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}