\titlenote
[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 %%% Font: times (and math stuff)
24 \usepackage{mathptmx}
25 %%% Package `babel' for language management
26 \RequirePackage[italian]{babel}
27 %%% Package `url' for urls and emails
28 \RequirePackage{url}
29 %% Define an \email{...} command
30 \DeclareUrlCommand\email{\urlstyle{tt}}
31
32 %%% AMS math environments and symbols
33 \RequirePackage{amsmath}
34 \RequirePackage{amssymb}
35 \RequirePackage{amsthm}
36
37 % %\magnification\magstephalf
38 %%% Page geometry, using the `geometry' package
39 \RequirePackage[paperwidth=17cm,%
40                 paperheight=24cm,%
41                 footskip=0pt,%
42                 headsep=0.5cm,%
43                 headheight=0.5cm,%
44                 width=12.2cm,%
45                 height=18.5cm,%
46                 left=2cm,%
47                 top=2cm,%
48                 bottom=2.5cm]{geometry}
49
50 %%% Our default head/foot style
51
52 \renewcommand{\ps@plain}{%
53   \renewcommand{\@oddhead}{\hfill\@htitle\hfill\thepage}%
54   \renewcommand{\@evenhead}{\thepage\hfill\@hauthor\hfill}%
55   \renewcommand{\@oddfoot}{}%
56   \renewcommand{\@evenfoot}{}%
57 }
58 \pagestyle{plain}
59
60 % TODO these will be redefined in the article itself
61 \def\@htitle{some title}
62 \def\@hauthor{some author}
63
64 %%% Footnotes
65 \renewcommand\footnoterule{%
66   \hrule\@width.4\columnwidth
67   \kern2.6\p@}
68
69 %%% Section styles
70 \def\@seccntformat#1{\csname the#1\endcsname.\quad}
71 \renewcommand\section{\@startsection {section}{1}{\z@}%
72                                    {-24pt \@plus -6pt \@minus -3pt}%
73                                    {\medskipamount}%
74                                    {\normalfont\bfseries}}
75
76 %%% Theorem environments
77 \addto\captionsitalian{%
78   \def\theoremname{Teorema}%
79   \def\corollaryname{Corollario}%
80   \def\lemmaname{Lemma}%
81   \def\propositionname{Proposizione}%
82   \def\definitionname{Definizione}%
83   \def\examplename{Esempio}%
84   \def\remarkname{Osservazione}%
85   \def\notename{Nota}%
86 }
87 \addto\captionsenglish{%
88   \def\theoremname{Theorem}%
89   \def\corollaryname{Corollary}%
90   \def\lemmaname{Lemma}%
91   \def\propositionname{Proposition}%
92   \def\definitionname{Definition}%
93   \def\examplename{Example}%
94   \def\remarkname{Remark}%
95   \def\notename{Note}%
96 }
97 \addto\captionsfrench{%
98   \def\theoremname{Th\'eor\`eme}%
99   \def\corollaryname{Corollaire}%
100   \def\lemmaname{Lemma}%
101   \def\propositionname{Proposition}%
102   \def\definitionname{D\'efinition}%
103   \def\examplename{Exemple}%
104   \def\remarkname{Remarque}%
105   \def\notename{Note}%
106 }
107
108 \theoremstyle{plain}
109 \newtheorem{thm}{\theoremname}[section]
110 \newtheorem{cor}{\corollaryname}[section]
111 \newtheorem{lemma}{\lemmaname}[section]
112 \newtheorem{prop}{\propositionname}[section]
113
114 \theoremstyle{definition}
115 \newtheorem{dfn}{\definitionname}[section]
116 \newtheorem{exa}{\examplename}[section]
117 \newtheorem{rem}{\remarkname}[section]
118 \newtheorem{note}{\notename}[section]
119
120 %%%%% TODO
121 % TODO bibliography
122
123
124 %%% Commands that define the article information
125 % TODO \title
126 \def\titlenote#1{\expandafter\@titlenote\expandafter{\the\@titlenote\thanks{#1}}}
127 \newtoks\@titlenote
128 % TODO \author
129 % TODO \address
130 %% Mathematics Subject Classification
131 \def\MSC#1{\gdef\@MSC{#1}}
132 \def\@MSC{}
133 %% Keywords
134 \def\keywords#1{\gdef\@keywords{#1}}
135 \def\@keywords{}
136
137 %% Year/Volume/Number/First Page/Last Page
138 \edef\LM@Year{????}
139 \def\LM@Vol{???}
140 \def\LM@Num{??}
141 \def\LM@FirstPg{??}
142 \def\LM@LastPg{??}
143
144 %% Redefine \date to parse a string yyyy/mm/dd, which will be used
145 %% as submission date
146 \newcounter{LM@year}
147 \newcounter{LM@month}
148 \newcounter{LM@day}
149 \def\date#1{\LM@parsedate#1\LM@enddate}
150 \def\LM@parsedate#1/#2/#3\LM@enddate{%
151 \setcounter{LM@year}{#1}%
152 \setcounter{LM@month}{#2}%
153 \setcounter{LM@day}{#3}%
154 }
155
156 %% turn a number/counter into an italian month
157 \def\@itmonth#1{\ifcase#1\or gennaio\or febbraio\or marzo\or aprile\or
158 maggio\or giugno\or luglio\or agosto\or settembre\or ottobre\or novembre\or
159 dicembre\else\textbf{??}\fi}
160 \def\itmonth#1{\expandafter\@itmonth\csname c@#1\endcsname}
161
162 \renewcommand{\maketitle}{%
163   \begingroup
164     \renewcommand\thefootnote{}%
165     \def\@makefnmark{}%
166     \long\def\@makefntext##1{\parindent 1em\noindent##1}%
167     \newpage
168     \global\@topnum\z@   % Prevents figures from going at top of page.
169     \@maketitle
170     \thispagestyle{empty}\@thanks
171   \endgroup
172   \setcounter{footnote}{0}%
173   \global\let\thanks\relax
174   \global\let\maketitle\relax
175   \global\let\@maketitle\relax
176   \global\let\@thanks\@empty
177   \global\let\@author\@empty
178   \global\let\@date\@empty
179   \global\let\@title\@empty
180   \global\let\title\relax
181   \global\let\author\relax
182   \global\let\date\relax
183   \global\let\and\relax
184   \global\let\MSC\relax
185   \global\let\@MSC\relax
186   \global\let\keywords\relax
187   \global\let\@keywords\relax
188   \global\let\titlenote\relax
189   \global\let\@titlenote\relax
190 }
191
192 %% insert the article information in the top right corner
193 \def\@articleinfo{%
194 \noindent\footnotesize LE MATEMATICHE\\
195 Vol.~\LM@Vol~(\LM@Year)~--~Fasc.~\LM@Num,~pp.~\LM@FirstPg--\LM@LastPg
196 }
197
198 %% Make the title page
199 \def\@maketitle{%
200   \newpage
201   \@articleinfo
202   %% Submission date (at the bottom)
203   \thanks{%
204     \hskip0.8cm Entrato in redazione \arabic{LM@day} \itmonth{LM@month} \arabic{LM@year}\\}%
205   %% MSC, if present
206   \ifx\@MSC\empty\else\thanks{%
207   \textit{Subject Classification:} \@MSC
208   }\fi%
209   %% Keywords, if present
210   \ifx\@keywords\empty\else\thanks{%
211   \textit{Keywords:} \@keywords
212   }\fi%
213   \vskip 4.5truecm%
214   \begin{center}%
215   \let \footnote \thanks
216     {\Large\bfseries \@title 
217     %% Title note, if present
218     \the\@titlenote
219     \par}%
220     \vskip 0.5truecm%
221     {\Large
222       \begin{tabular}[t]{c}%
223         \@author
224       \end{tabular}\par}%
225   \end{center}%
226   \par
227   \vskip 0.5truecm}
228
229 \renewenvironment{abstract}{%
230 \small\quotation
231 }{%
232 \endquotation
233 }
234
235 % In case the author forgets it:
236 \AtBeginDocument{\maketitle}
237