% \iffalse meta-comment balanced on line 108
% ltxfront.dtx: package to change page grid, MVL.
% Copyright (c) 2009 Arthur Ogawa
%
% Disclaimer
% This file is distributed WITHOUT ANY WARRANTY;
% without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
% License
% You may distribute this file under the conditions of the
% LaTeX Project Public License 1.3c or later
% (http://www.latex-project.org/lppl.txt).
% ReadMe
% For the documentation and more detailed instructions for
% installation, typeset this document with \LaTeX.
% Maintenance Status
% This work has the LPPL maintenance status "maintained";
% Current Maintainer of this work is Arthur Ogawa.
%
% This work consists of the main source file ltxfront.dtx
% and the derived files
% ltxfront.sty, ltxfront.pdf
% Distribution:
% CTAN:macros/latex/contrib/revtex/
%
% Unpacking:
% tex ltxfront.dtx
%
% Documentation:
% latex ltxfront.dtx; ...
%
% Programm calls to get the documentation (example):
% pdflatex ltxfront.dtx
% makeindex -s gind.ist ltxfront.idx
% makeindex -s gglo.ist -o ltxfront.gls ltxfront.glo
% pdflatex ltxfront.dtx
% makeindex -s gind.ist ltxfront.idx
% pdflatex ltxfront.dtx
%
% Installation:
% TDS:doc/latex/revtex/
% TDS:source/latex/revtex/
% TDS:tex/latex/revtex/
%
% Thanks, Heiko!
% This method of letting a single .dtx file serve as both
% documentation (via latex) and installer (via tex) follows
% the example of Heiko Oberdiek. Thanks!
%<*ignore>
\begingroup
\def\x{LaTeX2e}%
\expandafter\endgroup
\ifcase
0\expandafter\ifx\csname processbatchFile\endcsname\relax\else1\fi\ifx\fmtname\x\else 1\fi
\relax
\else
\csname fi\endcsname
%
%<*install>
%% This file will generate documentation and runtime files
%% from ltxfront.dtx when run through LaTeX or TeX.
\input docstrip
\preamble
This is a generated file;
altering it directly is inadvisable;
instead, modify the original source file.
See the URL in the file README-LTXFRONT.tex.
License
You may distribute this file under the conditions of the
LaTeX Project Public License 1.3c or later
(http://www.latex-project.org/lppl.txt).
This file is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE.
\endpreamble
\askforoverwritefalse
\keepsilent
\generate{%
%{ignore}
% \usedir{tex/latex/revtex}%
\file{ltxfront.sty}{%
\from{ltxfront.dtx}{package,options,kernel}%
}%
}%
\ifToplevel{
\Msg{***********************************************************}
\Msg{*}
\Msg{* To finish the installation, please move}
\Msg{* ltxfront.sty}
\Msg{* into a directory searched by TeX;}
\Msg{* in a TDS-compliant installation:}
\Msg{* texmf/tex/macros/latex/revtex/.}
\Msg{*}
\Msg{* To produce the documentation,
run ltxfront.dtx through LaTeX.}
\Msg{*}
\Msg{* Happy TeXing}
\Msg{***********************************************************}
}
\endbatchfile
%
%<*ignore>
\fi
%
% \fi
%
% \GetFileInfo{ltxfront.dtx}
%
% \iffalse ltxdoc klootch
%<*package>
%%% @LaTeX-file{
%%% filename = "ltxfront.dtx",
%%% version = "4.2f",
%%% date = "2022/06/05",
%%% author = "Arthur Ogawa (mailto:arthur_ogawa at sbcglobal.net),
%%% commissioned by the American Physical Society.
%%% ",
%%% copyright = "Copyright (C) 1999, 2009 Arthur Ogawa,
%%% distributed under the terms of the
%%% LaTeX Project Public License 1.3c, see
%%% ftp://ctan.tug.org/macros/latex/base/lppl.txt
%%% ",
%%% address = "Arthur Ogawa,
%%% USA",
%%% telephone = "",
%%% FAX = "",
%%% email = "mailto colon arthur_ogawa at sbcglobal.net",
%%% codetable = "ISO/ASCII",
%%% keywords = "latex, page grid, main vertical list",
%%% supported = "yes",
%%% abstract = "package to change page grid, MVL",
%%% }
%
% \fi
%
% \iffalse ltxdoc klootch
% The following references the \file{README-LTXFRONT} file,
% which contains basic information about this package.
% The contents of this file are generated when
% you typeset the programmer's documentation.
% Search on "{filecontents*}{README-LTXFRONT.tex}" to locate it.
% \fi\input{README-LTXFRONT}%
%
% \subsection{Bill of Materials}
%
% Following is a list of the files in this distribution arranged
% according to provenance.
%
% \subsubsection{Primary Source}%
% One single file generates all.
%\begin{verbatim}ltxfront.dtx\end{verbatim}
%
% \subsubsection{Generated by \texttt{latex ltxfront.dtx}}%
% Typesetting the source file under \LaTeX\
% generates the readme and the documentation.
%\begin{verbatim}README-LTXFRONT\end{verbatim}
%
% \subsubsection{Generated by \texttt{tex ltxfront.dtx}}%
% Typesetting the installer generates
% the package files.
%\begin{verbatim}ltxfront.sty\end{verbatim}
%
% \subsubsection{Documentation}%
% The following are the online documentation:
% \begin{verbatim}ltxfront.pdf\end{verbatim}
%
% \subsubsection{Auxiliary}%
% The following are auxiliary files generated
% in the course of running \LaTeX:
% \begin{verbatim}ltxfront.aux ltxfront.idx ltxfront.ind ltxfront.log ltxfront.toc\end{verbatim}
%
% \section{Code common to all modules}%
%
% We want to require only one place in this file
% where the version number is stated,
% and we also want to ensure that the version
% number is embedded into every generated file.
%
% Now we declare that
% these files can only be used with \LaTeXe.
% An appropriate message is displayed if
% a different \TeX{} format is used.
% \begin{macrocode}
%<*doc|package>
\NeedsTeXFormat{LaTeX2e}[1995/12/01]%
%
% \end{macrocode}
% As desired, the following modules all
% take common version information:
% \begin{macrocode}
%\typeout{%
%<*package|doc>
\ProvidesFile{%
%
%<*kernel|package|doc>
ltxfront%
%
%<*doc>
.dtx%
%
%.sty%
%<*package|doc>
}%
%
% \end{macrocode}
%
% The following line contains, for once and for all,
% the version and date information.
% By various means, this information is reproduced
% consistently in all generated files and in the
% typeset documentation.
% \begin{macrocode}
%<*doc|package|kernel>
%
[2022/06/05 4.2f frontmatter package (AO,DPC,MD)]% \fileversion
%
%}%
% \end{macrocode}
%
%
% \section{The doc module \texttt{doc}}
%
% This module, consisting of the present section,
% typesets the programmer's documentation,
% generating the \file{README-LTXFRONT} and sample document as needed.
%
% Because the only uncommented-out lines of code at the beginning of
% this file constitute the \file{doc} module itself,
% we can simply typeset the \file{.dtx} file directly,
% and there is thus rarely any need to
% generate the ``doc'' {\sc docstrip} module.
% Module delimiters are nonetheless required so that
% this code does not find its way into the other modules.
%
% The \enve{document} command concludes the typesetting run.
%
% \begin{macrocode}
%<*doc>
% \end{macrocode}
%
% \subsection{The Preamble}
% The programmers documentation is formatted
% with the \classname{ltxdoc} class with local customizations,
% and with the usual code line indexing.
% \begin{macrocode}
\documentclass{ltxdoc}
\RequirePackage{ltxdocext}%
\let\url\undefined
\RequirePackage[colorlinks=true,linkcolor=blue]{hyperref}%
%\expandafter\ifx\csname package@font\endcsname\@undefined\else
% \expandafter\RequirePackage\expandafter{\csname package@font\endcsname}%
%\fi
\CodelineIndex\EnableCrossrefs % makeindex -s gind.ist ltxfront
\RecordChanges % makeindex -s gglo.ist -o ltxfront.gls ltxfront.glo
% \end{macrocode}
%
% \subsubsection{Docstrip and info directives}
% We use so many {\sc docstrip} modules that we set the
% \texttt{StandardModuleDepth} counter to 1.
% \begin{macrocode}
\setcounter{StandardModuleDepth}{1}
% \end{macrocode}
% The following command retrieves the date and version information
% from this file.
% \begin{macrocode}
\expandafter\GetFileInfo\expandafter{\jobname.dtx}%
% \end{macrocode}
%
% \subsection{The ``Read Me'' File}
% As promised above, here is the contents of the
% ``Read Me'' file. That file serves a double purpose,
% since it also constitutes the beginining of the
% programmer's documentation. What better thing, after
% all, to have appear at the beginning of the
% typeset documentation?
%
% A good discussion of how to write a ReadMe file can be found in
% Engst, Tonya, ``Writing a ReadMe File? Read This''
% \emph{MacTech} October 1998, p. 58.
%
% Note the appearance of the
% \cmd\StopEventually\ command, which marks the
% dividing line between the user documentation
% and the programmer documentation.
%
% The usual user will not be asked to
% do a full build, not to speak
% of the bootstrap.
% Instructions for carrying these processes
% begin the programmer's manual.
%
% \begin{macrocode}
\begin{filecontents*}{README-LTXFRONT.tex}
\title{%
A \LaTeX\ Package for\\the frontmatter and title page%
\thanks{%
This file has version number \fileversion,
last revised \filedate.%
}%
\thanks{%
Version \fileversion\ \copyright\ 2019 American Physical Society
}%
}%
\author{%
Arthur Ogawa%
\thanks{\texttt{mailto:arthur\_ogawa at sbcglobal.net}}%
}%
%\iffalse
% For version number and date,
% search on "\fileversion" in the .dtx file,
% or see the end of the README-LTXFRONT file.
%\fi
\maketitle
This file embodies the \classname{ltxfront} package,
the implementation and its user documentation.
The distribution point for this work is
\url{https://journals.aps.org/revtex},
which contains fully unpacked, prebuilt runtime files and documentation.
The \classname{ltxfront} package was commissioned by the American Physical Society
and is distributed under the terms of the \LaTeX\ Project Public License 1.3c,
the same license under which all the portions of \LaTeX\ itself is distributed.
Please see \url{http://ctan.tug.org/macros/latex/base/lppl.txt} for details.
To use this document class, you must have a working
\TeX\ installation equipped with \LaTeXe\
and possibly pdftex and Adobe Acrobat Reader or equivalent.
To install, retrieve the distribution,
unpack it into a directory on the target computer,
and move the file \file{ltxfront.sty}
into a location in your filesystem where it will be found by \LaTeX.
To use, read the user documentation \file{ltxfront.pdf}.
\tableofcontents
\section{Processing Instructions}
The package file \file{ltxfront.sty}
is generated from this file, \file{ltxfront.dtx},
using the {\sc docstrip} facility of \LaTeX
via |tex ltxfront.dtx|.
The typeset documentation that you are now reading is generated from
the same file by typesetting it with \LaTeX\ or pdftex
via |latex ltxfront.dtx| or |pdflatex ltxfront.dtx|.
\subsection{Build Instructions}
You may bootstrap this suite of files solely from \file{ltxfront.dtx}.
Prepare by installing \LaTeXe\ (and either tex or pdftex) on your computer,
then carry out the following steps:
\begin{enumerate}
\item
Within an otherwise empty directory,
typeset \file{ltxfront.dtx} with \TeX\ or pdftex,
thereby generating the package file \file{ltxfront.sty}.
\item
Next typeset \file{ltxfront.dtx} with \LaTeX\ or pdflatex;
you will obtain the typeset documentation you are now reading,
along with
the sample document \file{ltxfront-test.tex}
and the file \file{README-LTXFRONT}.
Note: you will have to run \LaTeX, then
\file{makeindex} \texttt{-s gind.ist ltxfront.idx}, then
\file{makeindex} \texttt{-s gglo.ist -o ltxfront.gls ltxfront.glo}, then
\LaTeX\ again in order to obtain a valid index and table of contents.
\item
Now typeset \file{ltxfront.dtx} with \TeX (not \LaTeX),
thereby generating the package file \file{ltxfront.sty}.
\item
Install the following files into indicated locations within your
TDS-compliant \texttt{texmf} tree (you may need root access):
\begin{itemize}
\item
\file{$TEXMF/}\file{tex/}\file{latex/}\file{revtex/}\classname{ltxfront.sty}
\item
\file{$TEXMF/}\file{source/}\file{latex/}\file{revtex/}\classname{ltxfront.dtx}
\item
\file{$TEXMF/}\file{doc/}\file{latex/}\file{revtex/}\classname{ltxfront.pdf}
\end{itemize}
where \file{$TEXMF/} stands for \file{texmf-local/}, or some other \texttt{texmf} tree
in your installation.
\item
Run \texttt{mktexlsr} on \file{$TEXMF/} (you may need root access).
\item
Build and installation are now complete;
now put a \cmd\usepackage\texttt{\{ltxfront\}} in your document preamble!
\end{enumerate}
\subsection{Change Log}
\changes{4.0b}{1999/06/20}{Change handling of \cs{@author} to prevent parsing problems. (Helps in error recovery when syntax errors exist)}
\changes{4.0b}{1999/06/20}{Gathered all code for the abstract environment together and abstracted out the formatting details for journals to override.}
\changes{4.0b}{1999/06/20}{Separate option now controls production}
\changes{4.0b}{1999/06/20}{Set \cs{footnote} to \LaTeX\ standard version for this scope.}
\changes{4.0c}{1999/11/13}{grid changes with ltxgrid}
\changes{4.0d}{1998/01/31}{\cs{comma@space}}
\changes{4.0d}{1998/01/31}{change name from \cs{tempaffiliation}}
\changes{4.0d}{1998/01/31}{hookify}
\changes{4.0d}{1998/01/31}{If empty \cs{abstractname} omit spacing}
\changes{4.0d}{1998/01/31}{PACS boxed to width of abstract}
\changes{4.0e}{2000/09/20}{Keywords on same footing as PACS}
\changes{4.0e}{2000/09/20}{Warn if no production}
\changes{4.0f}{2001/02/13}{Actually append \cs{AU@grp} to \cs{@AAClist}.}
\changes{4.0g}{1998/06/10}{multiple preprint commands}
\changes{4.0h}{1998/06/25}{Changes to support groups of affiliations}
\changes{4.0h}{1998/06/25}{new hook}
\changes{4.0l}{1998/09/01}{add optional argument handling back}
\changes{4.0l}{1998/09/01}{Changes to add collaboration processing, which now means doing comma/and processing on each sublist}
\changes{4.0l}{1998/09/01}{macro added}
\changes{4.1a}{2008-06-30}{(AO, 443) create an entry in the PDF bookmarks for the abstract via the toc}
\changes{4.1a}{2008-07-01}{(AO, 496) remove default prependation to \cs{email}.}
\changes{4.1a}{2008-07-01}{(AO, 496) remove default prependation to \cs{homepage}.}
\changes{4.1a}{2008/06/16}{removed code that had been commented out}
\changes{4.1b}{2008/06/29}{(AO, 455) provide a \texttt{description} environment for the abstract}
\changes{4.1b}{2008/08/02}{(AO, 486) \cs{collaboration} to work with \texttt{groupedaddress}}
\changes{4.1b}{2008/08/02}{Change csname \cs{AFS@opr} to \cs{AFG@opr}}
\changes{4.1b}{2008/08/02}{Make the syntax of this package switch optional}%
\changes{4.1b}{2008/08/02}{Provide for diagnostics via \cs{frontmatterverbose@sw}}
\changes{4.1b}{2008/08/02}{Use \cs{@affil@def} for all access to \cs{@affil}}
\changes{4.1b}{2008/08/02}{Use \cs{frontmatter@init} as the vehicle for all initialization}
\changes{4.1b}{2008/08/04}{(AO, 443) PDF Bookmark for title page}%
\changes{4.1b}{2008/08/04}{Provide facility \cs{affil@cutoff}: if there is only one affiliation on the title page, no superscript}%
\changes{4.1c}{2008/08/04}{Hyperref compatibility: take \cs{maketitle} back.}
\changes{4.1c}{2008/08/04}{Parametrize the production after the address}%
\changes{4.1c}{2008/08/04}{Produce PACS, keywords only if specified}%
\changes{4.1d}{2008/10/17}{(AO, 410) compare \cs{@tempa} to \cs{blankaffiliation}.}%
\changes{4.1f}{2009/07/07}{(AO, 515) Use \cs{set@footnotefont}, which is defined in ltxutil}
\changes{4.1g}{2009/10/05}{(AO, 535) Robustify \cs{footnote} while \cs{class@warn} is expanding its argument}
\changes{4.1g}{2009/10/05}{(AO, 539) Robustify \cs{class@warn} against TOC processing}%
\changes{4.1i}{2009/10/18}{(AO, 540) More runtime diagnostics via \cs{frontmatterverbose@sw}}
\changes{4.1i}{2009/10/23}{(AO, 540) Rationalize code that appends to \cs{AF@grp}}
\changes{4.1i}{2009/10/23}{(AO, 540) Optimize boolean logic }
\changes{4.1i}{2009/10/23}{(AO, 544) Class options runinaddress and unsortedaddress stopped working}
\changes{4.1m}{2009/11/20}{(AO, 563) \cs{collaboration} to work with both \texttt{groupedaddress} and \texttt{superscriptaddress}}
\changes{4.1m}{2009/11/20}{(AO, 563) More complete runtime diagnostics via \cs{frontmatterverbose@sw}}
\changes{4.1m}{2009/11/20}{(AO, 563) Let \cs{@collaboration@gobble} parse all three arguments of \cs{CO@opr}}
\changes{4.1n}{2009/11/30}{(AO, 567) Handle \cs{noaffiliation} case}
\changes{4.1n}{2009/11/30}{(AO, 567) Handle punctuation for \classoption{superscriptaddress} style authors' extra information, such as \cs{email}}
\changes{4.1n}{2009/12/03}{(AO) remove http:// from \cs{href} call}
\changes{4.1n}{2010/01/02}{(AO, 571) Interface \cs{set@footnotewidth} for determining the set width of footnotes}%
\changes{4.1n}{2010/01/02}{(AO, 571) allow split after last line of footnote}%
\changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
\changes{4.2a}{2018/12/12}{(MD) Updated name of README file and use standard fonts when typesetting}%
\end{filecontents*}
% \end{macrocode}
%
% \subsection{A Gnuly Created Sample Document}
%
% \begin{macrocode}
\begin{filecontents*}{ltxfront-test.tex}
\documentclass{article}% use any combination of titlepage, twocolumn
\usepackage[]{ltxfront}% use inactive to turn off features
\begin{document}
\title{Gnu Veldt Cuisine}
\author{G. Picking}
\thanks{Supported by a grant from the GSF.}
\affiliation{Acme Kitchen Products}
\author{R. Dillo}
\thanks{On leave during 1985.}
\affiliation{Cordon Puce School}
\date{24 July 1984}%
\revised{5 January 1985}%
\maketitle
\section{Introduction}%
We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
\end{document}
\end{filecontents*}
% \end{macrocode}
%
% \subsection{The Document Body}
%
% Here is the document body, containing only a
% \cmd\DocInput\ directive---referring to this very file.
% This very cute self-reference is a common \classname{ltxdoc} idiom.
% \begin{macrocode}
\begin{document}%
\expandafter\DocInput\expandafter{\jobname.dtx}%
% ^^A\PrintChanges
\end{document}
% \end{macrocode}
%
% \begin{macrocode}
%
% \end{macrocode}
%
% \section{Using this package}
% Once this package is installed on your filesystem, you can employ it in
% adding functionality to \LaTeX\ by invoking it in your document or document class.
%
% \subsection{Invoking the package}
% In your document, you can simply call it up in your preamble:
% \begin{verbatim}
%\documentclass{book}%
%\usepackage{ltxfront}%
%\begin{document}
%
%\end{document}\end{verbatim}
% However, the preferred way is to invoke this package from within your
% customized document class:
% \begin{verbatim}
%\NeedsTeXFormat{LaTeX2e}[1995/12/01]%
%\ProvidesClass{myclass}%
%\RequirePackage{ltxfront}%
%\LoadClass{book}%
%
%\endinput\end{verbatim}
%
% Once loaded, the package gives you acccess to certain procedures,
% usually to be invoked by a \LaTeX\ command or environment.
%
% \section{Frontmatter commands}
%
% A document using this package will use commands like \cmd\title, \cmd\author, \cmd\thanks,
% the \texttt{abstract} environment
% and \cmd\maketitle.
% These are part of \LaTeX's standard document classes.
% But this package supplements \LaTeX\ syntax with additional commands, such as
% \cmd\affiliation, \cmd\collaboration, \cmd\email, \cmd\homepage, and others.
%
% Furthermore, you can have multiple \cmd\author, \cmd\affiliation, and \cmd\collaboration\ commands,
% each with their own set of \cmd\email, \cmd\homepage, etc. commands.
%
% \section{The Front Matter}\label{sec:front}
%
% This section describes the macros
% this package provides for formatting the front matter of an
% article. The behavior and usage of these macros can be quite
% different from those provided in \LaTeXe.
%
% \subsection{Setting the title}
%
% The title of the manuscript is simply specified by using the
% \cmd\title\arg{title} macro. A \verb+\\+ may be used to put a line
% break in a long title.
% The \cmd\title\ commnd takes an optional argument, which you will use to
% give an abbreviated title for use in the running header.
%
% \subsection{Specifying a date}%
%
% The \cmd\date\marg{date} command outputs the date on the manuscript.
% Using \cmd\today\ will cause \LaTeX{} to insert the
% current date whenever the file is run:
% \begin{verbatim}\date{\today}\end{verbatim}
%
% \subsection{Specifying authors and affiliations}
%
% Commands specifying author and affilliation have been improved to save
% labor for authors and in production. Authors and affiliations are
% arranged into groupings called, appropriately enough, \emph{author
% groups}. Each author group is a set of authors who share the same set
% of affiliations. Author names are specified with the \cmd\author\
% macro while affiliations (or addresses) are specified with the
% \cmd\affiliation\ macro. Author groups are specified by sequences of
% \cmd\author\ macros followed by \cmd\affiliation\ macros. An
% \cmd\affiliation\ macro applies to all previously specified
% \cmd\author\ macros which don't already have an affiliation supplied.
%
% For example, if Bugs Bunny and Roger Rabbit are both at Looney Tune
% Studios, while Mickey Mouse is at Disney World, the markup would be:
% \begin{verbatim}
% \author{Bugs Bunny}
% \author{Roger Rabbit}
% \affiliation{Looney Tune Studios}
% \author{Mickey Mouse}
% \affiliation{Disney World}\end{verbatim}
% The default is to display this as
% \begin{center}
% Bugs Bunny and Roger Rabbit\\
% \emph{Looney Tune Studios}\\
% Mickey Mouse\\
% \emph{Disney World}\\
% \end{center}
% This layout style for displaying authors and their affiliations is
% chosen by selecting the class option
% \classoption{groupedaddress}. This option is the default for all APS
% journal styles, so it does not need to be specified explicitly.
% The other major way of displaying this
% information is to use superscripts on the authors and
% affiliations. This can be accomplished by selecting the class option
% \classoption{superscriptaddress}. To achieve the display
% \begin{center}
% Bugs Bunny,$^{1}$ Roger Rabbit,$^{1,2}$ and Mickey Mouse$^{2}$\\
% \emph{$^{1}$Looney Tune Studios}\\
% \emph{$^{2}$Disney World}\\
% \end{center}
% one would use the markup
% \begin{verbatim}
% \author{Bugs Bunny}
% \affiliation{Looney Tune Studios}
% \author{Roger Rabbit}
% \affiliation{Looney Tune Studios}
% \affiliation{Disney World}
% \author{Mickey Mouse}
% \affiliation{Disney World}\end{verbatim}
%
% Note that this package takes care of any commas and \emph{and}'s that join
% the author names together and font selection, as well as any
% superscript numbering. Only the author names and affiliations should
% be given within their respective macros.
%
% There is a third class option, \classoption{unsortedaddress}, for
% controlling author/affiliation display. The default
% \classoption{groupedaddress} will actually sort authors into the
% approriate author groups if one chooses to specify an affiliation for
% each author. The markup:
% \begin{verbatim}
% \author{Bugs Bunny}
% \affiliation{Looney Tune Studios}
% \author{Mickey Mouse}
% \affiliation{Disney World}
% \author{Roger Rabbit}
% \affiliation{Looney Tune Studios}\end{verbatim}
% will result in the same display as for the first case given
% above even though Roger Rabbit is specified after Mickey Mouse. To
% avoid Roger Rabbit being moved into the same author group as Bugs
% Bunny, use the
% \classoption{unsortedaddress} option instead. In general, it is safest
% to list authors in the order they should appear and specify
% affiliations for multiple authors rather than one at a time. This will
% afford the most independence for choosing the display option. Finally,
% it should be mentioned that the affiliations for the
% \classoption{superscriptaddress} are presented and numbered
% in the order that they are encountered. This means that the order
% will usually follow the order of the authors. An alternative ordering
% can be forced by including a list of \cmd\affiliation\ commands before
% the first \cmd{\author} in the desired order. Then use the exact same
% text for each affilation when specifying them for each author.
%
% If an author doesn't have an affiliation, the \cmd\noaffiliation\
% macro may be used in the place of an \cmd\affiliation\ macro.
%
%
% \subsubsection{Collaborations}
%
% A collaboration name can be specified with the \cmd\collaboration\
% command. This is very similar to the \cmd\author\ command.
% It should appear at the end of an author group.
% The collaboration name will appear centered in parentheses.
% You may have multiple author groups, each with its own \cmd\collaboration.
% Because collaborations don't normally have affiliations, one needs to follow the
% \cmd\collaboration\ with \cmd\noaffiliation.
%
% \subsubsection{Footnotes for authors, collaborations, affiliations or title}\label{sec:footau}
%
% Often one wants to specify additional information associated with an
% author, collaboration, or affiliation such an e-mail address, an
% alternate affiliation, or some other ancillary information.
% This package introduces several new macros just for this purpose. They
% are:
% \begin{itemize}
% \item\cmd\email\oarg{optional text}\arg{e-mail address}
% \item\cmd\homepage\oarg{optional text}\arg{URL}
% \item\cmd\altaffiliation\oarg{optional text}\arg{affiliation}
% \item\cmd\thanks\arg{miscellaneous text}
% \end{itemize}
% In the first three, the \emph{optional text} will be prepended before the
% actual information specified in the required argument. \cmd\email\ and
% \cmd\homepage\ each have a default text for their optional arguments
% (`Electronic address:' and `URL:' respectively). The \cmd\thanks\
% macro should only be used if one of the other three do not apply. Any
% author name can have multiple instances of these four commands.
% Note that unlike the
% \cmd\affiliation\ macro, these macros only apply to the \cmd\author\
% that directly precedes it. Any \cmd\affiliation\ \emph{must} follow
% the other author-specific macros. A typical usage might be as follows:
% \begin{verbatim}
% \author{Bugs Bunny}
% \email[E-mail me at: ]{bugs@looney.com}
% \homepage[Visit: ]{http://looney.com/}
% \altaffiliation[Permanent address: ]
% {Warner Brothers}
% \affiliation{Looney Tunes}\end{verbatim}
% This would result in the footnote ``E-mail me at: \texttt{bugs@looney.com},
% Visit: \texttt{http://looney.com/}, Permanent address: Warner
% Brothers'' being attached to Bugs Bunny. Note that:
% \begin{itemize}
% \item Only an e-mail address, URL, or affiliation should go in the
% required argument in the curly braces.
% \item The font is automatically taken care of.
% \item An explicit space is needed at the end of the optional text if one is
% desired in the output.
% \item Use the optional arguments to provide customized
% text only if there is a good reason to.
% \end{itemize}
%
% The \cmd\collaboration\ , \cmd\affiliation, or even \cmd\title\ can
% also have footnotes attached via these commands. If any ancillary data
% (\cmd\thanks, \cmd\email, \cmd\homepage, or
% \cmd\altaffiliation) are given in the wrong context (e.g., before any
% \cmd\title, \cmd\author, \cmd\collaboration, or \cmd\affiliation\
% command has been given), then a warning is given in the \TeX\ log, and
% the command is ignored.
%
% Duplicate sets of ancillary data are merged, giving rise to a single
% shared footnote. However, this only applies if the ancillary data are
% identical: even the order of the commands specifying the data must be
% identical. Thus, for example, two authors can share a single footnote
% indicating a group e-mail address.
%
% Duplicate \cmd\affiliation\ commands may be given in the course of the
% front matter, without the danger of producing extraneous affiliations
% on the title page. However, ancillary data should be specified for
% only the first instance of any particular institution's
% \cmd\affiliation\ command; a later instance with different ancillary
% data will result in a warning in the \TeX\ log.
%
% It is preferable to arrange authors into
% sets. Within each set all the authors share the same group of
% affiliations. For each author, give the \cmd\author\ (and appropriate
% ancillary data), then follow this author group with the needed group
% of \cmd\affiliation\ commands.
%
% If affiliations have been listed before the first
% \cmd\author\ macro to ensure a particular ordering, be sure
% that any later \cmd\affiliation\ command for the given institution is
% an exact copy of the first, and also ensure that no ancillary data is
% given in these later instances.
%
%
% A journal may determine the placement of these
% ancillary information footnotes. One journal may put all
% such footnotes at the start of the bibliography while another
% journal may display them on the first page, as a footnote. One can override a
% journal style's default behavior by specifying explicitly the class
% option
% \classoption{bibnotes} (puts the footnotes at the start of the
% bibliography) or \classoption{nobibnotes} (puts them on the first page).
%
% \subsubsection{Specifying first names and surnames}
%
% Many authors have names in which either the surname appears first
% or in which the surname is made up of more than one name. To ensure
% that such names are accurately captured for indexing and other
% purposes, the \cmd\surname\ macro should be used to indicate which portion
% of a name is the surname. Similarly, there is a \cmd\firstname\ macro
% as well, although usage of \cmd\surname\ should be sufficient. If an
% author's surname is a single name and written last, it is not
% necessary to use these macros. These macros do nothing but indicate
% how a name should be indexed. Here are some examples;
% \begin{verbatim}
% \author{Andrew \surname{Lloyd Weber}}
% \author{\surname{Mao} Tse-Tung}\end{verbatim}
%
% \subsection{The abstract}
% An abstract for a paper is specified by using the \env{abstract}
% environment:
% \begin{verbatim}
% \begin{abstract}
% Text of abstract
% \end{abstract}\end{verbatim}
% Note that with this package, the abstract must be specified before the
% \cmd\maketitle\ command, and there is no need to embed it in an explicit
% minipage environment.
%
% \subsection{PACS codes}
% Some authors are asked to supply suggested PACS codes with their
% submissions. The \cmd\pacs\ macro is provided as a way to do this:
% \begin{verbatim}\pacs{23.23.+x, 56.65.Dy}\end{verbatim}
% The actual display of the PACS numbers below the abstract is
% controlled by two class options: \classoption{showpacs} and
% \classoption{noshowpacs}. In particular, this is now independent of
% the \classoption{preprint} option. \classoption{showpacs} must be
% explicitly included in the class options to display the PACS codes.
%
% \subsection{Keywords}
% A \cmd\keywords\ macro may also be used to indicate keywords for the
% article.
% \begin{verbatim}\keywords{nuclear form; yrast level}\end{verbatim}
% This will be displayed below the abstract and PACS (if supplied). Like
% PACS codes, the actual display of the the keywords is controlled by
% two classoptions: \classoption{showkeys} and
% \classoption{noshowkeys}. An explicit \classoption{showkeys} must be
% included in the \cmd\documentclass\ line to display the keywords.
%
% \subsection{Institutional report numbers}
% Institutional report numbers can be specified using the \cmd\preprint\
% macro. These will be displayed in the upper lefthand corner of the
% first page. Multiple \cmd\preprint\ macros may be supplied (space is
% limited though, so only three or less may actually fit).
%
% \subsection{maketitle}
% After specifying the title, authors, affiliations, abstract, PACS
% codes, and report numbers, the final step for formatting the front
% matter of the manuscript is to issue the \cmd\maketitle\ command:
% \begin{verbatim}\maketitle\end{verbatim}
% This command must follow all of the macros listed above.
% The macro will format the front matter in accordance with the various
% class options that were specified in the
% \cmd\documentclass\ line (either implicitly through defaults or
% explicitly).
%
%
% \section{Compatability with \LaTeX's Required Packages}
% Certain packages, usually ones written by members of the
% \LaTeX\ Project itself, have been designated ``required'' and
% are distributed as part of standard \LaTeX.
% These packages have been placed in a priviledged position
% vis \'a vis the \LaTeX\ kernel in that they override the definitions of certain kernel macros.
%
% The \classname{ltxfront} package will be incompatible with any package that
% redefines any of the kernel macros that \classname{ltxfront} patches---if that
% package is loaded \emph{after} \classname{ltxfront}.
%
% Hereinafter follows some notes on specific \LaTeX\ packages.
%
%\StopEventually{}
%
% \section{Implementation of package}
%
% \subsection{Beginning of the \file{package} {\sc docstrip} module}
% \begin{macrocode}
%<*package>
\def\package@name{ltxfront}%
\expandafter\PackageInfo\expandafter{\package@name}{%
Title page macros for \protect\LaTeXe,
by A. Ogawa (arthur_ogawa at sbcglobal.net)%
}%
% \end{macrocode}
%
% \subsection{Prerequisites}%
%
% This package requires the use of the \classname{ltxutil} package.
% \begin{macrocode}
\let\class@name\package@name
\RequirePackage{ltxutil}%
%
% \end{macrocode}
% End of the preliminary portion of the package code.
% \begin{macrocode}
% \end{macrocode}
%
% \subsection{Options}%
% Package options are treated in this portion of the dtx file.
% This portion is guarded by the \texttt{options} \classname{docstrip} code so that it can be
% merged into a larger package gracefully.
% \begin{macrocode}
%<*options>
% \end{macrocode}
%
% Package option turns on diagnostics that trace its operation.
% \cmd\frontmatterverbose@sw\ is set false by default: we do not elect to monitor
% the workings of these procedures.
% \begin{macrocode}
\DeclareOption{frontmatterverbose}{\@booleantrue\frontmatterverbose@sw}%
\@booleanfalse\frontmatterverbose@sw
% \end{macrocode}
%
% Package option inactivates its syntax, for testing purposes.
% \begin{macrocode}
\DeclareOption{inactive}{\@booleanfalse\frontmatter@syntax@sw}%
\@booleantrue\frontmatter@syntax@sw
% \end{macrocode}
%
% \begin{macro}{\runinaddress@sw}
% The flag \cmd\runinaddress@sw\ signifies that author addresses are to be set on the same
% line with the author.
%
% The \classoption{runinaddress} option is the only one that sets \cmd\runinaddress@sw\ to true.
%
% FIXME: this option pertains to cases where \cmd\groupauthors@sw\ is true, but is independant of \cmd\@affils@sw.
% So, it should be possible to assert both \classoption{runinaddress} and \classoption{unsortedaddress} as well as
% each separately.
% \begin{macrocode}
\@booleanfalse\runinaddress@sw
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@affils@sw}
% If \cmd\@affils@sw\ is false, an address is never recognised as ``new''
% and is therefore always entered into the affiliation list,
% stopping groups of authors at the same address being consolidated
% into the same list:
% the address will be printed the same number of times it is entered.
%
% The \classoption{unsortedaddress} option is the only one that sets \cmd\@affils@sw\ to false.
% \begin{macrocode}
\@booleantrue\@affils@sw
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\groupauthors@sw}
% The flag \cmd\groupauthors@sw\ signifies that authors are to be grouped,
% affecting the meaning of \cmd\@author@present.
%
% Clients will want to set \cmd\groupauthors@sw\ true if they want grouped addresses
% or either of the following variants:
% for unsorted addresses: set \cmd\@affils@sw\ false;
% for run-in addresses, set \cmd\runinaddress@sw\ true.
% \begin{macrocode}
\@booleanfalse\groupauthors@sw
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{groupedaddress}
% If we take the \classoption{groupedaddress} option as the default, then we can look upon
% the \classoption{superscriptaddress} option as simply turning \cmd\groupauthors@sw\ to \cmd\false@sw.
%
% \classoption{groupedaddress}, the default in APS journals, groups authors above a common address.
% \begin{macrocode}
\DeclareOption{groupedaddress}{\clo@groupedaddress}%
\def\clo@groupedaddress{%
\@booleantrue\groupauthors@sw
\@booleantrue\@affils@sw
\@booleanfalse\runinaddress@sw
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{unsortedaddress}
% \classoption{unsortedaddress} is similar to \classoption{groupedaddress},
% but turns off \cmd\@affils@sw,
% with the result that each address that is entered will be printed.
% \begin{macrocode}
\DeclareOption{unsortedaddress}{\clo@unsortedaddress}%
\def\clo@unsortedaddress{%
\@booleantrue\groupauthors@sw
\@booleanfalse\@affils@sw
\@booleanfalse\runinaddress@sw
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{runinaddress}
%
% \classoption{runinaddress} is similar to \classoption{groupedaddress},
% with the addition of the Boolean \cmd\runinaddress@sw,
% which causes the authors associated with a particular address group
% to be formatted in a paragraph instead of on separate lines.
% \begin{macrocode}
\DeclareOption{runinaddress}{\clo@runinaddress}%
\def\clo@runinaddress{%
\@booleantrue\groupauthors@sw
\@booleantrue\@affils@sw
\@booleantrue\runinaddress@sw
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{superscriptaddress}
% \classoption{superscriptaddress} presents author affiliations
% as superscripts. Authors with like affiliations share the same
% superscript.
%
% FIXME: if \cmd\groupauthors@sw\ is false, would not \cmd\@affils@sw\ be a don't care?
% \begin{macrocode}
\DeclareOption{superscriptaddress}{\clo@superscriptaddress}%
\def\clo@superscriptaddress{%
\@booleanfalse\groupauthors@sw
\@booleantrue\@affils@sw
\@booleanfalse\runinaddress@sw
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macrocode}
%
% \end{macrocode}
%
% \subsection{Process package options}%
% \begin{macrocode}
%<*package>
\DeclareOption*{\OptionNotUsed}%
\ProcessOptions*
%
% \end{macrocode}
%
% \section{Kernel of Front Matter}
% Here begins the kernel of the \classname{frontmatter} package.
% \begin{macrocode}
%<*kernel>
% \end{macrocode}
%
% This package implements a new syntax for the title page of an article.
%
% Special acknowledgment: this package uses concepts pioneered
% and first realized by William Baxter (mailto:web at superscript.com)
% in his SuperScript line of commercial typesetting tools, and
% which are used here with his permission.
%
% These macros were first coded by David P. Carlisle for the American Physical
% society in the late 1990s as part of the development of REV\TeX4.
% That development work was taken over by Arthur Ogawa, who is the author of
% this package.
%
% \subsection{Initialization}%
%
% \begin{macro}{\frontmatter@init}
% The \cmd\frontmatter@init\ procedure sets up all the registers for
% processing the title page.
% At present, this is done once, at \cmd\class@documenthook\ time.
% If multiple title pages are to be processed within a job,
% the initialization must be done for each.
% \begin{macrocode}
\appdef\class@documenthook{\frontmatter@init}%
\let\frontmatter@init\@empty
% \end{macrocode}
% \end{macro}
%
% \subsection{The title command}%
%
% \begin{macro}{\title}
% \begin{macro}{\do@title}
% The author uses \cmd\title\ to specify the title. As in the AMS
% classes, \cmd\title\ has an optional argument specifying a short form
% for use in running heads.
%
% Once the \cmd\title\ is given, you can specify any combination of
% \cmd\thanks, \cmd\email, \cmd\homepage, and \cmd\altaffiliation\ commands,
% applying to the title of the document.
%
% Compatibility note: as with all of the standard \LaTeX\ commands that we override,
% we make here a private definition and later switch it in if so required.
% \changes{4.1b}{2008/08/02}{Make the syntax of this package switch optional}%
% \begin{macrocode}
\newcommand\frontmatter@title[2][]{%
\def\@title{#2}%
\def\@shorttitle{#1}%
\let\@AF@join\@title@join
}%
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\@title}
% \begin{macro}{\@shorttitle}
% The arguments to \cmd\title\ are saved in these internal
% macros, which are set up to produce a warning if \cmd\title\ has not
% been used before \cmd\maketitle.
% \changes{4.1b}{2008/08/02}{Use \cs{frontmatter@init} as the vehicle for all initialization}
%
% Extensibility note: by using \cmd\frontmatter@init\ as the initialization procedure,
% we open the possibility of more than one title page per document.
% \begin{macrocode}
\appdef\frontmatter@init{%
\def\@title{\class@warn{No title}}%
\let\@shorttitle\@empty
\let\@title@aux\@title@aux@cleared
}%
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\@title@join}
% \begin{macro}{\@title@join@}
% \begin{macro}{\@title@aux@cleared}
%
% \begin{macrocode}
\def\@title@join{\expandafter\@title@join@\@title@aux}%
\def\@title@join@#1#2{%
\def\@title@aux{{\@join{\@separator}{#1}{#2}}}%
}%
\def\@title@aux@cleared{{}}%
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
% \subsection{The author, affiliation, and related commands}%
%
% \begin{macro}{\c@affil}
% \begin{macro}{\c@collab}
% \changes{4.1b}{2008/08/02}{(AO, 486) \cs{collaboration} to work with \texttt{groupedaddress}}
%
% \cmd\c@affil\ stores the affiliation numbers used for the superscript marks.
% The \cmd\newcounter\ command defines \cmd\theaffil, which we never use:
% this counter is evaluated solely via \cmd\the.
%
% \cmd\c@collab\ stores the collaboration numbers.
% The \cmd\newcounter\ command defines \cmd\thecollab.
% As with \cmd\c@affil, we never use \cmd\thecollab; only \cmd\the\ \cmd\c@collab.
%
% Each counter must be cleared before frontmatter can be processed.
% \begin{macrocode}
\newcounter{affil}%
\newcounter{collab}%
\appdef\frontmatter@init{%
\c@affil\z@
\c@collab\z@
}%
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsubsection{Commands for author or collaboration}%
%
% \begin{macro}{\author}
% Each author is given in a \emph{separate} \cmd\author\ command.
% This is similar to the AMS classes, but the AMS also try to support
% the \classname{article} class's \cmd\and\ command for putting multiple
% authors in one \cmd\author\ command.
% This package, however, does not support the \cmd\and\ command.
%
% When the \cmd\author\ command is encountered,
% the previous author, author group, affiliation, and affiliation group are at an end.
% This procedure moves the previous author to the author group (\cmd\move@AU),
% moves the previous affiliation to the affiliation group (\cmd\move@AF),
% and terminates the previous author/affiliation group (\cmd\move@AUAF) as the case may require.
%
% Compatibility note: as with all of the standard \LaTeX\ commands that we override,
% we make here a private definition and later switch it in if so required.
% \changes{4.1b}{2008/08/02}{Make the syntax of this package switch optional}%
% \begin{macrocode}
\newcommand\frontmatter@author{% implicit #1
\@author@def{}% implicit #2
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\collaboration}
% Specify the collaboration (given after a group of authors).
%
% This procedure does exactly what \cmd\author\ does, and sets
% a flag signifying that the \cmd\collaboration\ command was given.
%
% Note: earlier versions attempted to ignore the collaboration command if it was considered inappropriate.
% We must not do this, however, because it throws the state machine out of kilter.
% \changes{4.1b}{2008/08/02}{(AO, 486) \cs{collaboration} to work with \texttt{groupedaddress}}
% \begin{macrocode}
\def\collaboration{% implicit #1
\@author@def{\@booleantrue\collaboration@sw}% implicit #2
}%
\appdef\frontmatter@init{%
\@booleanfalse\collaboration@sw
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@author@init}
% \begin{macro}{\@author@cleared}
% \begin{macro}{\@authorclear@sw}
% \begin{macro}{\@author@def}
% \begin{macro}{\@author@join@}
% \begin{macro}{\@author@join}
% \changes{4.0b}{1999/06/20}{Change handling of \cs{@author} to prevent parsing problems. (Helps in error recovery when syntax errors exist)}
% \changes{4.1b}{2008/08/02}{(AO, 486) \cs{collaboration} to work with \texttt{groupedaddress}}
% \changes{4.1b}{2008/08/02}{Use \cs{frontmatter@init} as the vehicle for all initialization}
%
% Here are all the access procedures for the author data structure.
%
% We define a flag value for \cmd\@author (private),
% a procedure \cmd\@author@gobble\ to read author data without any effect,
% a procedure for setting \cmd\@author\ to the flag value (\cmd\@author@init),
% a Boolean to test against the flag value (\cmd\@authorclear@sw),
% and a procedure to add new ancillary data to the author.
%
% Note that expanding the functionality of the \cmd\collaboration\ command entailed changing
% the data structures, because now all authors must remember the collaboration they belong to.
% This change affects procedures \cmd\@author@cleared\ and \cmd\@author@gobble.
% \begin{macrocode}
\def\@author@cleared{{}{}{}}%
\def\@author@gobble#1#2#3{}%
\def\@author@init{%
\let\@author\@author@cleared
\@booleanfalse\collaboration@sw
}%
\def\@authorclear@sw{\@ifx{\@author\@author@cleared}}%
\appdef\frontmatter@init{%
\@author@init
}%
% \end{macrocode}
% \changes{4.1i}{2009/10/18}{(AO, 540) More runtime diagnostics via \cs{frontmatterverbose@sw}}
% \begin{macrocode}
\def\@author@def#1#2{%
\frontmatterverbose@sw{\typeout{\string\author\space\string\collaboration}}{}%
\move@AU\move@AF\move@AUAF
\let\@AF@join\@author@join
#1%
\def\@author{{#2}{}}%
}%
\def\@author@join@#1#2#3{%
\def\@author{{#1}{\@join{\@separator}{#2}{#3}}}%
}%
\def\@author@join{\expandafter\@author@join@\@author}%
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\move@AU}
% \begin{macro}{\add@AUCO@grp}
% \changes{4.1b}{2008/08/02}{(AO, 486) \cs{collaboration} to work with \texttt{groupedaddress}}
% The \cmd\move@AU\ procedure moves the most recent author to the current author group \cmd\AU@grp,
% or the most recent collaboration to the collaboration group \cmd\CO@grp.
% If we recently did a \cmd\@author@init, this is a no-op.
%
% To accommodate the expanded syntax of \cmd\collaboration, we add a new field to
% those associated with an author (collaborator), namely the value of the
% collaboration counter.
% \begin{macrocode}
\def\move@AU{%
\@authorclear@sw{}{%
\collaboration@sw{%
\advance\c@collab\@ne
\@argswap{\CO@grp\CO@opr}%
}{%
\@argswap{\AU@grp\AU@opr}%
}%
{%
\expandafter\@argswap@val
\expandafter{\@author}%
{\expandafter\@argswap@val\expandafter{\the\c@collab}{\add@AUCO@grp}}%
}%
}%
\@author@init
}%
% \end{macrocode}
% \changes{4.1b}{2008/08/02}{Provide for diagnostics via \cs{frontmatterverbose@sw}}
% The procedure \cmd\add@AUCO@grp\ adds to the specified group \#3 using the
% given intercollated operator \#4, with arguments \{\#1\} and \#2,
% where the first argument is the collaboration number,
% the second is the author name, and the third the joined attributes of the author.
% For example, \cmd\move@AU\ could finally execute:
% \cmd\appdef\ \cmd\AU@grp\ \{\cmd\AU@opr\{1\}\{A. Author\}\{\}\}.
% \begin{macrocode}
\def\add@AUCO@grp#1#2#3#4{%
\appdef#3{#4{#1}#2}%
\frontmatterverbose@sw{\say#3}{}%
}%
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\@author@finish}
% We define a procedure to terminate author/affiliation parsing just before the title block is formatted.
% We detect the case where an author group is not followed by an affiliation group.
% \changes{4.0f}{2001/02/13}{Actually append \cs{AU@grp} to \cs{@AAClist}.}
% \changes{4.1b}{2008/08/02}{(AO, 486) \cs{collaboration} to work with \texttt{groupedaddress}}
% \changes{4.1b}{2008/08/02}{Use \cs{@affil@def} for all access to \cs{@affil}}
% \changes{4.1b}{2008/08/02}{Provide for diagnostics via \cs{frontmatterverbose@sw}}
% \changes{4.1g}{2009/10/05}{(AO, 535) Robustify \cs{footnote} while \cs{class@warn} is expanding its argument}
% \changes{4.1i}{2009/10/18}{(AO, 540) More runtime diagnostics via \cs{frontmatterverbose@sw}}
% \changes{4.1m}{2009/11/20}{(AO, 563) \cs{collaboration} to work with both \texttt{groupedaddress} and \texttt{superscriptaddress}}
% \changes{4.1n}{2009/11/30}{(AO, 567) Handle \cs{noaffiliation} case}
%
% We first finish off any author- or affiliation groups in progress.
% Next, we detect the case where there is an author group or a collaboration group in progress, but no affiliation group.
% If so, we emit a diagnositic message and act as if a \cmd\noaffiliation\ command had been given.
% In any case, we finish off any author/affiliation pair that may remain.
% Formatting of the title block may now proceed.
% \begin{macrocode}
\def\@author@finish{%
\frontmatterverbose@sw{\typeout{\string\@author@finish}}{}%
\move@AU\move@AF
\@ifx{\AU@grp\@empty}{%
\@ifx{\CO@grp\@empty}%
}{%
\false@sw
}%
{}{%
\@ifx{\AF@grp\@empty}{%
\begingroup
\let\href\@secondoftwo
\let\AU@opr\@secondofthree
\let\CO@opr\@secondofthree
\let\footnote\@gobble
\@ifx{\CO@grp\@empty}{%
\class@warn{Assuming \string\noaffiliation\space for authors}%
\frontmatterverbose@sw{\say\AU@grp}%
}{%
\class@warn{Assuming \string\noaffiliation\space for collaboration}%
\frontmatterverbose@sw{\say\CO@grp}{}%
}%
\endgroup
\@affil@none\move@AF
}{}%
}%
\move@AUAF
}%
\def\@secondofthree#1#2#3{#2}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@join}
% The procedure \cmd\@join\ inserts
% a separator between two tokens, or, if the first token is
% nil, elides both that token and the separator.
% \begin{macrocode}
\def\@join#1#2#3{%
\@if@empty{#2}{#3}{#2#1#3}%
}%
\def\@separator{;\space}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\surname}
% \begin{macro}{\firstname}
% No-op to allow better post-processing of the file.
% \begin{macrocode}
\let\surname\@firstofone
\let\firstname\@firstofone
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\and}
% The original \LaTeX\ idea of using one \cmd\author\ command to capture
% all authors and their address just doesn't work with multiple authors
% possibly sharing addresses, so in this class disable \cmd\and.
% \begin{macrocode}
\newcommand\frontmatter@and{\class@err{\protect\and\space is not supported}}
% \end{macrocode}
% \end{macro}
%
%
% \subsubsection{Commands for affiliation}%
%
% \begin{macro}{\affiliation}
% \changes{4.1b}{2008/08/02}{Use \cs{@affil@def} for all access to \cs{@affil}}
% After each group of authors with the same address,
% give that address in \cmd\affiliation.
% If later in the list you have an author
% with the address of an earlier author, repeat the \cmd\affiliation\
% command: the system will detect the equivalence and (if using the \classoption{superscriptaddress} option)
% only print the affiliation once, reusing the superscript marker.
%
% When the \cmd\affiliation\ command is encountered, the current author and author group (if any) are at an end.
% Also, the current affiliation is at an end.
%
% \changes{4.1i}{2009/10/18}{(AO, 540) More runtime diagnostics via \cs{frontmatterverbose@sw}}
% FIXME: changes to catcode required elsewhere now?
% \begin{macrocode}
\def\cat@comma@active{\catcode`\,\active}%
{\cat@comma@active\gdef,{\active@comma}}%
\def\active@comma{,\penalty-300\relax}%
\newcommand\affiliation{%
\frontmatterverbose@sw{\typeout{\string\affiliation}}{}%
\move@AU\move@AF
\begingroup
\cat@comma@active
\@affiliation
}%
\def\@affiliation#1{%
\endgroup
\let\@AF@join\@affil@join
\@affil@def{#1}%
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\noaffiliation}
% \changes{4.1b}{2008/08/02}{Use \cs{@affil@def} for all access to \cs{@affil}}
% \changes{4.1i}{2009/10/18}{(AO, 540) More runtime diagnostics via \cs{frontmatterverbose@sw}}
% \changes{4.1n}{2009/11/30}{(AO, 567) Handle \cs{noaffiliation} case}
% User-level command \cmd\noaffiliation\ signifies that the current group of authors, or the current collaboration, has \emph{no} affiliation.
%
% This is implemented by acting as if the \cmd\affiliation\ command has been given, and using a
% flag value of \{\cmd\relax\}, which adds an element to the affiliation group of this author,
% albeit a nil one (\cmd\AFF@opr\ \{\cmd\relax\} \{\}).
%
% Note that this procedure does substantially the same as \cmd\@author@finish. (the latter, If it does not bail out altogether, differs chiefly in providing diagnostics).
% \begin{macrocode}
\newcommand\frontmatter@noaffiliation{%
\frontmatterverbose@sw{\typeout{\string\noaffiliation}}{}%
\move@AU\move@AF
% \end{macrocode}
% In \cmd\@author@finish, there is code testing if an effective
% \cmd\noaffiliation\ should be executed now. Here, we do so in any case.
% \begin{macrocode}
\@affil@none\move@AF
\move@AUAF
}%
\def\blankaffiliation{{}}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@affil@cleared}
% \begin{macro}{\@affil@nil}
% \begin{macro}{\@affil@init}
% \begin{macro}{\@affil@none}
% \begin{macro}{\@affilclear@sw}
% \begin{macro}{\@affil@def}
% \begin{macro}{\@affil@join@}
% \begin{macro}{\@affil@join}
% \changes{4.1b}{2008/08/02}{Use \cs{@affil@def} for all access to \cs{@affil}}
% \changes{4.1n}{2009/11/30}{(AO, 567) Handle \cs{noaffiliation} case}
%
% Here are all the access procedures for the affiliation data structure.
% Note the similarity to those of the \cmd\@author\ data structure.
%
% We define a flag value for \cmd\@affil\ (private),
% a procedure for setting \cmd\@affil\ to the flag value (\cmd\@affil@init),
% a Boolean to test against the flag value (\cmd\@affilclear@sw),
% a procedure \cmd\@affil@def\ to load a value into the structure,
% and a procedure to add new ancillary data to the affiliation.
% \begin{macrocode}
\def\@affil@cleared{{{}}{}}%
\def\@affil@nil{{\relax}{}}%
\appdef\frontmatter@init{%
\@affil@init
}%
\def\@affil@none{%
\let\@affil\@affil@nil
}%
\def\@affil@init{%
\let\@affil\@affil@cleared
}%
\def\@affilclear@sw{\@ifx{\@affil\@affil@cleared}}%
\def\@affil@def#1{%
\def\@affil{{#1}{}}%
}%
\def\@affil@join@#1#2#3{%
\def\@affil{{#1}{\@join{\@separator}{#2}{#3}}}%
}%
\def\@affil@join{\expandafter\@affil@join@\@affil}%
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\move@AF}
% \changes{4.1b}{2008/08/02}{(AO, 486) \cs{collaboration} to work with \texttt{groupedaddress}}
% \changes{4.1i}{2009/10/23}{(AO, 540) Rationalize code that appends to \cs{AF@grp}}
% \changes{4.1n}{2009/11/30}{(AO, 567) Handle \cs{noaffiliation} case}
% Move the most recent affiliation to the affiliation group.
% If we recently did a \cmd\@affil@init, this is a no-op.
%
% Set the \cmd\temp@sw\ to false, then execute the affiliation list (\cmd\@AFF@list)
% with the intercollated operator set to \cmd\@affil@match\
% and with \cmd\@tempa\ holding the first component of \cmd\@affil, the current affiliation, which is to be matched.
%
% If the current affiliation has been seen before, then by side effect
% \cmd\temp@sw\ will be set to true,
% \cmd\@tempc\ will be set to the matching affiliation number,
% and \cmd\@tempd\ will be set to the affiliation's ancillary data.
% The Boolean \cmd\@affils@sw\ being false prevents this test from ever returning a ``true'' result.
%
% This procedure uses \cmd\@tempa\ and sets \cmd\@tempc, \cmd\@tempd, and \cmd\temp@sw.
% \begin{macrocode}
\def\move@AF{%
\@affilclear@sw{}{%
\@booleanfalse\temp@sw
\let\@tempd\@empty
\@affils@sw{%
\expandafter\@affil@addr@def\expandafter\@tempa\@affil
\def\AFF@opr{\@affil@match\@tempa}%
\@AFF@list
}{}\temp@sw
% \end{macrocode}
% True clause: This affiliation has been seen before.
% If ancillary data for the affiliation have been given, but are not identical to those seen before, give a warning.
% \begin{macrocode}
{%
\expandafter\@affil@aux@def\expandafter\@tempb\@affil
\@ifx{\@tempb\@empty}{}{%
\@ifx{\@tempb\@tempd}{}{%
\class@warn{%
Ancillary information for \@tempa\space must not be different!
Please put all of it on the first instance%
}%
}%
}%
}%
% \end{macrocode}
% False clause: This affiliation is a new one:
% increment the affiliation counter to get a unique affiliation ID
% and append the new ID, collaboration number, address, and auxiliary information
% to the list \cmd\@AFF@list.
%
% Note that, with the expanded syntax of \cmd\collaboration, we need to label each address with
% its associated collaboration.
%
% Note also that the \cmd\noaffiliation\ case is handled by recognizing the flag value \cmd\@affil@nil.
% \begin{macrocode}
{%
\@ifx{\@affil\@affil@nil}{%
\def\@tempc{0}%
\@argswap@val{0}%
}{%
\advance\c@affil\@ne
\expandafter\def\expandafter\@tempc\expandafter{\the\c@affil}%
\expandafter\@argswap@val\expandafter{\the\c@affil}%
}%
{%
\expandafter\@argswap@val\expandafter{\the\c@collab}{%
\expandafter\@argswap@val\expandafter{\@affil}{%
\add@list@val@val@val\@AFF@list\AFF@opr
}%
}%
}%
}%
% \end{macrocode}
% In either case, append this affiliation number to the \cmd\AF@grp, the affiliation group of the current author group.
% (It will later be considered for the \cmd\@AFG@list.)
% Then assign the flag value to \cmd\@affil\ that signifies it has been cleared.
% \changes{4.1i}{2009/10/18}{(AO, 540) Rationalize code that appends to \cs{AF@grp}}
% \begin{macrocode}
\appdef@eval\AF@grp\@tempc
\frontmatterverbose@sw{\say\AF@grp}{}%
\@affil@init
}%
}%
\def\@affil@addr@def#1#2#3{%
\def#1{#2}%
}%
\def\@affil@aux@def#1#2#3{%
\def#1{#3}%
}%
% \end{macrocode}
% \changes{4.1b}{2008/08/02}{Provide for diagnostics via \cs{frontmatterverbose@sw}}
% Procedure \cmd\add@list@val@val@val\ appends to the given list \#1 using the given intercollated operator \#2,
% with arguments \#5 (affiliation ID) and \#4 (collaboration ID) delimited by braces, and \#3 bare.
% In the end, \cmd\move@AF\ may execute something like
% \cmd\appdef\ \cmd\@AFF@list\ \cmd\AFF@opr\ \{1\} \{3\} \{My Institution\} \{thanks\}.
% \begin{macrocode}
\def\add@list@val@val@val#1#2#3#4#5{%
\appdef#1{#2{#5}{#4}#3}%
\frontmatterverbose@sw{\say#1}{}%
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@affil@match}
% \changes{4.1b}{2008/08/02}{(AO, 486) \cs{collaboration} to work with \texttt{groupedaddress}}
% The procedure \cmd\@affil@match\ is the definition for \cmd\AFF@opr,
% the intercollated operator for \cmd\@AFF@list,
% when adding a new affiliation: it seeks a match with any earlier affiliation.
% When the affiliation list is executed, this procedure tests each entry against
% the `new' affiliation (which has been stored in \cmd\@tempa) and its associated
% collaboration number (in \cmd\@tempb).
%
% If \cmd\groupauthors@sw\ is true, then we require the collaboration ID to match,
% otherwise there is no such requirement,
% as is appropriate for the \classoption{superscriptaddress} class option.
%
% Uses \cmd\temp@sw, \cmd\@tempc, and \cmd\@tempd\ to communicate back:
% if it returns \cmd\temp@sw\ true, a match was found.
% Then
% \cmd\@tempc\ will be the affiliation ID of the matching entry
% and \cmd\@tempd\ will be the auxiliary information of the matching entry.
% \begin{macrocode}
\def\@affil@match#1#2#3#4#5{%
\temp@sw{}{%
\def\@tempifx{#4}%
\@ifx{\@tempifx#1}{%
\groupauthors@sw{%
\@ifnum{#3=\c@collab}{%
\true@sw
}{%
\false@sw
}%
}{%
\true@sw
}%
}{%
\false@sw
}%
{%
\@booleantrue\temp@sw
\def\@tempc{#2}%
\def\@tempd{#5}%
}{%
}%
}%
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\move@AUAF}
% \changes{4.0h}{1998/06/25}{Changes to support groups of affiliations}
% \changes{4.1b}{2008/08/02}{(AO, 486) \cs{collaboration} to work with \texttt{groupedaddress}}
% \changes{4.1b}{2008/08/02}{Change csname \cs{AFS@opr} to \cs{AFG@opr}}
% \changes{4.1b}{2008/08/02}{Provide for diagnostics via \cs{frontmatterverbose@sw}}
% Append \cmd\AF@grp, \cmd\AU@grp, and \cmd\CO@grp\ to \cmd\@AAC@list,
% append \cmd\CO@grp\ to \cmd\@AFG@list,
% and merge any new \cmd\AF@grp\ to \cmd\@AFG@list.
%
% The entire procedure is predicated on something non-trivial to move.
%
% If both author group \cmd\AU@grp\ and affiliation group \cmd\AF@grp\ are nil, bail out.
%
% No, try that again:
%
% If we have seen any affiliations (\cmd\AF@grp\ is not nil),
% then it is time to move the current affiliation group and author group to \cmd\@AAC@list.
% If not, we are picking up authors into an author group, and we should bail out.
%
% To extend this scheme to the new \cmd\collaboration\ abilities, we must append an affiliation \cmd\AF@opr\ to \cmd\@AAC@list\
% also in the case where there was no affiliation specified (e.g., \cmd\noaffiliation). This affiliation will be a nil affiliation:
% \cmd\AF@opr\verb+{{0}}+.
%
%FIXME: only one of \cmd\CO@grp\ or \cmd\AU@grp\ is non-empty at this point,
% but this code does not appear to recognize this fact!
% \changes{4.1i}{2009/10/18}{(AO, 540) More runtime diagnostics via \cs{frontmatterverbose@sw}}
% \begin{macrocode}
\def\move@AUAF{%
\frontmatterverbose@sw{\say\AU@grp\say\AF@grp\say\CO@grp}{}%
\@ifx{\AF@grp\@empty}{%
\@ifx{\@empty\CO@grp}{%
% \end{macrocode}
% Both \cmd\AF@grp\ and \cmd\CO@grp\ are empty: nothing to do. But what if \cmd\AU@grp\ is not empty?
% \begin{macrocode}
}{%
% \end{macrocode}
% Append the nil \cmd\AF@opr\ to \cmd\@AAC@list.
% \begin{macrocode}
\appdef \@AAC@list{\AF@opr{{0}}}%
% \end{macrocode}
% Append the collaboration group to the \cmd\@AAC@list; no intercollated operator need be added,
% because we already have \cmd\CO@opr.
% \begin{macrocode}
\appdef@e \@AAC@list{\CO@grp}%
\appdef@e \@AFG@list{\CO@grp}%
\let\CO@grp\@empty
}%
}{%
% \end{macrocode}
% Append current affiliation group (expansion of \cmd\AF@grp)
% to the author/affiliation list (\cmd\@AAC@list),
% using \cmd\AF@opr\ as the intercollated operator;
% also append the current authors (\cmd\AU@grp).
% \begin{macrocode}
\appdef \@AAC@list{\AF@opr}%
\appdef@eval\@AAC@list{\AF@grp}%
\appdef@e \@AAC@list{\AU@grp}%
% \end{macrocode}
% Determine if either \cmd\AU@grp\ or \cmd\CO@grp\ is non-empty.
% \begin{macrocode}
\@ifx{\@empty\AU@grp}{%
\@ifx{\@empty\CO@grp}%
}{%
\false@sw
}%
% \end{macrocode}
% At this point, there is a Boolean in \TeX's scanner;
% it will parse the following two brace-delimited sequences and select one of them.
% \begin{macrocode}
{%
% \end{macrocode}
% This branch is executed if and only if both \cmd\AU@grp\ and \cmd\CO@grp\ are empty.
% \begin{macrocode}
}{%
% \end{macrocode}
% There was either a \cmd\author\ or a \cmd\collaboration\ command.
% Append the current affiliation group to \cmd\@AFG@list,
% (only if it is not already there)
% using \cmd\AFG@opr\ as the intercollated operator.
%
% Note that \cmd\@AFG@list\ is a list of \emph{unique} affiliation \emph{groups},
% and building it entails an \(N^2\) computation.
% \begin{macrocode}
\@booleanfalse\temp@sw
\def\AFG@opr{\x@match\AF@grp}%
\let\CO@opr\@author@gobble
\@AFG@list
\temp@sw{}{%
\appdef \@AFG@list{\AFG@opr}%
\appdef@eval\@AFG@list{\AF@grp}%
}%
% \end{macrocode}
% If the collaboration \cmd\CO@grp\ is not empty, we append it to the \cmd\@AFG@list\ and to the \cmd\@AAC@list.
% \changes{4.1m}{2009/11/20}{(AO, 563) \cs{collaboration} to work with both \texttt{groupedaddress} and \texttt{superscriptaddress}}
% \begin{macrocode}
\@ifx{\@empty\CO@grp}{}{%
\appdef@e \@AAC@list{\CO@grp}%
\appdef@e \@AFG@list{\CO@grp}%
\let\CO@grp\@empty
}%
}%
% \end{macrocode}
% Finally, null out the macros holding the author group \cmd\AU@grp, affiliation group \cmd\AF@grp, and collaboration group \cmd\CO@grp.
% \begin{macrocode}
\let\CO@grp\@empty
\let\AU@grp\@empty
\let\AF@grp\@empty
}%
\frontmatterverbose@sw{\say\@AAC@list\say\@AFG@list}{}%
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\AU@grp}
% \begin{macro}{\AF@grp}
% \begin{macro}{\@AAC@list}
% \begin{macro}{\@AFG@list}
% \begin{macro}{\@AFF@list}
%
% The control sequence name \cmd\AU@grp\ accumulates
% consecutive \cmd\author\ entries (with \cmd\AU@opr\ as the intercollated operator)
% and \cmd\collaboration\ entries (with \cmd\CO@opr\ as the intercollated operator).
% Ultimately, its contents are appended to the author/affiliation list \cmd\@AAC@list\
% and to the list of affiliation groups, \cmd\@AFG@list.
% It must be initialized to \cmd\@empty.
%
% Note on \cmd\AU@opr\ and \cmd\CO@opr: it is essential to treat these two operators to the greatest extent possible on an equal footing.
% Therefore we invariably assign values to the pair of them within the same procedure.
%
% The macro \cmd\AF@grp\ accumulates affiliation IDs into an affiliation group.
% It must be empty at the beginning of the frontmatter.
%
% The \cmd\@AAC@list\ macro accumulates
% authors (using \cmd\AU@opr\ as the intercollated operator),
% collaborations (using \cmd\CO@opr\ as the intercollated operator),
% and
% affiliations (using \cmd\AF@opr\ as the intercollated operator).
%
% It must be empty at the beginning of the frontmatter.
%
% The macro \cmd\@AFG@list\ accumulates
% affiliation groups, with \cmd\AFG@opr\ as the intercollated operator,
% and collaborations, with no intercollated operator.
% This token list is employed when and only when \classoption{groupedaddress} is in effect.
%
% The macro \cmd\@AFF@list\ accumulates the list of affiliations
% with \cmd\AFF@opr\ as the intercollated operator.
% It must be empty at the beginning of the frontmatter.
%
% Each \cmd\affiliation\ command in the document contributes
% to this list, as long as the argument of that instance of the command
% is ``new''.
%
% Each entry in this list consists of the \cmd\AFF@opr\ intercollated operator
% followed by three brace-delimited tokens, representing, in order:
% \begin{enumerate}
% \item
% the affiliation's unique ID, a number increasing monotonically for
% each new entry,
% \item
% the optional argument of the \cmd\affiliation\ command,
% the footnote to the affiliation, and
% \item
% the text of the affiliation.
% \end{enumerate}
%
% At various junctures in the code, the control sequence name
% \cmd\AFF@opr\ assumes the meaning of
% \cmd\@affil@group, \cmd\affil@script,
% or is defined to expand to \cmd\@affil@match\cmd\@tempa,
% and the list \cmd\@AFF@list\ is expanded.
%
% For each of these lists, here is the syntax of an element and the usage of the associated operator:
% \begin{verbatim}
%\@AFF@list \AFF@opr{}{}{}{} \frontmatter@author@produce@script \affils@present@group
%\@AFG@list \AFG@opr{{}..{}} \frontmatter@author@produce@group
%\@AAC@list \AF@opr{{}..{}} (\AU@opr|\CO@opr){}{}{} \frontmatter@author@produce@script \frontmatter@author@produce@group \affils@present@group
%
%\AFF@opr \@affil@match\@tempa \@affil@script \@affil@group
%\AFG@opr \affils@present@group \x@match\AF@grp
%\AF@opr \@gobble \@affilID@def \@affilID@count\AF@temp\@tempcnta \@affilID@match\AF@temp
%\AU@opr \@secondofthree \@author@count\@tempcnta \@author@present \@author@gobble \@author@count#2 \@author@present
%\CO@opr \@secondofthree \@collaboration@count\AU@temp\@tempcnta \@collaboration@present\AU@temp \@collaboration@present\AU@temp \@collaboration@gobble
%
%\CO@opr\@author@cleared
% \end{verbatim}
% \begin{macrocode}
\appdef\frontmatter@init{%
\let\AU@grp\@empty
\let\CO@grp\@empty
\let\AF@grp\@empty
\let\@AAC@list\@empty
\let\@AFG@list\@empty
\let\@AFF@list\@empty
}%
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\@AF@join}
% The \cmd\csname\ \cmd\@AF@join\ is a procedure used within
% \cmd\email, \cmd\homepage, \cmd\thanks, and \cmd\altaffiliation.
% When such a command appears after an \cmd\author, \cmd\collaboration, or \cmd\affiliation
% command, the \cmd\@AF@join\ procedure appends the argument given to the appropriate
% macro.
% Its default is to give an error message, since these commands are legal only within
% the particular context mentioned.
% \begin{macrocode}
\appdef\frontmatter@init{%
\let\@AF@join\@AF@join@error
}%
\def\@AF@join@error#1{%
\class@warn{%
\string\email, \string\homepage, \string\thanks, or \string\altaffiliation\space
appears in wrong context.
}%
}%
% \end{macrocode}
% \end{macro}
%
%
% \subsubsection{Commands for auxiliary information}%
%
% \begin{macro}{\email}
% Just tacks the email address on to the current author or affiliation.
% \changes{4.1a}{2008-07-01}{(AO, 496) remove default prependation to \cs{email}.}
% \begin{macrocode}
\def\sanitize@url{%
\@makeother\%%
\@makeother\~%
\@makeother\_%
}%
\newcommand*\email[1][]{\begingroup\sanitize@url\@email{#1}}%
\def\@email#1#2{%
\endgroup
\@AF@join{#1\href{mailto:#2}{#2}}%
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\homepage}
% Just tacks the URL on to the current author or affiliation.
% Note: group opened in \cmd\homepage\ is closed in \cmd\@homepage.
% \changes{4.1a}{2008-07-01}{(AO, 496) remove default prependation to \cs{homepage}.}
% \changes{4.1n}{2009/12/03}{(AO) remove http:// from \cs{href} call}
% \begin{macrocode}
\newcommand*\homepage[1][]{\begingroup\sanitize@url\@homepage{#1}}%
\def\@homepage#1#2{%
\endgroup
\@AF@join{#1\href{#2}{#2}}%
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\href}
% The document may load a package that defines either of these commands;
% if not, we give a default meaning.
% \begin{macrocode}
\appdef\class@documenthook{%
\providecommand\href[1]{}%
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\thanks}
% \changes{4.1b}{2008/08/02}{Make the syntax of this package switch optional}%
%
% The operative version of \cmd\thanks\ appends an item to \cmd\@author, or \cmd\@affil's auxiliary data.
% \begin{macrocode}
\def\frontmatter@thanks{% implicit #1
\@AF@join
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\altaffiliation}
% \changes{4.0d}{1998/01/31}{change name from \cs{tempaffiliation}}
% \changes{4.0l}{1998/09/01}{add optional argument handling back}
% Implemented more or less like \cmd\thanks\ but shares the affiliation
% counter.
% Optional argument may be used to give explanatory text eg
% `currently staying at'
% This will be placed before the address, if used in a footnote.
% \begin{macrocode}
\newcommand*\altaffiliation[2][]{%
\@AF@join{#1#2}%
}%
% \end{macrocode}
% \end{macro}
%
%
% \subsubsection{Procedures for author, collaboration, and affiliation}%
%
% Macros that list off, say, authors, and which require punctuation, like ``A, B, and C'', will use
% \cmd\set@listcomma@list, \cmd\set@listcomma@count, \cmd\@listand, and \cmd\@listcomma.
% These macros use the \cmd\@tempcnta\ register to keep track of how many items remain to be listed off.
%
% At present, \cmd\@author@present\ will decrement that counter.
%
% \begin{macro}{\set@listcomma@list}
% \begin{macro}{\set@listcomma@count}
% \changes{4.0l}{1998/09/01}{macro added}
% Pop the author count for this collaboration.
%
% Note: by side effect, it assigns \cmd\@listcomma:
% for a list of length two, suppress comma addition.
% \begin{macrocode}
\def\set@listcomma@list#1{%
\expandafter\@reset@ac\expandafter#1#1{0}\@reset@ac{%
\let\@listcomma\relax
}{%
\let\@listcomma\@listcomma@comma
}%
}%
\def\set@listcomma@count#1{%
\@ifnum{#1=\tw@}{%
\let\@listcomma\relax
}{%
\let\@listcomma\@listcomma@comma
}%
}%
% \end{macrocode}
% Does the actual pop operation, then generates a Boolean which selects one of the two assignments for \cmd\@listcomma.
%
% Note: this procedure sets \cmd\@tempcnta\ to reflect the number of items to list off.
% \begin{macrocode}
\def\@reset@ac#1#2#3\@reset@ac{%
\def#1{#3}%
\@tempcnta#2\relax
\@ifnum{#2=\tw@}%
}%
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\listand}
% Might need extending with penalties etc.
%
% Note: this procedure expects \cmd\@tempcnta\ to reflect the current number of items remaining to list off.
% \begin{macrocode}
\def\@listand{\@ifnum{\@tempcnta=\tw@}{\andname\space}{}}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@listcomma}
% This definition, with \cmd\@ne\ puts a comma before and.
%
% David Carlisle says: In UK English (at least) would have \cmd\tw@\ here,
% which would then implement the convention of indicating conjunction with comma or ``and'', but not both.
%
% Note: this procedure expects \cmd\@tempcnta\ to reflect the current number of items remaining to list off.
% \begin{macrocode}
\def\@listcomma@comma{\@ifnum{\@tempcnta>\@ne}{,}{}}%
\def\@listcomma@comma@UK{\@ifnum{\@tempcnta>\tw@}{,}{}}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@collaboration@gobble}
% This command will be the synonym of \cmd\CO@grp\ during the expansion of \cmd\@AAC@list,
% within \cmd\affils@present@group execution (in a \classoption{groupedaddress} situation).
%
% \changes{4.1m}{2009/11/20}{(AO, 563) Let \cs{@collaboration@gobble} parse all three arguments of \cs{CO@opr}}
% \begin{macrocode}
\def\@collaboration@gobble#1#2#3{}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\doauthor}
% \changes{4.1b}{2008/08/04}{Provide facility \cs{affil@cutoff}: if there is only one affiliation on the title page, no superscript}%
% \changes{4.1n}{2009/11/30}{(AO, 567) Handle punctuation for \classoption{superscriptaddress} style authors' extra information, such as \cs{email}}
% Main control over how authors are typeset.
%
% |#1| is loaded by \cmd\author
%
% |#2| is loaded by \cmd\email, \cmd\homepage, \cmd\altaffiliation, or \cmd\thanks
%
% |#3| is the superscript affiliation, if at all used.
%
% First, the author name is formatted, followed by a comma,
% then come any marks relating to affiliation (if present),
% then come the homepage URL and email address, if any, with
% appropriate punctuation.
%
% Here, as in \cmd\@affil@script, the parameter \cmd\affil@cutoff\
% controls whether the argument \#3 is produced as a superscript label
% connecting this author with its affiliation. (If there is only one
% affiliation on the title page, it makes sense to remove the superscript.)
%
% Note that argument \#3 must effectively execute either
% \cmd\aftergroup\cmd\true@sw\ or \cmd\aftergroup\cmd\false@sw\ (exactly once!).
% In the case of \classoption{superscriptaddress}, this is done when
% \cmd\@author@present@script\ invokes \cmd\doauthor\ with its third argument containing
% \cmd\@affil@present@script.
% Otherwise (e.g., \classoption{groupedaddress}), \cmd\doauthor\ is invoked by
% \cmd\@author@present@group\ with its third argument containing \cmd\@affil@present@group.
% \begin{macrocode}
\def\doauthor#1#2#3{%
\ignorespaces#1\unskip\@listcomma
\begingroup
#3%
% \end{macrocode}
% At this point, we must have queued up a Boolean (either \cmd\true@sw\ or \cmd\false@sw).
% \begin{macrocode}
\@if@empty{#2}{\endgroup{}{}}{\endgroup{\comma@space}{}\frontmatter@footnote{#2}}%
\space \@listand
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\x@match}
% Procedure \cmd\x@match\ is used as an alias \cmd\AFG@opr,
% probing the list of affiliation groups
% and setting a Boolean if a match is found to \#1 (usually the current affiliation group).
%
% Procedure \cmd\y@match\ is used as an alias to \cmd\@TBN@opr,
% probing the list of unique title block footnotes for a match to the footnote text:
% when the first match is found it sets a Boolean,
% defining \cmd\@tempb\ to the number of that footnote.
% \begin{macrocode}
\def\x@match#1#2{%
\temp@sw{}{%
\def\@tempifx{#2}%
\@ifx{\@tempifx#1}{%
\@booleantrue\temp@sw
}{%
}%
}%
}%
\def\y@match#1#2#3{%
\temp@sw{}{%
\def\@tempifx{#3}%
\@ifx{\@tempifx#1}{%
\@booleantrue\temp@sw
\def\@tempb{#2}%
}{%
}%
}%
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@footnote}
% Used when typesetting a title block footnote.
% (Item 290: merge duplicates.)
%
% Maintains a list of frontmatter footnotes along with associated device.
% Uniquifies each footnote by traversing the list and looking for a match to the footnote text.
% If found, define \cmd\@tempb\ to the corresponding footnote device, and typeset it with \cmd\@footnotemark.
% If never found, manually increment footnote counter,
% determine the corresponding footnote device, and
% add footnote text and device to the list of frontmatter footnotes.
%
% The list \cmd\@FMN@list\ is processed later in the title block production.
%
% Note that this method of making footnotes runs afoul of \classname{hyperref}'s patches of the \LaTeX\ kernel.
% Therefore, we avoid trouble by refraining from using \cmd\@footnotemark\ and by creating our own hypertext links.
% \begin{macrocode}
\def\frontmatter@footnote#1{%
\begingroup
\@booleanfalse\temp@sw
\def\@tempa{#1}%
\let\@tempb\@empty
\def\@TBN@opr{\y@match\@tempa}%
\@FMN@list
% \end{macrocode}
% By side effect, \cmd\@tempb\ holds the value of the footnote counter if
% This note has been seen before. Otherwise \cmd\temp@sw\ is false.
% \begin{macrocode}
\temp@sw{%
\expandafter\frontmatter@footnotemark
\expandafter{\@tempb}%
}{%
% \end{macrocode}
% Execute \cmd\frontmatter@foot@mark, feeding it the value of the current footnote counter.
% This call requires two levels of pre-expansion to accomplish, the first to expand \cmd\csname, the second to evaluate \cmd\the.
% \begin{macrocode}
\stepcounter\@mpfn
\expandafter\expandafter
\expandafter\frontmatter@foot@mark
\expandafter\expandafter
\expandafter{%
\expandafter \the\csname c@\@mpfn\endcsname
}{#1}%
}%
\endgroup
}%
% \end{macrocode}
% Procedure \cmd\frontmatter@foot@mark\ lays down the footnote device (mark) and takes care of the footnote text.
% The latter merely involves queueing that text (along with its associated device) into \cmd\@FMN@list.
% \begin{macrocode}
\def\frontmatter@foot@mark#1#2{%
\frontmatter@footnotemark{#1}%
\g@addto@macro\@FMN@list{\@TBN@opr{#1}{#2}}%
}%
\appdef\frontmatter@init{%
\global\let\@FMN@list\@empty
}%
% \end{macrocode}
% \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
% \begin{macrocode}
\def\frontmatter@footnotemark#1{%
\leavevmode
\ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi
\begingroup
\hyper@linkstart {link}{frontmatter.#1}%
\csname c@\@mpfn\endcsname#1\relax
\def\@thefnmark{\frontmatter@thefootnote}%
\@makefnmark
\hyper@linkend
\endgroup
\ifhmode\spacefactor\@x@sf\fi
\relax
}%
% \end{macrocode}
% \end{macro}
%
%
%
% \subsection{The keywords command}%
% \begin{macro}{\keywords}
% \begin{macro}{\@keywords}
% Usual game, save text in a macro for processing by \cmd\maketitle.
% \begin{macrocode}
\def\keywords#1{%
\aftermaketitle@chk{\keywords}%
\gdef\@keywords{#1}%
}%
\appdef\frontmatter@init{%
\let\@keywords\@empty
}%
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsection{The \cs{date} command and related commands}%
% \begin{macro}{\date}
% \begin{macro}{\received}
% \begin{macro}{\revised}
% \begin{macro}{\accepted}
% \begin{macro}{\published}
% \begin{macro}{\@date}
% \begin{macro}{\@received}
% \begin{macro}{\@revised}
% \begin{macro}{\@accepted}
% \begin{macro}{\@published}
% \changes{4.1b}{2008/08/02}{Make the syntax of this package switch optional}%
% Use the \cmd\date\ command to specify the document date,
% the \cmd\received\ command to specify the date received,
% \cmd\revised\ for date revised,
% \cmd\accepted\ for date accepted, and
% \cmd\published\ for date published.
% Normally only \cmd\date\ to be used by author,
% the remainder used only by editors.
%
% DPC: As for \cmd\keywords, but this time don't flag a warning if there is no
% revision date specified.
%
% In each case the user-level command defines the value of a
% macro which buffers the data entered by the user.
% For instance, \cmd\received\ causes \cmd\@received\ to
% acquire a value.
% The optional argument allows the user to override the
% text that will be typeset along with the date;
% the default value of that text is itself
% a localized macro.
% \begin{macrocode}
\newcommand*\frontmatter@date[2][\Dated@name]{\def\@date{#1#2}}%
\def\@date{}%
\newcommand*\received[2][\Received@name]{\def\@received{#1#2}}%
\def\@received{}%
\newcommand*\revised[2][\Revised@name]{\def\@revised{#1#2}}%
\def\@revised{}%
\newcommand*\accepted[2][\Accepted@name]{\def\@accepted{#1#2}}%
\def\@accepted{}%
\newcommand*\published[2][\Published@name]{\def\@published{#1#2}}%
\def\@published{}%
% \end{macrocode}
%
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsection{The pacs command}%
% PACS, the Physics and Astronomy Classification Scheme.
% \begin{macro}{\pacs}
% \begin{macro}{\@pacs}
% As for \cmd\keywords\
% \begin{macrocode}
\def\pacs#1{%
\aftermaketitle@chk{\pacs}%
\gdef\@pacs{#1}%
}%
\appdef\frontmatter@init{%
\let\@pacs\@empty
}%
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsection{The \cs{preprint} command}
%
% \changes{4.0g}{1998/06/10}{multiple preprint commands}
% \begin{macrocode}
\def\preprint#1{\gappdef\@preprint{\preprint{#1}}}%
\appdef\frontmatter@init{%
\let\@preprint\@empty
}%
% \end{macrocode}
%
% \subsection{The \env{abstract} environment}%
%
% \changes{4.0b}{1999/06/20}{Gathered all code for the abstract environment together and abstracted out the formatting details for journals to override.}
%
% \begin{macro}{\absbox}
%
% \begin{macrocode}
\newbox\absbox
% \end{macrocode}
% \end{macro}
%
% \begin{environment}{abstract}
% Abstract, as in AMS classes, must be specified \emph{before}
% \cmd\maketitle. It just saves everything up in \cmd\absbox.
% \changes{4.0d}{1998/01/31}{If empty \cs{abstractname} omit spacing}
% \changes{4.0d}{1998/01/31}{hookify}
% Note that the specifics of how the abstract is to be
% formatted are set by \cmd\frontmatter@abstractwidth,
% \cmd\frontmatter@abstractheading, and \cmd\frontmatter@abstractfont.
%
% Here we wish to set the abstract into type but save it away in a box, much like
% the \cmd\minipage\ command does.
%
% Note that the \cmd\endabstract\ portion of the environment
% begins with code that mostly duplicates \cmd\endminipage, but without the \cmd\@iiiparbox.
% At the end, we simply transfer the contents of the \cmd\minipage\
% into a box of our own.
%
% However, we also have to end the gratuitous
% paragraph begun by \cmd\minipage.
% We ensure that no trace of that paragraph is left,
% by absorbing the \cmd\parindent\ box.
% Doing so destroys the paragraph entirely, except
% for the \cmd\parskip\ glue, and that morsel is pruned, because we are at the top
% of a page.
%
% This mechanism is vulnerable, however, because anything placed into the horizontal list
% after the \cmd\parindent\ box will confound it.
% And that is exactly what happens under Mik\TeX:
% There seems to be an extension to the \TeX\ standard operating here which inserts a \cmd\special \ at the beginning of every paragraph.
% (The mechnism is \emph{not} based on \cmd\everypar.)
%
% To accomodate this state of affairs,
% we have a new mechanism that offers an even more complete rewrite of \env{minipage}.
%
% Note that an entry is made in the toc for the abstract; this has the side effect
% of creating a PDF bookmark for this element if the \classname{hyperref} package is in effect.
% \changes{4.1a}{2008-06-30}{(AO, 443) create an entry in the PDF bookmarks for the abstract via the toc}
% \begin{macrocode}
\def\toclevel@abstract{1}%
\def\addcontents@abstract{%
\phantomsection
\expandafter\def\csname Parent0\endcsname{section*.2}%
\expandafter\@argswap@val\expandafter{\abstractname}{\addcontentsline{toc}{abstract}}%
}%
\newenvironment{frontmatter@abstract}{%
\aftermaketitle@chk{\begin{abstract}}%
\global\setbox\absbox\vbox\bgroup
\color@begingroup
\columnwidth\textwidth
\hsize\columnwidth
\@parboxrestore
% \end{macrocode}
% The following line switches footnotes to the \texttt{mpfoootnote} series.
% This action should rather be taken by \cmd\frontmatter@abstractfont, which can be customized.
% There is also an interaction with \cmd\mini@note.
% \begin{macrocode}
\def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@
\let\@footnotetext\frontmatter@footnotetext
\minipagefootnote@init
\let\set@listindent\set@listindent@
\let\@listdepth\@mplistdepth \@mplistdepth\z@
\let@environment{description}{frontmatter@description}%
\@minipagerestore
\@setminipage
\frontmatter@abstractheading
\frontmatter@abstractfont
\let\footnote\mini@note
\expandafter\everypar\expandafter{\the\everypar\addcontents@abstract\everypar{}}%
}{%
\par
\unskip
\minipagefootnote@here
\@minipagefalse %% added 24 May 89
\color@endgroup
\egroup
}%
% \end{macrocode}
% \end{environment}
%
% \begin{macro}{\frontmatter@footnotetext}
% We reimplement \cmd\@mpfootnotetext\ under a new name (so as not to be overridden by the \classname{hyperref} package)
% and extend it to accomodate hyperrefs.
%
% Note that this procedure is very like \classname{ltxutil}'s \cmd\mp@footnotetext, except that it
% uses \cmd\frontmatter@makefntext\ instead of \cmd\@makefntext.
%
% \changes{4.1f}{2009/07/07}{(AO, 515) Use \cs{set@footnotefont}, which is defined in ltxutil}
% \changes{4.1n}{2010/01/02}{(AO, 571) allow split after last line of footnote}%
% \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
% \begin{macrocode}
\long\def\frontmatter@footnotetext#1{%
\minipagefootnote@pick
\set@footnotefont
\set@footnotewidth
\@parboxrestore
\protected@edef\@currentlabel{\csname p@\@mpfn\endcsname\@thefnmark}%
\color@begingroup
\frontmatter@makefntext{%
\rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox\vadjust{\vskip\z@skip}%
}%
\color@endgroup
\minipagefootnote@drop
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ltx@no@footwarn}
%
% \begin{macrocode}
\def\ltx@no@footnote{%
\let\ltx@xfootnote\ltx@no@xfootnote\let\ltx@yfootnote\ltx@no@yfootnote
\let\ltx@xfootmark\ltx@no@xfootmark\let\ltx@yfootmark\ltx@no@yfootmark
\let\ltx@xfoottext\ltx@no@xfoottext\let\ltx@yfoottext\ltx@no@yfoottext
}%
\def\ltx@no@xfootnote[#1]#2{\ltx@no@footwarn\footnote}%
\def\ltx@no@yfootnote#1{\ltx@no@footwarn\footnote}%
\def\ltx@no@xfootmark[#1]{\ltx@no@footwarn\footnotemark}%
\def\ltx@no@yfootmark{\ltx@no@footwarn\footnotemark}%
\def\ltx@no@xfoottext[#1]#2{\ltx@no@footwarn\footnotetext}%
\def\ltx@no@yfoottext#1{\ltx@no@footwarn\footnotetext}%
\def\ltx@no@footwarn#1{%
\class@warn{%
The \string#1\space command is not legal on the title page;
using \string\thanks\space instead might suit you: consult the manual for details%
}%
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@abstractheading}
% The default abstract head; journals will override this procedure.
% \begin{macrocode}
\def\frontmatter@abstractheading{%
\begingroup
\centering\large
\abstractname
\par
\endgroup
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@abstractfont}
% The default type specification for the body of the abstract.
% Journals will override this setting.
% \begin{macrocode}
\def\frontmatter@abstractfont{}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{frontmatter@description}
% \changes{4.1b}{2008/06/29}{(AO, 455) provide a \texttt{description} environment for the abstract}
% Within the abstract, the description environment is defined as follows:
% \begin{macrocode}
\newenvironment{frontmatter@description}{%
\list{}{%
\leftmargin\z@
\labelwidth\z@
% \end{macrocode}
% \begin{verbatim}
% \itemindent-\leftmargin
% \end{verbatim}
% \begin{macrocode}
\itemindent\z@
\let\makelabel\frontmatter@descriptionlabel
}%
}{%
\endlist
}%
\def\frontmatter@descriptionlabel#1{%
\hspace\labelsep
\normalfont\bfseries
#1:%
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@abstractwidth}
% The default setting is the full text width;
% journals can override this setting.
% \begin{macrocode}
\def\frontmatter@abstractwidth{\textwidth}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@abstract@produce}
% This procedure determines how the abstract is incorporated
% into the title block. We split this out in anticipation
% of the need to lift the limitation that the abstract not break over pages.
%
% If we are in preprint style, we provide an easy pagebreak point immediately above the abstract.
% This means that the abstract will either fit entirely on the same page as the title block,
% or it will start a page of its own (which may itself break onto a subsequent page if necessary).
% \begin{macrocode}
\def\frontmatter@abstract@produce{%
\par
\preprintsty@sw{%
\do@output@MVL{%
\vskip\frontmatter@preabstractspace
\vskip200\p@\@plus1fil
\penalty-200\relax
\vskip-200\p@\@plus-1fil
}%
}{%
\addvspace{\frontmatter@preabstractspace}%
}%
\begingroup
\dimen@\baselineskip
\setbox\z@\vtop{\unvcopy\absbox}%
\advance\dimen@-\ht\z@\advance\dimen@-\prevdepth
\@ifdim{\dimen@>\z@}{\vskip\dimen@}{}%
\endgroup
\begingroup
\prep@absbox
\unvbox\absbox
\post@absbox
\endgroup
\@ifx{\@empty\mini@notes}{}{\mini@notes\par}%
\addvspace\frontmatter@postabstractspace
}%
\appdef\frontmatter@init{\let\mini@notes\@empty}%
\let\prep@absbox\@empty
\let\post@absbox\@empty
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@preabstractspace}
% \begin{macro}{\frontmatter@postabstractspace}
% Space above and space below abstract in title block
% \begin{macrocode}
\def\frontmatter@preabstractspace{.5\baselineskip}
\def\frontmatter@postabstractspace{.5\baselineskip}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
%
%
% \subsection{Formatting the title block}%
%
% \begin{environment}{titlepage}
% This is \LaTeXe's \classname{article} class version,
% with modifications.
% \changes{4.0c}{1999/11/13}{grid changes with ltxgrid}
% \changes{4.1b}{2008/08/02}{Make the syntax of this package switch optional}%
% \begin{macrocode}
\newenvironment{frontmatter@titlepage}{%
\twocolumn@sw{\onecolumngrid}{\newpage}%
\thispagestyle{titlepage}%
\setcounter{page}\@ne
}{%
\twocolumn@sw{\twocolumngrid}{\newpage}%
\twoside@sw{}{%
\setcounter{page}\@ne
}%
}%
% \end{macrocode}
% \end{environment}
%
% \begin{macro}{\maketitle}
% \changes{4.0d}{1998/01/31}{hookify}
% Put it all together to format the title block.
%
% Gotcha!
% If you expand \cmd\csname undefined\cmd\endcsname, you change the meaning of \cmd\undefined\ from
% ``Undefined'' to \cmd\relax.
% Watchout!
% \begin{macrocode}
\def\frontmatter@maketitle{%
\@author@finish
\title@column\titleblock@produce
\suppressfloats[t]%
% \end{macrocode}
% Now save some memory.
% \begin{macrocode}
\let\and\relax
\let\affiliation\@gobble
\let\author\@gobble
\let\@AAC@list\@empty
\let\@AFF@list\@empty
\let\@AFG@list\@empty
\let\@AF@join\@AF@join@error
\let\email\@gobble
\let\@address\@empty
\let\maketitle\relax
\let\thanks\@gobble
\let\abstract\@undefined\let\endabstract\@undefined
\titlepage@sw{%
\vfil
\clearpage
}{}%
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\maketitle@Hy}
% \changes{4.1c}{2008/08/04}{Hyperref compatibility: take \cs{maketitle} back.}
% We provide the means to take back the definition of \cmd\maketitle\ from \classname{hyperref}:
% we do not need its help in providing hypertext services in the title page.
% \begin{macrocode}
\def\maketitle@Hy{%
\let\Hy@saved@footnotemark\@footnotemark
\let\Hy@saved@footnotetext\@footnotetext
\let\@footnotemark\H@@footnotemark
\let\@footnotetext\H@@footnotetext
\@ifnextchar[%]
\Hy@maketitle@optarg
{%
\HyOrg@maketitle
\Hy@maketitle@end
}%
}%
\appdef\class@documenthook{%
\@ifx{\maketitle\maketitle@Hy}{%
\class@info{Taking \string\maketitle\space back from hyperref}%
\let\maketitle\frontmatter@maketitle
}{%
}%
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\titleblock@produce}
% This procedure produces the title block.
%
% It effectively executes inside a group
% and always returns us to vertical mode.
%
% Note: we assume that it is OK to set the footnote counter to zero at this point.
% Is this a safe assumption?
% \begin{macrocode}
\def\titleblock@produce{%
\begingroup
% \end{macrocode}
% \changes{4.0b}{1999/06/20}{Set \cs{footnote} to \LaTeX\ standard version for this scope.}
% First, we restore the footnote mechanism to its default state,
% then we customize the way the footnote mark is produced and how it is formatted.
% \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
% \begin{macrocode}
\ltx@footnote@pop
% \end{macrocode}
% The following three lines establish an independent footnote counter for use in the title block.
% \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
% \begin{macrocode}
\def\@mpfn{mpfootnote}%
\def\thempfn{\thempfootnote}%
\c@mpfootnote\z@
\let\@makefnmark\frontmatter@makefnmark
\frontmatter@setup
\thispagestyle{titlepage}\label{FirstPage}%
% \end{macrocode}
% Produce the title:
% \begin{macrocode}
\frontmatter@title@produce
% \end{macrocode}
% Produce the author list:
% \begin{macrocode}
\groupauthors@sw{%
\frontmatter@author@produce@group
}{%
\frontmatter@author@produce@script
}%
% \end{macrocode}
% Produce the dates:
% \begin{macrocode}
\frontmatter@RRAPformat{%
\expandafter\produce@RRAP\expandafter{\@date}%
\expandafter\produce@RRAP\expandafter{\@received}%
\expandafter\produce@RRAP\expandafter{\@revised}%
\expandafter\produce@RRAP\expandafter{\@accepted}%
\expandafter\produce@RRAP\expandafter{\@published}%
}%
% \end{macrocode}
% Produce the abstract, PACS, and keywords, and end any paragraph.
% \changes{4.1c}{2008/08/04}{Produce PACS, keywords only if specified}%
% \begin{macrocode}
\frontmatter@abstract@produce
\@ifx@empty\@pacs{}{%
\@pacs@produce\@pacs
}%
\@ifx@empty\@keywords{}{%
\@keywords@produce\@keywords
}%
\par
\frontmatter@finalspace
\endgroup
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@title@produce}
% The default formatting procedure for the article title.
% This procedure should take care of the vertical space below the title.
%
% Clients may override this procedure, but it is more likely that they will
% use the hooks \cmd\frontmatter@title@above, \cmd\frontmatter@title@format, and \cmd\frontmatter@title@below.
% \changes{4.1b}{2008/08/04}{(AO, 443) PDF Bookmark for title page}%
% \begin{macrocode}
\def\toclevel@title{0}%
\def\frontmatter@title@produce{%
\begingroup
\frontmatter@title@above
\frontmatter@title@format
\@title
\unskip
\phantomsection\expandafter\@argswap@val\expandafter{\@title}{\addcontentsline{toc}{title}}%
\@ifx{\@title@aux\@title@aux@cleared}{}{%
\expandafter\frontmatter@footnote\expandafter{\@title@aux}%
}%
\par
\frontmatter@title@below
\endgroup
}%
\appdef\let@mark{\let\\\relax}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@title@above}
% \begin{macro}{\frontmatter@title@format}
% \begin{macro}{\frontmatter@title@below}
% The default values for formatting specifications for the article title.
%
% The procedure \cmd\frontmatter@title@above\ should take care of the vertical space above the title;
% \cmd\frontmatter@title@below\ below.
% The procedure \cmd\frontmatter@title@format\ should invoke any font switches, etc.
% that may apply to the title.
%
% Journals will override this procedure.
% \begin{macrocode}
\def\frontmatter@title@above{}%
\def\frontmatter@title@format{}%
\def\frontmatter@title@below{\addvspace{\baselineskip}}%
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsubsection{Authors and affiliations in superscriptaddress style}
%
% \begin{macro}{\frontmatter@author@produce@script}
% \changes{4.1b}{2008/08/02}{Provide for diagnostics via \cs{frontmatterverbose@sw}}
% \cmd\frontmatter@author@produce@script\ is an alias for \cmd\frontmatter@author@produce,
% the procedure that formats the author/affiliation list.
%
% In this case, the authors affiliations are being superscripted
% (class option \classoption{superscriptaddress}).
%
% This procedure must ensure that any paragraph that it starts gets ended finally.
% \changes{4.1i}{2009/10/18}{(AO, 540) More runtime diagnostics via \cs{frontmatterverbose@sw}}
% \changes{4.1m}{2009/11/20}{(AO, 563) More complete runtime diagnostics via \cs{frontmatterverbose@sw}}
% \begin{macrocode}
\def\frontmatter@author@produce@script{%
\begingroup
\let\@author@present\@author@present@script
\frontmatterverbose@sw{\typeout{\string\frontmatter@author@produce@script:}\say\@AAC@list\say\@AFF@list\say\@AFG@list}{}%
% \end{macrocode}
% \changes{4.0l}{1998/09/01}{Changes to add collaboration processing, which now means doing comma/and processing on each sublist}
% When the author/affiliation list \cmd\@AAC@list\ is executed,
% \cmd\@tempcnt\ counts each author,
% and
% \cmd\@tempa\ stores a list of author indices for the current collaboration.
%
% Note: this procedure uses \cmd\AU@temp\ to hold a list of author counts for each collaboration.
% Note: also uses \cmd\@tempcnta\ to communicate between procedures.
% This usage ot \cmd\@tempcnta\ is OK, because the expansion of \cmd\@AAC@list\ will trigger only the execution of
% our own procedures.
% \begin{macrocode}
\let\AU@temp\@empty
\@tempcnta\z@
% \end{macrocode}
%
% We wish to know how many authors are in each collaboration, for the purposes of \cmd\listcomma\ and \cmd\listand.
%
% Here we assign values for the intercollated operators appearing within \cmd\@AAC@list,
% then execute that macro, registering the authors in each collaboration.
% Afterwards, clean up by emulating an empty collaboration.
%
% The result, stored in \cmd\AU@temp, is a list of brace-delmited tokens, each a number
% representing the number of authors in that collaboration.
% \begin{macrocode}
\let\AF@opr \@gobble
\def\AU@opr{\@author@count\@tempcnta}%
\def\CO@opr{\@collaboration@count\AU@temp\@tempcnta}%
\@AAC@list
\expandafter\CO@opr\@author@cleared
% \end{macrocode}
% Next, present the authors and their affiliations, with the collaborations interleaved.
%
% We assign values for the intercollated operators appearing within \cmd\@AAC@list.
% Next, assign \cmd\@listcomma\ based on the number of authors in the first collaboration.
% Then expand \cmd\@AAC@list.
%
% Upon completion, there will be two space tokens following the last author because of \cmd\listand\ processing;
% remove them, then end the last paragraph.
%
% FIXME: this juncture would be a good time to effectively eliminate
% the unused affiliations in \cmd\@AFF@list.
% \begin{macrocode}
\begingroup
\frontmatter@authorformat
\let\AF@opr \@affilID@def
\let\AU@opr \@author@present
\def\CO@opr{\@collaboration@present\AU@temp}%
\set@listcomma@list\AU@temp
\@AAC@list
\unskip\unskip
\par
\endgroup
% \end{macrocode}
% We now list out the affiliations in the order they appeared.
% \begin{macrocode}
\begingroup
\frontmatter@above@affiliation@script
\let\AFF@opr \@affil@script
\@AFF@list
\frontmatter@footnote@produce
\par
\endgroup
\endgroup
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@author@count}
% This version of \cmd\AU@opr\ counts the number of authors it processes.
% \begin{macrocode}
\def\@author@count#1{%
\advance#1\@ne
\@author@gobble
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@collaboration@present}
% Format a collaboration.
% Note that we immediately end the paragraph thus begun, because we only support
% \classoption{superscriptaddress}-style processing.
%
% Note also that the execution of the production procedures takes place inside of a group;
% for reasons of protective programming.
%
% Bug note: originally, the number of authors in each collaboration was stored in \cmd\@tempa,
% but this exposed us to procedures in our production that modified the meaning of \cmd\@tempa.
%
% The last action done in this procedure is to assign \cmd\@listcomma\ based on the number of authors in the next collaboration.
% \begin{macrocode}
\def\@collaboration@present#1#2#3#4{%
\par
\begingroup
\frontmatter@collaboration@above
\@affilID@def{}%
\@tempcnta\z@
\@author@present{}{(\ignorespaces#3\unskip)}{#4}%
\par
\endgroup
\set@listcomma@list#1%
}%
\def\frontmatter@collaboration@above{}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@collaboration@count}
% Simply register each author in this collaboration.
% Note: \#1 is a \cmd\csname\ to hold the value, \#2 is the \cmd\count\ register holding the count of interest.
% \begin{macrocode}
\def\@collaboration@count#1#2{%
\appdef@eval#1{\the#2}#2\z@
\@author@gobble
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@affilID@def}
%
% The \cmd\@affilID@def\ procedure, an alias of \cmd\AF@opr\ used during \cmd\frontmatter@author@produce@script\ processing,
% memorizes the affiliation in \cmd\@affilID@temp.
% \begin{macrocode}
\def\@affilID@def{\def\@affilID@temp}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@affilID@temp}
%
% The macro \cmd\@affilID@temp\ is used to communicate between
% \cmd\doauthor\ and instances of \cmd\AF@opr\ within the author list.
% \begin{macrocode}
\let\@affilID@temp\@empty
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\affils@present@script}
% An alias of \cmd\AFG@opr, this procedure is applied to elements in \cmd\@AFG@list.
% It builds \cmd\@AFU@list, a list of unique affiliations found within affiliation groups.
%
% \changes{4.1a}{2008/06/16}{removed code that had been commented out}
% \begin{verbatim}
%\def\affils@present@script#1{%
% \get@affil#1{}%
%}%
%\def\get@affil#1{%
% \def\@tempa{#1}%
% \@ifx{\@empty\@tempa}{}{%
% \@booleanfalse\temp@sw
% \def\AF@opr{\x@match\@tempa}%
% \@AFU@list
% \temp@sw{}{%
% \appdef\@AFU@list{\AF@opr{#1}}%
% }%
% \get@affil
% }%
%}%
% \end{verbatim}
% \end{macro}
%
% \begin{macro}{\affil@present@script}
% An alias of \cmd\AF@opr, this procedure is applied to \cmd\@AFU@list\ when formatting the affiliations
% under \classoption{superscriptaddress}.
% It in turn applies \cmd\affil@script\ to \cmd\@AFF@list, thereby formatting the affiliation
% associated with this affiliation index.
%
% Note: it traverses the \cmd\@AFF@list\ for each entry in the \cmd\@AFU@list, thereby making this
% portion of code execute in $N^{2}$ time.
% \changes{4.1a}{2008/06/16}{removed code that had been commented out}
% \begin{verbatim}
%\def\affil@present@script#1{%
% \def\@tempa{#1}%
% \begingroup
% \frontmatter@affiliationfont
% \let\AFF@opr \affil@script
% \@AFF@list
% \endgroup
%}%
% \end{verbatim}
% \end{macro}
%
% \begin{macro}{\affil@script}
% Alias of \cmd\AFF@opr, this procedure is applied to \cmd\@AFF@list\ when formatting the affiliations
% under \classoption{superscriptaddress}.
% It rejects all entries not matching the affiliation index held in \cmd\@tempa.
% \begin{macrocode}
\def\affil@script#1#2#3{%
\def\@tempifx{#1}\@ifx{\@tempifx\@tempa}{%
\@if@empty{#2}{}{%
\par
\begingroup
\def\@thefnmark{#1}\@makefnmark\ignorespaces
#2%
\@if@empty{#3}{}{\frontmatter@footnote{#3}}%
\par
\endgroup
}%
}{}%
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@affil@script}
% Alias of \cmd\AFF@opr:
% The affiliations are being formatted in the case
% where affiliations are being superscripted:
% make a list out of the affiliations with the numbers printed.
% Society-specific code can change the formatting
% by overriding the definition of \cmd\frontmatter@affiliationfont.
%
% A client may choose to set \cmd\affil@cutoff\ to either \cmd\@ne\ (the default)
% or \cmd\tw@. The latter setting will enforce a rule to the effect that
% if a single affiliation appears on the title page,
% then no affiliation superscript at all is produced.
%
% |#1|---Affiliation ID: a number; zero signifies a \cmd\noaffiliation.
%
% |#2|---Collaboration ID
%
% |#3|---Affiliation address
%
% |#4|---Auxiliary info
% \begin{macrocode}
\def\@affil@script#1#2#3#4{%
% \end{macrocode}
% If the affiliation is the \cmd\noaffiliation, then we do nothing.
% \begin{macrocode}
\@ifnum{#1=\z@}{}{%
\par
\begingroup
\frontmatter@affiliationfont
\@ifnum{\c@affil<\affil@cutoff}{}{%
\def\@thefnmark{#1}\@makefnmark
}%
\ignorespaces#3%
\@if@empty{#4}{}{\frontmatter@footnote{#4}}%
\par
\endgroup
}%
}%
\let\affil@cutoff\@ne
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@author@present@script}
% \changes{4.0h}{1998/06/25}{Changes to support groups of affiliations}
% \changes{4.1n}{2009/11/30}{(AO, 567) Handle \cs{noaffiliation} case}
% This version of \cmd\AU@opr\ applies to the \classoption{superscriptaddress} class option.
% Need to add commas between groups
% of address numbers, which are passed in the macro \cmd\@affilID@temp\ in the form
% |{3}{4}{7}| if this set of authors is related to addresses, 3, 4 and 7.
% \begin{macrocode}
\def\@author@present@script#1#2#3{%
\begingroup
\gdef\comma@space{\textsuperscript{,\,}}%
\doauthor{#2}{#3}{\@affil@present@script}%
\endgroup
\advance\@tempcnta\m@ne
}%
\def\@affilcomma#1#2{%
\@ifx{\z@#1}{%
\@ifx{\relax#2}{}{%
\@affilcomma{#2}%
}%
}{%
#1%
\@ifx{\relax#2}{}{%
\@ifx{\z@#2}{%
\@affilcomma
}{%
,\,\@affilcomma{#2}%
}%
}%
}%
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@affil@present@script}
% \begin{macro}{\@affil@present@script@}
% \changes{4.1n}{2009/11/30}{(AO, 567) Handle punctuation for \classoption{superscriptaddress} style authors' extra information, such as \cs{email}}
% The \cmd\@affil@present@script\ procedure presents the reference to the affiliations in the case of superscript addresses.
%
% The affiliations are presented to \cmd\@affil@present@script@ as a list of brace-delimited tokens, each containing the affiliation ID (a number).
% The list is terminated by the token \cmd\relax.
% The macro recurses (via tail recursion) until the terminating token is encountered.
% Note that an affiliation ID of zero signifies a \cmd\noaffiliation:
% references to the \cmd\noaffiliation\ are passed over.
%
% Upon termination, the affiliations, if any, are produced via \cmd\textsuperscript\ and the appropriate boolean is queued via \cmd\aftergroup.
% The boolean signifies that a non-trivial affiliation was produced, so that the proper punctuation can be produced.
% The group in question is that opened and closed by the \cmd\doauthor\ procedure.
%
% This procedure uses \cmd\@tempa\ as a scratch register.
% \begin{macrocode}
\def\@affil@present@script{%
\let\@tempa\@empty
\expandafter\@affil@present@script@\@affilID@temp\relax
}%
\def\@affil@present@script@#1{%
\@ifx{\relax#1}{%
\@ifx{\@tempa\@empty}{%
\aftergroup\false@sw
}{%
\textsuperscript{\expandafter\@affilcomma\@tempa\relax\relax}%
\aftergroup\true@sw
}%
}{%
\@ifnum{#1=\z@}{}{\appdef\@tempa{{#1}}}%
\@affil@present@script@
}%
}%
\@provide\@author@parskip{\z@skip}%
% \end{macrocode}
% \end{macro}
% \end{macro}
%
%
% \subsubsection{Authors and affiliations in groupedaddress style}
%
% \begin{macro}{\frontmatter@author@produce@group}
% \changes{4.1b}{2008/08/02}{Provide for diagnostics via \cs{frontmatterverbose@sw}}
% Alias for \cmd\frontmatter@author@produce when \classoption{groupedaddress} is in effect,
% the procedure that formats the author/affiliation list.
%
% In this case, the authors are being grouped above their shared addresses.
% How it works: the \cmd\@AFG@list, a list of all unique affiliation groups, is expanded.
% For each such group, all authors belonging to that group are formatted above the affiliation group.
% Collaborations are silently passed over.
%
% This procedure must ensure that any paragraph that it starts gets ended finally.
% \changes{4.1i}{2009/10/18}{(AO, 540) More runtime diagnostics via \cs{frontmatterverbose@sw}}
% \changes{4.1m}{2009/11/20}{(AO, 563) More complete runtime diagnostics via \cs{frontmatterverbose@sw}}
% \begin{macrocode}
\def\frontmatter@author@produce@group{%
\begingroup
\let\@author@present\@author@present@group
\frontmatter@authorformat
\frontmatterverbose@sw{\typeout{\string\frontmatter@author@produce@group:}\say\@AAC@list\say\@AFF@list\say\@AFG@list}{}%
\let\AU@temp\@empty
\set@listcomma@list\AU@temp
\def\CO@opr{\@collaboration@present\AU@temp}%
\let\AFG@opr \affils@present@group
\let\@listcomma\relax
\@AFG@list
\frontmatter@footnote@produce
\par
\endgroup
\frontmatter@authorbelow
}%
\@provide\frontmatter@authorbelow{}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\affils@present@group}
% \changes{4.1b}{2008/08/02}{Provide for diagnostics via \cs{frontmatterverbose@sw}}
% Alias of \cmd\AFG@opr, this procedure is used on every element of
% \cmd\@AFG@list, the list of unique affiliation groups,
% when formatting the author/affiliation block:
% It presents all authors sharing this affiliation group.
%
% This procedure is called via the procedure
% \cmd\frontmatter@author@produce@group, an alias for \cmd\frontmatter@author@produce,
%
% Its use pertains to the class options
% \classoption{groupedaddress}, \classoption{unsortedaddress}, and \classoption{runinaddress}
% (that is, \cmd\groupauthors@sw\ is true).
%
% For each invocation, the entire \cmd\@AAC@list\ is run through (twice),
% making this process execute in $N^{2}$ time. (Is this really true?)
% \begin{macrocode}
\def\affils@present@group#1{%
% \end{macrocode}
% Count (using \cmd\@tempcnta) the authors in the author list whose affiliation group
% matches the argument |#1|.
%
% Note that \cmd\AF@temp\ is used as a storage register for the argument
% of the procedure, for purposes of comparison using \cmd\ifx.
%
% Note: here we use \cmd\@tempcnta\ to accumulate the number of authors in the current affiliation set.
%
% QUERY: do the value of \cmd\AF@temp\ and \cmd\AF@opr\ need to persist?
%
% QUERY: what value does \cmd\AU@opr\ have at this point?
% ANSWER: the \cmd\@affilID@count\ and \cmd\@affilID@match\ procedures
% assign meanings to \cmd\AU@opr\ and \cmd\CO@opr\ dynamically.
% We initialize the two operators to \cmd\@undefined\ so as to catch the
% pathological cases.
% \begin{macrocode}
\begingroup
\def\AF@temp{#1}%
\@tempcnta\z@
\let\AU@opr \@undefined
\let\CO@opr \@undefined
\def\AF@opr{\@affilID@count\AF@temp\@tempcnta}%
\@AAC@list
% \end{macrocode}
%
% If there are no authors using this affiliation group, skip it.
% \begin{macrocode}
\@ifnum{\@tempcnta=\z@}{}{%
% \end{macrocode}
%
% DPC: If we have a list of length two, need to locally zap a comma.
% \begin{macrocode}
\begingroup
\frontmatter@above@affilgroup
\set@listcomma@count\@tempcnta
% \end{macrocode}
% Run through the author list, presenting (with \cmd\@author@present)
% those authors whose affiliation matched the given one.
% \begin{macrocode}
\let\AU@opr \@undefined
\let\CO@opr \@undefined
\def\AF@opr{\@affilID@match\AF@temp}%
\@AAC@list
\endgroup
% \end{macrocode}
% Now that the authors have all been presented, present the affiliations, grouped.
%
% Note: \cmd\@tempcnta\ is the number of affiliations for this set of authors.
% \begin{macrocode}
\begingroup
\par
\frontmatter@above@affiliation
\frontmatter@affiliationfont
\let\\\frontmatter@addressnewline
\@tempcnta\z@
\@tfor\AF@temp:=#1\do{%
\expandafter\@ifx\expandafter{\expandafter\z@\AF@temp}{}{%
\advance\@tempcnta\@ne
}%
}%
\@ifnum{\@tempcnta=\tw@}{%
\let\@listcomma\relax
}{}%
\def@after@address
\runinaddress@sw{%
}{%
\tightenlines@sw{}{%
% \end{macrocode}
% The following line determines the space between affilations in grouped mode
% \begin{macrocode}
\parskip\z@
}%
\appdef\after@address\par
}%
\let\AFF@opr \@affil@group
\do@affil@fromgroup\@AFF@list#1\relax
\endgroup
% \end{macrocode}
% End of branch handling authors.
% \begin{macrocode}
}%
% \end{macrocode}
%
% \begin{macrocode}
\par
\endgroup
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\def@after@address}
% \begin{macro}{\def@after@address@empty}
% \changes{4.1c}{2008/08/04}{Parametrize the production after the address}%
%
% Each of these procedures assigns a meaning to \cmd\after@address, the first
% a useful default, the second a nil.
% A society or journal substyle may define it according to its own requirements.
% \begin{macrocode}
\def\def@after@address{\def\after@address{\@listcomma\ \@listand}}%
\def\def@after@address@empty{\let\after@address\@empty}%
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\@affilID@count}
% \begin{macro}{\@affilID@match}
%
% The control sequence name \cmd\AF@opr\ is placed in the
% author/affiliation list (\cmd\@AAC@list) for each (new) affiliation, with that affiliation as its argument.
%
% The control sequence name \cmd\AF@opr\ is an alias of a procedure
% to count the number of authors at a given affiliation (\cmd\@affilID@count)
% or to present the given authors (\cmd\@affilID@match).
% These two procedures are executed when formatting under the \classoption{groupedaddress} class option.
% \begin{macrocode}
\def\@affilID@count#1#2#3{%
\def\@tempifx{#3}%
\@ifx{\@tempifx#1}{%
\def\AU@opr{\@author@count#2}%
}{%
\let\AU@opr \@author@gobble
}%
\let\CO@opr \@collaboration@gobble
}%
\def\@affilID@match#1#2{%
\def\@tempifx{#2}%
\@ifx{\@tempifx#1}{%
\let\AU@opr \@author@present
}{%
\let\AU@opr \@author@gobble
}%
\let\CO@opr \@collaboration@gobble
}%
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\do@affil@fromgroup}
% Executes iteratively:
% selects the next address ID to print,
% and then re-execute the list of addresses to print the text of that address.
%
% Note: an argument of \cmd\relax\ breaks out of this iteration,
% while an argument of \cmd\z@\ (\cmd\noaffiliation) is a no-op.
%
% Note: we have created an $N^{2}$ computing process.
% FIXME: can use hashing instead, you know.
% \begin{macrocode}
\def\do@affil@fromgroup#1#2{%
\@ifx{\relax#2}{}{%
\count@#2\relax
\@ifnum{\z@=\count@}{}{#1}%
\do@affil@fromgroup#1%
}%
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@affil@group}
% The alias of \cmd\AFF@opr\ when the list \cmd\@AFF@list\
% is executed by \cmd\do@affil@fromgroup\ (\classoption{groupedaddress}):
% Print the address if its number matches \cmd\count@\ (value set by \cmd\do@affil@fromgroup).
%
% Note that we detect a \cmd\noaffiliation\ here by the affiliation address being
% the same as the expansion of \cmd\blankaffiliation.
%
% \changes{4.1d}{2008/10/17}{(AO, 410) compare \cs{@tempa} to \cs{blankaffiliation}.}%
%
% I made a mistake when coding the comparison to \cmd\blankaffiliation:
% it originally read \cmd\@ifx\{\#3\cmd\blankaffiliation\}.
% This is obviously wrong once you think twice.
% \begin{macrocode}
\def\@affil@group#1#2#3#4{%
\@ifnum{#1=\count@}{%
\def\@tempa{#3}%
\@ifx{\@tempa\blankaffiliation}{}{%
#3%
\@if@empty{#4}{}{%
\frontmatter@footnote{#4}%
}%
\after@address
}%
\advance\@tempcnta\m@ne
}{}%
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@author@present@group}
% \begin{macro}{\@affil@present@group}
% \changes{4.0d}{1998/01/31}{\cs{comma@space}}
% This version of \cmd\AU@opr\ applies to the \classoption{groupedaddress} class option and its ilk.
% Traverse the list calling the \cmd\doauthor\ hook on each author.
%
% The third argument of \cmd\doauthor\ fulfills the requirement that it
% queue up a boolean via \cmd\aftergroup.
% \begin{macrocode}
\def\@author@present@group#1#2#3{%
\gdef\comma@space{\gdef\comma@space{\textsuperscript{,\,}}}%
\doauthor{#2}{#3}{\@affil@present@group}%
\advance\@tempcnta\m@ne
}%
\def\@affil@present@group{%
\aftergroup\false@sw
}%
% \end{macrocode}
% \end{macro}
% \end{macro}
%
%
% \begin{macro}{\@pacs@produce}
% PACS, keywords and dates.
% \changes{4.0d}{1998/01/31}{PACS boxed to width of abstract}
% \changes{4.0b}{1999/06/20}{Separate option now controls production}
% \changes{4.0e}{2000/09/20}{Warn if no production}
% \begin{macrocode}
\def\@pacs@produce#1{%
\showPACS@sw{%
\begingroup
\frontmatter@PACS@format
\@pacs@name#1\par
\endgroup
}{%
\@if@empty{#1}{}{%
\class@warn{\PACS@warn}%
}%
}%
}%
\def\PACS@warn{If you want your PACS to appear in your output, use document class option showpacs}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@keywords@produce}
% \changes{4.0e}{2000/09/20}{Keywords on same footing as PACS}
% \begin{macrocode}
\def\@keywords@produce#1{%
\showKEYS@sw{%
\begingroup
\frontmatter@keys@format
\@keys@name#1\par
\endgroup
}{%
\@if@empty{#1}{}{%
\class@warn{If you want your keywords to appear in your output, use document class option showkeys}%
}%
}%
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@footnote@produce@footnote}
% \begin{macro}{\frontmatter@footnote@produce@endnote}
% Produce any footnotes to appear at the bottom of the title page.
%
% If frontmatter footnotes have been redirected to the bibliography, this will be a no-op.
% ref.: \cmd\present@bibnote.
% \begin{macrocode}
\def\frontmatter@footnote@produce@footnote{%
\let\@TBN@opr\present@FM@footnote
\@FMN@list
\global\let\@FMN@list\@empty
}%
% \end{macrocode}
% \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
% \begin{macrocode}
\def\present@FM@footnote#1#2{%
\begingroup
\csname c@\@mpfn\endcsname#1\relax
\def\@thefnmark{\frontmatter@thefootnote}%
\frontmatter@footnotetext{#2}%
\endgroup
}%
\def\frontmatter@footnote@produce@endnote{%
}%
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \section{Package defaults}
%
% \begin{macro}{\title@column}
% \begin{macro}{\preprintsty@sw}
% \begin{macro}{\collaboration@sw}
% \begin{macro}{\frontmatter@footnote@produce}
% \begin{macro}{\do@output@MVL}
% \begin{macro}{\comma@space}
% We give meanings to the Booleans and other macros that a client document class would
% set on our behalf.
% \begin{macrocode}
\appdef\frontmatter@init{%
\@ifxundefined\title@column {\let\title@column\@empty}{}%
\@ifxundefined\preprintsty@sw {\@booleanfalse\preprintsty@sw}{}%
\@ifxundefined\frontmatter@footnote@produce{\let\frontmatter@footnote@produce\frontmatter@footnote@produce@footnote}{}%
\@ifxundefined\do@output@MVL {\let\do@output@MVL\@firstofone}{}%
\@ifxundefined\comma@space {\let\comma@space\@empty}{}%
}%
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\frontmatter@thefootnote}
% \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
% In the title block, the footnote symbol (used for alternate affiliation and sundry)
% is a \cmd\@fnsymbol\ or a lowercase letter, as selected by a boolean.
% The society or journal may override this definition.
% \begin{macrocode}
\def\frontmatter@thefootnote{%
\altaffilletter@sw{\@alph}{\@fnsymbol}{\csname c@\@mpfn\endcsname}%
}%
\@ifx{\altaffilletter@sw\@undefined}{\@booleantrue\altaffilletter@sw}{}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@makefnmark}
% The default procedure for setting the footnote mark within the frontmatter.
% A client may override this procedure.
% \begin{macrocode}
\def\frontmatter@makefnmark{%
\@textsuperscript{%
\normalfont\@thefnmark
}%
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@makefntext}
% This procedure is used when setting footnotes within the title block.
%
% Note that we are \classname{hyperref} friendly: we invoke \cmd\Hy@raisedlink\
% so that this footnote becomes a hypertext anchor. If \classname{hyperref} is
% not loaded, then \classname{ltxutil} has our act covered via some stubs.
%
% \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
% \begin{macrocode}
\long\def\frontmatter@makefntext#1{%
\parindent 1em
\noindent
\Hy@raisedlink{\hyper@anchorstart{frontmatter.\expandafter\the\csname c@\@mpfn\endcsname}\hyper@anchorend}%
\@makefnmark
#1%
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@setup}
% The default type specification for the title page.
% Clients will override this definition.
% \begin{macrocode}
\def\frontmatter@setup{}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@RRAPformat}
% \begin{macro}{\punct@RRAP}
% \begin{macro}{\produce@RRAP}
% The procedure \cmd\frontmatter@RRAPformat\ is the formatting procedure
% for the ``Received, Revised, etc.'' block on the title page.
% The macro \cmd\punct@RRAP\ produces the punctuation between the entries.
% Clients will override these two definitions.
%
% The procedure \cmd\produce@RRAP\ is fairly general, and should be used by most
% journal substyles.
%
% The procedure \cmd\frontmatter@RRAP@format\ will be overridden by the journal.
% \begin{macrocode}
\def\frontmatter@RRAPformat#1{%
\removelastskip
\begingroup
\frontmatter@RRAP@format
#1\par
\endgroup
}%
\def\punct@RRAP{; }%
\def\produce@RRAP#1{%
\@if@empty{#1}{}{%
\@ifvmode{\leavevmode}{\unskip\punct@RRAP\ignorespaces}%
#1%
}%
}%
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\frontmatter@authorformat}
% The default type specification for the author list.
% Clients will override this definition.
% For one alternative, see the \classname{revtex4} document class.
% \begin{macrocode}
\def\frontmatter@authorformat{}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@above@affilgroup}
% The default amount of space above an affiliation group
% (in a \cmd\affils@present@group\ production).
% Clients will override this definition.
% \begin{macrocode}
\def\frontmatter@above@affilgroup{}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@above@affiliation}
% \begin{macro}{\frontmatter@above@affiliation@script}
% The \cmd\frontmatter@above@affiliation\ is the amount of space above affiliations in the \classoption{groupedaddress}
% style, and \cmd\frontmatter@above@affiliation@script\ is that for \classoption{superscriptaddress}.
% Clients will override this definition.
% For one alternative, see the \classname{revtex4} document class.
% \begin{macrocode}
\def\frontmatter@above@affiliation{}%
\def\frontmatter@above@affiliation@script{}%
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\frontmatter@affiliationfont}
% The default type specification for the affiliation.
% Clients will override this definition.
% For one alternative, see the \classname{revtex4} document class, where
% several alternative definitions are made.
% \begin{macrocode}
\def\frontmatter@affiliationfont{\itshape\selectfont}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@RRAP@format}
% The default type specification for the dates.
% Clients will override this definition.
% \begin{macrocode}
\def\frontmatter@RRAP@format{}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@PACS@format}
% Specify the formatting of the title page PACS statement.
%
% Journals will override.
% \begin{macrocode}
\def\frontmatter@PACS@format{}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@keys@format}
% Specify the formatting of the title page keywords statement.
%
% Journals will override.
% \begin{macrocode}
\def\frontmatter@keys@format{}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@finalspace}
%
% \begin{macrocode}
\def\frontmatter@finalspace{\addvspace{18\p@}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@addressnewline}
% \changes{4.0h}{1998/06/25}{new hook}
% The definition of \cmd\\\ for address handling. Default puts all the `lines'
% on a run-in line, separated by comma and space.
% DPC: was \newline space between lines of addresss.
% \begin{macrocode}
\def\frontmatter@addressnewline{%
\@ifhmode{\skip@\lastskip\unskip\unpenalty\break\hskip\skip@}{}%
% was: \vskip-.5ex
}%
% \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\frontmatter@preabstractspace}
% \begin{macro}{\frontmatter@postabstractspace}
% Space above and space below abstract in title block
% \begin{macrocode}
\def\frontmatter@preabstractspace{5.5\p@}
\def\frontmatter@postabstractspace{6.5\p@}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\aftermaketitle@chk}
% Error-checking code.
% \begin{macrocode}
\def\aftermaketitle@chk#1{%
\@ifx{\maketitle\relax}{%
\class@err{\protect#1 must be used before \protect\maketitle}%
}{}%
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ps@titlepage}
% Default page style for title page.
% Journals will override this procedure.
% \begin{macrocode}
\def\ps@titlepage{\ps@empty}%
% \end{macrocode}
% \end{macro}
%
%FIXME: there is a limitation to the default meaning of
% \cmd\@startpage: the label ``FirstPage'' is only
% defined if the document has a \cmd\maketitle\ command.
%
% \begin{macrocode}
\def\volumeyear#1{\gdef\@volumeyear{#1}}%
\def\@volumeyear{}%
\def\volumenumber#1{\gdef\@volumenumber{#1}}%
\def\@volumenumber{}%
\def\issuenumber#1{\gdef\@issuenumber{#1}}%
\def\@issuenumber{}%
\def\eid#1{\gdef\@eid{#1}}%
\def\@eid{}%
%
\def\startpage#1{\gdef\@startpage{#1}\c@page#1\relax}%
\def\@startpage{\pageref{FirstPage}}%
\def\endpage#1{\gdef\@endpage{#1}}%
\def\@endpage{\pageref{LastPage}}%
% \end{macrocode}
%
%
% \subsection{Printing out the ``list-of'' elements}%
%
% FIXME: The \cmd\appendix@toc\ procedure should change the meaning
% of \cmd\l@section\ so that the \cmd\section s can be appropriately formatted,
% reflecting their status as appendices.
%
% \begin{macrocode}
\def\print@toc#1{%
\begingroup
\expandafter\section
\expandafter*%
\expandafter{%
\csname#1name\endcsname
}%
\let\appendix\appendix@toc
\@starttoc{#1}%
\endgroup
}%
\def\appendix@toc{}%
% \end{macrocode}
%
% \begin{macro}{\Dated@name}
% \begin{macro}{\Received@name}
% \begin{macro}{\Revised@name}
% \begin{macro}{\Accepted@name}
% \begin{macro}{\Published@name}
% These strings are used in the \cmd\date, et al. commands.
% \begin{macrocode}
\def\Dated@name{Dated }%
\def\Received@name{Received }%
\def\Revised@name{Revised }%
\def\Accepted@name{Accepted }%
\def\Published@name{Published }%
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \changes{4.1g}{2009/10/05}{(AO, 539) Robustify \cs{class@warn} against TOC processing}%
% Two commands require robustifying against harsh treatment when TOC entries are written out.
% Note that \cmd\class@warn\ is not user-level markup, but crops up when
% the \cmd\title\ command is missing from the document.
% \begin{macrocode}
\appdef\robustify@contents{%
\let\thanks\@gobble\let\class@warn\@gobble
\def\begin{\string\begin}\def\end{\string\end}%
}%
% \end{macrocode}
%
% \subsection{Syntax switch}%
% \changes{4.1b}{2008/08/02}{Make the syntax of this package switch optional}%
%
% Shall we take over the syntax of \LaTeX?
% By default, Yes, unless the Boolean below has already been defined.
% In the package version, this is controlled by an option;
% in the kernel version, the Boolean remains undefined.
%
% \cmd\maketitle\ presents a complication. If this code will execute under
% \classname{ltxgrid}, then its version of the procedure will do fine.
%
% As a package, under \classname{article}, things are different.
% In this case, what should be done depends upon \cmd\if@titlepage.
% If true, then just execute \cmd\maketitle\ as it stands.
% If false, then the \classname{article} class has defined its wrapper
% procedure, and we should take over the meaning of \cmd\@maketitle\ instead.
%
% Here is a list of the commands defined by this package that potentially override
% those of standard \LaTeX:
% \cmd\frontmatter@title,
% \cmd\frontmatter@author,
% \cmd\frontmatter@and,
% \cmd\frontmatter@thanks,
% \cmd\frontmatter@date,
% \env{frontmatter@abstract},
% \env{frontmatter@titlepage},
% \cmd\frontmatter@maketitle.
%
% The following code will perform that override, given the appropriate state of the Boolean.
% \begin{macrocode}
\@ifxundefined\frontmatter@syntax@sw{\@booleantrue\frontmatter@syntax@sw}{}%
\frontmatter@syntax@sw{%
\let\title \frontmatter@title
\let\author \frontmatter@author
\let\date \frontmatter@date
\@ifxundefined\@maketitle{%
\let\maketitle \frontmatter@maketitle
\@booleantrue \titlepage@sw
}{%
\let\@maketitle \frontmatter@maketitle
\prepdef\maketitle\@author@finish
}%
\let\noaffiliation \frontmatter@noaffiliation
\let\thanks@latex \thanks
\let\thanks \frontmatter@thanks
\let\and@latex \and
\let\and \frontmatter@and
\let@environment{titlepage}{frontmatter@titlepage}%
\let@environment{abstract}{frontmatter@abstract}%
}{%
\let\noaffiliation\@empty
}%
% \end{macrocode}
%
% \subsection{End of the \file{ltxfront} kernel}
% The kernel portion of the \classname{ltxfront} package is complete.
% \begin{macrocode}
%
% \end{macrocode}
%
% \subsection{Remainder of the \classname{ltxfront} package}
%
% Include any code here that ought to be incorporated into the package,
% but should not be part of the kernel.
%
% \begin{macrocode}
%<*package>
% \end{macrocode}
%
% \begin{macrocode}
% \end{macrocode}
% Define formatting as like as possible to the article class.
% Comands that prepare for \cmd\maketitle: \cmd\author, \cmd\title, \cmd\date.
%
% Argument of the above three may contain \cmd\\ and \cmd\thanks; argument of \cmd\author may contain \cmd\and.
% The \cmd\\ may still work fine; \cmd\and\ will be ignored (warning);
% \cmd\thanks\ even though it should not reside in the argument, will work.
%
% An explicit \cmd\footnote should be treated as if it were \cmd\thanks.
%
% \begin{verbatim}
% \@maketitle: \frontmatter@footnote@produce
% \end{verbatim}
% \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
%
% \begin{macrocode}
\def\thanks@latex#1{%
\footnotemark
\expandafter\expandafter
\expandafter\gappdef
\expandafter\expandafter
\expandafter\@thanks
\expandafter\expandafter
\expandafter{%
\expandafter\expandafter
\expandafter\footnotetext
\expandafter\expandafter
\expandafter[%
\expandafter\the\csname c@\@mpfn\endcsname]{#1}}%
}%
\@booleanfalse\altaffilletter@sw
\@if@sw\if@titlepage\fi{\@booleantrue}{\@booleanfalse}\titlepage@sw
\def\frontmatter@title@above{\newpage\null\vskip2em\relax}%
\def\frontmatter@title@format{\centering\LARGE\let\thanks\thanks@latex}%
\def\frontmatter@title@below{\vskip1.5em\relax}%
\def\frontmatter@authorformat{\centering\large\advance\baselineskip\p@\parskip11.5\p@\let\thanks\thanks@latex\let\and\and@space}%
\def\frontmatter@authorbelow{\vskip 1em\relax}%
\def\frontmatter@above@affiliation{}%
\def\frontmatter@above@affiliation@script{}%
\def\frontmatter@affiliationfont{\centering\itshape}%
\def\frontmatter@RRAP@format{\centering\large}%
\def\frontmatter@preabstractspace{1.5em}%
% \end{macrocode}
% \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
% \begin{macrocode}
\long\def\frontmatter@footnotetext{%
\expandafter\expandafter
\expandafter\footnotetext
\expandafter\expandafter
\expandafter[%
\expandafter\the\csname c@\@mpfn\endcsname]%
}%
\def\and@space{\\}%
\def\andname{and}%
% \end{macrocode}
% Implement the feature of the article class whereby there is a default \cmd\@date, left over
% from the \LaTeX\ kernel.
% This package does not have a default date. The user must put in an explicit command, like
% \cmd\date\arg{\cmd\today}, which will retore \LaTeX's default behavior.
%
% What if the abstract environment falls after the \cmd\maketitle\ command?
% The environment will be undefined; the user will have to deal with this.
% \begin{macrocode}
% \end{macrocode}
% End of the package.
% \begin{macrocode}
%
% \end{macrocode}
%
% \Finale
% %Here ends the programmer's documentation.
% \endinput
%
\endinput
%%EOF