1 %%%% Class file for Le Matematiche
2 %%% Author: Giuseppe Bilotta
3 %%% Email (work): bilotta@dmi.unict.it
4 %%% Email (home): giuseppe.bilotta@gmail.com
6 \NeedsTeXFormat{LaTeX2e}
7 \ProvidesClass{lematema}[2008/03/05 v0.8b
8 Class for articles in ``Le Matematiche'']
13 \DeclareOption{english}{\PassOptionsToPackage{\CurrentOption}{babel}\@langseltrue}
14 \DeclareOption{french}{\PassOptionsToPackage{\CurrentOption}{babel}\@langseltrue}
15 \DeclareOption{italian}{\PassOptionsToPackage{\CurrentOption}{babel}\@langseltrue}
18 \DeclareOption{draft}{\PassOptionsToClass{\CurrentOption}{article}}
19 \DeclareOption{final}{\PassOptionsToClass{\CurrentOption}{article}}
24 \ClassWarning{lematema}{No language specified, defaulting to english}
25 \PassOptionsToPackage{english}{babel}
28 %%% Class based on the standard article class
29 \LoadClass[11pt,twoside]{article}
30 %%% Font: times (and math stuff)
32 %%% Package `babel' for language management
33 \RequirePackage{babel}
34 %%% Package `url' for urls
36 %%% Define an \email{...} command, but let's not use the url package for this
37 \newcommand{\email}[1]{{e-mail: \upshape\ttfamily#1}}
39 %%% AMS math environments and symbols
40 \RequirePackage{amsmath}
41 \RequirePackage{amssymb}
42 \RequirePackage{amsthm}
45 \RequirePackage[square,numbers,sort&compress,sectionbib]{natbib}
46 \bibliographystyle{lematema}
47 \def\bibhere{\bibliography{\jobname}}
48 \addto\captionsitalian{%
49 \def\refname{Bibliografia}%
50 \def\bibname{Bibliografia}%
52 \addto\captionsenglish{%
53 \def\refname{References}%
54 \def\bibname{References}%
56 \addto\captionsfrench{%
57 \def\refname{Bibliographie}%
58 \def\bibname{Bibliographie}%
60 % from the needspace package
61 \newcommand{\needspace}[1]{\begingroup\setlength{\dimen@}{#1}%
62 \vskip\z@\@plus\dimen@ \penalty -100\vskip\z@\@plus -\dimen@
63 \vskip\dimen@ \penalty 9999\vskip -\dimen@\endgroup}
69 \centering{\MakeUppercase{\refname}}%
73 \setlength{\bibsep}{3pt}
75 % %\magnification\magstephalf
76 %%% Page geometry, using the `geometry' package
77 \RequirePackage[paperwidth=17cm,%
83 %height=18.5cm,% overspecification, comment out
86 bottom=2.5cm]{geometry}
88 %%% Our default head/foot style
90 \renewcommand{\ps@plain}{%
91 \renewcommand{\@oddhead}{\hfill{\footnotesize\@htitle}\hfill\thepage}%
92 \renewcommand{\@evenhead}{\thepage\hfill{\footnotesize\@hauthor}\hfill}%
93 \renewcommand{\@oddfoot}{}%
94 \renewcommand{\@evenfoot}{}%
98 \def\@htitle{\textbf{(no title)}}
99 \def\@hauthor{\textbf{(no author)}}
102 \renewcommand\footnoterule{%
103 \hrule\@width.4\columnwidth
107 \def\@seccntformat#1{\csname the#1\endcsname.\quad}
108 \renewcommand\section{\@startsection {section}{1}{\z@}%
109 {-24pt \@plus -6pt \@minus -3pt}%
111 {\normalfont\bfseries}}
113 %%% Theorem environments
114 \addto\captionsitalian{%
115 \def\theoremname{Teorema}%
116 \def\corollaryname{Corollario}%
117 \def\lemmaname{Lemma}%
118 \def\propositionname{Proposizione}%
119 \def\definitionname{Definizione}%
120 \def\examplename{Esempio}%
121 \def\remarkname{Osservazione}%
124 \addto\captionsenglish{%
125 \def\theoremname{Theorem}%
126 \def\corollaryname{Corollary}%
127 \def\lemmaname{Lemma}%
128 \def\propositionname{Proposition}%
129 \def\definitionname{Definition}%
130 \def\examplename{Example}%
131 \def\remarkname{Remark}%
134 \addto\captionsfrench{%
135 \def\theoremname{Th\'eor\`eme}%
136 \def\corollaryname{Corollaire}%
137 \def\lemmaname{Lemma}%
138 \def\propositionname{Proposition}%
139 \def\definitionname{D\'efinition}%
140 \def\examplename{Exemple}%
141 \def\remarkname{Remarque}%
146 \newtheorem{thm}{\theoremname}[section]
147 \newtheorem{cor}[thm]{\corollaryname}
148 \newtheorem{lemma}[thm]{\lemmaname}
149 \newtheorem{prop}[thm]{\propositionname}
151 \theoremstyle{definition}
152 \newtheorem{dfn}[thm]{\definitionname}
153 \newtheorem{exa}[thm]{\examplename}
154 \newtheorem{rem}[thm]{\remarkname}
155 \newtheorem{note}[thm]{\notename}
157 %%% Commands that define the article information
158 \let\originaltitlecmd\title
159 \def\title#1{\originaltitlecmd{#1}\titlemark{#1}}
160 \def\titlemark#1{\gdef\@htitle{\MakeUppercase{#1}}}
161 \def\titlenote#1{\expandafter\@titlenote\expandafter{\the\@titlenote\thanks{#1}}}
164 \def\makeshortauthor#1#2 #3\relax{
166 \expandafter\@shortauthortoks\expandafter{\the\@shortauthortoks{} - #1. #3}%
168 \@shortauthortoks{#1. #3}%
169 \@shortauthortokstrue
171 \def\@shortauthor{\the\@shortauthortoks}%
173 \newtoks\@shortauthortoks
174 \newif\if@shortauthortoks\@shortauthortoksfalse
176 \def\authormark#1{\gdef\@hauthor{\MakeUppercase{#1}}}
179 \expandafter\@authortoks\expandafter{\the\@authortoks{} - #1}%
184 \makeshortauthor#1\relax%
185 \authormark{\the\@authortoks}%
186 \def\@author{\the\@authortoks}%
190 \newif\if@authortoks\@authortoksfalse
193 \def\shortauthormark{\authormark{\the\@shortauthortoks}}
196 \expandafter\expandafter\expandafter\@addresstoks\expandafter\expandafter\expandafter{%
197 \expandafter\the\expandafter\@addresstoks\expandafter\par
199 \expandafter\MakeUppercase\expandafter{\the\@lastauthor}\\
202 \newtoks\@addresstoks
203 \def\@address{\par\bigskip\begin{flushright}%
207 \AtEndDocument{\@address}
209 %% Mathematics Subject Classification
210 \def\MSC#1{\gdef\@MSC{#1}}
213 \def\keywords#1{\gdef\@keywords{#1}}
216 %% Year/Volume/Number/First Page/Last Page
223 %% Redefine \date to parse a string yyyy/mm/dd, which will be used
224 %% as submission date
226 \newcounter{LM@month}
228 \def\date#1{\LM@parsedate#1\LM@enddate}
229 \def\LM@parsedate#1/#2/#3\LM@enddate{%
230 \setcounter{LM@year}{#1}%
231 \setcounter{LM@month}{#2}%
232 \setcounter{LM@day}{#3}%
235 %% turn a number/counter into an italian month
236 \def\@itmonth#1{\ifcase#1\or gennaio\or febbraio\or marzo\or aprile\or
237 maggio\or giugno\or luglio\or agosto\or settembre\or ottobre\or novembre\or
238 dicembre\else\textbf{??}\fi}
239 \def\itmonth#1{\expandafter\@itmonth\csname c@#1\endcsname}
241 \renewcommand{\maketitle}{%
243 \renewcommand\thefootnote{}%
245 \long\def\@makefntext##1{\parindent 1em\noindent##1}%
247 \global\@topnum\z@ % Prevents figures from going at top of page.
249 \thispagestyle{empty}\@thanks
251 \setcounter{footnote}{0}%
252 \global\let\thanks\relax
253 \global\let\maketitle\relax
254 \global\let\@maketitle\relax
255 \global\let\@thanks\@empty
256 \global\let\@author\@empty
257 \global\let\@shortauthor\@empty
258 \global\let\@date\@empty
259 \global\let\@title\@empty
260 \global\let\title\relax
261 \global\let\author\relax
262 \global\let\date\relax
263 \global\let\and\relax
264 \global\let\MSC\relax
265 \global\let\@MSC\relax
266 \global\let\keywords\relax
267 \global\let\@keywords\relax
268 \global\let\titlenote\relax
269 \global\let\@titlenote\relax
272 %% insert the article information in the top right corner
274 \noindent\footnotesize LE MATEMATICHE\\
275 Vol.~\LM@Vol~(\LM@Year)~--~Fasc.~\LM@Num,~pp.~\LM@FirstPg--\LM@LastPg
278 \newif\ifsubmissiondate
281 \newif\ifshortauthors\shortauthorsfalse
282 %% Make the title page
286 %% Submission date (at the bottom)
289 \hskip0.8cm Entrato in redazione \arabic{LM@day} \itmonth{LM@month} \arabic{LM@year}\smallskip}%
292 \ifx\@MSC\empty\else\thanks{%
293 \textit{AMS 2000 Subject Classification:} \@MSC
295 %% Keywords, if present
296 \ifx\@keywords\empty\else\thanks{%
297 \textit{Keywords:} \@keywords
301 \let \footnote \thanks
302 {\def\\{\protect\linebreak}%
303 \fontsize{12}{15}\selectfont\bfseries \MakeUppercase{\@title}
304 %% Title note, if present
308 {\fontsize{11.5}{14}\selectfont
309 \begin{tabular}[t]{c}%
310 \expandafter\MakeUppercase\expandafter{\ifshortauthors\@shortauthor\else\@author\fi}
317 \renewenvironment{abstract}{%
323 % In case the author forgets it:
324 \AtBeginDocument{\maketitle}
326 \expandafter\IfFileExists\expandafter{\jobname.pub}{%
327 \InputIfFileExists{\jobname.pub}{\typeout{Volume data loaded}}\relax%
328 \c@page=\LM@FirstPg\relax
331 \protected@write\@auxout{}%
332 {\string\xdef\string\LM@LastPg{\thepage}}%