Skip to content
Snippets Groups Projects
s0artcl.dtx 5.6 KiB
Newer Older
% \iffalse this-is-a-meta-comment-intended-for-humans
%
% Copyright (C) 2017 Roland Hieber <rohieb+latex@rohieb.name>
%
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.3 of this license or (at your option) any later
% version. The latest version of this license is in:
%
%   http://www.latex-project.org/lppl.txt
%
% and version 1.3 or later is part of all distributions of
% LaTeX version 2005/12/01 or later.
%
% \fi
%
\def\thisclass{s0artcl}
\def\thisfile{\thisclass.dtx}
% \iffalse
%<*driver>
\ProvidesFile{\thisfile}
%</driver>
%<class>\NeedsTeXFormat{LaTeX2e}
%<class>\ProvidesClass{\thisclass}
%<*class>
	[2017/02/21 v1.00 Stratum 0 Corporate Identity -- Article]
%</class>
%
%<*driver>
\documentclass{scrdoc}
\usepackage{hyperref}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
\DocInput{\thisfile}
\end{document}
%</driver>
% \fi
%
% \changes{v1.0}{2017/02/21}{Initial version}
%
% \GetFileInfo{\thisfile}
%
% \title{The \textsf{\thisclass} class\thanks{This document corresponds to
%   \textsf{\thisclass}~\fileversion, dated \filedate.}}
% \author{Roland Hieber \\ \url{rohieb+stratum0-latex-qua1aiMe@rohieb.name>}}
%
% \maketitle
% \tableofcontents
%
% \section{Introduction}
% This document class is part of the Stratum 0 Corporate Identity and can be used to
% typeset general documents.
%
% \section{Package Options}
% This class extends the \textsf{scrartcl} class, and knows every option that \textsf{scrartcl}
% knows. Refer to the \textsf{KOMA-Script} manual for more information.
%
% \StopEventually{\PrintChanges}
%
% \section{Implementation}
% \subsection{Option Parsing}
% Pass default options to \textsf{scrartcl}:
%    \begin{macrocode}
\PassOptionsToClass{a4paper}{scrartcl}
\PassOptionsToClass{11pt}{scrartcl}
\PassOptionsToClass{parskip=half-}{scrartcl}
%    \end{macrocode}
%
% Read all the documentclass options; pass them to \textsf{scrartcl}, unless the file
% |<currentoption>.s0c| exists, then it is loaded.
%    \begin{macrocode}
\DeclareOption*{\InputIfFileExists{\CurrentOption.s0c}{}{%
\PassOptionsToClass{\CurrentOption}{scrartcl}}}
\ProcessOptions \relax
\LoadClass{scrartcl}
%    \end{macrocode}
%
% \subsection{General Helper Packages}
%    \begin{macrocode}
\RequirePackage{xpatch}
\RequirePackage{hyperref}
\hypersetup{unicode=true,colorlinks=false,pdfborder=0 0 0}
\urlstyle{sf}
%    \end{macrocode}
%
% \subsection{Page Layout}
%    \begin{macrocode}
\RequirePackage[left=2.5cm,right=2.5cm,top=2cm,bottom=2.5cm]{geometry}
%    \end{macrocode}
%
% \subsection{Headings and Footers}
% We want to translate the footer:
%    \begin{macrocode}
\RequirePackage{lastpage}
\def\sn@pagenameof@english#1{Page #1 of \pageref{LastPage}}
\let\sn@pagenameof@UKenglish\sn@pagenameof@english
\let\sn@pagenameof@american\sn@pagenameof@english
\let\sn@pagenameof@USenglish\sn@pagenameof@english
\let\sn@pagenameof@british\sn@pagenameof@english
\let\sn@pagenameof@canadian\sn@pagenameof@english
\let\sn@pagenameof@australian\sn@pagenameof@english
\let\sn@pagenameof@newzealand\sn@pagenameof@english
\def\sn@pagenameof@german#1{Seite #1 von \pageref{LastPage}}
\let\sn@pagenameof@ngerman\sn@pagenameof@german
\let\sn@pagenameof@austrian\sn@pagenameof@german
\let\sn@pagenameof@germanb\sn@pagenameof@german
\let\sn@pagenameof@naustrian\sn@pagenameof@german
%    \end{macrocode}
%
% We define english as our default language.
% If \textsf{babel} is loaded with a new language, this gets overwritten.
%    \begin{macrocode}
\ifx\languagename\undefined\def\languagename{english}\fi
%    \end{macrocode}
%
% Now for the real header setup:
%    \begin{macrocode}
\RequirePackage[headsepline]{scrlayer-scrpage}[2013/12/27]
\ihead{\textsc{\@title}}
\chead{}
\ohead{\textsc{\@date}}
\ifoot{}
\cfoot*{\csname sn@pagenameof@\languagename\endcsname\thepage}
\ofoot{}
\pagestyle{scrheadings}
%    \end{macrocode}
%
% \subsection{Optimize Vertical Spacing}
%    \begin{macrocode}
\RedeclareSectionCommand[afterskip=0.5em]{section}
\RedeclareSectionCommand[afterskip=0.1em]{subsubsection}
\RedeclareSectionCommand[beforeskip=.5\parskip, afterskip=-1em]{paragraph}
\setlength{\parindent}{0em}
\RequirePackage{enumitem}
\setlist{nosep}
\RequirePackage{tocloft}
\setlength{\cftbeforesecskip}{0.3\baselineskip}
%    \end{macrocode}
%
% \textsf{tocloft} renders the table of contents header in serif font...
%    \begin{macrocode}
\renewcommand{\cfttoctitlefont}{\usekomafont{section}}
%    \end{macrocode}
%
% \subsection{Default Fonts}
% Yanone Kaffeesatz ZeroHack for titles etc.
%    \begin{macrocode}
\RequirePackage{yanonekaffeesatzzerohack}
\setkomafont{title}{\usefont{LY1}{YanoneKaffeesatzZeroHack}{b}{n}}
\setkomafont{subtitle}{\usefont{LY1}{YanoneKaffeesatzZeroHack}{l}{n}\Large}
\setkomafont{subject}{\normalfont\large}
\setkomafont{author}{\normalfont\large}
\setkomafont{date}{\normalfont\large}
%    \end{macrocode}
%
% Workaround because \textsf{KOMA-Script} has an explicit |\huge\@title| in |\maketitle|\ldots
% (see \url{http://tex.stackexchange.com/a/82851})
%    \begin{macrocode}
\xpatchcmd{\maketitle}{\huge}{\Huge}{}{}
\xpatchcmd{\@maketitle}{\huge}{\Huge}{}{}
\setkomafont{section}{\usefont{LY1}{YanoneKaffeesatzZeroHack}{b}{n}\huge}
\setkomafont{subsection}{\usefont{LY1}{YanoneKaffeesatzZeroHack}{l}{n}\LARGE}
%    \end{macrocode}
%
% \textsf{yanonekaffeesatzzerohack} really needs a \oarg{nodefault} option...
%    \begin{macrocode}
\renewcommand*{\encodingdefault}{T1}
%    \end{macrocode}
%
% Droid for all the rest:
%    \begin{macrocode}
\RequirePackage[default]{droidsans}
\RequirePackage[defaultmono]{droidmono}
%    \end{macrocode}
%
% \Finale
\endinput
% vim: set tw=100 noet sw=2 ts=2 sts=2: