Footnote rule and section style
[lematema] / lematema.cls
1 %%%% Class file for Le Matematiche
2 %%% Author: Giuseppe Bilotta
3 %%% Email (work): bilotta@dmi.unict.it
4 %%% Email (home): giuseppe.bilotta@gmail.com
5
6 \NeedsTeXFormat{LaTeX2e}
7 \ProvidesClass{lematema}[2007/01/01 v0.1
8 Class for articles in ``Le Matematiche'']
9
10 %%% Language options
11 \DeclareOption{english}{\PassOptionsToPackage{\CurrentOption}{babel}}
12 \DeclareOption{french}{\PassOptionsToPackage{\CurrentOption}{babel}}
13 \DeclareOption{italian}{\PassOptionsToPackage{\CurrentOption}{babel}}
14
15 %%% draft/final
16 \DeclareOption{draft}{\PassOptionsToClass{\CurrentOption}{article}}
17 \DeclareOption{final}{\PassOptionsToClass{\CurrentOption}{article}}
18
19 \ProcessOptions\relax
20
21 %%% Class based on the standard article class
22 \LoadClass[10pt,twoside]{article}
23 %%% Package `babel' for language management
24 \RequirePackage[italian]{babel}
25 %%% Package `url' for urls and emails
26 \RequirePackage{url}
27 %% Define an \email{...} command
28 \DeclareUrlCommand\email{\urlstyle{tt}}
29
30 %%% AMS math environments and symbols
31 \RequirePackage{amsmath}
32 \RequirePackage{amssymb}
33
34 % %\magnification\magstephalf
35 %%% Page geometry, using the `geometry' package
36 \RequirePackage[paperwidth=17cm,%
37                 paperheight=24cm,%
38                 footskip=0pt,%
39                 headsep=0.5cm,%
40                 headheight=0.5cm,%
41                 width=12.2cm,%
42                 height=18.5cm,%
43                 left=2cm,%
44                 top=2cm,%
45                 bottom=2.5cm]{geometry}
46
47 %%% Our default head/foot style
48
49 \renewcommand{\ps@plain}{%
50   \renewcommand{\@oddhead}{\hfill\@htitle\hfill\thepage}%
51   \renewcommand{\@evenhead}{\thepage\hfill\@hauthor\hfill}%
52   \renewcommand{\@oddfoot}{}%
53   \renewcommand{\@evenfoot}{}%
54 }
55 \pagestyle{plain}
56
57 % TODO these will be redefined in the article itself
58 \def\@htitle{some title}
59 \def\@hauthor{some author}
60
61 %%% Footnotes
62 \renewcommand\footnoterule{%
63   \hrule\@width.4\columnwidth
64   \kern2.6\p@}
65
66 %%% Section styles
67 \def\thesection{\arabic{section}.}
68 \renewcommand\section{\@startsection {section}{1}{\z@}%
69                                    {-24pt \@plus -6pt \@minus -3pt}%
70                                    {\medskipamount}%
71                                    {\normalfont\bfseries}}
72
73 %%%%% TODO
74 % TODO bibliography
75 % TODO font
76
77
78 %%% Commands that define the article information
79 % TODO \title
80 % TODO \author
81 % TODO \address
82 %% Mathematics Subject Classification
83 \def\MSC#1{\gdef\@MSC{#1}}
84 \def\@MSC{}
85 %% Keywords
86 \def\keywords#1{\gdef\@keywords{#1}}
87 \def\@keywords{}
88
89 %% Year/Volume/Number/First Page/Last Page
90 \edef\LM@Year{????}
91 \def\LM@Vol{???}
92 \def\LM@Num{??}
93 \def\LM@FirstPg{??}
94 \def\LM@LastPg{??}
95
96 %% Redefine \date to parse a string yyyy/mm/dd, which will be used
97 %% as submission date
98 \newcounter{LM@year}
99 \newcounter{LM@month}
100 \newcounter{LM@day}
101 \def\date#1{\LM@parsedate#1\LM@enddate}
102 \def\LM@parsedate#1/#2/#3\LM@enddate{%
103 \setcounter{LM@year}{#1}%
104 \setcounter{LM@month}{#2}%
105 \setcounter{LM@day}{#3}%
106 }
107
108 %% turn a number/counter into an italian month
109 \def\@itmonth#1{\ifcase#1\or gennaio\or febbraio\or marzo\or aprile\or
110 maggio\or giugno\or luglio\or agosto\or settembre\or ottobre\or novembre\or
111 dicembre\else\textbf{??}\fi}
112 \def\itmonth#1{\expandafter\@itmonth\csname c@#1\endcsname}
113
114 \renewcommand{\maketitle}{%
115   \begingroup
116     \renewcommand\thefootnote{}%
117     \def\@makefnmark{}%
118     \long\def\@makefntext##1{\parindent 1em\noindent##1}%
119     \newpage
120     \global\@topnum\z@   % Prevents figures from going at top of page.
121     \@maketitle
122     \thispagestyle{empty}\@thanks
123   \endgroup
124   \setcounter{footnote}{0}%
125   \global\let\thanks\relax
126   \global\let\maketitle\relax
127   \global\let\@maketitle\relax
128   \global\let\@thanks\@empty
129   \global\let\@author\@empty
130   \global\let\@date\@empty
131   \global\let\@title\@empty
132   \global\let\title\relax
133   \global\let\author\relax
134   \global\let\date\relax
135   \global\let\and\relax
136   \global\let\MSC\relax
137   \global\let\@MSC\relax
138   \global\let\keywords\relax
139   \global\let\@keywords\relax
140 }
141
142 %% insert the article information in the top right corner
143 \def\@articleinfo{%
144 \noindent\footnotesize LE MATEMATICHE\\
145 Vol.~\LM@Vol~(\LM@Year)~--~Fasc.~\LM@Num,~pp.~\LM@FirstPg--\LM@LastPg
146 }
147
148 %% Make the title page
149 \def\@maketitle{%
150   \newpage
151   \@articleinfo
152   %% Submission date (at the bottom)
153   \thanks{%
154     \hskip0.8cm Entrato in redazione \arabic{LM@day} \itmonth{LM@month} \arabic{LM@year}\\}%
155   %% MSC, if present
156   \ifx\@MSC\empty\else\thanks{%
157   \textit{Subject Classification:} \@MSC
158   }%
159   %% Keywords, if present
160   \ifx\@keywords\empty\else\thanks{%
161   \textit{Keywords:} \@keywords
162   }%
163   \vskip 4.5truecm%
164   \begin{center}%
165   \let \footnote \thanks
166     {\Large\bfseries \@title \par}%
167     \vskip 0.5truecm%
168     {\Large
169       \begin{tabular}[t]{c}%
170         \@author
171       \end{tabular}\par}%
172   \end{center}%
173   \par
174   \vskip 0.5truecm}
175
176 \renewenvironment{abstract}{%
177 \small\quotation
178 }{%
179 \endquotation
180 }
181
182 % In case the author forgets it:
183 \AtBeginDocument{\maketitle}
184