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