149 lines
3.7 KiB
TeX
149 lines
3.7 KiB
TeX
%!TEX TS-program = xelatex
|
|
%!TEX encoding = UTF-8 Unicode
|
|
|
|
%\documentclass[$fontsize$, a4paper]{article}
|
|
\documentclass[$fontsize$, a4paper, headings=small, markcase=upper]{scrartcl}
|
|
\usepackage{fontspec}
|
|
|
|
% 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
|
|
|
|
% LAYOUT
|
|
%--------------------------------
|
|
\usepackage{geometry}
|
|
\geometry{$geometry$}
|
|
|
|
% Trim excessive whitespace before lists
|
|
\usepackage{enumitem}
|
|
\setlist{nolistsep}
|
|
|
|
% 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}
|
|
|
|
% 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\&}}
|
|
|
|
% Upper-case section headings
|
|
\renewcommand\sectionlinesformat[4]{%
|
|
\@hangfrom{\hskip#2 #3}{\MakeUppercase{#4}}%
|
|
}
|
|
|
|
$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$},
|
|
pdftitle={$course$ - $title$},
|
|
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}
|
|
|
|
\subject{\vspace{-6ex}$course$\vspace{-1.5ex}}
|
|
\title{$title$\vspace{-1ex}}
|
|
\author{$author_name$, $author_group$, $author_id$}
|
|
\date{\vspace{-1ex}
|
|
\today}
|
|
%\begin{spacing}{1}
|
|
%\maketitle \end{spacing}
|
|
\maketitle
|
|
|
|
$if(multicol)$
|
|
\begin{multicols}{$columns$}
|
|
$endif$
|
|
|
|
$body$
|
|
|
|
$if(multicol)$
|
|
\end{multicols}
|
|
$endif$
|
|
|
|
\end{document}
|