-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathansarticle.cls
152 lines (137 loc) · 4.38 KB
/
ansarticle.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
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
% FIXME: (AL) Need to choose a license for this style, I suggest GFDL
% Basic setup
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{ansarticle}
\LoadClass[twoside,a4paper]{article}
% Load packages
\RequirePackage{a4wide}
\RequirePackage{anslistings}
\RequirePackage{algorithm,algorithmicx,algpseudocode}
\RequirePackage{amsmath,amssymb}
\RequirePackage[noblocks]{authblk}
\RequirePackage{booktabs}
\RequirePackage{fancyhdr}
\RequirePackage{graphicx}
\RequirePackage[hyperfootnotes=false,colorlinks,linkcolor=blue,urlcolor=blue,citecolor=blue]{hyperref}
\RequirePackage{natbib}
\RequirePackage{lastpage}
\RequirePackage{listings}
\RequirePackage[colorinlistoftodos,textwidth=4cm,shadow]{todonotes}
% Font selection
\RequirePackage[T1]{fontenc}
\RequirePackage{ae,aecompl}
\RequirePackage{pxfonts} % Palatino for running text and math
\renewcommand{\sfdefault}{pag} % Avantgarde for sans serif (section headings)
% Section headings
\renewcommand{\section}{%
\@startsection{section}{0}{0pt}{2ex}{1ex}{\large\bf\sffamily}}
\renewcommand{\subsection}{%
\@startsection{subsection}{1}{0pt}{\baselineskip}{.5ex}{\bf\sffamily}}
\renewcommand{\subsubsection}{%
\@startsection{subsubsection}{2}{0pt}{\baselineskip}{-1em}{\bf\sffamily}}
\renewcommand{\paragraph}{%
\@startsection{paragraph}{3}{0pt}{0ex}{-0.5em}{\bf\sffamily}}
\renewcommand{\subparagraph}{%
\@startsection{subparagraph}{4}{0pt}{0ex}{-0.5em}{\bf\sffamily}}
\setcounter{secnumdepth}{10}
% Paragraphs
\setlength{\parindent}{0pt}
\setlength{\parskip}{1ex plus 2ex}
% Running title and author
\let\@runningtitle\@empty
\let\@runningauthor\@empty
\newcommand{\runningtitle}[1]{\gdef\@runningtitle{#1}}
\newcommand{\runningauthor}[1]{\gdef\@runningauthor{#1}}
% PDF file headers
% \hypersetup{
% pdftitle = {\@title},
% pdfauthor = {\@author}
% }
% Formatting volume and article number
\newread\datafile
\openin\datafile=ansinfo
\ifeof\datafile
\message{File ansinfo.tex with volume, number, and year is missing}
\def\ANSreceived{never}
\def\ANSrevised{never}
\def\ANSaccepted{never}
\def\ANSpublished{never}
\def\ANSvolume{VV}
\def\ANSnumber{NN}
\def\ANSyear{1677}
\def\ANSDOI{DOI}
\else
\closein\datafile
\input{ansinfo}
\fi
% Page headers and footers
\fancyhead[RO, LE]{\thepage}
\fancyhead[LO]{\@runningtitle}
\fancyhead[RE]{\@runningauthor}
\fancyfoot[RE,LO]{%
\footnotesize \copyright{} by the authors, \ANSyear}
\fancyfoot[RO,LE]{%
\footnotesize Archive of Numerical Software \ANSvolume(\ANSnumber), \ANSyear}
\fancyfoot[C]{}
\renewcommand{\headrulewidth}{0pt}
\pagestyle{fancy}
% Front matter
\renewcommand*{\title}[2][]{\gdef\s@title{#1}\gdef\@title{#2}}
\renewcommand{\Authfont}{\large\sffamily}
\renewcommand{\Affilfont}{\normalsize\sffamily}
\renewcommand{\maketitle}{{
% Footnote stuff
\let\footnotesize\small
\def\footnoterule{\vspace*{-3pt}\rule{.4\columnwidth}{.4pt}\vspace*{2.6pt}}
\renewcommand\thefootnote{\sffamily\@fnsymbol\c@footnote}
\let\footnote\thanks
% Title
\hfill\fboxrule2pt\fboxsep3mm\fbox{\parbox{7cm}{\centering
Archive of Numerical Software\\
vol. \ANSvolume, no. \ANSnumber, \ANSyear, pages \thepage--\pageref*{LastPage}\\
DOI: \ANSDOI}}
\vskip 60\p@
\begin{center}
{\LARGE \textsf{\textbf{\@title}} \par}
\vskip 8mm
{\large \lineskip .75em \textsf{\@author} }
\vskip 4mm
\end{center}\par
% Affiliation stuff
\@thanks
% Paper received
\vskip 3mm
\textbf{\sffamily Received: }\ANSreceived;
\textbf{\sffamily final revision:} \ANSrevised;
\textbf{\sffamily published:} \ANSpublished.
% Some more fixes
\vskip 3mm
\setcounter{footnote}{0}%
\global\let\thanks\relax
\global\let\maketitle\relax
\global\let\@thanks\@empty
\global\let\@author\@empty
\global\let\@date\@empty
\global\let\@title\@empty
\global\let\title\relax
\global\let\author\relax
\global\let\date\relax
\global\let\and\relax
% No headers/footers on front page
\thispagestyle{empty}
}}
% Abstract heading
\renewenvironment{abstract}{\textsf{\textbf{Abstract: }}}{}
% Useful macro
\newcommand{\fixme}[1]{\todo[inline, color=red!40]{#1}}
% Some useful notation macros
\newcommand{\R}{\mathbb{R}}
\newcommand{\dx}{\,\mathrm{d}x}
\newcommand{\dX}{\,\mathrm{d}X}
\newcommand{\ds}{\,\mathrm{d}s}
\newcommand{\dS}{\,\mathrm{d}S}
\newcommand{\dt}{\,\mathrm{d}t}
\newcommand{\inner}[2]{\langle #1, #2 \rangle}
\newcommand{\nedelec}{N\'ed\'elec}
\newcommand{\babuska}{Babu\v{s}ka}
\newcommand{\emp}[1]{\texttt{#1}}