Headings and abstract, plus corrections
[lematema] / lematema.cls
1 % Class file for Le Matematiche
2 \NeedsTeXFormat{LaTeX2e}
3 \ProvidesClass{lematema}[2007/01/01 v0.1
4 Class for articles in ``Le Matematiche'']
5
6 \DeclareOption{english}{\PassOptionsToPackage{\CurrentOption}{babel}}
7 \DeclareOption{french}{\PassOptionsToPackage{\CurrentOption}{babel}}
8 \DeclareOption{italian}{\PassOptionsToPackage{\CurrentOption}{babel}}
9
10 \DeclareOption{draft}{\PassOptionsToClass{\CurrentOption}{article}}
11
12 \ProcessOptions\relax
13
14 \LoadClass[10pt,twoside]{article}
15 \RequirePackage[italian]{babel}
16 \RequirePackage{url}
17 \RequirePackage{amsmath}
18 \RequirePackage{amssymb}
19
20 \DeclareUrlCommand\email{\urlstyle{tt}}
21
22 % %\magnification\magstephalf
23 \RequirePackage[paperwidth=17cm,%
24                 paperheight=24cm,%
25                 footskip=0pt,%
26                 headsep=0.5cm,%
27                 headheight=0.5cm,%
28                 width=12.2cm,%
29                 height=18.5cm,%
30                 left=2cm,%
31                 top=2cm,%
32                 bottom=2.5cm]{geometry}
33
34 \renewcommand{\ps@plain}{%
35   \renewcommand{\@oddhead}{\hfill\@htitle\hfill\thepage}%
36   \renewcommand{\@evenhead}{\thepage\hfill\@hauthor\hfill}%
37   \renewcommand{\@oddfoot}{}%
38   \renewcommand{\@evenfoot}{}%
39 }
40 \pagestyle{plain}
41
42 % TODO bibliografia
43 % TODO font
44
45 % TODO
46 \def\@htitle{titolo}
47 \def\@hauthor{autore}
48
49 \def\MSC#1{\gdef\@MSC{#1}}
50 \def\@MSC{}
51 \def\keywords#1{\gdef\@keywords{#1}}
52 \def\@keywords{}
53
54 \edef\LM@Year{????}
55 \def\LM@Vol{???}
56 \def\LM@Num{??}
57 \def\LM@FirstPg{??}
58 \def\LM@LastPg{??}
59
60 %% Redefine \date to parse a string yyyy/mm/dd, which will be used
61 %% submission date
62 \newcount\LM@year
63 \newcount\LM@month
64 \newcount\LM@day
65 \def\date#1{\LM@parsedate#1\LM@enddate}
66 \def\LM@parsedate#1/#2/#3\LM@enddate{%
67 \LM@year#1\relax
68 \LM@month#2\relax
69 \LM@day#3\relax
70 }
71
72 \def\@articleinfo{%
73 \noindent\footnotesize LE MATEMATICHE\\
74 Vol.~\LM@Vol~(\LM@Year)~--~Fasc.~\LM@Num,~pp.~\LM@FirstPg--\LM@LastPg
75 }
76 \renewcommand{\maketitle}{%
77   \begingroup
78     \renewcommand\thefootnote{}%
79     \def\@makefnmark{}%
80     \long\def\@makefntext##1{\parindent 1em\noindent##1}%
81     \newpage
82     \global\@topnum\z@   % Prevents figures from going at top of page.
83     \@maketitle
84     \thispagestyle{empty}\@thanks
85   \endgroup
86   \setcounter{footnote}{0}%
87   \global\let\thanks\relax
88   \global\let\maketitle\relax
89   \global\let\@maketitle\relax
90   \global\let\@thanks\@empty
91   \global\let\@author\@empty
92   \global\let\@date\@empty
93   \global\let\@title\@empty
94   \global\let\title\relax
95   \global\let\author\relax
96   \global\let\date\relax
97   \global\let\and\relax
98   \global\let\MSC\relax
99   \global\let\@MSC\relax
100   \global\let\keywords\relax
101   \global\let\@keywords\relax
102 }
103
104 \def\@maketitle{%
105   \newpage
106   \@articleinfo
107   \vskip 4.5truecm%
108   \begin{center}%
109   \let \footnote \thanks
110     {\Large\bfseries \@title \par}%
111     \vskip 0.5truecm%
112     {\Large
113       \begin{tabular}[t]{c}%
114         \@author
115       \end{tabular}\par}%
116   \end{center}%
117   \par
118   \vskip 0.5truecm}
119
120 \renewenvironment{abstract}{%
121 \small\quotation
122 }{%
123 \endquotation
124 }
125
126 % In case the author forgets it:
127 \AtBeginDocument{\maketitle}
128