%%% =================================================================== %%% @LaTeX-file{ %%% filename = "commalg.dtx", %%% version = "1.0b", %%% date = "1998/01/30", %%% time = "17:37:42 WST", %%% checksum = "63934 452 1774 18680" %%% author = "Greg Gamble", %%% address = "Department of Mathematics, %%% University of Western Australia, %%% Nedlands, W.A. 6907, %%% Australia", %%% telephone = "+61 8 9380 3340," %%% FAX = "+61 8 9380 1028", %%% copyright = "Copyright (C) 1996 Greg Gamble, %%% all rights reserved. Copying of this file is %%% authorised only if either: %%% (1) you make absolutely no changes to your copy, %%% including name; OR %%% (2) if you do make changes, you first rename it %%% to some other name.", %%% email = "gregg@maths.uwa.edu.au (Internet)", %%% codetable = "ISO/ASCII", %%% keywords = "latex, amslatex, ams-latex, installation", %%% supported = "yes", %%% abstract = "This is class \cls{commalg}. It is built on the %%% standard \latex/ \cls{article} class. %%% It provides a document class for typesetting %%% articles to comply with specifications for %%% the journal Communications in Algebra." %%% docstring = "The checksum field above contains a CRC-16 %%% checksum as the first value, followed by the %%% equivalent of the standard UNIX wc (word %%% count) utility output of lines, words, and %%% characters. This is produced by Robert %%% Solovay's checksum utility.", %%% } %%% =================================================================== % % \iffalse %<*driver> \documentclass{amsdtx} \EnableCrossrefs \CodelineIndex \RecordChanges \begin{document} \title{The \cls{commalg} class} \author{Greg Gamble} \date{Version \fileversion, \filedate} \hDocInput{commalg.dtx} \end{document} % % \fi % % \maketitle % \tableofcontents % \markboth{THE \cls{COMMALG} CLASS}{} % % \changes{v1.0}{96/08/29}{First release} % \changes{v1.0a}{97/02/24}{Provided \opt{draft} option which % prints the word: \emph{Draft}, the % date and page number on each page} % \changes{v1.0a}{97/02/25}{Cleaned up some hacky code that % set the page parameters} % \changes{v1.0a}{97/02/28}{Provided a modified \texttt{headings} % \cn{pagestyle}} % \changes{v1.0b}{98/01/30}{Fixed \cn{thanks}. Previously, no error % was signalled but no footnote text % appeared.} % \changes{v1.0b}{98/01/30}{The \texttt{headings} \cn{pagestyle} % is no longer redefined to be % \texttt{empty} when the \opt{draft} % option is \emph{not} active.} % \changes{v1.0b}{98/01/30}{Corrected the captioning for figures % so that caption begins FIG.} % % \makeatletter % \DoNotIndex{\@addpunct,\@address,\@addtoreset,\@arabic} % \DoNotIndex{\@author,\@biblabel,\@date,\@dblarg,\@empty} % \DoNotIndex{\@fnsymbol,\@gobbletwo,\@latex@warning,\@m} % \DoNotIndex{\@makecaption,\@makefnmark,\@makefntext} % \DoNotIndex{\@maketitle,\@minipagefalse,\@noitemerr,\@nx} % \DoNotIndex{\@openbib@code,\@plus,\@setaddress,\@tempboxa} % \DoNotIndex{\@textsuperscript,\@thefnmark,\@title} % \DoNotIndex{\@topnum,\@xp,\c@enumiv,\c@footnote,\g@addto@macro} % \DoNotIndex{\hb@xt@,\p@,\p@enumiv,\tw@,\z@} % \DoNotIndex{\@draftfalse,\@drafttrue,\@evenfoot,\@evenhead} % \DoNotIndex{\@mkboth,\@oddfoot,\@oddhead,\if@draft} % \DoNotIndex{\ps@draft,\ps@empty,\ps@headings,\reset@font} % \DoNotIndex{\@MM,\@currentlabel,\@footnotetext,\@par} % \DoNotIndex{\@parboxrestore,\@setthanks,\@width,\m@th} % \DoNotIndex{\p@footnote,\ps@firstpage} % \makeatother % % \section{Introduction} % The file \fn{commalg.dtx} is the master file for the \latex/ % class, \cls{commalg}, which provides an article class for % submissions to the journal Communications in Algebra. % It is built on the standard \latex/ \cls{article} class. % A \opt{draft} option is provided that causes the word: % \emph{Draft}, the date and page number to be printed % on each page; by default, this data is printed % in the footline of each page, by using the \texttt{draft} % \cn{pagestyle}, provided by this document class. % Also, when the \opt{draft} option is active, % the \texttt{headings} \cn{pagestyle} is adjusted % to put the word: \emph{Draft} and the date in the footline % of each page and the abbreviated title (of the paper) % and page number in the page header. % The final copy should have no page numbers -- % the author must lightly mark page numbers with a blue % pencil before submission to the journal. % For this reason the default \cn{pagestyle} is \texttt{empty}. % In case users just like the style, but are not planning to % send their articles to the journal Communications in Algebra, % when the \opt{draft} option is \emph{not} active, one can % restore page numbers at the bottom for all but the first page % by using \cn{pagestyle} \texttt{plain}. % % \StopEventually{ % \begin{thebibliography}{9} % \addcontentsline{toc}{section}{\numberline{}Bibliography} % \bibitem{AmSLaTeX} American Mathematical Society, % \emph{\amslatex/ Version 1.2 User's Guide} (Nov.\ 1996). % Filename: \fn{amsldoc.dvi}. % \bibitem{source2e} J.~Braams, D.~Carlisle, A.~Jeffrey, L.~Lamport, % F.~Mittelbach, C.~Rowley, and R.~Sch\"opf, % \emph{The \LaTeXe\ Sources} (Jun.\ 1996). % Filename: \fn{source2e.dvi}. % \bibitem{amsthm} M.~Downes, % \emph{The \pkg{amsthm} package} (Version 1.2a, Feb.\ 1995). % Filename: \fn{amsthm.dvi}. % \bibitem{uwamaths} G.~Gamble, % \emph{The \pkg{uwamaths} package}, % (Version 1.0j, Oct.\ 1996). % Filename: \fn{uwamaths.dvi}. % Describes a general purpose package of macros for the % Mathematics Department of the % University of Western Australia. % \bibitem{Companion} M.~Goossens, F.~Mittelbach, and A.~Samarin, % \emph{The \latex/ Companion} (Addison-Wesley, 1994). % \bibitem{TeX} D.~E.~Knuth, % \emph{The \tex/book} % (Addison-Wesley, 1984). Describes \tex/ in detail. % \bibitem{LaTeX} L.~Lamport, % \emph{\latex/ -- A Document Preparation System} % (Addison-Wesley, first ed., 1985). Describes \latex/ 2.09. % \bibitem{LaTeXe} L.~Lamport, % \emph{\latex/ -- A Document Preparation System} % (Addison-Wesley, second ed., 1994). Updated for \LaTeXe. % \bibitem{clsguide} The \latex/3 Project, % \emph{\LaTeXe\ for class and package writers} (Nov.\ 1996). % Filename: \fn{clsguide.dvi}. % \end{thebibliography} % \addcontentsline{toc}{section}{\numberline{}Index} % \DisableCrossrefs % \PrintIndex % \addcontentsline{toc}{section}{\numberline{}Change History} % \PrintChanges % } % % \section{Implementation} % The usual name, date, and version information. % \begin{macrocode} \typeout{commalg 1.0b} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{commalg}[1998/01/30 v1.0b] % \end{macrocode} % \enlargethispage*{1\baselineskip} % We build the class \cls{commalg} on top of \latex/'s % \cls{article} class. % \begin{macrocode} \newif\if@draft \DeclareOption{draft}{\@drafttrue} \DeclareOption{final}{\@draftfalse} % \end{macrocode} % \pagebreak % \begin{macrocode} \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} \ProcessOptions\relax \LoadClass[a4paper]{article} % \end{macrocode} % The following code is a modified version of the \cls{amsbook} % class macro of the same name. % \begin{macrocode} \def\calclayout{% \oddsidemargin\paperwidth \advance\oddsidemargin -\textwidth \divide\oddsidemargin\tw@ \ifdim\oddsidemargin<.5truein \oddsidemargin.5truein \fi \advance\oddsidemargin -1truein \evensidemargin\oddsidemargin \advance\topmargin -\headheight \advance\topmargin -\headsep \advance\topmargin -1truein\relax% } % \end{macrocode} % Now we set the page parameters. If a user wishes to reset % these, it is recommended that they do so in the following % way and in the following order. In particular, take note % of what parameters are set \emph{before} and \emph{after} % the \cn{calclayout} command. % The journal Communications in Algebra specifies the text % area should be $5.5\,$in by $8.5\,$in. % \begin{macrocode} \normalsize \setlength{\textheight}{8.5in} \setlength{\textwidth}{5.5in} \setlength{\topmargin}{1in} \calclayout \setlength{\marginparsep}{4mm} \setlength{\marginparwidth}{12mm} % \end{macrocode} % We now define the \texttt{draft} \cn{pagestyle} and % redefine the \texttt{headings} \cn{pagestyle} in the % way described in the Introduction. % \begin{macrocode} \def\shortdate{\number\day/\number\month/\number\year} \def\ps@draft{\let\@mkboth\@gobbletwo\let\@oddhead\@empty% \def\@oddfoot{\reset@font\rlap{\textsl{Draft: \shortdate}}% \hfil\thepage\hfil}% \let\@evenhead\@empty\let\@evenfoot\@oddfoot} \def\ps@firstpage{\let\@mkboth\@gobbletwo\let\@oddhead\@empty% \def\@oddfoot{\normalfont\scriptsize} \let\@evenhead\@empty\let\@evenfoot\@oddfoot} \if@draft% \def\ps@headings{% \def\@oddfoot{\reset@font\rlap{\textsl{Draft: \shortdate}}\hfil} \def\@oddhead{{\slshape\MakeUppercase\shorttitle}\hfil\thepage}}% \fi% \if@draft\pagestyle{draft}\else\pagestyle{empty}\fi% % \end{macrocode} % We ensure that the \amslatex/ packages % \pkg{amsmath} \cite{AmSLaTeX}, % \pkg{amsfonts} and \pkg{amsthm} \cite{amsthm} are loaded. % The latter of these provides more developed theorem environments % than standard \latex/. % You get still more if you use % the \pkg{uwamaths} package \cite{uwamaths}. % The \env{proof} environment is redefined to give a % \textbf{bold} header (it's done in the same way as % the \pkg{uwamaths} package \cite{uwamaths}). % \begin{macrocode} \RequirePackage{amsmath}\relax \ifx\relax\mathfrak \@xp\@gobbletwo \else \let\mathfrak\relax \fi \RequirePackage{amsfonts}\relax \RequirePackage{amsthm}\relax \renewenvironment{proof}[1][\proofname]{\par \normalfont \topsep6\p@\@plus6\p@ \trivlist \item[\hskip\labelsep\bfseries #1\@addpunct{.}]\ignorespaces }{% \qed\endtrivlist }% % \end{macrocode} % The following \amslatex/ command tells \latex/ to allow breaks % within maths displays but to avoid them as much as possible. % \begin{macrocode} \allowdisplaybreaks[1] % \end{macrocode} % We redefine \cn{title} to accept an optional shorter % argument as for the \amslatex/ \cls{amsbook} class. This % is only useful for drafts where under the \opt{draft} option % the \cn{pagestyle} might be changed to \texttt{headings} % before submission to the journal. % The \verb+\pagestyle{headings}+ declaration % need not be removed before submission to the journal, since % if the \opt{draft} option is not active the \texttt{headings} % \cn{pagestyle} is redefined to be the same as the \texttt{empty} % \cn{pagestyle}. % \begin{macrocode} \renewcommand{\title}[2][]{\gdef\shorttitle{#1}\gdef\@title{#2}} \edef\title{\@nx\@dblarg \@xp\@nx\csname\string\title\endcsname} % \end{macrocode} % We redefine \cn{author} as per the \cls{amsbook} class to % accept an optional abbreviated argument \dots (this is % \emph{not at all} useful; however the intention in the future % is to support multiple authors -- the real reason for using % a hack of the \cls{amsbook} macro.) % We create also \cn{address} and supporting macros. Again, % at the moment a single author with a single address only % is supported. (The \cn{author} macro can though be used \emph{once} % for a list of authors, if those authors have a \emph{common} % address. % \begin{macrocode} \renewcommand{\author}[2][]{% \ifx\@empty\authors \gdef\shortauthors{#1}\gdef\authors{#2}% \else \g@addto@macro\shortauthors{\and#1}% \g@addto@macro\authors{\and#2}% \fi} \edef\author{\@nx\@dblarg \@xp\@nx\csname\string\author\endcsname} \let\shortauthors\@empty \let\authors\@empty \let\thankses\@empty \def\@setaddress{\def\address##1{\par##1\@addpunct.}\@address} \newcommand{\address}[1]{\let\@address\@empty \g@addto@macro\@address{\address{#1}}} \renewcommand{\thanks}[1]{\g@addto@macro\thankses{\thanks{#1}}} \def\@setthanks{\def\thanks##1{\par##1\@addpunct.}\thankses} % \end{macrocode} % Now we adjust the \cn{maketitle} macro from the \cls{article} % class to be in keeping with the journal specifications. % \begin{macrocode} \renewcommand\maketitle{\par \begingroup \renewcommand\thefootnote{\@fnsymbol\c@footnote}% \let\thanks\footnote \newpage \global\@topnum\z@ % Prevents figures from going at top of page. \@maketitle \if@draft\thispagestyle{draft}\else\thispagestyle{firstpage}\fi% \endgroup \setcounter{footnote}{0}% \global\let\thanks\relax \global\let\thankses\relax \global\let\maketitle\relax \global\let\@maketitle\relax \global\let\@author\@empty \global\let\@address\@empty \global\let\@date\@empty \global\let\@title\@empty \global\let\title\relax \global\let\author\relax \global\let\date\relax \global\let\and\relax } \def\@maketitle{% \newpage \null \vskip 11mm% \begin{center}% \ifx\@empty\thankses\else \@footnotetext{% \def\par{\let\par\@par}\@setthanks}\fi \renewcommand{\baselinestretch}{\normalstretch} {\LARGE\MakeUppercase\@title\par}% \vskip 2\baselineskip% {\normalsize \authors \vskip \baselineskip% {\renewcommand{\baselinestretch}{1}\normalsize% \ifx\@empty\@address\else\@setaddress\\\fi}} \end{center}% \renewcommand{\baselinestretch}{\normalstretch}\normalsize \par \vskip 4\baselineskip} \def\footnoterule{\kern-.4\p@ \hrule\@width 5pc\kern11\p@\kern-\footnotesep} \def\@makefnmark{\hbox{$\m@th^{\@thefnmark}$}} \def\@makefntext{\indent\@makefnmark} \long\def\@footnotetext#1{\insert\footins{% \normalfont\footnotesize \interlinepenalty\interfootnotelinepenalty \splittopskip\footnotesep \splitmaxdepth \dp\strutbox \floatingpenalty\@MM \hsize\columnwidth \@parboxrestore \parindent\parindent \sloppy \edef\@currentlabel{\p@footnote\@thefnmark}% \@makefntext{\rule\z@\footnotesep\ignorespaces#1\unskip\strut\par}}} % \end{macrocode} % We now create the \env{acknowledgements} environment. % \begin{macrocode} \def\ackname{Acknowledgments} \newenvironment{acknowledgements}% {\subsection*{\centering\normalfont\MakeUppercase\ackname}}{} % \end{macrocode} % We adjust the heading for the bibliography to be % centred and capitalised. % \begin{macrocode} \renewenvironment{thebibliography}[1] {\section*{\centering\MakeUppercase\refname}% \list{\@biblabel{\@arabic\c@enumiv}}% {\settowidth\labelwidth{\@biblabel{#1}}% \leftmargin\labelwidth \advance\leftmargin\labelsep \@openbib@code \usecounter{enumiv}% \let\p@enumiv\@empty \renewcommand\theenumiv{\@arabic\c@enumiv}}% \sloppy\clubpenalty4000\widowpenalty4000% \sfcode`\.\@m} {\def\@noitemerr {\@latex@warning{Empty `thebibliography' environment}}% \endlist} % \end{macrocode} % We set the normal interline spacing to be approximately % $1\frac12$-spacing (as required by the journal). % \begin{macrocode} \def\normalstretch{1.24} \renewcommand{\baselinestretch}{\normalstretch}\normalsize % \end{macrocode} % We make available some spacing macros. % The amounts of stretch are those specified % for $12\,$pt by the \emph{\latex/ Companion} \cite{Companion}. % Other font sizes differ from these only marginally. % See the \pkg{uwamaths} package \cite{uwamaths} % where the same macros are defined, for further discussion % of these macros. % \begin{macrocode} \newcommand{\singlespacing}{\renewcommand{\baselinestretch}{1}} \newcommand{\oneandhalfspacing}{\renewcommand{\baselinestretch}{1.24}} \newcommand{\doublespacing}{\renewcommand{\baselinestretch}{1.66}} % \end{macrocode} % The following macro is used in the setting of captions. It is % adjusted to capitalise the word TABLE or FIG. Also, we adjust % \cn{figurename} to be \texttt{Fig.} (the \cls{article} class % ordinarily defines the \cn{figurename} to be unabbreviated), % as dictated by the journal style. % \begin{macrocode} \long\def\@makecaption#1#2{% \vskip\abovecaptionskip \sbox\@tempboxa{#1: #2}% \ifdim \wd\@tempboxa >\hsize \MakeUppercase#1: #2\par \else \global \@minipagefalse \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% \fi \vskip\belowcaptionskip} \figurename{Fig.} % \end{macrocode} % \amslatex/ defines a macro \cn{numberwithin} % which doesn't work as desired in the case where a counter is already % numbered within a sectional unit -- one can end up with duplicate chapter % numbers for a table, for example. Hence we provide a macro % \cn{numberin} which otherwise works in the manner described for % \cn{numberwithin} in \cite{AmSLaTeX}, e.g. % \begin{quote}\slshape % \verb+\numberin{table}{section}+ % \end{quote} % will cause \env{table}s to be numbered within \texttt{section}s. % To get the order of the arguments right, read the above command % this way: \emph{number} \env{table} \emph{in} \texttt{section}. % (You will get strange effects if you get the arguments the wrong way % round.) % \begin{macrocode} \newcommand{\numberin}[2]{% \@addtoreset{#1}{#2}% \@xp\@xp\@xp\renewcommand\@xp{\csname the#1\endcsname}{% \csname the#2\endcsname.\arabic{#1}}} % \end{macrocode} % (For those curious about what \cn{@xp} does: \cn{@xp} is an % \amslatex/ abbreviation for \tex/'s \cn{expandafter}. % The above configuration of \cn{expandafter} commands is described % in \cite[page 374]{TeX}.) % % \begin{macrocode} \endinput % \end{macrocode} % \CheckSum{515} % \Finale