Newer
Older
%%% Partnership for Advanced Computing in Europe
%%% www.prace-ri.eu
%%%
%%%
%%% (c) CSC - IT Center for Science Ltd.
%%% author: Martti Louhivuori (martti.louhivuori@csc.fi)
%%% (c) JSC/PRACE
%%% author: Dirk Broemmel (prace-pmo@fz-juelich.de)
%%%
%%% Requires: LaTeX2e
%%% geometry, graphicx, ifthen, booktabs
%%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{prace}[2022/05/18 PRACE Whitepaper class]
\DeclareOption{onecolumn}{\OptionNotUsed}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions\relax
% default font-size for main body text of the current template is 10pt
\LoadClass[a4paper,10pt]{article}
% A4: 210x297mm - 25mm margins top, left, right, 20mm on bottom
\geometry{a4paper, total={165mm,247mm},
left=25mm, top=25mm, right=25mm, bottom=20mm,
footskip=8mm
}
\RequirePackage{siunitx}
\RequirePackage{graphicx}
\RequirePackage{ifthen}
\RequirePackage{booktabs}
\RequirePackage{iftex}
% select a font close to Times New Roman (this will depend on the TeX interpreter, more to come)
\ifpdftex
\RequirePackage{mathptmx}
\fi
\ifxetex
\RequirePackage{fontspec}
\setmainfont{FreeSerif} % this looks a lot like mathptmx, though metric not fully compatible
%\setmainfont{Liberation Serif} % this looks less like mathptmx, but has metric compatibility
\fi
\ifluatex
\RequirePackage{fontspec}
\setmainfont{FreeSerif}
\fi
% try and make sure \maketitle works when using UTF-8 characters and pdflatex/lualatex
\ifpdftex
\RequirePackage[T1]{fontenc}
\fi
\ifluatex
\RequirePackage[utf8]{luainputenc}
\fi
% spacing between paragraphs and indents
\RequirePackage{parskip}
% default values
\def\authoremail{author@example.com}
\def\refdoi{}
% date on bottom right, page number in the middle, DOI on the left
\RequirePackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[L,C,R]{}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[C]{\thepage}
\fancyfoot[R]{\@date}
% DOI as obtained from Zenodo or alike (PMO will reserve one first, then add here)
\newcommand{\doi}[1]{\renewcommand\refdoi{#1}}
% internal counters
\newcounter{praceauth}
\setcounter{praceauth}{0}
\renewcommand\thepraceauth{\alph{praceauth}}
\newcounter{praceaffi}
\setcounter{praceaffi}{0}
\renewcommand\thepraceaffi{\alph{praceaffi}}
\newcounter{pracetmp}
\setcounter{pracetmp}{0}
\renewcommand\thepracetmp{\alph{pracetmp}}
\newcommand{\email}[1]{\renewcommand\authoremail{#1}}
% tag corresponding author
\newif\if@iscorresponding
\@iscorrespondingfalse
\newif\if@hascorresponding
\@hascorrespondingfalse
\newcommand\corresponding[0]{\@iscorrespondingtrue\@hascorrespondingtrue}
% corresponding author footnote
\long\def\authorfootnote{%
\def\thefootnote{\fnsymbol{footnote}}%
\csname c@\@mpfn\endcsname 1\relax%
\@footnotetext}
% corresponding author contact detail footnote
\def\authorcontact{%
\authorfootnote{Corresponding author, %
e-mail: \authoremail{}}
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
}
% tmp flag
\newif\if@praceflag
\@praceflagfalse
% convert integers to letters
\def\csvitoalist{}
\newcommand\csvitoa[1]{
\def\csvitoalist{}
\@for\name:=#1\do{
\setcounter{pracetmp}{\name}
\if@praceflag
\edef\csvitoalist{\csvitoalist,\thepracetmp}
\else
\edef\csvitoalist{\thepracetmp}
\@praceflagtrue
\fi}
\@praceflagfalse
\csvitoalist
}
% store author definitions for later use
\def\authorlist{}
\def\tmpname{}
\renewcommand\author[2][a]{%
%
\def\alfalist{}
\@for\name:=#1\do{
\setcounter{pracetmp}{\name}
\if@praceflag
\edef\alfalist{\alfalist,\thepracetmp}
\else
\edef\alfalist{\thepracetmp}
\@praceflagtrue
\fi}
\@praceflagfalse
%
% \def\alfalist{\csvitoa{#1}}
%
\def\tmpname{#2}
\if@iscorresponding
\edef\tmpname{\tmpname{}${}^{\alfalist{},*}$}
\else
\edef\tmpname{\tmpname{}${}^{\alfalist}$}
\fi
\ifnum \c@praceauth >\z@
\edef\authorlist{\authorlist{}, \tmpname{}}
\else
\edef\authorlist{\tmpname{}}
\fi
\@iscorrespondingfalse
\addtocounter{praceauth}{1}
}
% store affiliation definitions for later use
\def\affiliationlist{}
\newcommand\affiliation[2][a]{%
\addtocounter{praceaffi}{1}
\def\tmpname{{${}^{\thepraceaffi}$#2}}
\ifnum \c@praceaffi >\@ne
\edef\affiliationlist{\affiliationlist{},\tmpname{}}
\else
\edef\affiliationlist{\tmpname{}}
\fi%
}
% output affiliation list
\newcommand\affiliationblock[0]{%
\@for\name:=\affiliationlist\do{\name\\}}
% title block
\renewcommand{\maketitle}{%
\newpage
\noindent\begin{minipage}{3cm}
\includegraphics[width=3cm]{prace-logo}
\end{minipage}
\centering%
Available on-line at www.prace-ri.eu\\\vspace{1em}
{\large\bfseries Partnership for Advanced Computing in Europe}
\end{minipage}
\begin{minipage}{3cm}
\end{minipage}\\
\null
\vskip 2em%
\begin{center}%
\let \footnote \thanks
{\LARGE \@title \par}%
\vskip 1.5em%
{\large
\lineskip .5em%
\vskip 1em%
\affiliationblock
\if@hascorresponding
\authorcontact
\else
\@latex@warning{Corresponding author is undefined}
\fi
\end{center}%
\par
\vskip 1.5em%
}
% section heading formats
\def\section{\@startsection {section}{1}{\z@}%
{-3.0ex \@plus -.8ex \@minus -.2ex}% beforeskip, corresponding to 18pt in total
{3.3ex \@plus.7ex}% afterskip, corresponding to 18pt in total
\def\subsection{\@startsection{subsection}{2}{\z@}%
{-3.0ex \@plus -.8ex \@minus -.2ex}% beforeskip, corresponding to 18pt in total
{2.0ex \@plus.67ex}% afterskip, corresponding to 12pt in total
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}%
{-1.67ex \@plus -.8ex \@minus -.2ex}% beforeskip, corresponding to 12pt in total
{2.0ex \@plus.67ex}% afterskip, corresponding to 12pt in total
\RequirePackage{secdot}
\sectiondot{subsection}
\sectiondot{subsubsection}
%\def\thesection {\arabic{section}}
%\def\thesubsection {\thesection.\arabic{subsection}}
%\def\thesubsubsection {\thesubsection\arabic{subsection}.}
\def\figurename {Figure}
\def\tablename {Table}
\renewenvironment{abstract}%
{\noindent\rule{\textwidth}{0.1pt}
\small
\noindent{\bfseries \abstractname}
\quotation}%
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
\noindent\rule{\textwidth}{0.1pt}}
% no indentation for quotations
\renewenvironment{quotation}%
{\list{}{%
\listparindent 0.0em
\itemindent \listparindent
\rightmargin \leftmargin
\parsep \z@ \@plus\p@}%
\item\relax}
{\endlist}
% add space either after table caption or before figure caption
\newif\if@withintable
\@withintablefalse
\newif\if@withinfigure
\@withinfigurefalse
\renewenvironment{figure}
{\@withinfiguretrue\@float{figure}}
{\end@float\@withinfigurefalse}
\renewenvironment{figure*}
{\@withinfiguretrue\@dblfloat{figure}}
{\end@dblfloat\@withinfigurefalse}
\renewenvironment{table}
{\@withintabletrue\@float{table}}
{\end@float\@withintablefalse}
\renewenvironment{table*}
{\@withintabletrue\@dblfloat{table}}
{\end@dblfloat\@withintablefalse}
\setlength\abovecaptionskip{10\p@}
\setlength\belowcaptionskip{10\p@}
\long\def\@makecaption#1#2{%
\if@withinfigure
\vskip\abovecaptionskip
\fi
{\small #1. #2\par}
\if@withintable
\vskip\belowcaptionskip
\fi}
% ref.number in References
% and changed formatting of heading
\renewenvironment{thebibliography}[1]
{\subsection*{\refname}% <- changed to match style of subsection
\@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}%
\list{\@biblabel{\@arabic\c@enumiv}}%
{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\@openbib@code
\usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand\theenumiv{\@arabic\c@enumiv}}%
\sloppy
\clubpenalty4000
\@clubpenalty \clubpenalty
\widowpenalty4000%
\sfcode`\.\@m}
{\def\@noitemerr
{\@latex@warning{Empty `thebibliography' environment}}%
\endlist}