numapde-preprint.cls 3.55 KB
Newer Older
1
\PassOptionsToPackage{fit}{truncate}
2
\ProvidesClass{numapde_preprint}[2019/09/05]
Roland Herzog's avatar
Roland Herzog committed
3 4 5
% Part of this work has been inspired by the jnsao.cls file
% from http://jnsao.episciences.org
% TODO licence
6

Roland Herzog's avatar
Roland Herzog committed
7
% TODO redesign title page
8
% TODO twoside option currently dysfunctional
9

Roland Herzog's avatar
Roland Herzog committed
10 11 12 13 14
% Declare the options for the class
% Turn on line numbering
\DeclareOption{lineno}{\AtBeginDocument{\linenumbers}}

% Pass all non-implemented options to the base class scrartcl
15
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrartcl}}
Roland Herzog's avatar
Roland Herzog committed
16 17

% Process all options
18 19 20
\ProcessOptions\relax

% Load bass class scrartcl
21
\LoadClass[a4paper,DIV=12,oneside,parskip=full]{scrartcl}
Roland Herzog's avatar
Roland Herzog committed
22

23
% Resolve the dependencies of this package
24 25
\RequirePackage{numapde-semantic}

Roland Herzog's avatar
Roland Herzog committed
26 27
% Enable line numbering (off by default)
\RequirePackage{lineno}
28

29
% Configure fonts
30 31 32
\IfFileExists{libertine.sty}{\RequirePackage[proportional]{libertine}}{}
\IfFileExists{newtxmath.sty}{\RequirePackage[libertine,liby]{newtxmath}\useosf}{}
\IfFileExists{inconsolata.sty}{\RequirePackage[scaled=0.95,varqu,varl]{inconsolata}}{}
33 34
\RequirePackage{microtype}

35 36 37
% Resolve the dependencies of this package
\RequirePackage{numapde-style}

Roland Herzog's avatar
Roland Herzog committed
38 39
% Set up basic information
\let\numapde@shortauthor\empty
40
\let\numapde@shorttitle\empty
Roland Herzog's avatar
Roland Herzog committed
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
\let\numapde@acknowledgments\empty
\let\numapde@license\empty
\def\numapde@copyright{{\copyright} the authors}
\def\numapde@documenttype{Manuscript}

% Define commands to manipulate basic information
\newcommand{\shortauthor}[1]{\gdef\numapde@shortauthor{#1}}
\newcommand{\shorttitle}[1]{\gdef\numapde@shorttitle{#1}}
\newcommand{\acknowledgements}[1]{\gdef\numapde@acknowledgments{#1}}
\newcommand{\acknowledgments}[1]{\gdef\numapde@acknowledgments{#1}}
\newcommand{\manuscriptlicense}[1]{\gdef\numapde@license{#1}}
\newcommand{\manuscriptcopyright}[1]{\gdef\numapde@copyright{#1}}

% Set up the appearance of author, date, title, and section headings etc.
\renewcommand*{\sectfont}{\color{TolMutedBlue}\sffamily}
\setkomafont{author}{\large\normalfont\sffamily}
\setkomafont{date}{\large\normalfont\sffamily}
\setkomafont{title}{\color{TolMutedBlue}\normalfont\sffamily\scshape}
\addtokomafont{section}{\scshape}
\addtokomafont{subsection}{\scshape}
\addtokomafont{subsubsection}{\scshape\itshape}

63 64 65 66
% Remove \@date and spacing following it from \@maketitle
% https://tex.stackexchange.com/questions/288800/omit-the-date-in-maketitle-without-blanking-the-date
\patchcmd{\@maketitle}{{\usekomafont{date}{\@date \par}}\vskip \z@ \@plus 1em}{}{}{}

Roland Herzog's avatar
Roland Herzog committed
67 68 69 70 71 72
% Set up the page header and footer
\addtokomafont{pageheadfoot}{\normalfont\sffamily\footnotesize}
\RequirePackage{scrdate}
\date{\ISOToday}
\RequirePackage{lastpage}
\RequirePackage{scrlayer-scrpage}
73
\RequirePackage{truncate}
Roland Herzog's avatar
Roland Herzog committed
74
\if@twoside
75
	\rohead[]{\truncate{1.0\textwidth}{\ifx\numapde@shorttitle\empty{}\else{\numapde@shorttitle}\fi}}
76
	\lehead[]{\truncate{1.0\textwidth}{\numapde@shortauthor}}
77 78
	\refoot[]{\ISOToday}
	\ofoot[]{page~\thepage~of~\pageref*{LastPage}}
Roland Herzog's avatar
Roland Herzog committed
79
\else
80
	\ohead[]{\truncate{0.45\textwidth}{\ifx\numapde@shorttitle\empty{}\else{\numapde@shorttitle}\fi}}
81
	\ihead[]{\truncate{0.45\textwidth}{\numapde@shortauthor}}
82
	\ofoot*{page~\thepage~of~\pageref*{LastPage}}
83
	\ifoot*{\ISOToday}
Roland Herzog's avatar
Roland Herzog committed
84 85 86 87 88 89 90
\fi
\cfoot*{}
\pagestyle{scrheadings}
\KOMAoptions{headsepline=true}
\KOMAoptions{footsepline=true}
\KOMAoptions{plainfootsepline=true}

91 92 93 94 95
% Define keywords environment (following etna.cls)
\newenvironment{@abs}[1]{\vspace{4pt}\footnotesize  \parindent 15pt {\bfseries #1. }\ignorespaces}{\par\vspace{7pt}}
\newenvironment{keywords}{\begin{@abs}{Keywords}}{\end{@abs}}
\newenvironment{AMS}{\begin{@abs}{AMS subject classifications (MSC2010)}}{\end{@abs}}