9 saw 1.1 \NeedsTeXFormat{LaTeX2e}
10 \ProvidesClass{chowto}[2003/03/04 Hall C HOWTO LaTeX class]
11 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
12 \ProcessOptions\relax
13 \LoadClass[12pt,letterpaper]{article}
14 \RequirePackage{hthtml}
15 \RequirePackage{graphicx}
16 \RequirePackage{epsfig}
17
18 \let\originalmaketitle\maketitle
19
20 \renewcommand{\maketitle}{
21
22 \ifx \@experiment \@undefined
23 \relax
24 \else
25 \let\@xoldtitle\@title
26 \renewcommand{\@title}{Experiment: \@experiment\\ \bigskip
27 \@xoldtitle}
28 \fi
29
30 saw 1.1 \let\@oldtitle\@title
31 \renewcommand{\@title}{{\Huge Hall C \@howtotype}\\ \bigskip
32 \@oldtitle}
33 \ifx \@maintainer \@undefined
34 \relax
35 \else
36 \let\@oldauthor\@author
37 \renewcommand{\@author}{\@oldauthor\\ Maintained by \@maintainer}
38 \fi
39
40 \originalmaketitle}
41
42 \def\howtotype#1{
43 \def\user{user}
44 \def\expert{expert}
45 \def\reference{reference}
46 \def\thearg{#1}
47 \ifx\user\thearg\gdef\@howtotype{User Howto}
48 \else\ifx\expert\thearg\gdef\@howtotype{Expert Howto}
49 \else\ifx\reference\thearg\gdef\@howtotype{Reference}
50 \else
51 saw 1.1 \@latex@error{Invalid \noexpand\howtotype given}
52 \fi\fi\fi
53 }
54 \def\@howtotype{\@latex@error{No \noexpand\howtotype given}\@def}
55 \def\howtofilename#1{\gdef\@howtofilename{#1}}
56 \def\@howtofilename{\@latex@error{No \noexpand\howtofilename given}\@def}
57 \def\maintainer#1{\gdef\@maintainer{#1}}
58 \def\experiment#1{\gdef\@experiment{#1}}
59 \def\category#1{\gdef\@category{#1}}
60
61 \newif\if@hascitations
62 \let\if@hascitations\iffalse
63 \let\originalcite\cite
64 \let\originalnocite\nocite
65 \renewcommand{\cite}{
66 \let\if@hascitations\iftrue
67 \originalcite
68 }
69 \renewcommand{\nocite}{
70 \let\if@hascitations\iftrue
71 \originalnocite
72 saw 1.1 }
73
74 \AtBeginDocument{
75 % Don't do \maketitle if latex2html is running to make figures
76 \@ifundefined{tex2html_wrap}
77 {\maketitle}
78 {}
79 }
80
81 \AtEndDocument{
82 \if@hascitations
83 \IfFileExists{chowto-auto.bib}
84 {\def\biblist{chowto,chowto-auto.bib}}
85 {\def\biblist{chowto}}
86 \IfFileExists{\jobname.bib}
87 {\bibliography{\biblist,\jobname}}
88 {\bibliography{\biblist}}
89 \fi
90 }
91
92 \bibliographystyle{chowto}
93 saw 1.1
|