1 \NeedsTeXFormat{LaTeX2e}[2009/07/27]
\r
2 \ProvidesClass{comjnl}
\r
3 [2009/07/27 v0.1c The Computer Journal class (DPC)]
\r
4 \def\CJ@err#1{\ClassError{cj}{#1}\@eha}
\r
5 \def\CJ@warn#1{\ClassWarningNoLine{cj}{#1}}
\r
6 \DeclareOption{10pt}{}
\r
7 \DeclareOption{11pt}{\CJ@warn{10pt used (not optional)}}
\r
8 \DeclareOption{12pt}{\CJ@warn{10pt used (not optional)}}
\r
9 \DeclareOption{twoside}{}
\r
10 \DeclareOption{twocolumn}{}
\r
11 \DeclareOption{onecolumn}{\CJ@warn{twocolumn used (not optional)}}
\r
12 \DeclareOption{mathptm}{%
\r
13 \def\CJ@fonts{\RequirePackage{times,mathptm}}}
\r
14 \DeclareOption{mathtime}{%
\r
15 \def\CJ@fonts{\RequirePackage{times,mathtime}}} %use for Mac
\r
16 % \def\CJ@fonts{\RequirePackage{times,mathtimy}}} %use for PC
\r
17 \DeclareOption{cmfonts}{%
\r
18 \let\CJ@fonts\relax}
\r
19 \DeclareOption{epsfig}{\AtEndOfClass{\RequirePackage{epsfig}}}
\r
20 \ExecuteOptions{cmfonts,epsfig}
\r
22 \LoadClass[a4paper,twoside,twocolumn]{article}
\r
29 \emergencystretch=5pt
\r
32 \RequirePackage{rotating}
\r
35 \def\shortauthors#1{\gdef\@shortauthors{\scshape#1}}
\r
36 \def\title{\@dblarg\CJ@title}
\r
37 \def\CJ@title[#1]#2{%
\r
39 \def\@shorttitle{\scshape#1}}
\r
40 \def\@title{\CJ@warn{No title}}
\r
43 \newcounter{remaffil}
\r
45 \g@addto@macro\@authors{%
\r
46 \@andorcomma,{\ignorespaces#1\unskip\affil@mark}}%
\r
47 \def\CJ@noaffil{\CJ@warn{No affiliation specified for #1}}}
\r
49 \CJ@err{No author specified}%
\r
50 \global\let\@andorcomma\relax
\r
52 \def\@authors{\relax\@gobbletwo}
\r
53 \def\and{\CJ@err{\protect\and\space is not supported}}
\r
54 \def\@andorcomma#1#2\@andorcomma#3{%
\r
59 \def\@tempa{\space\andname\space #2\@gobbletwo}%
\r
62 \def\@tempa{#1 #2\@andorcomma#3}%
\r
65 \def\affiliation#1{%
\r
70 \stepcounter{affil}\setcounter{remaffil}{\theaffil}%
\r
72 \noexpand\g@addto@macro\noexpand\@affils{%
\r
73 \noexpand\doaffil{\theaffil}{##1}}}%
\r
75 \edef\@tempa{\noexpand\CJ@addaffil{\theaffil}}%
\r
77 \expandafter\@tempa\@authors\relax\relax
\r
78 \let\CJ@noaffil\relax}
\r
80 \def\CJ@addaffil#1#2\relax#3\relax{%
\r
81 \def\@authors{#2\def\theaffil{#1}#3\relax}}
\r
86 \def\@tempa{\CJ@addaffil{#1}}%
\r
89 \g@addto@macro\@authors{\textsuperscript{$*$}}%
\r
92 \CJ@err{You may only specify one correspondence address}}}
\r
93 \def\@address{\CJ@warn{No correspondence address specified}}
\r
96 %%SDH David's \email puts email addresses at the bottom of the page--wrong!
\r
98 % \g@addto@macro\@address{\endgraf\noindent(e-mail: #1)}%
\r
100 % \CJ@err{You may only specify one correspondence email}}}
\r
102 \def\@email{Email: #1}%
\r
105 \let\affil@mark\@empty
\r
108 \addvspace\medskipamount
\r
109 \noindent\strut{\itshape Keywords:\/} \ignorespaces#1\unskip}}
\r
110 \def\@keywords{\ClassWarningNoLine{cj}{No keywords}}
\r
112 \gdef\@received{\medskip\noindent\strut{\itshape Received #1}}}
\r
113 \def\@received{\ClassWarningNoLine{cj}{No received date}}
\r
115 \gdef\@revised{{\itshape; revised #1}}} %SDH
\r
116 \let\@revised\@empty
\r
118 \gdef\@accepted{{\itshape; accepted #1}}}
\r
119 \def\@accepted{\CJ@warn{No accepted date}}
\r
121 \def\abstract{\lrbox\absbox\minipage{.75\textwidth}%
\r
124 \normalfont\bfseries\small
\r
127 \parfillskip\stretch2}
\r
128 \def\endabstract{\endminipage\endlrbox}
\r
130 \long\def\@makefntext##1{\parindent 1em\noindent
\r
131 \@textsuperscript{\normalfont\@thefnmark}##1}%
\r
133 \thispagestyle{title}\label{FirstPage}%
\r
134 \normalfont\centering
\r
135 \vspace{-\headheight}\vspace{-\voffset}\vspace{-12\p@}%
\r
136 {\parbox[b]{.75\textwidth}{\centering
\r
137 {\Huge\@title\par}%
\r
139 \ifnum\c@affil>\@ne
\r
140 \def\affil@mark{\textsuperscript{\theaffil}}%
\r
141 \def\doaffil##1##2{\noindent\textsuperscript{##1}##2\par}%
\r
143 \def\doaffil##1##2{\noindent##2\par}%
\r
145 \setcounter{affil}{1}%
\r
147 \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
\r
148 \global\c@footnote\@ne
\r
149 \ifnum\theremaffil>1 \typeout{caffil>1}
\r
150 \setcounter{footnote}{\theremaffil}
\r
151 \else \typeout{caffil not> 1}
\r
152 \setcounter{footnote}{0}\fi
\r
153 \def\@makefnmark{\@textsuperscript{\normalfont\@thefnmark}}%
\r
154 {\large\scshape\@authors\@andorcomma\relax\@andorcomma\relax\par}%
\r
155 \addvspace{15pt}% 75mm - 15.5pc - 12pt baseline from affils
\r
156 {\small\itshape\@affils}\par %%SDH affils made italic--should really be addresses
\r
157 {\small\itshape\@email}\par %%SDH Emails moved to correct place
\r
158 \addvspace\bigskipamount
\r
160 \addvspace\bigskipamount
\r
163 \@received\@revised\@accepted\par
\r
164 \addvspace\bigskipamount
\r
169 %{\def\thefootnote{\@fnsymbol\c@footnote}%
\r
170 % \footnotetext[1]{\def\\{\unskip, \ignorespaces}\@address}%
\r
172 \suppressfloats[t]}%
\r
174 \let\affiliation\relax
\r
177 \let\keywords\relax
\r
178 \let\@keywords\relax
\r
181 \let\@address\relax
\r
182 \let\maketitle\relax
\r
183 \let\thanks\@gobble}
\r
191 \vbox to \headheight{\vss
\r
192 \let\textsuperscript\@gobble
\r
195 % {\@authors\@andorcomma\relax\@andorcomma\relax}%
\r
199 \CJ@ruledhead\relax{%
\r
200 \textsc\journalname,\quad\volumename\space\@volumenumber,\quad
\r
201 \numbername\space\@issuenumber,\quad\@volumeyear}\relax}%
\r
202 \let\@evenfoot\@oddfoot}
\r
205 \vbox to \headheight{%
\r
207 \hrule \@height.5pt\@width\textwidth
\r
209 \let\@evenhead\@oddhead
\r
211 \CJ@ruledhead\relax{%
\r
212 \textsc\journalname,\quad\volumename\space\@volumenumber,\quad
\r
213 \numbername\space\@issuenumber,\quad\@volumeyear}\relax}%
\r
214 \let\@evenfoot\@oddfoot}
\r
215 \def\CJ@ruledhead#1#2#3{%
\r
217 \hrule \@height.5pt%
\r
218 \hbox to\textwidth{%
\r
219 \normalfont\vrule\@width\z@\@height 9.5pt\@depth 4.5pt%
\r
223 \hrule\@height.5pt}}
\r
225 \def\@volumeyear{????}
\r
226 \def\@volumenumber{??}
\r
227 \def\@issuenumber{??}
\r
228 \def\@startpage{\pageref{FirstPage}}
\r
229 \def\@endpage{\pageref{LastPage}}
\r
230 \def\volumeyear#1{\gdef\@volumeyear{#1}}
\r
231 \def\volumenumber#1{\gdef\@volumenumber{#1}}
\r
232 \def\issuenumber#1{\gdef\@issuenumber{#1}}
\r
233 \def\startpage#1{\gdef\@startpage{#1}\c@page#1}
\r
234 \def\endpage#1{\gdef\@endpage{#1}}
\r
235 \def\lastpage@putlabel{%
\r
236 \advance\c@page\m@ne
\r
237 \immediate\write\@auxout{\string
\r
238 \newlabel{LastPage}{{}{\thepage}}}%
\r
239 \advance\c@page\@ne}
\r
241 \clearpage\lastpage@putlabel}%
\r
242 \def\enumerate{\ifnum \@enumdepth >3 \@toodeep\else
\r
243 \advance\@enumdepth \@ne
\r
244 \edef\@enumctr{enum\romannumeral\the\@enumdepth}\list
\r
245 {\csname label\@enumctr\endcsname}{\usecounter
\r
246 {\@enumctr}\def\makelabel##1{##1\hss}%
\r
247 \labelsep=3\p@\parsep=0pt\listparindent=0pt\itemsep=0pt\partopsep=0pt
\r
248 \rightmargin=0pt}\fi}
\r
250 \def\itemize{\ifnum \@itemdepth >3 \@toodeep\else \advance\@itemdepth \@ne
\r
251 \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
\r
252 \list{\csname\@itemitem\endcsname}{\def\makelabel##1{##1\hss}%
\r
253 \labelsep=3\p@\parsep=0pt\listparindent=0pt\itemsep=0pt\partopsep=0pt
\r
254 \rightmargin=0pt}\fi}
\r
256 \setlength\parskip{0pt plus 0.1pt}
\r
257 \setlength\parindent{1em}
\r
258 \setlength\topsep{8pt plus 2pt minus 4pt}
\r
259 \setlength\partopsep{0pt plus 2pt}
\r
260 \setlength\itemsep{0pt plus 1pt}
\r
261 \def\@seccntformat#1{\csname the#1\endcsname.\quad}
\r
264 {section}{1}{\z@}{-14\p@ \@plus -2\p@ \@minus -2\p@}%
\r
265 {6\p@ plus 2\p@}{\normalfont\normalsize\bfseries\MakeUppercase}}
\r
268 {subsection}{2}{\z@}{-14\p@ \@plus -2\p@ \@minus -2\p@}%
\r
269 {6\p@ plus 2\p@}{\normalfont\normalsize\bfseries}}
\r
270 \def\subsubsection{%
\r
272 {subsubsection}{3}{\z@}{-14\p@ \@plus -2\p@ \@minus-2\p@}%
\r
273 {1sp}{\normalfont\normalsize\itshape}}
\r
276 {paragraph}{4}{\z@}{12\p@}%
\r
277 {-1em}{\normalfont\normalsize\itshape}}
\r
278 \def\subparagraph{%
\r
280 {paragraph}{5}{\z@}{12\p@}%
\r
281 {-1em}{\normalfont\normalsize\itshape}}
\r
282 \setcounter{secnumdepth}{3}
\r
283 \setcounter{tocdepth}{2}
\r
284 \def\fps@eqnfloat{!tp}
\r
285 \def\ftype@eqnfloat{4}
\r
286 \newenvironment{eqnfloat}
\r
287 {\@float{eqnfloat}}
\r
289 \newenvironment{eqnfloat*}
\r
290 {\@dblfloat{eqnfloat}}
\r
292 \renewenvironment{table}
\r
293 {\@float{table}\small\ignorespaces}
\r
295 \renewenvironment{table*}
\r
296 {\@dblfloat{table}\small\ignorespaces}
\r
298 \long\def\@makecaption#1#2{%
\r
299 \vskip\abovecaptionskip
\r
300 \sbox\@tempboxa{{\bfseries\small#1.} \small#2}%
\r
301 \ifdim \wd\@tempboxa >\hsize
\r
302 {\bfseries\small#1.} \small#2\par
\r
304 \global \@minipagefalse
\r
305 \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
\r
307 \vskip\belowcaptionskip}
\r
308 \def\fnum@figure{\MakeUppercase\figurename~\thefigure}
\r
309 \def\fnum@table{\MakeUppercase\tablename~\thetable}
\r
311 \RequirePackage{amsthm}
\r
312 \newtheoremstyle{theor}
\r
313 {6pt}% above space (default)
\r
321 \theoremstyle{theor}
\r
323 \newtheorem{definition}{Definition}[section]
\r
324 \def\thedefinition{\thesection.\arabic{definition}}
\r
325 \newtheorem{lemma}{Lemma}[section]
\r
326 \def\thelemma{\thesection.\arabic{lemma}}
\r
327 \newtheorem{proposition}{Proposition}[section]
\r
328 \def\theproposition{\thesection.\arabic{proposition}}
\r
329 \newtheorem{corollary}{Corollary}[section]
\r
330 \def\thecorollary{\thesection.\arabic{corollary}}
\r
331 \newtheorem{axiom}{Axiom}[section]
\r
332 \def\theaxiom{\thesection.\arabic{axiom}}
\r
334 \newtheoremstyle{remark}
\r
335 {6pt}% above space (default)
\r
337 {\normalfont}% body
\r
343 \theoremstyle{remark}
\r
345 \newtheorem{remark}{Remark}
\r
346 \newtheorem{example}{Example}
\r
347 \newtheorem{algorithm}{Algorithm}
\r
349 {\theoremstyle{theor}
\r
350 \newtheorem{theorem}{Theorem}[section]
\r
351 \def\thetheorem{\thesection.\arabic{theorem}}
\r
354 \setlength\voffset{-1in}
\r
355 \setlength\hoffset{-1in}
\r
356 \setlength\paperheight{276mm}
\r
357 \setlength\paperwidth{210mm}
\r
358 \setlength\headsep{4mm}
\r
359 \setlength\topskip\baselineskip
\r
360 \setlength\marginparsep{1mm}
\r
361 \setlength\marginparwidth{5mm}
\r
362 \setlength\headheight{26mm}
\r
363 \setlength\topmargin{0mm}
\r
364 \setlength{\footskip}{10mm}
\r
365 \setlength\@tempdima{276mm}
\r
366 \addtolength\@tempdima{-\headheight}
\r
367 \addtolength\@tempdima{-\headsep}
\r
368 \divide\@tempdima\baselineskip
\r
369 \@tempcnta=\@tempdima
\r
370 \setlength\textheight{\@tempcnta\baselineskip}
\r
371 \setlength\columnsep{2pc}
\r
372 \setlength\textwidth{42pc}
\r
373 \setlength\oddsidemargin\paperwidth
\r
374 \addtolength\oddsidemargin{-\textwidth}
\r
375 \setlength\oddsidemargin{.5\oddsidemargin}
\r
376 \setlength\evensidemargin\oddsidemargin
\r
379 \providecommand{\textsuperscript}[1]{%
\r
380 \ensuremath{{}^{\mbox{\normalfont\scriptsize#1}}}}
\r
381 \providecommand{\@textsuperscript}[1]{%
\r
382 \ensuremath{{}^{\mbox{\normalfont\scriptsize#1}}}}
\r
383 \providecommand\MakeUppercase[1]{%
\r
384 \protected@edef\@tempa{\uppercase{#1}}\@tempa}
\r
385 \def\@sect#1#2#3#4#5#6[#7]#8{%
\r
386 \ifnum #2>\c@secnumdepth
\r
389 \refstepcounter{#1}%
\r
390 \protected@edef\@svsec{\@seccntformat{#1}\relax}%
\r
392 \@tempskipa #5\relax
\r
393 \ifdim \@tempskipa>\z@
\r
396 \@hangfrom{\hskip #3\relax\@svsec}%
\r
397 \interlinepenalty \@M #8\@@par}%
\r
399 \csname #1mark\endcsname{#7}%
\r
400 \addcontentsline{toc}{#1}{%
\r
401 \ifnum #2>\c@secnumdepth \else
\r
402 \protect\numberline{\csname the#1\endcsname}%
\r
409 \csname #1mark\endcsname{#7}%
\r
410 \addcontentsline{toc}{#1}{%
\r
411 \ifnum #2>\c@secnumdepth \else
\r
412 \protect\numberline{\csname the#1\endcsname}%
\r
417 \def\@ssect#1#2#3#4#5{%
\r
418 \@tempskipa #3\relax
\r
419 \ifdim \@tempskipa>\z@
\r
422 \@hangfrom{\hskip #1}%
\r
423 \interlinepenalty \@M #5\@@par}%
\r
426 \def\@svsechd{#4{\hskip #1\relax #5}}%
\r
429 \def\journalname{The Computer Journal}
\r
430 \def\copyrightname{Oxford University Press}
\r
433 \def\numbername{No.\@}
\r
434 \def\volumename{Vol.\@}
\r
438 % Inserts space after macro unless followed by punctuation.
\r
440 \ifx\@let@token\bgroup\else%
\r
441 \ifx\@let@token\egroup\else%
\r
442 \ifx\@let@token\/\else%
\r
443 \ifx\@let@token\ \else%
\r
444 \ifx\@let@token~\else%
\r
445 \ifx\@let@token.\else%
\r
446 \ifx\@let@token!\else%
\r
447 \ifx\@let@token,\else%
\r
448 \ifx\@let@token:\else%
\r
449 \ifx\@let@token;\else%
\r
450 \ifx\@let@token?\else%
\r
451 \ifx\@let@token'\else%
\r
452 \ifx\@let@token)\else%
\r
453 \ifx\@let@token-\else%
\r
454 \ifx\@let@token$\else%
\r
455 \ifx\@let@token/\else%
\r
457 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
\r
458 \newcommand{\xspace}{\futurelet\@let@token\@xspace}
\r
460 % Omit extra full stop after et al. if at end of sentence
\r
465 \def\etstop{\futurelet\@let@token\@etstop}
\r
466 \def\etal{{\it et al}\etstop}
\r
468 \DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
\r
469 \DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
\r
470 \DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
\r
471 \DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
\r
472 \DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
\r
473 \DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
\r
474 \DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
\r
475 \DeclareRobustCommand*\cal{\@fontswitch\relax\mathcal}
\r
476 \DeclareRobustCommand*\mit{\@fontswitch\relax\mathnormal}
\r
477 \DeclareMathAlphabet\mathbit
\r
478 \encodingdefault\rmdefault\bfdefault\itdefault
\r
479 \DeclareOldFontCommand{\bi}{\normalfont\bfseries\itshape}{\mathbit}
\r
482 \def\appendix{\@@par
\r
483 \@addtoreset{table}{section}
\r
484 \@addtoreset{figure}{section}
\r
485 \@addtoreset{equation}{section}
\r
486 \setcounter{section}{0}
\r
487 \setcounter{subsection}{0}
\r
488 \setcounter{subsubsection}{0}
\r
489 \setcounter{equation}{0}
\r
490 \setcounter{figure}{0}
\r
491 \setcounter{table}{0}
\r
492 \def\thesection{Appendix~\Alph{section}}
\r
493 \def\thelemma{\Alph{section}.\arabic{lemma}}
\r
494 \def\thedefinition{\Alph{section}.\arabic{definition}}
\r
495 \def\thetheorem{\Alph{section}.\arabic{theorem}}
\r
496 \def\theproposition{\Alph{section}.\arabic{proposition}}
\r
497 \def\thecorollary{\Alph{section}.\arabic{corollary}}
\r
498 \def\theaxiom{\Alph{section}.\arabic{axiom}}
\r
500 \Alph{section}.\arabic{equation}}
\r
502 \Alph{section}.\arabic{table}}
\r
504 \Alph{section}.\arabic{figure}}
\r
507 \newcommand{\centre}[2]{\multispan{#1}{\hfill #2\hfill}}
\r
508 \newcommand{\crule}[1]{\multispan{#1}{\hrulefill}}
\r
510 \def\lo#1{\llap{${}#1{}$}}
\r
512 \def\tabnote#1{\par\rlap{\begin{minipage}[l]{\hsize}
\r
516 \def\lineup{\def\0{\hbox{\phantom{\small\rm 0}}}%
\r
517 \def\m{\hbox{$\phantom{-}$}}%
\r
518 \def\-{\llap{$-$}}}
\r
520 \newcommand{\ms}{\noalign{\vspace{3\p@ plus2\p@ minus1\p@}}}
\r
521 \newcommand{\ns}{\noalign{\vspace{-3\p@ plus-1\p@ minus-1\p@}}}
\r
523 %%%%%%%%%%%%%%%%%%%%%
\r
525 %%%%%%%%%%%%%%%%%%%%%
\r
527 \newcommand{\boldarrayrulewidth}{1\p@}
\r
528 % Width of bold rule in tabular environment.
\r
530 \def\bhline{\noalign{\ifnum0=`}\fi\hrule \@height
\r
531 \boldarrayrulewidth \futurelet \@tempa\@xhline}
\r
533 \def\@xhline{\ifx\@tempa\hline\vskip \doublerulesep\fi
\r
537 % Rules for tables with extra space around
\r
539 \newcommand{\br}{\ms\bhline\ms}
\r
540 \newcommand{\mr}{\ms\hline\ms}
\r
542 \newcommand{\case}[2]{{\textstyle\frac{#1}{#2}}}
\r
544 \newcommand{\ack}{\section*{Acknowledgements}}
\r
545 \newcommand{\ackn}{\section*{Acknowledgement}}
\r
547 % need to be explicit with `References' for \uppercase'ing
\r
548 \def\thebibliography#1{\section*{References}\small\list
\r
549 {[\arabic{enumi}]}{\labelsep 0.5em%
\r
550 \hyphenpenalty=50\itemsep=-1pt
\r
551 \settowidth\labelwidth{[#1]}\leftmargin\labelwidth
\r
552 \advance\leftmargin\labelsep
\r
553 \usecounter{enumi}}
\r
554 \def\newblock{\hskip .14em plus .38em minus -.1em}
\r
556 \sfcode`\.=1000\relax}
\r
557 \let\endthebibliography=\endlist
\r
559 \def\@cite#1#2{[{#1\if@tempswa , #2\fi}]}
\r
560 \def\@biblabel#1{[#1]}
\r
562 \let\origthebibliography\thebibliography
\r
563 \def\thebibliography#1{\origthebibliography{\hbox to 1em{\hss}}}
\r
566 \renewcommand{\floatpagefraction}{0.95}
\r
567 \renewcommand{\dblfloatpagefraction}{0.95}
\r
568 \renewcommand{\topfraction}{0.95}
\r
569 \renewcommand{\dbltopfraction}{0.95}
\r
570 %\renewcommand{\topnumber}{3}
\r
571 %\renewcommand{\dbltopnumber}{3}
\r
574 %% End of file `cj.cls'.
\r