summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/revtex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-10-18 23:59:04 +0000
committerKarl Berry <karl@freefriends.org>2009-10-18 23:59:04 +0000
commitf178d106a65d06929870917eddad8bdaa1ece706 (patch)
tree96b5a0f4386871521fd5af1663ca3aeabe75cef0 /Master/texmf-dist/source/latex/revtex
parentfc11e3250e9d42d71502608d6b7e24b649e6d547 (diff)
revtex 4.1 (14oct09)
git-svn-id: svn://tug.org/texlive/trunk@15832 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/revtex')
-rw-r--r--Master/texmf-dist/source/latex/revtex/aip.dtx2041
-rw-r--r--Master/texmf-dist/source/latex/revtex/ltxdocext.dtx440
-rw-r--r--Master/texmf-dist/source/latex/revtex/ltxfront.dtx3599
-rw-r--r--Master/texmf-dist/source/latex/revtex/ltxgrid.dtx2814
-rw-r--r--Master/texmf-dist/source/latex/revtex/ltxutil.dtx1404
-rw-r--r--Master/texmf-dist/source/latex/revtex/revtex4-1.dtx (renamed from Master/texmf-dist/source/latex/revtex/revtex4.dtx)7664
-rw-r--r--Master/texmf-dist/source/latex/revtex/revtex4.ins36
-rw-r--r--Master/texmf-dist/source/latex/revtex/textcase.dtx404
8 files changed, 12473 insertions, 5929 deletions
diff --git a/Master/texmf-dist/source/latex/revtex/aip.dtx b/Master/texmf-dist/source/latex/revtex/aip.dtx
new file mode 100644
index 00000000000..1059874638d
--- /dev/null
+++ b/Master/texmf-dist/source/latex/revtex/aip.dtx
@@ -0,0 +1,2041 @@
+% \iffalse meta-comment
+% aip.dtx: package to change page grid, MVL.
+% Copyright (c) 2008 American Institute of Physics
+% mailto:tex@aip.org
+%
+% 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.3 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 aip.dtx
+% and the derived files
+% aip.rtx, aip.pdf, aip.ins, aip.drv.
+% Distribution:
+% CTAN:macros/latex/contrib/aip/
+%
+% Unpacking:
+% tex aip.dtx
+%
+% Documentation:
+% latex aip.dtx; ...
+%
+% Programm calls to get the documentation (example):
+% pdflatex aip.dtx
+% makeindex -s gind.ist aip
+% makeindex -s gglo.ist -o aip.gls aip.glo
+% pdflatex aip.dtx
+% makeindex -s gind.ist aip
+% pdflatex aip.dtx
+%
+% Installation:
+% TDS:bibtex/bst/aip/
+% TDS:doc/latex/aip/
+% TDS:source/latex/aip/
+% TDS:tex/latex/aip/
+%
+% 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
+%</ignore>
+%<*install>
+%% This file will generate documentation and runtime files
+%% from aip.dtx when run through LaTeX or TeX.
+%% This file requires docstrip version 2.4 or higher available from
+%% ftp://ctan.tug.org/tex-archive/macros/latex/unpacked/docstrip.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.
+
+Copyright (c) 2008 American Institute of Physics.
+mailto:tex@aip.org
+
+Maintained by Arthur Ogawa (mailto:arthur_ogawa at sbcglobal.net)
+under contract to American Institute of Physics.
+
+License
+ You may distribute this file under the conditions of the
+ LaTeX Project Public License 1.3 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}
+% \file{aip.ins}{\from{aip.dtx}{install}}%
+% \file{aip.drv}{\from{aip.dtx}{driver}}%
+% \usedir{tex/latex/aip}%
+ \file{aip4-1.rtx}{\from{aip.dtx}{package}}%
+ }%
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation, please move}
+\Msg{* aip.rtx}
+\Msg{* into a directory searched by TeX;}
+\Msg{* in a TDS-compliant installation:}
+\Msg{* texmf/tex/macros/latex/aip/.}
+\Msg{*}
+\Msg{* To produce the documentation,
+ run aip.dtx through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+% \fi
+%
+% \GetFileInfo{aip.dtx}\CheckSum{1163}
+%
+% \iffalse ltxdoc klootch
+%<*package>
+%%% @LaTeX-file{
+%%% filename = "aip.dtx",
+%%% version = "4.1h",
+%%% date = "2009/10/09",
+%%% time = "11:23:00 GMT+8",
+%%% checksum = "1163",
+%%% author = "Arthur Ogawa (mailto:arthur_ogawa at sbcglobal.net),
+%%% commissioned by the American Institute of Physics.
+%%% ",
+%%% copyright = "Copyright (C) 2008 American Institute of Physics,
+%%% distributed under the terms of the
+%%% LaTeX Project Public License, see
+%%% ftp://ctan.tug.org/macros/latex/base/lppl.txt
+%%% ",
+%%% address = "AIP Journal Program
+%%% American Institute of Physics,
+%%% Suite 1NO1, 2 Huntington Quadrangle,
+%%% Melville, NY 11747 USA",
+%%% telephone = "",
+%%% FAX = "",
+%%% email = "mailto colon tex at aip.org",
+%%% codetable = "ISO/ASCII",
+%%% keywords = "latex, page grid, main vertical list",
+%%% supported = "yes",
+%%% abstract = "aip substyle for REVTeX",
+%%% docstring = "The checksum field above generated by ltxdoc",
+%%% }
+%</package>
+% \fi
+%
+% \iffalse ltxdoc klootch
+% The following references the \file{README} 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}" to locate it.
+% \fi\input{README}%
+%
+% \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}
+%aip.dtx
+%\end{verbatim}
+%
+% \subsubsection{Generated by \texttt{latex aip.dtx}}%
+% Typesetting the source file under \LaTeX\
+% generates the readme and the installer.
+%\begin{verbatim}
+%README aip.ins
+%\end{verbatim}
+%
+% \subsubsection{Generated by \texttt{tex aip.dtx}}%
+% Typesetting the installer generates
+% the package files.
+%\begin{verbatim}
+%aip.rtx
+%\end{verbatim}
+%
+% \subsubsection{Documentation}%
+% The following are the online documentation:
+% \begin{verbatim}
+%aip.pdf
+% \end{verbatim}
+%
+% \subsubsection{Auxiliary}%
+% The following are auxiliary files generated
+% in the course of running \LaTeX:
+% \begin{verbatim}
+%aip.aux aip.idx aip.ind aip.log aip.toc
+% \end{verbatim}
+%
+% \section{Code common to all modules}%
+%
+% The following may look a bit klootchy, but 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}
+%<*driver|package>
+\NeedsTeXFormat{LaTeX2e}[1996/12/01]%
+%</driver|package>
+% \end{macrocode}
+% As desired, the following modules all
+% take common version information:
+% \begin{macrocode}
+%<package>\ProvidesFile{aip4-1.rtx}%
+%<*driver>
+\expandafter\ProvidesFile\expandafter{\jobname.dtx}%
+%</driver>
+% \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}
+%<*driver|package>
+ [2009/10/09 4.1h AIP substyle for REVTeX]% \fileversion
+%</driver|package>
+% \end{macrocode}
+%
+%
+% \section{The driver module \texttt{driver}}
+%
+% This module, consisting of the present section,
+% typesets the programmer's documentation,
+% generating the \file{.ins} installer and \file{README} as required.
+%
+% Because the only uncommented-out lines of code at the beginning of
+% this file constitute the \file{driver} module itself,
+% we can simply typeset the \file{.dtx} file directly,
+% and there is thus rarely any need to
+% generate the ``driver'' {\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}
+%<*driver>
+% \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\relax\else
+ \expandafter\expandafter
+ \expandafter\RequirePackage
+ \expandafter\expandafter
+ \expandafter{\csname package@font\endcsname}%
+\fi
+\gdef\lquote{`}\gdef\rquote{'}%
+\CodelineIndex\EnableCrossrefs % makeindex -s gind.ist aip
+\RecordChanges % makeindex -s gglo.ist -o aip.gls aip.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.
+%
+%\changes{4.1b}{2008/08/06}{Beta candidate b}
+% \begin{macrocode}
+\begin{filecontents*}{README}
+\title{%
+ The \classname{aip} substyle for REV\TeX%
+ \protect\thanks{%
+ \fileversion\ \copyright 2009 American Institute of Physics
+ % For version number and date,
+ % search on "\fileversion" in the .dtx file,
+ % or see the end of the README file.
+ }%
+}%
+
+\author{%
+Arthur Ogawa\thanks{mailto:arthur\_ogawa at sbcglobal.net}%
+}%
+\date{Version \fileversion, dated \filedate}%
+\maketitle
+
+This file embodies the implementation of the
+AIP journal substyles for APS's \revtex\ 4.1 document class
+for electronic submissions to AIP journals.
+
+The distribution point for this work is
+\url{http://authors.aip.org/REVTEX}.
+The archive contains ready-to-Install files, documentation, and full source.
+
+This package is also distributed via CTAN:
+\url{http://www.ctan.org/pub/tex-archive/macros/latex/contrib/aip}, and as a ready-to-install image as
+\url{http://www.ctan.org/pub/tex-archive/install/macros/latex/contrib/aip.tds.zip}.
+
+The \classname{aip} package was commissioned by the American Institute of Physics
+and is distributed under the terms of the \LaTeX\ Project Public License,
+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{aip.rtx}
+into a location in your filesystem where it will be found by \LaTeX.
+
+To use, read the user documentation \file{auguide.pdf}.
+
+\tableofcontents
+
+\section{Overview}%
+\revtex\ is a \LaTeXe\ document class, somewhat like a hybrid of
+the standard \LaTeX\ \classname{book} and \classname{article} classes.
+
+This document class implements the AIP society and journal substyles:
+the journals represent a set of mutually exclusive class options that, in this case, allow the
+document class to address multiple journals within the AIP family.
+This society is obtained with class option \classoption{aip}.
+
+\section{Processing Instructions}
+
+The package file \file{aip.rtx}
+is generated from this file, \file{aip.dtx},
+using the {\sc docstrip} facility of \LaTeX
+via |tex aip.dtx|.
+The typeset documentation that you are now reading is generated from
+the same file by typesetting it with \LaTeX\ or pdftex
+via |latex aip.dtx| or |pdflatex aip.dtx|.
+
+\subsection{Build Instructions}
+
+You may bootstrap this suite of files solely from \file{aip.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{aip.dtx} with \LaTeX\ or pdflatex;
+you will obtain the typeset documentation you are now reading,
+along with
+the installer \file{aip.ins},
+and the file \file{README}.
+
+Note: you will have to run \LaTeX\ twice, then \file{makeindex}, then
+\LaTeX\ again in order to obtain a valid index and table of contents.
+\item
+Now typeset \file{aip.dtx} with \TeX (not \LaTeX),
+thereby generating the package file \file{aip.rtx}.
+\item
+Install \classname{aip.rtx}
+by moving it to a location
+in your filesystem where it will be found by \LaTeX,
+like \file{tex/latex/aip}.
+\item
+Install \classname{aip.pdf}
+by moving it to
+\file{doc/latex/aip}.
+\item
+Using the \file{.dbj} information herein,
+generate the needed \file{.bst} files and install them in
+\file{bibtex/bst/aip}.
+\end{enumerate}
+\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}%
+\newcommand\revtex{REV\TeX}%
+\expandafter\DocInput\expandafter{\jobname.dtx}%
+% ^^A\PrintChanges
+\end{document}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</driver>
+% \end{macrocode}
+%
+% \section{AIP: A set of journal-specifc extensions to \revtex}
+%
+% To create a journal substyle, you create
+% a \file{.rtx} file, in our case \file{aip.rtx}.
+% Within that file, you override procedures and parameter assignments as you see fit.
+% Ideally they will be generally applicable to all of that society's
+% journals (see the file \file{aps.rtx} for a realization of this scheme).
+% Also within that file, you include a
+% section of code for each journal, that for JMP looks like:
+% \begin{verbatim}
+% \@ifx{\@journal\journal@jmp}{%
+% <code specific to the JMP>
+% }{}%
+% \end{verbatim}
+%
+% \section{The \classoption{aip} class option: the \texttt{aip} module}
+% The file \file{aip.rtx} is read in by the \classname{revtex4} document class
+% if \cmd\@society\ has the value \classoption{aip}.
+%
+% Here, code specific to AIP journals appears.
+%
+% We first give some text entities (amounting to journal abbreviations),
+% then some AIP-specific initialisations,
+% then code for particular AIP journals.
+% In the latter case, the choice is
+% keyed off the macro \cmd\@journal.
+%
+% Note on \cmd\AtEndOfClass:
+% this file, like all journal substyles, is read in at \cmd\AtEndOfClass\ time,
+% so you should not use this command in this file.
+% Note for \LaTeX\ developers: It would be an improvement in \LaTeX\ to
+% \cmd\let\cmd\AtEndOfClass\ to something like \cmd\@firstofone.
+% This change would be effected in \cmd\@onefilewithoptions.
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \subsection{Defend Against Forseeable Errors}%
+% Protect this file from being read in by anything but \revtex.
+% \begin{macrocode}
+\ifx\undefined\substyle@ext
+ \def\@tempa{%
+ \endinput
+ \GenericWarning{I must be read in by REVTeX! (Bailing out)}%
+ }%
+ \expandafter\else
+ \def\@tempa{}%
+ \expandafter\fi\@tempa
+ \class@info{RevTeX society AIP selected}%
+% \end{macrocode}
+%
+% \subsection{Substyle Options}%
+%
+% Here are the class options relating to the AIP:
+% \begin{macrocode}
+\DeclareOption{jcp}{\change@journal{jcp}}%
+\DeclareOption{pop}{\change@journal{pop}}%
+\DeclareOption{rsi}{\change@journal{rsi}}%
+\DeclareOption{jap}{\change@journal{jap}}%
+\DeclareOption{apl}{\change@journal{apl}}%
+\DeclareOption{cha}{\change@journal{cha}}%
+\DeclareOption{pof}{\change@journal{pof}}%
+\DeclareOption{bmf}{\change@journal{bmf}}%
+\DeclareOption{rse}{\change@journal{rse}}%
+\DeclareOption{jmp}{\change@journal{jmp}}%
+% \end{macrocode}
+%
+% Option allowing for ``numerical author-year'' bibliography.
+% \begin{macrocode}
+\DeclareOption{author-numerical}{%
+ \@booleantrue\authoryear@sw
+ \@booleantrue\authornum@sw
+}%
+% \end{macrocode}
+%
+% Optionally allow article title in bibliography entries.
+% A new switch is defined here: \cmd\aip@jtitx@sw\ signifies that
+% the numbered style bibliography is to be prepared without article titles in @ARTICLE entries.
+% Otherwise, such titles are incorporated if present in the \file{.bib} entry.
+% By default, exclude the article titles.
+% \begin{macrocode}
+\DeclareOption{article-title}{%
+ \@booleanfalse\aip@jtitx@sw
+}%
+\@booleantrue \aip@jtitx@sw
+% \end{macrocode}
+%
+% Establish default options for this society.
+%
+% \begin{macrocode}
+\@booleanfalse\authoryear@sw
+\@booleanfalse\authornum@sw
+% \end{macrocode}
+%
+% For AIP, the preprint style \classoption{preprint} is the default.
+% \begin{macrocode}
+\@booleantrue\preprintsty@sw
+% \end{macrocode}
+%
+% \begin{macro}{\showPACS@sw}
+% \begin{macro}{\showKEYS@sw}
+% If \cmd\showPACS@sw\ is true, print the PACS information in the title block,
+% otherwise not.
+% Similarly for \cmd\showKEYS@sw\ and the keywords.
+% \begin{macrocode}
+\@booleantrue\showPACS@sw
+\@booleantrue\showKEYS@sw
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\refname}
+%
+% In reprint style only, we eliminate the head above the bibliography.
+% \begin{macrocode}
+\appdef\setup@hook{%
+ \preprintsty@sw{}{%
+ \let\refname\@empty
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{AIP Setup}%
+% Here we define the default procedures for AIP journals.
+% Individual AIP journals may override these definitions.
+%
+% \subsubsection{Running header and footer}%
+%
+% Page style for all AIP journals.
+% We assert our own page style only if nobody else has done so.
+% Users wishing to customize their documents will be able to invoke a \cmd\pagestyle\
+% command anywhere in the preamble.
+%FIXME: \cmd\preprintsty@sw\ is defined?
+% \begin{macrocode}
+\appdef\setup@hook{%
+ \preprintsty@sw{%
+ \ps@preprint
+ }{%
+ \ps@article
+ }%
+}%
+% \end{macrocode}
+%
+% The spc says: ``Running title must be provided on title page'',
+% and that journal classes 1b and 2 have no running title.
+% \begin{macrocode}
+\def\ps@preprint{%
+ \def\@oddhead{\@runningtitle\hfil}%
+ \def\@evenhead{\@runningtitle\hfil}%
+ \def\@oddfoot{\hfil\thepage\quad\checkindate\hfil}%
+ \def\@evenfoot{\hfil\thepage\quad\checkindate\hfil}%
+ \let\@mkboth\@gobbletwo
+ \let\sectionmark\@gobble
+ \let\subsectionmark\@gobble
+}%
+\def\ps@article{%
+ \def\@evenhead{\let\\\heading@cr\thepage\quad\checkindate\hfil\@runningtitle}%
+ \def\@oddhead{\let\\\heading@cr\@runningtitle\hfil\checkindate\quad\thepage}%
+ \def\@oddfoot{}%
+ \def\@evenfoot{}%
+ \let\@mkboth\@gobbletwo
+ \let\sectionmark\@gobble
+ \let\subsectionmark\@gobble
+}%
+\def\@runningtitle{\@shorttitle}%
+% \end{macrocode}
+%
+% \subsubsection{Title block}%
+%
+% The specifics of the title block.
+% Apply to all AIP journals; individual journals may override these settings.
+%
+% \begin{macro}{\titlepage}
+% \begin{macrocode}
+\renewenvironment{titlepage}{%
+ \let\wastwocol@sw\twocolumn@sw
+ \onecolumngrid
+ \newpage
+ \thispagestyle{titlepage}%
+ \c@page\z@% article sets this to one not zero???
+}{%
+ \wastwocol@sw{\twocolumngrid}{\newpage}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@fnsymbol}
+% On the title page, footnotes are lettered with right parenthesis: ``a)''.
+% \begin{macrocode}
+\let\@fnsymbol@latex\@fnsymbol
+\let\@fnsymbol\@alph
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\adjust@abstractwidth}
+% This procedure is used by many titlepage elements to indent on the left by a particular
+% amount. The author list uses \cmd\frontmatter@authorformat\ to accomplish the same.
+% \begin{macrocode}
+\def\adjust@abstractwidth{%
+ \parindent1em\relax
+ \advance\leftskip.5in\relax
+ \@totalleftmargin\leftskip
+ \@afterheading\@afterindentfalse
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@abstractheading}
+% AIP Journals all set the abstract head the same way, with no head.
+% \begin{macrocode}
+\def\frontmatter@abstractheading{}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@abstractfont}
+% All AIP journals set the abstract body the same way.
+% \begin{macrocode}
+\def\frontmatter@abstractfont{%
+%\small
+ \adjust@abstractwidth
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% All AIP journal preprints use separate titlepage and full-width abstract.
+% \begin{macrocode}
+\appdef\setup@hook{%
+ \preprintsty@sw{%
+ \@booleantrue\titlepage@sw
+% \def\frontmatter@affiliationfont{\it}%
+ \let\section\section@preprintsty
+% \let\@hangfrom@section\@hangfrom@section@preprintsty
+ \let\subsection\subsection@preprintsty
+ \let\subsubsection\subsubsection@preprintsty
+ }{}%
+}%
+% \end{macrocode}
+%
+% \begin{macro}{\frontmatter@authorformat}
+% All AIP journals set the author list the same.
+% The leading is 11.5 points, and
+% there is 11.5 points of extra space above the first author line
+% (which amounts to the same thing as 11.5 points extra below the title)
+% for a total of 23 points base-to-base.
+%
+% \begin{macrocode}
+\def\frontmatter@@indent{%
+ \skip@\@flushglue
+ \@flushglue\z@ plus.3\hsize\relax
+ \raggedright
+ \advance\leftskip.5in\relax
+ \@totalleftmargin\leftskip
+ \@flushglue\skip@
+}%
+\def\frontmatter@authorformat{%
+ \frontmatter@@indent
+ \sffamily
+%\advance\baselineskip\p@
+%\parskip11.5\p@\relax
+}%
+\renewcommand*\email[1][Electronic mail: ]{\begingroup\sanitize@url\@email{#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@above@affilgroup}
+% The default amount of space above affiliation.
+% \begin{macrocode}
+\def\frontmatter@above@affilgroup{%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@above@affiliation}
+% \begin{macro}{\frontmatter@above@affiliation@script}
+% The default amount of space above affiliation.
+% \begin{macrocode}
+\def\frontmatter@above@affiliation@script{%
+ \frontmatter@@indent
+%\addvspace{3.5\p@}%
+}%
+\def\frontmatter@above@affiliation{%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@affiliationfont}
+% All AIP journals set the affiliation the same.
+% Like the author, but in italic.
+% \begin{macrocode}
+\def\frontmatter@affiliationfont{%
+ \frontmatter@@indent
+ \preprintsty@sw{}{\small}%
+ \it
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@collaboration@above}
+% \begin{macrocode}
+\def\frontmatter@collaboration@above{%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% Set up the default AIP style for title block authors and affiliations.
+%
+% \begin{macro}{\frontmatter@setup}
+% All AIP journals set the title page using the same font and size.
+% However, justification varies for the title block elements, so
+% we assert none here.
+% \begin{macrocode}
+\def\frontmatter@setup{%
+ \normalfont
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@title@above}
+% \begin{macro}{\frontmatter@title@format}
+% \begin{macro}{\frontmatter@title@below}
+% All AIP journals set the article title 12 point Times Roman, bold, flush left.
+%
+% \begin{macrocode}
+\def\frontmatter@title@above{\addvspace{6\p@}}%
+\def\frontmatter@title@format{%
+ \preprintsty@sw{}{\Large}%
+ \sffamily
+ \bfseries
+ \raggedright
+ \parskip\z@skip
+}%
+\def\frontmatter@title@below{\addvspace{3\p@}}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@makefnmark}
+% All AIP journals share this procedure for setting the titlepage footnote text:
+% superior lowercase letter, with right parenthesis.
+% \begin{macrocode}
+\def\@author@parskip{3\p@}%
+\@booleantrue\altaffilletter@sw
+\def\frontmatter@makefnmark{%
+ \@textsuperscript{%
+ \normalfont\@thefnmark%(
+ )%
+ }%
+}%
+\def\frontmatter@authorbelow{%
+ \addvspace{3\p@}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\affil@cutoff}
+% We override \cmd\affil@cutoff\ to enforce the rule that,
+% if a single affiliation appears on the title page, then
+% no affiliation superscript at all is produced.
+% \begin{macrocode}
+\let\affil@cutoff\tw@
+% \end{macrocode}
+% De awa.
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@RRAP@format}
+% All AIP journals use the same format for the ``Received, Revised, etc.'' block on the title page.
+%
+% Change note: 11.5 points b-b from author/affiliation down to date.
+% \begin{macrocode}
+\def\frontmatter@RRAP@format{%
+ \addvspace{5\p@}%
+ \small
+ \raggedright
+ \advance\leftskip.5in\relax
+ \@totalleftmargin\leftskip
+% \preprintsty@sw{}{\parskip.5ex\relax}%
+ \everypar{%
+ \hbox\bgroup(\@gobble@leavemode@uppercase%)
+ }%
+ \def\par{%
+ \@ifvmode{}{%(
+ \unskip)\egroup\@@par
+ }%
+ }%
+}%
+\def\punct@RRAP{;\egroup\ \hbox\bgroup}%
+\def\@gobble@leavemode@uppercase#1#2{\expandafter\MakeTextUppercase}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@PACS@format}
+%
+% \begin{macrocode}
+\def\frontmatter@PACS@format{%
+ \addvspace{11\p@}%
+% \footnotesize
+ \adjust@abstractwidth
+ \parskip\z@skip
+ \samepage
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@keys@format}
+%
+% \begin{macrocode}
+\def\frontmatter@keys@format{%
+% \footnotesize
+ \adjust@abstractwidth
+ \samepage
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ps@titlepage}
+% Title page style. Currently empty except for preprint header,
+% which consists of all the \cmd\preprint\ arguments,
+% stacked flush right at the right margin.
+% \begin{macrocode}
+\def\ps@titlepage{%
+ \def\@oddhead{%
+ \@runningtitle
+ \hfill
+ \produce@preprints\@preprint
+ }%
+ \let\@evenhead\@oddhead
+ \def\@oddfoot{%
+ \hb@xt@\z@{\byrevtex\hss}%
+ \hfil
+ \preprintsty@sw{\thepage}{}%
+ \quad\checkindate
+ \hfil
+ }%
+ \let\@evenfoot\@oddfoot
+}%
+\def\byrevtex{\byrevtex@sw{Typeset by REV\TeX and AIP}{}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\produce@preprints}
+% \begin{macrocode}
+\def\produce@preprints#1{%
+ \preprint@sw{%
+ \vtop to \z@{%
+ \def\baselinestretch{1}%
+ \small
+ \let\preprint\preprint@count
+ \count@\z@#1\@ifnum{\count@>\tw@}{%
+ \hbox{%
+ \let\preprint\preprint@hlist
+ #1\setbox\z@\lastbox
+ }%
+ }{%
+ \let\preprint\preprint@cr
+ \halign{\hfil##\cr#1\crcr}%
+ \par
+ \vss
+ }%
+ }%
+ }{}%
+}%
+\def\preprint@cr#1{#1\cr}%
+\def\preprint@count#1{\advance\count@\@ne}%
+\def\preprint@hlist#1{#1\hbox{, }}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Lead-in paragraph}%
+%
+% The \env{Lead-in paragraph} environment formats the AIP ``lead paragraph''.
+% To avoid introducing new syntax, we take over the \env{quotation} environment
+% until the first \cmd\section\ (or other sectioning command) appears.
+%
+% \begin{macrocode}
+\newenvironment{Lead@inParagraph}{%
+ \par
+ \bfseries
+ \@afterheading\@afterindentfalse
+}{%
+ \par
+ \hb@xt@\hsize{\hfil\leaders\hrule\hfil\leaders\hrule\hfil\hfil}%
+}%
+% \end{macrocode}
+% At the beginning of the document temporarily change the meaning of
+% the \env{quotation} environment, restoring it once the first sectioning
+% command is given.
+% \begin{macrocode}
+\appdef\frontmatter@init{%
+ \let@environment{quotation@ltx}{quotation}%
+ \let@environment{quotation}{Lead@inParagraph}%
+}%
+\appdef\@startsection@hook{%
+ \let@environment{quotation}{quotation@ltx}%
+}%
+% \end{macrocode}
+%
+% \subsubsection{Stacked Heads}%
+% All AIP journals put a period (.), followed by quad space, after the section number.
+% Also, no hanging section number.
+% \begin{macrocode}
+\def\@seccntformat#1{\csname the#1\endcsname.\quad}%
+\def\@hang@from#1#2#3{#1#2#3}%
+% \end{macrocode}
+%
+% Note that in the following, we wish to set the section head uppercase, so we use
+% David Carlisle's \cmd\MakeTextUppercase. However, because this procedure effectively
+% parses its argument (looking for things to \emph{not} translate), it has to be invoked
+% in such a way that the argument of the \cmd\section\ command is passed to it as its
+% own argument.
+%
+% To accomplish this, we use the \cmd\@hangfrom@\ hook, which was developed for this
+% purpose.
+%
+% \begin{macrocode}
+\def\section{%
+ \@startsection
+ {section}%
+ {1}%
+ {\z@}%
+ {0.8cm \@plus1ex \@minus .2ex}%
+ {0.5cm}%
+ {%
+ \normalfont
+ \small
+ \sffamily
+ \bfseries
+ \raggedright
+ }%
+}%
+\def\@hangfrom@section#1#2#3{\@hangfrom{#1#2}\MakeTextUppercase{#3}}%
+\def\@hangfroms@section#1#2{#1\MakeTextUppercase{#2}}%
+% \end{macrocode}
+%
+% See, e.g., BMF\_044101\_1 (1) or BMF\_044103\_1 (1)
+% \begin{macrocode}
+\def\subsection{%
+ \@startsection
+ {subsection}%
+ {2}%
+ {\z@}%
+ {.8cm \@plus1ex \@minus .2ex}%
+ {.5cm}%
+ {%
+ \normalfont
+ \small
+ \sffamily
+ \bfseries
+ \raggedright
+ }%
+}%
+% \end{macrocode}
+%
+% See, e.g., BMF\_044104\_1 (1), JMP\_123520\_1 (48),
+% \begin{macrocode}
+\def\subsubsection{%
+ \@startsection
+ {subsubsection}%
+ {3}%
+ {\z@}%
+ {.8cm \@plus1ex \@minus .2ex}%
+ {.5cm}%
+ {%
+ \normalfont
+ \small
+ \sffamily
+ \bfseries
+ \itshape
+ \raggedright
+ }%
+}%
+% \end{macrocode}
+%
+% \subsubsection{Runin Heads}%
+% \begin{macrocode}
+\def\paragraph{%
+ \@startsection
+ {paragraph}%
+ {4}%
+ {\parindent}%
+ {\z@}%
+ {-1em}%
+ {\normalfont\normalsize\itshape}%
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\subparagraph{%
+ \@startsection
+ {subparagraph}%
+ {5}%
+ {\parindent}%
+ {3.25ex \@plus1ex \@minus .2ex}%
+ {-1em}%
+ {\normalfont\normalsize\bfseries}%
+}%
+% \end{macrocode}
+%
+% \begin{macro}{\section@preprintsty}
+% \begin{macro}{\subsection@preprintsty}
+% \begin{macro}{\subsubsection@preprintsty}
+% Here are the formatting procedures specific to the preprint style;
+% the only difference is that the heads are flush left instead of centered.
+%
+% \begin{macrocode}
+\def\section@preprintsty{%
+ \@startsection
+ {section}%
+ {1}%
+ {\z@}%
+ {0.8cm \@plus1ex \@minus .2ex}%
+ {0.5cm}%
+ {%
+ \normalfont
+ \bfseries
+ \raggedright
+ }%
+}%
+%\def\@hangfrom@section@preprintsty#1#2#3{\@hangfrom{#1#2}\MakeTextUppercase{#3}}%
+% \end{macrocode}
+% \begin{macrocode}
+\def\subsection@preprintsty{%
+ \@startsection
+ {subsection}%
+ {2}%
+ {\z@}%
+ {.8cm \@plus1ex \@minus .2ex}%
+ {.5cm}%
+ {%
+ \normalfont
+ \bfseries
+ \raggedright
+ }%
+}%
+% \end{macrocode}
+% \begin{macrocode}
+\def\subsubsection@preprintsty{%
+ \@startsection
+ {subsubsection}%
+ {3}%
+ {\z@}%
+ {.8cm \@plus1ex \@minus .2ex}%
+ {.5cm}%
+ {%
+ \normalfont
+% \small
+ \itshape\bfseries
+ \raggedright
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% For examples of
+% \env{theorem}, \env{proposition}, \env{lemma}, \env{remark}, \env{corollary}, \env{example},
+% and \env{proof} (with optional title),
+% using independent numbering for each class,
+% and with numbered and roman lists therein,
+% see JMP\_122901\_1 (48).
+%
+% For theorems, etc, numbered by section, (and with theorems in the appendix)
+% but equations numbered throughout,
+% see JMP\_123301\_1 (48).
+%
+% For a (roman) list in text, theorem, and proof,
+% see JMP\_123514\_1 (48).
+%
+% For numbered list in text,
+% and equations numbered by section,
+% see JMP\_123518\_1 (48).
+%
+% All AIP journals use frontmatter footnotes by default.
+% \begin{macrocode}
+\let\frontmatter@footnote@produce\frontmatter@footnote@produce@footnote
+% \end{macrocode}
+%
+%
+% \subsubsection{Table of Contents}%
+% The toc will itself make an entry in the toc,
+% but we temporarily turn off toc formatting for the duration.
+% \begin{macrocode}
+\def\@pnumwidth{1.55em}
+\def\@tocrmarg {2.55em}
+\def\@dotsep{2}
+\def\ltxu@dotsep{4.5pt}
+\setcounter{tocdepth}{3}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\tableofcontents{%
+ \addtocontents{toc}{\string\tocdepth@munge}%
+ \print@toc{toc}%
+ \addtocontents{toc}{\string\tocdepth@restore}%
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\tocdepth@munge{%
+ \let\l@section@saved\l@section
+ \let\l@section\@gobble@tw@
+}%
+\def\@gobble@tw@#1#2{}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\tocdepth@restore{%
+ \let\l@section\l@section@saved
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\l@part#1#2{\addpenalty{\@secpenalty}%
+ \begingroup
+ \set@tocdim@pagenum{#2}%
+% \@tempdima 3em %
+ \parindent \z@
+ \rightskip\tocleft@pagenum plus 1fil\relax
+ \skip@\parfillskip\parfillskip\z@
+ \addvspace{2.25em plus\p@}%
+ \large \bf %
+ \leavevmode\ignorespaces#1\unskip\nobreak\hskip\skip@
+ \hb@xt@\rightskip{\hfil\unhbox\z@}\hskip-\rightskip\hskip\z@skip
+ \par
+ \nobreak %
+ \endgroup
+}%
+% \end{macrocode}
+%
+% \begin{macro}{\l@section}
+% Determine which TOC elements are automatically indented.
+% \begin{macrocode}
+\def\tocleft@{\z@}%
+\def\tocdim@min{5\p@}%
+\def\l@section{%
+ \l@@sections{}{section}% Implicit #3#4
+}%
+\def\l@f@section{%
+ \addpenalty{\@secpenalty}%
+ \addvspace{1.0em plus\p@}%
+ \bf
+}%
+\def\l@subsection{%
+ \l@@sections{section}{subsection}% Implicit #3#4
+}%
+\def\l@subsubsection{%
+ \l@@sections{subsection}{subsubsection}% Implicit #3#4
+}%
+\def\l@paragraph#1#2{}%
+\def\l@subparagraph#1#2{}%
+% \end{macrocode}
+% \end{macro}
+%
+% Activate the auto TOC processing.
+% \begin{macrocode}
+\let\toc@pre\toc@pre@auto
+\let\toc@post\toc@post@auto
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\listoffigures{\print@toc{lof}}%
+\def\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\listoftables{\print@toc{lot}}%
+\let\l@table\l@figure
+% \end{macrocode}
+%
+% \subsubsection{Default column bottom}%
+% All AIP journal styles have flush bottoms.
+%
+% \begin{macrocode}
+\@booleanfalse\raggedcolumn@sw
+% \end{macrocode}
+%
+%
+% \subsubsection{Table alignment style}%
+%
+% \begin{macro}{\tableft@skip@float}
+% \begin{macro}{\tabmid@skip@float}
+% \begin{macro}{\tabright@skip@float}
+% \begin{macro}{\array@row@pre@float}
+% \begin{macro}{\array@row@pst@float}
+% All AIP publications have the same table specification:
+% Scotch rules above and below, centered in column.
+% \begin{macrocode}
+\def\tableft@skip@float{\z@ plus\hsize}%
+\def\tabmid@skip@float{\@flushglue}%
+\def\tabright@skip@float{\z@ plus\hsize}%
+\def\array@row@pre@float{\hline\hline\noalign{\vskip\doublerulesep}}%
+\def\array@row@pst@float{\noalign{\vskip\doublerulesep}\hline\hline}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsubsection{Footnote formatting}%
+% We customize the formatting of footnotes for all AIP journals.
+% \begin{macro}{\@makefntext}
+% \begin{macrocode}
+\def\@makefntext#1{%
+ \def\baselinestretch{1}%
+ \leftskip1em%
+ \parindent1em%
+ \noindent
+ \nobreak\hskip-\leftskip
+ \hb@xt@\leftskip{%
+ \hss\@makefnmark\ %
+ }%
+ #1%
+ \par
+}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsubsection{Appendix}%
+% \begin{macro}{\appendix}
+% \begin{macro}{\@hangfrom@appendix}
+% \begin{macro}{\@hangfroms@appendix}
+% \begin{macro}{\@appendixcntformat}
+% \begin{macrocode}
+\prepdef\appendix{%
+ \par
+ \let\@hangfrom@section\@hangfrom@appendix
+%\let\@hangfroms@section\@hangfroms@appendix
+ \let\@sectioncntformat\@appendixcntformat
+}%
+\def\@hangfrom@appendix#1#2#3{%
+ #1%
+ \@if@empty{#2}{%
+ #3%
+ }{%
+ #2\@if@empty{#3}{}{:\ #3}%
+ }%
+}%
+\def\@hangfroms@appendix#1#2{%
+ #1#2%
+}%
+\def\@appendixcntformat#1{\appendixname\ \csname the#1\endcsname}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Bibliography}%
+%
+% Customize the \revtex\ for the AIP society.
+% this task requires three components:
+% the \BibTeX\ \file{aipnum.bst} and \file{aipauth.bst} style files,
+% customizing code for \file{natbib}, and
+% customizations of the \env{thebibliography} environment.
+%
+% \begin{macro}{\@bibstyle}
+% Define the argument of the \cmd\bibliographystyle\ command.
+% The user must have installed a \file{.bst} file of the corresponding name.
+% This file will then be used by \BibTeX\ when compiling the document's \file{.bbl} file.
+%
+% The default bibliography style for the AIP journal substyles are \file{aipnum.bst} and \file{aipauth.bst}.
+% To generate them, use \classname{custom-bib} version 4.21 or later.
+% Run the \file{.bst} generator, \file{makebst.tex}, and
+% accept all defaults, with the following exceptions:
+%
+% \begin{enumerate}
+% \item
+% ORDERING OF REFERENCES: c: seq-no (references in order of Citation);
+% \item
+% AUTHOR NAMES: i: nm-init,ed-au (Initials + surname);
+% \item
+% NUMBER OF AUTHORS: l: max 12, min 12 (there will be three prompts total);
+% \item
+% TYPEFACE FOR AUTHORS IN LIST OF REFERENCES: u: nmft,nmft-def (User defined author font);
+% \item
+% FONT FOR FIRST NAMES: u: fnm-def (First names in user defined font);
+% \item
+% EDITOR NAMES IN INCOLLECTION ETC: a: nmfted (Editors incollection like authors);
+% \item
+% DATE FORMAT: p: yr-par (Date in parentheses);
+% \item
+% SUPPRESS MONTH: x: xmth (Date is year only);
+% \item
+% TITLE OF ARTICLE: i: tit-it (Title italic)
+% \item
+% ARTICLE TITLE PRESENT: x: jtit-x (No article title);
+% \item
+% JOURNAL NAME FONT: r: jttl-rm (Journal title normal);
+% \item
+% TECHNICAL REPORT TITLE: b: trtit-b (Tech. report title like books);
+% \item
+% JOURNAL VOLUME: b: vol-bf (Volume bold);
+% \item
+% VOLUME PUNCTUATION: c: volp-com (Volume with comma);
+% \item
+% PAGE NUMBERS: f: jpg-1 (Only start page number);
+% \item
+% JOURNAL NAME PUNCTUATION: x: jnm-x (Space after journal);
+% \item
+% PUBLISHER IN PARENTHESES: d: pub-date (Publisher and date in parentheses);
+% \item
+% PUBLISHER POSITION: p: pre-pub (Publisher before chapter, pages);
+% \item
+% ISBN NUMBER: isbn: (Include ISBN for books, booklets)
+% \item
+% ISSN NUMBER: issn: (Include ISSN for periodicals)
+% \item
+% EDITOR IN COLLECTIONS: b: edby (Booktitle, edited by \dots);
+% \item
+% PUNCTUATION BETWEEN SECTIONS (BLOCKS): c: blk-com (Comma between blocks);
+% \item
+% ABBREVIATE WORD `PAGES': a: pp (`Page' abbreviated);
+% \item
+% ABBREVIATE WORD `EDITORS': a: ed (`Editor' abbreviated);
+% \item
+% OTHER ABBREVIATIONS: a: abr (Abbreviations);
+% \item
+% ABBREVIATION FOR `EDITION': a: ednx (`Edition' abbreviated as `ed');
+% \item
+% EDITION NUMBERS: n: ord (Numerical editions);
+% \item
+% STORED JOURNAL NAMES: a: jabr (Abbreviated journal names);
+% \item
+% FONT OF `ET AL': i: etal-it (Italic et al);
+% \item
+% ADDITIONAL REVTeX DATA FIELDS: r: revdata, eprint, url, url-blk (Include REVTeX data fields collaboration, eid, eprint, numpages, url)
+% \item
+% NEW FONT SELECTION SCHEME: n: nfss (NFSS);
+% \item
+% ADDITIONAL REVTeX DATA FIELDS: y: revdata (additional data fields);
+% \item
+% REFERENCE COMPONENT TAGS: y: reference component tags;
+% \item
+% URL ADDRESS: n: URL as note;
+% \end{enumerate}
+%
+% A file \file{aipnum.dbj} file equivalent to the following should result:
+% \begin{verbatim}
+%\input docstrip
+%\preamble
+%----------------------------------------
+%*** REVTeX-compatible aipnum4-1.bst 2009-10-08 ***
+%\endpreamble
+%\postamble
+%End of customized bst file
+%\endpostamble
+%\keepsilent
+%\askforoverwritefalse
+%\def\MBopts{\from{merlin.mbs}{%
+% head,\MBopta}
+%\from{physjour.mbs}{\MBopta}
+%\from{geojour.mbs}{\MBopta}
+%\from{photjour.mbs}{\MBopta}
+%\from{merlin.mbs}{tail,\MBopta}}
+%\def\MBopta{%
+% lang,%: Use language field to switch hyphenation patterns for title
+% pres,pres-bf,%: Presentation, speaker bold face
+% seq-no,%: Citation order (unsorted, like unsrt.bst)
+% vonx,%: Sort without von part (de la Maire after Mahone)
+% nm-init,ed-au,%: Initials + surname (J. F. Smith)
+% nmft,nmft-def,%: User defined author font (\bibnamefont)
+% fnm-def,%: First names in user defined font (\bibfnamefont)
+% nmfted,%: Editors incollection like authors font
+% nmand-rm,%: `And' in normal font (JONES and JAMES)
+% lab,lab-def,%: User defined citation font (\citenamefont)
+% and-rm,%: Cited `and' in normal font
+% yr-par,%: Date in parentheses as (May 1993)
+% date-nil-x,%: If date is empty, then do not produce the surrounding punctuation (parens, brackets, colon, comma)
+% tit-qq,%: Title and punctuation in double quotes (``Title,'' ..)
+% inproceedings-chapter,%: produce pages after chapter, just as in InBook
+% jtit-x,%: Title is ignored
+% inproceedings-chapter,%: produce pages after chapter just as in InBook
+% article-booktitle,%: format booktitle
+% article-series,%: article can has series
+% jttl-rm,%: Journal name normal font
+% journal-address,%: Include address field (in parentheses) along with journal name
+% book-bt,%: Field `booktitle', or if absent field `title', is book title
+% thesis-title-o,%: Title is optional: no warning issued if empty
+% techreport-institution-par,%: format tech report institution like book publisher
+% vol-bf,%: Volume bold as {\bf vol}(num)
+% vnum-x,%: Journal vol, without number as 34
+% volp-com,%: Volume with comma as vol(num), ppp
+% jpg-1,%: Only start page number
+% book-editor-booktitle,%: Book permits empty author, produces title before editor in this case
+% inbook-editor-booktitle,%: Allow using both title/booktitle, both author/editor
+% bookaddress,%: Italic booktitle followed by bookaddress in roman
+% num-xser,%: Allows number without series and suppresses word "number"
+% number-cap,%: Capitalize word `number' as: "Number 123"
+% chapter-cap,%: Capitalize word `chapter' as: `Chapter 42'
+% series-number,%: Series number as: `Springer Lecture Notes No. 125'
+% numser-booktitle,%: After book title and conference address, and before editors
+% ser-vol,%: Series, vol. 23
+% ser-rm,%: format series roman , even when used with volume
+% volume-cap,%: Capitalize word `volume', as: `Volume 7 in Lecture Series'
+% ser-ed,%: Series and volume after booktitle and before editors
+% jnm-x,%: Space after journal name
+% pg-bk,book-chapter-pages,%: As chapter and page: chapter 42, page 345
+% pub-date,%: Publisher with address and date in parentheses (Oxford, 1994)
+% ay-empty-pub-parens-x,%: eliminate parentheses altogether if nothing inside
+% pre-pub,%: Publisher before volume, chapter, pages
+% pre-edn,%: Edition before publisher
+% pre-pub,pre-edn,%: Edition, publisher, volume, chapter, pages
+% isbn,%: Include ISBN for books, booklets, etc.
+% issn,%: Include ISSN for periodicals
+% doi-link,doi,%: Doi forms a link to the publication, anchored to the volume or title
+% edby,%: In booktitle, edited by .. (where .. is names)
+% blk-com,%: Comma between blocks
+% fin-endbibitem,%: Command at end instead of period
+% pp,%: `Page' abbreviated as p. or pp.
+% ed,%: `Editor' abbreviated as ed. or eds.
+% abr,%: Abbreviations of such words
+% ednx,%: `Edition' abbreviated as `ed'
+% ord,%: Numerical editions as 1st, 2nd, 3rd, etc
+% jabr,%: Abbreviated journal names
+% etal-it,%: Italic et al
+% revdata,eprint,url,url-blk,translation,%: Include REVTeX data fields collaboration, eid, eprint, archive, url, translation
+% SLACcitation,%: Produce SLACcitation field
+% numpages-x,%: Do not include numpages field
+% url,url-prefix-x,%: URL without prefix (default: `URL ')
+% bibinfo,%: Reference component tags like \bibinfo in the content of \bibitem
+% bibfield,%: Element tags like \bibfield in the content of \bibitem
+% nfss,%: Use LaTeX commands which may not work with Plain TeX
+%,{%
+% }}
+%\generate{\file{aipnum4-1.bst}{\MBopts}}
+%\endbatchfile
+% \end{verbatim}
+%
+% Between the two files \file{aipnum.dbj} and \file{aipnum.dbj},
+% the differences are limited:
+% \file{aipnum.dbj} has two lines lacking in \file{aipauth.dbj}:
+% \begin{verbatim}
+% ,seq-no%: Citation order (unsorted, like unsrt.bst)
+% ,nm-init,ed-au%: Initials + surname (J. F. Smith)
+% \end{verbatim}
+% thus, the ``numbered citation'' bibliography is sorted by citation order, and
+% the names are give first inital, then last name.
+%
+% Likewise, \file{aipauth.dbj} has two lines lacking in \file{aipnum.dbj}:
+% \begin{verbatim}
+% ,ay%: Author-year with some non-standard interface
+% ,nat%: Natbib for use with natbib v5.3 or later
+% ,blkyear%: Missing date left blank
+% ,nm-rev%: Surname + initials (Smith, J. F.)
+% \end{verbatim}
+% Thus, the ``author-year'' bibliography is sorted by author name, and
+% names are given last name first, followed by initials.
+%
+% Note that \file{aipnumlong.dbj} is the same as \file{aipnum.dbj}, except:
+% \begin{itemize}
+% \item
+% Remove \texttt{jtit-x}, \texttt{jpg-1}. This means article titles and full page range.
+% \item
+% Add \texttt{article-title-o}: article title is not required.
+% \item
+% Remove \texttt{nm-init}. This means full names.
+% \item
+% The file to be \cmd\generate d is \filename{aipnum4-1long.bst} instead of \filename{aipnum4-1.bst}.
+% \end{itemize}
+%
+% The differences between \file{aipauthlong.dbj} and \file{aipauth.dbj}
+% are exactly the same as between \file{aipnumlong.dbj} and \file{aipnum.dbj}
+%
+% To get a banner in the \file{.blg} file, patch by hand into \file{apsrev.bst}:
+% \begin{verbatim}
+% FUNCTION {banner.log} {"REVTeX-compatible apsrev.bst 9812" warning$}
+% \end{verbatim}
+% and invoke \texttt{banner.log} from within \texttt{begin.bib}
+%
+% We ensure that the journal substyle has the first word
+% in the matter by installing the (default) AIP code
+% later on (see Section~\ref{sec:aip-defaults}).
+% \end{macro}
+%
+% \begin{macro}{\pre@bibdata}
+%
+% Set up to write endnotes to a .bib file; its data will be incorporated into the bibliography.
+% \begin{macrocode}
+ \def\pre@bibdata{\jobname\bibdata@app}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bibsection}
+% We define the sectioning command to use when starting the bibliography
+% (we use \cmd\refname).
+% \begin{macrocode}
+\def\refname{References}%
+\def\rtx@bibsection{%
+ \@ifx@empty\refname{%
+ \par\vspace{6\p@ plus 6\p@}%
+ }{%
+% \let\@hangfroms@section\@hang@froms
+ \expandafter\section\expandafter*\expandafter{\refname}%
+ \@nobreaktrue
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bibpreamble}
+% \begin{macro}{\bibsep}
+% \begin{macro}{\newblock}
+% \begin{macrocode}
+\let\bibpreamble\@empty
+\appdef\setup@hook{%
+ \bibsep\z@\relax
+}%
+\def\newblock{\ }%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\bibfont}
+% We define the font switch that applies to the body of the bibliography.
+%
+% \begin{macrocode}
+\appdef\setup@hook{%
+ \def\bibfont{%
+ \preprintsty@sw{}{\footnotesize}%
+ \@clubpenalty\clubpenalty
+ \labelsep\z@
+ }%
+}%
+\let\place@bibnumber\place@bibnumber@sup
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsubsection{Index}%
+% \begin{macrocode}
+\newenvironment{theindex}{%
+ \columnseprule \z@
+ \columnsep 35\p@
+ \c@secnumdepth-\maxdimen
+ \onecolumngrid@push
+ \section{\indexname}%
+ \thispagestyle{plain}%
+ \parindent\z@
+ \parskip\z@ plus.3\p@\relax
+ \let\item\@idxitem
+ \onecolumngrid@pop
+}{%
+}%
+%
+\def\@idxitem{\par\hangindent 40\p@}
+%
+\def\subitem{\par\hangindent 40\p@ \hspace*{20\p@}}
+%
+\def\subsubitem{\par\hangindent 40\p@ \hspace*{30\p@}}
+%
+\def\indexspace{\par \vskip 10\p@ plus5\p@ minus3\p@\relax}
+% \end{macrocode}
+%
+%
+% \subsubsection{Typesize Processing}%
+% The formatting specification for the preprint option is:
+% Times Roman 12 pt, double spacing, with 1-inch margins on letter paper.
+% Paragraphs indented ``five spaces''.
+% Display math on standard indent, with equation number flush right in parenthesis, with subequations roman.
+%
+% That for reprint option is to format similar to the printed journal; with most journals
+% set (approximately analyzed) 10-point, 2-column grid, letter paper.
+% \begin{macrocode}
+\expandafter\def\csname rtx@aip10pt\endcsname{%
+ \let\@currname@class\@currname
+ \def\@currname{aps10pt\substyle@post}%
+ \class@info{Reading file \@currname.\substyle@ext}%
+ \input{\@currname.\substyle@ext}%
+ \let\@currname\@currname@class
+ \class@info{Overriding 10pt}%
+ \aipreprint
+}%
+\expandafter\def\csname rtx@aip11pt\endcsname{\csname rtx@aip12pt\endcsname}%
+\expandafter\def\csname rtx@aip12pt\endcsname{%
+ \let\@currname@class\@currname
+ \def\@currname{aps12pt\substyle@post}%
+ \class@info{Reading file \@currname.\substyle@ext}%
+ \input{\@currname.\substyle@ext}%
+ \let\@currname\@currname@class
+ \class@info{Overriding 12pt}%
+ \aippreprint
+}%
+% \end{macrocode}
+%
+% \begin{macro}{\today}
+% Procedure \cmd\today\ is used in the article class, but not in
+% this document class.
+% \begin{macrocode}
+\def\today{%
+ \number\day\space
+ \ifcase\month
+ \or January\or February\or March\or April\or May\or June%
+ \or July\or August\or September\or October\or November\or December%
+ \fi\space
+ \number\year
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{A. Running Title}
+% User-provided running title \cmd\@shorttitle\ to be set.
+%
+% \subsection{B. Equation numbering, figure and table numbering}
+% Equations can be numbered throughout, or by section, with appendix equations prepended by the appendix label.
+% Figures and tables are numbered throughout.
+%
+%
+% \subsection{C. Title}
+% Title page may break above abstract, within author list.
+% Title notes are signified by superior letter followed by right parenthesis.
+%
+% \subsection{D. Author footnote}
+% Set short line above these footnotes.
+%
+% \subsection{E. Author}
+% Class option \classoption{superscriptaddress} is standard.
+% \begin{macrocode}
+ \clo@superscriptaddress
+% \end{macrocode}
+%
+% \subsection{F. Affiliations}
+% Set italic.
+%
+% \subsection{G. Received date}
+%
+%
+% \subsection{H. Abstract}
+% Single paragraph, no indent.
+%
+% \subsection{J. Lead Paragraph}
+% Set boldface, flush left before main text, single paragraph.
+% Separated from text by a short centered rule.
+%
+% \subsection{K. Headings}
+% Use labels: ROMAN, LETTER, arabic, letter.
+% Set ALLCAPS, boldface; Initial cap, boldface; Initial cap, bold-italic; Initial cap, italic.
+%
+% Theorem, proof title followed by colon. Follow author.
+%
+% \subsection{L. Text Footnotes}
+% Not permitted; use endnotes.
+%
+% \subsection{M. Citations and Bibliography}
+% Numerical \filename{aipnum.bst}, author-year \filename{aipauth.bst}, and numbered author-year \filename{aipnumauth.bst} are the available choices.
+% Numerical is standard, with all styles permitted in journal classes 3a and 4b.
+%
+%
+% \subsection{N. References}
+%
+% Article Title usage:
+%
+% Article title required in all journals with "unpublished", "to be published", "in press" and "submitted" refs.
+%
+% Exceptions:
+%
+% Journal classes 1a,1b,2,4a:
+%
+% Article title not allowed in published references, except in the case of "in press" or submitted" (see sample references below).
+%
+% Journal class 3a:
+%
+% Article title allowed but not required in author-year references (use must be consistent within a single manuscript).
+%
+% Journal class 3b:
+%
+% Article title required in all journal references and report references.
+%
+% Journal class 4b:
+%
+% Article title allowed in journal references in author-year mode.
+%
+% \subsection{O. Examples of Numerical References}
+%
+%
+% \subsection{P. References in Author-year mode}
+%
+%
+% \subsection{Q. Numbered Author-year References}
+%
+%
+% \subsection{R. Tables}
+% Placed within text (floated), labeled with Roman numeral.
+%
+% Table caption placed above table, followed by space,
+% two double lines, space, table column headings, space,
+% single line, table contents, two double lines.
+%
+% Footnotes labeled with superior lower-case letter, set below table contents.
+%
+% \subsection{S. Figures}
+% Placed within text (floated), labeled with arabic numbers.
+%
+% Caption set below figure. A citation to be set inline, not superscripted.
+%
+% \subsection{Society defaults}%
+%
+% After this society file is read in, we will process the
+% \cmd\@journal- and \cmd\@pointsize-specific code.
+% Here we define the defaults.
+%
+% We select \textbf{Chaos} as the default journal substyle, because it is
+% the most permissive in terms of bibliography and citation style,
+% and it is formatted in two column in the reprint style.
+%
+% \begin{macrocode}
+\def\@journal@default{cha}%
+\def\@pointsize@default{12}%
+% \end{macrocode}
+%
+% \subsection{Journal-Specific Code}%
+%
+% For AIP journals, we supply code specific to JCP, POP, RSI, JAP, APL, CHA, POF, BMF, RSE, JMP.
+%
+% \subsubsection{\classoption{jcp}}%
+%A member of the journal class 1a.
+% \begin{macrocode}
+\def\rtx@aipjcp{%
+ \typeout{Using journal substyle \@journal.}%
+% \end{macrocode}
+% Journal class 1a uses the (superscript) numerical citation style by default.
+% \begin{macrocode}
+ \@booleanfalse\authoryear@sw
+% \end{macrocode}
+%
+% End of \classoption{jcp} code.
+% \begin{macrocode}
+}%
+% \end{macrocode}
+%
+% \subsubsection{\classoption{pop}}%
+%A member of the journal class 1a.
+% \begin{macrocode}
+\def\rtx@aippop{%
+ \typeout{Using journal substyle \@journal.}%
+% \end{macrocode}
+% Journal class 1a uses the (superscript) numerical citation style by default.
+% \begin{macrocode}
+ \@booleanfalse\authoryear@sw
+% \end{macrocode}
+%
+% End of \classoption{pop} code.
+% \begin{macrocode}
+}%
+% \end{macrocode}
+%
+% \subsubsection{\classoption{rsi}}%
+%A member of the journal class 1a.
+% \begin{macrocode}
+\def\rtx@aiprsi{%
+ \typeout{Using journal substyle \@journal.}%
+% \end{macrocode}
+% Journal class 1a uses the (superscript) numerical citation style by default.
+% \begin{macrocode}
+ \@booleanfalse\authoryear@sw
+% \end{macrocode}
+%
+% End of \classoption{rsi} code.
+% \begin{macrocode}
+}%
+% \end{macrocode}
+%
+% \subsubsection{\classoption{jap}}%
+%Sole member of the journal class 1b.
+%
+% No running title.
+% \begin{macrocode}
+\def\rtx@aipjap{%
+ \typeout{Using journal substyle \@journal.}%
+% \end{macrocode}
+% Journal class 1b uses the (superscript) numerical citation style by default.
+% \begin{macrocode}
+ \@booleanfalse\authoryear@sw
+ \let\@runningtitle\@empty
+% \end{macrocode}
+%
+% End of \classoption{jap} code.
+% \begin{macrocode}
+}%
+% \end{macrocode}
+%
+% \subsubsection{\classoption{apl}}%
+%Sole member of the journal class 2.
+%
+% No running title.
+% \begin{macrocode}
+\def\rtx@aipapl{%
+ \typeout{Using journal substyle \@journal.}%
+% \end{macrocode}
+% Journal class 2 uses the (superscript) numerical citation style by default.
+% \begin{macrocode}
+ \@booleanfalse\authoryear@sw
+ \let\@runningtitle\@empty
+% \end{macrocode}
+%
+% End of \classoption{apl} code.
+% \begin{macrocode}
+}%
+% \end{macrocode}
+%
+% \subsubsection{\classoption{cha}}%
+%Sole member of the journal class 3a.
+% \begin{macrocode}
+\def\rtx@aipcha{%
+ \typeout{Using journal substyle \@journal.}%
+% \end{macrocode}
+% Article titles are allowed.
+% \begin{macrocode}
+ \@booleanfalse\aip@jtitx@sw
+% \end{macrocode}
+%
+% End of \classoption{cha} code.
+% \begin{macrocode}
+}%
+% \end{macrocode}
+%
+% \subsubsection{\classoption{pof}}%
+%Sole member of the journal class 3b.
+% \begin{macrocode}
+\def\rtx@aippof{%
+ \typeout{Using journal substyle \@journal.}%
+% \end{macrocode}
+% Journal class 3b uses the (superscript) numerical citation style by default.
+% Article titles are required, so we include them if available,
+% but if absent, we can do no more than make a warning in the \file{.blg}.
+% \begin{macrocode}
+ \@booleanfalse\authoryear@sw
+ \@booleanfalse\aip@jtitx@sw
+% \end{macrocode}
+%
+% End of \classoption{pof} code.
+% \begin{macrocode}
+}%
+% \end{macrocode}
+%
+% \subsubsection{\classoption{bmf}}%
+% A member of the journal class 4a,
+% the Biomicrofluidics journal is single column.
+% \begin{macrocode}
+\def\rtx@aipbmf{%
+ \typeout{Using journal substyle \@journal.}%
+% \end{macrocode}
+% Journal class 4a uses the (superscript) numerical citation style by default.
+% Journal is formatted in a single column.
+% \begin{macrocode}
+ \@booleanfalse\authoryear@sw
+ \@booleanfalse\twocolumn@sw
+% \end{macrocode}
+%
+% End of \classoption{bmf} code.
+% \begin{macrocode}
+}%
+% \end{macrocode}
+%
+% \subsubsection{\classoption{rse}}%
+%A member of the journal class 4a.
+% \begin{macrocode}
+\def\rtx@aiprse{%
+ \typeout{Using journal substyle \@journal.}%
+% \end{macrocode}
+% Journal class 4a uses the (superscript) numerical citation style by default.
+% \begin{macrocode}
+ \@booleanfalse\authoryear@sw
+% \end{macrocode}
+%
+% End of \classoption{rse} code.
+% \begin{macrocode}
+}%
+% \end{macrocode}
+%
+% \subsubsection{\classoption{jmp}}%
+% Sole member of the journal class 4b, Journal of Mathematical Physics is single column.
+% For an example of \env{itemize}, see JMP\_122901\_1 (48).
+% \begin{macrocode}
+\def\rtx@aipjmp{%
+ \typeout{Using journal substyle \@journal.}%
+% \end{macrocode}
+% Article titles are allowed.
+% Journal is formatted in a single column.
+% \begin{macrocode}
+ \@booleanfalse\aip@jtitx@sw
+ \@booleanfalse\twocolumn@sw
+% \end{macrocode}
+%
+% End of \classoption{jmp} code.
+% \begin{macrocode}
+}%
+% \end{macrocode}
+%
+% \subsection{Establish AIP Defaults\label{sec:aip-defaults}}
+%
+% \begin{macro}{\footinbib@sw}
+% All AIP journals invoke the \classoption{footinbib} option.
+% \begin{macrocode}
+\@booleantrue\footinbib@sw
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\place@bibnumber}
+% \begin{macro}{\@bibstyle}
+% \begin{macro}{\bibpunct}
+% We install code that will
+% govern the style in which \cmd\cite\ commands are
+% formatted,
+% select the presentation for \cmd\bibitem s
+% and control the \BibTeX\ processing.
+%
+% Note that a journal substyle may override these settings.
+% Likewise, document preamble may itself invoke \cmd\bibpunct\ or \cmd\bibliographystyle,
+% thereby overriding these settings and those of the journal substyle.
+%
+% The numbered citations of \file{aipnum} and \file{aipauthnum}
+% are compatible with \classoption{footinbib} and
+% the compression and coalescing features of \classname{natbib},
+% while \file{aipauth}'s author-year citations are not.
+% Therefore, we de-select such options if we are selecting author-year citations.
+%
+% Note on \classname{natbib} presets:
+% \file{aipnum} and \file{aipauthnum} uses the Chicago \cmd\bibpunct\ style;
+% while \file{aipauth} uses that of Nature.
+%
+% Note on \cmd\NAT@mcite: if not using numerical citations, we set \cmd\NAT@mcite\
+% to a lower value, to turn off the mcite semantics of \classname{natbib}.
+% \begin{macrocode}
+\let\place@bibnumber\place@bibnumber@sup
+\appdef\setup@hook{%
+ \authoryear@sw{%
+ \aip@jtitx@sw{%
+ \def\@bibstyle{aipauth\substyle@post}%
+ }{%
+ \def\@bibstyle{aipauth\substyle@post long}%
+ }%
+ \authornum@sw{%
+ \bibpunct{}{}{,}{s}{}{\textsuperscript{,}}%
+ \let\onlinecite\rev@citealpnum
+ }{%
+ \bibhang10\p@
+ \bibpunct{(%)
+ }{%(
+ )}{; }{a}{,}{,}%
+ \@booleanfalse\footinbib@sw
+ \let\NAT@mcite\@ne
+ \let\NAT@sort\z@
+ \def\NAT@cmprs{\z@}%
+ \let\NAT@def@citea\rtx@def@citea
+ \let\NAT@def@citea@close\rtx@def@citea@close
+ }%
+ }{%
+ \aip@jtitx@sw{%
+ \def\@bibstyle{aipnum\substyle@post}%
+ }{%
+ \def\@bibstyle{aipnum\substyle@post long}%
+ }%
+ \bibpunct{}{}{,}{s}{}{\textsuperscript{,}}%
+ \let\onlinecite\rev@citealpnum
+ }%
+}%
+\def\make@footnote@endnote{%
+ \footinbib@sw{%
+ \authoryear@sw{\authornum@sw{\false@sw}{\true@sw}}{\false@sw}%
+ {}{%
+ \ltx@footnote@push
+ \def\thempfn{Note\thefootnote}%
+ \let\ltx@footmark\rev@citemark
+ \let\ltx@foottext\rev@endtext
+ \appdef\class@enddocumenthook{\auto@bib}%
+ \let\printendnotes\relax
+ }%
+ }{}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\aipreprint}%
+% We want to override \filename{aps10pt.rtx}.
+% \begin{macrocode}
+\def\aipreprint{%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\aippreprint}%
+% We want to override \filename{aps12pt.rtx}.
+% \begin{macrocode}
+\def\aippreprint{%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \Finale
+% %Here ends the programmer's documentation.
+% \endinput
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/revtex/ltxdocext.dtx b/Master/texmf-dist/source/latex/revtex/ltxdocext.dtx
index ee9d71c9c04..a6ca9e78b9a 100644
--- a/Master/texmf-dist/source/latex/revtex/ltxdocext.dtx
+++ b/Master/texmf-dist/source/latex/revtex/ltxdocext.dtx
@@ -1,67 +1,151 @@
-% \iffalse &pdflatex ltxdoc klootch
+% \iffalse meta-comment balanced on line 108
% ltxdocext.dtx: package to extend the ltxdoc class of standard LaTeX
-% Copyright (c) 1999 Arthur Ogawa
+% Copyright (c) 2008 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.3 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 ltxdocext.dtx
+% and the derived files
+% ltxdocext.sty, ltxdocext.pdf, ltxdocext.ins, ltxdocext.drv.
+% Distribution:
+% CTAN:macros/latex/contrib/revtex/
+%
+% Unpacking:
+% tex ltxdocext.dtx
+%
+% Documentation:
+% latex ltxdocext.dtx; ...
+%
+% Program calls to get the documentation (example):
+% pdflatex ltxdocext.dtx
+% makeindex -s gind.ist ltxdocext.idx
+% makeindex -s gglo.ist -o ltxdocext.gls ltxdocext.glo
+% pdflatex ltxdocext.dtx
+% makeindex -s gind.ist ltxdocext.idx
+% pdflatex ltxdocext.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
+%</ignore>
+%<*install>
+\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.
+
+License
+ You may distribute this file under the conditions of the
+ LaTeX Project Public License 1.3 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{ltxdocext.sty}{%
+ \from{ltxdocext.dtx}{package,kernel}%
+ }%
+ \file{acrofont.sty}{\from{ltxdocext.dtx}{fonts}}%
+ }%
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation, please move}
+\Msg{* ltxdocext.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 ltxdocext.dtx through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
% \fi
-% \CheckSum{938}
-%% \CharacterTable
-%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
-%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
-%% Digits \0\1\2\3\4\5\6\7\8\9
-%% Exclamation \! Double quote \" Hash (number) \#
-%% Dollar \$ Percent \% Ampersand \&
-%% Acute accent \' Left paren \( Right paren \)
-%% Asterisk \* Plus \+ Comma \,
-%% Minus \- Point \. Solidus \/
-%% Colon \: Semicolon \; Less than \<
-%% Equals \= Greater than \> Question mark \?
-%% Commercial at \@ Left bracket \[ Backslash \\
-%% Right bracket \] Circumflex \^ Underscore \_
-%% Grave accent \` Left brace \{ Vertical bar \|
-%% Right brace \} Tilde \~}%
+%
+% \GetFileInfo{ltxdocext.dtx}\CheckSum{941}
%
% \iffalse ltxdoc klootch
+%<*ltxdocext>
%%% @LaTeX-file{
%%% filename = "ltxdocext.dtx",
-%%% version = "0.0a0",
-%%% date = "1999/06/04",
+%%% version = "1.0",
+%%% date = "2008/08/13",
%%% time = "11:23:00 GMT",
%%% checksum = "929",
-%%% author = "Arthur Ogawa (mailto:ogawa@teleport.com)",
-%%% copyright = "Copyright (C) 1999 Arthur Ogawa,
-%%% all rights reserved. Copying of this file is
-%%% authorized only if either:
-%%% (1) you make absolutely no changes to your copy,
-%%% including name; OR
-%%% (2) if you do make changes, you first rename it
-%%% to some other name.",
+%%% author = "Arthur Ogawa (mailto:arthur_ogawa at sbcglobal.net),
+%%% commissioned by the American Physical Society.
+%%% ",
+%%% copyright = "Copyright (C) 1999, 2008 Arthur Ogawa,
+%%% distributed under the terms of the
+%%% LaTeX Project Public License, see
+%%% ftp://ctan.tug.org/macros/latex/base/lppl.txt
+%%% ",
%%% address = "Arthur Ogawa,
%%% USA",
%%% telephone = "",
%%% FAX = "",
-%%% email = "ogawa@teleport.com",
+%%% email = "mailto colon arthur_ogawa at sbcglobal.net",
%%% codetable = "ISO/ASCII",
%%% keywords = "latex, ltxdoc",
%%% supported = "yes",
%%% abstract = "extensions to the ltxdoc class",
%%% docstring = "The checksum field above generated by ltxdoc",
%%% }
+%</ltxdocext>
% \fi
%
% \iffalse ltxdoc klootch
-% The following references the \file{00readme.txt} file,
+% The following references the \file{README} 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*}{00readme.txt}" to locate it.
-% \fi\input{00readme.txt}%
+% Search on "{filecontents*}{README}" to locate it.
+% \fi\input{README}%
%
% \subsection{Bill of Materials}
%
@@ -75,15 +159,15 @@
%\end{verbatim}
%
% \subsubsection{Generated by \texttt{latex ltxdocext.dtx}}%
-% Typesetting the source file under \LaTeX\
-% generates the readme and the installer.
+% Typesetting the source file under pdflatex
+% generates the readme and the documentation.
%\begin{verbatim}
-%00readme.txt ltxdocext.ins
+%README ltxdocext.pdf
%\end{verbatim}
%
% \subsubsection{Generated by \texttt{tex ltxdocext.ins}}%
-% Typesetting the installer generates
-% the package files.
+% Typesetting this file with \TeX\ generates
+% the package file.
%\begin{verbatim}
%ltxdocext.sty acrofont.sty
%\end{verbatim}
@@ -103,8 +187,7 @@
%
% \section{Code common to all modules}%
%
-% The following may look a bit klootchy, but we
-% want to require only one place in this file
+% 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.
@@ -114,18 +197,18 @@
% An appropriate message is displayed if
% a different \TeX{} format is used.
% \begin{macrocode}
-%<*doc|extensions|fonts>
+%<*driver|package|fonts>
\NeedsTeXFormat{LaTeX2e}[1995/12/01]%
-%</doc|extensions|fonts>
+%</driver|package|fonts>
% \end{macrocode}
% As desired, the following modules all
% take common version information:
% \begin{macrocode}
-%<extensions>\ProvidesFile{ltxdocext.sty}%
+%<package>\ProvidesFile{ltxdocext.sty}%
%<fonts>\ProvidesFile{acrofont.sty}%
-%<*doc>
+%<*driver>
\expandafter\ProvidesFile\expandafter{\jobname.dtx}%
-%</doc>
+%</driver>
% \end{macrocode}
%
% The following line contains, for once and for all,
@@ -134,7 +217,7 @@
% consistently in all generated files and in the
% typeset documentation.
% \begin{macrocode}
- [1999/06/04 0.0a0 ltxdoc extensions package]% \fileversion
+ [2008/08/04 1.1b2 ltxdoc extensions package]% \fileversion
% \end{macrocode}
%
%
@@ -142,7 +225,7 @@
%
% This module, consisting of the present section,
% typesets the programmer's documentation,
-% generating the \file{.ins} installer and \file{00readme.txt} as required.
+% generating the \file{README} as required.
%
% Because the only uncommented-out lines of code at the beginning of
% this file constitute the \file{doc} module itself,
@@ -155,38 +238,22 @@
% The \enve{document} command concludes the typesetting run.
%
% \begin{macrocode}
-%<*doc>
-% \end{macrocode}
-%
-% \subsection{Stubs for \file{ltxdocext.sty} and \file{acrofont.sty}}
-%
-% This \env{filecontents} environment generates stub files
-% \file{ltxdocext.sty} and \file{acrofont.sty}.
-% Stubs are needed because the documentation for this package
-% requires them and they might not yet be present.
-%
-% A real version of these files will be generated
-% when you typeset \file{ltxdocext.ins}, at which point
-% the stub file will be overwritten (you will have to give {\sc docstrip}
-% permission to do this).
-% \begin{macrocode}
-\begin{filecontents}{ltxdocext.sty}
-% Stub version of ltxdocext.sty
-\end{filecontents}
-\begin{filecontents}{acrofont.sty}
-% Stub version of acrofont.sty
-\end{filecontents}
+%<*driver>
% \end{macrocode}
%
% \subsection{The Preamble}
% The programmers documentation is formatted
-% with the \classname{ltxdoc} class with local customizations,
+% with the \classname{ltxdoc} document class, with local customizations,
% and with the usual code line indexing.
% \begin{macrocode}
\documentclass[draft]{ltxdoc}
\RequirePackage{ltxdocext}%
-\RequirePackage{acrofont}%
-\CodelineIndex\EnableCrossrefs
+\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 ltxdocext
+\RecordChanges % makeindex -s gglo.ist -o ltxdocext.gls ltxdocext.glo
% \end{macrocode}
%
% \subsubsection{Docstrip and info directives}
@@ -201,78 +268,6 @@
\expandafter\GetFileInfo\expandafter{\jobname.dtx}%
% \end{macrocode}
%
-%
-% \subsection{The installer file}
-%
-% The installer \file{ltxdocext.ins} appears here.
-% If you have retrieved the standard distribution of this package,
-% the installer file is already on your filesystem.
-% If you are bootstrapping,
-% the first typesetting of the \file{.dtx} file
-% will cause the installer to be generated.
-%
-% The following modules are used to direct
-% {\sc docstrip} in generating the external files:
-% \begin{center}
-% \begin{tabular}{lll}
-% \textbf{Module}&\textbf{File}&\textbf{Description}\\
-% doc &\file{ltxdocext.drv}&driver for programmer's documantation\\
-% extensions&\file{ltxdocext.sty}&ltxdoc extensions package\\
-% fonts &\file{acrofont.sty} &package to use only Acrobat fonts
-% \end{tabular}
-% \end{center}
-%
-% \begin{macrocode}
-\begin{filecontents}{ltxdocext.ins}
-%% This file will generate documentation and runtime files
-%% from ltxdocext.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 00readme.txt.
-
-Copyright notice.
-
- These files are distributed
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-\endpreamble
-\keepsilent
- \generate{%
- \file{ltxdocext.drv}{\from{ltxdocext.dtx}{doc}}%
- \file{ltxdocext.sty}{\from{ltxdocext.dtx}{extensions}}%
- \file{acrofont.sty}{\from{ltxdocext.dtx}{fonts}}%
- }%
-\ifToplevel{
-\Msg{***********************************************************}
-\Msg{*}
-\Msg{* To finish the installation, please move}
-\Msg{* ltxdocext.sty}
-\Msg{* into a directory searched by TeX.}
-\Msg{*}
-\Msg{* To produce the user documentation,
- run ltxdocext.tex through LaTeX.}
-\Msg{*}
-\Msg{* To produce the programmer documentation,
- run ltxdocext.dtx through LaTeX.}
-\Msg{*}
-\Msg{* Happy TeXing}
-\Msg{***********************************************************}
-}
-\endbatchfile
-\end{filecontents}
-% \end{macrocode}
-% Note that, because all of the files generated by the installer
-% are part of the standard distribution, it will
-% be necessary to run the installer only when bootstrapping
-% (or, of course, during development).
-% Note, too, that it is rare to generate the \file{doc}
-% module because it suffices to simply typeset the \file{.dtx} file itself.
-%
% \subsection{The ``Read Me'' File}
% As promised above, here is the contents of the
% ``Read Me'' file. That file serves a double purpose,
@@ -297,29 +292,41 @@ Copyright notice.
% begin the programmer's manual.
%
% \begin{macrocode}
-\begin{filecontents*}{00readme.txt}
+\begin{filecontents*}{README}
\title{%
Extensions to the \classname{ltxdoc} class%
\thanks{%
This file has version number \fileversion,
last revised \filedate.%
- % For version number and date, search on "\fileversion" in the .dtx file,
- % or see the end of the 00readme.txt file.
+ }%
+ \thanks{%
+ Version \fileversion\ \copyright\ 2008 The American Physical Society
}%
}%
-
\author{%
-Arthur Ogawa (\texttt{mailto:ogawa@teleport.com}),
-\fileversion\\Copyright (C) 1999 Arthur Ogawa
+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 file.
+%\fi
+
\maketitle
This file embodies the \classname{ltxdocext} package,
the implementation and its user documentation.
The distribution point for this work is
-\url{ftp://ftp.teleport.com/users/ogawa/macros/latex/contrib/supported/ltxdocext...},
-which contains fully unpacked, prebuilt runtime files and documentation.
+\url{publish.aps.org/revtex},
+which contains prebuilt runtime files, documentation, and full source,
+ready to add to a TDS-compliant \TeX\ installation.
+
+The \classname{ltxdocext} package was commissioned by the American Physical Society
+and is distributed under the terms of the \LaTeX\ Project Public License,
+the same license under which all the portions of \LaTeX\ itself are 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\
@@ -348,8 +355,8 @@ package and the \classname{acrofont} package.
The package files \file{ltxdocext.sty} and \file{acrofont.sty}
are generated from this file, \file{ltxdocext.dtx},
-via the {\sc docstrip} facility of \LaTeX
-via |tex ltxdocext.ins|.
+using the {\sc docstrip} facility of \LaTeX
+via |tex ltxdocext.dtx| (Note: do \emph{not} use \LaTeX\ for this step).
The typeset documentation that you are now reading is generated from
the same file by typesetting it with \LaTeX\ or pdftex
via |latex ltxdocext.dtx| or |pdflatex ltxdocext.dtx|.
@@ -362,26 +369,41 @@ then carry out the following steps:
\begin{enumerate}
\item
Within an otherwise empty directory,
-typeset \file{ltxdocext.dtx} with \LaTeX\ or pdflatex;
-you will obtain the typeset documentation you are now reading,
-along with
-the installer \file{ltxdocext.ins},
-and the file \file{00readme.txt}.
-\item
-Now typeset \file{ltxdocext.ins},
+typeset \file{ltxdocext.dtx} with \TeX\ or pdftex;
thereby generating the package file \file{ltxdocext.sty},
and the package file \file{acrofont.sty}.
Make sure that {\sc docstrip} receives permission
to overwrite existing versions of these packages.
\item
-Install \classname{ltxdocext.sty} and \classname{acrofont.sty}
-by moving them to a location
-in your filesystem where they will be found by \LaTeX.
-\item
-Now complete the typesetting of the documentation by
-retypesetting \file{ltxdocext.dtx}.
-Note: you will have to run \LaTeX\ twice, then \file{makeindex}, then
+Now
+typeset \file{ltxdocext.dtx} with \LaTeX\ or pdflatex;
+you will obtain the typeset documentation you are now reading,
+along with
+the file \file{README}.
+
+Note: you will have to run \LaTeX, then
+\file{makeindex} \texttt{-s gind.ist ltxdocext.idx}, then
+\file{makeindex} \texttt{-s gglo.ist -o ltxdocext.gls ltxdocext.glo}, then
\LaTeX\ again in order to obtain a valid index and table of contents.
+\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{ltxdocext.sty} and
+\file{$TEXMF/}\file{tex/}\file{latex/}\file{revtex/}\classname{acrofont.sty}
+\item
+\file{$TEXMF/}\file{source/}\file{latex/}\file{revtex/}\classname{ltxdocext.dtx}
+\item
+\file{$TEXMF/}\file{doc/}\file{latex/}\file{revtex/}\classname{ltxdocext.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{\{ltxutil\}} in your document preamble!
\end{enumerate}
\end{filecontents*}
% \end{macrocode}
@@ -394,12 +416,9 @@ Note: you will have to run \LaTeX\ twice, then \file{makeindex}, then
% \begin{macrocode}
\begin{document}%
\expandafter\DocInput\expandafter{\jobname.dtx}%
-% ^^A\PrintChanges
+\PrintChanges
\end{document}
-% \end{macrocode}
-%
-% \begin{macrocode}
-%</doc>
+%</driver>
% \end{macrocode}
%
% \section{Using the \classname{ltxdoc} and \classname{acrofont} packages}%
@@ -458,7 +477,7 @@ Note: you will have to run \LaTeX\ twice, then \file{makeindex}, then
%
% \begin{unnumtable}
% \begin{tabular}{ll}
-% meta-text &\cmd\m\arg{text}\\
+% meta-text &\cmd\marg\arg{text}\\
% command &\cmd\cmd\cmd\csname\\
% environment name &\cmd\env\arg{name}\\
% \cmd\begin\verb`{foo}`&\cmd\envb\arg{foo}\\
@@ -535,18 +554,28 @@ Note: you will have to run \LaTeX\ twice, then \file{makeindex}, then
%\StopEventually{}
%
% \section{Extensions to the ltxdoc class}
-% The \file{extensions} {\sc docstrip} module comprises the
+% The \file{package} {\sc docstrip} module comprises the
% package \classname{ltxdocext.sty}, which provides extensions
% to the standard \LaTeX\ \classname{ltxdoc} class.
%
-% \subsection{Beginning of the \file{extensions} {\sc docstrip} module}
+% \subsection{Beginning of the \file{package} {\sc docstrip} module}
+% This portion of code is only present in the \LaTeX\ package (\texttt{.sty} file),
+% not in the kernel portion.
% \begin{macrocode}
-%<*extensions>
+%<*package>
\def\class@name{ltxdocext}%
\expandafter\PackageInfo\expandafter{\class@name}{%
An extension to the \protect\LaTeXe\space ltxdoc class
- by A. Ogawa (ogawa@teleport.com)%
+ by A. Ogawa (arthur\_ogawa sbcglobal.net)%
}%
+%</package>
+% \end{macrocode}
+%
+% \subsection{Beginning of the \file{kernel} {\sc docstrip} module}
+%
+% The bulk of the code is the kernel portion; a brief tail of \file{package} code then follows.
+% \begin{macrocode}
+%<*kernel>
% \end{macrocode}
%
% \subsection{Incorporate \classname{ltxguide.cls} extensions}
@@ -596,7 +625,7 @@ Note: you will have to run \LaTeX\ twice, then \file{makeindex}, then
\catcode`\>=\active
\gdef<{\@ifnextchar<\@lt\@meta}
\gdef>{\@ifnextchar>\@gt\@gtr@err}
- \gdef\@meta#1>{\m{#1}}
+ \gdef\@meta#1>{\marg{#1}}
\gdef\@lt<{\char`\<}
\gdef\@gt>{\char`\>}
\endgroup
@@ -630,7 +659,7 @@ Note: you will have to run \LaTeX\ twice, then \file{makeindex}, then
%
% Various forms of self-indexing commands:
% \begin{macrocode}
-\DeclareRobustCommand{\m}[1]{%
+\DeclareRobustCommand{\marg}[1]{%
\meta{#1}%
\index{#1=\string\meta{#1} placeholder}\index{placeholder>#1=\string\meta{#1}}%
}%
@@ -652,7 +681,7 @@ Note: you will have to run \LaTeX\ twice, then \file{makeindex}, then
\index{argument, optional>#1=\string\ttt{#1}}%
}%
\DeclareRobustCommand\cmd{\begingroup\makeatletter\@cmd}%
-\def\@cmd#1{%
+\long\def\@cmd#1{%
\endgroup
\cs{\expandafter\cmd@to@cs\string#1}%
\expandafter\cmd@to@index\string#1\@nil
@@ -675,7 +704,8 @@ Note: you will have to run \LaTeX\ twice, then \file{makeindex}, then
{\ttfamily\string\begin\string{}\env{#1}{\ttfamily\string}}%
}%
\DeclareRobustCommand\enve[1]{{\ttfamily\string\end\string{}\env{#1}{\ttfamily\string}}}%
-\DeclareRobustCommand*{\file}[1]{%
+\DeclareRobustCommand{\file}{\begingroup\@sanitize\@file}%
+\long\def\@file#1{\endgroup
{\ttfamily#1}%
\index{#1=\string\ttt{#1}}\index{file>#1=\string\ttt{#1}}%
}%
@@ -723,9 +753,10 @@ Note: you will have to run \LaTeX\ twice, then \file{makeindex}, then
\columnsep 35\p@
\def\see##1##2{\textit{See} ##1}%
\def\seealso##1##2{\textit{See also} ##1}%
-\def\cmd##1{\cs{\expandafter\cmd@to@cs\string##1}}%
+\long\def\cmd##1{\cs{\expandafter\cmd@to@cs\string##1}}%
\def\@url##1{\url@break\ttt{##1}\endgroup}%
-\def\ttt##1{{\ttfamily##1}}%
+\def\ttt{\begingroup\@sanitize\ttfamily\@ttt}%
+\def\@ttt##1{##1\endgroup}%
\mathchardef\save@secnumdepth\c@secnumdepth
\c@secnumdepth\m@ne
\twocolumn[\section{\indexname}]%
@@ -799,9 +830,9 @@ Note: you will have to run \LaTeX\ twice, then \file{makeindex}, then
%
% Emulate \cmd\toprule\ and friends
% \begin{macrocode}
-\newcommand\toprule{\hline\hline}%
-\newcommand\colrule{\\\hline}%
-\newcommand\botrule{\\\hline\hline}%
+\providecommand\toprule{\hline\hline}%
+\providecommand\colrule{\\\hline}%
+\providecommand\botrule{\\\hline\hline}%
% \end{macrocode}
%
% Define sectioning command below \cmd\subsubsection.
@@ -860,7 +891,7 @@ Note: you will have to run \LaTeX\ twice, then \file{makeindex}, then
%
% Direct \classname{ltxdoc} to produce an index.
% \begin{macrocode}
-\AtEndDocument{\PrintIndex}%
+\AtEndDocument{\PrintIndex\PrintChanges}%
% \end{macrocode}
%
% \subsection{Extension to \LaTeX's \env{filecontents} Environment}
@@ -901,10 +932,20 @@ Note: you will have to run \LaTeX\ twice, then \file{makeindex}, then
\setlength\arraycolsep{0pt}%
% \end{macrocode}
%
-% \subsection{End of the \file{extensions} {\sc docstrip} module}
-% Here ends the module.
+% \subsection{End of the \file{kernel} {\sc docstrip} module}
+%
+% \begin{macrocode}
+%</kernel>
+% \end{macrocode}
+%
+% \subsection{Tail of the \file{package} {\sc docstrip} module}
+% Here is the remainder of the package code.
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+% Currently, there is little.
% \begin{macrocode}
-%</extensions>
+%</package>
% \end{macrocode}
%
%
@@ -933,7 +974,7 @@ Note: you will have to run \LaTeX\ twice, then \file{makeindex}, then
\def\class@name{ltxdocext}%
\expandafter\ClassInfo\expandafter{\class@name}{%
Written for \protect\LaTeXe\space
- by A. Ogawa (ogawa@teleport.com)%
+ by A. Ogawa (arthur_ogawa at sbcglobal.net)%
}%
% \end{macrocode}
% \end{macro}
@@ -1085,8 +1126,7 @@ Note: you will have to run \LaTeX\ twice, then \file{makeindex}, then
% \begin{itemize}
% \item
% Each new macro definition or register assignment begins a new line.
-% Therefore, \cmd\def, \cmd\newcommand, and their ilk will start in column
-% 1.
+% Therefore, \cmd\def, \cmd\newcommand, and their ilk will start in column~1.
% \item
% Code is indented one space for each level of nesting within braces
% \verb|{}|.
@@ -1108,11 +1148,19 @@ Note: you will have to run \LaTeX\ twice, then \file{makeindex}, then
% small monitors.
% But \classname{ltxdoc} output looks better with the shorter lines, too.
% \item
-% Extraneous whitespace is avoided by using the comment character |%|.
+% Extraneous whitespace in the replacement part of a macro definition
+% is avoided by using the comment character |%|.
% In most cases, if falling at the end of a line of code,
% a brace will be immediately followed by a comment character,
% as will the macro parameter |#1| and any one-letter control sequence,
% like |\\|.
+% \item
+% Extraneous whitespace in the package file is also avoided.
+% When \TeX\ reads in the .sty file, it will process \cmd\def s, and other commands,
+% but will not process blank spaces.
+% This practice is simply a discipline. You don't need to do this.
+% But sometimes \TeX\ has to read in a file while it is in horizontal mode,
+% at which point this practice is essential.
% \end{itemize}
% These conventions taken together are illustrated by the following:
% \begin{verbatim}
@@ -1172,7 +1220,7 @@ Note: you will have to run \LaTeX\ twice, then \file{makeindex}, then
% is very useful and produces code that executes nicely.
% Using it also helps avoid your having to debug problems where
% \cmd\if\dots\ and \cmd\fi\ are not properly balanced
-% (a nightmare in case you didn't already experience it).
+% (a nightmare, in case you have not already experienced it).
%
% \end{itemize}
%
@@ -1200,9 +1248,9 @@ Note: you will have to run \LaTeX\ twice, then \file{makeindex}, then
% I cannot help but notice that much of the code of \LaTeX\ itself fails
% to comply with many of the coding recommendations of Team \LaTeX.
%
-%
% \Finale
-% %Here ends the programmer's documentation.
+% \iffalse Here ends the programmer's documentation.\fi
% \endinput
%
\endinput
+%%EOF
diff --git a/Master/texmf-dist/source/latex/revtex/ltxfront.dtx b/Master/texmf-dist/source/latex/revtex/ltxfront.dtx
new file mode 100644
index 00000000000..b9432481136
--- /dev/null
+++ b/Master/texmf-dist/source/latex/revtex/ltxfront.dtx
@@ -0,0 +1,3599 @@
+% \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.3 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
+%</ignore>
+%<*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 00readme.tex.
+
+License
+ You may distribute this file under the conditions of the
+ LaTeX Project Public License 1.3 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
+%</install>
+%<*ignore>
+\fi
+%</ignore>
+% \fi
+%
+% \GetFileInfo{ltxfront.dtx}\CheckSum{2012}
+%
+% \iffalse ltxdoc klootch
+%<*package>
+%%% @LaTeX-file{
+%%% filename = "ltxfront.dtx",
+%%% version = "4.1h",
+%%% date = "2009/10/09",
+%%% time = "11:23:00 GMT+8",
+%%% checksum = "2012",
+%%% 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, 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",
+%%% docstring = "The checksum field above generated by ltxdoc",
+%%% }
+%</package>
+% \fi
+%
+% \iffalse ltxdoc klootch
+% The following references the \file{00readme} 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*}{00readme}" to locate it.
+% \fi\input{00readme}%
+%
+% \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}00readme\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}
+%<*driver|package>
+\NeedsTeXFormat{LaTeX2e}[1995/12/01]%
+%</driver|package>
+% \end{macrocode}
+% As desired, the following modules all
+% take common version information:
+% \begin{macrocode}
+%<package>\ProvidesFile{ltxfront.sty}%
+%<*driver>
+\expandafter\ProvidesFile\expandafter{\jobname.dtx}%
+%</driver>
+% \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}
+%<*driver|package>
+ [2009/10/09 4.1h frontmatter package]% \fileversion
+%</driver|package>
+% \end{macrocode}
+%
+%
+% \section{The driver module \texttt{driver}}
+%
+% This module, consisting of the present section,
+% typesets the programmer's documentation,
+% generating the \file{00readme} and sample document as needed.
+%
+% Because the only uncommented-out lines of code at the beginning of
+% this file constitute the \file{driver} module itself,
+% we can simply typeset the \file{.dtx} file directly,
+% and there is thus rarely any need to
+% generate the ``driver'' {\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}
+%<*driver>
+% \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*}{00readme.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\ 2009 The 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 00readme file.
+%\fi
+\maketitle
+
+This file embodies the \classname{ltxfront} package,
+the implementation and its user documentation.
+
+The distribution point for this work is
+\url{http://publish.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,
+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{00readme}.
+
+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}%
+
+\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}
+%</driver>
+% \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}
+%<your document here>
+%\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}%
+%<class customization commands>
+%\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. These 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)%
+}%
+%</package>
+% \end{macrocode}
+%
+% \subsection{Banner}%
+% Credit where due.
+% \begin{macrocode}
+%<*kernel>
+\typeout{%
+ ltxfront [2009/10/06/20:20 4.1g]: Arthur Ogawa (after David P. Carlisle)%
+}%
+%</kernel>
+% \end{macrocode}
+%
+% \subsection{Prerequisites}%
+%
+% This package requires the use of the \classname{ltxutil} package.
+% \begin{macrocode}
+%<*package>
+\let\class@name\package@name
+\RequirePackage{ltxutil}%
+%</package>
+% \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.
+% \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 amalgamated
+% 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.
+% This affects the meaning of \cmd\@author@present\ and \cmd\@tempaffil.
+% FIXME: apparently \cmd\@tempaffil\ and its aliases are never used.
+%
+% 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 false.
+%
+% \classoption{groupedaddress}, the default, 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}
+%</options>
+% \end{macrocode}
+%
+% \subsection{Process package options}%
+% \begin{macrocode}
+%<*package>
+\DeclareOption*{\OptionNotUsed}%
+\ProcessOptions*
+%</package>
+% \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
+}%
+\def\@author@def#1#2{%
+ \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}
+%
+% We first finish off any author- or affiliation groups in progress.
+% Next, we detect the case where there is an author 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{%
+ \move@AU\move@AF
+ \@ifx{\AU@grp\@empty}{}{%
+ \@ifx{\AF@grp\@empty}{%
+ \begingroup
+ \frontmatterverbose@sw{\say\AU@grp}{}%
+ \let\href\@secondoftwo
+ \let\AU@opr\@secondofthree
+ \let\CO@opr\@secondofthree
+ \let\footnote\@gobble
+ \class@warn{Assuming \string\noaffiliation\space for \AU@grp}%
+ \endgroup
+ \@affil@def{}\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 similarity 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.
+%
+% 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{%
+ \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}}
+% User-level command \cmd\noaffiliation\ signifies that the current group of authors has \emph{no} affiliation.
+%
+% This is implemented by acting as if the \cmd\affiliation\ command has been given, and using a
+% flag value of \{\}, which adds an element to the affiliation group of this author,
+% albeit a nil one (\cmd\AFF@opr\ \{\cmd\z@\} \{\}).
+% \begin{macrocode}
+\newcommand\frontmatter@noaffiliation{%
+ \move@AU\move@AF
+ \@affil@def{}\move@AF
+ \move@AUAF
+}%
+\def\blankaffiliation{{}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@affil@cleared}
+% \begin{macro}{\@affil@init}
+% \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}}
+%
+% 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{{{}}{}}%
+\appdef\frontmatter@init{%
+ \@affil@init
+}%
+\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}
+%
+% \begin{macro}{\move@AF}
+% \changes{4.1b}{2008/08/02}{(AO, 486) \cs{collaboration} to work with \texttt{groupedaddress}}
+% 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,
+% \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 positive 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 it on the first instance%
+ }%
+ }%
+ }%
+% \end{macrocode}
+% Removed code
+% \cmd\appdef@eval\ \cmd\AF@grp\ \cmd\@tempc,
+% which appears to have added the affiliation number even in this case.
+% \begin{macrocode}
+ }%
+% \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.
+%
+% With the expanded syntax of \cmd\collaboration, we need to label each address with
+% its associated collaboration.
+% \begin{macrocode}
+ {%
+ \@if@empty{\expandafter\@firstoftwo\@affil}{%
+ \def\@tempc{\z@}%
+ \@argswap@val{\z@}%
+ }{%
+ \advance\c@affil\@ne
+ \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
+ }%
+ }%
+ }%
+ \appdef@eval\AF@grp{\the\c@affil}%
+ }%
+% \end{macrocode}
+% Append the footnote number of the affiliation to the affiliation group of the current author group.
+% \begin{macrocode}
+ \@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 definition for the \cmd\AFF@opr, the intercollated operator for \cmd\@AFF@list,
+% when adding a new affiliation: 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 not such a 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,
+% \begin{macrocode}
+\def\move@AUAF{%
+ \@ifx{\AF@grp\@empty}%
+ {%
+ \@ifx{\@empty\CO@grp}{}{%
+ \appdef@e \@AAC@list{\CO@grp}%
+ \appdef@e \@AFG@list{\CO@grp}%
+ \let\CO@grp\@empty
+ }%
+ }{%
+% \end{macrocode}
+% First, 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}%
+ \frontmatterverbose@sw{\say\@AAC@list}{}%
+% \end{macrocode}
+% Next, 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}
+ \@ifx{\@empty\AU@grp}{%
+ \@ifx{\@empty\CO@grp}{%
+ \false@sw
+ }{%
+ \true@sw
+ }%
+ }{%
+ \true@sw
+ }%
+ {%
+ \@ifx{\@empty\AF@grp}{}{%
+ \@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}%
+ }%
+ }%
+ \@ifx{\@empty\CO@grp}{}{%
+ \appdef@e \@AFG@list{\CO@grp}%
+ \let\CO@grp\@empty
+ }%
+ }{%
+ }%
+% \end{macrocode}
+% Finally, null out the macros holding the author group and affiliation group, respectively.
+% \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.
+% 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.
+%
+% 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.
+%
+% Here is a precis of these lists, their syntax, and the usage of their associated operators:
+% \begin{verbatim}
+%\@AFF@list \AFF@opr{<affiliation ID>}{<collaboration ID>}{<address>}{<auxiliary info>} \frontmatter@author@produce@script \affils@present@group
+%\@AFG@list \AFG@opr{{<affiliation ID>}..{<affiliation ID>}} \frontmatter@author@produce@group
+%\@AAC@list \AF@opr{{<affiliation ID>}..{<affiliation ID>}} (\AU@opr|\CO@opr){<collaboration ID>}{<author>}{<auxilliary info>} \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@err
+%
+%\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}.}
+% \begin{macrocode}
+\newcommand*\homepage[1][]{\begingroup\sanitize@url\@homepage{#1}}%
+\def\@homepage#1#2{%
+ \endgroup
+ \@AF@join{#1\url{#2}}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\url}
+% \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\url{}%
+ \providecommand\href[1]{}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \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@err}
+% This command will be executed if are in a \classoption{groupedaddress} situation and
+% the document contained a \cmd\collaboration\ command.
+%
+% There already has been issued a warning message explaining that \cmd\collaboration\ is wrong in this case,
+% so here we simply gobble.
+% \begin{macrocode}
+\def\@collaboration@err#1#2{%
+%\class@warn{An illegal \string\collaboration\ command has been entered!}%
+}%
+% \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}%
+% 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.
+%
+% \begin{macrocode}
+\def\doauthor#1#2#3{%
+ \ignorespaces#1\unskip\@listcomma
+ \begingroup
+ \def\@tempifx{#3}%
+ \@ifx{\@tempifx\@empty}{%
+ \false@sw
+ }{%
+ \@ifnum{\c@affil<\affil@cutoff}{%
+ \false@sw
+ }{%
+ \true@sw
+ }%
+ }%
+ {%
+ #3\aftergroup\true@sw
+ }{%
+ \aftergroup\false@sw
+ }%
+ \@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
+ \temp@sw{%
+ \expandafter\frontmatter@footnotemark
+ \expandafter{\@tempb}%
+ }{%
+ \stepcounter\@mpfn
+ \protected@xdef\@tempb{\the\csname c@\@mpfn\endcsname}%
+ \expandafter\frontmatter@footnotemark
+ \expandafter{\@tempb}%
+ \expandafter\g@addto@macro
+ \expandafter\@FMN@list
+ \expandafter{%
+ \expandafter \@TBN@opr
+ \expandafter {\@tempb}{#1}%
+ }%
+ }%
+ \endgroup
+}%
+\appdef\frontmatter@init{%
+ \global\let\@FMN@list\@empty
+}%
+\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{\thempfn}%
+ \@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}.
+%
+% The user can elect to use this new mechanism via the \classoption{newabstract};
+% likewise the old mechanism via the \classoption{oldabstract}.
+%
+% 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
+ \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 \texttt{p@mpfootnote} instead of \texttt{p@mpfootnote}, and
+% \cmd\frontmatter@makefntext\ instead of \cmd\@makefntext.
+%
+% \changes{4.1f}{2009/07/07}{(AO, 515) Use \cs{set@footnotefont}, which is defined in ltxutil}
+% \begin{macrocode}
+\long\def\frontmatter@footnotetext#1{%
+ \minipagefootnote@pick
+ \set@footnotefont
+ \set@footnotewidth
+ \@parboxrestore
+ \protected@edef\@currentlabel{\csname p@mpfootnote\endcsname\@thefnmark}%
+ \color@begingroup
+ \frontmatter@makefntext{%
+ \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox
+ }%
+ \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.
+% \begin{macrocode}
+ \ltx@footnote@pop
+ \let\thefootnote\frontmatter@thefootnote
+ \let\@makefnmark\frontmatter@makefnmark
+ \global\c@footnote\z@
+ \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.
+% \begin{macrocode}
+\def\frontmatter@author@produce@script{%
+ \begingroup
+ \let\@author@present\@author@present@script
+ \frontmatterverbose@sw{\say\@AAC@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.
+%
+% 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
+ \frontmatterverbose@sw{\say\@AFF@list}{}%
+ \@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{}%
+ \@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 \cmd\@AFG@list\ and 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
+% |#2|---Collaboration ID
+% |#3|---Affiliation address
+% |#4|---Auxiliary info
+% \begin{macrocode}
+\def\@affil@script#1#2#3#4{%
+ \@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}
+% 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}{%
+ \let\@tempa\@empty
+ \expandafter\@affil@present@script\@affilID@temp\relax
+ }%
+ \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}%
+ }%
+ }%
+ }%
+}%
+\def\@affil@present@script#1{%
+ \@ifx{\relax#1}{%
+ \@ifx{\@tempa\@empty}{}{%
+ \textsuperscript{\expandafter\@affilcomma\@tempa\relax\relax}%
+ }%
+ }{%
+ \@ifx{\z@#1}{}{\appdef\@tempa{{#1}}}%
+ \@affil@present@script
+ }%
+}%
+\@provide\@author@parskip{\z@skip}%
+% \end{macrocode}
+% \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.
+% \begin{macrocode}
+\def\frontmatter@author@produce@group{%
+ \begingroup
+ \let\@author@present\@author@present@group
+ \frontmatter@authorformat
+ \frontmatterverbose@sw{\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
+ \frontmatterverbose@sw{\say\@AAC@list}{}%
+ \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{%
+ }{%
+ \parskip\z@ %space between affilations in grouped mode
+ }%
+ \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@err
+}%
+\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@err
+}%
+% \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}
+% \changes{4.0d}{1998/01/31}{\cs{comma@space}}
+% This version of \cmd\AU@opr\ applies to the \classoption{groupedaddress} class option.
+% Traverse the list calling the \cmd\doauthor\ hook on each author.
+% \begin{macrocode}
+\def\@author@present@group#1#2#3{%
+ \gdef\comma@space{\gdef\comma@space{\textsuperscript{,\,}}}%
+ \doauthor{#2}{#3}{}%
+ \advance\@tempcnta\m@ne
+}%
+% \end{macrocode}
+% \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
+}%
+\def\present@FM@footnote#1#2{%
+ \begingroup
+ \csname c@\@mpfn\endcsname#1\relax
+ \def\@thefnmark{\thempfn}%
+ \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}
+% 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}\c@footnote
+}%
+\@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.
+% \begin{macrocode}
+\long\def\frontmatter@makefntext#1{%
+ \parindent 1em
+ \noindent
+ \Hy@raisedlink{\hyper@anchorstart{frontmatter.\the\c@footnote}\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}
+%</kernel>
+% \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.
+%
+% FIXME: \cmd\noaffiliation\ should not be necessary!
+%
+% FIXME: footnotes not working!
+%
+% \begin{verbatim}
+% \@maketitle: \frontmatter@footnote@produce
+% \end{verbatim}
+% \begin{macrocode}
+\def\thanks@latex#1{%
+ \footnotemark
+ \expandafter\gappdef
+ \expandafter\@thanks
+ \expandafter{%
+ \expandafter\footnotetext
+ \expandafter[\the\c@footnote]{#1}}%
+}%
+\@booleanfalse\altaffilletter@sw
+% \end{macrocode}
+% \begin{macrocode}
+\@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}%
+\def\frontmatter@footnotetext{\footnotetext[\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}
+%</package>
+% \end{macrocode}
+%
+% \Finale
+% %Here ends the programmer's documentation.
+% \endinput
+%
+\endinput
+%%EOF
diff --git a/Master/texmf-dist/source/latex/revtex/ltxgrid.dtx b/Master/texmf-dist/source/latex/revtex/ltxgrid.dtx
index ab0209ed098..fdd4a9fbfc5 100644
--- a/Master/texmf-dist/source/latex/revtex/ltxgrid.dtx
+++ b/Master/texmf-dist/source/latex/revtex/ltxgrid.dtx
@@ -1,29 +1,127 @@
-% \iffalse ltxdoc klootch
+% \iffalse meta-comment balanced on line 109
% ltxgrid.dtx: package to change page grid, MVL.
-% Copyright (c) 1999 Arthur Ogawa
+% 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.3 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 ltxgrid.dtx
+% and the derived files
+% ltxgrid.sty, ltxgrid.pdf
+% Distribution:
+% CTAN:macros/latex/contrib/revtex/
+%
+% Unpacking:
+% tex ltxgrid.dtx
+%
+% Documentation:
+% latex ltxgrid.dtx; ...
+%
+% Programm calls to get the documentation (example):
+% pdflatex ltxgrid.dtx
+% makeindex -s gind.ist ltxgrid
+% makeindex -s gglo.ist -o ltxgrid.gls ltxgrid.glo
+% pdflatex ltxgrid.dtx
+% makeindex -s gind.ist ltxgrid.idx
+% pdflatex ltxgrid.dtx
+%
+% Installation:
+% TDS:doc/latex/revtex/
+% TDS:tex/latex/revtex/
+% TDS:source/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
+%</ignore>
+%<*install>
+%% This file will generate documentation and runtime files
+%% from ltxgrid.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 00readme.tex.
+
+License
+ You may distribute this file under the conditions of the
+ LaTeX Project Public License 1.3 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{ltxgrid.sty}{%
+ \from{ltxgrid.dtx}{package,kernel}%
+ }%
+ }%
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation, please move}
+\Msg{* ltxgrid.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 ltxgrid.dtx through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
% \fi
-% \GetFileInfo{ltxgrid.dtx}\CheckSum{4234}
+%
+% \GetFileInfo{ltxgrid.dtx}\CheckSum{5462}
%
% \iffalse ltxdoc klootch
-%<*ltxgrid>
+%<*package>
%%% @LaTeX-file{
%%% filename = "ltxgrid.dtx",
-%%% version = "1.0rc5",
-%%% date = "2001/07/26",
-%%% time = "12:23:00 GMT+8",
-%%% checksum = "4234",
-%%% author = "Arthur Ogawa (mailto:ogawa@teleport.com),
+%%% version = "4.1h",
+%%% date = "2009/10/09",
+%%% time = "11:23:00 GMT+8",
+%%% checksum = "5462",
+%%% author = "Arthur Ogawa (mailto:arthur_ogawa at sbcglobal.net),
%%% commissioned by the American Physical Society.
%%% ",
-%%% copyright = "Copyright (C) 1999, 2000 Arthur Ogawa,
+%%% copyright = "Copyright (C) 1999, 2009 Arthur Ogawa,
%%% distributed under the terms of the
%%% LaTeX Project Public License, see
%%% ftp://ctan.tug.org/macros/latex/base/lppl.txt
@@ -32,23 +130,23 @@
%%% USA",
%%% telephone = "",
%%% FAX = "",
-%%% email = "ogawa@teleport.com",
+%%% 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",
%%% docstring = "The checksum field above generated by ltxdoc",
%%% }
-%</ltxgrid>
+%</package>
% \fi
%
% \iffalse ltxdoc klootch
-% The following references the \file{00readme.txt} file,
+% The following references the \file{00readme} 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*}{00readme.txt}" to locate it.
-% \fi\input{00readme.txt}%
+% Search on "{filecontents*}{00readme}" to locate it.
+% \fi\input{00readme}%
%
% \subsection{Bill of Materials}
%
@@ -65,7 +163,7 @@
% Typesetting the source file under \LaTeX\
% generates the readme and the installer.
%\begin{verbatim}
-%00readme.txt ltxgrid.ins
+%00readme ltxgrid.ins
%\end{verbatim}
%
% \subsubsection{Generated by \texttt{tex ltxgrid.ins}}%
@@ -101,17 +199,17 @@
% An appropriate message is displayed if
% a different \TeX{} format is used.
% \begin{macrocode}
-%<*doc|ltxgrid>
+%<*driver|package>
\NeedsTeXFormat{LaTeX2e}[1995/12/01]%
-%</doc|ltxgrid>
+%</driver|package>
% \end{macrocode}
% As desired, the following modules all
% take common version information:
% \begin{macrocode}
-%<ltxgrid>\ProvidesFile{ltxgrid.sty}%
-%<*doc>
+%<package>\ProvidesFile{ltxgrid.sty}%
+%<*driver>
\expandafter\ProvidesFile\expandafter{\jobname.dtx}%
-%</doc>
+%</driver>
% \end{macrocode}
%
% The following line contains, for once and for all,
@@ -120,9 +218,9 @@
% consistently in all generated files and in the
% typeset documentation.
% \begin{macrocode}
-%<*doc|ltxgrid>
- [2001/07/26 1.0rc5 page grid package]% \fileversion
-%</doc|ltxgrid>
+%<*driver|package>
+ [2009/10/09 4.1h page grid package]% \fileversion
+%</driver|package>
% \end{macrocode}
%
%
@@ -130,7 +228,7 @@
%
% This module, consisting of the present section,
% typesets the programmer's documentation,
-% generating the \file{.ins} installer and \file{00readme.txt} as required.
+% generating the \file{.ins} installer and \file{00readme} as required.
%
% Because the only uncommented-out lines of code at the beginning of
% this file constitute the \file{doc} module itself,
@@ -143,7 +241,7 @@
% The \enve{document} command concludes the typesetting run.
%
% \begin{macrocode}
-%<*doc>
+%<*driver>
% \end{macrocode}
%
% \subsection{The Preamble}
@@ -162,7 +260,8 @@
\csname package@font\endcsname
}%
\fi
-\CodelineIndex\EnableCrossrefs
+\CodelineIndex\EnableCrossrefs % makeindex -s gind.ist ltxgrid
+\RecordChanges % makeindex -s gglo.ist -o ltxgrid.gls ltxgrid.glo
% \end{macrocode}
%
% \subsubsection{Docstrip and info directives}
@@ -177,78 +276,6 @@
\expandafter\GetFileInfo\expandafter{\jobname.dtx}%
% \end{macrocode}
%
-%
-% \subsection{The installer file}
-%
-% The installer \file{ltxgrid.ins} appears here.
-% If you have retrieved the standard distribution of this package,
-% the installer file is already on your filesystem.
-% If you are bootstrapping,
-% the first typesetting of the \file{.dtx} file
-% will cause the installer to be generated.
-%
-% The following modules are used to direct
-% {\sc docstrip} in generating the external files:
-% \begin{center}
-% \begin{tabular}{lll}
-% \textbf{Module}&\textbf{File}&\textbf{Description}\\
-% doc &\file{ltxgrid.drv}&driver for programmer's documentation\\
-% ltxgrid,ltxgrid-krn &\file{ltxgrid.sty}&this package\\
-% ltxgrid-krn& &the portion of this package suitable for inclusion within another package
-% \end{tabular}
-% \end{center}
-%
-% \begin{macrocode}
-\begin{filecontents}{ltxgrid.ins}
-%% This file will generate documentation and runtime files
-%% from ltxgrid.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 00readme.txt.
-
-Copyright notice.
-
- These files are distributed
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-\endpreamble
-\keepsilent
- \generate{%
- \file{ltxgrid.drv}{\from{ltxgrid.dtx}{doc}}%
- \file{ltxgrid.sty}{%
- \from{ltxgrid.dtx}{ltxgrid,ltxgrid-krn}%
- }%
- }%
-\ifToplevel{
-\Msg{***********************************************************}
-\Msg{*}
-\Msg{* To finish the installation, please move}
-\Msg{* ltxgrid.sty}
-\Msg{* into a directory searched by TeX;}
-\Msg{* in a TDS-compliant installation:}
-\Msg{* texmf/tex/macros/latex/ao/.}
-\Msg{*}
-\Msg{* To produce the documentation,
- run ltxgrid.dtx through LaTeX.}
-\Msg{*}
-\Msg{* Happy TeXing}
-\Msg{***********************************************************}
-}
-\endbatchfile
-\end{filecontents}
-% \end{macrocode}
-% Note that, because all of the files generated by the installer
-% are part of the standard distribution, it will
-% be necessary to run the installer only when bootstrapping
-% (or, of course, during development).
-% Note, too, that it is rare to generate the \file{doc}
-% module because it suffices to simply typeset the \file{.dtx} file itself.
-%
% \subsection{The ``Read Me'' File}
% As promised above, here is the contents of the
% ``Read Me'' file. That file serves a double purpose,
@@ -273,30 +300,34 @@ Copyright notice.
% begin the programmer's manual.
%
% \begin{macrocode}
-\begin{filecontents*}{00readme.txt}
+\begin{filecontents*}{00readme}
\title{%
A \LaTeX\ Package for changing the page grid and MVL%
\thanks{%
This file has version number \fileversion,
last revised \filedate.%
- % For version number and date,
- % search on "\fileversion" in the .dtx file,
- % or see the end of the 00readme.txt file.
+ }%
+ \thanks{%
+ Version \fileversion\ \copyright\ 2009 The American Physical Society
}%
}%
-
\author{%
-Arthur Ogawa (\texttt{mailto:ogawa@teleport.com}),
-\fileversion\\Copyright (C) 1999, 2000 Arthur Ogawa
-}%
+ 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 00readme file.
+%\fi
\maketitle
This file embodies the \classname{ltxgrid} package,
the implementation and its user documentation.
The distribution point for this work is
-\url{ftp://ftp.teleport.com/users/ogawa/macros/latex/contrib/supported/ltxgrid...},
-which contains fully unpacked, prebuilt runtime files and documentation.
+\url{publish.aps.org/revtex},
+which contains the REV\TeX\ package, and includes source and documentation for this package.
The \classname{ltxgrid} package was commissioned by the American Physical Society
and is distributed under the terms of the \LaTeX\ Project Public License,
@@ -311,9 +342,9 @@ To install, retrieve the distribution,
unpack it into a directory on the target computer,
into a location in your filesystem where it will be found by \LaTeX;
in a TDS-compliant installation this would be:
-\file{texmf/tex/macros/latex/ao/.}
+\file{texmf/tex/macros/latex/revtex/.}
-To use, read the user documentation \file{ltxgrid.pdf}.
+To use, read the user documentation \file{src/ltxgrid.pdf}.
\tableofcontents
@@ -322,9 +353,9 @@ To use, read the user documentation \file{ltxgrid.pdf}.
The package file \file{ltxgrid.sty}
is generated from this file, \file{ltxgrid.dtx},
using the {\sc docstrip} facility of \LaTeX
-via |tex ltxgrid.ins|.
+via |tex ltxgrid.dtx|.
The typeset documentation that you are now reading is generated from
-the same file by typesetting it with \LaTeX\ or pdftex
+this same file by typesetting it with \LaTeX\ or pdftex
via |latex ltxgrid.dtx| or |pdflatex ltxgrid.dtx|.
\subsection{Build Instructions}
@@ -335,22 +366,70 @@ then carry out the following steps:
\begin{enumerate}
\item
Within an otherwise empty directory,
-typeset \file{ltxgrid.dtx} with \LaTeX\ or pdflatex;
+typeset \file{ltxgrid.dtx} with \TeX\ or pdftex;
+thereby generating the package file \file{ltxgrid.sty}.
+
+\item
+Now typeset \file{ltxgrid.dtx} with \LaTeX\ or pdflatex;
you will obtain the typeset documentation you are now reading,
-along with
-the installer \file{ltxgrid.ins},
-and the file \file{00readme.txt}.
+along with the file \file{00readme}.
Note: you will have to run \LaTeX\ twice, then \file{makeindex}, then
\LaTeX\ again in order to obtain a valid index and table of contents.
+
\item
-Now typeset \file{ltxgrid.ins},
-thereby generating the package file \file{ltxgrid.sty}.
+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{ltxgrid.sty}
+\item
+\file{$TEXMF/}\file{source/}\file{latex/}\file{revtex/}\classname{ltxgrid.dtx}
\item
-Install \classname{ltxgrid.sty}
-by moving it to a location
-in your filesystem where they will be found by \LaTeX.
+\file{$TEXMF/}\file{doc/}\file{latex/}\file{revtex/}\classname{ltxgrid.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 directory \file{$TEXMF/} (you may need root access).
+\item
+Build and installation are now complete;
+now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
+(Note: \texttt{ltxgrid} requires package \texttt{ltxutil}.)
\end{enumerate}
+
+\subsection{Change Log}
+\changes{4.0a}{2001/06/18}{Introduce \cs{marry@height} }
+\changes{4.0a}{2001/06/18}{Introduce \cs{set@marry@height} }
+\changes{4.0a}{2008/06/26 }{\cs{@yfloat}: de-fang \cs{set@footnotewidth} (see ltxutil.dtx): we have already done its job. }
+\changes{4.1a}{2008/06/29}{Change \cs{LT@array@new}: restore \cs{@tabularcr} and \cs{@xtabularcr}}
+\changes{4.1a}{2008/06/29}{Change \cs{LT@array@new}: set \cs{LT@LL@FM@cr} to \cs{@arraycr@array} instead of \cs{@arraycr}}
+\changes{4.1a}{2008/06/29}{Repair error in \cs{endlongtable@new} involving \cs{@ifx}: argument not delimited.}
+\changes{4.1b}{2008/08/04}{Get rid of the \cs{reserved@a} idiom}
+\changes{4.1b}{2008/08/04}{Turn off the \cs{set@footnotewidth} mechanism; a float `knows' its proper typesetting context}
+\changes{4.1b}{2008/08/04}{(AO, 452) Support length checking: show size of shipped out text.}
+\changes{4.1b}{2008/08/04}{(AO, 456) Compatibility with other packages that override the output routine, following suggestion by David Kastrup.}
+\changes{4.1b}{2008/08/04}{}
+\changes{4.1b}{2008/08/04}{Box \cs{footbox} changed to box \cs{footsofar}}
+\changes{4.1b}{2008/08/04}{Change \cs{@combinepage} to \cs{@combinepage} with argument}
+\changes{4.1b}{2008/08/04}{Change \cs{@makecol} to \cs{@makecolumn} with argument}
+\changes{4.1b}{2008/08/04}{Change \cs{set@colroom} to \cs{set@colht}}
+\changes{4.1b}{2008/08/04}{New procedure \cs{@iffpsbit} replaces \cs{@getfpsbit}}
+\changes{4.1b}{2008/08/04}{New procedure \cs{@output@combined@page}}
+\changes{4.1b}{2008/08/04}{New procedure for showing a box contents, \cs{trace@box}}
+\changes{4.1b}{2008/08/04}{Procedure \cs{@outputpage@head} headpatches \cs{@outputpage}}%
+\changes{4.1b}{2008/08/04}{Procedure \cs{@outputpage@tail} tailpatches \cs{@outputpage}}%
+\changes{4.1b}{2008/08/04}{Procedure \cs{balance@2} defined more transparently}%
+\changes{4.1b}{2008/08/04}{Procedure \cs{set@adj@footins} to adjust for footnotes and other inserts}
+\changes{4.1b}{2008/08/04}{Tally the height of the float}
+\changes{4.1b}{2008/08/04}{Use \cs{document@inithook} instead of \cs{AtBeginDocument}}
+\changes{4.1b}{2008/08/04}{Use \cs{trace@box} instead of \cs{showbox}}
+\changes{4.1f}{2009/07/07}{(AO, 515) Prevent line numbering within a footnote}
+\changes{4.1f}{2009/07/10}{(AO, 518) Tally register overflow when locument is long}
+\changes{4.1f}{2009/07/14}{(AO, 519) \cs{footins} content must be preserved and reintegrated}
+\changes{4.1f}{2009/07/14}{(AO, 519) Do not use \cs{dimen@} register as a scratch register in \cs{set@adj@footins}}
+\changes{4.1f}{2009/07/15}{(AO, 519) Preserve footnotes that are in \cs{footsofar} across a page grid change}
+\changes{4.1g}{2009/10/06}{(AO, 531) Fix package \classname{float} }
+
\end{filecontents*}
% \end{macrocode}
%
@@ -361,13 +440,10 @@ in your filesystem where they will be found by \LaTeX.
% This very cute self-reference is a common \classname{ltxdoc} idiom.
% \begin{macrocode}
\begin{document}%
+\def\revtex{REV\TeX}%
\expandafter\DocInput\expandafter{\jobname.dtx}%
-% ^^A\PrintChanges
\end{document}
-% \end{macrocode}
-%
-% \begin{macrocode}
-%</doc>
+%</driver>
% \end{macrocode}
%
% \section{Using this package}
@@ -396,7 +472,7 @@ in your filesystem where they will be found by \LaTeX.
%
% Note that this package requires the features of the \classname{ltxutil} package,
% available at
-% \url{ftp://ftp.teleport.com/users/ogawa/macros/latex/contrib/supported/ltxutil/}.
+% \url{publish.aps.org/revtex}.
%
% Once loaded, the package gives you acccess to certain procedures,
% usually to be invoked by a \LaTeX\ command or environment, but not at the document level.
@@ -553,7 +629,7 @@ in your filesystem where they will be found by \LaTeX.
% \cmd\twocolumn\ mode such that footnotes are set at the bottom of the right-hand
% column instead of at the foot of each of the two columns.
%
-% Note that it overwrites three \LaTeX\ kernel macros: \cmd\@outputdblcol, \cmd\@startcolumn, and \cmd\@makecol.
+% Note that it overwrites three \LaTeX\ kernel macros: \cmd\@outputdblcol, \cmd\@startcolumn, and \cmd\@makecolumn.
% Fortunately none of the three are patched by \classname{ltxgrid}, so that compatability
% is not excluded on this basis.
%
@@ -604,7 +680,7 @@ in your filesystem where they will be found by \LaTeX.
% Frank Mittelbach's \classname{multicol} package provides a page grid with many columns,
% albeit denies the placement of floats in individual columns.
%
-% It esablishes its own \cmd\output\ routine, which is the reason it runs afoul of
+% It establishes its own \cmd\output\ routine, which is the reason it runs afoul of
% the \classname{longtable} package. On the other hand, \classname{ltxgrid} specifically
% allows for the case where a package installs its own \cmd\output\ routine, so
% there is no incompatability on that basis.
@@ -658,7 +734,7 @@ in your filesystem where they will be found by \LaTeX.
% calculated.
%
% This scheme typically works fine, but it has a significant vulnerability:
-% any discardable items trimmed at the original column break is lost, never to be retrieved.
+% any discardable items trimmed at the original column break are lost, never to be retrieved.
% Consequently, after re-balancing, an element like, say, a section head can fail to have the correct amount of whitespace above.
%
% This problem is due to an unfortunate optimization in \TeX, wherein a certain class of nodes is trimmed from the
@@ -671,8 +747,8 @@ in your filesystem where they will be found by \LaTeX.
% they are quietly passed over during trimming.
%
% An alternative approach for \TeX\ to take would have been,
-% rather than discarding the node entirely, to simply mark it as discarded.
-% (Implementors of NTS, please note!)
+% rather than discarding the node entirely, to simply \emph{mark} it as discarded.
+% (Implementors of extended \TeX, please note!)
% Then, upon shipping out, such nodes would not make it into the DVI.
% \TeX's optimization, driven by the small computer architectures current when it was developed,
% does save mem, but at the cost of revisiting page breaks in a reliable way.
@@ -684,7 +760,7 @@ in your filesystem where they will be found by \LaTeX.
% \section{Implementation of package}
%
% Special acknowledgment: this package uses concepts pioneered
-% and first realized by William Baxter (mailto:web@superscript.com)
+% 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. His thorough understanding
% of \TeX's output routine underpins the entire \classname{ltxgrid}
@@ -693,22 +769,22 @@ in your filesystem where they will be found by \LaTeX.
% \subsection{Beginning of the \file{ltxgrid} {\sc docstrip} module}
% Requires the underpinnings of the \classname{ltxkrnext} package.
% \begin{macrocode}
-%<*ltxgrid>
+%<*package>
\def\package@name{ltxgrid}%
\expandafter\PackageInfo\expandafter{\package@name}{%
Page grid for \protect\LaTeXe,
- by A. Ogawa (ogawa@teleport.com)%
+ by A. Ogawa (arthur_ogawa at sbcglobal.net)%
}%
\RequirePackage{ltxutil}%
-%</ltxgrid>
+%</package>
% \end{macrocode}
%
% \subsection{Banner}%
% Credit where due.
% \begin{macrocode}
-%<*ltxgrid-krn>
+%<*kernel>
\typeout{%
- ltxgrid: portions licensed from W. E. Baxter (web@superscript.com)%
+ ltxgrid [2009/07/07 4.1f]: portions licensed from W. E. Baxter (web at superscript.com)%
}%
% \end{macrocode}
%
@@ -718,20 +794,23 @@ in your filesystem where they will be found by \LaTeX.
% The document-level command \cmd\lineloop\ sets numbered lines until the
% specified count is reached.
% This command is mainly used to construct test documents.
+%
+% Because the counter is globally advanced and never reset, successive
+% calls to \cmd\lineloop\ should have an argument ever larger.
+% The formatted output will have each line labeled with its ordinal number.
% \begin{macrocode}
\newcounter{linecount}
+\def\loop@line#1#2{%
+ \par
+ \hb@xt@\hsize{%
+ \global\advance#1\@ne
+ \edef\@tempa{\@ifnum{100>#1}{0}{}\@ifnum{10>#1}{0}{}\number#1}%
+ \@tempa\edef\@tempa{\special{trace:\@tempa}}\@tempa
+ \vrule depth2.5\p@#2\leaders\hrule\hfil
+ }%
+}%
\def\lineloop#1{%
- \loop
- \ifnum\c@linecount<#1\relax
- \global\advance\c@linecount\@ne
- \par
- \hb@xt@\hsize{%
- \ifnum\c@linecount<100 0\fi\ifnum\c@linecount<10 0\fi\number\c@linecount
- \vrule depth2.5\p@
- \leaders\hrule\hfil
- }%
- \penalty\interlinepenalty
- \repeat
+ \loopwhile{\loop@line\c@linecount{}\@ifnum{#1>\c@linecount}}%
}%
% \end{macrocode}
% \end{macro}
@@ -966,7 +1045,7 @@ in your filesystem where they will be found by \LaTeX.
% and \classname{longtable} (authored by David P. Carlisle), which
% swap in their own output routines when the respective package is active.
%
-% The better mechanism, used here, is due to William Baxter (web@superscript.com),
+% The better mechanism, used here, is due to William Baxter (web at superscript.com),
% who has allowed his several ideas to be used in this package.
%
% In what follows, we effectively wrap up the old \LaTeX\ output routine inside
@@ -1021,7 +1100,7 @@ in your filesystem where they will be found by \LaTeX.
% We do introduce flexibility in the form of a mechanism for patching into the
% natural output routine. Three hooks are offered, allowing a procedure
% to prepare for the upcoming visit to the output routine,
-% access to \cmd\box\cmd\@cclv, and after shipping out (or otherwise
+% access to \cmd\box\cmd\@cclv, and after doing \cmd\shipout\ (or otherwise
% committing the material to the page).
%
% Environments, commands, and even packages can install their
@@ -1040,81 +1119,263 @@ in your filesystem where they will be found by \LaTeX.
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\output@latex}
% \begin{macro}{\output}
% Grab the tokens in \cmd\the\cmd\output\ (but without the extra set of braces).
% The value of \cmd\toks@\ must remain untouched until loaded into the appropriate token
% register; this is done a few lines below.
% \begin{macrocode}
\long\def\@tempa#1\@@nil{#1}%
-\toks@
+ \toks@
\expandafter\expandafter
\expandafter{%
\expandafter \@tempa
- \the\output
+ \the\primitive@output
\@@nil
}%
-\newtoks\output
-\output\expandafter{\the\toks@}%
+\newtoks\output@latex
+\output@latex\expandafter{\the\toks@}%
+\let\output\output@latex
% \end{macrocode}
+%
+% A comment on compatibility with other packages that co-opt the output routine.
+%
+% Somewhere on the LaTeX-L list, David Kastrup has urged macro writers to take over
+% the output routine in such a way that others can do likewise. How is this to be
+% accomplished?
+%
+% Consider what the \classname{lineno} package does when it loads.
+% \begin{enumerate}
+% \item
+% It does \cmd\let\ cmd\@tempa\ \cmd\output.
+% This has the effect of identifying \cmd\@tempa\ with the
+% \cmd\toks\ register we created above to hold the old output routine of \LaTeX.
+% Let us say that was \cmd\toks14.
+% \item
+% \classname{lineno} itself effectively does \cmd\newtoks\ \cmd\@LN@output,
+% which assigns that \cmd\csname\ to \cmd\toks 15.
+% \item
+% It loads \cmd\@LN@output\ with the contents of \cmd\@tempa
+% (that is, \cmd\toks14, our copy of \LaTeX's output routine).
+% \item
+% Then it loads \cmd\@tempa\ with its own desired procedure,
+% to be executed at \cmd\output\ time, thereby taking over what it thinks is the output routine,
+% but which is in reality the procedure \revtex\ executes when it wants to pass control
+% to \LaTeX's original output routine.
+% \item
+% It then does \cmd\let\ \cmd\output\ \cmd\@LN@output,
+% which now identifies \cmd\output\ with \cmd\toks15, the output routine of \classname{lineno}.
+% \item
+% When the \cmd\output\ routine is triggered,
+% the primitive output routine \cmd\primitive@output\ is executed, and if
+% appropriate, control is passed to \cmd\output@latex, which \revtex\ had loaded with the old
+% \LaTeX\ output routine, but which is presently loaded with that of \classname{lineno}.
+% \item
+% The output routine of \classname{lineno} is executed, and if appropriate control is passed
+% to \cmd\@LN@output, the old output routine of \LaTeX.
+% \item
+% Furthermore, the \cmd\csname\ \cmd\output\ now points to \cmd\@LN@output\ (\cmd\toks15).
+% This means that someone coming in after \classname{lineno} to take over the output routine
+% will actually get executed after that of \classname{lineno}, but before \LaTeX.
+% \end{enumerate}
+% As you can see, the process of taking over the output routine may continue until all of the
+% \cmd\toks\ registers have been allocated.
+% If, say, \classname{newpackage} would itself like to take over the output routine,
+% and if it uses the above set of steps, then when the output routine is triggered, the order
+% of execution is \revtex, then \classname{lineno}, then \classname{newpackage}, then \LaTeX.
+% Each new package inserts itself on front of \LaTeX.
+% \end{macro}
% \end{macro}
%
% \begin{macro}{\dispatch@output}
-% We now install our own output routine in place of the
-% old one, which is still available as \cmd\the\cmd\output.
+% \changes{4.1b}{2008/08/04}{(AO, 456) Compatibility with other packages that override the output routine, following suggestion by David Kastrup.}
+% We now install our own output routine in place of the original
+% output routine of \LaTeX, which is still available as \cmd\the\ \cmd\output.
%
% The output routine is simply the procedure \cmd\dispatch@output.
% It either dispatches to a procedure based on a particular value of
-% \cmd\outputpenalty\ or it executes \cmd\the\cmd\output\ tokens.
+% \cmd\outputpenalty\ or it executes \cmd\the\cmd\output@latex\ tokens.
% \begin{macrocode}
\primitive@output{\dispatch@output}%
\def\dispatch@output{%
\let\par\@@par
- \expandafter\let\expandafter\@tempa\csname output@\the\outputpenalty\endcsname
- \outputdebug@sw{%
- \saythe\badness
- \saythe\outputpenalty
- \saythe\holdinginserts
- \say\thepagegrid
- \saythe\pagegrid@col
- \saythe\pagegrid@cur
- %\say\bot@envir
- \saythe\insertpenalties
- %\say\@@topmark
- %\say\saved@@topmark
- %\say\@@firstmark
- %\say\saved@@firstmark
- \say\@@botmark
- %\say\saved@@botmark
- \saythe\pagegoal
- \saythe\pagetotal
- \saythe{\badness\@cclv}%
- \expandafter\@ifx\expandafter{\csname output@-\the\execute@message@pen\endcsname\@tempa}{%
- \say\@message@saved
- }{%
- \expandafter\say\csname output@\the\outputpenalty\endcsname
- }%
- \say\@toplist
- \say\@botlist
- \say\@dbltoplist
- \say\@deferlist
- {\tracingall\scrollmode
- \showbox\@cclv
- \showbox\@cclv@saved
- \showbox\pagesofar
- \showbox\footbox
- \showbox\footins@saved
- \showbox\footins
- \showlists
- }%
+% \end{macrocode}
+% Try to interpret \cmd\outputpenalty\ as a dispatcher to a message handler,
+% its value is, e.g., \cmd\do@startpage@pen.
+% \begin{macrocode}
+ \expandafter\let\expandafter\output@procedure\csname output@\the\outputpenalty\endcsname
+% \end{macrocode}
+% If we have failed to find a dispatcher, then settle for \cmd\output@latex.
+% \begin{macrocode}
+ \@ifnotrelax\output@procedure{}{%
+ \expandafter\def\expandafter\output@procedure\expandafter{\the\output@latex}%
+ }%
+% \end{macrocode}
+% Now test if the dispatcher is the special case of \cmd\execute@message@pen, in which case execute the \cmd\@message@saved.
+% \begin{macrocode}
+ \expandafter\@ifx\expandafter{\csname output@-\the\execute@message@pen\endcsname\output@procedure}{%
+ \let\output@procedure\@message@saved
}{}%
- \@ifnotrelax\@tempa{\@tempa}{\the\output}%
+ \outputdebug@sw{\output@debug}{}%
+ \output@procedure
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\set@output@procedure#1#2{%
+ \count@\outputpenalty\advance\count@-#2%
+ \expandafter\let\expandafter#1\csname output@\the\count@\endcsname
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\output@debug{%
+ \saythe\inputlineno
+ \saythe\holdinginserts
+ \saythe\outputpenalty
+ \saythe\interlinepenalty
+ \saythe\brokenpenalty
+ \saythe\clubpenalty
+ \saythe\widowpenalty
+ \saythe\displaywidowpenalty
+ \saythe\predisplaypenalty
+ \saythe\interdisplaylinepenalty
+ \saythe\postdisplaypenalty
+ \say\output@procedure
+ \saythe\badness
+ \say\thepagegrid
+ \saythe\pagegrid@col
+ \saythe\pagegrid@cur
+%\say\bot@envir
+ \saythe\insertpenalties
+%\say\@@topmark
+%\say\saved@@topmark
+%\say\@@firstmark
+%\say\saved@@firstmark
+ \say\@@botmark
+%\say\saved@@botmark
+ \saythe\pagegoal
+ \saythe\pagetotal
+ \saythe{\badness\@cclv}%
+ \say\@toplist
+ \say\@botlist
+ \say\@dbltoplist
+ \say\@deferlist
+ \trace@scroll{%
+ \showbox\@cclv
+ \showbox\@cclv@saved
+ \showbox\pagesofar
+ \showbox\footsofar
+ \showbox\footins@saved
+ \showbox\footins
+ \showlists
+ }%
}%
\@ifxundefined{\outputdebug@sw}{%
\@booleanfalse\outputdebug@sw
}{}%
+\def\trace@scroll#1{\begingroup\showboxbreadth\maxdimen\showboxdepth\maxdimen\scrollmode#1\endgroup}%
+\def\trace@box#1{\trace@scroll{\showbox#1}}%
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\@outputpage}
+% \begin{macro}{\@outputpage@head}
+% \begin{macro}{\@outputpage@tail}
+% \changes{4.1b}{2008/08/04}{Procedure \cs{@outputpage@tail} tailpatches \cs{@outputpage}}%
+% \changes{4.1b}{2008/08/04}{Procedure \cs{@outputpage@head} headpatches \cs{@outputpage}}%
+% The procedure \cmd\@outputpage\ of standard \LaTeX\ is the sole place where a \cmd\shipout\ is carried out.
+% The procedures that build \cmd\@outputbox\ just before a page is shipped out by \cmd\@outputpage\ are:
+% \cmd\@makecolumn,
+% \cmd\@combinepage, and
+% \cmd\@combinedblfloats.
+%
+% We need to head- and tailpatch this procedure, so we perform here
+% the only modifications to that procedure that are essential.
+% Elsewhere, we will build up the meanings of \cmd\@outputpage@head\ and \cmd\@outputpage@tail.
+% \begin{macrocode}
+\prepdef\@outputpage{\@outputpage@head}%
+\let\@outputpage@head\@empty
+\appdef\@outputpage{\@outputpage@tail}%
+\let\@outputpage@tail\@empty
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\show@box@size}
+% \begin{macro}{\show@text@box@size}
+% \begin{macro}{\show@pagesofar@size}
+% \begin{macro}{\show@box@size@sw}
+% \begin{macro}{\total@text}
+% \changes{4.1b}{2008/08/04}{(AO, 452) Support length checking: show size of shipped out text.}
+% Procedure \cmd\show@box@size\ is a diagnostic for the sizes of boxes;
+% the boolean \cmd\show@box@size@sw\ turns it on and off.
+% \begin{macrocode}
+\def\show@box@size#1#2{%
+ \show@box@size@sw{%
+ \begingroup
+ \setbox\z@\vbox{\unvcopy#2\hrule}%
+ \class@info{Show box size: #1^^J%
+ (\the\ht\z@\space X \the\wd\z@)
+ \the\c@page\space\space\the\pagegrid@cur\space\the\pagegrid@col
+ }%
+ \endgroup
+ }{}%
+}%
+% \end{macrocode}
+% Procedure \cmd\show@text@box@size\ tallies the size of the indicated column.
+% If \cmd\box\ \cmd\pagesofar\ is a factor, then its height has been memorized
+% in the depth of the tally box.
+%
+% \changes{4.1f}{2009/07/10}{(AO, 518) Tally register overflow when locument is long}
+% \begin{macrocode}
+\def\show@text@box@size{%
+ \show@box@size{Text column}\@outputbox
+ \tally@box@size@sw{%
+ \@ifdim{\wd\@outputbox>\z@}{%
+ \dimen@\ht\@outputbox\divide\dimen@\@twopowerfourteen
+ \advance\dimen@-\dp\csname box@size@\the\pagegrid@col\endcsname
+ \@ifdim{\dimen@>\z@}{%
+ \advance\dimen@ \ht\csname box@size@\the\pagegrid@col\endcsname
+ \global\ht\csname box@size@\the\pagegrid@col\endcsname\dimen@
+ \show@box@size@sw{%
+ \class@info{Column: \the\dimen@}%
+ }{}%
+ }{}%
+ }{}%
+ \global\dp\csname box@size@\the\pagegrid@col\endcsname\z@
+ }{}%
+}%
+% \end{macrocode}
+% Take the height of \cmd\box\ \cmd\pagesofar\ into account.
+% \begin{macrocode}
+\def\show@pagesofar@size{%
+ \show@box@size{Page so far}\pagesofar
+ \dimen@\ht\pagesofar\divide\dimen@\@twopowerfourteen
+ \global\dp\csname box@size@1\endcsname\dimen@
+ \show@box@size@sw{%
+ \class@info{Pagesofar: \the\dimen@}%
+ }{}%
+}%
+\@booleanfalse\tally@box@size@sw
+\@booleanfalse\show@box@size@sw
+\expandafter\newbox\csname box@size@1\endcsname
+\expandafter\setbox\csname box@size@1\endcsname\hbox{}%
+\expandafter\newbox\csname box@size@2\endcsname
+\expandafter\setbox\csname box@size@2\endcsname\hbox{}%
+\def\total@text{%
+ \@tempdima\the\ht\csname box@size@2\endcsname\divide\@tempdima\@twopowertwo\@tempcnta\@tempdima
+ \@tempdimb\the\ht\csname box@size@1\endcsname\divide\@tempdimb\@twopowertwo\@tempcntb\@tempdimb
+ \class@info{Total text: Column(\the\@tempcnta pt), Page(\the\@tempcntb pt)}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
%
% \subsection{Further thoughts about inserts}
%
@@ -1158,7 +1419,20 @@ in your filesystem where they will be found by \LaTeX.
% In the above, the first of the two visits to the output routine is a dead cycle and requires
% propagation of marks, but nothing else.
%
-% The natural output routine
+% \subsection{The difference between inserts and floats}
+%
+% While revisiting this package in 2008, I needed to clarify under what circumstances inserts
+% would be added to the \cmd\pagesofar. My conclusion is that I had been treating them
+% exactly the same as floats, but that was a mistake.
+%
+% Floats can be committed at the top of a column, in the middel, or at the bottom.
+% Footnotes (the only \cmd\insert\ that is used in \LaTeX) may only be committed at the bottom
+% of a column. So, it was necessary to provide two versions of \cmd\@combinepage, one
+% that committed \cmd\insert s, and the other that did not, the former used only when
+% a \cmd\shipout\ was certain to be performed.
+%
+%
+% \subsection{The natural output routine}
%
% Here is the portion of the output routine that fields cases not handled by
% the dispatcher.
@@ -1176,39 +1450,57 @@ in your filesystem where they will be found by \LaTeX.
% ensured by an initial mark of that value; the associated procedures
% are all nil. Any unknown envir value will "\cmd\relax\ out".
%
-% The code \cmd\move@insert@sw\ tells whether we are on our first visit to
-% the output routine (with \cmd\holdinginserts\ still set), or our second
-% (with \cmd\holdinginserts\ cleared). The output routine will toggle the
-% setting.
+% The test made by \cmd\toggle@insert\ tells whether we are on our first visit to
+% the output routine (with \cmd\holdinginserts\ still positive), or our second
+% (with \cmd\holdinginserts\ zeroed). The output routine will toggle the setting.
%
% The commands \cmd\hold@insertions\ and \cmd\move@insertions\ respectively
-% clear and set the state of \cmd\move@insert@sw, so this procedure effectively
+% clear and set \cmd\holdinginserts, so this procedure effectively
% clears \cmd\holdinginserts\ just long enough to pick up the insertions.
% Important: any output routine that clears \cmd\holdinginserts\
% must guarentee that it is restored on the subsequent visit to the output routine.
% Or, to put it another way, if an output routine detects that \cmd\holdinginserts\
-% is cleared, it should take it upon itself to restore it before exiting.
+% is cleared, it should take it upon itself to restore it to a positive value before exiting.
%
% The branch with \cmd\holdinginserts\ set is executed first; the other
% branch follows on practically immediately thereafter. In the first branch,
% we simply execute the appropriate hook and then execute a dead cycle.
%
% In the branch with \cmd\holdinginserts\ cleared, the procedure
-% builds up the current column, which is now complete, with \cmd\@makecol, then
+% builds up the current column, which is now complete, with \cmd\@makecolumn, then
% dispatches to the shipout routine associated with the current page grid, \cmd\output@column@.
% At the end, it triggers the execution of an output routine to prepare the next column (or page).
%
% \subsection{Natural output routine}%
%
+% \begin{macro}{\natural@output}
% \begin{macro}{\output}
-% Here is what has become of the output routine of \LaTeX.
-% It is of necessity divided into phases, \cmd\output@holding\ is executed upon first encountering the natural page-breaking point, while inserts are being held.
-% The second phase, \cmd\output@moving, is set in motion by the first: here the same material (in most cases) will be processed with \cmd\holdinginserts\ cleared.
-%
+% Here is the output routine that handles natural pagebreaks:
+% we now have page that needs to be shipped out or a portion of a page that is ready to be committed to the page grid.
+% Processing is of necessity divided into phases, \cmd\output@holding\ is executed upon first encountering the natural page-breaking point, while inserts are being held.
+% The second phase, \cmd\output@moving, is set in motion by the first: here the same material (in most cases) will be processed with \cmd\holdinginserts\ cleared,
+% and the insertions (e.g., footnotes) are split off into their assigned box registers.
% \begin{macrocode}
-\output={\toggle@insert\output@holding\output@moving}%
+\def\natural@output{\toggle@insert{\output@holding}{\output@moving}}%
+\output@latex{\natural@output}%
% \end{macrocode}
%
+% In accordance with the scheme suggested by David Kastrup for allowing another output routine
+% to slip itself into ours, we use a token register called \cmd\output.
+% However, we reserve the ability to restore things if we so desire.
+% This we must do in the case of the \filename{lineno.sty} package, because its functionality
+% is best served by being integrated into our own dispatcher-based output routine.
+%
+% To restore our own output routine, we can repeat the above assignment,
+% \begin{verbatim}
+%\output@latex{\natural@output}%
+% \end{verbatim}
+% some time before the document begins.
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\output@holding}
+% \begin{macro}{\@if@exceed@pagegoal}
% The procedure \cmd\output@holding\
% is our first cycle through the output routine; \cmd\holdinginserts\ is still set.
% We give the current environment a heads up
@@ -1224,47 +1516,50 @@ in your filesystem where they will be found by \LaTeX.
% The corner case is at hand if the natural size of \cmd\box\cmd\@cclv\ exceeds \cmd\pagegoal\ and
% the contents cannot be shrunk to fit.
%
+% \changes{4.1b}{2008/08/04}{New procedure for showing a box contents, \cs{trace@box}}
% \begin{macrocode}
\def\output@holding{%
- \csname output@init@\bot@envir\endcsname
-%\vbadness\@M
-%\vfuzz\maxdimen
- \@if@exceed@pagegoal{\unvcopy\@cclv}{%
- \setbox\z@\vbox{\unvcopy\@cclv}%
- \outputdebug@sw{{\tracingall\scrollmode\showbox\z@}}{}%
- \dimen@\ht\@cclv\advance\dimen@-\ht\z@
- \dead@cycle@repair\dimen@
- }{%
- \dead@cycle
- }%
+ \csname output@init@\bot@envir\endcsname
+ \@if@exceed@pagegoal{\unvcopy\@cclv}{%
+ \setbox\z@\vbox{\unvcopy\@cclv}%
+ \outputdebug@sw{\trace@box\z@}{}%
+ \dimen@\ht\@cclv\advance\dimen@-\ht\z@
+ \dead@cycle@repair\dimen@
+ }{%
+ \dead@cycle
+ }%
}%
\def\@if@exceed@pagegoal#1{%
\begingroup
- \setbox\z@\vbox{#1}%
- \dimen@\ht\z@\advance\dimen@\dp\z@
- \outputdebug@sw{\saythe\dimen@}{}%
- \@ifdim{\dimen@>\pagegoal}{%
- \setbox\z@\vbox{\@@mark{}\unvbox\z@}%
- \splittopskip\topskip
- \splitmaxdepth\maxdepth
- \vbadness\@M
- \vfuzz\maxdimen
+ \setbox\z@\vbox{#1}%
+ \dimen@\ht\z@\advance\dimen@\dp\z@
+ \outputdebug@sw{\saythe\dimen@}{}%
+ \@ifdim{\dimen@>\pagegoal}{%
+ \setbox\z@\vbox{\@@mark{}\unvbox\z@}%
+ \splittopskip\topskip
+ \splitmaxdepth\maxdepth
+ \vbadness\@M
+ \vfuzz\maxdimen
\setbox\tw@\vsplit\z@ to\pagegoal
- \outputdebug@sw{{\tracingall\scrollmode\showbox\tw@\showbox\z@}}{}%
- \setbox\tw@\vbox{\unvbox\tw@}%
- \@ifdim{\ht\tw@=\z@}{%
- \ltxgrid@info{Found overly large chunk while preparing to move insertions. Attempting repairs}%
- \aftergroup\true@sw
- }{%
- \aftergroup\false@sw
- }%
+ \outputdebug@sw{\trace@scroll{\showbox\tw@\showbox\z@}}{}%
+ \setbox\tw@\vbox{\unvbox\tw@}%
+ \@ifdim{\ht\tw@=\z@}{%
+ \ltxgrid@info{Found overly large chunk while preparing to move insertions. Attempting repairs}%
+ \aftergroup\true@sw
+ }{%
+ \aftergroup\false@sw
+ }%
}{%
- \aftergroup\false@sw
+ \aftergroup\false@sw
}%
- \endgroup
+ \endgroup
}%
% \end{macrocode}
+% \end{macro}
+% \end{macro}
%
+% \begin{macro}{\output@moving}
+% \begin{macro}{\@cclv@nontrivial@sw}
% The procedure \cmd\output@moving\
% is our second cycle through the output routine; \cmd\holdinginserts\ is now cleared,
% and \cmd\insert s will have been split off into their respective box registers, like \cmd\footins.
@@ -1275,7 +1570,7 @@ in your filesystem where they will be found by \LaTeX.
% \item
% If we got here because of a \cmd\clearpage\ command, remove the protection box that this mechanism has left on the MVL.
% \item
-% If the contents of \cmd\box\cmd\@cclv\ are non-trivial, commit it to the current page or ship it out as the case may call for.
+% If the contents of \cmd\box\cmd\@cclv\ are non-trivial, commit it to the current page (as a column) or ship it out, as the case may call for.
% \item
% If not, discard it (we are at the end of \cmd\clearpage\ processing).
% \item
@@ -1302,35 +1597,55 @@ in your filesystem where they will be found by \LaTeX.
% \begin{enumerate}
% \item
% Void out \cmd\box\cmd\@cclv\ and give appropriate warning messages and diagnostics.
-%% \item
-%% Put down the same interrupts as for the non-trivial case above.
+% \item
+% Put down the same interrupts as for the non-trivial case above.
% \end{enumerate}
%
+% This instance of \cmd\@makecolumn\ is followed by \cmd\output@column@,
+% that is, it builds a column for \cmd\shipout\ rather than for adding to \cmd\pagesofar.
+%
+% We need to handle cases where the \cmd\output@pre@, \cmd\output@column@, or \cmd\output@post@\
+% dispatchers come up \cmd\relax ed out: the default is to execute the corresponding
+% procedures from the \env{docuemnt} environment and the one-column grid respectively.
+%
+% One such case comes up with frequency: at the end of the document, where the \cmd\botmark\ is
+% now empty.
+% \changes{4.1b}{2008/08/04}{Change \cs{@makecol} to \cs{@makecolumn} with argument}
+% \changes{4.1b}{2008/08/04}{Change \cs{set@colroom} to \cs{set@colht}}
% \begin{macrocode}
\def\output@moving{%
\set@top@firstmark
\@ifnum{\outputpenalty=\do@newpage@pen}{%
\setbox\@cclv\vbox{%
\unvbox\@cclv
- \setbox\z@\lastbox
+ \remove@lastbox
\@ifdim{\ht\z@=\ht\@protection@box}{\box\lastbox}{\unskip}%
}%
}{}%
\@cclv@nontrivial@sw{%
- \csname output@prep@\bot@envir \endcsname
- \@makecol\csname output@column@\thepagegrid\endcsname
+ \expandafter\let\expandafter\output@prep@\csname output@prep@\bot@envir \endcsname
+ \outputdebug@sw{\say\output@prep@}{}%
+ \@ifx{\output@prep@\relax}{\output@prep@document}{\output@prep@}%
+ \@makecolumn\true@sw
+ \expandafter\let\expandafter\output@column@\csname output@column@\thepagegrid\endcsname
+ \outputdebug@sw{\say\output@column@}{}%
+ \@ifx{\output@column@\relax}{\output@column@one}{\output@column@}%
\protect@penalty\do@startcolumn@pen
\clearpage@sw{%
\protect@penalty\do@endpage@pen
}{}%
- \csname output@post@\bot@envir \endcsname
+ \expandafter\let\expandafter\output@post@\csname output@post@\bot@envir \endcsname
+ \outputdebug@sw{\say\output@post@}{}%
+ \@ifx{\output@post@\relax}{\output@post@document}{\output@post@}%
}{%
- {\setbox\z@\box\@cclv}%
+ \void@cclv
}%
- \set@colroom
+ \set@colht
\global\@mparbottom\z@
- \global\@textfloatsheight\z@ %FIXME: this legacy LaTeX variable is set, but never queried!
+ \global\@textfloatsheight\z@
}%
+\def\void@cclv{\begingroup\setbox\z@\box\@cclv\endgroup}%
+\def\remove@lastbox{\setbox\z@\lastbox}%
% \end{macrocode}
%
% The procedure \cmd\@cclv@nontrivial@sw\ determines if this visit to \cmd\output@moving\
@@ -1341,61 +1656,70 @@ in your filesystem where they will be found by \LaTeX.
% typesetting a (full-page-width) title block in a two-column layout.
%
% Note: the code that removes the last box and skip from the output is intended to detect the case
-% where the output has whatit nodes followed by topskip and a protection box.
+% where the output has whatsit nodes followed by topskip and a protection box.
% This is what happens under normal circumstances at the end of \cmd\clearpage\ processing.
+% \changes{4.1b}{2008/08/04}{New procedure for showing a box contents, \cs{trace@box}}
% \begin{macrocode}
\def\@cclv@nontrivial@sw{%
- \@ifx@empty\@toplist{%
- \@ifx@empty\@botlist{%
- \@ifvoid\footins{%
- \@ifvoid\@cclv{%
- \false@sw
- }{%
- \setbox\z@\vbox{\unvcopy\@cclv}%
- \@ifdim{\ht\z@=\topskip}{%
- \setbox\z@\vbox{%
- \unvbox\z@
- \setbox\z@\lastbox\dimen@\lastskip\unskip
- \@ifdim{\ht\z@=\ht\@protection@box}{%
- \advance\dimen@\ht\z@
- \@ifdim{\dimen@=\topskip}{%
- \aftergroup\true@sw
- }{%
- \aftergroup\false@sw
- }%
- }{%
- \aftergroup\false@sw
- }%
- }%
- {%
- \false@sw % Normal for \clearpage
- }{%
- \true@sw
- }%
- }{%
- \@ifdim{\ht\z@=\z@}{%
- \ltxgrid@info{Found trivial column. Discarding it}%
- \outputdebug@sw{{\tracingall\scrollmode\showbox\@cclv}}{}%
- \false@sw
- }{%
- \true@sw
- }%
- }%
- }%
- }{%
- \true@sw
- }%
- }{%
- \true@sw
- }%
- }{%
- \true@sw
- }%
+ \@ifx@empty\@toplist{%
+ \@ifx@empty\@botlist{%
+ \@ifvoid\footins{%
+ \@ifvoid\@cclv{%
+ \false@sw
+ }{%
+ \setbox\z@\vbox{\unvcopy\@cclv}%
+ \@ifdim{\ht\z@=\topskip}{%
+ \setbox\z@\vbox\bgroup
+ \unvbox\z@
+ \remove@lastbox
+ \dimen@\lastskip\unskip
+ \@ifdim{\ht\z@=\ht\@protection@box}{%
+ \advance\dimen@\ht\z@
+ \@ifdim{\dimen@=\topskip}{%
+ \aftergroup\true@sw
+ }{%
+ \aftergroup\false@sw
+ }%
+ }{%
+ \aftergroup\false@sw
+ }%
+% \end{macrocode}
+% End of \cmd\box\cmd\z@.
+% \begin{macrocode}
+ \egroup
+ {%
+% \end{macrocode}
+% Normal for \clearpage
+% \begin{macrocode}
+ \false@sw
+ }{%
+ \true@sw
+ }%
+ }{%
+ \@ifdim{\ht\z@=\z@}{%
+ \ltxgrid@info{Found trivial column. Discarding it}%
+ \outputdebug@sw{\trace@box\@cclv}{}%
+ \false@sw
+ }{%
+ \true@sw
+ }%
+ }%
+ }%
+ }{%
+ \true@sw
+ }%
+ }{%
+ \true@sw
+ }%
+ }{%
+ \true@sw
+ }%
}%
% \end{macrocode}
%
%
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\protect@penalty}
% The procedure \cmd\protect@penalty\ is the utility procedure for invoking a
@@ -1465,29 +1789,32 @@ in your filesystem where they will be found by \LaTeX.
%
% \begin{macrocode}
\def\dead@cycle@repair#1{%
- \expandafter\do@@mark
- \expandafter{%
- \@@botmark
- }%
- \unvbox\@cclv
- \nointerlineskip
- \vbox to#1{\vss}%
- \@ifnum{\outputpenalty<\@M}{\penalty\outputpenalty}{}%
+ \expandafter\do@@mark
+ \expandafter{%
+ \@@botmark
+ }%
+ \unvbox\@cclv
+ \nointerlineskip
+ \vbox to#1{\vss}%
+ \@ifnum{\outputpenalty<\@M}{\penalty\outputpenalty}{}%
}%
\def\dead@cycle@repair@protected#1{%
- \expandafter\do@@mark
- \expandafter{%
- \@@botmark
- }%
- \begingroup
- \unvbox\@cclv
- \setbox\z@\lastbox % Remove protection box
- \nointerlineskip
+ \expandafter\do@@mark
+ \expandafter{%
+ \@@botmark
+ }%
+ \begingroup
+ \unvbox\@cclv
+% \end{macrocode}
+% Remove the protection box
+% \begin{macrocode}
+ \remove@lastbox
+ \nointerlineskip
\advance#1-\ht\@protection@box
- \vbox to#1{\vss}%
- \protection@box % Reinsert protection box
- \@ifnum{\outputpenalty<\@M}{\penalty\outputpenalty}{}%
- \endgroup
+ \vbox to#1{\vss}%
+ \protection@box % Reinsert protection box
+ \@ifnum{\outputpenalty<\@M}{\penalty\outputpenalty}{}%
+ \endgroup
}%
\def\dead@cycle{%
\expandafter\do@@mark
@@ -1511,17 +1838,24 @@ in your filesystem where they will be found by \LaTeX.
% Upon our return, at \cmd\output@prep@\ time, the page break will accomodate the material;
% it is now actually inserted by concatenating it with the contents of \cmd\footins.
% The default processing for \cmd\output@post@\ is nil.
+% \changes{4.1b}{2008/08/04}{Procedure \cs{set@adj@footins} to adjust for footnotes and other inserts}
+% \changes{4.1b}{2008/08/04}{Box \cs{footbox} changed to box \cs{footsofar}}
% \begin{macrocode}
\def\output@init@document{%
- \@ifvoid\footbox{}{%
- \global\advance\vsize-\ht\footbox
- \global\advance\vsize-\dp\footbox
- }%
+ \set@adj@footins\vsize\global\vsize\vsize
}%
+% \end{macrocode}
+% QUERY: the following procedure is very like \cmd\combine@foot@inserts. Should it be the same?
+% \begin{macrocode}
\def\output@prep@document{%
- \@ifvoid\footbox{}{%
-% {\tracingall\scrollmode\showbox\footbox\showbox\footins}%
- \setbox\footins\vbox{\unvbox\footbox\unvbox\footins}%
+ \@ifvoid\footsofar{}{%
+ \setbox\footins\vbox\bgroup
+ \unvbox\footsofar
+ \@ifvoid\footins{}{%
+ \marry@baselines
+ \unvbox\footins
+ }%
+ \egroup
}%
}%
\def\output@post@document{}%
@@ -1537,8 +1871,9 @@ in your filesystem where they will be found by \LaTeX.
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\@makecol}
-% The procedure \cmd\@makecol\ packages up a page along with all its insertions and floats.
+% \begin{macro}{\@makecolumn}
+% \changes{4.1b}{2008/08/04}{Change \cs{@makecol} to \cs{@makecolumn} with argument}
+% The procedure \cmd\@makecolumn\ packages up a page along with all its insertions and floats.
% Therefore it is essential that it be executed with \cmd\holdininserts\ cleared.
%
% Note that there is a corner case when in a multi-column grid, where the change back to
@@ -1548,8 +1883,16 @@ in your filesystem where they will be found by \LaTeX.
% Note on \cmd\@kludgeins: we have removed this mechanism from \LaTeX, because the implementation
% of \cmd\enlargethispage\ no longer requires it.
% Here, for consistency sake, we remove \cmd\@makespecialcolbox.
+%
+% The argument of \cmd\@makecolumn\ is a Boolean and determines if we combine the footnote material
+% into the present column. If the procedure is building a column for shipping out, then we will
+% combine the footnote material, if not, we return with the \cmd\footins\ box unchanged.
+%
+% \changes{4.1f}{2009/07/14}{(AO, 519) \cs{footins} content must be preserved and reintegrated}
+% I changed the behavior of this procedure in the case where the argument is \cmd\false@sw:
+% send the unused footnote material to \cmd\footsofar.
% \begin{macrocode}
-\def\@makecol{%
+\def\@makecolumn#1{%
\setbox\@outputbox\vbox{%
\boxmaxdepth\@maxdepth
\@tempdima\dp\@cclv
@@ -1557,23 +1900,24 @@ in your filesystem where they will be found by \LaTeX.
\vskip-\@tempdima
}%
\xdef\@freelist{\@freelist\@midlist}\global\let\@midlist\@empty
+ \show@text@box@size
\@combinefloats
- \@combineinserts\@outputbox\footins
-%\@ifvbox\@kludgeins{%
-% \@makespecialcolbox
-%}{%
- \set@adj@colht\dimen@
- \count@\vbadness
- \vbadness\@M
- \setbox\@outputbox\vbox to\dimen@{%
- \@texttop
- \dimen@\dp\@outputbox
- \unvbox\@outputbox
- \vskip-\dimen@
- \@textbottom
- }%
- \vbadness\count@
-%}%
+ #1{%
+ \@combineinserts\@outputbox\footins
+ }{%
+ \combine@foot@inserts
+ }%
+ \set@adj@colht\dimen@
+ \count@\vbadness
+ \vbadness\@M
+ \setbox\@outputbox\vbox to\dimen@{%
+ \@texttop
+ \dimen@\dp\@outputbox
+ \unvbox\@outputbox
+ \vskip-\dimen@
+ \@textbottom
+ }%
+ \vbadness\count@
\global\maxdepth\@maxdepth
}%
\let\@makespecialcolbox\@undefined
@@ -1587,10 +1931,10 @@ in your filesystem where they will be found by \LaTeX.
\def\@combineinserts#1#2{%
\setbox#1\vbox{%
\unvbox#1%
-% {\tracingall\scrollmode\showbox#2}%
\vbox{%
\@ifvoid#2{}{%
- \vskip\skip\footins
+ \show@box@size{Combining inserts}#2%
+ \vskip\skip#2%
\color@begingroup
\normalcolor
\footnoterule
@@ -1659,13 +2003,14 @@ in your filesystem where they will be found by \LaTeX.
% in which the procedures that handle full-page width floats in a two-column page grid all have in their names
% the string `dbl', which erroneously suggests having something to do with ``double''. It does not:
% when you see `dbl', think ``full page width''.
+% \changes{4.1b}{2008/08/04}{Change \cs{set@colroom} to \cs{set@colht}}
% \begin{macrocode}
\mathchardef\do@startcolumn@pen=10005
\@namedef{output@-\the\do@startcolumn@pen}{\do@startcolumn}%
\def\do@startcolumn{%
- \setbox\@cclv\vbox{\unvbox\@cclv\setbox\z@\lastbox\unskip}%
+ \setbox\@cclv\vbox{\unvbox\@cclv\remove@lastbox\unskip}%
\clearpage@sw{\@clearfloatplacement}{\@floatplacement}%
- \set@colroom
+ \set@colht
\@booleanfalse\pfloat@avail@sw
\begingroup
\@colht\@colroom
@@ -1675,9 +2020,10 @@ in your filesystem where they will be found by \LaTeX.
\endgroup
\fcolmade@sw{%
\setbox\@cclv\vbox{\unvbox\@outputbox\unvbox\@cclv}%
-% \csname float@column@\thepagegrid\endcsname
-% \csname output@column@\thepagegrid\endcsname
- \outputpenalty-\pagebreak@pen % ask for a return visit, this time with insertions and all.
+% \end{macrocode}
+% Now ask for a return visit, this time with insertions and all.
+% \begin{macrocode}
+ \outputpenalty-\pagebreak@pen
\dead@cycle
}{%
\begingroup
@@ -1741,6 +2087,7 @@ in your filesystem where they will be found by \LaTeX.
%
% \begin{macro}{\do@startpage@pen}
% \begin{macro}{\forcefloats@sw}
+% \begin{macro}{\@output@combined@page}
% \begin{macro}{\@sdblcolelt}
% \begin{macro}{\test@dblfloat}
% \begin{macro}{\@if@notdblfloat}
@@ -1767,11 +2114,13 @@ in your filesystem where they will be found by \LaTeX.
% To differentiate between the two, the width of the float is compared to \cmd\textwidth.
% This comparison is encapsulated in the macro \cmd\@if@notdblfloat, which should be used whenever
% such a determination must be made. This procedure returns a Boolean.
+%
+% \changes{4.1b}{2008/08/04}{Change \cs{set@colroom} to \cs{set@colht}}
% \begin{macrocode}
\mathchardef\do@startpage@pen=10006
\@namedef{output@-\the\do@startpage@pen}{\do@startpage}%
\def\do@startpage{%
- \setbox\@cclv\vbox{\unvbox\@cclv\setbox\z@\lastbox\unskip}%
+ \setbox\@cclv\vbox{\unvbox\@cclv\remove@lastbox\unskip}%
\clearpage@sw{\@clearfloatplacement}{\@dblfloatplacement}%
\set@colht
\@booleanfalse\pfloat@avail@sw
@@ -1782,11 +2131,7 @@ in your filesystem where they will be found by \LaTeX.
\endgroup
\fcolmade@sw{%
\global\setbox\pagesofar\vbox{\unvbox\pagesofar\unvbox\@outputbox}%
- \@combinepage
- \@combinedblfloats
- \@outputpage
- \global\pagegrid@cur\@ne
- \protect@penalty\do@startpage@pen
+ \@output@combined@page
}{%
\begingroup
\@booleanfalse\float@avail@sw
@@ -1807,7 +2152,25 @@ in your filesystem where they will be found by \LaTeX.
}%
\check@deferlist@stuck\do@startpage
\set@colht
-%\set@colroom
+}%
+% \end{macrocode}
+%
+% Procedure \cmd\@output@combined@page\ is a utility that ships out a page consisting of the
+% result of \cmd\@combinepage\ and \cmd\@combinedblfloats, after which it prepares for
+% the process to repeat.
+%
+% It is coincidentally identical to what needs to happen with
+% a float page that has been built by \cmd\@tryfcolumn, in the multi-column page grid,
+% and also handles the case where a page needs to be shipped out when in multicolumn mode.
+% \changes{4.1b}{2008/08/04}{New procedure \cs{@output@combined@page}}
+% \changes{4.1b}{2008/08/04}{Change \cs{@combinepage} to \cs{@combinepage} with argument}
+% \begin{macrocode}
+\def\@output@combined@page{%
+ \@combinepage\true@sw
+ \@combinedblfloats
+ \@outputpage
+ \global\pagegrid@cur\@ne
+ \protect@penalty\do@startpage@pen
}%
\def\@sdblcolelt#1{\def\@currbox{#1}\@addtodblcol}%
\def\test@dblfloat#1{%
@@ -1822,6 +2185,7 @@ in your filesystem where they will be found by \LaTeX.
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@addtodblcol}
%
@@ -2028,7 +2392,7 @@ in your filesystem where they will be found by \LaTeX.
%
% At the beginning of the page-clearing process, by definition all of the paragraph text involved is on the MVL and all floats have been encountered.
% There may be material in \cmd\pagesofar, and (in a multi-column page grid) any number of columns of the page have been composed.
-% Also, there might be footnote material saved up in \cmd\footbox.
+% Also, there might be footnote material saved up in \cmd\footsofar.
%
% Because we did not want to perform multiple \cmd\shipout s per visit to the output routine,
% our multi-column page makeup will not compose multiple columns per visit.
@@ -2166,9 +2530,7 @@ in your filesystem where they will be found by \LaTeX.
% measured.
% \begin{macrocode}
\mathchardef\do@endpage@pen=10007
-\@namedef{output@-\the\do@endpage@pen}{%
- \csname end@column@\thepagegrid\endcsname
-}%
+\@namedef{output@-\the\do@endpage@pen}{\csname end@column@\thepagegrid\endcsname}%
% \end{macrocode}
% \end{macro}
%
@@ -2217,7 +2579,7 @@ in your filesystem where they will be found by \LaTeX.
%
% \begin{macro}{\clr@top@firstmark}
% \begin{macro}{\set@top@firstmark}
-% \begin{macro}{\@outputpage}
+% \begin{macro}{\@outputpage@tail}
% We want accurate values of \cmd\topmark\ and \cmd\firstmark, but we must deal with
% the fact that there are many different ways of contributing material
% to the page. Only upon the first contribution to the page is the value of \cmd\topmark\
@@ -2256,10 +2618,9 @@ in your filesystem where they will be found by \LaTeX.
%
% As soon as a page is shipped out, we initialize the two macros that
% hold the values of \cmd\topmark\ and \cmd\firstmark, respectively.
-% \LaTeX\ has exactly one procedure \cmd\@outputpage\ that does \cmd\shipout,
-% which is as it should be: we tailpatch it, and the job is done.
+% \changes{4.1b}{2008/08/04}{Procedure \cs{@outputpage@tail} tailpatches \cs{@outputpage}}%
% \begin{macrocode}
-\appdef\@outputpage{%
+\appdef\@outputpage@tail{%
\clr@top@firstmark
}%
% \end{macrocode}
@@ -2283,36 +2644,46 @@ in your filesystem where they will be found by \LaTeX.
% and in the "dbl" version, \cmd\textwidth. However, an environment such as \env{turnpage}
% may change the meanings of these macros to allow turnpage floats.
%
+% \changes{4.0a}{2008/06/26 }{\cs{@yfloat}: de-fang \cs{set@footnotewidth} (see ltxutil.dtx): we have already done its job. }
+%
+% Note on \cmd\@xfloat: the optional argument must come to it fully expanded, because the macro
+% does a weird procedure on this argument, involving \cmd\@onelevel@sanitize, which I do not
+% understand, and which does not work if not so expanded.
+% \changes{4.1b}{2008/08/04}{Get rid of the \cs{reserved@a} idiom}
% \begin{macrocode}
\def\@float#1{%
- \@ifnextchar[{%}]{%Brace-matching klootch
+ \@ifnextchar[{%
+% \end{macrocode}
+% \verb+}]{+Brace-matching klootch
+% \begin{macrocode}
\@yfloat\width@float{#1}%
}{%
- \@ifxundefined@cs{fps@#1}{%
- \edef\reserved@a{\noexpand\@yfloat\noexpand\width@float{#1}[\csname fps@\endcsname]}\reserved@a
- }{%
- \edef\reserved@a{\noexpand\@yfloat\noexpand\width@float{#1}[\csname fps@#1\endcsname]}\reserved@a
- }%
+ \@ifxundefined@cs{fps@#1}{}{\expandafter\let\expandafter\fps@\csname fps@#1\endcsname}%
+ \expandafter\@argswap\expandafter{\expandafter[\fps@]}{\@yfloat\width@float{#1}}%
}%
}%
\def\@dblfloat#1{%
\@ifnum{\pagegrid@col=\@ne}{%
\@float{#1}%
}{%
- \@ifnextchar[{%}]{%Brace-matching klootch
+ \@ifnextchar[{%
+% \end{macrocode}
+% \verb+}]{+Brace-matching klootch
+% \begin{macrocode}
\@yfloat\widthd@float{#1}%
}{%
- \@ifxundefined@cs{fpsd@#1}{%
- \edef\reserved@a{\noexpand\@yfloat\noexpand\widthd@float{#1}[\csname fpsd@\endcsname]}\reserved@a
- }{%
- \edef\reserved@a{\noexpand\@yfloat\noexpand\widthd@float{#1}[\csname fpsd@#1\endcsname]}\reserved@a
- }%
+ \@ifxundefined@cs{fpsd@#1}{}{\expandafter\let\expandafter\fpsd@\csname fpsd@#1\endcsname}%
+ \expandafter\@argswap\expandafter{\expandafter[\fpsd@]}{\@yfloat\widthd@float{#1}}%
}%
}%
}%
+% \end{macrocode}
+% \changes{4.1b}{2008/08/04}{Turn off the \cs{set@footnotewidth} mechanism; a float `knows' its proper typesetting context}
+% \begin{macrocode}
\def\@yfloat#1#2[#3]{%
\@xfloat{#2}[#3]%
\hsize#1\linewidth\hsize
+ \let\set@footnotewidth\@empty
\minipagefootnote@init
}%
\def\fps@{tbp}%
@@ -2352,8 +2723,14 @@ in your filesystem where they will be found by \LaTeX.
% LaTeX Bug note: if a user types \cmd\begin{table*}[h], the float will never succeed in being placed!
% we try to catch such cases.
%
-% Note that the macro \cmd\check@currbox@count\ trys to catch cases where the float placement options
+% Note that the macro \cmd\check@currbox@count\ tries to catch cases where the float placement options
% are such that the float can never be placed.
+%
+% The calls to \cmd\@iffpsbit\ are part of a procedure to deny certain of the float placement
+% parameters: ``h'' and ``b'' are not possible, the former because the \cmd\marginpar\ mechanism
+% cannot place a full-page-width float within a multicolumn page grid, the latter because nobody
+% has yet written the code to do so (pretty bad reason, I know).
+% \changes{4.1b}{2008/08/04}{New procedure \cs{@iffpsbit} replaces \cs{@getfpsbit}}
% \begin{macrocode}
\def\end@float{%
\end@@float{%
@@ -2365,8 +2742,8 @@ in your filesystem where they will be found by \LaTeX.
\end@float
}{%
\end@@float{%
- \@boxfpsbit\@currbox{1}\@ifodd\@tempcnta{\global\advance\count\@currbox\m@ne}{}%
- \@boxfpsbit\@currbox{4}\@ifodd\@tempcnta{\global\advance\count\@currbox-4\relax}{}%
+ \@iffpsbit\@ne{\global\advance\count\@currbox\m@ne}{}%
+ \@iffpsbit\f@ur{\global\advance\count\@currbox-4\relax}{}%
\global\wd\@currbox\textwidth % Klootch
\check@currbox@count
}%
@@ -2374,7 +2751,6 @@ in your filesystem where they will be found by \LaTeX.
}%
\def\end@@float#1{%
\minipagefootnote@here
-%\minipagefootnotes
\@endfloatbox
#1%
\@ifnum{\@floatpenalty <\z@}{%
@@ -2388,19 +2764,117 @@ in your filesystem where they will be found by \LaTeX.
}%
}{}%
}%
+% \end{macrocode}
+% The \classname{float} package of Anselm Lingnau fails when used under \classname{ltxgrid}, but
+% we can fix things.
+% We also repair a bug in that package.
+%
+% \changes{4.1g}{2009/10/06}{(AO, 531) Fix package \classname{float} }
+% \begin{macrocode}
+\newcommand\float@end@float{%
+ \@endfloatbox
+ \global\setbox\@currbox\float@makebox\columnwidth
+ \let\@endfloatbox\relax
+ \end@float
+}%
+\newcommand\float@end@ltx{%
+ \end@@float{%
+ \global\setbox\@currbox\float@makebox\columnwidth
+ \check@currbox@count
+ }%
+}%
+\newcommand\newfloat@float[3]{%
+ \@namedef{ext@#1}{#3} %!
+ \let\float@do=\relax
+ \xdef\@tempa{\noexpand\float@exts{\the\float@exts \float@do{#3}}}%
+ \@tempa
+ \floatplacement{#1}{#2}%
+ \@ifundefined{fname@#1}{\floatname{#1}{#1}}{} %!
+ \expandafter\edef\csname ftype@#1\endcsname{\value{float@type}}%
+ \addtocounter{float@type}{\value{float@type}} %!
+ \restylefloat{#1}%
+ \expandafter\edef\csname fnum@#1\endcsname{%
+ \expandafter\noexpand\csname fname@#1\endcsname{} %!
+ \expandafter\noexpand\csname the#1\endcsname
+ }
+ \@ifnextchar[%]
+ {%
+ \float@newx{#1}%
+ }{%
+ \@ifundefined{c@#1}{\newcounter{#1}\@namedef{the#1}{\arabic{#1}}}{}%
+ }%
+}%
+\newcommand\newfloat@ltx[3]{%
+ \@namedef{ext@#1}{#3}%
+ \let\float@do=\relax
+ \xdef\@tempa{\noexpand\float@exts{\the\float@exts \float@do{#3}}}%
+ \@tempa
+ \floatplacement{#1}{#2}%
+ \@ifundefined{fname@#1}{\floatname{#1}{#1}}{}%
+ \expandafter\edef\csname ftype@#1\expandafter\endcsname\expandafter{\the\c@float@type}%
+ \addtocounter{float@type}{\value{float@type}}%
+ \restylefloat{#1}%
+ \expandafter\edef\csname fnum@#1\endcsname{%
+ \expandafter\noexpand\csname fname@#1\endcsname{}%
+ \expandafter\noexpand\csname the#1\endcsname
+ }
+ \@ifnextchar[%]
+ {%
+ \float@newx{#1}%
+ }{%
+ \@ifundefined{c@#1}{\newcounter{#1}\@namedef{the#1}{\arabic{#1}}}{}%
+ }%
+}%
+\appdef\document@inithook{%
+ \@ifxundefined\newfloat{}{%
+ \@ifx{\float@end\float@end@float}{%
+ \@ifx{\newfloat\newfloat@float}{\true@sw}{\false@sw}%
+ }{\false@sw}%
+ {%
+ \class@warn{Repair the float package}%
+ \let\float@end\float@end@ltx
+ \let\newfloat\newfloat@ltx
+ }{%
+ \class@warn{Failed to patch the float package}%
+ }%
+ }%
+}%
+% \end{macrocode}
+%
+% Boolean procedure \cmd\@iffpsbit\ is similar to the \cmd\@getfpsbit\ of \LaTeX, except
+% that we do not expose the scratch count register or even change its value.
+% \begin{macrocode}
+\def\@iffpsbit#1{%
+ \begingroup
+ \@tempcnta\count\@currbox
+ \divide\@tempcnta#1\relax
+ \@ifodd\@tempcnta{\aftergroup\true@sw}{\aftergroup\false@sw}%
+ \endgroup
+}%
+% \end{macrocode}
+%
+% In procedure \cmd\check@currbox@count, we calculate the net float placement
+% directive (encoded into \cmd\count\ \cmd\@currbox's least significant four bits).
+% If zero, issue a warning.
+% \changes{4.1b}{2008/08/04}{Tally the height of the float}
+% \begin{macrocode}
\def\check@currbox@count{%
\@ifnum{\count\@currbox>\z@}{%
- \count@\count\@currbox\divide\count@\sixt@@n\multiply\count@\sixt@@n
- \@tempcnta\count\@currbox\advance\@tempcnta-\count@
- \@ifnum{\@tempcnta=\z@}{%
+ \count@\count\@currbox\divide\count@\sixt@@n\multiply\count@\sixt@@n
+ \@tempcnta\count\@currbox\advance\@tempcnta-\count@
+ \@ifnum{\@tempcnta=\z@}{%
\ltxgrid@warn{Float cannot be placed}%
- }{}%
+ }{}%
+ \expandafter\tally@float\expandafter{\@captype}%
}{%
- % Is a \marginpar
+% \end{macrocode}
+% In this case, the float is a \cmd\marginpar.
+% \begin{macrocode}
}%
}%
\providecommand\minipagefootnote@init{}%
\providecommand\minipagefootnote@here{}%
+\providecommand\tally@float[1]{}%
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -2438,18 +2912,17 @@ in your filesystem where they will be found by \LaTeX.
\csname @floatselect@sw@\thepagegrid\endcsname\@currbox{%
\@ifnum{\count\@currbox>\z@}{%
\advance \@pageht \@pagedp
- \advance \@pageht \vsize \advance \@pageht -\pagegoal % do not assume \holdinginserts is cleared!
-% \@ifvbox\@kludgeins{%
-% \@ifdim{\wd\@kludgeins=\z@}{%
-% \advance \@pageht \ht\@kludgeins
-% }{}%
-% }{}%
-% \@reinserts
- \@addtocurcol % Commit an h float
- }{%
-% \@reinserts
- \@addmarginpar
- }%
+% \end{macrocode}
+% Do not assume \cmd\holdinginserts is cleared:
+% \begin{macrocode}
+ \advance \@pageht \vsize \advance \@pageht -\pagegoal
+% \end{macrocode}
+% Commit an `h' float:
+% \begin{macrocode}
+ \@addtocurcol
+ }{%
+ \@addmarginpar
+ }%
}{%
\@resethfps
\@cons\@deferlist\@currbox
@@ -2468,7 +2941,7 @@ in your filesystem where they will be found by \LaTeX.
% \end{macro}
%
% \begin{macro}{\@reinserts}
-% The \cmd\@reinserts\ procedure of standard \LaTeX\ is now obsoleted.
+% The \cmd\@reinserts\ procedure of standard \LaTeX\ is now obsoleted (it had been erroneous anyway).
% \begin{macrocode}
\let\@reinserts\@undefined
% \end{macrocode}
@@ -2627,7 +3100,10 @@ in your filesystem where they will be found by \LaTeX.
\ltxgrid@warn{You must load the graphics or graphicx package in order to use the turnpage environment}%
#2%
}%
-\AtBeginDocument{%
+% \end{macrocode}
+% \changes{4.1b}{2008/08/04}{Use \cs{document@inithook} instead of \cs{AtBeginDocument}}
+% \begin{macrocode}
+\appdef\document@inithook{%
\@ifxundefined\rotatebox{\let\rotatebox\rotatebox@dummy}{}%
}%
% \end{macrocode}
@@ -2641,14 +3117,19 @@ in your filesystem where they will be found by \LaTeX.
% \begin{macro}{output@-1073741824}
% The first one-off output routine handles the end of the job, wherein
% \LaTeX\ executes \cmd\@@end, and breaks to the output with a penalty of
-% $"40000000 = 2^{32}/4$. We simply discard \cmd\box\cmd\@cclv\ and leave.
+% $"40000000 = 2^{32}/4 = 1073741824$.
+% We simply discard \cmd\box\cmd\@cclv\ and leave.
% This means that \LaTeX\ is obligated to do \cmd\clearpage\ as part of
% its \enve{document} processing, otherwise material will be lost.
% \begin{macrocode}
-\@namedef{output@-1073741824}{%"40000000
+\@namedef{output@-1073741824}{%
\deadcycles\z@
+% \end{macrocode}
+% \begin{verbatim}
%\showbox\@cclv
- \setbox\z@\box\@cclv
+% \end{verbatim}
+% \begin{macrocode}
+ \void@cclv
}%
% \end{macrocode}
% \end{macro}
@@ -2682,18 +3163,18 @@ in your filesystem where they will be found by \LaTeX.
% \begin{macrocode}
\def\save@column{%
\@ifvoid\@cclv@saved{%
- \set@top@firstmark
- \global\@topmark@saved\expandafter{\@@topmark}%
+ \set@top@firstmark
+ \global\@topmark@saved\expandafter{\@@topmark}%
}{}%
- \global\setbox\@cclv@saved\vbox{%
+ \global\setbox\@cclv@saved\vbox{%
\@ifvoid\@cclv@saved{}{%
- \unvbox\@cclv@saved
- \marry@baselines
- }%
- \unvbox\@cclv
- \lose@breaks
- \setbox\z@\lastbox
- }%
+ \unvbox\@cclv@saved
+ \marry@baselines
+ }%
+ \unvbox\@cclv
+ \lose@breaks
+ \remove@lastbox
+ }%
}%
\newtoks\@topmark@saved
% \end{macrocode}
@@ -2706,7 +3187,7 @@ in your filesystem where they will be found by \LaTeX.
% the one-off output routine associated with \cmd\save@column@pen.
% \begin{macrocode}
\def\prep@cclv{%
- \setbox\z@\box\@cclv
+ \void@cclv
\setbox\@cclv\box\@cclv@saved
\vbadness\@M
}%
@@ -2723,7 +3204,7 @@ in your filesystem where they will be found by \LaTeX.
% first with \cmd\holdinginserts\ set, then with it cleared.
% \begin{macrocode}
\mathchardef\save@column@insert@pen=10017
-\@namedef{output@-\the\save@column@insert@pen}{\toggle@insert\savecolumn@holding\savecolumn@moving}%
+\@namedef{output@-\the\save@column@insert@pen}{\toggle@insert{\savecolumn@holding}{\savecolumn@moving}}%
% \end{macrocode}
% The procedure \cmd\savecolumn@holding\ is the first phase of saving a column with its inserts.
% This phase must detect and remedy the one circumstance that will confound our efforts to propagate marks.
@@ -2732,16 +3213,17 @@ in your filesystem where they will be found by \LaTeX.
%
% If it appears that we have the pathological ``Big Bad Box'' case at hand, we use the \cmd\dead@cycle@repair@protected\
% procedure instead of \cmd\dead@cycle\ to do our dead cycle.
+% \changes{4.1b}{2008/08/04}{Use \cs{trace@box} instead of \cs{showbox}}
% \begin{macrocode}
\def\savecolumn@holding{%
- \@if@exceed@pagegoal{\unvcopy\@cclv\setbox\z@\lastbox}{%
- \setbox\z@\vbox{\unvcopy\@cclv\setbox\z@\lastbox}%
- \outputdebug@sw{{\tracingall\scrollmode\showbox\z@}}{}%
- \dimen@\ht\@cclv\advance\dimen@-\ht\z@
- \dead@cycle@repair@protected\dimen@
- }{%
- \dead@cycle
- }%
+ \@if@exceed@pagegoal{\unvcopy\@cclv\remove@lastbox}{%
+ \setbox\z@\vbox{\unvcopy\@cclv\remove@lastbox}%
+ \outputdebug@sw{\trace@box\z@}{}%
+ \dimen@\ht\@cclv\advance\dimen@-\ht\z@
+ \dead@cycle@repair@protected\dimen@
+ }{%
+ \dead@cycle
+ }%
}%
% \end{macrocode}
% The procedure \cmd\save@column@moving\ is the second phase of saving a column with its inserts.
@@ -2751,18 +3233,19 @@ in your filesystem where they will be found by \LaTeX.
%
% Note that the message that is about to be executed had better deal properly with the contents of
% the \cmd\footins@saved\ box.
+% \changes{4.1b}{2008/08/04}{New procedure for showing a box contents, \cs{trace@box}}
% \begin{macrocode}
\def\savecolumn@moving{%
\@cclv@nontrivial@sw{%
- \save@column
+ \save@column
}{%
- {\setbox\z@\box\@cclv}%
+ \void@cclv
+ }%
+ \@ifvoid\footins{}{%
+ \outputdebug@sw{\trace@box\footins}{}%
+ \global\setbox\footins@saved\vbox{\unvbox\footins@saved\marry@baselines\unvbox\footins}%
+ \protect@penalty\save@column@insert@pen
}%
- \@ifvoid\footins{}{%
- \outputdebug@sw{{\tracingall\scrollmode\showbox\footins}}{}%
- \global\setbox\footins@saved\vbox{\unvbox\footins@saved\marry@baselines\unvbox\footins}%
- \protect@penalty\save@column@insert@pen
- }%
}%
\newbox\footins@saved
% \end{macrocode}
@@ -2779,17 +3262,19 @@ in your filesystem where they will be found by \LaTeX.
% namely \cmd\let@mark.
%
% Note: we expect that \cmd\box\cmd\@cclv's contents are well known:
-% \cmd\topskip, protection box, and a \cmd\mark, the latter havin the
-% message.
-% But if we came here via \cmd\penalty 10017, there might be an \cmd\insert\ node here as well, because
-% a footnote split.
+% \cmd\topskip, protection box, and a \cmd\mark, the latter containing the message.
+% But if we came here via \cmd\penalty 10017, there might be an \cmd\insert\ node present as well,
+% because a footnote may have split.
% Because this procedure simply voids out \cmd\box\cmd\@cclv, such material would be lost.
% Perhaps we can repair things by manipulating the \cmd\insert \ mechanism temporarily.
% \begin{macrocode}
\mathchardef\save@message@pen=10018
\@namedef{output@-\the\save@message@pen}{\save@message}%
\def\save@message{%
- \setbox\z@\box\@cclv %FIXME: what if \box\@cclv is not empty?
+ \void@cclv
+% \end{macrocode}
+%FIXME: what if \cmd\box\cmd\@cclv is not empty?
+% \begin{macrocode}
\toks@\expandafter{\@@firstmark}%
\expandafter\gdef\expandafter\@message@saved\expandafter{\the\toks@}%
\expandafter\do@@mark\expandafter{\the\@topmark@saved}%
@@ -2815,7 +3300,7 @@ in your filesystem where they will be found by \LaTeX.
% the output routine for execution in an environment appropriate to page makeup.
%
% How it works. We put down three large negative penalties, each of which will be handled by
-% the output dispatcher (not the output routine), each penalty being protected by
+% the output dispatcher (\emph{not} the natural output routine), each penalty being protected by
% a removable, non-discardable item (i.e., a box).
% Either three or four invocations of one-off output routines are involved per message.
%
@@ -2847,7 +3332,10 @@ in your filesystem where they will be found by \LaTeX.
% with a penalty value for the standard treatment.
% \begin{macrocode}
\def\execute@message{%
- \@execute@message\save@column@pen %Implicit #2
+ \@execute@message\save@column@pen
+% \end{macrocode}
+% Implicit second argument
+% \begin{macrocode}
}%
% \end{macrocode}
% \end{macro}
@@ -2863,7 +3351,7 @@ in your filesystem where they will be found by \LaTeX.
% must be dealt with in a way entirely analogous to \cmd\footins.
% \begin{macrocode}
\def\execute@message@insert#1{%
- \@execute@message\save@column@insert@pen{\setbox\footins\box\footins@saved#1}%
+ \@execute@message\save@column@insert@pen{\setbox \footins \box \footins@saved#1}%
}%
% \end{macrocode}
% \end{macro}
@@ -2893,7 +3381,11 @@ in your filesystem where they will be found by \LaTeX.
\toks@{\prep@cclv#2}%
\@@mark{\the\toks@}%
\penalty-\save@message@pen
+% \end{macrocode}
+%\begin{verbatim}
% \hbox{\vrule\@height\z@\@width\z@\@depth\dimen@}%
+%\end{verbatim}
+% \begin{macrocode}
\setbox\z@\null\dp\z@\dimen@\ht\z@-\dimen@
\nointerlineskip\box\z@
\penalty-\execute@message@pen
@@ -2940,7 +3432,10 @@ in your filesystem where they will be found by \LaTeX.
\def\lose@breaks{%
\loopwhile{%
\count@\lastpenalty
- \@ifnum{\count@=\@M}{% 10000 is a TeX magic number!
+ \@ifnum{\count@=\@M}{%
+% \end{macrocode}
+% Note: 10000 is a TeX magic number!
+% \begin{macrocode}
\unpenalty\true@sw
}{%
\false@sw
@@ -2968,7 +3463,7 @@ in your filesystem where they will be found by \LaTeX.
\vadjust{%
\execute@message{%
\unvbox\@cclv
- \setbox\z@\lastbox
+ \remove@lastbox
\unskip
\unskip
\unpenalty
@@ -3034,7 +3529,6 @@ in your filesystem where they will be found by \LaTeX.
%
% \begin{macro}{\move@insertions}
% \begin{macro}{\hold@insertions}
-% \begin{macro}{\move@insert@sw}
% In order to avoid bolluxing up \cmd\insert\ registers by our one-off
% output routines, we set \cmd\holdinginserts\ to zero by default and only
% clear it (briefly) while we handle cases where we want inserts to show up.
@@ -3042,14 +3536,12 @@ in your filesystem where they will be found by \LaTeX.
\def\move@insertions{\global\holdinginserts\z@}%
\def\hold@insertions{\global\holdinginserts\@ne}%
\hold@insertions
-\def\move@insert@sw{\@ifnum{\holdinginserts=\z@}}%
\def\toggle@insert#1#2{%
- \@ifnum{\holdinginserts=\z@}{\hold@insertions#2}{\move@insertions#1}%
+ \@ifnum{\holdinginserts>\z@}{\move@insertions#1}{\hold@insertions#2}%
}%
% \end{macrocode}
% \end{macro}
% \end{macro}
-% \end{macro}
%
%
% \subsection{Messages to alter the page grid}%
@@ -3132,16 +3624,17 @@ in your filesystem where they will be found by \LaTeX.
% name of your page grid.
%
% The procedure \cmd\open@column@ name starts the new page grid. It should define \cmd\thepagegrid,
-% deal with \cmd\box\cmd\pagesofar\ and \cmd\box\cmd\footbox\ (perhaps by leaving them alone),
+% deal with \cmd\box\cmd\pagesofar\ and \cmd\box\cmd\footsofar\ (perhaps by leaving them alone),
% and it should set the values of \LaTeX's page layout parameters for the column size and height.
%
% The procedure \cmd\shut@column@ name should expect to be called with \cmd\holdinginserts\
% cleared (it can assume that \cmd\holdinginserts\ will automatically be restored).
-% It should properly deal with insertions (like footnotes); calling \cmd\@makecol\
-% is a good way to do this. It should know that the page grid is being terminated
+% It should properly deal with insertions (like footnotes); calling \cmd\@makecolumn\
+% with an argument of \cmd\false@sw\ will do this.
+% It should know that the page grid is being terminated
% in the middle of a page, so it should make arrangements to carry the footnotes down to the
% bottom of the column or page, and it should possibly salt away the material for later
-% incorporation into the page. The box registers \cmd\footbox\ and \cmd\pagesofar\ are customarily used
+% incorporation into the page. The box registers \cmd\footsofar\ and \cmd\pagesofar\ are customarily used
% for this purpose.
%
% The procedure \cmd\end@column@ name should kick out a possibly short page containing all the
@@ -3159,10 +3652,24 @@ in your filesystem where they will be found by \LaTeX.
% The former can be the basis for, say, a single-column page grid with a side column.
%
% \begin{macro}{\pagesofar}
-% \begin{macro}{\footbox}
+% \begin{macro}{\footsofar}
% \begin{macrocode}
\newbox\pagesofar
-\newbox\footbox
+\newbox\footsofar
+\def\combine@foot@inserts{%
+ \@ifvoid\footins{%
+ }{%
+ \@ifvoid\footsofar{%
+ \global\setbox\footsofar\box\footins
+ }{%
+ \global\setbox\footsofar\vbox\bgroup
+ \unvbox\footsofar
+ \marry@baselines
+ \unvbox\footins
+ \egroup
+ }%
+ }%
+}%
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -3194,6 +3701,7 @@ in your filesystem where they will be found by \LaTeX.
%
% The procedure \cmd\open@column@one\ takes advantage of the special nature of the one-column
% page grid to deal with \cmd\box\cmd\pagesofar, therefore it must also reset \cmd\@colroom.
+% \changes{4.1b}{2008/08/04}{Change \cs{set@colroom} to \cs{set@colht}}
% \begin{macrocode}
\def\open@column@one#1{%
\unvbox\pagesofar
@@ -3201,27 +3709,35 @@ in your filesystem where they will be found by \LaTeX.
\global\pagegrid@col#1%
\global\pagegrid@cur\@ne
\set@colht
-%\set@colroom
\set@column@hsize\pagegrid@col
}%
% \end{macrocode}
%
% The procedure \cmd\shut@column@one\ saves away the one-column material into the box register \cmd\pagesofar.
% Because it is called from a message handler, we are assured that marks are properly taken care of.
+%
+% This instance of \cmd\@makecolumn\ is building a column for saving into \cmd\pagesofar.
+% \changes{4.1b}{2008/08/04}{Change \cs{@makecol} to \cs{@makecolumn} with argument}
+% \changes{4.1b}{2008/08/04}{Change \cs{set@colroom} to \cs{set@colht}}
+% \changes{4.1f}{2009/07/15}{(AO, 519) Preserve footnotes that are in \cs{footsofar} across a page grid change}
% \begin{macrocode}
\def\shut@column@one{%
- \@makecol
+ \@makecolumn\false@sw
\global\setbox\pagesofar\vbox{\unvbox\@outputbox\recover@footins}%
+ \combine@foot@inserts
\set@colht
-%\set@colroom
}%
% \end{macrocode}
%
-% The procedure \cmd\float@column@one\ takes care of a float column that has been built by \cmd\@tryfcolumn,
-% in the single-column page grid.
+% The procedure \cmd\float@column@one\ takes care of a float column that has been built by
+% \cmd\@tryfcolumn, in the single-column page grid.
+%
+% This instance of \cmd\@makecolumn\ is followed by \cmd\@outputpage: it is building
+% a column for \cmd\shipout, rather than for saving into \cmd\pagesofar.
+% \changes{4.1b}{2008/08/04}{Change \cs{@makecol} to \cs{@makecolumn} with argument}
% \begin{macrocode}
\def\float@column@one{%
- \@makecol
+ \@makecolumn\true@sw
\@outputpage
}%
% \end{macrocode}
@@ -3239,17 +3755,17 @@ in your filesystem where they will be found by \LaTeX.
% upon which it relies to correctly do what \cmd\clearpage\ requires.
% \begin{macrocode}
\def\end@column@one{%
- \unvbox\@cclv\setbox\z@\lastbox
+ \unvbox\@cclv\remove@lastbox
\protect@penalty\do@newpage@pen
}%
% \end{macrocode}
%
% The procedure \cmd\output@column@one\ is dispatched from the output routine when
-% we have completed a page (that is, a column in a one-column page grid).
-% It ships out the page using the \cmd\@outputpage\ of standard \LaTeX,
-% which has been retained (it is needed also in \cmd\output@column@mlt,
-% and in any case should remain as the sole procedure in \LaTeX\ where \cmd\shipout\ is performed).
+% we have completed a page (that is, a column in a one-column page grid);
+% it ships out the page using the \cmd\@outputpage.
% It will be followed up with an output routine message to prepare a new column.
+%
+% Query: by what mechanism do the footnotes get placed onto such a page?
% \begin{macrocode}
\def\output@column@one{%
\@outputpage
@@ -3335,6 +3851,7 @@ in your filesystem where they will be found by \LaTeX.
% If your document class descends from one of \LaTeX's standard classes.dtx-derived
% classes, it will break. You must expunge from it all such commands.
%
+% \changes{4.1b}{2008/08/04}{Change \cs{set@colroom} to \cs{set@colht}}
% \begin{macrocode}
\def\open@column@mlt#1{%
\gdef\thepagegrid{mlt}%
@@ -3342,7 +3859,6 @@ in your filesystem where they will be found by \LaTeX.
\global\pagegrid@cur\@ne
\set@column@hsize\pagegrid@col
\set@colht
-%\set@colroom
}%
% \end{macrocode}
%
@@ -3350,41 +3866,47 @@ in your filesystem where they will be found by \LaTeX.
% salts away all in \cmd\pagesofar. Because it is called in a message handler,
% we are assured that marks are handled properly.
% Attention: because this procedure balances columns, all footnotes are
-% held aside in \cmd\footbox\ for placement at the bottom of the page.
+% held aside in \cmd\footsofar\ for placement at the bottom of the page.
%
-% Bug note: the last macro executed by this procedure is \cmd\set@colht, but had been erroneously \cmd\set@colroom.
+% Bug note: the last macro executed by this procedure is \cmd\set@colht,
+% but had been erroneously \cmd\set@colroom.
% I now believe that the latter should be changed pretty much everywhere to the former.
+%
+% This instance of \cmd\@makecolumn\ is building material for \cmd\pagesofar, rather than
+% for \cmd\shipout.
+% \changes{4.1b}{2008/08/04}{Change \cs{@makecol} to \cs{@makecolumn} with argument}
+% \changes{4.1b}{2008/08/04}{Change \cs{@combinepage} to \cs{@combinepage} with argument}
+% \changes{4.1b}{2008/08/04}{Change \cs{set@colroom} to \cs{set@colht}}
% \begin{macrocode}
\def\shut@column@mlt{%
\@cclv@nontrivial@sw{%
- \@makecol
- \@ifnum{\pagegrid@cur<\pagegrid@col}{%
- \expandafter\global\expandafter\setbox\csname col@\the\pagegrid@cur\endcsname\box\@outputbox
- \global\advance\pagegrid@cur\@ne
- }{}%
+ \@makecolumn\false@sw
+ \@ifnum{\pagegrid@cur<\pagegrid@col}{%
+ \expandafter\global\expandafter\setbox\csname col@\the\pagegrid@cur\endcsname\box\@outputbox
+ \global\advance\pagegrid@cur\@ne
+ }{}%
}{%
- {\setbox\z@\box\@cclv}%
+ \void@cclv
}%
- \@ifnum{\pagegrid@cur>\@ne}{%
- \csname balance@\the\pagegrid@col\endcsname
- \grid@column{}%
- \@combinepage
- \@combinedblfloats
- \global\setbox\pagesofar\box\@outputbox
+ \@ifnum{\pagegrid@cur>\@ne}{%
+ \csname balance@\the\pagegrid@col\endcsname
+ \grid@column{}%
+ \@combinepage\false@sw
+ \@combinedblfloats
+ \global\setbox\pagesofar\box\@outputbox
+ \show@pagesofar@size
}{}%
\set@colht
}%
% \end{macrocode}
%
% The procedure \cmd\float@column@mlt\ takes care of a float page that has been built by \cmd\@tryfcolumn,
-% in the multi-column page grid.
+% in the multi-column page grid. It is coincidentally identical to what happens in
+% \cmd\do@startpage\ when a page needs to be shipped out.
+% \changes{4.1b}{2008/08/04}{New procedure \cs{@output@combined@page}}
% \begin{macrocode}
\def\float@column@mlt{%
- \@combinepage
- \@combinedblfloats
- \@outputpage
- \global\pagegrid@cur\@ne
- \protect@penalty\do@startpage@pen
+ \@output@combined@page
}%
% \end{macrocode}
%
@@ -3423,17 +3945,18 @@ in your filesystem where they will be found by \LaTeX.
% true = kick out a column and try again
{%
\@cclv@nontrivial@sw{%
- \unvbox\@cclv\setbox\z@\lastbox
+ \unvbox\@cclv\remove@lastbox
}{%
- \unvbox\@cclv\setbox\z@\lastbox\unskip\null
+ \unvbox\@cclv\remove@lastbox\unskip\null
}%
\protect@penalty\do@newpage@pen
\protect@penalty\do@endpage@pen
}{%
- \unvbox\@cclv\setbox\z@\lastbox
+ \unvbox\@cclv\remove@lastbox
}%
}%
% \end{macrocode}
+%
% The procedure \cmd\output@column@mlt (cf. \cmd\output@column@one)
% is dispatched from the output routine when
% we have completed a column in a multi-column page grid).
@@ -3443,6 +3966,9 @@ in your filesystem where they will be found by \LaTeX.
% full-page-width floats to the next page.
% Like \cmd\output@column@mlt, this is followed by
% an output routine message to prepare a new column.
+%
+% If a page needs to be shipped out, it uses the same mechanism as \cmd\do@startpage.
+% \changes{4.1b}{2008/08/04}{New procedure \cs{@output@combined@page}}
% \begin{macrocode}
\def\output@column@mlt{%
\@ifnum{\pagegrid@cur<\pagegrid@col}{%
@@ -3450,13 +3976,8 @@ in your filesystem where they will be found by \LaTeX.
\global\advance\pagegrid@cur\@ne
}{%
\set@adj@colht\dimen@
-% \advance\dimen@-\topskip
- \grid@column{}%{\dimen@}%
- \@combinepage
- \@combinedblfloats
- \@outputpage
- \global\pagegrid@cur\@ne
- \protect@penalty\do@startpage@pen
+ \grid@column{}%
+ \@output@combined@page
}%
}%
% \end{macrocode}
@@ -3556,8 +4077,7 @@ in your filesystem where they will be found by \LaTeX.
% The procedure \cmd\append@column\ appends columns for \cmd\grid@column,
% \cmd\box@column\ builds the columns for \cmd\append@column,
% and \cmd\marry@baselines\ pastes vertical things back together.
-% \changes{v4.0rc1}{2001/06/18}
-% {Introoduce \cs{marry@height} }
+% \changes{4.0a}{2001/06/18}{Introduce \cs{marry@height} }
%
% Note that \cmd\box@column\ makes an attempt to prevent excessive \cmd\topskip\
% or \cmd\baselineskip\ glue
@@ -3571,7 +4091,7 @@ in your filesystem where they will be found by \LaTeX.
% to use: it will change if floats have been placed in the last column of the page.
% I believe \cmd\textheight\ is the correct parameter to use here.
%
-% A REVTeX4 beta user, Sergey Strelkov (strelkov@maik.rssi.ru), wants the option
+% A REVTeX4 user, Sergey Strelkov (strelkov@maik.rssi.ru), wants the option
% of ragged-bottom columns. Implementing this feature properly means reboxing the
% columns to their natural height only if \cmd\raggedcolumn@sw\ is true.
% Otherwise, they get reboxed to their common height (\cmd\@colht?).
@@ -3624,20 +4144,21 @@ in your filesystem where they will be found by \LaTeX.
}%
}%
\def\marry@baselines{%
-%{\tracingall\scrollmode\showlists}%
-%\skip@\baselineskip\advance\skip@-\topskip %FIXME: cannot assume \baselineskip nor \topskip
\vskip\marry@skip\relax
}%
\gdef\marry@skip{\z@skip}%
\def\set@marry@skip{%
- \begingroup
+ \begingroup
\skip@\baselineskip\advance\skip@-\topskip
\@ifdim{\skip@>\z@}{%
\xdef\marry@skip{\the\skip@}%
}{}%
\endgroup
}%
-\AtBeginDocument{%
+% \end{macrocode}
+% \changes{4.1b}{2008/08/04}{Use \cs{document@inithook} instead of \cs{AtBeginDocument}}
+% \begin{macrocode}
+\appdef\document@inithook{%
\@ifxundefined\raggedcolumn@sw{\@booleanfalse\raggedcolumn@sw}{}%
}%
\def\raggedcolumn@skip{%
@@ -3649,9 +4170,18 @@ in your filesystem where they will be found by \LaTeX.
% \end{macro}
%
% \begin{macro}{\@combinepage}
-% The procedure \cmd\@combinepage\ prepends the stored page to \cmd\@outputbox.
+% The procedure \cmd\@combinepage\ prepends the stored page (\cmd\pagesofar) to \cmd\@outputbox\ and
+% employs \cmd\@combineinserts\ to lay down the footnotes.
+% The next event will usually be shipping out the made-up page, but not always.
+% Therefore the argument of \cmd\@combinepage, which must be a Boolean, determines
+% if the footnotes are to be combined into this page.
+%
+% \changes{4.1b}{2008/08/04}{Change \cs{@combinepage} to \cs{@combinepage} with argument}
+% \changes{4.1b}{2008/08/04}{(AO, 452) Support length checking: show size of shipped out text.}
+%
+% QUERY: In the following, if \cmd\box\cmd\footins\ is not void, its contents are lost. Can this ever happen?
% \begin{macrocode}
-\def\@combinepage{%
+\def\@combinepage#1{%
\@ifvoid\pagesofar{}{%
\setbox\@outputbox\vbox{%
\unvbox\pagesofar
@@ -3659,17 +4189,60 @@ in your filesystem where they will be found by \LaTeX.
\unvbox\@outputbox
}%
}%
- \@ifvoid\footbox{}{%
- \setbox\@outputbox\vbox{%
- \unvbox\@outputbox
- \marry@baselines
- \unvbox\footbox
+ #1{%
+ \@ifvoid\footsofar{}{%
+ \show@box@size{Combining page footnotes}\footsofar
+ \setbox\footins\box\footsofar
+ \@combineinserts\@outputbox\footins
}%
+ }{%
+% \end{macrocode}
+%QUERY: The following line was removed, probably to fix a bug. When was this done?
+% \begin{verbatim}
+% \global\setbox\footins\box\footsofar
+% \end{verbatim}
+% \begin{macrocode}
}%
}%
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\@cflt}
+% \begin{macro}{\@cflb}
+% \changes{4.1b}{2008/08/04}{}
+% We modify \LaTeX's \cmd\@cflt\ and \cmd\@cflb\ to remove the unwanted glue with \cmd\unskip.
+% \begin{macrocode}
+\def \@cflt{%
+ \let \@elt \@comflelt
+ \setbox\@tempboxa \vbox{}%
+ \@toplist
+ \setbox\@outputbox \vbox{%
+ \boxmaxdepth \maxdepth
+ \unvbox\@tempboxa\unskip
+ \topfigrule\vskip \textfloatsep
+ \unvbox\@outputbox
+ }%
+ \let\@elt\relax
+ \xdef\@freelist{\@freelist\@toplist}%
+ \global\let\@toplist\@empty
+}%
+\def \@cflb {%
+ \let\@elt\@comflelt
+ \setbox\@tempboxa \vbox{}%
+ \@botlist
+ \setbox\@outputbox \vbox{%
+ \unvbox\@outputbox
+ \vskip \textfloatsep\botfigrule
+ \unvbox\@tempboxa\unskip
+ }%
+ \let\@elt\relax
+ \xdef\@freelist{\@freelist\@botlist}%
+ \global \let \@botlist\@empty
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\@combinedblfloats}
% We modify \LaTeX's \cmd\@combinedblfloats\ to be more appropriate for incremental page building:
% we \cmd\unvbox\ the \cmd\@outputbox.
@@ -3696,8 +4269,7 @@ in your filesystem where they will be found by \LaTeX.
% The procedure \cmd\set@column@hsize\ takes care of setting up the horizontal dimensions
% for the current page grid. The present routine will certainly not be adequate for more
% complex page layouts (e.g., with a side column), but works for the common ones.
-% \changes{v4.0rc1}{2001/06/18}
-% {Introoduce \cs{set@marry@height} }
+% \changes{4.0a}{2001/06/18}{Introduce \cs{set@marry@height} }
% \begin{macrocode}
\def\set@column@hsize#1{%
\pagegrid@col#1%
@@ -3740,7 +4312,7 @@ in your filesystem where they will be found by \LaTeX.
%
% Question: what if there are committed floats? Footnotes?
% Answer: full-page-width floats are only committed at top, and they are already reckoned with in \cmd\@colht.
-% Column-width committed floats are incorporated by \cmd\@makecol; footnotes need help.
+% Column-width committed floats are incorporated by \cmd\@makecolumn; footnotes need help.
%
% Note: FIXME: adjusting for \cmd\pagesofar\ is done at not quite the right time. I need to reexamine \cmd\set@colht,
% because \cmd\@dbltoplist\ and \cmd\pagesofar\ really should be on the same footing.
@@ -3749,12 +4321,13 @@ in your filesystem where they will be found by \LaTeX.
% These concerns will be particularly germane if we ever extend this package to deal with full-page-width floats
% placed at the bottom of the page, or committed on the same page as called out.
%
-% It occurs to me that we should ditch \cmd\set@colroom\ and only ever execute \cmd\set@colht, which sets \cmd\@colroom\ as a side effect.
+% It occurs to me that we should ditch \cmd\set@colroom\ and only ever execute \cmd\set@colht,
+% which sets \cmd\@colroom\ as a side effect.
% If so, we can make \cmd\@colht\ take \cmd\pagesofar\ into account, as it should. Then \cmd\@colht\ will return to its
% original significance as the value that \cmd\@colroom\ is set to after a column is committed.
%
% On the other hand, why not simply forget all this caching and (re-)calculate \cmd\vsize\ as late as possible?
-% Paticularly, \cmd\@colht\ is an artifact of the old way of doing things, where once it was set, it would never change.
+% Particularly, \cmd\@colht\ is an artifact of the old way of doing things, where once it was set, it would never change.
%
% \begin{macrocode}
\def\set@colht{%
@@ -3767,9 +4340,6 @@ in your filesystem where they will be found by \LaTeX.
\def\@elt{\adj@page#1}%
\@booleantrue\firsttime@sw\@dbltoplist
\let\@elt\relax
-%\@ifvoid\pagesofar{}{%
-% \advance#1-\ht\pagesofar\advance#1-\dp\pagesofar
-%}%
\global#1#1\relax
\outputdebug@sw{\saythe#1}{}%
}%
@@ -3777,8 +4347,8 @@ in your filesystem where they will be found by \LaTeX.
\set@adj@colht\@colroom
\@if@empty\enlarge@colroom{}{%
\global\advance\@colroom\enlarge@colroom\relax
+ \outputdebug@sw{\saythe\@colroom}{}%
}%
- \outputdebug@sw{\saythe\@colroom}{}%
\@ifdim{\@colroom>\topskip}{}{%
\ltxgrid@info{Not enough room: \string\@colroom=\the\@colroom; increasing to \the\topskip}%
\@colroom\topskip
@@ -3791,28 +4361,53 @@ in your filesystem where they will be found by \LaTeX.
\global\vsize\@colroom
\outputdebug@sw{\saythe\vsize}{}%
}%
-%
+% \end{macrocode}
+% \changes{4.1b}{2008/08/04}{Procedure \cs{set@adj@footins} to adjust for footnotes and other inserts}
+% \begin{macrocode}
\def\set@adj@colht#1{%
#1\@colht
+ \outputdebug@sw{\saythe#1}{}%
\@ifvoid\pagesofar{}{%
\advance#1-\ht\pagesofar\advance#1-\dp\pagesofar
+ \outputdebug@sw{\saythe#1}{}%
}%
- \@ifvoid\footbox{}{%
- \advance#1-\ht\footbox\advance#1-\dp\footbox
- }%
+ \set@adj@footins#1%
\def\@elt{\adj@column#1}%
\@booleantrue\firsttime@sw\@toplist
\@booleantrue\firsttime@sw\@botlist
\let\@elt\relax
- \outputdebug@sw{\saythe#1}{}%
}%
\def\adj@column#1#2{%
\advance#1-\ht#2%
\advance#1-\firsttime@sw{\textfloatsep\@booleanfalse\firsttime@sw}{\floatsep}%
+ \outputdebug@sw{\saythe#1}{}%
}%
\def\adj@page#1#2{%
\advance#1-\ht#2%
\advance#1-\firsttime@sw{\dbltextfloatsep\@booleanfalse\firsttime@sw}{\dblfloatsep}%
+ \outputdebug@sw{\saythe#1}{}%
+}%
+% \end{macrocode}
+% \changes{4.1b}{2008/08/04}{Procedure \cs{set@adj@footins} to adjust for footnotes and other inserts}
+% \changes{4.1f}{2009/07/14}{(AO, 519) Do not use \cs{dimen@} register as a scratch register in \cs{set@adj@footins}}
+% Bug note (AO): I had used \cmd\dimen@\ as a scratch register within this procedure, because I had thought
+% that doing, e.g., \cmd\advance\cmd\dimen@-\cmd\skip\cmd\footins\ would not work in \TeX.
+% Not only was I wrong about that, but I then proceded to execute \cmd\set@adj@footins\cmd\dimen@,
+% which understandably did not work. Ah! The treachery of the human mind.
+% \begin{macrocode}
+\def\set@adj@footins#1{%
+ \@booleanfalse\temp@sw
+ \set@adj@box#1\footins
+ \set@adj@box#1\footins@saved
+ \set@adj@box#1\footsofar
+ \temp@sw{\advance#1-\skip\footins}{}%
+}%
+\def\set@adj@box#1#2{%
+ \@ifvoid#2{}{%
+ \advance#1-\ht#2\advance#1-\dp#2%
+ \@booleantrue\temp@sw
+ \outputdebug@sw{\saythe#1}{}%
+ }%
}%
% \end{macrocode}
% \end{macro}
@@ -3820,8 +4415,9 @@ in your filesystem where they will be found by \LaTeX.
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\@outputpage}%
-% At the tail of \cmd\@outputpage, we set \cmd\@colht\ and the float placement parameters
+% \begin{macro}{\@outputpage@tail}%
+% \changes{4.1b}{2008/08/04}{Procedure \cs{@outputpage@tail} tailpatches \cs{@outputpage}}%
+% In \cmd\@outputpage@tail, we set \cmd\@colht\ and the float placement parameters
% (this is the one point where it is appropriate to set \cmd\@colht).
% At \cmd\do@startpage\ time, we adjust \cmd\@colht's value to reflect committed
% full-page-width floats.
@@ -3829,7 +4425,7 @@ in your filesystem where they will be found by \LaTeX.
% Note: with a correctly written output routine, a call to \cmd\@outputpage\ will inevitably be
% followed by a call to \cmd\do@startpage, so these procedure calls would be unneeded.
% \begin{macrocode}
-\appdef\@outputpage{%
+\appdef\@outputpage@tail{%
\set@colht % FIXME: needed?
\@floatplacement % FIXME: needed?
\@dblfloatplacement % FIXME: needed?
@@ -3838,23 +4434,50 @@ in your filesystem where they will be found by \LaTeX.
% \end{macro}
%
% \begin{macro}{balance@2}
+% \changes{4.1b}{2008/08/04}{Procedure \cs{balance@2} defined more transparently}%
% We define procedures for balancing columns in a multicolumn layout.
% For now, we define only one: a procedure for the two-column grid.
% All others will simply \cmd\relax\ out.
-% \begin{macrocode}
-\@namedef{balance@2}{%
- \expandafter\balance@two\csname col@1\endcsname\@outputbox
- % Avoid a bug by preventing a restore when leaving this group
- \global\setbox\csname col@1\endcsname\box\csname col@1\endcsname
- \@ifvoid\footbox{}{%
- \global\setbox\footbox\vbox{%
- \setbox\z@\box\@tempboxa
- \let\recover@footins\relax
- \balance@two\footbox\@tempboxa
- \hb@xt@\textwidth{\box\footbox\hfil\box\@tempboxa}%
+%
+% The following code defines \verb+\balance@2+ without all the clunky \cmd\csname\ commands
+% in the replacement part,
+% which appears on the right-hand side of the assignment to \cmd\toks@.
+%
+% The method is straightforward: balance the two columns of text, and balance the footnotes.
+% Later on, \cmd\@combineinserts\ will be called to place the footnotes after the now-balanced columns.
+%
+% \changes{4.1f}{2009/07/14}{(AO, 519) \cs{footins} content must be preserved and reintegrated}
+% It was necessary to deal with the case where \cmd\box\cmd\footsofar\ was not empty
+% upon execution of this balancing code. We store it away in \cmd\box\cmd\footins\ and
+% add it back in afterwards.
+% \begin{macrocode}
+\begingroup
+ \catcode`\1=\cat@letter
+ \catcode`\2=\cat@letter
+% \end{macrocode}
+% \cmd\toks@\ contains the repacement part for an effective \cmd\def\cs{balance@2}.
+% \begin{macrocode}
+ \toks@{%
+ \setbox\footins\box\footsofar
+ \balance@two\col@1\@outputbox
+% \end{macrocode}
+% \begin{verbatim}
+% \global\setbox\col@1\box\col@1
+% \end{verbatim}
+% \begin{macrocode}
+ \combine@foot@inserts
+ \@ifvoid\footsofar{}{%
+ \global
+ \setbox\footsofar\vbox\bgroup
+ \setbox\z@\box\@tempboxa
+ \let\recover@footins\relax
+ \balance@two\footsofar\@tempboxa
+ \hb@xt@\textwidth{\box\footsofar\hfil\box\@tempboxa}%
+ \egroup
}%
}%
-}%
+ \aftergroup\def\aftergroup\balance@2\expandafter
+\endgroup\expandafter{\the\toks@}%
% \end{macrocode}
% \end{macro}
%
@@ -3898,7 +4521,7 @@ in your filesystem where they will be found by \LaTeX.
% \cmd\z@\
% \cmd\vskip-%
% \cmd\dimen@.
-% The error here is that the shift of the last box in the vertical list will be lost in the process.
+% The error here is that the (horizontal) shift of the last box in the vertical list will be lost in the process.
% Simply put, \cmd\setbox\cmd\z@\cmd\lastbox\ fails to retain the shift of the box node in the vertical list,
% and when it is put down again via \cmd\box\cmd\z@, it will no longer have the correct shift.
%
@@ -3923,9 +4546,10 @@ in your filesystem where they will be found by \LaTeX.
%
% The dimension involved is checked against the current \cmd\@colroom\ to guard against the case where
% excessive material happens to fall in either column.
+% \changes{4.1b}{2008/08/04}{Change \cs{set@colroom} to \cs{set@colht}}
% \begin{macrocode}
\def\balance@two#1#2{%
- \outputdebug@sw{{\tracingall\scrollmode\showbox#1\showbox#2}}{}%
+ \outputdebug@sw{\trace@scroll{\showbox#1\showbox#2}}{}%
\setbox\@ne\vbox{%
\@ifvoid#1{}{%
\unvcopy#1\recover@footins
@@ -3945,11 +4569,11 @@ in your filesystem where they will be found by \LaTeX.
\setbox\z@\copy\@ne\setbox\tw@\vsplit\z@ to\dimen@
\setbox\z@ \vbox{%
\unvcopy\z@
- \setbox\z@\vbox{\unvbox\z@ \setbox\z@\lastbox\aftergroup\vskip\aftergroup-\expandafter}\the\dp\z@\relax
+ \setbox\z@\vbox{\unvbox\z@ \remove@lastbox\aftergroup\vskip\aftergroup-\expandafter}\the\dp\z@\relax
}%
\setbox\tw@\vbox{%
\unvcopy\tw@
- \setbox\z@\vbox{\unvbox\tw@\setbox\z@\lastbox\aftergroup\vskip\aftergroup-\expandafter}\the\dp\z@\relax
+ \setbox\z@\vbox{\unvbox\tw@\remove@lastbox\aftergroup\vskip\aftergroup-\expandafter}\the\dp\z@\relax
}%
\dimen@ii\ht\tw@\advance\dimen@ii-\ht\z@
\@ifdim{\dimen@i>.5\p@}{%
@@ -3965,30 +4589,30 @@ in your filesystem where they will be found by \LaTeX.
}%
}%
\outputdebug@sw{\saythe\dimen@\saythe\dimen@i\saythe\dimen@ii}{}%
- \@ifdim{\ht\z@=\z@}{%
- \@ifdim{\ht\tw@=\z@}{%
- \true@sw
- }{%
- \false@sw
- }%
- }{%
- \true@sw
- }%
- {%
- }{%
- \ltxgrid@info{Unsatifactorily balanced columns: giving up}%
- \setbox\tw@\box#1%
- \setbox\z@ \box#2%
- }%
+ \@ifdim{\ht\z@=\z@}{%
+ \@ifdim{\ht\tw@=\z@}{%
+ \true@sw
+ }{%
+ \false@sw
+ }%
+ }{%
+ \true@sw
+ }%
+ {%
+ }{%
+ \ltxgrid@info{Unsatifactorily balanced columns: giving up}%
+ \setbox\tw@\box#1%
+ \setbox\z@ \box#2%
+ }%
\setbox\tw@\vbox{\unvbox\tw@\vskip\z@skip}%
\setbox\z@ \vbox{\unvbox\z@ \vskip\z@skip}%
- \set@colroom
- \dimen@\ht\z@\@ifdim{\dimen@<\ht\tw@}{\dimen@\ht\tw@}{}%
- \@ifdim{\dimen@>\@colroom}{\dimen@\@colroom}{}%
+ \set@colht
+ \dimen@\ht\z@\@ifdim{\dimen@<\ht\tw@}{\dimen@\ht\tw@}{}%
+ \@ifdim{\dimen@>\@colroom}{\dimen@\@colroom}{}%
\outputdebug@sw{\saythe{\ht\z@}\saythe{\ht\tw@}\saythe\@colroom\saythe\dimen@}{}%
- \setbox#1\vbox to\dimen@{\unvbox\tw@\unskip\raggedcolumn@skip}%
- \setbox#2\vbox to\dimen@{\unvbox\z@ \unskip\raggedcolumn@skip}%
- \outputdebug@sw{{\tracingall\scrollmode\showbox#1\showbox#2}}{}%
+ \setbox#1\vbox to\dimen@{\unvbox\tw@\unskip\raggedcolumn@skip}%
+ \setbox#2\vbox to\dimen@{\unvbox\z@ \unskip\raggedcolumn@skip}%
+ \outputdebug@sw{\trace@scroll{\showbox#1\showbox#2}}{}%
}%
% \end{macrocode}
% \end{macro}
@@ -3997,29 +4621,29 @@ in your filesystem where they will be found by \LaTeX.
% The procedure \cmd\recover@footins\ is the utility procedure for recovering the footnotes
% from the bottom of a column. It is used when the page grid is changed, so that footnotes can be
% set at the bottom of the shipped out page.
+% \changes{4.1b}{2008/08/04}{New procedure for showing a box contents, \cs{trace@box}}
% \begin{macrocode}
\def\recover@footins{%
\skip\z@ \lastskip\unskip
\skip\@ne\lastskip\unskip
\setbox\z@\lastbox
\@ifvbox\z@{%
- \setbox\z@\vbox{%
- \unvbox\z@
- \setbox\z@\lastbox
-% \outputdebug@sw{{\tracingall\showbox\lastbox}}{}%
- \@ifvoid\z@{}{%
- \global\setbox\footbox\vbox{%
- \unvbox\footbox
+ \setbox\z@\vbox{%
+ \unvbox\z@
+ \setbox\z@\lastbox
+ \@ifvoid\z@{}{%
+ \global\setbox\footsofar\vbox{%
+ \unvbox\footsofar
\@ifvbox\z@{%
- \unvbox\z@
- }{%
- \box\z@
- }%
- }%
- }%
- }%
+ \unvbox\z@
+ }{%
+ \box\z@
+ }%
+ }%
+ }%
+ }%
}{}%
- \outputdebug@sw{{\tracingall\scrollmode\showbox\footbox}}{}%
+ \outputdebug@sw{\trace@box\footsofar}{}%
}%
% \end{macrocode}
% \end{macro}
@@ -4081,7 +4705,6 @@ in your filesystem where they will be found by \LaTeX.
%
% These things can be accomodated easily by the \classname{ltxgrid} output
% routine hooks.
-%
%
% \begin{macro}{\longtable}
% \begin{macrocode}
@@ -4129,6 +4752,9 @@ in your filesystem where they will be found by \LaTeX.
\endgraf\penalty\z@\addvspace\LTpost
\ifvoid\footins\else\insert\footins{}\fi
}%
+% \end{macrocode}
+% \changes{4.1a}{2008/06/29}{Repair error in \cs{endlongtable@new} involving \cs{@ifx}: argument not delimited.}
+% \begin{macrocode}
\def\endlongtable@new{%
\crcr
\noalign{%
@@ -4148,7 +4774,7 @@ in your filesystem where they will be found by \LaTeX.
}%
}%
}{}%
- \@ifx\LT@save@row\LT@@save@row{}{%
+ \@ifx{\LT@save@row\LT@@save@row}{}{%
\LT@warn{%
Column \@width s have changed\MessageBreak in table \thetable
}\LT@final@warn
@@ -4166,34 +4792,40 @@ in your filesystem where they will be found by \LaTeX.
% \begin{macro}{\LT@start}
% \begin{macrocode}
\def\LT@start@longtable{%
- \let\LT@start\endgraf
- \endgraf
- \penalty\z@
- \vskip\LTpre
- \dimen@\pagetotal
- \advance\dimen@ \ht\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi
- \advance\dimen@ \dp\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi
- \advance\dimen@ \ht\LT@foot
- \dimen@ii\vfuzz\vfuzz\maxdimen
- \setbox\tw@\copy\z@
- \setbox\tw@\vsplit\tw@ to \ht\@arstrutbox
- \setbox\tw@\vbox{\unvbox\tw@}%
- \vfuzz\dimen@ii
- \advance\dimen@ \ht
- \ifdim\ht\@arstrutbox>\ht\tw@\@arstrutbox\else\tw@\fi
- \advance\dimen@\dp
- \ifdim\dp\@arstrutbox>\dp\tw@\@arstrutbox\else\tw@\fi
- \advance\dimen@ -\pagegoal
- \ifdim \dimen@>\z@\vfil\break\fi
- \global\@colroom\@colht
- \ifvoid\LT@foot\else
- \advance\vsize-\ht\LT@foot
- \global\advance\@colroom-\ht\LT@foot
- \dimen@\pagegoal\advance\dimen@-\ht\LT@foot\pagegoal\dimen@
- \maxdepth\z@
- \fi
- \ifvoid\LT@firsthead\copy\LT@head\else\box\LT@firsthead\fi
- \output{\LT@output}%
+ \let\LT@start\endgraf
+ \endgraf\penalty\z@\vskip\LTpre
+ \dimen@\pagetotal
+ \advance\dimen@ \ht\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi
+ \advance\dimen@ \dp\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi
+ \advance\dimen@ \ht\LT@foot
+ \dimen@ii\vfuzz
+ \vfuzz\maxdimen
+ \setbox\tw@\copy\z@
+ \setbox\tw@\vsplit\tw@ to \ht\@arstrutbox
+ \setbox\tw@\vbox{\unvbox\tw@}%
+ \vfuzz\dimen@ii
+ \advance\dimen@ \ht
+ \ifdim\ht\@arstrutbox>\ht\tw@\@arstrutbox\else\tw@\fi
+ \advance\dimen@\dp
+ \ifdim\dp\@arstrutbox>\dp\tw@\@arstrutbox\else\tw@\fi
+ \advance\dimen@ -\pagegoal
+ \ifdim \dimen@>\z@\vfil\break\fi
+ \global\@colroom\@colht
+ \ifvoid\LT@foot\else
+ \advance\vsize-\ht\LT@foot
+ \global\advance\@colroom-\ht\LT@foot
+ \dimen@\pagegoal\advance\dimen@-\ht\LT@foot\pagegoal\dimen@
+ \maxdepth\z@
+ \fi
+ \ifvoid\LT@firsthead\copy\LT@head\else\box\LT@firsthead\fi
+% \end{macrocode}
+% At some point before version 4.11, the \cmd\nobreak\ was added.
+% \begin{macrocode}
+\nobreak
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \output{\LT@output}%
}%
\def\LT@start@new{%
\let\LT@start\endgraf
@@ -4229,6 +4861,8 @@ in your filesystem where they will be found by \LaTeX.
% \end{macro}
%
% \begin{macro}{\LT@array}
+%
+%
% \begin{macrocode}
\def\LT@array@longtable[#1]#2{%
\refstepcounter{table}\stepcounter{LT@tables}%
@@ -4275,15 +4909,18 @@ in your filesystem where they will be found by \LaTeX.
\global\advance\c@LT@chunks\@ne
\global\LT@rows\z@\setbox\z@\vbox\bgroup
\LT@setprevdepth
- \tabskip\LTleft\halign to\hsize\bgroup
+% \end{macrocode}
+% At some point before version 4.11, the \cmd\noexpand\ was added.
+% We need not change our own version, because we did it right, back in 1998 (using \cmd\appdef).
+% \begin{macrocode}
+ \tabskip\LTleft \noexpand\halign to\hsize\bgroup
\tabskip\z@ \@arstrut \@preamble \tabskip\LTright \cr}%
\endgroup
\expandafter\LT@nofcols\LT@bchunk&\LT@nofcols
\LT@make@row
\m@th\let\par\@empty
\everycr{}\lineskip\z@\baselineskip\z@
- \LT@bchunk
-}%
+ \LT@bchunk}%
\def\LT@LR@l{\LTleft\z@ \LTright\fill}%
\def\LT@LR@r{\LTleft\fill \LTright\z@ }%
\def\LT@LR@c{\LTleft\fill \LTright\fill}%
@@ -4312,12 +4949,24 @@ in your filesystem where they will be found by \LaTeX.
\def\@startpbox{\vtop\LT@startpbox}%
\let\@@startpbox\@startpbox
\let\@@endpbox\@endpbox
- \let\LT@LL@FM@cr\@tabularcr
+% \end{macrocode}
+% Because \classname{ltxutil} patches \LaTeX's \cmd\@tabularcr and \cmd\@xtabularcr,
+% we must restore these procedures in the scope of \env{longtable}.
+% Ironically, the patches in \classname{ltxutil} were for the purpose of extending
+% the \env{tabular} environment to prevent pagebreaks with the *-form of \cmd\\,
+% just the same as is being done here. But the two mechanisms conflict.
+% \changes{4.1a}{2008/06/29}{Change \cs{LT@array@new}: restore \cs{@tabularcr} and \cs{@xtabularcr}}
+% \begin{macrocode}
+ \let\LT@LL@FM@cr\@tabularcr@LaTeX
+ \let\@xtabularcr\@xtabularcr@LaTeX
}{%
\advance\@tempdima\extrarowheight
\col@sep\tabcolsep
\let\@startpbox\LT@startpbox
- \let\LT@LL@FM@cr\@arraycr
+% \end{macrocode}
+% \changes{4.1a}{2008/06/29}{Change \cs{LT@array@new}: set \cs{LT@LL@FM@cr} to \cs{@arraycr@array} instead of \cs{@arraycr}}
+% \begin{macrocode}
+ \let\LT@LL@FM@cr\@arraycr@array
}%
%
\let\@acoll\@tabacoll
@@ -4373,14 +5022,6 @@ in your filesystem where they will be found by \LaTeX.
% use the full page width for setting the table.
% You can think this way: \env{longtable*} is to \env{longtable} as \env{table*} is to \env{table}.
%
-%FIXME: the following is no longer true:
-%% Note that it is not enough to define the environment itself; we also have to create the corresponding
-%% \cmd\output\ routine procedures, which provide for continued footers and headers
-%% (the very feature of \env{longtable} requiring support in the output routine).
-%
-%% This same consideration would arise in defining any syntactic extension to \env{longtable}, because
-%% the environment name itself is exposed in the output routine.
-%
% \begin{macrocode}
\def\switch@longtable{%
\@ifpackageloaded{longtable}{%
@@ -4412,9 +5053,9 @@ in your filesystem where they will be found by \LaTeX.
\endlongtable
\onecolumngrid@pop
}%
-% \expandafter\let\csname output@init@longtable*\endcsname\output@init@longtable
-% \expandafter\let\csname output@prep@longtable*\endcsname\output@prep@longtable
-% \expandafter\let\csname output@post@longtable*\endcsname\output@post@longtable
+% \end{macrocode}
+% Removed obsolete code.
+% \begin{macrocode}
}{}%
}%
% \end{macrocode}
@@ -4477,8 +5118,11 @@ in your filesystem where they will be found by \LaTeX.
\let\output@prep@theindex\@empty
\def\output@post@theindex{%
\@ifodd\c@page{}{%
- \@ifnum{\pagegrid@cur=\@ne}{% we have the leftmost column of a verso page
- % insert the current top-level continued head
+ \@ifnum{\pagegrid@cur=\@ne}{%
+% \end{macrocode}
+% We have the leftmost column of a verso page:
+% Insert the current top-level continued head.
+% \begin{macrocode}
}%
}%
}%
@@ -4552,7 +5196,8 @@ in your filesystem where they will be found by \LaTeX.
% documents that exhaust \LaTeX's pool of float registers!
%
% \begin{macro}{\check@deferlist@stuck}
-% \begin{macro}{\@outputpage}
+% \begin{macro}{\@outputpage@tail}
+% \changes{4.1b}{2008/08/04}{Procedure \cs{@outputpage@tail} tailpatches \cs{@outputpage}}%
% We detect the case where, at the start of a fresh page, there are deferred floats, but none are
% committed. We memorize the \cmd\@deferlist\ at \cmd\shipout\ time, then examine it at the point where
% our efforts to commit floats to the new page are complete.
@@ -4574,7 +5219,9 @@ in your filesystem where they will be found by \LaTeX.
\force@deferlist@stuck#1%
}%
}{%
- %Successfully committed float(s)
+% \end{macrocode}
+% We have successfully committed float(s)
+% \begin{macrocode}
}%
\global\let\@deferlist@postshipout\@empty
}%
@@ -4582,7 +5229,7 @@ in your filesystem where they will be found by \LaTeX.
\def\@fltstk{%
\@latex@warning{A float is stuck (cannot be placed without \string\clearpage)}%
}%
-\appdef\@outputpage{%
+\appdef\@outputpage@tail{%
\global\let\@deferlist@postshipout\@deferlist
}%
% \end{macrocode}
@@ -4644,20 +5291,28 @@ in your filesystem where they will be found by \LaTeX.
%
% \begin{macrocode}
\def\force@deferlist@stuck#1{%
- \force@deferlist@sw{%
+ \force@deferlist@sw{%
\@booleantrue\clearpage@sw
\@booleantrue\forcefloats@sw
#1%
- }{%
- }%
+ }{%
+ }%
}%
\def\force@deferlist@empty{%
\force@deferlist@sw{%
+% \end{macrocode}
+% \begin{verbatim}
% \ltxgrid@info{#1, attempting rectification}%
+% \end{verbatim}
+% \begin{macrocode}
\penalty-\pagebreak@pen
\protect@penalty\do@forcecolumn@pen
}{%
+% \end{macrocode}
+% \begin{verbatim}
% \ltxgrid@info{#1}%
+% \end{verbatim}
+% \begin{macrocode}
}%
}%
\@booleanfalse\force@deferlist@sw
@@ -4666,9 +5321,13 @@ in your filesystem where they will be found by \LaTeX.
\def\do@forcecolumn{%
\@booleantrue\clearpage@sw
\@booleantrue\forcefloats@sw
+% \end{macrocode}
+% \begin{verbatim}
%\unvbox\@cclv
%\vfil
%\penalty-\pagebreak@pen
+% \end{verbatim}
+% \begin{macrocode}
\do@startcolumn
}%
% \end{macrocode}
@@ -4695,8 +5354,7 @@ in your filesystem where they will be found by \LaTeX.
%
% We provide support for the \cmd\enlargethispage\ command.
%
-% Note: using a command of this sort is questionable.
-% Instead, people should enlarge the entire spread.
+% Note: using a command of this sort does not automatically enlarge both pages of a spread, which would be the convention in page composition.
%
% Timing Note: In a multicolumn page grid, the user should issue the \cmd\enlargethispage\ command
% while the first column of the page is being typeset.
@@ -4711,11 +5369,11 @@ in your filesystem where they will be found by \LaTeX.
% will revert to its standard value.
% \begin{macrocode}
\def\enlargethispage{%
- \@ifstar{%
- \@enlargethispage{}%
- }{%
- \@enlargethispage{}%
- }%
+ \@ifstar{%
+ \@enlargethispage{}%
+ }{%
+ \@enlargethispage{}%
+ }%
}%
\def\@enlargethispage#1#2{%
\begingroup
@@ -4732,14 +5390,23 @@ in your filesystem where they will be found by \LaTeX.
}{%
\def\@tempa{mlt}%
\@ifx{\thepagegrid\@tempa}{%
- \@ifnum{\pagegrid@cur=\@ne}{% OK to adjust this page
- \gdef\enlarge@colroom{#2}%
+ \@ifnum{\pagegrid@cur=\@ne}{%
+% \end{macrocode}
+% OK to adjust this page
+% \begin{macrocode}
+ \gdef\enlarge@colroom{#2}%
\true@sw
- }{% Can only adjust this column; give up
+ }{%
+% \end{macrocode}
+% Can only adjust this column; give up
+% \begin{macrocode}
\ltxgrid@warn{Too late to enlarge this page; move the command to the first column.}%
\false@sw
}%
- }{% Unknown page grid
+ }{%
+% \end{macrocode}
+% Unknown page grid
+% \begin{macrocode}
\ltxgrid@warn{Unable to enlarge a page of this kind.}%
\false@sw
}%
@@ -4749,7 +5416,9 @@ in your filesystem where they will be found by \LaTeX.
\global\advance\@colroom#2\relax
\set@vsize
}{%
- % Could not adjust this page
+% \end{macrocode}
+% Could not adjust this page
+% \begin{macrocode}
}%
}%
\let\enlarge@colroom\@empty
@@ -4762,15 +5431,12 @@ in your filesystem where they will be found by \LaTeX.
%
% \subsubsection{Building the page for shipout}
%
-% \begin{macro}{\@outputpage}
-% The procedures that build \cmd\@outputbox\ just before a page is shipped out by \cmd\@outputpage\ are:
-% \cmd\@makecol,
-% \cmd\@combinepage, and
-% \cmd\@combinedblfloats.
-% We headpatch \cmd\@outputpage\ to make the \cmd\@outputbox\ be of fixed height.
+% \begin{macro}{\@outputpage@head}
+% We set \cmd\@outputpage@head\ to make the \cmd\@outputbox\ be of fixed height.
+% \changes{4.1b}{2008/08/04}{Procedure \cs{@outputpage@head} headpatches \cs{@outputpage}}%
% \begin{macrocode}
\@booleantrue\textheight@sw
-\prepdef\@outputpage{%
+\prepdef\@outputpage@head{%
\textheight@sw{%
\count@\vbadness\vbadness\@M
\dimen@\vfuzz\vfuzz\maxdimen
@@ -4801,10 +5467,860 @@ in your filesystem where they will be found by \LaTeX.
% \end{macro}
% \end{macro}
%
+% \section{Line-wise processing}%
+% Sometimes we wish to process each line of type that will be placed into the galley,
+% for example, applying line numbering to a document.
+% To accomplish the task, we have to force a visit to the output routine after each such line, whereupon
+% we can process it accordingly (in the case of line numbering, we could do as \filename{lineno.sty} and
+% append an appropriately formed box to the MVL).
+%
+% In implementing such a scheme, we will have to instantiate interrupts for the following cases:
+% \begin{description}
+%
+% \item[\cmd\interlinepenalty\ and friends] These include \cmd\clubpenalty, \cmd\widowpenalty, \cmd\displaywidowpenalty, and \cmd\brokenpenalty.
+%
+%
+% \item[Display math penalties] Includes \cmd\predisplaypenalty, \cmd\postdisplaypenalty, and \cmd\interdisplaylinepenalty.
+%
+%
+% \item[\cs{par}] The penalty following the last line of the paragraph.
+%
+%
+% \item[\cmd\vadjust] A trap for any \cmd\vadjust\ command that falls in the paragraph.
+%
+% \end{description}
+%
+% \begin{macro}{\def@next@handler}
+% \begin{macro}{\def@line@handler}
+% Utility procedures \cmd\def@next@handler\ and \cmd\def@line@handler\ help in the creation of
+% interrupt handlers.
+%
+% \cmd\def@next@handler\ increments the scratch count register (argument 1),
+% using this value to \cmd\mathchardef\ its second argument
+% as the negative of the flag value to be used as a penalty for exciting the interrupt (argument 3).
+% As a byproduct, it leaves the given scratch counter incremented.
+% \begin{macrocode}
+\def\def@next@handler#1#2#3{%
+ \advance#1\@ne\mathchardef#2\the#1%
+ \expandafter\def\csname output@-\the#1\endcsname{#3}%
+% \end{macrocode}
+% The following line is for diagnostic purposes.
+% \begin{verbatim}
+% \typeout{\string#2(\expandafter\string\csname output@\the#1\endcsname:\expandafter\meaning\csname output@\the#1\endcsname)}%
+% \end{verbatim}
+% \begin{macrocode}
+}%
+% \end{macrocode}
+% \cmd\def@line@handler\ uses \cmd\int@parpenalty\ as a base.
+% The interrupt is the sum of that base with the first argument,
+% and the handler is the second argument.
+% \begin{macrocode}
+\def\def@line@handler#1#2{%
+ \begingroup
+ \@tempcnta\int@parpenalty
+ \advance\@tempcnta-#1%
+% \end{macrocode}
+% The following line is for diagnostic purposes.
+% \begin{verbatim}
+% \typeout{Defining: \expandafter\string\csname output@\the\linenopenalty\endcsname}%
+% \end{verbatim}
+% \begin{macrocode}
+ \aftergroup\def
+ \expandafter\aftergroup\csname output@-\the\@tempcnta\endcsname
+ \endgroup{#2}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\int@parpenalty}
+% \begin{macro}{\@handle@line@ltx}
+% \begin{macro}{\@@handle@line@ltx}
+% We first set \cmd\int@parpenalty\ to our chosen base value${}\le -11012$.
+% We then define all the handlers for lines within a paragraph, of which there are 12 different cases.
+% \begin{macrocode}
+\mathchardef\int@parpenalty11012
+\def@line@handler\z@{\@handle@line@ltx{}{}{}}%
+\def@line@handler\@ne{\@handle@line@ltx{}{}{\brokenpenalty@ltx}}%
+\def@line@handler\tw@{\@handle@line@ltx{}{\clubpenalty@ltx}{}}%
+\def@line@handler\thr@@{\@handle@line@ltx{\clubpenalty@ltx}{}{\brokenpenalty@ltx}}%
+\def@line@handler\f@ur{\@handle@line@ltx{\widowpenalty@ltx}{}{}}%
+\def@line@handler{5}{\@handle@line@ltx{\widowpenalty@ltx}{}{\brokenpenalty@ltx}}%
+\def@line@handler{6}{\@handle@line@ltx{\widowpenalty@ltx}{\clubpenalty@ltx}{}}%
+\def@line@handler{7}{\@handle@line@ltx{\widowpenalty@ltx}{\clubpenalty@ltx}{\brokenpenalty@ltx}}%
+\def@line@handler{8}{\@handle@line@ltx{\displaywidowpenalty@ltx}{}{}}%
+\def@line@handler{9}{\@handle@line@ltx{\displaywidowpenalty@ltx}{}{\brokenpenalty@ltx}}%
+\def@line@handler{10}{\@handle@line@ltx{\displaywidowpenalty@ltx}{\clubpenalty@ltx}{}}%
+\def@line@handler{11}{\@handle@line@ltx{\displaywidowpenalty@ltx}{\clubpenalty@ltx}{\brokenpenalty@ltx}}%
+% \end{macrocode}
+%
+% The default handler for lines within a paragraph simply
+% restores the value of the \cmd\penalty\ to the normal value.
+% If something more useful needs to be done, we can change the definition of \cmd\@@handle@line@ltx.
+% \begin{macrocode}
+\def\@handle@line@ltx#1#2#3{%
+ \@@handle@line@ltx
+ \@tempcnta\lastpenalty
+ \@tempcntb\interlinepenalty@ltx\relax
+ \@if@empty{#1}{}{\advance\@tempcntb#1\relax}%
+ \@if@empty{#2}{}{\advance\@tempcntb#2\relax}%
+ \@if@empty{#3}{}{\advance\@tempcntb#3\relax}%
+ \penalty\@ifnum{\@tempcnta<\@tempcntb}{\@tempcntb}{\@tempcnta}%
+}%
+\let\@@handle@line@ltx\@empty
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\int@postparpenalty}
+% \begin{macro}{\int@vadjustpenalty}
+% \begin{macro}{\int@whatsitpenalty}
+% \begin{macro}{\int@predisplaypenalty}
+% \begin{macro}{\int@interdisplaylinepenalty}
+% \begin{macro}{\int@postdisplaypenalty}
+% \begin{macro}{\@handle@display@ltx}
+% \begin{macro}{\@@handle@display@ltx}
+% \begin{macro}{\handle@par@ltx}
+% We herewith define all the handlers for cases relating to display math:
+% last line before a display math,
+% last line of a display math, and a line within a display math.
+% We also handle the last line of a paragraph, a whatsit node, and a \cmd\vadjust.
+% \begin{macrocode}
+\@tempcnta\int@parpenalty
+\def@next@handler\@tempcnta\int@postparpenalty{\reset@queues@ltx\handle@par@ltx}%
+\def@next@handler\@tempcnta\int@vadjustpenalty{\handle@vadjust@ltx}%
+\def@next@handler\@tempcnta\int@whatsitpenalty{\handle@whatsit@ltx}%
+\def@next@handler\@tempcnta\int@predisplaypenalty{\reset@queues@ltx\@handle@display@ltx{\predisplaypenalty@ltx}}%
+\def@next@handler\@tempcnta\int@interdisplaylinepenalty{\@handle@display@ltx{\interdisplaylinepenalty@ltx}}%
+\def@next@handler\@tempcnta\int@postdisplaypenalty{\@handle@display@ltx{\postdisplaypenalty@ltx}}%
+% \end{macrocode}
+% The default handler for display math lines simply
+% restores the value of the \cmd\penalty\ to the normal value.
+% If something more useful needs to be done, we can change the definition of \cmd\@@handle@display@ltx.
+% \begin{macrocode}
+\def\@handle@display@ltx#1{%
+ \@@handle@display@ltx
+ \@tempcnta\lastpenalty
+ \@tempcntb#1%
+ \penalty\@ifnum{\@tempcnta<\@tempcntb}{\@tempcntb}{\@tempcnta}%
+}%
+\let\@@handle@display@ltx\@empty
+% \end{macrocode}
+%
+% We provide stub definitions for the handlers for the last line of a paragraph, a \cmd\vadjust, and a whatsit node (e.g., \cmd\write, \cmd\special).
+% There is no canonical penalty for such cases.
+% \begin{macrocode}
+\def\handle@par@ltx{}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% Note that a whatsit needs to be handled differently from a \cmd\vadjust:
+% a whatsit node does not affect the (crucial) depth of \cmd\box\cmd\@cclv, while the more
+% general \cmd\vadjust\ may cause any kind of vertical mode material to be interposed just below the line
+% we are trying to trap, in particular \cmd\vskip s and \cmd\penalty s.
+%
+% \begin{macro}{\set@linepenalties}
+% \begin{macro}{\restore@linepenalties}
+% \begin{macro}{\set@displaypenalties}
+% Now we define utility procedures that set up for a paragraph to be broken into lines,
+% restoring the penalties afterwards.
+%
+% Utility procedure \cmd\set@linepenalties\ systematically sets the penalties of paragraph breaking
+% to flag values, meanwhile storing away the normal values for access by the output routine.
+% \begin{macrocode}
+\def\set@linepenalties{%
+ \expandafter\def\expandafter\interlinepenalty@ltx\expandafter{\the\interlinepenalty}%
+ \interlinepenalty-\int@parpenalty
+ \expandafter\def\expandafter\brokenpenalty@ltx\expandafter{\the\brokenpenalty}%
+ \brokenpenalty\@ne
+ \expandafter\def\expandafter\clubpenalty@ltx\expandafter{\the\clubpenalty}%
+ \clubpenalty\tw@
+ \expandafter\def\expandafter\widowpenalty@ltx\expandafter{\the\widowpenalty}%
+ \widowpenalty\f@ur
+ \expandafter\def\expandafter\displaywidowpenalty@ltx\expandafter{\the\displaywidowpenalty}%
+ \displaywidowpenalty8\relax
+}%
+% \end{macrocode}
+%
+% Utility procedure \cmd\restore@linepenalties\ restores the values of the penalty parameters that were
+% modified by \cmd\set@linepenalties.
+% \begin{macrocode}
+\def\restore@linepenalties{%
+ \interlinepenalty\interlinepenalty@ltx
+ \brokenpenalty\brokenpenalty@ltx
+ \clubpenalty\clubpenalty@ltx
+ \widowpenalty\widowpenalty@ltx
+ \displaywidowpenalty\displaywidowpenalty@ltx
+ \relax
+}%
+% \end{macrocode}
+%
+% In the following, the first argument should be a boolean (either \cmd\true@sw\ or \cmd\false@sw).
+% \begin{macrocode}
+\def\set@displaypenalties#1{%
+ \expandafter\def\expandafter\predisplaypenalty@ltx\expandafter{\the\predisplaypenalty}%
+ \expandafter\def\expandafter\interdisplaylinepenalty@ltx\expandafter{\the\interdisplaylinepenalty}%
+ \expandafter\def\expandafter\postdisplaypenalty@ltx\expandafter{\the\postdisplaypenalty}%
+ \@ifhmode{\predisplaypenalty-\int@predisplaypenalty\relax}{}%
+ #1{\interdisplaylinepenalty-\int@interdisplaylinepenalty\relax}{}%
+ #1{\postdisplaypenalty-\int@postdisplaypenalty\relax}{}%
+}%
+% \end{macrocode}
+% We provide no procedure to restore the respective penalties, because they are altered within a group:
+% \TeX 's context stack will automatically restore things.
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\enqueue@whatsit@ltx}%
+% \begin{macro}{\handle@whatsit@ltx}%
+% \begin{macro}{\do@whatsit}%
+% \begin{macro}{\@g@pop@ltx}%
+% Here is a facility for dealing with whatsit nodes while we are trapping paragraph lines.
+% We simply enqueue a macro that will create the desired whatsit node, dequeueing it in the output routine.
+% \begin{macrocode}
+\def\enqueue@whatsit@ltx#1{%
+ \gappdef\g@whatsit@queue{{#1}}%
+ \vadjust{\penalty-\int@whatsitpenalty}%
+}%
+\def\handle@whatsit@ltx{%
+ \unvbox\@cclv
+ \g@pop@ltx\g@whatsit@queue\@tempa
+ \expandafter\do@whatsit\expandafter{\@tempa}%
+}%
+\def\do@whatsit#1{}%
+\def\g@pop@ltx#1#2{%
+ \expandafter\@g@pop@ltx#1{}{}\@@#1#2%
+}%
+\def\@g@pop@ltx#1#2\@@#3#4{%
+ \gdef#3{#2}%
+ \def#4{#1}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\vspace}%
+% \begin{macro}{\pagebreak}%
+% \begin{macro}{\nopagebreak}%
+% \begin{macro}{\\}%
+% \begin{macro}{\@arrayparboxrestore}%
+% We wish to prevent \filename{lineno.sty} from patching \cmd\vspace\ and \cmd\pagebreak,
+% because that package does it through global assignments, which is prone to failure.
+%
+% We also wish to prevent that package from patching \cmd\@arrayparboxrestore, because
+% it prevents us from \cmd\unvbox ing vertical mode material into the MVL and numbering those
+% lines.
+%
+% We start by retaining the original definitions of these commands, so we can restore them
+% if \filename{lineno.sty} does get loaded.
+% \begin{macrocode}
+\let\vspace@ltx\vspace
+\let\pagebreak@ltx\pagebreak
+\let\nopagebreak@ltx\nopagebreak
+\let\endline@ltx\\
+\let\@arrayparboxrestore@ltx\@arrayparboxrestore
+% \end{macrocode}
+%
+% Next, we provide for line-wise processing by patching the procedures associated with these same three commands.
+%
+% There are exactly four core \LaTeX\ procedures that use \cmd\vadjust\ to insert vertical mode material
+% into the main vertical list: \cmd\vspace, \cmd\pagebreak, \cmd\nopagebreak, and \cmd\\.
+% Other commands may use \cmd\vadjust, but they are inserting an interrupt (via a penalty${}<10000$),
+% and such a thing does not mask the depth of \cmd\box\cmd\@cclv, hence is permissible.
+%
+% In each case, we replace the core \LaTeX\ procedure with one that itself replaces \cmd\vadjust\ with
+% \cmd\ex@vadjust@ltx. The meaning of this procedure can be left as \cmd\vadjust, or it can be changed to
+% one that accomplishes the equivalent without masking the depth of \cmd\box\cmd\@cclv.
+%
+% The first procedure is \cmd\@vspace, here shown in original form and in the patched alternative form.
+% This procedure and \cmd\@vspacer\ implement the \cmd\vspace\ command.
+% \begin{macrocode}
+\def\@vspace@org #1{%
+ \ifvmode
+ \vskip #1
+ \vskip\z@skip
+ \else
+ \@bsphack
+ \vadjust{\@restorepar
+ \vskip #1
+ \vskip\z@skip
+ }%
+ \@esphack
+ \fi
+}%
+\def\@vspace@ltx#1{%
+ \@ifvmode{%
+ \vskip#1\vskip\z@skip
+ }{%
+ \@bsphack
+ \ex@vadjust@ltx{%
+ \@restorepar
+ \nobreak
+ \vskip#1\vskip\z@skip
+ }%
+ \@esphack
+ }%
+}%
+% \end{macrocode}
+%
+% The second procedure is \cmd\@vspacer.
+% \begin{macrocode}
+\def\@vspacer@org#1{%
+ \ifvmode
+ \dimen@\prevdepth
+ \hrule \@height\z@
+ \nobreak
+ \vskip #1
+ \vskip\z@skip
+ \prevdepth\dimen@
+ \else
+ \@bsphack
+ \vadjust{\@restorepar
+ \hrule \@height\z@
+ \nobreak
+ \vskip #1
+ \vskip\z@skip}%
+ \@esphack
+\fi
+}%
+\def\@vspacer@ltx#1{%
+ \@ifvmode{%
+ \dimen@\prevdepth
+ \hrule\@height\z@
+ \nobreak
+ \vskip#1\vskip\z@skip
+ \prevdepth\dimen@
+ }{%
+ \@bsphack
+ \ex@vadjust@ltx{%
+ \@restorepar
+ \hrule\@height\z@
+ \nobreak
+ \vskip#1\vskip\z@skip
+ }%
+ \@esphack
+ }%
+}%
+% \end{macrocode}
+%
+% The procedure \cmd\@no@pgbk\ implements both \cmd\pagebreak\ and \cmd\nopagebreak.
+% \begin{macrocode}
+\def\@no@pgbk@org #1[#2]{%
+ \ifvmode
+ \penalty #1\@getpen{#2}%
+ \else
+ \@bsphack
+ \vadjust{\penalty #1\@getpen{#2}}%
+ \@esphack
+ \fi
+}%
+\def\@no@pgbk@ltx#1[#2]{%
+ \@ifvmode{%
+ \penalty#1\@getpen{#2}%
+ }{%
+ \@bsphack
+ \ex@vadjust@ltx{%
+ \penalty#1\@getpen{#2}%
+ }%
+ \@esphack
+ }%
+}%
+% \end{macrocode}
+%
+% The command to end a line of type, \cmd\\, is defined via \cmd\DeclareRobustCommand,
+% so we must proceed carefully:
+% A procedure is defined whose \cmd\long\cmd\csname\ is contructed via the incantation:
+% \cmd\csname\cmd\expandafter\cmd\@gobble\cmd\string\cmd\\ \cmd\endcsname.
+% Note the non-trivial space character after the \cmd\\: it is incorporated into
+% the \cmd\csname.
+%
+% Here is the original core \LaTeX\ definition for
+% the procedure involved, along with our revised version.
+% \begin{macrocode}
+\long\def\end@line@org{%
+ \let\reserved@e\relax
+ \let\reserved@f\relax
+ \@ifstar{%
+ \let\reserved@e\vadjust
+ \let\reserved@f\nobreak
+ \@xnewline
+ }%
+ \@xnewline
+}%
+\long\def\end@line@ltx{%
+ \let\reserved@e\relax
+ \let\reserved@f\relax
+ \@ifstar{%
+ \let\reserved@e\ex@vadjust@ltx
+ \let\reserved@f\nobreak
+ \@xnewline
+ }{%
+ \@xnewline
+ }%
+}%
+% \end{macrocode}
+% An additional procedure requiring patching has the following original core \LaTeX\
+% definition; we modify it correspondingly.
+% \begin{macrocode}
+\def\@newline@org[#1]{%
+ \let\reserved@e\vadjust
+ \@gnewline{\vskip#1}%
+}%
+\def\@newline@ltx[#1]{%
+ \let\reserved@e\ex@vadjust@ltx
+ \@gnewline{\vskip#1}%
+}%
+% \end{macrocode}
+% We now install our patches.
+% If some package overrides these macros, we will detect and complain.
+%
+% \begin{macrocode}
+ \@ifx{\@vspace\@vspace@org}{%
+ \@ifx{\@vspacer\@vspacer@org}{%
+ \@ifx{\@no@pgbk\@no@pgbk@org}{%
+ \@ifx{\@newline\@newline@org}{%
+ \expandafter\@ifx\expandafter{\csname\expandafter\@gobble\string\\ \endcsname\end@line@org}{%
+ \true@sw
+ }{\false@sw}%
+ }{\false@sw}%
+ }{\false@sw}%
+ }{\false@sw}%
+ }{\false@sw}%
+ {%
+ \class@info{Overriding \string\@vspace, \string\@vspacer, \string\@no@pgbk, \string\@newline, and \string\\ }%
+ \let\@normalcr\end@line@ltx
+ \expandafter\let\csname\expandafter\@gobble\string\\ \endcsname\@normalcr
+ \let\@newline\@newline@ltx
+ \let\@vspace\@vspace@ltx
+ \let\@vspacer\@vspacer@ltx
+ \let\@no@pgbk\@no@pgbk@ltx
+ }{%
+ \class@warn{%
+ Failed to recognize \string\@vspace, \string\@vspacer, \string\@no@pgbk, \string\@newline, and \string\\;
+ no patches applied. Please get a more up-to-date class,
+ }%
+ }%
+% \end{macrocode}
+% Note that we have assigned the same meaning to \cmd\@normalcr, which is necessary to \LaTeX.
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ex@vadjust@ltx}
+% \begin{macro}{\enqueue@vadjust@ltx}
+% \begin{macro}{\handle@vadjust@ltx}
+% \begin{macro}{\g@vadjust@line}
+% \begin{macro}{\reset@queues@ltx}
+% Here we give the default definition for \cmd\ex@vadjust@ltx\ along with
+% the definitions for the alternative version and its the associated handler.
+% \begin{macrocode}
+\let\ex@vadjust@ltx\vadjust
+\def\enqueue@vadjust@ltx#1{%
+ \gappdef\g@vadjust@queue{{#1}}%
+ \vadjust{\penalty-\int@vadjustpenalty}%
+}%
+\def\handle@vadjust@ltx{%
+ \unvbox\@cclv
+ \g@pop@ltx\g@vadjust@queue\@tempa
+ \expandafter\gappdef\expandafter\g@vadjust@line\expandafter{\@tempa}%
+}%
+\let\g@vadjust@line\@empty
+% \end{macrocode}
+% Procedure \cmd\reset@queues@ltx\ resets the whatsit queue and the \cmd\vadjust\ queues
+% to their empty state. This should be done whenever we leave horizontal mode and
+% complete the processing of these queues: upon executing, effectively, primitive \cmd\par\
+% or interrupting a paragraph with display math.
+% \begin{macrocode}
+\def\reset@queues@ltx{%
+ \global\let\g@whatsit@queue\@empty
+ \global\let\g@vadjust@queue\@empty
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \section{Patching the lineno.sty package}
+%
+% \filename{lineno.sty} is a \LaTeX\ package that applies line numbering to a document.
+% The basic method is to give \cmd\interlinepenalty\ and like penalties such a value as
+% to force a visit to the output routine, where the line of type is given its number.
+% In order to properly measure the depth of \cmd\box\cmd\@cclv, it defers \cmd\vadjust\
+% commands that may insert \cmd\vskip\ or \cmd\penalty\ nodes.
+%
+% The implementation of that package, however, manipulates \cmd\holdinginserts\ in a dangerous
+% way: outside the safety of the output routine. It also alters the meaning of \cmd\vadjust\
+% using global assignments. We patch its code to avoid these problems. The \filename{ltxgrid}
+% package already has the needed mechanisms in place to do these jobs correctly.
+%
+% The methods we use can accomodate any values of penalties like \cmd\clubpenalty, etc:
+% we do not make assumptions about the range of values these penalty parameters could take.
+%
+%
+% \begin{macro}{\linenomathWithnumbers}
+% \begin{macro}{\linenomathNonumbers}
+% \begin{macro}{\endlinenomath}
+% \begin{macro}{\linenumberpar}
+% Here are the definitions of procedures in \filename{lineno.sty}
+% that alter \cmd\holdinginserts. They are current as of version v4.41, 2005/11/02.
+% We patch them to avoid doing this: in ltxgrid-based classes like REVTeX, the output routine properly manages \cmd\holdinginserts, so packages should not attempt to do so.
+% Also, we will want \cmd\linenumberpar\ to set \cmd\interlinepenaly\ to dispatch to \cmd\MakeLineNo.
+%
+% \begin{macrocode}
+\newcommand\linenomathWithnumbers@LN{%
+ \ifLineNumbers
+ \ifnum\interlinepenalty>-\linenopenaltypar
+ \global\holdinginserts\thr@@
+ \advance\interlinepenalty \linenopenalty
+ \ifhmode
+ \advance\predisplaypenalty \linenopenalty
+ \fi
+ \advance\postdisplaypenalty \linenopenalty
+ \advance\interdisplaylinepenalty \linenopenalty
+ \fi
+ \fi
+ \ignorespaces
+}%
+\newcommand\linenomathNonumbers@LN{%
+ \ifLineNumbers
+ \ifnum\interlinepenalty>-\linenopenaltypar
+ \global\holdinginserts\thr@@
+ \advance\interlinepenalty \linenopenalty
+ \ifhmode
+ \advance\predisplaypenalty \linenopenalty
+ \fi
+ \fi
+ \fi
+ \ignorespaces
+}%
+\def\endlinenomath@LN{%
+ \ifLineNumbers
+ \global\holdinginserts\@LN@outer@holdins
+ \fi
+ \global\@ignoretrue
+}
+\def\linenumberpar@LN{%
+ \ifvmode \@@@par \else
+ \ifinner \@@@par \else
+ \xdef\@LN@outer@holdins{\the\holdinginserts}%
+ \advance \interlinepenalty \linenopenalty
+ \linenoprevgraf \prevgraf
+ \global \holdinginserts \thr@@
+ \@@@par
+ \ifnum\prevgraf>\linenoprevgraf
+ \penalty-\linenopenaltypar
+ \fi
+ \@LN@parpgbrk
+ \global\holdinginserts\@LN@outer@holdins
+ \advance\interlinepenalty -\linenopenalty
+ \fi
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\class@documenthook}
+% We patch only if we recognize the definitions of all the procedures we are to patch.
+% \begin{macrocode}
+\appdef\class@documenthook{%
+ \@ifpackageloaded{lineno}{%
+ \@ifx{\linenomathWithnumbers\linenomathWithnumbers@LN}{%
+ \@ifx{\linenomathNonumbers\linenomathNonumbers@LN}{%
+ \@ifx{\endlinenomath\endlinenomath@LN}{%
+ \@ifx{\linenumberpar\linenumberpar@LN}{%
+ \true@sw
+ }{\false@sw}%
+ }{\false@sw}%
+ }{\false@sw}%
+ }{\false@sw}%
+ {%
+ \class@info{Overriding lineo.sty, restoring output routine,}%
+% \end{macrocode}
+% We commence overriding the procedures of \filename{lineno.sty}.
+% \begin{macrocode}
+ \let\linenumberpar\linenumberpar@ltx
+ \let\endlinenomath\endlinenomath@ltx
+ \expandafter\let\csname endlinenomath*\endcsname\endlinenomath@ltx
+ \let\linenomathWithnumbers\linenomathWithnumbers@ltx
+ \let\linenomathNonumbers\linenomathNonumbers@ltx
+% \end{macrocode}
+% Override \filename{lineno.sty}'s equipment for \cmd\vadjust\ and \cmd\linelabel:
+% we have existing interrupts and handlers for these purposes.
+% \begin{macrocode}
+ \let\ex@vadjust@ltx\ex@vadjust@line
+ \let\@LN@postlabel\enqueue@whatsit@ltx
+ \let\do@whatsit\write@linelabel
+% \end{macrocode}
+% Redirect handlers to those provided by \filename{lineno.sty}, and
+% give an appropriate meaning to the respective headpatch within the handlers.
+% \begin{macrocode}
+ \let\handle@par@ltx\handle@par@LN
+ \let\@@handle@line@ltx\Make@LineNo@ltx
+ \let\@@handle@display@ltx\Make@LineNo@ltx
+% \end{macrocode}
+% Next, we undo the action taken by \filename{lineno.sty} wherein it
+% took over the output routine. Instead, we service \filename{lineno.sty}
+% existing equipment of \filename{ltxgrid}.
+% We also revert the core \LaTeX\ definitions of
+% \cmd\vspace, \cmd\pagebreak, \cmd\nopagebreak, and \cmd\\,
+% which that package takes over (we have our own ways of doing these things).
+% \begin{macrocode}
+ \output@latex{\natural@output}%
+ \let\vspace\vspace@ltx
+ \let\pagebreak\pagebreak@ltx
+ \let\nopagebreak\nopagebreak@ltx
+ \let\@arrayparboxrestore\@arrayparboxrestore@ltx
+ \let\\\endline@ltx
+% \end{macrocode}
+% \changes{4.1f}{2009/07/07}{(AO, 515) Prevent line numbering within a footnote}
+% When line numbering is in effect, we must avoid any attempt to number the lines of a footnote.
+% \begin{macrocode}
+ \appdef\set@footnotefont{%
+ \let\par\@@@par
+ \let\@@par\@@@par
+ }%
+% \end{macrocode}
+% At last, we detect if the \cmd\linenumbers\ command has already been given;
+% if so, we do its assignments again, because we have changed the meaning of \cmd\linenumberpar.
+% \begin{macrocode}
+ \@if@sw\ifLineNumbers\fi{%
+ \class@info{Reinvoke \string\linenumbers}%
+ \let\@@par\linenumberpar
+ \@ifx{\@par\linenumberpar@LN}{\let\@par\linenumberpar}{}%
+ \@ifx{\par\linenumberpar@LN}{\let\par\linenumberpar}{}%
+ }{%
+ \class@info{Line numbering not turned on yet}%
+ }%
+% \end{macrocode}
+% Here ends the ``true branch'' of the patch code.
+% \begin{macrocode}
+ }{%
+% \end{macrocode}
+% If the \filename{lineno.sty} package is loaded, but we fail to patch it, notify the user.
+% \begin{macrocode}
+ \class@warn{Failed to recognize lineno.sty procedures; no patches applied. Please get a more up-to-date class.}%
+ }%
+ }{%
+% \end{macrocode}
+% \filename{lineno.sty} is not loaded, so no patches are needed.
+% \begin{macrocode}
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\linenumberpar}
+% \begin{macro}{\@linenumberpar}
+% Procedure \cmd\linenumberpar\ takes the place of \cmd\par\ when line numbering is in effect;
+% It executes the \cmd\par\ primitive if we are in vertical mode.
+% Otherwise we are in horizontal mode in the MVL and wish to end the current paragraph,
+% or we have \cmd\unvbox ed material onto the MVL.
+%
+% \begin{macrocode}
+\def\linenumberpar@ltx{\@ifvmode{\@@@par}{\@linenumberpar}}%
+% \end{macrocode}
+%
+% Procedure \cmd\@linenumberpar
+% \begin{macrocode}
+\def\@linenumberpar{%
+% \end{macrocode}
+% Prepare for our trip into the output routine by
+% saving away the current value of \cmd\prevgraf.
+% \begin{macrocode}
+ \linenoprevgraf\prevgraf
+% \end{macrocode}
+% The following will be used in the output routine dispatcher
+% to sense that we came from here.
+% \begin{macrocode}
+ \set@linepenalties
+% \end{macrocode}
+% Finally, call primitive \cmd\par\ with the signal value of \cmd\interlinepenalty\ and friends.
+% \begin{macrocode}
+ \@@@par
+% \end{macrocode}
+% We are now in vertical mode.
+% If lines of type were contributed to the MVL (non-trivial paragraph),
+% we must force another trip into the output routine to apply
+% line numbering to the last line of the paragraph.
+% \begin{macrocode}
+ \@ifnum{\prevgraf>\linenoprevgraf}{
+ \penalty-\int@postparpenalty
+ }{}%
+% \end{macrocode}
+% Execute procedure \cmd\@LN@parpgbrk, which has been set up in the
+% output routine for us to invoke here.
+%
+% \begin{macrocode}
+ \@LN@parpgbrk
+% \end{macrocode}
+% To wrap things up, we restore the original value of \cmd\interlinepenalty\ and friends.
+%
+% Query: why not employ \TeX's context stack to do the restore?
+% Would there be something wrong with executing primitive \cmd\par\ within a group?
+% \begin{macrocode}
+ \restore@linepenalties
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\linenomathWithnumbers}
+% \begin{macro}{\linenomathNonumbers}
+% Here are the patched definitions for the commands enabling
+% line numbering in display math.
+% \begin{macrocode}
+\newcommand\linenomathWithnumbers@ltx{\@linenomathnumbers@ltx\true@sw}%
+\newcommand\linenomathNonumbers@ltx{\@linenomathnumbers@ltx\false@sw}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@linenomathnumbers}
+% \begin{macro}{\endlinenomath}
+% We have just begun a display math, and any paragraph we are setting will now end.
+% We set all relevant penalties to interrupt values; in the visit to the output routine,
+% we will replace the penalty with its normal value.
+% \begin{macrocode}
+\def\@linenomathnumbers@ltx#1{%
+ \@if@sw\ifLineNumbers\fi{%
+ \set@linepenalties
+ \set@displaypenalties#1%
+ }{}%
+ \ignorespaces
+}%
+\def\endlinenomath@ltx{%
+ \global\@ignoretrue
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% We provide a handler for the last line of a paragraph.
+% \begin{macrocode}
+\def\handle@par@LN{%
+ \Make@LineNo@ltx
+% \end{macrocode}
+% After setting the line number, we arrange for an appropriate penalty to
+% be laid down after this visit to the output routine ends.
+%
+% Query: why not contribute the penalty right here in the visit to the output routine?
+% \begin{macrocode}
+ \@tempcnta\lastpenalty
+ \@ifnum{\@tempcnta=\z@}{}{%
+ \expandafter\gdef
+ \expandafter\@LN@parpgbrk
+ \expandafter{%
+ \expandafter\penalty
+ \the\@tempcnta
+% \end{macrocode}
+% When \cmd\@LN@parpgbrk\ is executed, it resets itself to the default value,
+% \cmd\@LN@screenoff@pen.
+%
+% Query: \cmd\@LN@screenoff@pen\ appears to try to restore the depth of the last box:
+% why is this being done outside the safety of the output routine?
+% \begin{macrocode}
+ \global\let\@LN@parpgbrk\@LN@screenoff@pen
+ }%
+ }%
+}%
+% \end{macrocode}
+%
+% \begin{macro}{\Make@LineNo}
+% The procedure \cmd\Make@LineNo\ sets the box containing the line number itself.
+% \begin{macrocode}
+\def\Make@LineNo@ltx{%
+ \@LN@maybe@normalLineNumber
+% \end{macrocode}
+% We measure the depth of \cmd\box\cmd\@cclv\ and unbox it.
+% At this point, it is crucial that that box have the same depth as that of the last
+% box within it.
+%
+% In the simple case, \cmd\box\cmd\@cclv\ is
+% a \cmd\vbox\ containing as its last box the \cmd\hbox\ of the paragraph we are processing.
+%
+% Query: under what circumstances will this \emph{not} be the case?
+% \begin{macrocode}
+ \boxmaxdepth\maxdimen\setbox\z@\vbox{\unvbox\@cclv}%
+ \@tempdima\dp\z@
+ \unvbox\z@
+% \end{macrocode}
+% Then we create the box with the line number, setting its height to zero.
+% \begin{macrocode}
+ \sbox\@tempboxa{\hb@xt@\z@{\makeLineNumber}}%
+ \ht\@tempboxa\z@
+% \end{macrocode}
+% With these preparations, we invoke \cmd\@LN@depthbox, which
+% lays that box down (with its depth appropriately set):
+% this procedure depends on our having set \cmd\@tempdima\ and \cmd\@tempboxa
+% (kinda kludgy way of passing arguments, really).
+% \begin{macrocode}
+ \@LN@depthbox
+% \end{macrocode}
+% Now increment the line number. I have relocated this token past \cmd\@LN@depthbox:
+% this may induce a bug, but I am going to hereby force the issue:
+% why split up the procedure that lays down boxes with a procedure that sets a register value?
+% \begin{macrocode}
+ \stepLineNumber
+% \end{macrocode}
+% Finally, execute the \cmd\vadjust s that fell within the line that we just handled.
+%
+% Note that \cmd\enqueue@vadjust@ltx\ had queued up all the \cmd\vadjust\ commands for the paragraph
+% into \cmd\g@vadjust@queue, laying down an (\cmd\int@vadjustpenalty) interrupt in each ones' place.
+% The interrupts associated with this line of the paragraph have now moved the tokens to \cmd\g@vadjust@line,
+% which we now expand and execute.
+% \begin{macrocode}
+ \g@vadjust@line
+ \global\let\g@vadjust@line\@empty
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\write@linelabel#1{%
+ \protected@write\@auxout{}{%
+ \string\newlabel{#1}{{\theLineNumber}{\thepage}{}{}{}}%
+ }%
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\ex@vadjust@line{%
+ \@if@sw\ifLineNumbers\fi{\enqueue@vadjust@ltx}{\vadjust}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% Note that the \cmd\linelabel\ commands use a mechanism different from \cmd\vadjust,
+% embodied in the procedure \cmd\enqueue@vadjust@ltx, wherein the
+% \cmd\write\ primitives are enqueued while the paragraph is being processed, each replaced with
+% an interrupt, then dequeued and executed by the interrupt handler, leaving a \cmd\write\ node
+% in place of the interrupt (just where the \cmd\vadjust 's vertical mode material would had been)
+% just below the box containing the line of type. This \cmd\write, like all whatsits,
+% does not affect the depth of \cmd\box\cmd\@cclv, unlike the case of general vertical mode material,
+% which could have interfered.
+%
% \section{End of the \file{ltxgrid} {\sc docstrip} module}
% Here ends the module.
% \begin{macrocode}
-%</ltxgrid-krn>
+%</kernel>
% \end{macrocode}
%
% \Finale
diff --git a/Master/texmf-dist/source/latex/revtex/ltxutil.dtx b/Master/texmf-dist/source/latex/revtex/ltxutil.dtx
index 5553e3a863e..bf9000c82af 100644
--- a/Master/texmf-dist/source/latex/revtex/ltxutil.dtx
+++ b/Master/texmf-dist/source/latex/revtex/ltxutil.dtx
@@ -1,29 +1,125 @@
-% \iffalse ltxdoc klootch
-% ltxutil.dtx: package to add utilties to LaTeX
-% Copyright (c) 2000 Arthur Ogawa
+% \iffalse meta-comment balanced on line 107
+% ltxutil.dtx: utilities package
+% 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.3 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 ltxutil.dtx
+% and the derived files
+% ltxutil.sty, ltxutil.pdf
+% Distribution:
+% CTAN:macros/latex/contrib/revtex/
+%
+% Unpacking:
+% tex ltxutil.dtx
+%
+% Documentation:
+% latex ltxutil.dtx; ...
+%
+% Program calls to get the documentation (example):
+% pdflatex ltxutil.dtx
+% makeindex -s gind.ist ltxutil.idx
+% makeindex -s gglo.ist -o ltxutil.gls ltxutil.glo
+% pdflatex ltxutil.dtx
+% makeindex -s gind.ist ltxutil.idx
+% pdflatex ltxutil.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
+%</ignore>
+%<*install>
+\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 00readme.tex.
+
+License
+ You may distribute this file under the conditions of the
+ LaTeX Project Public License 1.3 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{ltxutil.sty}{%
+ \from{ltxutil.dtx}{package,kernel}%{ltxutil,ltxutil-krn}%
+ }%
+ }%
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation, please move}
+\Msg{* ltxutil.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 ltxutil.dtx through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+\endbatchfile
+%</install>
+%<*ignore>
+\fi
+%</ignore>
% \fi
-% \GetFileInfo{ltxutil.dtx}\CheckSum{3641}
+%
+% \GetFileInfo{ltxutil.dtx}\CheckSum{4094}
%
% \iffalse ltxdoc klootch
-%<*ltxutil>
+%<*package>
%%% @LaTeX-file{
%%% filename = "ltxutil.dtx",
-%%% version = "1.0rc5b",
-%%% date = "2001/07/31",
-%%% time = "12:23:00 GMT+8",
-%%% checksum = "3641",
-%%% author = "Arthur Ogawa (mailto:ogawa@teleport.com),
+%%% version = "4.1h",
+%%% date = "2009/10/09",
+%%% time = "11:23:00 GMT+8",
+%%% checksum = "4094",
+%%% author = "Arthur Ogawa (mailto:arthur_ogawa at sbcglobal.net),
%%% commissioned by the American Physical Society.
%%% ",
-%%% copyright = "Copyright (C) 1999 Arthur Ogawa,
+%%% copyright = "Copyright (C) 1999, 2009 Arthur Ogawa,
%%% distributed under the terms of the
%%% LaTeX Project Public License, see
%%% ftp://ctan.tug.org/macros/latex/base/lppl.txt
@@ -32,23 +128,23 @@
%%% USA",
%%% telephone = "",
%%% FAX = "",
-%%% email = "ogawa@teleport.com",
+%%% email = "mailto colon arthur_ogawa at sbcglobal.net",
%%% codetable = "ISO/ASCII",
-%%% keywords = "latex, utility, kernel",
+%%% keywords = "latex, page grid, main vertical list",
%%% supported = "yes",
-%%% abstract = "package to add utilties to LaTeX",
+%%% abstract = "utilities package",
%%% docstring = "The checksum field above generated by ltxdoc",
%%% }
-%</ltxutil>
+%</package>
% \fi
%
% \iffalse ltxdoc klootch
-% The following references the \file{00readme.txt} file,
+% The following references the \file{00readme} 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*}{00readme.txt}" to locate it.
-% \fi\input{00readme.txt}%
+% Search on "{filecontents*}{00readme}" to locate it.
+% \fi\input{00readme}%
%
% \subsection{Bill of Materials}
%
@@ -62,25 +158,19 @@
%\end{verbatim}
%
% \subsubsection{Generated by \texttt{latex ltxutil.dtx}}%
-% Typesetting the source file under \LaTeX\
-% generates the readme and the installer.
+% Typesetting the source file under pdflatex
+% generates the readme and the documentation.
%\begin{verbatim}
-%00readme.txt ltxutil.ins
+%00readme ltxutil.pdf
%\end{verbatim}
%
-% \subsubsection{Generated by \texttt{tex ltxutil.ins}}%
-% Typesetting the installer generates
-% the package files.
+% \subsubsection{Generated by \texttt{tex ltxutil.dtx}}%
+% Typesetting this file with \TeX\ generates
+% the package file.
%\begin{verbatim}
%ltxutil.sty
%\end{verbatim}
%
-% \subsubsection{Documentation}%
-% The following are the online documentation:
-% \begin{verbatim}
-%ltxutil.pdf
-% \end{verbatim}
-%
% \subsubsection{Auxiliary}%
% The following are auxiliary files generated
% in the course of running \LaTeX:
@@ -90,8 +180,7 @@
%
% \section{Code common to all modules}%
%
-% The following may look a bit klootchy, but we
-% want to require only one place in this file
+% 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.
@@ -101,14 +190,14 @@
% An appropriate message is displayed if
% a different \TeX{} format is used.
% \begin{macrocode}
-%<*doc|ltxutil>
+%<*doc|package>
\NeedsTeXFormat{LaTeX2e}[1995/12/01]%
-%</doc|ltxutil>
+%</doc|package>
% \end{macrocode}
% As desired, the following modules all
% take common version information:
% \begin{macrocode}
-%<ltxutil>\ProvidesFile{ltxutil.sty}%
+%<package>\ProvidesFile{ltxutil.sty}%
%<*doc>
\expandafter\ProvidesFile\expandafter{\jobname.dtx}%
%</doc>
@@ -120,9 +209,9 @@
% consistently in all generated files and in the
% typeset documentation.
% \begin{macrocode}
-%<*doc|ltxutil>
- [2001/07/31 1.0rc5b utilities package]% \fileversion
-%</doc|ltxutil>
+%<*doc|package>
+ [2009/10/09 4.1h utilities package]% \fileversion
+%</doc|package>
% \end{macrocode}
%
%
@@ -130,7 +219,7 @@
%
% This module, consisting of the present section,
% typesets the programmer's documentation,
-% generating the \file{.ins} installer and \file{00readme.txt} as required.
+% generating the \file{00readme} as required.
%
% Because the only uncommented-out lines of code at the beginning of
% this file constitute the \file{doc} module itself,
@@ -158,7 +247,8 @@
\expandafter\ifx\csname package@font\endcsname\@undefined\else
\expandafter\RequirePackage\expandafter{\csname package@font\endcsname}%
\fi
-\CodelineIndex\EnableCrossrefs
+\CodelineIndex\EnableCrossrefs % makeindex -s gind.ist ltxutil
+\RecordChanges % makeindex -s gglo.ist -o ltxutil.gls ltxutil.glo
% \end{macrocode}
%
% \subsubsection{Docstrip and info directives}
@@ -173,76 +263,6 @@
\expandafter\GetFileInfo\expandafter{\jobname.dtx}%
% \end{macrocode}
%
-%
-% \subsection{The installer file}
-%
-% The installer \file{ltxutil.ins} appears here.
-% If you have retrieved the standard distribution of this package,
-% the installer file is already on your filesystem.
-% If you are bootstrapping,
-% the first typesetting of the \file{.dtx} file
-% will cause the installer to be generated.
-%
-% The following modules are used to direct
-% {\sc docstrip} in generating the external files:
-% \begin{center}
-% \begin{tabular}{lll}
-% \textbf{Module}&\textbf{File}&\textbf{Description}\\
-% doc &\file{ltxutil.drv}&driver for programmer's documentation\\
-% ltxutil,ltxutil-krn &\file{ltxutil.sty}&this package\\
-% ltxutil-krn& &the portion of this package suitable for inclusion within another package
-% \end{tabular}
-% \end{center}
-%
-% \begin{macrocode}
-\begin{filecontents}{ltxutil.ins}
-%% This file will generate documentation and runtime files
-%% from ltxutil.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 00readme.txt.
-
-Copyright notice.
-
- These files are distributed
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-\endpreamble
-\keepsilent
- \generate{%
- \file{ltxutil.drv}{\from{ltxutil.dtx}{doc}}%
- \file{ltxutil.sty}{%
- \from{ltxutil.dtx}{ltxutil,ltxutil-krn}%
- }%
- }%
-\ifToplevel{
-\Msg{***********************************************************}
-\Msg{*}
-\Msg{* To finish the installation, please move}
-\Msg{* ltxutil.sty}
-\Msg{* into a directory searched by TeX.}
-\Msg{*}
-\Msg{* To produce the documentation,
- run ltxutil.dtx through LaTeX.}
-\Msg{*}
-\Msg{* Happy TeXing}
-\Msg{***********************************************************}
-}
-\endbatchfile
-\end{filecontents}
-% \end{macrocode}
-% Note that, because all of the files generated by the installer
-% are part of the standard distribution, it will
-% be necessary to run the installer only when bootstrapping
-% (or, of course, during development).
-% Note, too, that it is rare to generate the \file{doc}
-% module because it suffices to simply typeset the \file{.dtx} file itself.
-%
% \subsection{The ``Read Me'' File}
% As promised above, here is the contents of the
% ``Read Me'' file. That file serves a double purpose,
@@ -263,38 +283,43 @@ Copyright notice.
% The usual user will not be asked to
% do a full build, not to speak
% of the bootstrap.
-% Instructions for carrying these processes
+% Instructions for carrying out these procedures
% begin the programmer's manual.
%
% \begin{macrocode}
-\begin{filecontents*}{00readme.txt}
+\begin{filecontents*}{00readme}
\title{%
A \LaTeX\ Package of utility macros%
\thanks{%
This file has version number \fileversion,
last revised \filedate.%
- % For version number and date,
- % search on "\fileversion" in the .dtx file,
- % or see the end of the 00readme.txt file.
+ }%
+ \thanks{%
+ Version \fileversion\ \copyright\ 2009 The American Physical Society
}%
}%
-
\author{%
-Arthur Ogawa (\texttt{mailto:ogawa@teleport.com}),
-\fileversion\\Copyright (C) 1999 Arthur Ogawa
-}%
+ 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 00readme file.
+%\fi
\maketitle
This file embodies the \classname{ltxutil} package,
the implementation and its user documentation.
The distribution point for this work is
-\url{ftp://ftp.teleport.com/users/ogawa/macros/latex/contrib/supported/ltxutil...},
-which contains fully unpacked, prebuilt runtime files and documentation.
+\url{publish.aps.org/revtex},
+which contains prebuilt runtime files, documentation, and full source,
+ready to add to a TDS-compliant \TeX\ installation.
The \classname{ltxutil} package was commissioned by the American Physical Society
and is distributed under the terms of the \LaTeX\ Project Public License,
-the same license under which all the portions of \LaTeX\ itself is distributed.
+the same license under which all the portions of \LaTeX\ itself are 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
@@ -315,7 +340,7 @@ To use, read the user documentation \file{ltxutil.pdf}.
The package file \file{ltxutil.sty}
is generated from this file, \file{ltxutil.dtx},
using the {\sc docstrip} facility of \LaTeX
-via |tex ltxutil.ins|.
+via |tex ltxutil.dtx| (Note: do \emph{not} use \LaTeX\ for this task).
The typeset documentation that you are now reading is generated from
the same file by typesetting it with \LaTeX\ or pdftex
via |latex ltxutil.dtx| or |pdflatex ltxutil.dtx|.
@@ -330,20 +355,79 @@ then carry out the following steps:
Within an otherwise empty directory,
typeset \file{ltxutil.dtx} with \LaTeX\ or pdflatex;
you will obtain the typeset documentation you are now reading,
-along with
-the installer \file{ltxutil.ins},
-and the file \file{00readme.txt}.
+along with the file \file{00readme}.
-Note: you will have to run \LaTeX\ twice, then \file{makeindex}, then
+Note: you will have to run \LaTeX, then
+\file{makeindex} \texttt{-s gind.ist ltxutil.idx}, then
+\file{makeindex} \texttt{-s gglo.ist -o ltxutil.gls ltxutil.glo}, then
\LaTeX\ again in order to obtain a valid index and table of contents.
\item
-Now typeset \file{ltxutil.ins},
+Now typeset \file{ltxutil.dtx} with \TeX (not \LaTeX),
thereby generating the package file \file{ltxutil.sty}.
\item
-Install \classname{ltxutil.sty}
-by moving it to a location
-in your filesystem where they will be found by \LaTeX.
+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{ltxutil.sty}
+\item
+\file{$TEXMF/}\file{source/}\file{latex/}\file{revtex/}\classname{ltxutil.dtx}
+\item
+\file{$TEXMF/}\file{doc/}\file{latex/}\file{revtex/}\classname{ltxutil.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{\{ltxutil\}} in your document preamble!
\end{enumerate}
+
+\subsection{Change Log}
+\changes{4.0b}{1999/06/20}{AO: Fixed spurious \texttt{CR} and (return) characters in output file. Also, if the document did not have the \cs{end}\texttt{figure} on a line of its own, the macro wouldn't work. Fixed.}
+\changes{4.0b}{1999/06/20}{AO: Removed superfluous \cs{def}s, changed to using \cs{floats@sw} as the flag. Also stopped using DPC's \cs{if@twocolumn} flag: using \cs{floats@sw} instead. Also added \cs{par}\cs{vskip}\cs{z@skip} after the \cs{minipagefootnotes} so that the float box would have zero depth like the kernel one. }
+\changes{4.0b}{1999/06/20}{only execute if there really were floats of the given type}
+\changes{4.0b}{1999/06/20}{Support the hack with \cs{prepdef}, and delay until \cs{AtBeginDocument} time, since \classname{hyperref} clobbers \cs{caption}.}
+\changes{4.0c}{1999/11/13}{(AO, 110) Install hooks for endfloats processing}
+\changes{4.0c}{1999/11/13}{(AO, 116) Hyperref compatibility}
+\changes{4.0c}{1999/11/13}{(AO, 130) Interference from array package}
+\changes{4.0c}{1999/11/13}{*-form mandates pagebreak at each float; only print section head if there is something there.}
+\changes{4.0d}{2000/04/10}{(AO, 127) Floats placed [h] to allow page breaks}
+\changes{4.0d}{2000/04/10}{(AO, 174) kernel fix}
+\changes{4.0d}{2000/05/19}{(AO, 224) Hyperref compatibility.}
+\changes{4.0d}{2000/05/23}{Allow things to break over pages by setting array@default.}
+\changes{4.0e}{2000/11/16}{(AO, 221) Remove samepage command from @xfloat@prep: If the float can break over pages, we want better control.}
+\changes{4.0f}{2001/07/13}{(AO, 404) Hyperref compatibility}
+\changes{4.1a}{2008/01/19}{(AO, 459) do not assume \cs{class@name} is defined}%
+\changes{4.1a}{2008/01/19}{(AO, 461) Change the csname from \cs{@dotsep} to \cs{ltxu@dotsep}. The former is understood in mu. (What we wanted was a dimension.)}%
+\changes{4.1a}{2008/01/19}{(AO, 475) I had not properly reproduced the LaTeX macro \cs{eqnarray}.}%
+\changes{4.1a}{2008/01/19}{(AO, 479) Per: Dylan Thurston<dpt at math.harvard.edu>}%
+\changes{4.1a}{2008/06/30}{(AO) Make \cs{addtocontents} a \cs{long} \cs{def}; gobble up \cs{footnote}}%
+\changes{4.1a}{2008/06/30}{(AO) Remove code that avoided changes to \cs{@xfootnotemark}}%
+\changes{4.1a}{2008/06/30}{(AO, 438) Complete rewrite of footnote macros.}
+\changes{4.1a}{2008/07/07}{\cs{@xfloat@prep} calls \cs{ltx@footnote@pop} to restore the original \cs{ltx@footmark} and \cs{ltx@foottext} procedures, in case footnote processing has switched.}
+\changes{4.1a}{2008/08/12}{\cs{class@documenthook} is the last \cs{AtBeginDocument} token now}
+\changes{4.1a}{2008/08/12}{Class extension mechanism \cs{@pushfilename@ltx} and \cs{@p@pfilename@ltx}.}
+\changes{4.1a}{2008/08/12}{Class extension mechanism \cs{class@extension}, \cs{class@extensionfile}, and \cs{class@ext@hook}.}
+\changes{4.1a}{2008/08/12}{Get rid of \cs{set@typesize@hook} \cs{set@pica@hook} and the \cs{normalsize} directive}%
+\changes{4.1b}{2008/08/12}{(AO, 487) Support for video figures and the \cs{setfloatlink} command}%
+\changes{4.1b}{2008/08/12}{(AO, 505) try to accommodate \classname{colortbl}.}
+\changes{4.1b}{2008/08/12}{Acquire \classname{hyperref} savoire}
+\changes{4.1b}{2008/08/12}{Default assignment of \cs{float@sw} now, not at \cs{AtBeginDocument} time.}%
+\changes{4.1b}{2008/08/12}{If class option \classoption{lengthcheck} is in effect, log the height of this float class.}
+\changes{4.1b}{2008/08/12}{No need to protect against undefined \cs{float@sw}}
+\changes{4.1b}{2008/08/12}{Patch the array package even later: after all package patches go in.}
+\changes{4.1b}{2008/08/12}{Refine toc processing: provide default.}%
+\changes{4.1b}{2008/08/12}{Tally and log the height of a float class}
+\changes{4.1d}{2009/03/27}{(AO, 511) Compatability with lineno.sty's erroneous way of detecting fleqn.clo}%
+\changes{4.1f}{2009/07/07}{(AO, 515) Hook for setting the font of a footnote}
+\changes{4.1f}{2009/07/10}{(AO, 518) Tally register overflow when locument is long}
+\changes{4.1g}{2009/10/06}{(AO, 532) Both arguments of \cs{href} get sanitized}%
+\changes{4.1g}{2009/10/07}{(AO, 525) Remove phantom paragraph above display math that is given in vertical mode}%
+\changes{4.1g}{2009/10/07}{(AO, 539) Use of double-backslash in argument of \cs{section} gives error. The \classname{textcase} package is involved.}%
+
+
\end{filecontents*}
% \end{macrocode}
%
@@ -355,7 +439,6 @@ in your filesystem where they will be found by \LaTeX.
% \begin{macrocode}
\begin{document}%
\expandafter\DocInput\expandafter{\jobname.dtx}%
-% ^^A\PrintChanges
\end{document}
% \end{macrocode}
%
@@ -374,8 +457,7 @@ in your filesystem where they will be found by \LaTeX.
%\usepackage{ltxutil}%
%\begin{document}
%<your document here>
-%\end{document}
-% \end{verbatim}
+%\end{document}\end{verbatim}
% However, the preferred way is to invoke this package from within your
% customized document class:
% \begin{verbatim}
@@ -384,14 +466,13 @@ in your filesystem where they will be found by \LaTeX.
%\RequirePackage{ltxutil}%
%\LoadClass{book}%
%<class customization commands>
-%\endinput
-% \end{verbatim}
+%\endinput\end{verbatim}
%
% Once loaded, the package gives you acccess to certain procedures,
% usually to be invoked by a \LaTeX\ command or environment, but not at the document level.
%
%
-% \section{Compatability with \LaTeX's Required Packages}
+% \section{Compatibility 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.
@@ -401,7 +482,7 @@ in your filesystem where they will be found by \LaTeX.
% The \classname{ltxutil} package will be incompatible with any package that
% redefines any of the kernel macros that \classname{ltxutil} patches---if that
% package is loaded \emph{after} \classname{ltxutil}. This means that for
-% greatest compatability, \classname{ltxutil} should be loaded \emph{after},
+% greatest compatibility, \classname{ltxutil} should be loaded \emph{after},
% say, \classname{ftnright}, which overwrites \LaTeX's kernel
% procedures \cmd\@outputdblcol, \cmd\@startcolumn, and \cmd\@makecol.
%
@@ -426,27 +507,27 @@ in your filesystem where they will be found by \LaTeX.
% \section{Implementation of package}
%
% Special acknowledgment: this package uses concepts pioneered
-% and first realized by William Baxter (mailto:web@superscript.com)
+% 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.
%
-% \subsection{Beginning of the \file{ltxutil} {\sc docstrip} module}
+% \subsection{Beginning of the \file{package} {\sc docstrip} module}
% \begin{macrocode}
-%<*ltxutil>
+%<*package>
\def\package@name{ltxutil}%
\expandafter\PackageInfo\expandafter{\package@name}{%
Utility macros for \protect\LaTeXe,
- by A. Ogawa (ogawa@teleport.com)%
+ by A. Ogawa (arthur_ogawa at sbcglobal.net)%
}%
-%</ltxutil>
+%</package>
% \end{macrocode}
%
-% \subsection{Banner}%
+% \subsection{Banner and beginning of the \file{kernel} {\sc docstrip} module}%
% Credit where due.
% \begin{macrocode}
-%<*ltxutil-krn>
+%<*kernel>
\typeout{%
- ltxutil: portions licensed from W. E. Baxter (web@superscript.com)%
+ ltxutil [2009/07/07 4.1f]: portions licensed from W. E. Baxter (web at superscript.com)%
}%
% \end{macrocode}
%
@@ -488,14 +569,20 @@ in your filesystem where they will be found by \LaTeX.
\def\class@warn@end#1{%
\gappdef\class@enddocumenthook{\class@warn{#1}}%
}%
-\AtEndOfClass{%
- \@ifxundefined\class@name{\def\class@name{Generic Class}}{}%
-}%
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
+% \changes{4.1a}{2008/01/19}{(AO, 459) do not assume \cs{class@name} is defined}%
+% Give \cmd\class@name\ a meaning if it does not already have one.
+% \begin{macrocode}
+\ifx\undefined\class@name
+ \def\class@name{ltxutil}%
+ \class@warn{You should define the class name before reading in this package. Using default}%
+\fi
+% \end{macrocode}
+%
% \subsection{New Tools}%
%
% \begin{macro}{\t@}
@@ -603,7 +690,7 @@ in your filesystem where they will be found by \LaTeX.
% Alan Jeffrey was the pioneer here, with an article in TUGboat
% (Vol. 11, No. 2, page 237).
% This implementation owes a debt to
-% William Baxter (web@superscript.com).
+% William Baxter (web at superscript.com).
% See articles by Baxter and Ogawa in the proceedings of the
% 1994 TUG meeting, TUGboat Vol.~15, No.~3.
%
@@ -729,8 +816,8 @@ in your filesystem where they will be found by \LaTeX.
% We can now invoke the defining word to create
% the procedures \cmd\@ifx\ and friends.
%
-% Compatability Note: earlier versions of this package
-% defined a procedure \cmd\@ifempty. However, for compatability with AMS\LaTeX,
+% Compatibility Note: earlier versions of this package
+% defined a procedure \cmd\@ifempty. However, for compatibility with AMS\LaTeX,
% we must avoid the following three names:
% \cmd\@ifempty, \cmd\@xifempty, and \cmd\@ifnotempty.
%
@@ -820,7 +907,11 @@ in your filesystem where they will be found by \LaTeX.
% for deferring the decision about the page grid until \cmd\AtBeginDocument\ time.
% We fix things by prepending a hook at the very beginning of \cmd\document.
%
-% The price we pay for this facility is to depend on the stability of this part
+% As it turns out, though, it appears feasible to simply invoke the desired
+% column grid command at \cmd\AtBeginDocument\ time, since the MVL has nothing in it
+% at that time that would be problematical.
+%
+% The facility depends on the stability of this part
% of \LaTeX's kernel code (the first token of \cmd\document),
% which could change, you see. But considering that \LaTeX\ is
% at this point essentially stagnant once more, we risk it.
@@ -832,49 +923,43 @@ in your filesystem where they will be found by \LaTeX.
% begun by \cmd\begin. Last, we conclude our shenanigans by absorbing
% the first token of the expansion of \cmd\document, which
% we assume to be \cmd\endgroup.
+% \changes{4.1a}{2008/08/12}{Get rid of \cs{set@typesize@hook} \cs{set@pica@hook} and the \cs{normalsize} directive}%
% \begin{macrocode}
\prepdef\document{%
\endgroup
- \init@documenthook
- \set@typesize@hook
- \normalsize
- \set@pica@hook
+ \document@inithook
\true@sw{}%
}%
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\document@inithook}
+% To use, simply \cmd\appdef\cmd\document@inithook\arg{your tokens here}.
+% \begin{macrocode}
+\let\document@inithook\@empty
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\class@documenthook}
% \begin{macro}{\class@enddocumenthook}
-% We install the first \cmd\AtBeginDocument\ hook, namely the
+% \changes{4.1a}{2008/08/12}{\cs{class@documenthook} is the last \cs{AtBeginDocument} token now}
+% We install the last \cmd\AtBeginDocument\ hook, namely the
% procedure \cmd\class@documenthook. Within the document class,
% we will use this hook exclusively, so as to avoid interference from other packages.
% Similarly with \cmd\class@enddocumenthook, installed via \cmd\AtEndDocument.
%
-% A document class using this package should do as this package does and
-% just say, \cmd\appdef\cmd\class@documenthook\ and \cmd\appdef\cmd\class@enddocumenthook\
-% instead of \cmd\AtBeginDocument\ and \cmd\AtEndDocument.
+% A document class using this package should do as this package does and just say,
+% \cmd\appdef\ \cmd\class@documenthook\ instead of \cmd\AtBeginDocument,
+% and \cmd\appdef\ \cmd\class@enddocumenthook\ instead of \cmd\AtEndDocument.
% \begin{macrocode}
-\def\init@documenthook{}%
-\AtBeginDocument{%
- \class@documenthook
+\appdef\document@inithook{%
+ \AtBeginDocument{\class@documenthook}%
}%
\AtEndDocument{%
\class@enddocumenthook
}%
-\def\class@documenthook{}%
-\def\class@enddocumenthook{}%
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\set@typesize@hook}
-% \begin{macro}{\set@pica@hook}
-% The macros \cmd\set@typesize@hook\ and \cmd\set@pica@hook\ provide everything we need.
-% To use, simply \cmd\appdef\ your tokens to the appropriate hook.
-% \begin{macrocode}
-\def\set@typesize@hook{}%
-\def\set@pica@hook{}%
+\let\class@documenthook\@empty
+\let\class@enddocumenthook\@empty
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -938,6 +1023,108 @@ in your filesystem where they will be found by \LaTeX.
% \end{macro}
%
%
+% \subsection{Class Extensions}%
+% \changes{4.1a}{2008/08/12}{Class extension mechanism \cs{class@extension}, \cs{class@extensionfile}, and \cs{class@ext@hook}.}
+% The \LaTeX\ procedure \cmd\@onefilewithoptions\ is the vehicle for reading in
+% a \LaTeX\ class or package.
+% The APS RevTeX class implements the use of what are called ``substyles'',
+% actually extensions to the class itself.
+% Any document class can do likewise.
+%
+% \begin{macro}{\class@extension}
+% \begin{macro}{\class@extensionfile}
+% \begin{macro}{\class@ext@hook}
+% A procedure similar to \LaTeX's \cmd\@onefilewithoptions, but as an extension to the
+% current document class.
+%
+% Read in the given file as if it were a document class file.
+% Usage: \cmd\class@extensionfile\ \arg{class} \cmd\@extension,
+% where \marg{class} is a file (similar to \file{aps.rtx}) and where \cmd\@extension\ is
+% the file extension for \marg{class}.
+% For instance, to read in the file \file{aps.rtx},
+% do \cmd\class@extensionfile\ \texttt{\{aps\}} \cmd\substyle@ext,
+% where the latter has been define to expand to \file{.rtx}.
+%
+% Features supported include
+% passing existing class options on to the class extension,
+% \cmd\AtEndOfClass\ processing,
+% a stack that restores \cmd\@currname, \cmd\@currext, \cmd\@clsextension, and the \cmd\catcode\ of `@',
+% fall-back to a control sequence name (with leading `rtx@') if no file exists.
+%
+% Note that \cmd\LoadClass\ gives one the ability to write a class that calls in
+% another class as a (sort of) module: this scheme is like \cmd\LoadClass, but
+% turned inside out.
+% \begin{macrocode}
+\def\class@extension#1#2{%
+ \IfFileExists{#1.#2}{%
+ \expandafter\class@extensionfile\csname ver@\@currname.\@currext\endcsname{#1}#2%
+ }{%
+ \csname rtx@#1\endcsname
+ }%
+}%
+\def\class@extensionfile#1#2#3{%
+ \@pass@ptions#3\@unusedoptionlist{#2}%
+ \global\let\@unusedoptionlist\@empty
+ \expandafter\class@ext@hook\csname#2.#3-h@@k\endcsname#1{#2}#3%
+}%
+\def\class@ext@hook#1#2#3#4{%
+ \@pushfilename@ltx
+ \makeatletter
+ \let\CurrentOption\@empty
+ \@reset@ptions
+ \let#1\@empty
+ \xdef\@currname{#3}%
+ \global\let\@currext#4%
+ \global\let\@clsextension\@currext
+ \input{#3.#4}%
+ \@ifl@ter#4{#3}#2{%
+ \class@info{Class extension later than: #2}%
+ }{%
+ \class@info{Class extension earlier: #2}%
+ \@@end
+ }%
+ #1%
+ \let#1\@undefined
+ \expandafter\@p@pfilename@ltx\@currnamestack@ltx\@nil
+ \@reset@ptions
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@pushfilename}
+% \begin{macro}{\@p@pfilename}
+% \changes{4.1a}{2008/08/12}{Class extension mechanism \cs{@pushfilename@ltx} and \cs{@p@pfilename@ltx}.}
+% But! \LaTeX\ does not provide for a class extension other than \file{.cls}, therefore we
+% must extend \LaTeX's file name stack with the file extension of a class extension.
+% This way, procedures like
+% \cmd\ProvidesPackage, \cmd\OptionNotUsed, \cmd\ProcessOptions, \cmd\@reset@ptions\
+% will still work properly.
+% \begin{macrocode}
+\def\@pushfilename@ltx{%
+ \xdef\@currnamestack@ltx{%
+ {\@currname}%
+ {\@currext}%
+ {\@clsextension}%
+ {\the\catcode`\@}%
+ \@currnamestack@ltx
+ }%
+}%
+\def\@p@pfilename@ltx#1#2#3#4#5\@nil{%
+ \gdef\@currname{#1}%
+ \gdef\@currext{#2}%
+ \gdef\@clsextension{#3}%
+ \catcode`\@#4\relax
+ \gdef\@currnamestack@ltx{#5}%
+}%
+\global\let\@currnamestack@ltx\@empty
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% We carefully patch \LaTeX\ so that the current value of \cmd\@clsextension\ can be
+% restored after reading in a class file.
+%
% \subsection{Type Tools}%
%
% \begin{macro}{\flushing}
@@ -953,6 +1140,31 @@ in your filesystem where they will be found by \LaTeX.
% \end{macrocode}
% \end{macro}
%
+% \changes{4.1g}{2009/10/07}{(AO, 539) Use of double-backslash in argument of \cs{section} gives error. The \classname{textcase} package is involved.}%
+% \begin{macro}{\@centercr}
+% The \cmd\@centercr\ command is the replacement for \cmd\@normalcr\ when setting type centered or ragged.
+% Normally, the meaning of \cmd\\ is \cmd\@normalcr, which \LaTeX\ defines via \cmd\DeclareRobustCommand.
+% In centered or ragged typesetting, the meaning of \cmd\\ is \cmd\@centercr,
+% therefore it ought to to be defined via \cmd\DeclareRobustCommand\ (but unfortunately is not).
+% The fact that it is not is yet another of \LaTeX's early failures that will never get fixed.
+%
+% The following exemplar fails under \LaTeX\ version 2005/12/01, package \classname{textcase} 2004/10/07 v0.07:
+% \begin{verbatim}
+%\documentclass{article}%
+%\usepackage[overload]{textcase}
+%\begin{document}
+%\centering
+%\section{\MakeTextUppercase{Section\\title}}
+%Text
+%\end{document}
+% \end{verbatim}
+% The solution is to promote \cmd\@centercr\ to a robust command, just the same as \cmd\\.
+% We do that here without needing to know the meaning of the command.
+% \begin{macrocode}
+\expandafter\DeclareRobustCommand\expandafter\@centercr\expandafter{\@centercr}%
+% \end{macrocode}
+% \end{macro}
+%
%
% \subsection{Display Math}%
%
@@ -961,10 +1173,11 @@ in your filesystem where they will be found by \LaTeX.
% Team \LaTeX\ has stated they will never repair Leslie's broken definition of \env{eqnarray}.
% Let us be bold\dots.
%
-% Note on \classname{hyperref} package compatability: that package overrides
+% Note on \classname{hyperref} package compatibility: that package overrides
% \cmd\eqnarray\ by wrapping it up in a larger procedure, so its changes
% are compatible with this package's changes.
%
+% \changes{4.1a}{2008/01/19}{(AO, 475) I had not properly reproduced the LaTeX macro \cs{eqnarray}.}%
% \begin{macrocode}
\def\eqnarray@LaTeX{%
\stepcounter{equation}%
@@ -974,7 +1187,7 @@ in your filesystem where they will be found by \LaTeX.
\global\@eqcnt\z@
\tabskip\@centering
\let\\\@eqncr
- $$\everycr{}\halign\t@\displaywidth\bgroup
+ $$\everycr{}\halign to\displaywidth\bgroup
\hskip\@centering$\displaystyle\tabskip\z@skip{##}$\@eqnsel
&\global\@eqcnt\@ne\hskip \tw@\arraycolsep \hfil${##}$\hfil
&\global\@eqcnt\tw@ \hskip \tw@\arraycolsep
@@ -986,7 +1199,7 @@ in your filesystem where they will be found by \LaTeX.
\long\def\eqnarray@fleqn@fixed{%
\stepcounter{equation}\def\@currentlabel{\p@equation\theequation}%
\global\@eqnswtrue\m@th\global\@eqcnt\z@
- \tabskip\mathindent
+ \tabskip\ltx@mathindent
\let\\=\@eqncr
\setlength\abovedisplayskip{\topsep}%
\ifvmode\addtolength\abovedisplayskip{\partopsep}\fi
@@ -1016,114 +1229,254 @@ in your filesystem where they will be found by \LaTeX.
\let\eqnarray@LaTeX\relax
\let\eqnarray@fleqn@fixed\relax
}{}%
-\def\mathindent{\@centering}%
+% \end{macrocode}
+% The macro \cmd\ltx@mathindent\ is assigned to the \cmd\tabskip\ glue just
+% before the alignment preamble is expanded, the value therefore applying at the
+% left of the first column.
+%
+% The below value specifies the display math to be set centered, as is common practice.
+% Alternatively, \cmd\tabskip\ can be set to a different glue value, accomplishing
+% flush-left display math.
+%
+% Note that the \filename{fleqn.clo} package provides its own meaning for
+% the eqnarray environment, which is also broken. We do not patch that package, however.
+%
+% \changes{4.1d}{2009/03/27}{(AO, 511) Compatability with lineno.sty's erroneous way of detecting fleqn.clo}%
+% Bug note: The \filename{lineno.sty} package detects \filename{fleqn.clo}
+% by testing whether \cmd\mathindent\ is defined, instead of using correct \LaTeXe\ means.
+% Even though our eqnarray environment is modelled after \filename{fleqn.clo},
+% we must program defensively here.
+% \begin{macrocode}
+\def\ltx@mathindent{\@centering}%
\def\set@eqnarray@skips{}%
% \end{macrocode}
% \end{macro}
% \end{macro}
+%
+% \changes{4.1g}{2009/10/07}{(AO, 525) Remove phantom paragraph above display math that is given in vertical mode}%
+%\begin{macro}{\prep@math}
+%\begin{macro}{\prep@math@patch}
+% If we are in vertical mode when display math mode is entered (via \verb+$$+),
+% \TeX\ will first enter horizontal mode, then display math mode; this results in a phantom paragraph
+% containing a single \cmd\hbox\ consisting of the \cmd\parindent\ box followed by the \cmd\parskipfillskip\ glue.
+% Of course, that \cmd\hbox\ is accompanied by \cmd\parskip\ glue and \cmd\baselineskip\ glue.
+%
+% The \cmd\prep@math\ procedure removes the \cmd\parindent\ box, thereby (magically) eliminating the phantom paragraph.
+% The \cmd\prep@math@patch\ procedure headpatches the \env{equation} and \env{eqnarray} environments
+% to accomplish this removal of the phantom paragraph.
+%
+% Note that there are three remaining ways to enter display math mode that we do not treat:
+% the \env{displaymath} environment (equivalent to \cmd\[/\cmd\]), and the primitive the \verb+$$+ markup.
+% I refrain from treating the first case because \env{displaymath} already detects the case
+% where it is entered from vertical mode: I do not wish to engage in the dubious enterprise of attempting to correct a procedure that is ill conceived from the outset.
+% As to the primitive \verb+$$+, there is no help for users who insist upon employing procedural markup in their documents.
+% in their documents.
+% \begin{macrocode}
+\def\prep@math{%
+ \@ifvmode{\everypar{{\setbox\z@\lastbox}}}{}%
+}%
+\def\prep@math@patch{%
+ \prepdef\equation{\prep@math}%
+ \prepdef\eqnarray{\prep@math}%
+}%
+% \end{macrocode}
+% A document class may invoke \cmd\prep@math@patch\ at any point it wishes to prevent the appearance
+% of the phantom paragraph: it may be a global declaration or a local one.
+% \end{macro}
+% \end{macro}
%
+% We fail to patch \cmd\[, \cmd\equation, however.
%
% \subsection{Footnotes}
%
-% \changes{v4.0beta 4}{2000/04/10}
-% {New kernel fix. For bug 174}
+% \changes{4.0d}{2000/04/10}{(AO, 174) kernel fix}
%
-% \begin{macro}{\footnote}
% \begin{macro}{\footnotemark}
-% \begin{macro}{\@xfootnote}
-% \begin{macro}{\@xfootnotemark}
-% \begin{macro}{\@yfootnote}
+% \begin{macro}{\footnotetest}
+% \begin{macro}{\ltx@xfootnote}
+% \begin{macro}{\ltx@footmark}
+% \begin{macro}{\ltx@foottext}
+% \begin{macro}{\ltx@make@current@footnote}
% We repair an error in the \LaTeX\ kernel (see \file{ltfloat.dtx}) involving footnotes.
% The symptom is that the \cmd\footnotemark\ command does not work properly within a \env{minipage} environment.
% The source of the problem is in the way the \cmd\footnotemark\ and \cmd\@xfootnotemark\ procedures are defined:
-% they do not share the method used by the \cmd\footnote\ and other procedures that allows a context switch to
+% they do not share the method, used by \cmd\footnote\ and other procedures, that allows a context switch to
% change the way footnotes behave within a minipage environment.
-% This is a \LaTeX\ bug of long standing; this fix dates to 1987.
+% This is a \LaTeX\ bug of long standing; our fix dates to 1987.
%
-% While we are at it, we rewrite both the \cmd\footnote\ and \cmd\footnotemark\ procedures,
-% achieving a slightly cleaner separation of syntax and semantics.
-% Note that the \cmd\@footnotemark\ and \cmd\@footnotetext\ procedures are not altered here;
-% they continue as the methods of formatting the footnote mark and footnote text, respectively.
+% While we are at it, we rewrite both the \cmd\footnote, \cmd\footnotemark\ and \cmd\footnotetext\ procedures,
+% achieving a cleaner separation of syntax and semantics.
+% Note that the \cmd\@footnotetext\ procedure is not involved in context switching;
+% \classname{hyperref} will take over that procedure, substituting its own processing around
+% its argument and passing this to \cmd\H@@footnotetext.
+% We anticipate this, and do our context switching on \cmd\H@@footnotetext.
+%
+% The \cmd\@makefnmark\ continues as the method of formatting the footnote mark.
%
% A note about the context switch mentioned above:
% the \env{minipage} environment executes the following in order to alter the way footnotes
-% behave:
-%\begin{verbatim}
+% behave:\begin{verbatim}
%\def\@mpfn{mpfootnote}%
%\def\thempfn{\thempfootnote}%
%\let\@footnotetext\@mpfootnotetext
-%\c@mpfootnote\z@
-%\end{verbatim}
+%\let\@makefnmark\@mpmakefnmark
+%\c@mpfootnote\z@\end{verbatim}
% This code changes the counter used in autonumbered footnotes, the choice of footnote marker,
% and the procedure used on the footnote text. Changing the counter is needed because minipage
% footnotes are in their own sequence, and the footnote marker is customarily different within
% a minipage. The procedure that works on the footnote text must be different because the footnotes
% are placed at the bottom of the minipage, not the bottom of the text column.
%
-% Any procedure that establishes a minipage-like context (e.g., floats) can do the same.
+% Note that \LaTeX\ initially defines \cmd\@mpfn\ as \texttt{footnote} and \cmd\thempfn\ as \cmd\thefootnote,
+% so we are initially doing general footnotes.
+%
+% Any procedure that establishes a minipage-like context (e.g., floats) can do the same as the mimipage context switch
+% illustrated above.
+% \changes{4.1a}{2008/06/30}{(AO, 438) Complete rewrite of footnote macros.}
+%
+% Three user-level command, \cmd\footnote, \cmd\footnotemark, and \cmd\footnotetext\ are defined (see the \LaTeX\ manual for user-level details).
+% \begin{macro}{\footnote}
+% The first user-level command is \cmd\footnote.
+% A simple way to look at this command is to think of it as
+% \cmd\footnotemark\ \oarg{number} \cmd\footnotetext\ \oarg{number} \arg{text},
+% where the optional argument is the same in both calls.
+% We also define a syntactical helper procedure \cmd\ltx@xfootnote.
+%
+% We employ the procedures \cmd\ltx@stp@footproc\ and \cmd\ltx@def@footproc,
+% passing in the procedure to execute, in this case \cmd\ltx@footmark,
+% which sets the footnote mark.
+% In any case, we end on the procedure \cmd\ltx@foottext, which sets the footnote text.
% \begin{macrocode}
-\def\footnote{%
- \@ifnextchar[\@xfootnote{\@yfootnote\@footnotetext}%
+\def\footnote{\@ifnextchar[\ltx@xfootnote\ltx@yfootnote}%
+\def\ltx@xfootnote[#1]{%
+ \ltx@def@footproc\ltx@footmark[#1]%
+ \expandafter\ltx@foottext\expandafter{\the\csname c@\@mpfn\endcsname}%
}%
-\def\footnotemark{%
- \@ifnextchar[\@xfootnotemark{\@yfootnote}%
+\def\ltx@yfootnote{%
+ \ltx@stp@footproc\ltx@footmark
+ \expandafter\ltx@foottext\expandafter{\the\csname c@\@mpfn\endcsname}%
}%
-\def\@xfootnote[#1]{%
- \@xfootnotemark[#1]%
- \@footnotetext
+% \end{macrocode}
+% The \cmd\footmark\ user-level command is next.
+% Here we use the procedures \cmd\ltx@stp@footproc\ and \cmd\ltx@def@footproc\ again,
+% but unlike \cmd\footnote, we do not set the footnote text.
+% \begin{macrocode}
+\def\footnotemark{\@ifnextchar[\ltx@xfootmark\ltx@yfootmark}%
+\def\ltx@xfootmark{\ltx@def@footproc\ltx@footmark}%
+\def\ltx@yfootmark{\ltx@stp@footproc\ltx@footmark}%
+\def\ltx@footmark#1{%
+ \leavevmode
+ \ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi
+ \begingroup
+ \expandafter\ltx@make@current@footnote\expandafter{\@mpfn}{#1}%
+ \expandafter\@argswap@val\expandafter{\Hy@footnote@currentHref}{\hyper@linkstart {link}}%
+ \@makefnmark
+ \hyper@linkend
+ \endgroup
+ \ifhmode\spacefactor\@x@sf\fi
+ \relax
}%
-\def\@xfootnotemark@ltx[#1]{%
+% \end{macrocode}
+% The third user-level command is \cmd\footnotetext.
+% As with \cmd\footnotemark, we use the procedures \cmd\ltx@stp@footproc\ and \cmd\ltx@def@footproc,
+% this time passing in the procedure \cmd\ltx@foottext, which sets the footnote text.
+% \begin{macrocode}
+\def\footnotetext{\@ifnextchar[\ltx@xfoottext\ltx@yfoottext}%
+\def\ltx@xfoottext{\ltx@def@footproc\ltx@foottext}%
+\def\ltx@yfoottext{\ltx@stp@footproc\ltx@foottext}%
+\long\def\ltx@foottext#1#2{%
\begingroup
- \csname c@\@mpfn\endcsname #1\relax
- \unrestored@protected@xdef\@thefnmark{\thempfn}%
+ \expandafter\ltx@make@current@footnote\expandafter{\@mpfn}{#1}%
+ \@footnotetext{#2}%
\endgroup
- \H@@footnotemark
}%
-\def\@yfootnote{%
- \stepcounter\@mpfn
+% \end{macrocode}
+% Here are the definitions of the procedures \cmd\ltx@stp@footproc\ and \cmd\ltx@def@footproc.
+% The require argument is the procedure to execute afterwards, and
+% \cmd\ltx@def@footproc\ parses a bracket-delimited argument (it is not optional).
+% In each case the given procedure is executed with an argument prepared for it:
+% the value of the footnote counter.
+% \begin{macrocode}
+\def\ltx@def@footproc#1[#2]{%
+ \begingroup
+ \csname c@\@mpfn\endcsname #2\relax
+ \unrestored@protected@xdef\@thefnmark{\thempfn}%
+ \expandafter\endgroup
+ \expandafter#1%
+ \expandafter{\the\csname c@\@mpfn\endcsname}%
+}%
+\def\ltx@stp@footproc#1{%
+ \expandafter\stepcounter\expandafter{\@mpfn}%
\protected@xdef\@thefnmark{\thempfn}%
- \H@@footnotemark
+ \expandafter#1%
+ \expandafter{\the\csname c@\@mpfn\endcsname}%
+}%
+% \end{macrocode}
+% Here we provide for our good friend \classname{hyperref}
+% to enter in like a bull in a china shop. If it is not loaded,
+% we do what it would have done, but gentlier and without hypertext functionality.
+% \begin{macrocode}
+\appdef\class@documenthook{%
+ \let\footnote@latex\footnote
+ \@ifpackageloaded{hyperref}{}{%
+ \let\H@@footnotetext\@footnotetext
+ \def\@footnotetext{\H@@footnotetext}%
+ \let\H@@mpfootnotetext\@mpfootnotetext
+ \def\@mpfootnotetext{\H@@mpfootnotetext}%
+ }%
}%
% \end{macrocode}
+% In the following, we must use \LaTeX's rococco equipment in the form of \cmd\protected@edef,
+% because of the presence of a font switch in the meaning of \cmd\thempfootnote.
+% But, really, isn't this a sloppy conflation of semantics and presentation?
+% \begin{macrocode}
+\def\ltx@make@current@footnote#1#2{%
+ \csname c@#1\endcsname#2\relax
+ \protected@edef\Hy@footnote@currentHref{\@currentHref-#1.\csname the#1\endcsname}%
+}%
+\def\thempfootnote@latex{{\itshape \@alph \c@mpfootnote }}%
+\def\ltx@thempfootnote{\@alph\c@mpfootnote}%
+\@ifx{\thempfootnote\thempfootnote@latex}{%
+ \class@info{Repairing hyperref-unfriendly LaTeX definition of \string\mpfootnote}%
+ \let\thempfootnote\ltx@thempfootnote
+}{}%
+% \end{macrocode}
%
-% Note on \classname{hyperref} compatability:
+% Note on \classname{hyperref} compatibility:
% In its ``Automated \LaTeX\ hypertext cross-references'',
% the \classname{hyperref} package alters footnote processing,
-% thereby imperiling these fixes and necessiating defensive measures.
+% but it does nothing to address the several issues of concern to us.
+%
+% The \classname{hyperref} package takes over the \cmd\@mpfootnotetext\ and
+% \cmd\@footnotetext\ procedures, wrapping the argument in its own code.
+% It also rewrites \cmd\@footnotemark, making it a hyperlink, and
+% \cmd\@xfootnotenext, removing from it all hypertext capabilities.
%
-% The main thing \classname{hyperref} does is to take over the \cmd\@mpfootnotetext\ and
-% \cmd\@footnotetext\ procedures, feeding its own arguments to these macros.
-% It also rewrites \cmd\@footnotemark, making it a hyperlink.
+% However, if the \cmd\footnotemark\ command has been supplied with an optional argument,
+% \classname{hyperref}'s changes do not apply: it punts in this case.
%
-% But at the same time, it attempts to turn off these changes during
-% \cmd\maketitle\ processing, necessitating rewriting \cmd\@xfootnotemark.
-% At this point it is on the slippery slope.
+% At the same time, it attempts to turn off its changes during
+% \cmd\maketitle\ processing, destroying one of the capabilities we desire.
%
-% We make ourself \classname{hyperref} friendly:
-% we give \classname{hyperref} what it needs, but avoid its change to
-% \cmd\@xfootnotemark.
+% We make ourself \classname{hyperref} savvy:
+% we re-implement footnote processing, using \classname{hyperref} capabilities if that
+% package has been loaded.
%
% Any other package that rewrites \LaTeX's footnote macros will be incompatible
% with this package.
-% \begin{macrocode}
-\appdef\class@documenthook{%
- \@ifxundefined\H@@footnotemark{%
- \let\H@@footnotemark\@footnotemark
- }{}%
- \let\@xfootnotemark\@xfootnotemark@ltx
-}%
-% \end{macrocode}
+% \changes{4.1a}{2008/06/30}{(AO) Remove code that avoided changes to \cs{@xfootnotemark}}%
%
% Two thoughts about \classname{hyperref}: what for does it define \cmd\realfootnote?
+% Apparently even SR himself cannot remember.
+%
% Also: a document class that desires high hypertext capabilities might
% well wish to reimplement \cmd\maketitle\ so that footnotes called out from there
% are hypertext links: the \classname{hyperref} package's
% ``Automated \LaTeX\ hypertext cross-references''
% does not do any of this:
%\begin{quotation}
-% But the special footnotes
-% in |\maketitle| are much too hard to deal with
-% properly. Let them revert to plain behaviour.
+% But the special footnotes in |\maketitle| are much too hard to deal with properly.
+% Let them revert to plain behaviour.
%\end{quotation}
% Note that the document class, in reimplementing \cmd\maketitle, must ensure
% that the \classname{hyperref} package does not clobber its own definition!
@@ -1133,6 +1486,8 @@ in your filesystem where they will be found by \LaTeX.
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@footnotetext}
% \begin{macro}{\@mpfootnotetext}
@@ -1148,7 +1503,7 @@ in your filesystem where they will be found by \LaTeX.
% Difference from \LaTeX: here we do not set \cmd\floatingpenalty\ to infinity.
% Doing this must date back to a time when \LaTeX\ could not accomodate split insertions (footnotes).
% I cannot think of any other reason to do have done this.
-% At any rate, with the \classname{ltxgrid} package, split insertions are specifically properly
+% At any rate, with the \classname{ltxgrid} package, split insertions are properly
% taken care of, so we allow it.
%
% We provide the hook \cmd\set@footnotewidth\
@@ -1163,20 +1518,32 @@ in your filesystem where they will be found by \LaTeX.
% are a step outside of the galley context, and all aspects of insertions need to be
% properly handled, including the set width.
% \begin{macrocode}
+\def\@makefnmark{%
+ \hbox{%
+ \@textsuperscript{%
+ \normalfont\itshape\@thefnmark
+ }%
+ }%
+}%
+% \end{macrocode}
+% \begin{macrocode}
\long\def\@footnotetext{%
\insert\footins\bgroup
\make@footnotetext
}%
+% \end{macrocode}
+% \begin{macrocode}
\long\def\@mpfootnotetext{%
\minipagefootnote@pick
\make@footnotetext
}%
-\def\make@footnotetext#1{%
- \reset@font\footnotesize
- \interlinepenalty\interfootnotelinepenalty
- \splittopskip\footnotesep
- \splitmaxdepth\dp\strutbox
-% \floatingpenalty\@MM
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\make@footnotetext#1{%
+ \set@footnotefont
+% \end{macrocode}
+% As noted above, we do \emph{not} do \cmd\floatingpenalty\ \cmd\@MM.
+% \begin{macrocode}
\set@footnotewidth
\@parboxrestore
\protected@edef\@currentlabel{%
@@ -1189,10 +1556,26 @@ in your filesystem where they will be found by \LaTeX.
\color@endgroup
\minipagefootnote@drop
}%
+% \end{macrocode}
+% \changes{4.1f}{2009/07/07}{(AO, 515) Hook for setting the font of a footnote}
+% \cmd\set@footnotefont\ is the procedure for setting the font of a footnote.
+% Other aspects of the environment may be set using this hook.
+% \begin{macrocode}
+\def\set@footnotefont{%
+ \reset@font\footnotesize
+ \interlinepenalty\interfootnotelinepenalty
+ \splittopskip\footnotesep
+ \splitmaxdepth\dp\strutbox
+}%
+% \end{macrocode}
+% \cmd\set@footnotewidth\ is the procedure for setting the width of a footnote.
+% \begin{macrocode}
\def\set@footnotewidth{%
\hsize\columnwidth
\linewidth\hsize
}%
+% \end{macrocode}
+% \begin{macrocode}
\def\set@footnotewidth@ii{%
\hsize\textwidth
\advance\hsize\columnsep
@@ -1235,13 +1618,11 @@ in your filesystem where they will be found by \LaTeX.
%
% \item
% Optionally define an alternative, say \env{figure@write} as follows:
-% \begin{verbatim}
-%\newenvironment{figure@write}{%
+% \begin{verbatim}\newenvironment{figure@write}{%
% \write@float{figure}%
%}{%
% \endwrite@float
-%}%
-% \end{verbatim}
+%}\end{verbatim}
% That is, the alternative environment executes \cmd\write@float\
% instead of \cmd\@float.
% Note that this step is not needed if the float environment
@@ -1251,9 +1632,7 @@ in your filesystem where they will be found by \LaTeX.
% \item
% Install into \cmd\AtBeginDocument\ a call to \cmd\do@if@floats,
% with the float name and an appropriate file extension as its arguments.
-% \begin{verbatim}
-%\AtBeginDocument{\do@if@floats{figure}{.fgx}}%
-% \end{verbatim}
+% \begin{verbatim}\appdef\class@documenthook{\do@if@floats{figure}{.fgx}}\end{verbatim}
%
% \item
% Optionally define a text entity \cmd\figuresname\ that will
@@ -1265,15 +1644,11 @@ in your filesystem where they will be found by \LaTeX.
% Optionally define a user-level command to allow
% the document to determine where the figures are printed out
% (default is to print at end of document). E.g.,
-% \begin{verbatim}
-%\newcommand\printfigures{\print@float{figure}}%
-% \end{verbatim}
+% \begin{verbatim}\newcommand\printfigures{\print@float{figure}}\end{verbatim}
% \item
% Install into \cmd\appdef\cmd\class@enddocumenthook\ a call to \cmd\printfigures,
% or, if the latter is not defined, as follows:
-% \begin{verbatim}
-%\appdef\class@enddocumenthook{\print@float{figure}}%
-% \end{verbatim}
+% \begin{verbatim}\appdef\class@enddocumenthook{\print@float{figure}}\end{verbatim}
% Note that installing this command into \cmd\AtBeginDocument
% is best done earlier than calls that assume the last page of
% the document is at hand.
@@ -1286,24 +1661,33 @@ in your filesystem where they will be found by \LaTeX.
% We provide for a little help, but without changing the meanings of these commands.
%
% \begin{macro}{\addtocontents}
+% \begin{macro}{\robustify@contents}
%
+% \changes{4.1a}{2008/06/30}{(AO) Make \cs{addtocontents} a \cs{long} \cs{def}; gobble up \cs{footnote}}%
% \begin{macrocode}
-\def\addtocontents#1#2{%
- \protected@write\@auxout{%
- \let \label \@gobble \let \index \@gobble \let \glossary \@gobble
- \def\({\string\(}%
- \def\){\string\)}%
- \def\\{\string\\}%
- }{\string \@writefile {#1}{#2}}%
+\def\robustify@contents{%
+ \let \label \@gobble
+ \let \index \@gobble
+ \let \glossary \@gobble
+ \let\footnote \@gobble
+ \def\({\string\(}%
+ \def\){\string\)}%
+ \def\\{\string\\}%
+}%
+\long\def\addtocontents#1#2{%
+ \protected@write\@auxout{\robustify@contents}{\string \@writefile {#1}{#2}}%
}%
% \end{macrocode}
%
% \end{macro}
+% \end{macro}
%
% \subsubsection{Preparing for the \classname{hyperref package}}%
%
% \begin{macro}{\addcontentsline}
-% \begin{macro}{\contentsline}
+% \begin{macro}{\label}
+% \begin{macro}{\ltx@contentsline}
+% \changes{4.1b}{2008/08/12}{Refine toc processing: provide default.}%
% The \classname{hyperref} package assumes that the \cmd\contentsline\ command will be given four arguments.
% Therefore it cannot successfully process a \filename{.toc} file that had been written by standard \LaTeX.
% We fix things up by always writing that fourth argument and by supplying a \cmd\contentsline\ command that
@@ -1311,16 +1695,16 @@ in your filesystem where they will be found by \LaTeX.
%
% We also give the \cmd\newlabel\ command's second argument five tokens.
%
-% This means that a document class that uses this package will itself have trouble taking over a \filename{.toc} file that was written by standard \LaTeX. Sigh.
+% Finally, we wrap \LaTeX's \cmd\contentsline\ command with code to detect the case
+% where the expected procedure is not defined, and we give it a syntax with no semantics.
+%
+% We switch over to this new definition only after \classname{hyperref} has loaded.
% \begin{macrocode}
\def\addcontentsline#1#2#3{%
\addtocontents{#1}{%
\protect\contentsline{#2}{#3}{\thepage}{}%
}%
}%
-\def\contentsline#1#2#3#4{%
- \csname l@#1\endcsname{#2}{#3}%
-}%
\def\label#1{%
\@bsphack
\protected@write\@auxout{}{%
@@ -1328,10 +1712,21 @@ in your filesystem where they will be found by \LaTeX.
}%
\@esphack
}%
+\def\ltx@contentsline#1{%
+ \expandafter\@ifnotrelax\csname l@#1\endcsname{}{%
+ \expandafter\let\csname l@#1\endcsname\@gobbletwo
+ }%
+ \contentsline@latex{#1}%
+}%
+\appdef\document@inithook{%
+ \let\contentsline@latex\contentsline
+ \let\contentsline\ltx@contentsline
+}%
% \end{macrocode}
%
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \subsubsection{Footnotes within floats, unfloating floats, float font}%
%
@@ -1339,19 +1734,16 @@ in your filesystem where they will be found by \LaTeX.
% DPC: Er a bit of a hack, but seems best way of supporting normal
% \LaTeX\ syntax at this point: If a caption is used below a table,
% then put out the footnotes before the caption.
-% \changes{v4.0beta 2}{1999/06/20}
-% {Support the hack with \cs{prepdef}, and delay until \cs{AtBeginDocument} time,
-% since \classname{hyperref} clobbers \cs{caption}.}
+% \changes{4.0b}{1999/06/20}{Support the hack with \cs{prepdef}, and delay until \cs{AtBeginDocument} time, since \classname{hyperref} clobbers \cs{caption}.}
% \begin{macrocode}
\appdef\class@documenthook{%
\prepdef\caption{\minipagefootnote@here}%
}%
% \end{macrocode}
%
-% Note on \classname{hyperref} compatability:
+% Note on \classname{hyperref} compatibility:
% this change to the \cmd\caption\ command is compatible with the
-% ``Automated \LaTeX\ hypertext cross-references'' patches of
-% that package.
+% ``Automated \LaTeX\ hypertext cross-references'' patches of that package.
%
% All the same, I think Sebastian's changes to \cmd\caption\ and \cmd\@caption\
% could bear with some improvement.
@@ -1371,9 +1763,7 @@ in your filesystem where they will be found by \LaTeX.
% \hyper@@anchor{\@currentHref}{\relax}#3%
% \fi
% }%
-%}%
-%
-%\end{verbatim}
+%}\end{verbatim}
%
% \end{macro}
%
@@ -1432,17 +1822,14 @@ in your filesystem where they will be found by \LaTeX.
% \end{macro}
%
% \begin{macro}{\floats@sw}
+% \changes{4.1b}{2008/08/12}{Default assignment of \cs{float@sw} now, not at \cs{AtBeginDocument} time.}%
% The Boolean \cmd\floats@sw\ signifies that floats are to be floated;
% if false, that floats are to be deferred to the end of the document.
-% Note that the state of this Boolean is to be changed by
+% Note that the assignment of this Boolean is to be overridden by
% the document class in response to user-selected options.
-% Here we display model code that assigns a default value
-% at \cmd\AtBeginDocument\ time.
-% \begin{verbatim}
-%\AtBeginDocument{%
-% \@ifxundefined\floats@sw{\@booleantrue\floats@sw}{}%
-%}%
-% \end{verbatim}
+% \begin{macrocode}
+\@booleantrue\floats@sw
+% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@xfloat}
@@ -1453,63 +1840,42 @@ in your filesystem where they will be found by \LaTeX.
% Note that, to protect against the Boolean being undefined
% at this late hour, we default it globally to true.
%
-% \changes{v4.0beta 2}{1999/06/20}
-% {AO: Removed superfluous \cs{def}s, changed to using \cs{floats@sw} as the flag.
-% Also stopped using DPC's \cs{if@twocolumn} flag: using \cs{floats@sw} instead.
-% Also added \cs{par}\cs{vskip}\cs{z@skip} after the \cs{minipagefootnotes}
-% so that the float box would have zero depth like the kernel one.
-% }
-% \changes{v4.0beta 3}{1999/11/13}
-% {bug fix 110. Install hooks for endfloats processing}
-% \changes{v4.0beta 4}{2000/04/10}
-% {bug fix 127. Floats placed [h] to allow page breaks}
-% \changes{v4.0beta 4}{2000/05/19}
-% {bug fix 224. Hyperref compatability.}
-% \changes{v4.0beta 5}{2000/11/16}
-% {bug fix 221. Remove samepage command from @xfloat@prep: If the float can break over pages, we want better control.}
-%FIXME: why does hyperref override \cmd\@xfootnotenext?
+% \changes{4.0b}{1999/06/20}{AO: Removed superfluous \cs{def}s, changed to using \cs{floats@sw} as the flag. Also stopped using DPC's \cs{if@twocolumn} flag: using \cs{floats@sw} instead. Also added \cs{par}\cs{vskip}\cs{z@skip} after the \cs{minipagefootnotes} so that the float box would have zero depth like the kernel one. }
+% \changes{4.0c}{1999/11/13}{(AO, 110) Install hooks for endfloats processing}
+% \changes{4.0d}{2000/04/10}{(AO, 127) Floats placed [h] to allow page breaks}
+% \changes{4.0d}{2000/05/19}{(AO, 224) Hyperref compatibility.}
+% \changes{4.0e}{2000/11/16}{(AO, 221) Remove samepage command from @xfloat@prep: If the float can break over pages, we want better control.}
+% \changes{4.1a}{2008/07/07}{\cs{@xfloat@prep} calls \cs{ltx@footnote@pop} to restore the original \cs{ltx@footmark} and \cs{ltx@foottext} procedures, in case footnote processing has switched.}
+% \changes{4.1b}{2008/08/12}{No need to protect against undefined \cs{float@sw}}
%
% \begin{macrocode}
\let\@xfloat@LaTeX\@xfloat
\def\@xfloat#1[#2]{%
\@xfloat@prep
\@nameuse{fp@proc@#2}%
- \@ifxundefined\floats@sw{\global\@booleantrue\floats@sw}{}%
\floats@sw{\@xfloat@LaTeX{#1}[#2]}{\@xfloat@anchored{#1}[]}%
}%
\def\@xfloat@prep{%
- \let\footnote\footnote@latex
+ \ltx@footnote@pop
\def\@mpfn{mpfootnote}%
\def\thempfn{\thempfootnote}%
-% \def\thefootnote{\thempfootnote}%
\c@mpfootnote\z@
- \let\@footnotetext\@mpfootnotetext
- \let\H@@footnotetext\@mpfootnotetext
- \let\@makefntext\@mpmakefntext
-% \samepage
-}%
-\appdef\class@documenthook{%
- \let\footnote@latex\footnote
+ \let\H@@footnotetext\H@@mpfootnotetext
}%
-%\def\fp@proc@h{\@booleanfalse\floats@sw}%
-%\def\fp@proc@H{\@booleanfalse\floats@sw}%
+\let\ltx@footnote@pop\@empty
\def\@xfloat@anchored#1[#2]{%
\def\@captype{#1}%
\begin@float@pagebreak
-%\vbox\bgroup
\let\end@float\end@float@anchored
\let\end@dblfloat\end@float@anchored
-% do as \@xfloat does:
\hsize\columnwidth
\@parboxrestore
\@floatboxreset
\minipagefootnote@init
-% \pagegrid@col\@ne % Klootch to avoid processing as a float
}%
\def\end@float@anchored{%
\minipagefootnote@here
- \par\vskip\z@skip %% \par\vskip\z@ added 15 Dec 87
-%\egroup
+ \par\vskip\z@skip
\par
\end@float@pagebreak
}%
@@ -1529,8 +1895,9 @@ in your filesystem where they will be found by \LaTeX.
% \subsubsection{Writing floats out to a file}%
%
% \begin{macro}{\do@if@floats}
+% \changes{4.1b}{2008/08/12}{No need to protect against undefined \cs{float@sw}}
% The procedure \cmd\do@if@floats\ should be executed at
-% \cmd\AtBeginDocument\ time, and arranges to write out
+% \cmd\class@documenthook\ time: it arranges to write out
% the floats of the given class to a temporary file, to be
% read back later (deferred floats),
% given that \cmd\floats@sw\ is false.
@@ -1538,7 +1905,6 @@ in your filesystem where they will be found by \LaTeX.
% at this late hour, we default it globally to true.
% \begin{macrocode}
\def\do@if@floats#1#2{%
- \@ifxundefined\floats@sw{\global\@booleantrue\floats@sw}{}%
\floats@sw{}{%
% \end{macrocode}
% Open the stream to save out the document's floats of this class.
@@ -1579,18 +1945,20 @@ in your filesystem where they will be found by \LaTeX.
% \begin{macro}{\print@float}
% The procedure \cmd\print@float\ prints out the
% deferred floats.
-% \changes{v4.0beta 2}{1999/06/20}
-% {only execute if there really were floats of the given type}
-% \changes{v4.0beta 3}{1999/11/13}
-% {*-form mandates pagebreak at each float;
-% only print section head if there is something there.}
-% \changes{v4.0beta 4}{2000/05/23}
-% {Allow things to break over pages by setting array@default.}
+% \changes{4.0b}{1999/06/20}{only execute if there really were floats of the given type}
+% \changes{4.0c}{1999/11/13}{*-form mandates pagebreak at each float; only print section head if there is something there.}
+% \changes{4.0d}{2000/05/23}{Allow things to break over pages by setting array@default.}
+% \changes{4.1b}{2008/08/12}{If class option \classoption{lengthcheck} is in effect, log the height of this float class.}
%
+% Here, we make use of the \cmd\floats@sw\ Boolean to select
+% the non-floating type of processing.
% \begin{macrocode}
\def\triggerpar{\leavevmode\@@par}%
\def\oneapage{\def\begin@float@pagebreak{\newpage}\def\end@float@pagebreak{\newpage}}%
\def\print@float#1#2{%
+ \lengthcheck@sw{%
+ \total@float{#1}%
+ }{}%
\@ifxundefined@cs{#1write}{}{%
\begingroup
\@booleanfalse\floats@sw
@@ -1628,13 +1996,93 @@ in your filesystem where they will be found by \LaTeX.
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\tally@float}
+% \begin{macro}{\total@float}
+% \changes{4.1b}{2008/08/12}{Tally and log the height of a float class}
+% If we are tallying column inches, \cmd\tally@float\ tallies a contribution to \cmd\ftype@\ \cmd\@captype,
+% depending upon the width of \cmd\@currbox.
+% In effect, each float class is tallied in two sections, one for narrow, one for wide floats.
+%
+% If statistics are wanted, \cmd\total@float\ logs the tally for the given float class.
+% \changes{4.1f}{2009/07/10}{(AO, 518) Tally register overflow when locument is long}
+% The quantity \cmd\@twopowerfourteen\ is $2^{14}$, \cmd\@twopowertwo\ is $2^{2}$.
+% \begin{macrocode}
+\chardef\@xvi=16\relax
+\mathchardef\@twopowerfourteen="4000
+\mathchardef\@twopowertwo="4
+\def\tally@float#1{%
+ \begingroup
+% \end{macrocode}
+% We strip all but the least significant 5 bits from \cmd\count\ \cmd\@currbox,
+% and put them into \cmd\@tempcnta. We then subtract 16 from \cmd\count\ \cmd\@currbox
+% (unless this would make it negative), effectively reversing the process
+% carried out in \cmd\@float.
+% \begin{macrocode}
+ \@tempcnta\count\@currbox
+ \divide\@tempcnta\@xxxii
+ \multiply\@tempcnta\@xxxii
+ \advance\count\@currbox-\@tempcnta
+ \divide\@tempcnta\@xxxii
+ \@ifnum{\count\@currbox>\@xvi}{%
+ \advance\count\@currbox-\@xvi\@booleantrue\@temp@sw
+ }{%
+ \@booleanfalse\@temp@sw
+ }%
+% \end{macrocode}
+% If so desired, we log the characteristics of this float object:
+% float class and float placement parameters, height, depth, and width.
+% \begin{macrocode}
+ \show@box@size@sw{%
+ \class@info{Float #1
+ (\the\@tempcnta)[\@temp@sw{16+}{}\the\count\@currbox]^^J%
+ (\the\ht\@currbox+\the\dp\@currbox)X\the\wd\@currbox
+ }%
+ }{}%
+ \endgroup
+% \end{macrocode}
+% Here we tally the height of this float object.
+% \begin{macrocode}
+ \expandafter\let
+ \expandafter\@tempa
+ \csname fbox@\csname ftype@#1\endcsname\endcsname
+ \@ifnotrelax\@tempa{%
+ \@ifhbox\@tempa{%
+ \setbox\@tempboxa\vbox{\unvcopy\@currbox\hrule}%
+ \dimen@\ht\@tempboxa
+ \divide\dimen@\@twopowerfourteen
+ \@ifdim{\wd\@tempboxa<\textwidth}{%
+ \advance\dimen@\ht\@tempa
+ \global\ht\@tempa\dimen@
+ }{%
+ \advance\dimen@\dp\@tempa
+ \global\dp\@tempa\dimen@
+ }%
+ }{}%
+ }{}%
+}%
+\def\total@float#1{%
+ \expandafter\let
+ \expandafter\@tempa
+ \csname fbox@\csname ftype@#1\endcsname\endcsname
+ \@ifnotrelax\@tempa{%
+ \@ifhbox\@tempa{%
+ \@tempdima\the\ht\@tempa\divide\@tempdima\@twopowertwo\@tempcnta\@tempdima
+ \@tempdimb\the\dp\@tempa\divide\@tempdimb\@twopowertwo\@tempcntb\@tempdimb
+ \class@info{Total #1: Column(\the\@tempcnta pt), Page(\the\@tempcnta pt)}%
+ }{}%
+ }{}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\write@float}
% \begin{macro}{\write@floats}
% \begin{macro}{\write@@float}
% Handles the case where the name of the float is the same as
% that of the stream. Note that
% \env{longtable} does \emph{not} fit this case.
-% Note also: \cmd\write@float\ is \emph{not} a user-level environment
+% Note also: \cmd\write@float\ is \emph{not} a user-level environment,
% therefore it is properly not defined with \cmd\newenvironment.
% \begin{macrocode}
\def\write@float#1{\write@@float{#1}{#1}}%
@@ -1645,10 +2093,7 @@ in your filesystem where they will be found by \LaTeX.
% \end{macro}
%
% \begin{macro}{\write@@float}
-% \changes{v4.0beta 2}{1999/06/20}
-% {AO: Fixed spurious \texttt{CR} and (return) characters in output file.
-% Also, if the document did not have the \cs{end}\texttt{figure} on a line of its own,
-% the macro wouldn't work. Fixed.}
+% \changes{4.0b}{1999/06/20}{AO: Fixed spurious \texttt{CR} and (return) characters in output file. Also, if the document did not have the \cs{end}\texttt{figure} on a line of its own, the macro wouldn't work. Fixed.}
% \begin{macrocode}
\def\write@@float#1#2{%
\ifhmode
@@ -1670,8 +2115,8 @@ in your filesystem where they will be found by \LaTeX.
% \begin{macro}{\write@floatline}
% \begin{macro}{\@write@floatline}
% \begin{macro}{\float@end@tag}
-% The procedure \cmd\write@floatline\ only parses, and passes
-% its result to \cmd\@write@floatline, which
+% The procedure \cmd\write@floatline\ only parses;
+% it passes its result to \cmd\@write@floatline, which
% writes the line to output, then tests the line
% for the \cmd\end\arg{float} tokens with
% aid of the \cmd\float@end@tag\ procedure.
@@ -1797,8 +2242,7 @@ in your filesystem where they will be found by \LaTeX.
% the convention that the former is the original \LaTeX\ procedure.
%
% \begin{macrocode}
-\class@info
- {Repairing broken LateX \string\@sect}%
+\class@info{Repairing broken LateX \string\@sect}%
\def\@sect@ltx#1#2#3#4#5#6[#7]#8{%
\@ifnum{#2>\c@secnumdepth}{%
\def\H@svsec{\phantomsection}%
@@ -1864,7 +2308,7 @@ in your filesystem where they will be found by \LaTeX.
% Possibly set a mark.
% Make a TOC entry.
%
-% Note that, for compatability with the \classname{hyperref} package, we
+% Note that, for compatibility with the \classname{hyperref} package, we
% need to provide the interface required by that package
% (actually required by \file{pdfmark.def} and \file{nameref.sty}),
% namely
@@ -1873,13 +2317,13 @@ in your filesystem where they will be found by \LaTeX.
% the call to \cmd\phantomsection\ (which must precede the call to \cmd\addcontentsline).
% We also have to sidestep the patch to \cmd\@ssect\ in that same file, therefore
% we use a different control sequence name in the call from \cmd\@startsection.
-% \changes{v4.0beta 3}{1999/11/13}
-% {Bug 116: Hyperref compatability}
-% \changes{v4.0rc3b}{2001/07/13}
-% {Bug 404: Hyperref compatability}
+% \changes{4.0c}{1999/11/13}{(AO, 116) Hyperref compatibility}
+% \changes{4.0f}{2001/07/13}{(AO, 404) Hyperref compatibility}
% \begin{macrocode}
\def\@ssect@ltx#1#2#3#4#5#6[#7]#8{%
-% \def\@currentlabelname{#8}%
+% \end{macrocode}
+% Removed |\def\@currentlabelname{#8}|
+% \begin{macrocode}
\def\H@svsec{\phantomsection}%
\@tempskipa #5\relax
\@ifdim{\@tempskipa>\z@}{%
@@ -1887,7 +2331,9 @@ in your filesystem where they will be found by \LaTeX.
\interlinepenalty \@M
#6{%
\@ifundefined{@hangfroms@#1}{\@hang@froms}{\csname @hangfroms@#1\endcsname}%
-% {\hskip#3\relax\H@svsec}{\Sectionformat{#8}{#1}}%
+% \end{macrocode}
+% Removed |{\hskip#3\relax\H@svsec}{\Sectionformat{#8}{#1}}|
+% \begin{macrocode}
{\hskip#3\relax\H@svsec}{#8}%
}%
\@@par
@@ -1898,7 +2344,9 @@ in your filesystem where they will be found by \LaTeX.
\def\@svsechd{%
#6{%
\@ifundefined{@runin@tos@#1}{\@runin@tos}{\csname @runin@tos@#1\endcsname}%
-% {\hskip#3\relax\H@svsec}{\Sectionformat{#8}{#1}}%
+% \end{macrocode}
+% Removed |{\hskip#3\relax\H@svsec}{\Sectionformat{#8}{#1}}|
+% \begin{macrocode}
{\hskip#3\relax\H@svsec}{#8}%
}%
\@ifundefined{#1smark}{\@gobble}{\csname #1smark\endcsname}{#7}%
@@ -1912,7 +2360,8 @@ in your filesystem where they will be found by \LaTeX.
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\init@documenthook}
+% \begin{macro}{\init@hyperref}
+% \changes{4.1b}{2008/08/12}{Acquire \classname{hyperref} savoire}
% Document classes that incorporate this package will be \classname{hyperref}-savvy.
% (To accomplish this, we ensure that \cmd\hyperanchor\ and \cmd\hyper@last\ are both defined.)
% Being \classname{hyperref}-savvy levels some requirements on us, but the benefits are many.
@@ -1921,25 +2370,27 @@ in your filesystem where they will be found by \LaTeX.
% Instead, only two runs are required: the first updates the auxiliary file, the second the TOC.
% However, the formatting of the document does not change.
%
-% Another aspect of being \classname{hyperref}-savvy is that the syntax of commands in the \filename{.aux} file will now change
+% Another aspect of being \classname{hyperref}-savvy is that the syntax of commands in the \file{.aux} file will not change
% if \classname{hyperref} is turned on or off.
%
% Note that \cmd\hyper@anchorstart\ and \cmd\hyper@anchorend\ constitute the programming interface
% for a hypertext anchor (the target of a hypertext link); \cmd\hyper@linkstart\ and \cmd\hyper@linkend\
% are the interface for a hypertext link.
% \begin{macrocode}
-\appdef\init@documenthook{%
+\def\init@hyperref{%
\providecommand\phantomsection{}%
-%\@ifx{\Sectionformat\@undefined}{\let\Sectionformat\@firstoftwo}{}%
- \providecommand\hyper@anchor[1]{}%
- \providecommand\hyper@last{}%
- \providecommand\Hy@raisedlink[1]{#1}%
+ \providecommand\hyper@makecurrent[1]{}%
+ \providecommand\Hy@raisedlink[1]{}%
\providecommand\hyper@anchorstart[1]{}%
\providecommand\hyper@anchorend{}%
\providecommand\hyper@linkstart[2]{}%
\providecommand\hyper@linkend{}%
+ \providecommand\@currentHref{}%
}%
\let\H@refstepcounter\refstepcounter
+\appdef\document@inithook{%
+ \init@hyperref
+}%
% \end{macrocode}
% \end{macro}
%
@@ -1969,6 +2420,7 @@ in your filesystem where they will be found by \LaTeX.
%
% \begin{macro}{\endtabular}
% \begin{macro}{\endarray}
+% \changes{4.1b}{2008/08/12}{Patch the array package even later: after all package patches go in.}
% We headpatch the begin processing and tailpatch the end processing
% of the \env{tabular} and \env{array} environments.
% A document class can define these hooks as needed.
@@ -1979,7 +2431,7 @@ in your filesystem where they will be found by \LaTeX.
% other packages that replace the \LaTeX\ \env{array} and \env{tabular}
% environments. I know of none that do so.
% \begin{macrocode}
-\appdef\class@documenthook{%
+\appdef\document@inithook{%
\@ifpackageloaded{array}{\switch@array}{\switch@tabular}%
\prepdef\endtabular{\endtabular@hook}%
\@provide\endtabular@hook{}%
@@ -1990,8 +2442,7 @@ in your filesystem where they will be found by \LaTeX.
% Install, effectively, a head patch to \cmd\tabular.
% In order to avoid interference from, e.g., the \classname{array} package,
% we must perform this patch only \emph{after} packages load.
-% \changes{v4.0beta 3}{1999/11/13}
-% {Bug 130. Interference from array package}
+% \changes{4.0c}{1999/11/13}{(AO, 130) Interference from array package}
% \begin{macrocode}
\prepdef\@tabular{\tabular@hook}%
\@provide\tabular@hook{}%
@@ -2123,7 +2574,11 @@ in your filesystem where they will be found by \LaTeX.
\let\@xargarraycr\@xargarraycr@ltx
\let\@yargarraycr\@yargarraycr@ltx
}%
+% \end{macrocode}
+% \changes{4.1b}{2008/08/12}{(AO, 505) Try to accommodate \classname{colortbl}.}
+% \begin{macrocode}
\def\switch@array{%
+ \@ifpackageloaded{colortbl}{\let\switch@array@info\colortbl@message}{\let\switch@array@info\array@message}%
\let\@array@sw\@array@sw@LaTeX
\@ifx{\@array\@array@array}{%
\@ifx{\@tabular\@tabular@array}{%
@@ -2139,18 +2594,18 @@ in your filesystem where they will be found by \LaTeX.
\@ifx{\@xargarraycr\@xargarraycr@array}{%
\@ifx{\@yargarraycr\@yargarraycr@array}{%
\true@sw
- }{%
- \false@sw
- }%
- }{%
- \false@sw
- }%
- }{%
- \false@sw
- }%
- }{%
- \false@sw
- }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
}{%
\false@sw
}%
@@ -2180,7 +2635,7 @@ in your filesystem where they will be found by \LaTeX.
}{%
\class@info{Patching array package.}%
}{%
- \class@info{Unrecognized array package. Please update this document class! (Proceeding with fingers crossed.)}%
+ \switch@array@info
}%
\let\@array \@array@array@new
\let\@@array \@array % Cosi fan tutti
@@ -2200,6 +2655,12 @@ in your filesystem where they will be found by \LaTeX.
\let\@xargarraycr\@xargarraycr@new
\let\@yargarraycr\@yargarraycr@new
}%
+\def\array@message{%
+ \class@info{Unrecognized array package. Please update this document class! (Proceeding with fingers crossed.)}%
+}%
+\def\colortbl@message{%
+ \class@info{colortbl package is loaded. (Proceeding with fingers crossed.)}%
+}%
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -2214,8 +2675,12 @@ in your filesystem where they will be found by \LaTeX.
% \end{macro}
%
% \begin{macro}{\@tabular}
+% \changes{4.1b}{2008/08/12}{(AO, 505) try to accommodate \classname{colortbl}.}
% We provide the old versions of \cmd\@tabular\ along with the respective new versions.
% The change here is to avoid committing to LR mode. That will be done later (as late as possible, naturally).
+%
+% Compatibility note: I had done \cmd\let\ \cmd\col@sep\ \cmd\@undefined\ here, but
+% this was not compatible with \classname{colortbl}. I have removed that statement.
% \begin{macrocode}
\def\@tabular@LaTeX{%
\leavevmode
@@ -2247,7 +2712,9 @@ in your filesystem where they will be found by \LaTeX.
\let\@acoll\@tabacoll
\let\@acolr\@tabacolr
\let\@acol\@tabacol
- \let\col@sep\@undefined
+% \end{macrocode}
+% \let\col@sep\@undefined
+% \begin{macrocode}
\let\d@llarbegin\begingroup
\let\d@llarend\endgroup
\@tabarray
@@ -2261,7 +2728,13 @@ in your filesystem where they will be found by \LaTeX.
% which is 'c' in standard \LaTeX.
% Under some circumstances, we want to change this to, say, 'v'.
%
-% FIXME: must decouple \env{array} and \env{tabular}.
+% \changes{4.1b}{2008/08/12}{(AO, 505) try to accommodate \classname{colortbl}.}
+% FIXME: must decouple \env{array} and \env{tabular}. Done (it seems).
+%
+% Note on \classname{colortbl}: this package head-patches \cmd\@tabarray
+% with its own command \cmd\CT@start, and tails onto \cmd\endarray\ with \cmd\CT@end.
+% It fortuitously does the former at \cmd\AtBeginDocument\ time, and, fortuitously,
+% we do not patch \cmd\endarray, which it overwrites.
% \begin{macrocode}
\def\@tabarray@LaTeX{%
\m@th\@ifnextchar[\@array{\@array[c]}%
@@ -2406,7 +2879,10 @@ in your filesystem where they will be found by \LaTeX.
\let\@acoll\@arrayacol
\let\@acolr\@arrayacol
\let\@acol\@arrayacol
-\let\col@sep\@undefined
+% \end{macrocode}
+% \changes{4.1b}{2008/08/12}{(AO, 505) try to accommodate \classname{colortbl}.}
+% Removed: \verb+\let\col@sep\@undefined+
+% \begin{macrocode}
\def\d@llarbegin{$}%
\let\d@llarend\d@llarbegin
\gdef\@halignto{}%
@@ -2892,26 +3368,34 @@ in your filesystem where they will be found by \LaTeX.
% Then, in both \classname{array} and \classname{longtable}, \TeX's \cmd\edef\
% is used to `compile in place' that alignment preamble.
%
-% In the case of \classname{array}, the operation is done in order to
-% pre-expand the use of \texttt{*}, in \classname{longtable}, it is to
-% set the widths of the columns.
+% In the case of \classname{array},
+% the operation is done in order to pre-expand the use of \texttt{*};
+% in \classname{longtable}, it is to set the widths of the columns.
%
% Now, during this \cmd\edef, certain control sequence names must \emph{not}
% be expanded, and those are robustified by \cmd\@mkpream@relax.
%
% \begin{macrocode}
\def\@mkpream@relax{%
- \let\tableftsep\relax
- \let\tabmidsep\relax
- \let\tabrightsep\relax
+ \let\tableftsep \relax
+ \let\tabmidsep \relax
+ \let\tabrightsep \relax
\let\array@row@rst\relax
- \let\cell@font\relax
- \let\@startpbox\relax
+ \let\cell@font \relax
+ \let\@startpbox \relax
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@mkpream}
+% We insert \cmd\@mkpream@relax\ at the head of the procedure.
+% The robustifying of \cmd\@startpbox\ and \cmd\@endpbox\ is taken over by this mechanism.
+% We also invoke \cmd\@acolr\ instead of \cmd\@acol\ when a right-hand column is at hand.
+%
+% \changes{4.1b}{2008/08/12}{(AO, 505) try to accommodate \classname{colortbl}.}
+% Note on \classname{colortbl}: this package head-patches \cmd\@mkpream\ to robustify
+% a number of its commands during the construction of the alignment preamble.
+% The best we can do is to supplement the \cmd\@mkpream@relax\ procedure to perform this action.
% \begin{macrocode}
\def\@mkpream@array#1{%
\gdef\@preamble{}\@lastchclass 4 \@firstamptrue
@@ -2998,6 +3482,26 @@ in your filesystem where they will be found by \LaTeX.
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\@mkpream@relax}
+% \changes{4.1b}{2008/08/12}{(AO, 505) try to accommodate \classname{colortbl}.}
+% David P. Carlisle's \classname{colortbl} package headpatches \cmd\@mkpream\ in place
+% during package loading, so it does not know whom it is working on.
+% Let us try to accomodate this package by doing what it would have liked to have done.
+%
+% Note: it would be far better to break out this mechanism in the \classname{array} package.
+% \begin{macrocode}
+\appdef\@mkpream@relax{%
+ \let\CT@setup \relax
+ \let\CT@color \relax
+ \let\CT@do@color \relax
+ \let\color \relax
+ \let\CT@column@color\relax
+ \let\CT@row@color \relax
+ \let\CT@cell@color \relax
+}%
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\@addamp}
% \begin{macrocode}
\def\@addamp@LaTeX{%
@@ -3217,7 +3721,7 @@ in your filesystem where they will be found by \LaTeX.
\ifodd\@tempcntb \@testtrue\fi
\fi}%
\def\@xbitor@ltx#1{%
- \@tempcntb\count#1%
+ \@tempcntb\count#1\relax
\@ifnum{\@tempcnta=\z@}{}{%
\divide\@tempcntb\@tempcnta
\@ifodd\@tempcntb{\@testtrue}{}%
@@ -3248,11 +3752,11 @@ in your filesystem where they will be found by \LaTeX.
%
% Note on \classname{hyperref} compatibility:
% We must respect that
-% \cmd\contentsline now has a 4th argument.
+% \cmd\contentsline\ now has a fourth argument.
% So, instead of trying to override the meaning of \cmd\contentsline,
% we use the aux file to remember max values from one run to the next.
%
-% In this respect, this package retains compatability with
+% In this respect, this package retains compatibility with
% \classname{hyperref}.
%
% \begin{macro}{\@starttoc}
@@ -3282,9 +3786,10 @@ in your filesystem where they will be found by \LaTeX.
%
% Note: \cmd\toc@@font\ is the common font for all auto-sizing toc commands,
% although this, too, could become a dispatcher.
+% \changes{4.1a}{2008/01/19}{(AO, 461) Change the csname from \cs{@dotsep} to \cs{ltxu@dotsep}. The former is understood in mu. (What we wanted was a dimension.)}%
% \begin{macrocode}
-\def\toc@@font{}%{\footnotesize\rmfamily}%
-\def\@dotsep{\z@}%{5.5pt}%
+\def\toc@@font{}%
+\def\ltxu@dotsep{\z@}%
% \end{macrocode}
% \end{macro}
%
@@ -3292,31 +3797,18 @@ in your filesystem where they will be found by \LaTeX.
% Interface for determining which TOC elements are automatically indented.
%
% All of the \cmd\l@\dots\ commands simply go through the
-% bottleproc \cmd\l@@sections. The calling convention is
+% utility procedure \cmd\l@@sections. The calling convention is
% to pass the name of self and the name of parent.
% If you want to exclude any of these from the indentation
% scheme, simply leave the \cmd\l@\dots\ command undefined.
%
-% Note that the parent of ``section'' is nil, so we have to
-% define a stub.
-% \begin{verbatim}
-%\def\l@section{%
-% \l@@sections{}{section}% Implicit #3#4
-%}%
-%\def\tocleft@{\z@}%
-%\def\l@subsection{%
-% \l@@sections{section}{subsection}% Implicit #3#4
-%}%
-%\def\l@subsubsection{%
-% \l@@sections{subsection}{subsubsection}% Implicit #3#4
-%}%
-%\def\l@paragraph{%
-% \l@@sections{subsubsection}{paragraph}% Implicit #3#4
-%}%
-%\def\l@subparagraph#1#2{%
-% \l@@sections{paragraph}{subparagraph}% Implicit #3#4
-%}%
-% \end{verbatim}
+% Note that the parent of ``section'' is nil, so we have to define a stub.
+% \begin{verbatim}\def\l@section{\l@@sections{}{section}}% Implicit #3#4\end{verbatim}
+% \begin{verbatim}\def\tocleft@{\z@}%\end{verbatim}
+% \begin{verbatim}\def\l@subsection{\l@@sections{section}{subsection}}% Implicit #3#4\end{verbatim}
+% \begin{verbatim}\def\l@subsubsection{\l@@sections{subsection}{subsubsection}}% Implicit #3#4\end{verbatim}
+% \begin{verbatim}\def\l@paragraph{\l@@sections{subsubsection}{paragraph}}% Implicit #3#4\end{verbatim}
+% \begin{verbatim}\def\l@subparagraph#1#2{\l@@sections{paragraph}{subparagraph}}% Implicit #3#4\end{verbatim}
% \end{macro}
%
% Glom some \cmd\dimen\ registers.
@@ -3411,17 +3903,20 @@ in your filesystem where they will be found by \LaTeX.
% \cmd\tocleft@section, the former being written to the auxiliary file
% and the latter only defined for the duration of the TOC processing.
%
-% Note that the assignment of \cmd\box\cmd\z@\ must endure
-% over the invocation of |#3|.
+% Note that the assignment of \cmd\box\cmd\@tempboxa\ by \cmd\set@tocdim@pagenum\
+% must endure over the invocation of |#3|: it contains the
+% page number which will be set just before the \cmd\par.
+%
+% The arguments:\begin{enumerate}
+% \item[\#1] superior section
+% \item[\#2] this section
+% \item[\#3] content, including possible \cmd\numberline
+% \item[\#4] page number\end{enumerate}
% \begin{macrocode}
\def\l@@sections#1#2#3#4{%
- % #1 - superior section
- % #2 - this section
- % #3 - content, including possible \numberline
- % #4 - page number
\begingroup
\everypar{}%
- \set@tocdim@pagenum{#4}%
+ \set@tocdim@pagenum\@tempboxa{#4}%
\global\@tempdima\csname tocdim@#2\endcsname
\leftskip\csname tocleft@#2\endcsname\relax
\dimen@\csname tocleft@#1\endcsname\relax
@@ -3436,15 +3931,21 @@ in your filesystem where they will be found by \LaTeX.
\expandafter\aftergroup\csname tocdim@#2\endcsname\expandafter
\endgroup\the\@tempdima\relax
}%
-\def\set@tocdim@pagenum#1{%
- \setbox\@tempboxa\hbox{\ignorespaces#1}%
- \@ifdim{\tocdim@pagenum<\wd\z@}{\global\tocdim@pagenum\wd\z@}{}%
+% \end{macrocode}
+% \changes{4.1a}{2008/01/19}{(AO, 479) Per: Dylan Thurston<dpt at math.harvard.edu>}%
+% In the call to \cmd\set@tocdim@pagenum, I am now exposing the
+% use of the particular box register.
+% \begin{macrocode}
+\def\set@tocdim@pagenum#1#2{%
+ \setbox#1\hbox{\ignorespaces#2}%
+ \@ifdim{\tocdim@pagenum<\wd#1}{\global\tocdim@pagenum\wd#1}{}%
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\numberline@@sections}
-% The bottleproc for all \cmd\numberline\ processing in indented TOC entries.
+% \changes{4.1a}{2008/01/19}{(AO, 461) Change the csname from \cs{@dotsep} to \cs{ltxu@dotsep}. The former is understood in mu. (What we wanted was a dimension.)}%
+% The utility procedure for all \cmd\numberline\ processing in indented TOC entries.
% The first argument is self.
%
% We use \cmd\@tempdima\ to pass a value around (via global assignment) because
@@ -3456,7 +3957,7 @@ in your filesystem where they will be found by \LaTeX.
\leavevmode\hb@xt@-\parindent{%
\hfil
\@if@empty{#1}{}{%
- \setbox\z@\hbox{#1.\kern\@dotsep}%
+ \setbox\z@\hbox{#1.\kern\ltxu@dotsep}%
\@ifdim{\@tempdima<\wd\z@}{\global\@tempdima\wd\z@}{}%
\unhbox\z@
}%
@@ -3519,15 +4020,84 @@ in your filesystem where they will be found by \LaTeX.
% \end{macrocode}
% \end{macro}
%
-% \subsection{End of the \file{ltxutil} {\sc docstrip} module}
-% Here ends the module.
+%
+% \subsection{Hypertext capabilities}
+%
+% \begin{macro}{\href}
+% \begin{macro}{\url}
+% \begin{macro}{\URL@prefix}
+% \changes{4.1b}{2008/08/12}{(AO, 487) Support for video figures and the \cs{setfloatlink} command}%
+% We provide support for the \cmd\href\ and \cmd\url\ commands.
+% Packages, like \classname{hyperref}, may override these definitions
+% and provide better semantics.
+% \changes{4.1g}{2009/10/06}{(AO, 532) Both arguments of \cs{href} get sanitized}%
+% \begin{macrocode}
+\providecommand\href[0]{\begingroup\@sanitize\@href}%
+\def\@href#1{\@@startlink{#1}\@@href}%
+\def\@@href#1{\endgroup#1\@@endlink}%
+\providecommand \url [0]{\begingroup\@sanitize \@url }%
+\def \@url #1{\endgroup\@href {#1}{\URL@prefix#1}}%
+\providecommand \URL@prefix [0]{URL }%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@@startlink}
+% \begin{macro}{\@@endlink}
+% \begin{macro}{\pdfstartlink@attr}
+% How we define \cmd\@@startlink\ and \cmd\@@endlink\ will depend on
+% whether we are running under \textsc{pdflatex}.
+% If so, and if PDF output is requested, then we use its primitives
+% to implement hypertext,
+% breaking out the link attributes in \cmd\pdfstartlink@attr\
+% and using the \classname{hyperref} defaults;
+% \cmd\pdfstartlink@attr\ can be redefined by a client package.
+% Otherwise we fall back the Hyper\TeX\ standard and leave things to the DVI translator.
% \begin{macrocode}
-%</ltxutil-krn>
+\@ifxundefined \pdfoutput {\true@sw}{\@ifnum{\z@=\pdfoutput}{\true@sw}{\false@sw}}%
+{%
+ \def\@@startlink#1{\leavevmode\special{html:<a href="#1">}}%
+ \def\@@endlink{\special{html:</a>}}%
+}{%
+ \def\@@startlink#1{%
+ \leavevmode
+ \pdfstartlink\pdfstartlink@attr
+ user{/Subtype/Link/A<</Type/Action/S/URI/URI(#1)>>}%
+ \relax
+ }%
+ \def\@@endlink{\pdfendlink}%
+ \def\pdfstartlink@attr{attr{/Border[0 0 1 ]/H/I/C[0 1 1]}}%
+}%
+\def\typeout@org#1{%
+ \begingroup
+ \set@display@protect
+ \immediate\write\@unused{#1}%
+ \endgroup
+}%
+\long\def\typeout@ltx#1{%
+ \begingroup
+ \set@display@protect
+ \immediate\write\@unused{#1}%
+ \endgroup
+}%
+\@ifx{\typeout\typeout@org}{%
+ \class@info{Making \string\typeout\space \string\long}%
+ \let\typeout\typeout@ltx
+}{}%
% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
+% \subsection{End of the \file{kernel} {\sc docstrip} module}
+% Here ends the module.
+% \begin{macrocode}
+%</kernel>
+% \end{macrocode}
%
% \Finale
-% %Here ends the programmer's documentation.
+% \iffalse Here ends the programmer's documentation.\fi
% \endinput
%
\endinput
diff --git a/Master/texmf-dist/source/latex/revtex/revtex4.dtx b/Master/texmf-dist/source/latex/revtex/revtex4-1.dtx
index 693747ef47f..9d517bf02a5 100644
--- a/Master/texmf-dist/source/latex/revtex/revtex4.dtx
+++ b/Master/texmf-dist/source/latex/revtex/revtex4-1.dtx
@@ -1,103 +1,438 @@
-% \iffalse
-% ****** Start of file revtex4.dtx ****** %
-%
-% This file is part of the APS files in the REVTeX 4 distribution.
-% For version number, search on the string "%FileInfo"
-%
-% First revision by David Carlisle,
-% later versions by Arthur Ogawa.
-%
-% Copyright (c) 2000 The American Physical Society.
+% \iffalse meta-comment balanced on line 122
+% revtex4-1.dtx: package to typeset APS, AIP, OSA, ASA, etc. journal articles
+% Copyright (c) 2009 The American Physical Society.
% http://publish.aps.org/revtex4/
% mailto:revtex@aps.org
-%
-%
-% See the REVTeX 4 README file for restrictions and more information.
-% \fi
-% \iffalse
-%<*driver>
- \ProvidesFile{revtex4.dtx}
-%</driver>
-%<class-pre|aps|rmp>\NeedsTeXFormat{LaTeX2e}[1996/12/01]
-%<class-pre>\ProvidesClass{revtex4}
-%<aps>\ProvidesFile{aps.rtx}
-%<rmp>\ProvidesFile{rmp.rtx}
-%<10pt>\ProvidesFile{10pt.rtx}
-%<11pt>\ProvidesFile{11pt.rtx}
-%<12pt>\ProvidesFile{12pt.rtx}
-%<revsymb&!class-pre>\ProvidesPackage{revsymb}
-%<driver>\ProvidesFile{revtex.drv}
-%<*!class-pst>
- [2001/08/02 v4.0 (http://publish.aps.org/revtex4/ for documentation)]%FileInfo
-%</!class-pst>
-%<*driver>
-\listfiles
-\documentclass{ltxdoc}
-\RequirePackage{ltxdocext}%
-\let\url\undefined
-\RequirePackage[colorlinks=true,linkcolor=blue]{hyperref}%
-\expandafter\ifx\csname package@font\endcsname\relax\else
- \expandafter\expandafter
- \expandafter\RequirePackage
- \expandafter\expandafter
- \expandafter{\csname package@font\endcsname}%
+%
+% 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.3 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 revtex4-1.dtx
+% and the derived files
+% revtex4.cls, revtex4.pdf
+% Distribution:
+% CTAN:macros/latex/contrib/revtex/
+%
+% Unpacking:
+% tex revtex4-1.dtx
+%
+% Documentation:
+% latex revtex4-1.dtx; ...
+%
+% Programm calls to get the documentation (example):
+% pdflatex revtex4-1.dtx
+% makeindex -s gind.ist revtex4-1.idx
+% makeindex -s gglo.ist -o revtex4-1.gls revtex4-1.glo
+% pdflatex revtex4-1.dtx
+% makeindex -s gind.ist revtex4-1.idx
+% pdflatex revtex4-1.dtx
+%
+% Installation:
+% TDS:bibtex/bst/revtex/
+% TDS:doc/latex/revtex/
+% TDS:tex/latex/revtex/
+% TDS:source/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
+%</ignore>
+%<*install>
+%% This file will generate documentation and runtime files
+%% from revtex4-1.dtx when run through TeX.
+\input docstrip
+\preamble
+
+This file is part of the APS files in the REVTeX 4 distribution.
+For the version number, search on the string %FileInfo
+
+Original version by David Carlisle
+Modified by Arthur Ogawa (mailto:arthur_ogawa at sbcglobal dot net)
+
+Copyright (c) 2009 The American Physical Society.
+http://publish.aps.org/revtex4/
+mailto:revtex4@aps.org
+
+See the REVTeX 4 README file for restrictions and more information.
+
+\endpreamble
+\askforoverwritefalse
+\keepsilent
+\generate{%
+ \file{revtex4-1.cls}{%
+ \from{revtex4-1.dtx}{kernel}%
+ \from{ltxutil.dtx}{kernel}%
+ \from{ltxfront.dtx}{kernel}%
+ \from{ltxgrid.dtx}{kernel}%
+ \from{revtex4-1.dtx}{options}%
+ \from{ltxutil.dtx}{options}%
+ \from{ltxfront.dtx}{options}%
+ \from{ltxgrid.dtx}{options}%
+ \from{revtex4-1.dtx}{package}%
+ }%
+ \file{aps4-1.rtx}{\from{revtex4-1.dtx}{aps}}%
+ \file{apsrmp4-1.rtx}{\from{revtex4-1.dtx}{rmp}}%
+ \file{aps10pt4-1.rtx}{\from{revtex4-1.dtx}{10pt}}%
+ \file{aps11pt4-1.rtx}{\from{revtex4-1.dtx}{11pt}}%
+ \file{aps12pt4-1.rtx}{\from{revtex4-1.dtx}{12pt}}%
+ \file{revsymb4-1.sty}{\from{revtex4-1.dtx}{revsymb}}%
+}%
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation, please move}
+\Msg{* *.cls, *.rtx, and *.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 revtex4-1.dtx through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+\endbatchfile
+%</install>
+%<*ignore>
\fi
-\CodelineIndex\EnableCrossrefs
-\begin{document}
-\gdef\lquote{`}\gdef\rquote{'}%
-%{\tracingall\showlists}
-\DocInput{revtex4.dtx}
-\end{document}
-%</driver>
+%</ignore>
% \fi
%
-% \GetFileInfo{revtex4.dtx}\CheckSum{7177}
+% \GetFileInfo{revtex4-1.dtx}\CheckSum{7177}
+%
+% \iffalse ltxdoc klootch
+%<*package>
+%%% @LaTeX-file{
+%%% filename = "revtex4-1.dtx",
+%%% version = "4.1g",
+%%% date = "2009/10/08",
+%%% time = "11:23:00 GMT+8",
+%%% checksum = "7177",
+%%% 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, 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",
+%%% docstring = "The checksum field above generated by ltxdoc",
+%%% }
+%</package>
+% \fi
%
-% \title{The \classname{revtex4} document class of the American Physical Society}
-% \author{Arthur Ogawa%
-% \thanks{First revision by David Carlisle}%
-% }%
-% \date{Version \fileversion, dated \filedate}%
-% \newcommand\revtex{REV\TeX}
+% \iffalse ltxdoc klootch
+% The following references the \file{00readme.tex} file,
+% which contains the frontmatter for the programmer's docs.
+% The contents of this file are generated when
+% you typeset this file with LaTeX.
+% Search on "{filecontents*}{00readme.tex}" to locate it.
+% \fi\input{00readme.tex}%
%
-% \maketitle
+% \subsection{Bill of Materials}
%
-% This file embodies the implementation of the APS \revtex\ 4 document class
-% for electronic submissions to journals.
-%
-% The distribution point for this work is
-% \url{http://publish.aps.org/revtex4/},
-% which contains fully unpacked, prebuilt runtime files and documentation.
+% Following is a list of the files in this distribution arranged
+% according to provenance.
+%
+% \subsubsection{Primary Source}%
+% One single file generates all.
+%\begin{verbatim}
+%revtex4-1.dtx
+%\end{verbatim}
%
-% \tableofcontents
+% \subsubsection{Generated by \texttt{tex revtex4-1.dtx}}%
+% Typesetting ths file under \TeX\ itself runs the installer,
+% which generates the package files.
+%\begin{verbatim}
+%revtex4-1.cls, revtex4.ins, revtex4.drv, aps4-1.rtx,
+%aps10pt4-1.rtx, aps11pt4-1.rtx, aps12pt4-1.rtx, revsymp.sty
+%\end{verbatim}
+%
+% \subsubsection{Generated by \texttt{pdflatex revtex4-1.dtx}}%
+% Typesetting the source file under \LaTeX\
+% generates the documentation.
+%\begin{verbatim}
+%revtex4.pdf,
+%\end{verbatim}
%
-% \section{Using \protect\revtex}
+% \subsubsection{Auxiliary}%
+% The following are auxiliary files generated
+% in the course of running \LaTeX:
+% \begin{verbatim}
+%revtex4.aux revtex4.idx revtex4.ind revtex4.log revtex4.toc
+% \end{verbatim}
+%
+% \section{Code common to all modules}%
%
-% The file \file{README} has retrieval and installation information.
+% The following may look a bit klootchy, but 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|kernel|aps|rmp|revsymb>
+\NeedsTeXFormat{LaTeX2e}[1996/12/01]%
+%</doc|kernel|aps|rmp|revsymb>
+%<kernel>\ProvidesClass{revtex4-1}
+%<aps>\ProvidesFile{aps4-1}
+%<rmp>\ProvidesFile{apsrmp4-1}
+%<10pt>\ProvidesFile{aps10pt4-1}
+%<11pt>\ProvidesFile{aps11pt4-1}
+%<12pt>\ProvidesFile{aps12pt4-1}
+%<revsymb>\ProvidesPackage{revsymb4-1}
+%<*doc>
+\ProvidesFile{revtex4-1.dtx}
+%</doc>
+%<*!package&!options>
+ [2009/10/08:11:23 4.1g (http://publish.aps.org/revtex4/ for documentation)]%FileInfo
+%</!package&!options>
+%<kernel>\let\class@name\@gtempa
+% \end{macrocode}
+%
+% \section{The driver module \texttt{driver}}
+%
+% This module, consisting of the present section,
+% typesets the programmer's documentation,
+% generating the \file{00readme.txt} and sample document as needed.
+%
+% Because the only uncommented-out lines of code at the beginning of
+% this file constitute the \file{driver} module itself,
+% we can simply typeset the \file{.dtx} file directly,
+% and there is thus rarely any need to
+% generate the ``driver'' {\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}
+% The driver uses packages \file{ltxdoc.sty}, \file{ltxdocext.sty},
+% \file{hyperref.sty}, and whatever font package has been selected.
+% \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
+% \end{macrocode}
+% We ask for the usual indices and glossaries.
+% \begin{macrocode}
+\CodelineIndex\EnableCrossrefs % makeindex -s gind.ist revtex4
+\RecordChanges % makeindex -s gglo.ist -o revtex4.gls revtex4.glo
+% \end{macrocode}
%
-% User documentation is presented separately in \file{revguide.tex}.
+% \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}
%
-% The file \file{template.aps} is a boilerplate file.
+% \subsection{The Frontmatter File}
+% As promised above, here is the contents of the frontmatter file.
+% \begin{macrocode}
+\begin{filecontents*}{00readme.tex}
+\title{%
+ The \classname{revtex4-1} document class of the American Physical Society%
+ \protect\thanks{Work under hire to The American Physical Society.}%
+}%
+\author{Arthur Ogawa%
+ \protect\thanks{First revision of REV\TeX4.0 (unreleased) by David Carlisle}%
+}%
+\date{Version \fileversion, dated \filedate}%
+\newcommand\revtex{REV\TeX}
+
+\maketitle
+
+This file embodies the implementation of the APS \revtex\ 4.1 document class
+for electronic submissions to journals.
+
+The distribution point for this work is
+\url{http://publish.aps.org/revtex4/},
+which contains fully unpacked, prebuilt runtime files and documentation.
+
+\tableofcontents
+
+\section{Using \protect\revtex}
+
+The file \file{README} has retrieval and installation information.
+
+User documentation is presented separately in \file{auguide.tex}.
+
+The file \file{template.aps} is a boilerplate file.
+
+\changes{4.0a}{1998/01/16}{Initial version}
+\changes{4.0a}{1998/01/31}{Move after process options, so \cs{clearpage} not in scope of twocolumn}
+\changes{4.0a}{1998/01/31}{Rearrange the ordering so numerical ones come first. AO: David, what does this mean?}
+\changes{4.0a}{1998/01/31}{use font-dependent spacing}
+\changes{4.0a}{1998/01/31}{4.0d had twoside option setting twoside switch to false}
+\changes{4.0a}{1998/01/31}{Move after process options, so the following test works}
+\changes{4.0a}{1998/01/31}{print homepage}
+\changes{4.0a}{1998/01/31}{protect against hyperref revtex kludges which are not needed now}
+\changes{4.0a}{1998/06/10}{multiple preprint commands}
+\changes{4.0a}{1998/06/10}{comma not space between email and homepage}
+\changes{4.0a}{1998/06/10}{single space footnotes}
+\changes{4.0b}{1999/06/20}{First modifications by Arthur Ogawa (mailto:arthur\_ogawa at sbcglobal dot net)}
+\changes{4.0b}{1999/06/20}{Added localization of \cs{figuresname}}
+\changes{4.0b}{1999/06/20}{Added localization of \cs{tablesname}}
+\changes{4.0b}{1999/06/20}{AO: all code for \protect\classoption{10pt} is in this module.}
+\changes{4.0b}{1999/06/20}{AO: all code for \protect\classoption{11pt} is in this module.}
+\changes{4.0b}{1999/06/20}{AO: all code for \protect\classoption{12pt} is in this module.}
+\changes{4.0b}{1999/06/20}{AO: made aps.rtx part of revtex4.dtx}
+\changes{4.0b}{1999/06/20}{AO: remove duplicates}
+\changes{4.0b}{1999/06/20}{call \cs{print@floats}}
+\changes{4.0b}{1999/06/20}{Defer assignment until \cs{AtBeginDocument} time.}
+\changes{4.0b}{1999/06/20}{Defer decision until \cs{AtBeginDocument} time}
+\changes{4.0b}{1999/06/20}{Define three separate environments, defer assignment to \cs{AtBeginDocument} time.}
+\changes{4.0b}{1999/06/20}{Frank Mittelbach, has stated in \protect\classname{multicol}: ``The kernel command \cs{@footnotetext} should not be modified.'' Thus, I have removed David Carlisle's redefinition of that command. Note, however, that later versions of \protect\classname{multicol} do not require this workaround. Belt and suspenders.}%
+\changes{4.0b}{1999/06/20}{Move this ``complex'' option to the front, where it can be overridden by ``simple'' options.}
+\changes{4.0b}{1999/06/20}{New option}
+\changes{4.0b}{1999/06/20}{One-line caption sets flush left.}
+\changes{4.0b}{1999/06/20}{only execute if appropriate}
+\changes{4.0b}{1999/06/20}{Processing delayed to \cs{AtBeginDocument} time}
+\changes{4.0b}{1999/06/20}{Removed invocation of nonexistent class option \protect\classoption{groupauthors} and all other class options that should only be invoked by the document. (Otherwise precedence of class options does not work.)}
+\changes{4.0b}{1999/06/20}{Restore all media size class option of \protect\file{classes.dtx}}
+\changes{4.0b}{1999/06/20}{Stack \cs{preprint} args flush right at right margin.}
+\changes{4.0c}{1999/11/13}{(AO, 115) If three or more preprints specified, set on single line, with commas.}
+\changes{4.0c}{1999/11/13}{(AO, 129) section* within appendix was producing appendixname}
+\changes{4.0c}{1999/11/13}{*-form mandates pagebreak}
+\changes{4.0c}{1999/11/13}{also spelled ``acknowledgements''.}
+\changes{4.0c}{1999/11/13}{Do not put by REVTeX in every page foot}
+\changes{4.0c}{1999/11/13}{grid changes via ltxgrid procedures}
+\changes{4.0c}{1999/11/13}{grid changes with ltxgrid}
+\changes{4.0c}{1999/11/13}{Insert procedure \cs{checkindate}}
+\changes{4.0c}{1999/11/13}{Lose compatability mode.}
+\changes{4.0c}{1999/11/13}{New ltxgrid-based code, other bug fixes}
+\changes{4.0c}{1999/11/13}{New option ``checkin''}
+\changes{4.0c}{1999/11/13}{Prevent an inner footnote from performing twice}
+\changes{4.0d}{2000/04/10}{Also alter how lists get indented.}
+\changes{4.0d}{2000/04/10}{eprint takes an optional argument, syntactical only in this case.}
+\changes{4.0d}{2000/04/10}{New option}
+\changes{4.0d}{2000/05/10}{More features and bug fixes: compatability with longtable and array packages. Now certainly incompatible with multicol.}
+\changes{4.0d}{2000/05/17}{make longtable trigger the head, too}
+\changes{4.0d}{2000/05/18}{But alternative spelling is deprecated.}
+\changes{4.0e}{2000/09/20}{New option showkeys}
+\changes{4.0e}{2000/11/14}{Bug fixes and minor new features: title block affiliations can have ancillary data, just like authors; clearpage processing revamped, with floats staying in order; widetext ornaments.}
+\changes{4.0e}{2000/11/21}{adornments above and below.}
+\changes{4.0f}{2001/02/13}{Last bug fixes before release.}
+\changes{4.0rc1}{2001/06/17}{Running headers always as if two-sided}
+\changes{4.0rc1}{2001/06/18}{grid changes with push and pop}
+\changes{4.0rc1}{2001/06/18}{grid changes with push and pop}
+\changes{4.0rc4}{2001/07/23}{hyperref is no longer loaded via class option: use a usepackage statement instead}
+\changes{4.1a}{2008/01/18}{(AO, 457) Endnotes to be sorted in with numerical citations.}%
+\changes{4.1a}{2008/01/18}{(AO, 451) ``Cannot have more than 256 cites in a document''}%
+\changes{4.1a}{2008/01/18}{(AO, 457) Endnotes to be sorted in with numerical citations.}%
+\changes{4.1a}{2008/01/18}{(AO, 460) ``Proper style is "FIG. 1. ..." (no colon)''}%
+\changes{4.1a}{2008/01/18}{(AO, 478) \cs{ds@letterpaper}, so that ``letterpaper really is the default''}%
+\changes{4.1a}{2008/01/18}{(AO, 488) Change processing of options to allow an unused option to specify society and journal}%
+\changes{4.1a}{2008/01/19}{(AO, 461) Change the csname revtex uses from @dotsep to ltxu@dotsep. The former is understood in mu. (What we wanted was a dimension.)}%
+\changes{4.1a}{2008/01/19}{For natbib versions before 8.21, \cs{NAT@sort} was consulted only as natbib was being read in. Now it is fully dynamic.}
+\changes{4.1b}{2008/05/29}{The csname substyle@ext is now defined without a dot (.), to be compatible with \LaTeX usage (see @clsextension and @pkgextension).}
+\changes{4.1b}{2008/06/01}{(AO) Implement bibnotes through \cs{frontmatter@footnote@produce} instead of \cs{bibnotes@sw}}%
+\changes{4.1b}{2008/06/01}{Add option reprint, opposite of preprint, and preferred alternative to twocolumn}
+\changes{4.1b}{2008/06/29}{(AO, 455) Be nice to a list within the abstract (assign \cs{@totalleftmargin}).}
+\changes{4.1b}{2008/06/30}{(AO) Structure the Abstract using the \texttt{bibliography} environment}
+\changes{4.1b}{2008/07/01}{(AO) coordinate \cs{if@twoside} with \cs{twoside@sw}}
+\changes{4.1b}{2008/07/01}{(AO) make settings at class time instead of deferring them to later.}
+\changes{4.1b}{2008/07/01}{(AO) No longer need to test \cs{chapter} as of \texttt{natbib} version 8.2}
+\changes{4.1b}{2008/07/01}{(AO) No longer use \cs{secnumarabic@sw}, instead use \cs{setup@secnums}}
+\changes{4.1b}{2008/07/01}{(AO) Provide more diagnostics when \cs{@society} is assigned.}
+\changes{4.1b}{2008/07/01}{(AO) provide option longbibliography}
+\changes{4.1b}{2008/07/01}{Add \cs{@hangfroms@section}}
+\changes{4.1b}{2008/07/01}{Break out \cs{@caption@fignum@sep}}
+\changes{4.1b}{2008/07/01}{Class option galley sets \cs{preprintsty@sw} to false}
+\changes{4.1b}{2008/07/01}{Code relating to new syntax for frontmatter has been placed in \file{ltxfront.dtx}}
+\changes{4.1b}{2008/07/01}{Package textcase is now simply a required package}
+\changes{4.1b}{2008/07/01}{Procedures \cs{@parse@class@options@society} and \cs{@parse@class@options@journal} and friends}
+\changes{4.1b}{2008/07/01}{Read in all required packages together}
+\changes{4.1b}{2008/07/01}{Remove options newabstract and oldabstract}
+\changes{4.1b}{2008/08/01}{Section numbering via procedures \cs{secnums@rtx} and \cs{secnums@arabic}.}
+\changes{4.1b}{2008/08/04}{As with author formatting, rag the right more, and assign \cs{@totalleftmargin}. Also neutralize \cs{def@after@address}.}%
+\changes{4.1b}{2008/08/04}{Rag the right even more: .8\cs{hsize}. Also, assign \cs{@totalleftmargin}.}%
+\changes{4.1b}{2008/08/04}{The \texttt{rmp} journal substyle selects \texttt{groupedaddress} by default.}%
+\changes{4.1b}{2008/08/04}{Use \cs{setup@hook} to initialize all.}
+\changes{4.1c}{2008/08/15}{Document class option longbibliography via \cs{substyle@post}}
+\changes{4.1d}{2009/03/27}{Definition of \cs{ @fnsymbol} follows fixltx2e.sty}
+\changes{4.1e}{2008/06/29}{(AO, 455) be nice to a list within the abstract}
+\changes{4.1f}{2009/07/07}{(AO, 513) Add class option linenumbers: number the lines a la \filename{lineno.sty}}
+\changes{4.1f}{2009/07/07}{(AO, 516) Merged references are separated with a semicolon}
+\changes{4.1f}{2009/07/10}{(AO, 520) Automatically produce \cs{bibliography} command when needed}%
+\changes{4.1f}{2009/07/11}{(AO, 521) Lonely bibliography head}%
+\changes{4.1f}{2009/07/11}{(AO, 522) Warn if software is expired}%
+\changes{4.1f}{2009/07/15}{(AO, 523) Add class option nomerge, to turn off new natbib 8.3 syntax}
+\changes{4.1f}{2009/07/20}{(AO, 524) Makes no sense if citations are superscript numbers and so are footnotes}
+\changes{4.1f}{2009/10/05}{(AO, 530) \cs{@fnsymbol}: Failed to import fixltx2e.sty technology. Return to LaTeX core.}
+\changes{4.1g}{2009/10/07}{(AO, 525) Remove phantom paragraph above display math that is given in vertical mode}%
+\changes{4.1g}{2009/10/07}{(AO, 538) \cs{MakeTextUppercase} inappropriately expands the double backslash}
+\changes{4.1h}{2009/10/09}{(AO) Remove expiry code in the release software}%
+
+\end{filecontents*}
+% \end{macrocode}
%
-% \StopEventually{}
+% \subsection{The Document Body}
%
-% \changes{v4.a}{1998/01/16}
-% {Initial version}
-% \changes{v4.0beta 2}{1999/06/20}
-% {First modifications by Arthur Ogawa (mailto:ogawa@teleport.com)}
-% \changes{v4.0beta 3}{1999/11/13}
-% {New ltxgrid-based code, other bug fixes}
-% \changes{v4.0beta 4}{2000/05/10}
-% {More features and bug fixes: compatability with longtable and array packages.
-% Now certainly incompatible with multicol.}
-% \changes{v4.0beta 5}{2000/11/14}
-% {Bug fixes and minor new features: title block affiliations can have ancillary data, just like authors;
-% clearpage processing revamped, with floats staying in order; widetext ornaments.}
-% \changes{v4.0beta 6}{2001/02/13}
-% {Last bug fixes before release.}
+% 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}%
+\PrintChanges
+\end{document}
+% \end{macrocode}
+% And that is the end of the driver for the programmer's documentation.
+% \begin{macrocode}
+%</doc>
+% \end{macrocode}
%
% \section{Overview}%
-% \revtex\ is a \LaTeXe\ document class, aomewhat like a hybrid of
+% \revtex\ is a \LaTeXe\ document class, somewhat like a hybrid of
% the standard \LaTeX\ \classname{book} and \classname{article} classes.
%
% Certain packages are (should be) loaded by this class in any case:
@@ -116,7 +451,7 @@
% Certain other packages are to be loaded by the
% document through explicit use of \cmd\usepackage.
% Some mentioned in the user documentation are
-% \classname{graphicx}, \classname{longtable},
+% \classname{graphicx}, \classname{longtable}, \classname{hyperref},
% and \classname{bm}.
%
% Certain commonly used packages are known to be incompatible with
@@ -132,30 +467,43 @@
% document class to address multiple societies.
% It also implements a sub-substyle, giving the
% journal of the given society.
-% The only society currently implemented is \classoption{aps},
-% however, code is in place for another society, the \classoption{osa}.
+% Any society may create a substyle;
+% this file generates one for \classoption{aps}.
%
-% FIXME: should always load the \classname{graphicx} package.
+% FIXME: should always load the \classname{graphicx} package. No, allow user to load whichever graphics package is desired.
%
% QUERY: since \classname{amsfonts} and \classname{amssymb} extend
% syntax, why not load them in any case?
%
-% QUERY: if you say \cmd\documentclass|[prb,osa]{revtex4}|, then
-% the value of \cmd\@society\ will be wrong, or? Fixed.
-%
-% Certain events occur at \cmd\AtEndOfClass\ time:
+% Certain processing occurs at the endgame for reading in \revtex, thereby establishing
+% precedence for assignments to \LaTeX's (and \revtex's) parameters:
% \begin{enumerate}
% \item
-% Optionally read in packages
-% \classname{amsfonts}, \classname{amssymb}.
+% Figure out which society is operative and read in the indicated \file{.rtx} file.
+% \item
+% Figure out which journal option is operative and execute the indicated journal command. This may lead to reading in a journal substyle \file{.rtx} file.
+% \item
+% Figure out which pointsize is operative and execute the indicateded pointsize command. This may lead to reading in a pointsize \file{.rtx} file.
% \item
-% Read in society substyle \file{.rtx} file.
+% Execute all of the document's options, in the order declared within the document.
% \item
-% Read in type size \file{.rtx} file.
+% Read in all required packages (like \classname{natbib}, \classname{amsfonts}, \classname{amssymb}), that were determined by class, society, and journal.
% \item
-% Read in the job's style file, the \file{.rty} file.
+% The last required package, if existing, is the document's style file, the \file{.rty} file.
+% Note that the \file{.rty} file can override the assignments of \revtex, society, journal, and required packages, and even load its own packages.
+% It can also, via appendations to \cmd\setup@hook, override the setup code itself.
% \item
-% Define things based on \cmd\secnumarabic@sw.
+% Execute all of the setup code accumulated. Such code can be queued by \revtex\ itself, by the society, by the journal, or by the pointsize.
+% \item
+% At this point, \revtex\ has completed the process of inputting itself,
+% and \LaTeX\ will now execute the \cmd\AtEndOfClass\ procedures.
+% \end{enumerate}
+%
+% \revtex\ will have enqueued code to execute at \cmd\AtBeginDocument\ time,
+% in two different queues.
+% \cmd\document@inithook\ executes immediately upon encountering the \cmd\begin\env{document} statement,
+% \cmd\class@documenthook\ at the end of all the code enqueued via \cmd\AtBeginDocument.
+% \begin{enumerate}
% \item
% Install procedures to execute at the very end of the class's
% \cmd\AtBeginDocument\ processing, such as
@@ -205,67 +553,6 @@
% (\classname{natbib}) prepare to read in the \file{.aux} file.
% \end{enumerate}
%
-%
-% \section{The installer file}
-% We include here a reference copy of the installer file, \file{revtex4.ins}.
-% It is not intended that one actually generate that file using \file{docstrip}
-% via the revtex4 installer file, because that would involve overwriting the
-% file that \TeX\ is typesetting. Instead, the installer file is provided
-% pre-generated.
-%
-% For the most part, the installer is simple: it generates \file{revtex4.cls} and
-% a collection of \file{.rtx} files from \file{revtex4.dtx}.
-%
-% However, the process of generating \file{revtex4.cls} involves the incorporation
-% of portions of two of the \file{ltx} series of files, \file{ltxutil.dtx},
-% and \file{ltxgrid.dtx}. The former is a collection of macro definitions that
-% serve as the lowest level of extensions to \LaTeX, the latter implements
-% an alternative output routine and page gridding mechanism that provides for
-% multicolumn page layouts, but without the sorry limitations of the
-% \LaTeX\ required package, \classname{multicol}, and is also compatible with
-% the \classname{longtable} package (which \classname{multicol} is not).
-% \begin{macrocode}
-%<*ins>
-% This file requires docstrip version 2.4 or higher available from
-% ftp://ctan.tug.org/tex-archive/macros/latex/unpacked/docstrip.tex
-\input docstrip
-\preamble
-
-This file is part of the APS files in the REVTeX 4 distribution.
-For the version number, search on the string %FileInfo
-
-Copyright (c) 2000 The American Physical Society.
-http://publish.aps.org/revtex4/
-mailto:revtex@aps.org
-
-Maintained by Arthur Ogawa (mailto:ogawa@teleport.com)
-under contract to the American Physical Society.
-
-See the REVTeX 4 README file for restrictions and more information.
-
-\endpreamble
-\keepsilent
-\askforoverwritefalse
-\generate{%
- \file{revtex4.cls}{%
- \from{revtex4.dtx}{class-pre}%
- \from{ltxutil.dtx}{ltxutil-krn}%
- \from{ltxgrid.dtx}{ltxgrid-krn}%
- \from{textcase.dtx}{package}%
- \from{revtex4.dtx}{class-pst}%
- }%
- \file{aps.rtx}{\from{revtex4.dtx}{aps}}%
- \file{rmp.rtx}{\from{revtex4.dtx}{rmp}}%
- \file{10pt.rtx}{\from{revtex4.dtx}{10pt}}%
- \file{11pt.rtx}{\from{revtex4.dtx}{11pt}}%
- \file{12pt.rtx}{\from{revtex4.dtx}{12pt}}%
- \file{revsymb.sty}{\from{revtex4.dtx}{revsymb}}%
-}%
-\endbatchfile
-%</ins>
-% \end{macrocode}
-%
-%
% \section{Writing journal-specifc extensions to \revtex}
%
% With this version of \revtex, we introduce a somewhat different
@@ -298,33 +585,33 @@ See the REVTeX 4 README file for restrictions and more information.
% to \revtex.
%
% \section{The \classname{revtex4} Document Class}
-%
+% Above, we took
+% advantage of 1) the \LaTeX\ definition of \cmd\ProvidesPackage\ and
+% 2) that the line of code immediately afterwards follows the \cmd\ProvidesClass\ statement above.
% \begin{macrocode}
-%<*class-pre>
-\def\class@name{revtex4}%
+%<*kernel>
% \end{macrocode}
%
% Print a banner in the log:
% \begin{macrocode}
\GenericInfo{}{\space
- Copyright (c) 2001 The American Physical Society.^^J
+ Copyright (c) 2009 The American Physical Society.^^J
mailto:revtex@aps.org^^J
Licensed under the LPPL:^^Jhttp://www.ctan.org/tex-archive/macros/latex/base/lppl.txt^^J
- Arthur Ogawa <ogawa@teleport.com>^^J
- Based on work by David Carlisle <david@dcarlisle.demon.co.uk>%
+ Arthur Ogawa <arthur_ogawa at sbcglobal dot net>^^J
+ Based on work by David Carlisle <david at dcarlisle.demon.co.uk>%
\@gobble
}%
% \end{macrocode}
%
-% \subsection{Compatability Processing}
+% \subsection{Compatibility Processing}
%
% If the document has \cmd\documentstyle|{revtex4}|,
% then, instead of attempting to run in compatability mode,
% just complain and exit.
-% \changes{v4.0beta 3}{1999/11/13}
-% {Lose compatability mode.}
+% \changes{4.0c}{1999/11/13}{Lose compatability mode.}
% \begin{macrocode}
-\if@compatibility
+\if@compatibility
\edef\reserved@a{\errhelp{%
Change your \string\documentstyle\space statement to
\string\documentclass\space and rerun.
@@ -336,92 +623,112 @@ See the REVTeX 4 README file for restrictions and more information.
%
%
% \section{Extensions to the \LaTeX\ Kernel}
-% I am introducing
-% some portions of the \classname{ltxkrnext} package
-% (\url{ftp://ftp.teleport.com/users/ogawa/macros/latex/contrib/supported/ltxkrnext/}).
%
-% First, de-fang unwanted commands and turn \cmd\ProvidesPackage\ into an informative message.
% \begin{macrocode}
-\let\DeclareOption@latex\DeclareOption
-\let\DeclareOption\@gobbletwo
-\let\ProcessOptions@latex\ProcessOptions
-\let\ProcessOptions\@empty
-\let\ProvidesPackage@latex\ProvidesPackage
-\def\ProvidesPackage#1[#2]{%
- \class@info{Incorporating package #1 [#2].}%
-}%
-%</class-pre>
+%</kernel>
% \end{macrocode}
-% Now load the utility and page grid packages.
-% The \classname{ltxutil} and \classname{ltxgrid} packages are distributed with
+%
+% Here, we incorporate the utility, frontmatter, and page grid packages.
+% The \classname{ltxutil}, \classname{ltxfront}, and \classname{ltxgrid} source are distributed with
% \revtex.
+%
+% Here begins the \file{options} \textsc{docstrip} module.
% \begin{macrocode}
-%\RequirePackage{ltxutil}%
-%\RequirePackage{ltxgrid}%
+%<*options>
% \end{macrocode}
%
-% The \classname{textcase} package is available from
-% \url{CTAN:/macros/latex/contrib/supported/carlisle/textcase.dtx} and is
-% used at the suggestion, and by permission, of David~P. Carlisle.
-% \begin{quotation}
-% \cmd\ProvidesFile{textcase.dtx}
-% [1998/11/12 v0.06 Text only upper/lower case changing (DPC)]
-% \end{quotation}
+% \subsection{Hooks}
%
-% David, in turn, suggests that Donald Arseneau be credited for some of the ideas in
-% the \classname{textcase} package, so let it hereby be so understood.
+% \begin{macro}{\setup@hook}
+% The procedure
+% \cmd\setup@hook\
+% serves as the vehicle for all code that
+% gives values to the class's parameters once all the
+% society, journal, options, and packages have been processed.
%
-% Note that David's package has a bug, which is fixed as follows:
-% Change:
-%\begin{verbatim}
-% \def\NoCaseChange##1{\noexpand\NoCaseChange{\noexpand##1}}
-%\end{verbatim}
-% To:
-%\begin{verbatim}
-% \def\NoCaseChange##1{\noexpand\NoCaseChange{\noexpand##1}}%
-%\end{verbatim}
-%
-% \begin{macrocode}
-%\RequirePackage{textcase}%
-% \end{macrocode}
-%
-% Next, restore those cammands we de-fanged:
+% Arrange for journal substyles to set their own default values.
% \begin{macrocode}
-%<*class-pst>
-\let\ProvidesPackage\ProvidesPackage@latex
-\let\ProcessOptions\ProcessOptions@latex
-\let\DeclareOption\DeclareOption@latex
-% \end{macrocode}
-% And let the \classname{textcase} commands override those of \LaTeX:
-% \begin{macrocode}
-\expandafter
-\let\csname MakeUppercase \expandafter\endcsname
- \csname MakeTextUppercase \endcsname
-\expandafter
-\let\csname MakeLowercase \expandafter\endcsname
- \csname MakeTextLowercase \endcsname
+\let\setup@hook\@empty
% \end{macrocode}
+% \end{macro}
%
-% Try to patch \classname{longtable}.
+% After preamble processing is complete,
+% detect whether package \classname{longtable} has been loaded and patch it.
% \begin{macrocode}
-\appdef\class@documenthook{%
+\appdef\document@inithook{%
\switch@longtable
+ \let\LT@makecaption\LT@makecaption@rtx
+}%
+% \end{macrocode}
+%
+% \begin{macro}{\LT@makecaption}
+% We override the caption processing method of the \classname{longtable} package:
+% space below the caption is created via strut instead of whitespace.
+% \begin{macrocode}
+\def\LT@makecaption@rtx#1#2#3{%
+ \LT@mcol\LT@cols c{%
+ \hbox to\z@{%
+ \hss
+ \parbox[t]\LTcapwidth{%
+ \sbox\@tempboxa{#1{#2: }#3\unskip\nobreak\vrule\@width\z@\@height\z@\@depth .5\baselineskip}%
+ \ifdim\wd\@tempboxa>\hsize
+ #1{#2: }#3\unskip\nobreak\vrule\@width\z@\@height\z@\@depth .5\baselineskip
+ \else
+ \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \endgraf
+ }%
+ \hss
+ }%
+ }%
}%
% \end{macrocode}
+% \end{macro}
%
-% Try to provide a more robust version of \cmd\boldmath.
-% If Team \LaTeX\ ever gets around to fixing this problem, we will bow out.
-% (This relates to bug \#394.)
+% \begin{macro}{\robust@boldmath}
+% Robustify the \cmd\boldmath command.
+% If Team \LaTeX\ (or any package) ever gets around to fixing this problem,
+% we will bow out. (This fix relates to bug \#394.)
% \begin{macrocode}
-\appdef\class@documenthook{%
+\def\protectdef@boldmath{%
\expandafter\@ifnotrelax\csname boldmath \endcsname{}{%
+ \class@info{Robustifying \string\LaTeX's \string\boldmath\space command}%
\expandafter\let\csname boldmath \endcsname\boldmath
\expandafter\def\expandafter\boldmath\expandafter{\expandafter\protect\csname boldmath \endcsname}%
}%
}%
+\appdef\document@inithook{%
+ \protectdef@boldmath
+}%
% \end{macrocode}
+% \end{macro}
%
+% \section{Compatability with the geometry package}
%
+% The \classname{geometry} package of Hideo Umeki provides a way to
+% specify the metrics of the media and page layout.
+% We want to ensure that \revtex\ does not foreclose on the use of
+% this or any other such package, nor to interfere with
+% explicit assignments of such metric parameters within the
+% document preamble.
+%
+% The \LaTeX\ parameters (resp. \TeX\ primitives) set by \classname{geometry} are:
+% \cmd\paperwidth, \cmd\paperheight,
+% \cmd\textwidth, \cmd\textheight,
+% \cmd\topmargin, \cmd\headheight, \cmd\headsep,
+% \cmd\footskip, \cmd\skip\cmd\footins,
+% \cmd\marginparwidth, \cmd\marginparsep,
+% \cmd\oddsidemargin, \cmd\evensidemargin,
+% \cmd\columnsep,
+% \cmd\hoffset, \cmd\voffset, \cmd\mag,
+% \cmd\if@twocolumn, \cmd\if@twoside, \cmd\if@mparswitch, \cmd\if@reversemargin,
+%
+% \revtex's assignments can be overridden by
+% any package or other statement in the document preamble,
+% so it should be compatible.
+%
+%FIXME: one parameter is rendered semantically void (by \file{ltxgrid.dtx}):
+% \cmd\if@twocolumn.
%
% \section{Options}\label{sec:options}%
%
@@ -429,223 +736,7 @@ See the REVTeX 4 README file for restrictions and more information.
% The following Booleans are used within the document class to
% allow the document or the substyle to make selections
% of formatting.
-% Because an explicit document class option always overrides a substyle,
-% any substyle wishing to assign a value to a flag must first test the flag to
-% confirm that it is still undefined.
-% This further means that the default value of the flag must be
-% assigned late, at the end of \cmd\AtBeginDocument\ time, and that
-% the flag may be queried no earlier than that time.
-%
-% \begin{macro}{\class@inithook}
-% The hook \cmd\class@inithook\ is installed into \cmd\class@documenthook,
-% and thereafter serves as the focal point for all code that
-% gives default values to the class's parameters.
-%
-% A typical code might be:
-% \begin{verbatim}
-%\appdef\class@inithook{%
-% \@ifxundefined\twocolumn@sw{\@booleanfalse\twocolumn@sw}{}%
-%}%
-% \end{verbatim}
-% which ensures that the switch \cmd\twocolumn@sw\ is never left undefined.
-%
-% \begin{macrocode}
-\appdef\class@documenthook{%
- \class@inithook
-}%
-\def\class@inithook{}%
-%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\twocolumn@sw}
-% The boolean \cmd\twocolumn@sw\ signifies that we are to use a two-column grid.
-%
-% \begin{macrocode}
-\appdef\class@inithook{%
- \@ifxundefined\twocolumn@sw{\@booleanfalse\twocolumn@sw}{}%
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\footinbib@sw}
-% The boolean \cmd\footinbib@sw\ signifies that
-% footnotes are to be set in the bibliography, as endnotes.
-% \begin{macrocode}
-\appdef\class@inithook{%
- \@ifxundefined\footinbib@sw{\@booleanfalse\footinbib@sw}{}%
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\preprintsty@sw}
-% The boolean \cmd\preprintsty@sw\ signifies that
-% the document is to be formatted in preprint style.
-% \begin{macrocode}
-\appdef\class@inithook{%
- \@ifxundefined\preprintsty@sw{\@booleanfalse\preprintsty@sw}{}%
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\preprint@sw}
-% The boolean \cmd\preprint@sw\ signifies that
-% the preprints (cf. \cmd\preprint) are to be formatted (usually on the title page).
-% The default is to do so; the option \classoption{nopreprintnumbers}
-% declares not to.
-% \begin{macrocode}
-\appdef\class@inithook{%
- \@ifxundefined\preprint@sw{\@booleanfalse\preprint@sw}{}%
- \preprintsty@sw{\@booleantrue\preprint@sw}{}%
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\galley@sw}
-% The boolean \cmd\galley@sw\ signifies that
-% the document is to be formatted in galley style.
-%
-% Asserting both \cmd\galley@sw\ and \cmd\preprintsty@sw\
-% may produce strange formatting results, but it is not illegal.
-% However, it \emph{is} illegal to assert galley and any
-% twocolumn option.
-% \begin{macrocode}
-\appdef\class@inithook{%
- \@ifxundefined\galley@sw{\@booleanfalse\galley@sw}{}%
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\groupauthors@sw}
-% The flag \cmd\groupauthors@sw\ signifies that authors are to be grouped.
-% This affects the meaning of \cmd\@author@present\ and \cmd\@tempaffil.
-%
-% FIXME: apparently \cmd\@tempaffil\ and its aliases are never used.
-% \end{macro}
-%
-% \begin{macro}{\runinaddress@sw}
-% The flag \cmd\runinaddress@sw\ signifies that author addresses are to be
-% run in.
-% \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 amalgamated
-% into the same list:
-% the address will be printed the same number of times it is entered.
-% \end{macro}
-%
-% \begin{macro}{\showPACS@sw}
-% \begin{macro}{\showKEYS@sw}
-% If \cmd\showPACS@sw\ is true, print the PACS information in the title block,
-% otherwise not.
-% Similarly for \cmd\showKEYS@sw\ and the keywords.
-% \begin{macrocode}
-\appdef\class@inithook{%
- \@ifxundefined\showPACS@sw{\@booleanfalse\showPACS@sw}{}%
- \@ifxundefined\showKEYS@sw{\@booleanfalse\showKEYS@sw}{}%
-}%
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\floats@sw}
-% The Boolean \cmd\floats@sw\ signifies that floats are to be floated;
-% if false, that floats are to be deferred to the end of the document.
-% By default, the former.
-% Note that the state of this Boolean is to be changed by
-% the document class in response to user-selected options.
-%
-% This boolean and the assignment of its default value is done by
-% the \classname{ltxutil} package.
-% \end{macro}
-%
-% \begin{macro}{\floatp@sw}
-% The Boolean \cmd\floatp@sw\ signifies that endfloats are to be set one per page;
-% if false, that endfloats are to be set with multiple floats per page permitted.
-% By default, the latter.
-% Note that the state of this Boolean is to be changed by
-% the document class in response to user-selected options.
-% The default is established here.
-% \end{macro}
-%
-% \begin{macro}{\twoside@sw}
-% The flag \cmd\twoside@sw\ signifies that the document is to be
-% formatted for duplex printing.
-% At \cmd\AtBeginDocument\ time, we must align the value
-% of the kernel \cmd\newif\ switch \cmd\if@twoside\
-% to that of \cmd\twoside@sw.
-% \begin{macrocode}
-\appdef\class@inithook{%
- \@ifxundefined\twoside@sw{\@booleanfalse\twoside@sw}{}%
- \twoside@sw{\@twosidetrue}{\@twosidefalse}%
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\draft@sw}
-% The flag \cmd\draft@sw\ signifies that the document is to be
-% formatted in draft mode.
-% Certain packages may pay attention to the
-% class option \classoption{draft} that sets this Boolean.
-% \begin{macrocode}
-\appdef\class@inithook{%
- \@ifxundefined\draft@sw{\@booleanfalse\draft@sw}{}%
- \draft@sw{\overfullrule 5\p@}{\overfullrule\z@}%
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\tightenlines@sw}
-% The boolean \cmd\tightenlines@sw\ signifies that
-% the leading is to be made standard amount.
-% If false, it means that the leading is to be set extra open.
-% Has no effect on 10pt size option.
-% \begin{macrocode}
-\appdef\class@inithook{%
- \@ifxundefined\tightenlines@sw{\@booleanfalse\tightenlines@sw}{}%
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\lengthcheck@sw}
-% The flag \cmd\lengthcheck@sw\ signifies that
-% the length checking is in effect.
-% It is up to the individual journal substyle
-% to alter its formatting accordingly.
-% \begin{macrocode}
-\appdef\class@inithook{%
- \@ifxundefined\lengthcheck@sw{\@booleanfalse\lengthcheck@sw}{}%
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\eqsecnum@sw}
-% The flag \cmd\eqsecnum@sw\ signifies that equations are to be
-% numbered with the section, e.g., ``Eq. (2.13)''.
-% This flag is neither set nor queried.
-% \begin{macrocode}
-\appdef\class@inithook{%
- \@ifxundefined\eqsecnum@sw{\@booleanfalse\eqsecnum@sw}{}%
- \eqsecnum@sw{%
- \@addtoreset{equation}{section}%
- \def\theequation@prefix{\arabic{section}.}%
- }{}%
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\byrevtex@sw}
-% The flag \cmd\byrevtex@sw\ signifies that the document should
-% bear an imprint to the effect that it was formatted by this document class.
-% \begin{macrocode}
-\appdef\class@inithook{%
- \@ifxundefined\byrevtex@sw{\@booleanfalse\byrevtex@sw}{}%
-}%
-% \end{macrocode}
-% \end{macro}
-%
+% An explicit document class option overrides an assignment made by a substyle.
%
% \subsection{Declare Options}%
%
@@ -665,8 +756,7 @@ See the REVTeX 4 README file for restrictions and more information.
% specify that when a float is placed h or H, it will be allowed to break over pages.
% (Note: be sure that if the enclosed \env{tabular} has an optional argument, you change it to [v], or remove it entirely.)
% \end{itemize}
-% \changes{v4.0beta 3}{1999/11/13}
-% {New option ``checkin''}
+% \changes{4.0c}{1999/11/13}{New option ``checkin''}
% \begin{macrocode}
\DeclareOption{checkin}{%
\@booleantrue\dateinRH@sw
@@ -686,30 +776,40 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macrocode}
%
% \subsubsection{Preprint Style}%
-% \changes{v4.d}{1998/01/31}
-% {Rearrange the ordering so numerical ones come first. AO: David, what does this mean?}
-%
-% \changes{v4.g}{1998/06/10}
-% {comma not space between email and homepage}
%
-% \changes{v4.0beta 2}{1999/06/20}
-% {Move this ``complex'' option to the front, where it can be overridden by ``simple'' options.}
+% \begin{macro}{\preprintsty@sw}
+% The boolean \cmd\preprintsty@sw\ signifies that
+% the document is to be formatted in preprint style.
+% \changes{4.0a}{1998/01/31}{Rearrange the ordering so numerical ones come first. AO: David, what does this mean?}
+% \changes{4.0a}{1998/06/10}{comma not space between email and homepage}
+% \changes{4.0b}{1999/06/20}{Move this ``complex'' option to the front, where it can be overridden by ``simple'' options.}
+% \changes{4.1b}{2008/06/01}{Add option reprint, opposite of preprint, and preferred alternative to twocolumn}
% \begin{macrocode}
\DeclareOption{preprint}{%
- \@booleantrue\preprintsty@sw
- \def\@pointsize{12}%
+ \@booleantrue\preprintsty@sw
+ \ExecuteOptions{12pt}%
+}%
+\DeclareOption{reprint}{%
+ \@booleanfalse\preprintsty@sw
+ \@booleantrue\twocolumn@sw
+ \ExecuteOptions{10pt}%
}%
\DeclareOption{manuscript}{%
\class@warn{Document class option manuscript is obsolete; use preprint instead}%
\ExecuteOptions{preprint}%
}%
+\@booleanfalse\preprintsty@sw
% \end{macrocode}
+% \end{macro}
%
+% \begin{macro}{\showPACS@sw}
+% \begin{macro}{\showKEYS@sw}
+% If \cmd\showPACS@sw\ is true, print the PACS information in the title block,
+% otherwise not.
+% Similarly for \cmd\showKEYS@sw\ and the keywords.
% \subsubsection{Showing PACS and keywords}%
-% \changes{v4.0beta 2}{1999/06/20}
-% {New option}
-% \changes{v4.0beta 5}{2000/09/20}
-% {New option showkeys}
+% \changes{4.0b}{1999/06/20}{New option}
+% \changes{4.0e}{2000/09/20}{New option showkeys}
% \begin{macrocode}
\DeclareOption{showpacs}{%
\@booleantrue\showPACS@sw
@@ -723,9 +823,16 @@ See the REVTeX 4 README file for restrictions and more information.
\DeclareOption{noshowkeys}{%
\@booleanfalse\showKEYS@sw
}%
+\@booleanfalse\showPACS@sw
+\@booleanfalse\showKEYS@sw
% \end{macrocode}
+% \end{macro}
+% \end{macro}
%
% \subsubsection{Balance the last page when in two-column page grid}%
+%
+% \begin{macro}{\balancelastpage@sw}
+% \changes{4.1b}{2008/07/01}{(AO) make settings at class time instead of deferring them to later.}
% If we are in a two-column page grid, we may wish to balance the columns
% of the last page. This will be done automatically if the
% \classoption{twocolumn} document class option is chosen.
@@ -738,148 +845,208 @@ See the REVTeX 4 README file for restrictions and more information.
\DeclareOption{nobalancelastpage}{%
\@booleanfalse\balancelastpage@sw
}%
-\appdef\class@inithook{%
- \@ifxundefined\balancelastpage@sw{%
- \@booleantrue\balancelastpage@sw
- }{}%
-}%
+\@booleantrue\balancelastpage@sw
% \end{macrocode}
+% \end{macro}
%
% \subsubsection{Showing preprint numbers}%
-% \changes{v4.0beta 4}{2000/04/10}
-% {New option}
+%
+% \begin{macro}{\preprint@sw}
+% \changes{4.1b}{2008/07/01}{(AO) make settings at class time instead of deferring them to later.}
+% The boolean \cmd\preprint@sw\ signifies that
+% the preprints (cf. \cmd\preprint) are to be formatted (usually on the title page).
+% The option \classoption{preprintnumbers} declares to do so,
+% \classoption{nopreprintnumbers} declares not to;
+% the default is to follow \cmd\preprintsty@sw.
+% \changes{4.0d}{2000/04/10}{New option}
% \begin{macrocode}
\DeclareOption{nopreprintnumbers}{\@booleanfalse\preprint@sw}%
\DeclareOption{preprintnumbers}{\@booleantrue\preprint@sw}%
+\let\preprint@sw\preprintsty@sw
% \end{macrocode}
+% \end{macro}
%
% \subsubsection{Hypertext Option}%
%
-% \changes{v4.e}{1998/01/31}
-% {protect against hyperref revtex kludges which are not needed now}
-% \changes{v4.0beta 2}{1999/06/20}
-% {Move this ``complex'' option to the front, where it can be overridden by ``simple'' options.}
-% \changes{v4.0rc4}{2001/07/23}
-% {hyperref is no longer loaded via class option: use a usepackage statement instead}
+% \changes{4.0a}{1998/01/31}{protect against hyperref revtex kludges which are not needed now}
+% \changes{4.0b}{1999/06/20}{Move this ``complex'' option to the front, where it can be overridden by ``simple'' options.}
+% \changes{4.0rc4}{2001/07/23}{hyperref is no longer loaded via class option: use a usepackage statement instead}
% \begin{macrocode}
\DeclareOption{hyperref}{%
+% \end{macrocode}
+% The following code had been commented out, it is now truly a comment:
+% \begin{verbatim}
%\AtEndOfClass{%
-% \begingroup
-% \edef\@tempa{%
-% \let
-% \noexpand\@clsextension
-% \noexpand\@empty
-% \noexpand\RequirePackage{hyperref}%
-% \def\noexpand
-% \@clsextension{\@clsextension}%
-% }%
-% \expandafter
-% \endgroup
-% \@tempa
+% \begingroup
+% \edef\@tempa{%
+% \let
+% \noexpand\@clsextension
+% \noexpand\@empty
+% \noexpand\RequirePackage{hyperref}%
+% \def\noexpand
+% \@clsextension{\@clsextension}%
+% }%
+% \expandafter
+% \endgroup
+% \@tempa
%}%
-% \end{macrocode}
+% \def\@pointsize{10}%
+% \end{verbatim}
%
% If you have a hyper-foo enabled browser you may prefer this format
% which does not print the URL for the home page, but just makes the
% name a link, but by default print it so it works on paper.
-% \changes{v4.e}{1998/01/31}
-% {print homepage}
+% \changes{4.0a}{1998/01/31}{print homepage}
%
% \begin{macrocode}
-% \def\@pointsize{10}%
\class@warn{Class option "hyperref" is no longer supported.^^JEmploy \string\usepackage{hyperref} instead}%
}%
% \end{macrocode}
%
% \subsubsection{Type Size}%
+% \changes{4.1b}{2008/07/01}{(AO) make settings at class time instead of deferring them to later.}
% Use \cmd\@pointsize|=10| rather than \cmd\@ptsize|=0| to allow easy extensions
% to 9pt or whatever.
-% Note: the three alternatives are mutually exclusive. Furthermore
-% if \cmd\@pointsize\ is still undefined at \cmd\AtEndOfClass\ time,
-% then the substyle can conclude that the user accepts the default.
+% Note: the three alternatives are mutually exclusive.
+%
+% At this point, the parameter \cmd\@pointsize\ is set to \cmd\undefined:
+% a society \emph{must} give it a definition.
% \begin{macrocode}
-\DeclareOption{10pt}{\def\@pointsize{10}}
-\DeclareOption{11pt}{\def\@pointsize{11}}
-\DeclareOption{12pt}{\def\@pointsize{12}}
+\DeclareOption{10pt}{\def\@pointsize{10}}%
+\DeclareOption{11pt}{\def\@pointsize{11}}%
+\DeclareOption{12pt}{\def\@pointsize{12}}%
+\let\@pointsize\@undefined
% \end{macrocode}
%
% \subsubsection{Media Size}%
-% \changes{v4.0beta 2}{1999/06/20}
-% {Restore all media size class option of \protect\file{classes.dtx}}
-% \begin{macrocode}
-\DeclareOption{a4paper}
- {\setlength\paperheight {297mm}%
- \setlength\paperwidth {210mm}}
-\DeclareOption{a5paper}
- {\setlength\paperheight {210mm}%
- \setlength\paperwidth {148mm}}
-\DeclareOption{b5paper}
- {\setlength\paperheight {250mm}%
- \setlength\paperwidth {176mm}}
-\DeclareOption{letterpaper}
- {\setlength\paperheight {11in}%
- \setlength\paperwidth {8.5in}}
-\DeclareOption{legalpaper}
- {\setlength\paperheight {14in}%
- \setlength\paperwidth {8.5in}}
-\DeclareOption{executivepaper}
- {\setlength\paperheight {10.5in}%
- \setlength\paperwidth {7.25in}}
-\DeclareOption{landscape}
- {\setlength\@tempdima {\paperheight}%
+%
+% \begin{macro}{\paperheight}
+% \begin{macro}{\paperwidth}
+% \changes{4.0b}{1999/06/20}{Restore all media size class option of \protect\file{classes.dtx}}
+% \begin{macrocode}
+\DeclareOption{a4paper}{%
+ \setlength\paperheight {297mm}%
+ \setlength\paperwidth {210mm}%
+}%
+\DeclareOption{a5paper}{%
+ \setlength\paperheight {210mm}%
+ \setlength\paperwidth {148mm}%
+}%
+\DeclareOption{b5paper}{%
+ \setlength\paperheight {250mm}%
+ \setlength\paperwidth {176mm}%
+}%
+\DeclareOption{letterpaper}{%
+ \setlength\paperheight {11in}%
+ \setlength\paperwidth {8.5in}%
+}%
+\DeclareOption{legalpaper}{%
+ \setlength\paperheight {14in}%
+ \setlength\paperwidth {8.5in}%
+}%
+\DeclareOption{executivepaper}{%
+ \setlength\paperheight {10.5in}%
+ \setlength\paperwidth {7.25in}%
+}%
+\DeclareOption{landscape}{%
+ \setlength\@tempdima {\paperheight}%
\setlength\paperheight {\paperwidth}%
- \setlength\paperwidth {\@tempdima}}
+ \setlength\paperwidth {\@tempdima}%
+}%
+% \end{macrocode}
+%
+% \changes{4.1a}{2008/01/18}{(AO, 478) \cs{ds@letterpaper}, so that ``letterpaper really is the default''}%
+% Effectively select \classoption{letterpaper}.
+% \begin{macrocode}
+\ds@letterpaper
% \end{macrocode}
+% \end{macro}
+% \end{macro}
%
% \subsubsection{Bibnotes}%
+%
+% \begin{macro}{\frontmatter@footnote@produce}
% Frontmatter footnotes result from frontmatter commands like
% \cmd\email, \cmd\homepage, \cmd\altaffiliation, and \cmd\thanks.
% The default for \cmd\frontmatter@footnote@produce\ is
% \cmd\frontmatter@footnote@produce@footnote, which formats the frontmatter footnotes
% at the foot of the title page. The \classoption{bibnotes} class option
% defers them to the bibliography.
+% \changes{4.1b}{2008/06/01}{(AO) Implement bibnotes through \cs{frontmatter@footnote@produce} instead of \cs{bibnotes@sw}}%
% \begin{macrocode}
-\DeclareOption{bibnotes}{\@booleantrue\bibnotes@sw}%
-\DeclareOption{nobibnotes}{\@booleanfalse\bibnotes@sw}%
+\DeclareOption{bibnotes}{\let\frontmatter@footnote@produce\frontmatter@footnote@produce@endnote}%
+\DeclareOption{nobibnotes}{\let\frontmatter@footnote@produce\frontmatter@footnote@produce@footnote}%
+\let\frontmatter@footnote@produce\frontmatter@footnote@produce@footnote
\appdef\class@enddocumenthook{\auto@bib}%
-\appdef\class@inithook{%
- \@ifxundefined\bibnotes@sw{\@booleanfalse\bibnotes@sw}{}%
- \bibnotes@sw{%
- \let\frontmatter@footnote@produce\frontmatter@footnote@produce@endnote
- }{%
- \let\frontmatter@footnote@produce\frontmatter@footnote@produce@footnote
- }%
-}%
% \end{macrocode}
+% \end{macro}
%
% \subsubsection{Footinbib}%
+%
+% \begin{macro}{\footinbib@sw}
+% The boolean \cmd\footinbib@sw\ signifies that
+% text footnotes are to be set in the bibliography, as endnotes.
+%
+% The document may set the value one way or the other via
+% the following two class options.
% \begin{macrocode}
\DeclareOption{footinbib}{\@booleantrue\footinbib@sw}
\DeclareOption{nofootinbib}{\@booleanfalse\footinbib@sw}
% \end{macrocode}
+% The default value is \cmd\false@sw, and the society or journal
+% may override the default.
+% \changes{4.1b}{2008/07/01}{(AO) make settings at class time instead of deferring them to later.}
+% \begin{macrocode}
+\@booleanfalse\footinbib@sw
+% \end{macrocode}
+% \end{macro}
%
% \subsubsection{altaffilletter}%
%
+% \begin{macro}{\altaffilletter@sw}
+% \changes{4.1b}{2008/07/01}{(AO) make settings at class time instead of deferring them to later.}
+% Determine the procedure \cmd\thefootnote\ used in frontmatter:
+% the footnote symbol used in titlepage footnotes.
% \begin{macrocode}
\DeclareOption{altaffilletter}{\@booleantrue\altaffilletter@sw}%
\DeclareOption{altaffilsymbol}{\@booleanfalse\altaffilletter@sw}%
-\appdef\class@inithook{%
- \@ifxundefined\altaffilletter@sw{\@booleanfalse\altaffilletter@sw}{}%
-}%
+\@booleanfalse\altaffilletter@sw
% \end{macrocode}
+% \end{macro}
%
% \subsubsection{superbib}%
-% The document may invoke superscript bibliography style.
-% If not, the journal substyle may make a selection.
-% If neither, the class itself selects a default.
-% This is really a quite deep nesting of defaults.
+%
+% \begin{macro}{\place@bibnumber}
+% \changes{4.1b}{2008/07/01}{(AO) make settings at class time instead of deferring them to later.}
+% The procedure \cmd\place@bibnumber\ produces the number
+% at the head of the \cmd\bibitem, in the bibliography.
+% By default, it has the \cmd\bibnumfmt\ meaning assigned by the \classname{natbib} package.
+% It may be overridden by society, journal, or by the document options.
+%
% \begin{macrocode}
\DeclareOption{superbib}{%
- \def\place@bibnumber{\place@bibnumber@sup}%
+ \let\place@bibnumber\place@bibnumber@sup
}%
+\def\place@bibnumber{\NATx@bibnumfmt}%
% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\place@bibnumber@sup}
+% \begin{macro}{\place@bibnumber@inl}
+% For producing the \cmd\bibitem\ device,
+% we define two procedures to select from.
+%
+% Note that we could have used \classname{natbib}'s \cmd\ifNAT@super\
+% switch, but it does not allow for altering the meaning of \cmd\bibnumfmt.
+% \begin{macrocode}
+\def\place@bibnumber@sup#1{\textsuperscript{#1}}%
+\def\place@bibnumber@inl#1{[#1]}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
%
% \subsubsection{citeautoscript}%
+% \begin{macro}{\citeautoscript@sw}
% This class option allows you to automatically accomodate a change from non-superscripted, numbered references
% to superscripted, bunmbered references.
%
@@ -887,15 +1054,57 @@ See the REVTeX 4 README file for restrictions and more information.
% Otherwise this option has no hope of working properly.
%
% \begin{macrocode}
-\DeclareOption{citeautoscript}{%
- \@booleantrue\citeautoscript@sw
-}%
+\DeclareOption{citeautoscript}{\@booleantrue\citeautoscript@sw}%
\@booleanfalse\citeautoscript@sw
% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Variants on the Bibliography Style}%
+% \changes{4.1b}{2008/07/01}{(AO) provide option longbibliography}
+%
+% \revtex\ anticipates that a society or journal will provide two related Bib\TeX bibliography style variants,
+% designating one as the default.
+% A pair of document class options \classoption{longbibliography} and \classoption{nolongbibliography}
+% allows the user to explicitly select between them.
+% \begin{macro}{\longbibliography@sw}
+%
+% \revtex's default for \cmd\longbibliography@sw\ is \cmd\false@sw.
+%
+% Here is a suggested convention for societies and journals that provide two alternative
+% Bib\TeX\ styles: if one is named, say, \file{apsrev.bst}, then name the alternative
+% \file{apsrevlong.bst}. Then invoke the code:
+% \begin{verbatim}
+%\appdef\setup@hook{%
+% \longbibliography@sw{%
+% \appdef\@bibstyle{long}%
+% }{}%
+%}%
+% \end{verbatim}
+% \begin{macrocode}
+\DeclareOption{longbibliography}{\@booleantrue\longbibliography@sw}%
+\DeclareOption{nolongbibliography}{\@booleanfalse\longbibliography@sw}%
+\@booleanfalse\longbibliography@sw
+% \end{macrocode}
+% \end{macro}
%
% \subsubsection{Simplex/Duplex Pages}%
-% \changes{v4.e}{1998/01/31}
-% {4.d had twoside option setting twoside switch to false}
+%
+% \begin{macro}{\twoside@sw}
+% \changes{4.1b}{2008/07/01}{(AO) coordinate \cs{if@twoside} with \cs{twoside@sw}}
+% The flag \cmd\twoside@sw\ signifies that the document is to be
+% formatted for duplex printing.
+% After the preamble is processed, we align the value
+% of the kernel \cmd\newif\ switch \cmd\if@twoside\
+% to that of \cmd\twoside@sw.
+% \cmd\if@twoside\ itself is used in the kernel's
+% \cmd\cleardoublepage\ and \cmd\@outputpage\ procedures.
+% \begin{macrocode}
+\@booleanfalse\twoside@sw
+\appdef\document@inithook{%
+ \twoside@sw{\@twosidetrue}{\@twosidefalse}%
+}%
+% \end{macrocode}
+% \changes{4.0a}{1998/01/31}{4.d had twoside option setting twoside switch to false}
% The complementary options \classoption{twoside} and \classoption{oneside}
% assert formatting for duplex or simplex printing, respectively.
% At the same time, we arrange for the selection of the page grid
@@ -904,14 +1113,17 @@ See the REVTeX 4 README file for restrictions and more information.
% if duplex printing, this column will always be on the (right),
% if simplex printing, it will always be on the (outside).
% QUERY: correct choice?
+%FIXME: assign \cmd\if@mparswitch\ later (and protect the assignment, too).
% \begin{macrocode}
-\DeclareOption{twoside}{\@booleantrue\twoside@sw \@mparswitchfalse}
-\DeclareOption{oneside}{\@booleanfalse\twoside@sw\@mparswitchtrue}
+\DeclareOption{twoside}{\@booleantrue \twoside@sw\@mparswitchfalse}%
+\DeclareOption{oneside}{\@booleanfalse\twoside@sw\@mparswitchtrue}%
% \end{macrocode}
+% \end{macro}
%
% \subsubsection{Two-Column Page Grid}%
%
% \begin{macro}{\twocolumn@sw}
+% \changes{4.1b}{2008/07/01}{(AO) make settings at class time instead of deferring them to later.}
% The flag \cmd\twocolumn@sw\ signifies that the document is to be
% formatted in the two-column page grid.
%
@@ -920,205 +1132,387 @@ See the REVTeX 4 README file for restrictions and more information.
% Up to that point, the class can check if \cmd\twocolumn@sw\
% is \cmd\undefined\ to see if any related options have been invoked.
%
-% At \cmd\AtBeginDocument\ time, we must align the value
-% of the kernel \cmd\newif\ switch \cmd\if@twocolumn\
-% to that of \cmd\twocolumn@sw.
-%
% We install into \cmd\class@enddocumenthook\
% all tasks that we know must be completed at \cmd\AtEndDocument\ time.
% The first thing it does is end the current paragraph.
-% The last is
-% to return us to one-column page grid.
-% (This task is installed as late as possible,
+% The last is to return us to one-column page grid.
+% (This procedure is executed after all typesetting is complete
% i.e., after items like \cmd\printtables.)
% \begin{macrocode}
-\AtEndOfClass{%
- \def\clear@document{%
- \close@column
- }%
- \appdef\class@inithook{%
- \@ifxundefined\close@column{%
- \let\close@column\close@column@default
- }{}%
- }%
+\def\clear@document{%
+ \close@column
}%
% \end{macrocode}
-% \end{macro}
%
+% \classoption{onecolumn} specifies one-column page grid.
+% \changes{4.1b}{2008/07/01}{(AO) make settings at class time instead of deferring them to later.}
% The \classoption{twocolumn} class option employs the standard mechanism for
% changing the column grid: the \classname{ltxgrid} package.
% \begin{macrocode}
-\DeclareOption{twocolumn}{%
- \@booleantrue\twocolumn@sw
-}%
+\DeclareOption{onecolumn}{\@booleanfalse\twocolumn@sw}%
+\DeclareOption{twocolumn}{\@booleantrue \twocolumn@sw}%
+\@booleanfalse\twocolumn@sw
% \end{macrocode}
+% The column grid is determined by the state of the switch \cmd\twocolumn@sw
+% and is effected at \cmd\class@documenthook\ time.
+% The society or journal file may re-define \cmd\select@column@grid\
+% to accomodate, e.g., more than two choices for the page grid.
%
-% \classoption{onecolumn} specifies one-column page grid.
+% Note that \cmd\open@column@two\ adds items to the Main Vertical List,
+% so constitutes the true beginning of the document.
+%
+% Note also that if the selected column grid is a one-column grid,
+% there is nothing to do, because \classname{ltxgrid} has already
+% set that up via \cmd\@begindocumenthook.
% \begin{macrocode}
-\DeclareOption{onecolumn}{%
- \@booleanfalse\twocolumn@sw
+\def\select@column@grid{%
+ \twocolumn@sw{%
+ \open@twocolumn
+ }{%
+% \open@onecolumn
+ }%
+}%
+\appdef\class@documenthook{%
+ \select@column@grid
}%
% \end{macrocode}
%
+% \end{macro}
+%
+% \begin{macro}{\authoryear@sw}
+% \changes{4.1a}{2008/01/18}{(AO, 457) Endnotes to be sorted in with numerical citations.}%
+% The boolean \cmd\authoryear@sw\ signifies that we are to use author-year citations rather than numerical citations.
+%
+% The \classoption{author-year} class option selects ``'author-year'' citations;
+% \classoption{numerical} selectes ``numerical'' citations.
+% The former is the default.
+% \begin{macrocode}
+\DeclareOption{author-year}{\@booleantrue\authoryear@sw}%
+\DeclareOption{numerical}{\@booleanfalse\authoryear@sw}%
+\@booleanfalse\authoryear@sw
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\galley@sw}
+% The boolean \cmd\galley@sw\ signifies that
+% the document is to be formatted in galley style.
+%
+% Asserting both \cmd\galley@sw\ and \cmd\preprintsty@sw\
+% may produce strange formatting results, but it is not illegal.
+% However, it \emph{is} illegal to assert galley and any
+% twocolumn option.
+% \begin{macrocode}
+% \end{macrocode}
% \classoption{galley} emulates setting the galleys of
% a two-column journal.
-% FIXME: this option should effectively set \cmd\preprintsty@sw\ false.
+% CHANGED: this option should effectively set \cmd\preprintsty@sw\ false.
% NOTE: it makes no sense to assert both galley and twocolumn.
+% \changes{4.1b}{2008/07/01}{Class option galley sets \cs{preprintsty@sw} to false}
%
% \begin{macrocode}
\DeclareOption{galley}{%
\ExecuteOptions{onecolumn}%
\@booleantrue\galley@sw
- \appdef\set@pica@hook{%
+ \@booleanfalse\preprintsty@sw
+ \appdef\setup@hook{%
\advance\textwidth-\columnsep
\textwidth.5\textwidth
}%
}%
+\@booleanfalse\galley@sw
% \end{macrocode}
-%
+% \end{macro}
%
% \subsubsection{raggedbottom or flushbottom}%
+% \begin{macro}{\raggedcolumn@sw}
+% \changes{4.1b}{2008/07/01}{(AO) make settings at class time instead of deferring them to later.}
% The class options \classoption{raggedbottom} and \classoption{flushbottom} determine whether the columns (page)
% are ragged bottom or flush bottom.
% Note that we do not select a default here; that is done by the journal substyle.
% \begin{macrocode}
\DeclareOption{raggedbottom}{\@booleantrue\raggedcolumn@sw}
\DeclareOption{flushbottom}{\@booleanfalse\raggedcolumn@sw}
+\@booleanfalse\raggedcolumn@sw
+\appdef\setup@hook{%
+ \raggedcolumn@sw{\raggedbottom}{\flushbottom}%
+}%
% \end{macrocode}
+% \end{macro}
%
% \subsubsection{tightenlines}%
+%
% This class option specifies that standard leading
% is to be used to set the type.
% If lacking, the leading will be loose.
%
+% \begin{macro}{\tightenlines@sw}
+% \changes{4.1b}{2008/07/01}{(AO) make settings at class time instead of deferring them to later.}
+% The boolean \cmd\tightenlines@sw\ signifies that
+% the leading is to be made standard amount.
+% If false, it means that the leading is to be set extra open.
+% Has no effect on 10pt size option.
+%
% \begin{macrocode}
\DeclareOption{tightenlines}{\@booleantrue\tightenlines@sw}
+\@booleanfalse\tightenlines@sw
% \end{macrocode}
+% \end{macro}
%
% \subsubsection{lengthcheck}%
+%
+% \begin{macro}{\lengthcheck@sw}
+% \changes{4.1b}{2008/07/01}{(AO) make settings at class time instead of deferring them to later.}
+% The flag \cmd\lengthcheck@sw\ signifies that
+% the length checking is in effect.
+% It is up to the individual journal substyle
+% to alter its formatting accordingly.
+% \begin{macrocode}
+\@booleanfalse\lengthcheck@sw
+% \end{macrocode}
% This class option specifies that the formatted document
% should approach as closely as possible the
% formatting of an actual journal article
% to facilitate the author's performance of a length check.
%
+%FIXME: society or journal may have its own definition of this option.
% \begin{macrocode}
\DeclareOption{lengthcheck}{%
\@booleantrue\lengthcheck@sw
- \@booleantrue\twoside@sw
- \@booleantrue\twocolumn@sw
+ \ExecuteOptions{reprint}%
+}%
+% \end{macrocode}
+% In addition, if length checking is in effect, we will enable
+% the tally of text length.
+% \begin{macrocode}
+\appdef\setup@hook{%
+ \lengthcheck@sw{\@booleantrue\tally@box@size@sw}{}%
}%
% \end{macrocode}
+% \end{macro}
%
% \subsubsection{Draft and Final}%
+%
+% \begin{macro}{\draft@sw}
+% \changes{4.1b}{2008/07/01}{(AO) make settings at class time instead of deferring them to later.}
+% The flag \cmd\draft@sw\ signifies that the document is to be
+% formatted in draft mode.
+%
% \begin{macrocode}
-\DeclareOption{draft}{%
- \@booleantrue\draft@sw
-}%
-\DeclareOption{final}{%
- \@booleanfalse\draft@sw
+\appdef\setup@hook{%
+ \draft@sw{\overfullrule 5\p@}{\overfullrule\z@}%
}%
% \end{macrocode}
%
+% Certain packages may pay attention to the
+% class option \classoption{draft} that sets this Boolean.
+% \begin{macrocode}
+\DeclareOption{draft}{\@booleantrue\draft@sw}%
+\DeclareOption{final}{\@booleanfalse\draft@sw}%
+\@booleanfalse\draft@sw
+% \end{macrocode}
+%
+% \end{macro}
+%
% \subsubsection{eqsecnum}%
+%
+% \begin{macro}{\eqsecnum@sw}
+% The flag \cmd\eqsecnum@sw\ signifies that equations are to be
+% numbered with the section, e.g., ``Eq. (2.13)''.
+% \begin{macrocode}
+\appdef\setup@hook{%
+ \eqsecnum@sw{%
+ \@addtoreset{equation}{section}%
+ \def\theequation@prefix{\arabic{section}.}%
+ }{}%
+}%
+% \end{macrocode}
+%
% The \classoption{eqsecnum} class option signifies that equations are
% to be numbered within sections.
% \begin{macrocode}
-\DeclareOption{eqsecnum}{\@booleantrue\eqsecnum@sw}
+\DeclareOption{eqsecnum}{\@booleantrue\eqsecnum@sw}%
+\@booleanfalse\eqsecnum@sw
% \end{macrocode}
+% \end{macro}
%
% \subsubsection{secnumarabic}%
+% \changes{4.1b}{2008/07/01}{(AO) No longer use \cs{secnumarabic@sw}, instead use \cs{setup@secnums}}
% The \classoption{secnumarabic} class option signifies that sectioning commands are
-% to be numbered arabic.
+% to be numbered arabic:
+% the procedure \cmd\secnums@arabic\ is executed as the default.
+% Otherwise, the procedure \cmd\secnums@rtx\ determines things.
+% The society or journal may redefine either procedure,
+% and may change the definition of \cmd\setup@secnums\ itself,
+% thereby establishing a different default.
% \begin{macrocode}
-\DeclareOption{secnumarabic}{\@booleantrue\secnumarabic@sw}
+\appdef\setup@hook{%
+ \setup@secnums
+}%
+\DeclareOption{secnumarabic}{%
+ \def\setup@secnums{\secnums@arabic}%
+}%
+\def\setup@secnums{\secnums@rtx}%
% \end{macrocode}
-% The code that polls the Boolean \cmd\secnumarabic@sw\ appears
+% The code that defines \cmd\secnums@rtx\ and \cmd\secnums@arabic\ appears
% in Section~\ref{sec:secnumarabic}.
%
+% \begin{macro}{fleqn}
% FIXME: model fleqn after amsfonts. I no longer understand why I said this.
+% \file{fleqn.clo} is not a package, so it can simply be \cmd\input.
% \begin{macrocode}
-\DeclareOption{fleqn}{\input{fleqn.clo}}
+\DeclareOption{fleqn}{%
+ \input{fleqn.clo}%
+}%
% \end{macrocode}
+% \end{macro}
%
% \subsubsection{floats/endfloats}%
+%
+% \begin{macro}{\floats@sw}
+% \begin{macro}{\floatp@sw}
+% \changes{4.1b}{2008/07/01}{(AO) make settings at class time instead of deferring them to later.}
+% The Boolean \cmd\floats@sw\ signifies that floats are to be floated;
+% if false, that floats are to be deferred to the end of the document.
+% By default, the former.
+% Note that the state of this Boolean is to be changed by
+% the document class in response to user-selected options.
+%
+% This boolean and the assignment of its default value is done by
+% the \classname{ltxutil} package.
+%
+% The Boolean \cmd\floatp@sw\ signifies that endfloats are to be set one per page;
+% if false, that endfloats are to be set with multiple floats per page permitted.
+% By default, the latter.
+% Note that the state of this Boolean is to be changed by
+% the document class in response to user-selected options.
+% The default is established here.
+%
% These options control, via the Boolean \cmd\floats@sw,
% whether floats are to be migrated to the end of the document.
% \begin{macrocode}
\DeclareOption{floats}{\@booleantrue\floats@sw\@booleanfalse\floatp@sw}
\DeclareOption{endfloats}{\@booleanfalse\floats@sw\@booleanfalse\floatp@sw}
\DeclareOption{endfloats*}{\@booleanfalse\floats@sw\@booleantrue\floatp@sw}
-\appdef\class@inithook{%
- \@ifxundefined\floats@sw{\@booleantrue\floats@sw}{}%
- \@ifxundefined\floatp@sw{\@booleantrue\floatp@sw}{}%
-}%
+\@booleantrue\floats@sw
+\@booleantrue\floatp@sw
% \end{macrocode}
+% \end{macro}
+% \end{macro}
%
% \subsubsection{titlepage/notitlepage}%
% These options control, via \cmd\titlepage@sw,
% whether the title block is to be set on a separate page.
+%
% \begin{macro}{\titlepage@sw}
+% \changes{4.1b}{2008/07/01}{(AO) make settings at class time instead of deferring them to later.}
% The flag \cmd\titlepage@sw\ signifies that a forced
% page break is to follow the title page: the article
% title appears on a page by itself.
%
-% The Boolean \cmd\titlepage@sw\ is in an odd situation:
-% its value is set by one or more substyles, contingent
-% upon the value of another Boolean.
-% Therefore that code must be invoked at \cmd\AtBeginDocument\ time.
-% Therefore we must assign the default value at the very end
-% of \cmd\AtBeginDocument\ processing: we use \cmd\defaults@hook.
-% Luckily, this Boolean does not need to be queried at
-% \cmd\AtBeginDocument\ time, or we'd be in dire straights.
% \begin{macrocode}
\DeclareOption{titlepage}{\@booleantrue\titlepage@sw}
\DeclareOption{notitlepage}{\@booleanfalse\titlepage@sw}
-\appdef\defaults@hook{%
- \@ifxundefined\titlepage@sw{\@booleanfalse\titlepage@sw}{}%
-}%
+\@booleanfalse\titlepage@sw
% \end{macrocode}
% \end{macro}
%
% \subsubsection{Substyle and Sub-substyle}%
%
-% If the society has already been assigned,
-% notify user that \cmd\@society\ is being overridden.
+% \begin{macro}{\change@society}
+% \begin{macro}{\change@journal}
+% \changes{4.1b}{2008/07/01}{(AO) Provide more diagnostics when \cs{@society} is assigned.}
+% If the society or, resp., journal has already been assigned,
+% notify user whether it is being overridden.
%
% \begin{macrocode}
\def\change@society#1{%
\def\@tempa{#1}%
- \@ifxundefined\@society{}{%
+ \@ifxundefined\@society{%
+ \class@info{Selecting society \@tempa}%
+ \let\@society\@tempa
+ }{%
\@ifx{\@tempa\@society}{}{%
- \class@warn{Conflicting society \@tempa<>\@society.}%
+ \class@warn{Conflicting society \@tempa<>\@society; not selected}%
+ }%
+ }%
+}%
+\def\change@journal#1{%
+ \def\@tempa{#1}%
+ \@ifxundefined\@journal{%
+ \class@info{Selecting journal \@tempa}%
+ \let\@journal\@tempa
+ }{%
+ \@ifx{\@tempa\@journal}{}{%
+ \class@warn{Conflicting journal \@tempa<>\@journal; not selected}%
}%
}%
- \let\@society\@tempa
}%
% \end{macrocode}
-% Here are the class options relating to the APS
+% \end{macro}
+% \end{macro}
+%
+% Here had been the class options relating to the APS.
+% Now that all societies are on an equal footing, this code is in the
+% respective \file{.rtx} file.
% \begin{macrocode}
-\DeclareOption{aps}{\change@society{aps}\def\@journal{}}%
-\DeclareOption{pra}{\change@society{aps}\def\@journal{pra}}%
-\DeclareOption{prb}{\change@society{aps}\def\@journal{prb}}%
-\DeclareOption{prc}{\change@society{aps}\def\@journal{prc}}%
-\DeclareOption{prd}{\change@society{aps}\def\@journal{prd}}%
-\DeclareOption{pre}{\change@society{aps}\def\@journal{pre}}%
-\DeclareOption{prl}{\change@society{aps}\def\@journal{prl}}%
-\DeclareOption{prstab}{\change@society{aps}\def\@journal{prstab}}%
-\DeclareOption{rmp}{\change@society{aps}\def\@journal{rmp}}%
% \end{macrocode}
-% Here are the class options relating to the Optical Society of America
+%
+% \subsubsection{Optical Society of America}%
+% Here are the class options relating to the Optical Society of America.
+%
+% Note: as of 2008, the only OSA module being distributed by ctan is \file{osajnl.rtx}.
+% The class options declared here are, I think, unused.
% \begin{macrocode}
-\DeclareOption{osa}{\change@society{osa}\def\@journal{}}%
+\DeclareOption{osa}{\change@society{osa}\let\@journal\@undefined}%
\DeclareOption{osameet}{\change@society{osa}\def\@journal{osameet}}%
\DeclareOption{opex}{\change@society{osa}\def\@journal{opex}}%
\DeclareOption{tops}{\change@society{osa}\def\@journal{tops}}%
\DeclareOption{josa}{\change@society{osa}\def\@journal{josa}}%
% \end{macrocode}
%
-% NOTE: \file{revguide.tex} does not mention any \cmd\@journal\ options
-% besides \classoption{prb}.
+% \begin{macro}{\rtx@require@packages}
+% \changes{4.1b}{2008/07/01}{Read in all required packages together}
+% The procedure \cmd\rtx@require@packages\ accumulates all \cmd\RequirePackage\ statements
+% in the course of loading the document class.
+% Carrying out these operations at that time is needed:
+% \cmd\ProcessOptions\ must be executed first.
+% \begin{macrocode}
+\let\rtx@require@packages\@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\MakeUppercase}
+% \begin{macro}{\MakeLowercase}
+% \changes{4.1b}{2008/07/01}{Package textcase is now simply a required package}
+% \changes{4.1b}{2008/07/01}{Read in all required packages together}
+% \changes{4.1g}{2009/10/07}{(AO, 538) \cs{MakeTextUppercase} inappropriately expands the double backslash}
+% We load the \classname{textcase} package of David Carlisle.
+% Now that its bug of long standing has been repaired, we no longer need to doctor it up.
+% And, because its loading has been deferred until \cmd\rtx@require@packages\ time,
+% we no longer override \LaTeX\ here. Instead, the \classname{textcase} package
+% will be asked to do that.
+% \begin{macrocode}
+\appdef\rtx@require@packages{%
+ \RequirePackage[overload]{textcase}%
+}%
+% \end{macrocode}
+% The following code used to
+% let the \classname{textcase} commands override those of \LaTeX:
+% \begin{verbatim}
+%\appdef\setup@hook{%
+% \expandafter
+% \let\csname MakeUppercase \expandafter\endcsname
+% \csname MakeTextUppercase \endcsname
+% \expandafter
+% \let\csname MakeLowercase \expandafter\endcsname
+% \csname MakeTextLowercase \endcsname
+% }%
+% \end{verbatim}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{amsfonts}
+% \changes{4.1b}{2008/07/01}{Read in all required packages together}
% The class option \classoption{amsfonts} has the
% same effect as if the document preamble contained
% a \cmd\usepackage\verb${amsfonts}$ statement.
@@ -1129,13 +1523,14 @@ See the REVTeX 4 README file for restrictions and more information.
\DeclareOption{noamsfonts}{%
\let\class@amsfonts\@empty
}%
-\AtEndOfClass{%
+\appdef\rtx@require@packages{%
\@ifxundefined\class@amsfonts{}{\class@amsfonts}%
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{amssymb}
+% \changes{4.1b}{2008/07/01}{Read in all required packages together}
% The class option \classoption{amssymb} has the
% same effect as if the document preamble contained
% a \cmd\usepackage\verb${amssymb}$ statement.
@@ -1146,13 +1541,14 @@ See the REVTeX 4 README file for restrictions and more information.
\DeclareOption{noamssymb}{%
\let\class@amssymb\@empty
}%
-\AtEndOfClass{%
+\appdef\rtx@require@packages{%
\@ifxundefined\class@amssymb{}{\class@amssymb}%
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{amsmath}
+% \changes{4.1b}{2008/07/01}{Read in all required packages together}
% The class option \classoption{amsmath} has the
% same effect as if the document preamble contained
% a \cmd\usepackage\verb${amsmath}$ statement.
@@ -1174,7 +1570,7 @@ See the REVTeX 4 README file for restrictions and more information.
\DeclareOption{noamsmath}{%
\let\class@amsmath\@empty
}%
-\AtEndOfClass{%
+\appdef\rtx@require@packages{%
\preserve@LaTeX
\@ifxundefined\class@amsmath{}{\class@amsmath}%
\appdef\class@enddocumenthook{\test@amsmath@ver}%
@@ -1217,84 +1613,33 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macro}
%
% \subsubsection{Presenting Authors and Their Affiliations}%
-% \changes{v4.0beta 2}{1999/06/20}
-% {These options are now mutually exclusive. But is this correct?}
-%
-% The \classoption{runinaddress} option is the only one that sets \cmd\runinaddress@sw\ to true.
-%
-% The \classoption{unsortedaddress} option is the only one that sets \cmd\@affils@sw\ to false.
-%
-% 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 false.
-%
-% \classoption{groupedaddress}, the default, groups authors above a common address.
-% In order to assert the default and still provide for proper precedence
-% for document-supplied options, we carry out our action at \cmd\AtBeginDocument\ time,
-% and only if none of the related class options were invoked.
-% \begin{macrocode}
-\DeclareOption{groupedaddress}{\clo@groupedaddress}%
-\def\clo@groupedaddress{%
- \@booleantrue\groupauthors@sw
- \@booleantrue\@affils@sw
- \@booleanfalse\runinaddress@sw
-}%
-\appdef\class@inithook{%
- \@ifxundefined\groupauthors@sw{\clo@groupedaddress}{}%
-}%
-% \end{macrocode}
-%
-% \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}
-%
-% \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}
-%
-% \classoption{superscriptaddress} presents author affiliations
-% as superscripts. Authors with like affiliations share the same
-% superscript.
+% \changes{4.1b}{2008/07/01}{Code relating to new syntax for frontmatter has been placed in \file{ltxfront.dtx}}
+% Class options for presenting authors and their affiliations are now defined in
+% \file{ltxfront.dtx}.
%
-% 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}
%
-%
% \subsubsection{Typeset by \revtex}%
%
+% \begin{macro}{\byrevtex@sw}
+% \changes{4.1b}{2008/07/01}{(AO) make settings at class time instead of deferring them to later.}
+% The flag \cmd\byrevtex@sw\ signifies that the document should
+% bear an imprint to the effect that it was formatted by this document class.
+%
% The class option \classoption{byrevtex} signifies that you want the
% ``Typeset by \revtex'' byline to appear on your formatted output.
% By default, no such byline appears.
% \begin{macrocode}
\DeclareOption{byrevtex}{\@booleantrue\byrevtex@sw}%
+\@booleanfalse\byrevtex@sw
% \end{macrocode}
-%
+% \end{macro}
%
% \subsection{Attempt to fix float placement failure}%
%
+% \begin{macro}{\force@deferlist@sw}
+% \changes{4.1b}{2008/07/01}{(AO) make settings at class time instead of deferring them to later.}
% \revtex\ uses the \classname{ltxgrid} package, which provides the ability to attempt repairs when
% \LaTeX's float placement mechanism is about to fail, but that facility is turned off by default.
% Users should invoke the \classoption{floatfix} document class option to enable this \LaTeX\ extension.
@@ -1302,10 +1647,9 @@ See the REVTeX 4 README file for restrictions and more information.
% \begin{macrocode}
\DeclareOption{floatfix}{\@booleantrue\force@deferlist@sw}%
\DeclareOption{nofloatfix}{\@booleanfalse\force@deferlist@sw}%
-\appdef\class@inithook{%
- \@ifxundefined\force@deferlist@sw{\@booleanfalse\force@deferlist@sw}{}%
-}%
+\@booleanfalse\force@deferlist@sw
% \end{macrocode}
+% \end{macro}
%
% \begin{macro}{\@fltovf}
% \begin{macro}{\@fltstk}
@@ -1342,6 +1686,7 @@ See the REVTeX 4 README file for restrictions and more information.
%
% \subsection{Option to relax page height}%
%
+% \begin{macro}{\textheight@sw}
% The \classname{ltxgrid} package can set text pages to their natural height or force them to the full
% text height; the latter is the default.
% If setting the pages with a variable length,
@@ -1351,93 +1696,236 @@ See the REVTeX 4 README file for restrictions and more information.
\DeclareOption{raggedfooter}{\@booleanfalse\textheight@sw}%
\DeclareOption{noraggedfooter}{\@booleantrue\textheight@sw}%
% \end{macrocode}
+% \end{macro}
%
% \subsection{Selecting procedure for processing abstract}%
+% \changes{4.1b}{2008/07/01}{Remove options newabstract and oldabstract}
+% Code defining options \classoption{newabstract} and \classoption{oldabstract} has been removed.
+%
+% \subsection{Option to turn on diagnostics in the frontmatter}%
%
-% There are two different procedures for processing an abstract; the options
-% \classoption{newabstract} and \classoption{oldabstract} determine which one the user
-% prefers. At present, the default is to use the old, but this may change.
-% \begin{macrocode}
-\DeclareOption{newabstract}{\@booleanfalse\oldabstract@sw}%
-\DeclareOption{oldabstract}{\@booleantrue \oldabstract@sw}%
-\appdef\class@inithook{%
- \@ifxundefined\oldabstract@sw{\@booleanfalse\oldabstract@sw}{}%
- \oldabstract@sw{%
- \let@environment{abstract}{abstract-old}%
- }{}%
+% \begin{macro}{\frontmatterverbose@sw}
+% \changes{4.1b}{2008/07/01}{Code relating to new syntax for frontmatter has been placed in \file{ltxfront.dtx}}
+% A diagnostic option, not for the average enduser, which reveals
+% the workings of the frontmatter.
+% This code interfaces to that of \file{ltxfront.dtx}.
+% \begin{macrocode}
+\DeclareOption{frontmatterverbose}{\@booleantrue\frontmatterverbose@sw}%
+\@booleanfalse\frontmatterverbose@sw
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\linenumbers@sw}
+% \changes{4.1f}{2009/07/07}{(AO, 513) Add class option linenumbers: number the lines a la \filename{lineno.sty}}
+% An option to number the lines of type in the output in the manner of \filename{lineno.sty}.
+%
+% At present, we use that very package to implement this functionality.
+% This means that users may modify the workings of that package per its documentation (which see).
+% \begin{macrocode}
+\DeclareOption{linenumbers}{%
+ \appdef\rtx@require@packages{%
+ \RequirePackage{lineno}[2005/11/02 v4.41]%
+ \linenumbersep4pt\relax
+ \linenumbers\relax
+ }%
+}%
+% \end{macrocode}
+% By default, line numbering is off.
+% \end{macro}
+%
+% \begin{macro}{\NAT@merge}
+% \changes{4.1f}{2009/07/15}{(AO, 523) Add class option nomerge, to turn off new natbib 8.3 syntax}
+% Add class option nomerge, to turn off natbib 8.3 syntax for citation key.
+% The default value of REVTeX 4.1 for \cmd\NAT@merge is \cmd\thr@@, which turns on
+% the new syntax along with its semantics.
+% Legacy documents that would be incompatible with the new syntax can be successfully processed
+% with class option \classoption{nomerge}.
+% \begin{macrocode}
+\DeclareOption{nomerge}{%
+ \appdef\setup@hook{%
+ \@ifnum{\NAT@merge>\z@}{\let\NAT@merge\z@}{}%
+ }%
}%
% \end{macrocode}
+% \end{macro}
%
+% \subsection{Default Option, Society, Journal, and pointsize}%
%
+% \changes{4.1a}{2008/01/18}{(AO, 488) Change processing of options to allow an unused option to specify society and journal}%
+% This change will not break OSA documents because that society is still built in to revtex4.
%
+% \begin{macro}{\@parse@class@options@society}
+% \begin{macro}{\@parse@class@options@}
+% \changes{4.1b}{2008/07/01}{Procedures \cs{@parse@class@options@society} and \cs{@parse@class@options@journal} and friends}
+% The procedure \cmd\@parse@class@options@society\ parses the options passed to this document class
+% for the \cmd\@society.
+% It is like \cmd\ProcessOptions*\ in that it accesses
+% \cmd\@ptionlist\{\cmd\@currname.\cmd\@currext\}.
+% Any undefined option is considered: if there is a corresponding \file{.rtx} file,
+% it will change the society accordingly
+% and define a placeholder class option for the society thus found
+% (thus preventing a spurious "option not found" message).
+%
+% The procedure \cmd\@parse@class@options@\ parses the document's options
+% for any that set the \cmd\csname\ provided.
+% \begin{macrocode}
+\def\@parse@class@options@society{%
+ \edef\@tempa{\@ptionlist{\@currname.\@currext}}%
+ \expandafter\@for\expandafter\CurrentOption\expandafter:\expandafter=\@tempa\do{%
+ \expandafter\@ifnotrelax\csname ds@\CurrentOption\endcsname{}{%
+ \IfFileExists{\CurrentOption\substyle@post.\substyle@ext}{%
+ \expandafter\change@society\expandafter{\CurrentOption}%
+ \expandafter\let\csname ds@\CurrentOption\endcsname\@empty
+ }{}%
+ }%
+ }%
+}%
+\def\@parse@class@options@#1{%
+ \edef\@tempa{\@ptionlist{\@currname.\@currext}}%
+ \expandafter\@for\expandafter\CurrentOption\expandafter:\expandafter=\@tempa\do{%
+ \expandafter\@ifnotrelax\csname ds@\CurrentOption\endcsname{%
+ \begingroup\csname ds@\CurrentOption\endcsname
+ \@ifxundefined#1{%
+ \endgroup
+ }{%
+ \expandafter\endgroup\expandafter\def\expandafter#1\expandafter{#1}%
+ }%
+ }{}%
+ }%
+}%
+\def\@parse@class@options@journal{%
+ \edef\@tempa{\@ptionlist{\@currname.\@currext}}%
+ \expandafter\@for\expandafter\CurrentOption\expandafter:\expandafter=\@tempa\do{%
+ \expandafter\@ifnotrelax\csname ds@\CurrentOption\endcsname{%
+ \begingroup
+ \csname ds@\CurrentOption\endcsname
+ \@ifxundefined\@journal{%
+ \endgroup
+ }{%
+ \expandafter\endgroup\expandafter\def\expandafter\@journal\expandafter{\@journal}%
+ }%
+ }{}%
+ }%
+}%
+\def\@parse@class@options{%
+ \edef\@tempa{\@ptionlist{\@currname.\@currext}}%
+ \expandafter\@for\expandafter\CurrentOption\expandafter:\expandafter=\@tempa\do{%
+ \expandafter\@ifnotrelax\csname ds@\CurrentOption\endcsname{%
+ \begingroup
+ \csname ds@\CurrentOption\endcsname
+ \@ifxundefined\@pointsize{%
+ \endgroup
+ }{%
+ \expandafter\endgroup\expandafter\def\expandafter\@pointsize\expandafter{\@pointsize}%
+ }%
+ }{%
+ \IfFileExists{\CurrentOption\substyle@post.\substyle@ext}{%
+ \expandafter\change@society\expandafter{\CurrentOption}%
+ \expandafter\let\csname ds@\CurrentOption\endcsname\@empty
+ }{}%
+ }%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
%
-% \subsection{Default Option}%
+% The default handling for a document class option depends upon whether the \cmd\@society\ is
+% defined.
%
-% The default handling for a document class option is to
-% treat it as the name of a society and
-% hunt for a corresponding \file{.rtx} file to read in.
-% This behavior is much like the \LaTeX2.09 handling, where
+% If not, then hunt for a \file{.rtx} file with that name.
+% If it exists, then we will take this option as the name of the society,
+% otherwise, declare the option as not used.
+%
+% (This behavior is similar to the \LaTeX2.09 handling, where
% one looked for a \file{.sty} file, except that
-% in this case, we must catch the case where multiple
-% unknown options are declared.
+% in this case, we must provide for journal substyles that may be
+% defined in the society file, or have their own journal substyle file.)
+%
+% At the point where the class file is finished loading,
+% we then read in the society file.
+% That file can define further class options, such as the journal substyle.
+%
+% For users, this will mean that they can specify the society and journal simply
+% by specifying first the former and then the latter among their document class options.
+% The society \emph{must} have a corresponding \file{.rtx}.
+%
+% \changes{4.1b}{2008/05/29}{The csname substyle@ext is now defined without a dot (.), to be compatible with \LaTeX usage (see @clsextension and @pkgextension).}
%
% \begin{macrocode}
-\DeclareOption*{%
- \IfFileExists{\CurrentOption\substyle@ext}{%
- \expandafter\change@society\expandafter{\CurrentOption}%
- }{%
- \OptionNotUsed
- }%
-}%
-\def\substyle@ext{.rtx}%
-\AtEndOfClass{%
- \@ifxundefined\@society{%
- \class@warn{No Society specified, using generic APS style}%
- \def\@society{aps}\def\@journal{}%
- }{}%
- \expandafter\input\expandafter{\@society\substyle@ext}%
-}%
+%</options>
% \end{macrocode}
%
-% \subsection{Class-Asserted Options}%
-% \changes{v4.0beta 2}{1999/06/20}
-% {%
-% Removed invocation of nonexistent class option \protect\classoption{groupauthors}
-% and all other class options that should only be invoked by the document.
-% (Otherwise precedence of class options does not work.)
-% }
-% Here we establish the default document class options.
-% Those of the document itself will override these.
% \begin{macrocode}
-\ExecuteOptions{10pt}
+%<*package>
% \end{macrocode}
%
-% \subsection{Execute Options}%
-% The document class options are processed in the order
-% they are declared in this document class file.
-%
-% Precedence is established in the following way:
-%
-% First, the single \file{.rtx} file is read in.
-% It may set values to any of the Booleans that represent class options,
-% and it may elect to do so only if that Boolean is undefined, signifying
-% that its corresponding document class options were absent from
-% the document's option list.
-% In this way correct precedence of class options is maintained.
-%
-% Second, the type size option is acted upon. Type size code
-% should not require altering the values of any of the Booleans carrying
-% class options.
+% \begin{macro}{\@process@society}
+% \begin{macro}{\@process@journal}
+% \begin{macro}{\@process@pointsize}
+% \begin{macrocode}
+\def\substyle@post{4-1}%
+\def\substyle@ext{rtx}%
+\DeclareOption*{\OptionNotUsed}%
+% \end{macrocode}
+% A society substyle may define its own options, via \cmd\DeclareOption.
%
-% Next, at \cmd\AtEndOfClass\ time, certain packages are read in.
+% At the end of this document class, we process the society file,
+% using \file{aps.rtx} if none has been specified in the document.
+% \begin{macrocode}
+\def\@process@society#1{%
+ \@ifxundefined\@society{%
+ \class@warn{No Society specified, using default society #1}%
+ \def\@society{#1}\let\@journal\@undefined
+ }{}%
+ \expandafter\input\expandafter{\@society\substyle@post.\substyle@ext}%
+}%
+% \end{macrocode}
%
-% Finally, at \cmd\AtBeginDocument\ time, the state of the Booleans determines
-% how the formatting will go.
+% A society substyle can encompass any number of journal substyles;
+% we use the following procedure to invoke the proper one.
+% \begin{macrocode}
+\def\@process@journal#1{%
+ \@ifxundefined\@journal{%
+ \class@warn{No journal specified, using default #1}%
+ \def\@journal{#1}%
+ }{}%
+ \expandafter\expandafter
+ \expandafter\rtx@do@substyle
+ \expandafter\expandafter
+ \expandafter{\expandafter\@society\@journal}%
+}%
+\def\rtx@do@substyle#1{%
+ \InputIfFileExists{#1\substyle@post.\substyle@ext}{}{\csname rtx@#1\endcsname}%
+}%
+% \end{macrocode}
+%
+% Document class options \classoption{10pt}, \classoption{11pt}, and \classoption{12pt}
+% are implemented by \revtex\ itself and determine \cmd\@pointsize.
+% These provide formatting settings appropriate to the society's journals.
%
+% If not specified by the document, a value \cmd\@pointsize@default\ is used.
+% This default can be set by the journal. Here, the society sets its default.
% \begin{macrocode}
-\ProcessOptions\relax
+\def\@process@pointsize#1{%
+ \@ifxundefined\@pointsize{%
+ \def\@pointsize{#1}%
+ \class@warn{No type size specified, using default \@pointsize}%
+ }{}%
+ \expandafter\expandafter
+ \expandafter\rtx@do@substyle
+ \expandafter\expandafter
+ \expandafter{\expandafter\@society\@pointsize pt}%
+}%
% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
+% \subsection{Class-Asserted Options}%
+% \changes{4.0b}{1999/06/20}{Removed invocation of nonexistent class option \protect\classoption{groupauthors} and all other class options that should only be invoked by the document. (Otherwise precedence of class options does not work.)}
+% Here we establish the default document class options.
+% Those of the document itself will override these.
%
% \section{Procedures Dependent Upon Options}
%
@@ -1475,32 +1963,28 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\ps@article@twoside}
-% \begin{macro}{\ps@article@oneside}
+% \begin{macro}{\ps@article}
+% \begin{macro}{\ps@article@final}
% \begin{macro}{\ps@preprint}
-% \changes{v4.e}{1998/01/31}
-% {Move after process options, so the following test works}
-% \changes{v4.0beta 2}{1999/06/20}
-% {Defer decision until \cs{AtBeginDocument} time}
-% \changes{v4.0beta 3}{1999/11/13}
-% {Insert procedure \cs{checkindate}}
-% \changes{v4.0rc1}{2001/06/17}
-% {Running headers always as if two-sided}
+% \changes{4.0a}{1998/01/31}{Move after process options, so the following test works}
+% \changes{4.0b}{1999/06/20}{Defer decision until \cs{AtBeginDocument} time}
+% \changes{4.0c}{1999/11/13}{Insert procedure \cs{checkindate}}
+% \changes{4.0rc1}{2001/06/17}{Running headers always as if two-sided}
% \begin{macrocode}
\def\ps@article{%
- \@provide\@evenhead{\let\\\heading@cr\thepage\quad\checkindate\hfil{\leftmark}}%
- \@provide\@oddhead{\let\\\heading@cr{\rightmark}\hfil\checkindate\quad\thepage}%
- \@provide\@oddfoot{}%
- \@provide\@evenfoot{}%
+ \def\@evenhead{\let\\\heading@cr\thepage\quad\checkindate\hfil{\leftmark}}%
+ \def\@oddhead{\let\\\heading@cr{\rightmark}\hfil\checkindate\quad\thepage}%
+ \def\@oddfoot{}%
+ \def\@evenfoot{}%
\let\@mkboth\markboth
\let\sectionmark\@gobble
\let\subsectionmark\@gobble
}%
\def\ps@article@final{%
- \@provide\@evenhead{\let\\\heading@cr\thepage\quad\checkindate\hfil{\leftmark}}%
- \@provide\@oddhead{\let\\\heading@cr{\rightmark}\hfil\checkindate\quad\thepage}%
- \@provide\@oddfoot{}%
- \@provide\@evenfoot{}%
+ \def\@evenhead{\let\\\heading@cr\thepage\quad\checkindate\hfil{\leftmark}}%
+ \def\@oddhead{\let\\\heading@cr{\rightmark}\hfil\checkindate\quad\thepage}%
+ \def\@oddfoot{}%
+ \def\@evenfoot{}%
\let\@mkboth\markboth
\def\sectionmark##1{%
\markboth{%
@@ -1517,27 +2001,20 @@ See the REVTeX 4 README file for restrictions and more information.
}%
}%
}%
-\appdef\class@inithook{%
-%\twoside@sw{%
-%}{%
-%}%
-}%
% \end{macrocode}
%
% \begin{macrocode}
\def\heading@cr{\unskip\space\ignorespaces}%
% \end{macrocode}
%
-% \changes{v4.0beta 3}{1999/11/13}
-% {Do not put by REVTeX in every page foot}
-% \changes{v4.0beta 3}{1999/11/13}
-% {Insert procedure \cs{checkindate}}
+% \changes{4.0c}{1999/11/13}{Do not put by REVTeX in every page foot}
+% \changes{4.0c}{1999/11/13}{Insert procedure \cs{checkindate}}
% \begin{macrocode}
\def\ps@preprint{%
- \@provide\@oddfoot{\hfil\thepage\quad\checkindate\hfil}%
- \@provide\@evenfoot{\hfil\thepage\quad\checkindate\hfil}%
- \@provide\@oddhead{}%
- \@provide\@evenhead{}%
+ \def\@oddfoot{\hfil\thepage\quad\checkindate\hfil}%
+ \def\@evenfoot{\hfil\thepage\quad\checkindate\hfil}%
+ \def\@oddhead{}%
+ \def\@evenhead{}%
\let\@mkboth\@gobbletwo
\let\sectionmark\@gobble
\let\subsectionmark\@gobble
@@ -1545,18 +2022,10 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macrocode}
%
% \begin{macrocode}
-\let\@oddhead\@undefined
-\let\@evenhead\@undefined
-\let\@oddfoot\@undefined
-\let\@evenfoot\@undefined
-\AtEndOfClass{%
- \appdef\class@documenthook{%
- \@provide\@oddhead{}%
- \@provide\@evenhead{}%
- \@provide\@oddfoot{}%
- \@provide\@evenfoot{}%
- }%
-}%
+\let\@oddhead\@empty
+\let\@evenhead\@empty
+\let\@oddfoot\@empty
+\let\@evenfoot\@empty
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1564,9 +2033,7 @@ See the REVTeX 4 README file for restrictions and more information.
%
% \begin{macro}{\lastpage@putlabel}
% Support the default meaning of \cmd\@endpage.
-% \changes{v4.d}{1998/01/31}
-% {Move after process options, so \cs{clearpage} not in scope of
-% twocolumn}
+% \changes{4.0a}{1998/01/31}{Move after process options, so \cs{clearpage} not in scope of twocolumn}
% Name of this macro (and the \cmd\label\ key) taken from
% \url{CTAN:/macros/latex/contrib/other/lastpage}%
% with code optimised slightly.
@@ -1580,22 +2047,20 @@ See the REVTeX 4 README file for restrictions and more information.
\fi
}%
% \end{macrocode}
-% Install a late hook into \cmd\class@enddocumenthook\ that
+% Install a procedure into document endgame processing that
% labels the last page of the document.
% This is done just before the \file{.aux} file
% is closed, and does not require a \cmd\shipout, because it writes
% directly to the \file{.aux} file.
% Note that we invoke \cmd\clearpage: this means that no more typesetting
% should be done past this point.
-% CHECKME: are there any more things installed via
-% \cmd\AtEndOfClass\allowbreak\cmd\class@enddocumenthook?
% \begin{macrocode}
-\AtEndOfClass{%
- \appdef\clear@document{%
- \clearpage
- \lastpage@putlabel
- }%
+\appdef\clear@document{%
+ \clearpage
+ \lastpage@putlabel
+ \tally@box@size@sw{\total@text}{}%
}%
+\providecommand\write@column@totals{}%
% \end{macrocode}
% \end{macro}
%
@@ -1603,16 +2068,23 @@ See the REVTeX 4 README file for restrictions and more information.
% \section{Required Packages}
% \url{CTAN:macros/latex/contrib/other/misc/url.sty}%
% \begin{macrocode}
-\RequirePackage{url}%
+\appdef\rtx@require@packages{%
+ \RequirePackage{url}%
+}%
% \end{macrocode}
%
% \section{Incompatible Packages}
-% Known to be incompatible are \classname{multicol} and \classname{cite}.
-% The former is incompatible with \classname{ltxgrid}, which replaces it.
-% The latter is incompatible with \classname{natbib}, which replaces its functionality.
+%
+% We wait until after the preamble is processed, then check for any packages
+% that might have been loaded which we know to be incompatible with \revtex.
+%
+% The \classname{multicol} package is incompatible with \classname{ltxgrid}, which replaces it.
+% The \classname{cite} package is incompatible with \classname{natbib}, which replaces its functionality.
+% The functionality of the \classname{mcite} package is provided by \classname{natbib}.
% \begin{macrocode}
-\appdef\class@inithook{%
+\appdef\document@inithook{%
\incompatible@package{cite}%
+ \incompatible@package{mcite}%
\incompatible@package{multicol}%
}%
% \end{macrocode}
@@ -1641,7 +2113,6 @@ See the REVTeX 4 README file for restrictions and more information.
% \cmd\footinbib@sw &true if footnotes are to be formatted in the bibliography\\
% \cmd\preprintsty@sw &true for preprint and hyperpreprint\\
% \cmd\eqsecnum@sw &true means that equations are numbered within sections\\
-% \cmd\secnumarabic@sw &true means the sections are to be numbered arabic\\
% \cmd\groupauthors@sw &true means authors listed separately for each address\\
% \cmd\preprint@sw &true means to produce the preprint numbers as part of the title block\\
% \cmd\showPACS@sw &true means to produce the PACS as part of the title block\\
@@ -1672,2227 +2143,6 @@ See the REVTeX 4 README file for restrictions and more information.
% and should be selected by the document alone.
% \end{macro}
%
-%
-% \section{Front Matter}
-%
-% \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.
-% \begin{macrocode}
-\renewcommand\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.
-% \begin{macrocode}
-\appdef\class@inithook{%
- \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}
-% A counter to store the affiliation numbers used for the
-% superscript marks. This command defines \cmd\theaffil.
-% \begin{macrocode}
-\newcounter{affil}
-% \end{macrocode}
-% \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.
-% \revtex, 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.
-% \begin{macrocode}
-\renewcommand\author{% implicit #1
- \@author@def{}% implicit #2
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\collaboration}
-% \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.
-% \begin{macrocode}
-\def\collaboration{% implicit #1
- \groupauthors@sw{%
- \class@warn{%
- \string\collaboration\space is only allowed with superscriptaddress option.
- Use superscriptaddress in place of groupedaddress, unsortedaddress, or runinaddress%
- }%
- }{}%
- \@author@def{\@booleantrue\collaboration@sw}% implicit #2
-}%
-% \end{macrocode}
-% \end{macro}
-% \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{v4.0beta 2}{1999/06/20}
-% {Change handling of \cs{@author} to prevent parsing problems.
-% (Helps in error recovery when syntax errors exist)}
-%
-% Here are all the access procedures for the author data structure.
-%
-% We define a flag value for \cmd\@author (private),
-% 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.
-% \begin{macrocode}
-\def\@author@cleared{{}{}}%
-\def\@author@init{%
- \let\@author\@author@cleared
-}%
-\def\@authorclear@sw{\@ifx{\@author\@author@cleared}}%
-\appdef\class@inithook{%
- \@author@init
-}%
-\def\@author@def#1#2{%
- \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}%
-\def\@author@gobble#1#2{}%
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\move@AU}
-% Move the most recent author to the list of current authors.
-% If we recently did a \cmd\@author@init, this is a no-op.
-% If we recently encountered a \cmd\collaboration,
-% we preface the author with the \cmd\CO@opr \ intercollated operator,
-% otherwise we apply \cmd\AU@opr.
-% \begin{macrocode}
-\def\move@AU{%
- \@authorclear@sw{}{%
- \collaboration@sw{%
- \expandafter\appdef
- \expandafter\AU@grp
- \expandafter{%
- \expandafter \CO@opr
- \@author
- }%
- }{%
- \expandafter\appdef
- \expandafter\AU@grp
- \expandafter{%
- \expandafter \AU@opr
- \@author
- }%
- }%
- }%
- \@author@init
- \@booleanfalse\collaboration@sw
-}%
-% \end{macrocode}
-% \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{v4.0beta 6}{2001/02/13}
-% {Actually append AU@grp to @AAClist.}
-%
-% We first finish off any author- or affiliation groups in progress.
-% Next, we detect the case where there is an author 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{%
- \move@AU\move@AF
- \@ifx{\AU@grp\@empty}{}{%
- \@ifx{\AF@grp\@empty}{%
- \begingroup
- \let\href\@secondoftwo
- \let\AU@opr\@firstoftwo
- \let\CO@opr\@firstoftwo
- \class@warn{Assuming \string\noaffiliation\space for \AU@grp}%
- \endgroup
- \begingroup\@affiliation{\blankaffiliation}%\endgroup in \@affiliation
- \move@AF
-%
-% \appdef \@AAC@list{\AF@opr}%
-% \appdef@eval\@AAC@list{\AF@grp}%
-% \appdef@e \@AAC@list{\AU@grp}%
-% \let\AU@grp\@empty
-% \let\AF@grp\@empty
- }{}%
- }%
- \move@AUAF
-}%
-% \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}{\AU@grp}
-% The control sequence name \cmd\AU@grp\ accretes
-% 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.
-% 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.
-%
-% \begin{macrocode}
-\let\AU@grp\@empty
-% \end{macrocode}
-% \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}
-\renewcommand\and{\class@err{\protect\and\space is not supported}}
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \subsubsection{Commands for affiliation}%
-%
-% \begin{macro}{\affiliation}
-% 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 similarity 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.
-%
-% 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{%
- \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}
-% User-level command signifying that the current group of authors 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\blankaffiliation, which \cmd\@affil@group\ can recognize as a no-op.
-% \begin{macrocode}
-\newcommand\noaffiliation{%
- \move@AU\move@AF
-% \edef\AF@grp{\AF@grp}%
- \begingroup\@affiliation{\blankaffiliation}%
-% \move@AF
-}%
-\def\blankaffiliation{}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@affil@cleared}
-% \begin{macro}{\@affil@init}
-% \begin{macro}{\@affilclear@sw}
-% \begin{macro}{\@affil@def}
-% \begin{macro}{\@affil@join@}
-% \begin{macro}{\@affil@join}
-%
-% 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),
-% and a procedure to add new ancillary data to the affiliation.
-% \begin{macrocode}
-\def\@affil@cleared{{}{}}%
-\def\@affil@init{%
- \let\@affil\@affil@cleared
-}%
-\def\@affilclear@sw{\@ifx{\@affil\@affil@cleared}}%
-\appdef\class@inithook{%
- \@affil@init
-}%
-\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}
-%
-% \begin{macro}{\move@AF}
-% Move the most recent affiliation to the affiliation group.
-% If we recently did a \cmd\@affil@init, this is a no-op.
-% \begin{macrocode}
-\def\move@AF{%
- \@affilclear@sw{}{%
-% \end{macrocode}
-% 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, \cmd\temp@sw\ will be set to true,
-% \cmd\@tempc\ will be set to the existing 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 positive result.
-%
-% This procedure uses \cmd\@tempa\ and sets \cmd\@tempc, \cmd\@tempd, and \cmd\temp@sw.
-% \begin{macrocode}
- \@booleanfalse\temp@sw
- \let\@tempd\@empty
- \@affils@sw{%
- \expandafter\@firstoftwodef\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\@secondoftwodef\expandafter\@tempb\@affil
- \@ifx{\@tempb\@empty}{}{%
- \@ifx{\@tempb\@tempd}{}{%
- \class@warn{%
- Ancillary information for \@tempa\space must not be different!
- Please put it on the first instance%
- }%
- }%
- }%
- \appdef@eval\AF@grp\@tempc
- }%
-% \end{macrocode}
-% False clause: This is a new address:
-% increment the counter to get a unique ID for the new affiliation
-% and append the new number, address, and footnote to the list \cmd\@AFF@list.
-% \begin{macrocode}
- {%
- \@if@empty{\expandafter\@firstoftwo\@affil}{%
- \edef\@tempc{\z@}%
- }{%
- \stepcounter{affil}%
- \edef\@tempc{\theaffil}%
- }%
- \appdef \@AFF@list{\AFF@opr}%
- \appdef@eval\@AFF@list\@tempc
- \appdef@e \@AFF@list{\@affil}%
- \appdef@eval\AF@grp\@tempc
- }%
-% \end{macrocode}
-% Append the ID of the affiliation to the affiliation group of the current author group.
-% \begin{macrocode}
- \@affil@init
- }%
-}%
-\def\@firstoftwodef#1#2#3{%
- \def#1{#2}%
-}%
-\def\@secondoftwodef#1#2#3{%
- \def#1{#3}%
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\move@AUAF}
-% \changes{v4.h}{1998/06/25}
-% {Changes to support groups of affiliations}
-% Append \cmd\AF@grp\ and \cmd\AU@grp\ to \cmd\@AAC@list\ %
-% and merge any new \cmd\AF@grp\ to \cmd\@AFG@list.
-% \begin{macrocode}
-\def\move@AUAF{%
-% \end{macrocode}
-% Entire procedure is predicated on something non-trivial to move.
-%
-% If both author and affiliation are nil, bail out.
-%
-% No, try that again:
-%
-% If we have seen any affiliations, 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.
-% \begin{macrocode}
-%\@ifx{\AU@grp\@empty}{\@ifx{\AF@grp\@empty}{\true@sw}{\false@sw}}{\false@sw}%
- \@ifx{\AF@grp\@empty}%
- {}{%
-% \end{macrocode}
-% First, 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}
-% Next, append the current affiliation group to \cmd\@AFG@list,
-% (if it is not already there)
-% using \cmd\AFS@opr\ as the intercollated operator.
-%
-% Note that \cmd\@AFG@list\ is a list of \emph{unique} affiliation groups.
-% \begin{macrocode}
- \@ifx{\@empty\AU@grp}{}{%
- \@ifx{\@empty\AF@grp}{}{%
- \@booleanfalse\temp@sw
- \def\AFS@opr{\x@match\AF@grp}%
- \@AFG@list
- \temp@sw{}{%
- \appdef \@AFG@list{\AFS@opr}%
- \appdef@eval\@AFG@list{\AF@grp}%
- }%
- }%
- }%
-% \end{macrocode}
-% Finally, null out the macros holding the author group and affiliation group, respectively.
-% \begin{macrocode}
- \let\AU@grp\@empty
- \let\AF@grp\@empty
- }%
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@AAC@list}
-% The \cmd\@AAC@list\ macro accretes
-% 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).
-% \begin{macrocode}
-\appdef\class@inithook{%
- \let\@AAC@list\@empty
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@AFG@list}
-% The macro \cmd\@AFG@list\ accretes \cmd\AF@grp,
-% with \cmd\AFS@opr\ as the intercollated operator.
-%
-% This token list is employed when and only when \classoption{groupedaddress} is in effect.
-%
-% It must be empty at the beginning of the document.
-% \begin{macrocode}
-\appdef\class@inithook{%
- \let\@AFG@list\@empty
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@AFF@list}
-% The macro \cmd\@AFF@list\ accretes the list of affiliations
-% with \cmd\AFF@opr\ as the intercollated operator.
-% It must be empty at the beginning of the document.
-%
-% 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@footnote\ (FIXME: never used),
-% \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.
-% \begin{macrocode}
-\appdef\class@inithook{%
- \let\@AFF@list\@empty
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\AF@grp}
-% The macro \cmd\AF@grp\ accretes affiliation IDs into an affiliation group.
-% It must be empty at the beginning of the document.
-% \begin{macrocode}
-\let\AF@grp\@empty
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@affil@match}
-% The definition for the \cmd\AFF@opr, the intercollated operator for \cmd\@AFF@list,
-% when adding a new affiliation: 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).
-%
-% 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 footnote number 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{%
- \temp@sw{}{%
- \def\@tempifx{#3}%
- \@ifx{\@tempifx#1}{%
- \@booleantrue\temp@sw
- \def\@tempc{#2}%
- \def\@tempd{#4}%
- }{%
- }%
- }%
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@tempaffil@script}
-% Give a superscript marker to the address,
-% and junk the text argument (|#2|).
-% \begin{macrocode}
-%\def\@tempaffil@script#1#2{%
-% ,\,#1%
-%}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@tempaffil@group}
-%
-% Execute if we are grouping authors above `main addresses' (\classoption{groupedaddress}).
-% Put temp address in a footnote, with explanatory text.
-% Note: this procedure uses \cmd\@tempb\ and \cmd\@tempc\
-% to communicate to \cmd\AFF@opr.
-% \begin{macrocode}
-%\def\@tempaffil@group#1#2{%
-% \def\@tempc{#1}%
-% \def\@tempb{#2}%
-% \begingroup
-% \let\AFF@opr \@affil@footnote
-% \@AFF@list
-% \endgroup
-%}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@affil@footnote}
-% The alias of \cmd\AFF@opr\ when \cmd\@AFF@list\
-% is executed by \cmd\@tempaffil@group.
-% If we find a match of the affiliation number to \cmd\@tempc,
-% then footnotes are formatted with the relevant content and \cmd\@tempb.
-% \begin{macrocode}
-%\def\@affil@footnote#1#2#3{%
-% \def\@tempifx{#1}%
-% \@ifx{\@tempifx\@tempc}{%
-% \comma@space
-% \expandafter\frontmatter@footnote\expandafter{\@tempb#2}%
-% \frontmatter@footnote{#3}%
-% }{%
-% }%
-%}%
-% \end{macrocode}
-% \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\class@inithook{%
- \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.
-% \begin{macrocode}
-\def\sanitize@url{%
- \@makeother\%%
- \@makeother\~%
- \@makeother\_%
-}%
-\newcommand*\email[1][Electronic address: ]{\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.
-% \begin{macrocode}
-\newcommand*\homepage[1][URL:~]{\begingroup\sanitize@url\@homepage{#1}}%
-\def\@homepage#1#2{%
- \endgroup
- \@AF@join{#1\url{#2}}%
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\url}
-% \begin{macro}{\href}
-% \begin{macrocode}
-\appdef\class@documenthook{%
- \providecommand\url{\texttt}%
- \providecommand\href[2]{\url{#2}}%
-}%
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\thanks}
-%
-% The operative version of \cmd\thanks\ appends an item to \cmd\@author, or \cmd\@affil's auxiliary data.
-% \begin{macrocode}
-\def\thanks{% implicit #1
- \@AF@join
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\altaffiliation}
-% \changes{v4.d}{1998/01/31}
-% {change name from \cs{tempaffiliation}}
-% \changes{v4.l}{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{v4.l}{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@err}
-% This command will be executed if are in a \classoption{groupedaddress} situation and
-% the document contained a \cmd\collaboration\ command.
-%
-% There already has been issued a warning message explaining that \cmd\collaboration\ is wrong in this case,
-% so here we simply gobble.
-% \begin{macrocode}
-\def\@collaboration@err#1#2{%
-%\class@warn{An illegal \string\collaboration\ command has been entered!}%
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\doauthor}
-% 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.
-% \begin{macrocode}
-\def\doauthor#1#2#3{%
- \ignorespaces#1\unskip\@listcomma
- \def\@tempifx{#3}%
- \@ifx{\@tempifx\@empty}{%
- \def\@tempifx{#2}%
- \@ifx{\@tempifx\@empty}{}{\frontmatter@footnote{#2}}%
- }{%
- #3%
- \def\@tempifx{#2}%
- \@ifx{\@tempifx\@empty}{}{\comma@space\frontmatter@footnote{#2}}%
- }%
- \space \@listand
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\AF@opr}
-% DPC: The number(s) associated to the affiliation address(es).
-% \end{macro}
-%
-% \begin{macro}{\@thanks}
-% \changes{v4.d}{1998/01/31}
-% {\cs{comma@space} added}
-% Society-specific options may change this. \cmd\comma@space\ is a separator
-% between adjacent footnotes.
-% \begin{macrocode}
-\def\@thanks{\comma@space\footnote}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\x@match}
-% Procedure \cmd\x@match\ is used as an alias \cmd\AFS@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
- \temp@sw{%
- \expandafter\frontmatter@footnotemark
- \expandafter{\@tempb}%
- }{%
- \stepcounter\@mpfn
- \protected@xdef\@tempb{\the\csname c@\@mpfn\endcsname}%
- \expandafter\frontmatter@footnotemark
- \expandafter{\@tempb}%
- \expandafter\g@addto@macro
- \expandafter\@FMN@list
- \expandafter{%
- \expandafter \@TBN@opr
- \expandafter {\@tempb}{#1}%
- }%
- }%
- \endgroup
-}%
-\appdef\class@inithook{%
- \global\let\@FMN@list\@empty
-}%
-\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{\thempfn}%
- \@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}%
-}%
-\def\@keywords{}%
-% \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}
-% 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}
-\renewcommand*\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}%
-}%
-\def\@pacs{}%{\class@warn{No PACS numbers}}%
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \subsection{The \cs{preprint} command}
-%
-% \changes{v4.g}{1998/06/10}
-% {multiple preprint commands}
-% \begin{macrocode}
-\def\preprint#1{\gappdef\@preprint{\preprint{#1}}}%
-\let\@preprint\@empty
-% \end{macrocode}
-%
-% \subsection{draft}
-% DPC: Name clash with draft option. \LaTeX\ doesn't care, but it confuses me.
-%
-% This command is a 3.1 relic, now removed.
-% \begin{macrocode}
-%\newcommand\draft{\@booleantrue\draft@sw}%
-% \end{macrocode}
-%
-% \subsection{The \env{abstract} environment}%
-%
-% \changes{v4.0beta 2}{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{v4.d}{1998/01/31}
-% {If empty \cs{abstractname} omit spacing}
-% \begin{macrocode}
-% \changes{v4.e}{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}.
-%
-% The user can elect to use this new mechanism via the \classoption{newabstract};
-% likewise the old mechanism via the \classoption{oldabstract}.
-%
-% \begin{macrocode}
-\newenvironment{abstract}{%
- \aftermaketitle@chk{\begin{abstract}}%
- \global\setbox\absbox\vbox\bgroup
- \color@begingroup
- \columnwidth\textwidth
- \hsize\columnwidth
- \@parboxrestore
- \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@
- \let\@footnotetext\frontmatter@footnotetext
- \minipagefootnote@init
- \let\@listdepth\@mplistdepth \@mplistdepth\z@
- \@minipagerestore
- \@setminipage
- \frontmatter@abstractheading
- \frontmatter@abstractfont
- \let\footnote\mini@note
-}{%
- \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 \texttt{p@mpfootnote} instead of \texttt{p@mpfootnote}, and
-% \cmd\frontmatter@makefntext\ instead of \cmd\@makefntext.
-%
-% \begin{macrocode}
-\long\def\frontmatter@footnotetext#1{%
- \minipagefootnote@pick
- \reset@font\footnotesize
- \interlinepenalty \interfootnotelinepenalty
- \splittopskip \footnotesep
- \splitmaxdepth \dp \strutbox
- \set@footnotewidth
- \@parboxrestore
- \protected@edef\@currentlabel{\csname p@mpfootnote\endcsname\@thefnmark}%
- \color@begingroup
- \frontmatter@makefntext{%
- \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox
- }%
- \color@endgroup
- \minipagefootnote@drop
-}%
-% \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@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
-% \tracingall
- \preprintsty@sw{%
- \do@output@MVL{%
- \vskip\frontmatter@preabstractspace
- \vskip200\p@\@plus1fil
- \penalty-200\relax
- \vskip-200\p@\@plus-1fil
- }%
- }{%
- \addvspace{\frontmatter@preabstractspace}%
- }%
-% \leavevmode
- \begingroup
- \dimen@\baselineskip
- \setbox\z@\vtop{\unvcopy\absbox}%
- \advance\dimen@-\ht\z@\advance\dimen@-\prevdepth
- \@ifdim{\dimen@>\z@}{\vskip\dimen@}{}%
- \endgroup
- \unvbox\absbox
- \@ifx{\@empty\mini@notes}{}{\mini@notes\par}%
-% \par
- \addvspace\frontmatter@postabstractspace
-% \showlists
-% \tracingplain
-}%
-% \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{v4.0beta 3}{1999/11/13}
-% {grid changes with ltxgrid}
-% \begin{macrocode}
-\newenvironment{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{v4.d}{1998/01/31}
-% {hookify}
-% Put it all together to format the title block.
-% \begin{macrocode}
-\def\maketitle{%
- \@author@finish
- \title@column\titleblock@produce
- \suppressfloats[t]%
-% \end{macrocode}
-% Now save some memory.
-% \begin{macrocode}
- \let\and\relax
- \let\affiliation\@gobble
-% \let\address\affiliation
- \let\author\@gobble
- \let\@AAC@list\@empty
- \let\@AFF@list\@empty
- \let\@AFG@list\@empty
-% \let\keywords\@gobble
-% \let\@keywords\@empty
- \let\@AF@join\@AF@join@error
- \let\email\@gobble
- \let\@address\@empty
- \let\maketitle\relax
- \let\thanks\@gobble
- \titlepage@sw{%
- \vfil
- \clearpage
- }{}%
-}%
-% \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}
-% Special footnote version [of footnotes] for \cmd\thanks,
-% copied from \classname{article} class \cmd\maketitle.
-% \changes{v4.0beta 2}{1999/06/20}
-% {Set \cs{footnote} to \LaTeX\ standard version for this scope.}
-% \begin{macrocode}
- \let\footnote\footnote@latex
- \let\@makefnmark\@makefnmark@latex
- \let\@footnotemark\@footnotemark@latex
- \let\thefootnote\frontmatter@thefootnote
-% \let\@makefntext\frontmatter@makefntext
- \global\c@footnote\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.
-% \begin{macrocode}
- \frontmatter@abstract@produce
- \@pacs@produce\@pacs
- \@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.
-%
-% Journals 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.
-%
-% At this point, we patch into \cmd\let@mark\ so that the common markup idiom \cmd\\ is taken care of.
-% \begin{macrocode}
-\def\frontmatter@title@produce{%
- \begingroup
- \frontmatter@title@above
- \frontmatter@title@format
- \@title
- \@ifx{\@title@aux\@title@aux@cleared}{}{%
- \expandafter\frontmatter@footnote\expandafter{\@title@aux}%
- }%
- \par
-% \@ifx{\@shorttitle\@empty}{%
-% \markboth{\@title}{\@title}%
-% }{%
-% \markboth{\@shorttitle}{\@shorttitle}%
-%% \class@warn{Unused short title ignored}%
-% }%
- \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}
-% \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.
-% \begin{macrocode}
-\def\frontmatter@author@produce@script{%
- \begingroup
- \let\@author@present\@author@present@script
-% \end{macrocode}
-% \changes{v4.l}{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.
-%
-% 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\@AFU@list\@empty
-% \let\AFS@opr \affils@present@script
-% \@AFG@list
-% \let\AF@opr \affil@present@script
-% \@AFU@list
- \let\AFF@opr \@affil@script
-% \say\@AFF@list
- \@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{%
- \par
- \begingroup
- \frontmatter@collaboration@above
- \@author@present{(\ignorespaces#2\unskip)}{#3}%
- \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\AFS@opr, this procedure is applied to \cmd\@AFG@list\ and builds
-% \cmd\@AFU@list, a list of unique affiliations found within affiliation groups.
-%
-% \begin{macrocode}
-%\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{macrocode}
-% \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.
-% \begin{macrocode}
-%\def\affil@present@script#1{%
-% \def\@tempa{#1}%
-% \begingroup
-% \frontmatter@affiliationfont
-% \let\AFF@opr \affil@script
-% \@AFF@list
-% \endgroup
-%}%
-% \end{macrocode}
-% \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
- \textsuperscript{\normalfont#1}%
- #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.
-%
-% FIXME: dead code.
-% \begin{macrocode}
-\def\@affil@script#1#2#3{%
- \@ifnum{#1=\z@}{}{%
- \par
- \begingroup
- \frontmatter@affiliationfont
-% \textsuperscript{\normalfont#1}%
- \textsuperscript{#1}%
- #2%
- \@if@empty{#3}{}{\frontmatter@footnote{#3}}%
- \par
- \endgroup
- }%
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@author@present@script}
-% \changes{v4.h}{1998/06/25}
-% {Changes to support groups of affiliations}
-% 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{%
- \begingroup
-% \parskip\@author@parskip\relax
- \gdef\comma@space{\textsuperscript{,\,}}%
-% \@ifx{\@affilID@temp\@empty}{%
-% \doauthor{#1}{#2}{}%
-% }{%
-% \expandafter\set@count@\@affilID@temp{}{}\@@nil
-% \@ifnum{\count@=\z@}{%
-% \doauthor{#1}{#2}{}%
-% }{%
-% \doauthor{#1}{#2}{%
-% \textsuperscript{\expandafter\@affilcomma\@affilID@temp\relax\relax}%
-% }%
-% }%
-% }%
- \doauthor{#1}{#2}{%
- \let\@tempa\@empty
- \expandafter\@affil@present@script\@affilID@temp\relax
- }%
- \endgroup
- \advance\@tempcnta\m@ne
-}%
-%\def\set@count@#1#2\@@nil{%
-% \count@#1\relax
-%}%
-\def\@affilcomma#1#2{%
- \@ifx{\z@#1}{%
- \@ifx{\relax#2}{}{%
- \@affilcomma{#2}%
- }%
- }{%
- #1%
- \@ifx{\relax#2}{}{%
- \@ifx{\z@#2}{%
- \@affilcomma
- }{%
- ,\,\@affilcomma{#2}%
- }%
- }%
- }%
-}%
-\def\@affil@present@script#1{%
- \@ifx{\relax#1}{%
- \@ifx{\@tempa\@empty}{}{%
- \textsuperscript{\expandafter\@affilcomma\@tempa\relax\relax}%
- }%
- }{%
- \@ifx{\z@#1}{}{\appdef\@tempa{{#1}}}%
- \@affil@present@script
- }%
-}%
-\@provide\@author@parskip{\z@skip}%
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \subsubsection{Authors and affiliations in groupedaddress style}
-%
-% \begin{macro}{\frontmatter@author@produce@group}
-% \cmd\frontmatter@author@produce@group\ is an alias for \cmd\frontmatter@author@produce,
-% the procedure that formats the author/affiliation list when \classoption{groupedaddress} is in effect.
-%
-% 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.
-% \begin{macrocode}
-\def\frontmatter@author@produce@group{%
- \begingroup
- \let\@author@present\@author@present@group
- \frontmatter@authorformat
- \let\AFS@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}
-% Alias of \cmd\AFS@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 is |#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 communicate accumulate the number of authors in the current affiliation set.
-%
-% QUERY: does 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}% % 0B13
- \@tempcnta\z@
- \let\AU@opr \undefined % 0B13
- \let\CO@opr \undefined % 0B13
- \def\AF@opr{\@affilID@count\AF@temp\@tempcnta}% 0B13
- \@AAC@list
-% \end{macrocode}
-%
-% If 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 % 0B13
- \let\CO@opr \undefined % 0B13
- \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 used to count 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{\z@\AF@temp}{}{%
- \advance\@tempcnta\@ne
- }%
- }%
- \@ifnum{\@tempcnta=\tw@}{%
- \let\@listcomma\relax
- }{}%
- \def\after@address{\@listcomma\ \@listand}%
- \runinaddress@sw{%
- }{%
- \tightenlines@sw{%
- }{%
- \parskip\z@ %space between affilations in grouped mode
- }%
- \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
-%\smallskip
-}%
-% \end{macrocode}
-% \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@err
-}%
-\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@err
-}%
-% \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 createed 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{\count@=\z@}{}{#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 second parameter's being the token \cmd\blankaffiliation.
-% \begin{macrocode}
-\def\@affil@group#1#2#3{%
- \@ifnum{\count@=#1\relax}{%
- \@ifx{#2\blankaffiliation}{}{%
- #2%
- \@if@empty{#3}{}{%
- \frontmatter@footnote{#3}%
- }%
- \after@address
- }%
- \advance\@tempcnta\m@ne
- }{}%
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@author@present@group}
-% \changes{v4.d}{1998/01/31}
-% {\cs{comma@space}}
-% This version of \cmd\AU@opr\ applies to the \classoption{groupedaddress} class option.
-% Traverse the list calling the \cmd\doauthor\ hook on each author.
-% \begin{macrocode}
-\def\@author@present@group#1#2{%
- \gdef\comma@space{\gdef\comma@space{\textsuperscript{,\,}}}%
- \doauthor{#1}{#2}{}%
- \advance\@tempcnta\m@ne
-}%
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \begin{macro}{\@pacs@produce}
-% PACS, keywords and dates.
-% \changes{v4.d}{1998/01/31}
-% {PACS boxed to width of abstract}
-% \changes{v4.0beta 2}{1999/06/20}
-% {Separate option now controls production}
-% \changes{v4.0beta 5}{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{v4.0beta 5}{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
-}%
-\def\present@FM@footnote#1#2{%
- \begingroup
- \csname c@\@mpfn\endcsname#1\relax
- \def\@thefnmark{\thempfn}%
- \frontmatter@footnotetext{#2}%
- \endgroup
-}%
-\def\frontmatter@footnote@produce@endnote{%
-}%
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\frontmatter@thefootnote}
-% The 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.
-% \begin{macrocode}
-\def\frontmatter@thefootnote{%
- \altaffilletter@sw{\@alph}{\@fnsymbol}\c@footnote
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\frontmatter@makefnmark}
-% The default procedure for setting the footnote mark within the frontmatter.
-% Journals will 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.
-% \begin{macrocode}
-\long\def\frontmatter@makefntext#1{%
- \parindent 1em
- \noindent
- \Hy@raisedlink{\hyper@anchorstart{frontmatter@\the\c@footnote}\hyper@anchorend}%
- \@makefnmark
- #1%
-}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\frontmatter@setup}
-% The default type specification for the title page.
-% Journals 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.
-% Journals 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.
-% Journals will override this definition.
-% \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).
-% Journals 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}.
-% Journals will override this definition.
-% \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.
-% Journals will override this definition.
-% \begin{macrocode}
-\def\frontmatter@affiliationfont{}%
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\frontmatter@RRAP@format}
-% The default type specification for the dates.
-% Journals 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{v4.h}{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
-% \c@secnumdepth-\maxdimen
- \expandafter\section
- \expandafter*%
- \expandafter{%
- \csname#1name\endcsname
- }%
- \let\appendix\appendix@toc
- \@starttoc{#1}%
- \endgroup
-}%
-\def\appendix@toc{}%
-% \end{macrocode}
-%
-%
% \section{Body}
%
% \subsection{counters}
@@ -3986,9 +2236,10 @@ See the REVTeX 4 README file for restrictions and more information.
}%
% \end{macrocode}
%
+% \changes{4.1b}{2008/06/30}{(AO) Structure the Abstract using the \texttt{bibliography} environment}
% \begin{macrocode}
\def\descriptionlabel#1{%
- \hspace\labelsep \normalfont\bfseries #1%
+ \hspace\labelsep \normalfont\bfseries #1\unskip:%
}%
% \end{macrocode}
%
@@ -4003,31 +2254,87 @@ See the REVTeX 4 README file for restrictions and more information.
}%
% \end{macrocode}
%
-% \subsection{Sectioning Commands}
+% \subsection{Sectioning Commands\label{sec:secnumarabic}}
%
-% \subsubsection{Counters and Their Productions}%
+% \subsubsection{Sectioning Commands and Their Productions}%
+% The following counters are defined by LaTeX's standard document classes.
+% We do likewise, then assign flag values to the productions, awaiting
+% overrides.
% \begin{macrocode}
-\newcounter{part}
-\newcounter{section}
-\newcounter{subsection}[section]
-\newcounter{subsubsection}[subsection]
-\newcounter{paragraph}[subsubsection]
-\newcounter{subparagraph}[paragraph]
+\newcounter{part}%
+\let\thepart\@undefined
+\newcounter{section}%
+\let\thesection\@undefined
+\newcounter{subsection}[section]%
+\let\thesubsection\@undefined
+\newcounter{subsubsection}[subsection]%
+\let\thesubsubsection\@undefined
+\newcounter{paragraph}[subsubsection]%
+\let\theparagraph\@undefined
+\newcounter{subparagraph}[paragraph]%
+\let\thesubparagraph\@undefined
% \end{macrocode}
-%
-% \begin{macrocode}
-\def\thepart {\Roman{part}} %
-\def\thesection {\Roman{section}}
-\def\p@section {}
-\def\thesubsection {\Alph{subsection}}
-\def\p@subsection {\thesection\,}
-\def\thesubsubsection {\arabic{subsubsection}}
-\def\p@subsubsection {\thesection\,\thesubsection\,}
-\def\theparagraph {\alph{paragraph}}
-\def\p@paragraph {\thesection\,\thesubsection\,\thesubsubsection\,}
-\def\thesubparagraph {\arabic{subparagraph}}
-\def\p@subparagraph {\thesection\,\thesubsection\,\thesubsubsection\,\theparagraph\,}
+% The procedure invoked by \cmd\setup@secnums\ provides meanings for these productions.
+%
+% \begin{macro}{\secnums@rtx}
+% \begin{macro}{\secnums@arabic}
+% These two procedures define the meanings of each of the productions
+% of the counters of the sectioning commands,
+% but only if nothing else has defined it.
+% \begin{macrocode}
+\def\secnums@rtx{%
+ \@ifxundefined\thepart{%
+ \def\thepart{\Roman{part}}%
+ }{}%
+ \@ifxundefined\thesection{%
+ \def\thesection {\Roman{section}}%
+ \def\p@section {}%
+ }{}%
+ \@ifxundefined\thesubsection{%
+ \def\thesubsection {\Alph{subsection}}%
+ \def\p@subsection {\thesection\,}%
+ }{}%
+ \@ifxundefined\thesubsubsection{%
+ \def\thesubsubsection {\arabic{subsubsection}}%
+ \def\p@subsubsection {\thesection\,\thesubsection\,}%
+ }{}%
+ \@ifxundefined\theparagraph{%
+ \def\theparagraph {\alph{paragraph}}%
+ \def\p@paragraph {\thesection\,\thesubsection\,\thesubsubsection\,}%
+ }{}%
+ \@ifxundefined\thesubparagraph{%
+ \def\thesubparagraph {\arabic{subparagraph}}%
+ \def\p@subparagraph {\thesection\,\thesubsection\,\thesubsubsection\,\theparagraph\,}%
+ }{}%
+}%
+\def\secnums@arabic{%
+ \@ifxundefined\thepart{%
+ \def\thepart {\Roman{part}}%
+ }{}%
+ \@ifxundefined\thesection{%
+ \def\thesection {\Roman{section}}%
+ \def\p@section {}%
+ }{}%
+ \@ifxundefined\thesubsection{%
+ \def\thesubsection {\thesection.\arabic{subsection}}%
+ \def\p@subsection {}%
+ }{}%
+ \@ifxundefined\thesubsubsection{%
+ \def\thesubsubsection {\thesubsection.\arabic{subsubsection}}%
+ \def\p@subsubsection {}%
+ }{}%
+ \@ifxundefined\theparagraph{%
+ \def\theparagraph {\thesubsubsection.\arabic{paragraph}}%
+ \def\p@paragraph {}%
+ }{}%
+ \@ifxundefined\thesubparagraph{%
+ \def\thesubparagraph {\theparagraph.\arabic{subparagraph}}%
+ \def\p@subparagraph {}%
+ }{}%
+}%
% \end{macrocode}
+% \end{macro}
+% \end{macro}
%
% \subsubsection{The Acknowledgments Environment}%
% This user-level markup produces a head introducing
@@ -4037,17 +2344,15 @@ See the REVTeX 4 README file for restrictions and more information.
%
% For compatiability's sake, we implement it under the alternative
% spelling \env{acknowledgements}.
-% \changes{v4.0beta 3}{1999/11/13}
-% {also spelled ``acknowledgements''.}
-% \changes{v4.0beta 4}{2000/05/18}
-% {But alternative spelling is deprecated.}
+% \changes{4.0c}{1999/11/13}{also spelled ``acknowledgements''.}
+% \changes{4.0d}{2000/05/18}{But alternative spelling is deprecated.}
% \begin{macrocode}
\newenvironment{acknowledgments}{%
\acknowledgments@sw{%
- \section*{\acknowledgmentsname}%
+ \expandafter\section\expandafter*\expandafter{\acknowledgmentsname}%
}{%
\par
- \phantomsection
+ \phantomsection
\addcontentsline{toc}{section}{\protect\numberline{}\acknowledgmentsname}%
}%
}{%
@@ -4190,18 +2495,6 @@ See the REVTeX 4 README file for restrictions and more information.
%
% \subsection{Type Size-Dependent Settings}
%
-% Note that many parameters, as well as the meaning of
-% \cmd\normalsize, are deferred until
-% \cmd\AtEndOfClass\ time.
-% Therefore, code elsewhere in this class \emph{should not}
-% assume these things' values have been set!
-% \begin{macrocode}
-\AtEndOfClass{%
- \expandafter\input\expandafter{\@pointsize pt\substyle@ext}%
-}%
-% \end{macrocode}
-%
-%
% \subsection{All Point Sizes}
% \begin{macrocode}
\setcounter{secnumdepth}{4}
@@ -4242,8 +2535,7 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macrocode}
%
% \subsection{Figures}
-% \changes{v4.0beta 2}{1999/06/20}
-% {Processing delayed to \cs{AtBeginDocument} time}
+% \changes{4.0b}{1999/06/20}{Processing delayed to \cs{AtBeginDocument} time}
%
% \begin{environment}{figure}
% We define the \env{figure} environment.
@@ -4259,6 +2551,11 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macrocode}
% \end{environment}
%
+% \begin{macrocode}
+\def\listoffigures{\print@toc{lof}}%
+\def\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}%
+% \end{macrocode}
+%
% \begin{macro}{\@makecaption}
% If caption is one line long, to be centered; if lines turn, then set justified.
% \begin{macrocode}
@@ -4268,10 +2565,12 @@ See the REVTeX 4 README file for restrictions and more information.
\setlength\belowcaptionskip{2\p@}
% \end{macrocode}
%
-% \changes{v4.0beta 2}{1999/06/20}
-% {One-line caption sets flush left.}
-% \changes{v4.0beta 3}{1999/11/13}
-% {Prevent an inner footnote from performing twice}
+% \changes{4.0b}{1999/06/20}{One-line caption sets flush left.}
+% \changes{4.0c}{1999/11/13}{Prevent an inner footnote from performing twice}
+% \changes{4.1a}{2008/01/18}{(AO, 460) ``Proper style is "FIG. 1. ..." (no colon)''}%
+% There is a hook \cmd\@caption@fignum@sep\ for determining
+% the separator following the float number, e.g., ``Fig.1''.
+% Formerly, we had defined it to be ``: '', now the colon has been replace by a period (full stop).
% \begin{macrocode}
\long\def\@makecaption#1#2{%
\par
@@ -4281,14 +2580,14 @@ See the REVTeX 4 README file for restrictions and more information.
\small\rmfamily
\sbox\@tempboxa{%
\let\\\heading@cr
- #1: #2%
+ \@make@capt@title{#1}{#2}%
}%
\@ifdim{\wd\@tempboxa >\hsize}{%
\begingroup
\samepage
\flushing
\let\footnote\@footnotemark@gobble
- #1: #2\par
+ \@make@capt@title{#1}{#2}\par
\endgroup
}{%
\global \@minipagefalse
@@ -4297,6 +2596,10 @@ See the REVTeX 4 README file for restrictions and more information.
\endgroup
\vskip\belowcaptionskip
}%
+\def\@make@capt@title#1#2{%
+ \@ifx@empty\float@link{\@firstofone}{\expandafter\href\expandafter{\float@link}}%
+ {#1}\@caption@fignum@sep#2%
+}%
\def\@footnotemark@gobble{%
\@footnotemark
\@ifnextchar[{\@gobble@opt@i}{\@gobble}%
@@ -4309,6 +2612,9 @@ See the REVTeX 4 README file for restrictions and more information.
\hb@xt@1em{\hss\@makefnmark}%
#1%
}%
+\def\@caption@fignum@sep{. }%
+\def\setfloatlink{\def\float@link}%
+\let\float@link\@empty
% \end{macrocode}
% \end{macro}
%
@@ -4328,13 +2634,17 @@ See the REVTeX 4 README file for restrictions and more information.
\def\ext@figure{lof}
\def\fnum@figure{\figurename~\thefigure}
% \end{macrocode}
+% We allocate a box register for use in tallying the column inches of floats of this type.
+% \begin{macrocode}
+\expandafter\newbox\csname fbox@\ftype@figure\endcsname
+\expandafter\setbox\csname fbox@\ftype@figure\endcsname\hbox{}%
+% \end{macrocode}
% \end{macro}
%
% \subsubsection{Deferring \env{figure} Floats}%
%
-% We install a hook at \cmd\AtBeginDocument\ time which determines if
-% figures will float or will be deferred until
-% \cmd\printfigures\ time.
+% We determine if figures are to float or be deferred until \cmd\printfigures\ time.
+% If so, we open the stream that will receive the deferred document portions.
% \begin{macrocode}
\appdef\class@documenthook{%
\do@if@floats{figure}{.fgx}%
@@ -4353,10 +2663,8 @@ See the REVTeX 4 README file for restrictions and more information.
% the figures will be printed at the end of the document.
% If the command is given, but floats are not being deferred,
% it amounts to a no-op.
-% \changes{v4.0beta 2}{1999/06/20}
-% {call \cs{print@floats}}
-% \changes{v4.0beta 3}{1999/11/13}
-% {*-form mandates pagebreak}
+% \changes{4.0b}{1999/06/20}{call \cs{print@floats}}
+% \changes{4.0c}{1999/11/13}{*-form mandates pagebreak}
% \begin{macrocode}
\newcommand\printfigures{%
\@ifstar{\true@sw}{\floatp@sw{\true@sw}{\false@sw}}%
@@ -4377,16 +2685,14 @@ See the REVTeX 4 README file for restrictions and more information.
% \begin{macrocode}
\appdef\@xfloat@prep{%
\appdef\@parboxrestore{\centering}%
- \let\@makefnmark\@makefnmark@latex
- \let\@footnotemark\@footnotemark@latex
+%\let\@makefnmark\@makefnmark@latex
}%
% \end{macrocode}
% \end{macro}
%
%
% \subsection{Tables}
-% \changes{v4.0beta 2}{1999/06/20}
-% {Processing delayed to \cs{AtBeginDocument} time}
+% \changes{4.0b}{1999/06/20}{Processing delayed to \cs{AtBeginDocument} time}
%
% DPC: More or less taken from \file{revtex2} \file{aps.sty},
% but using dcolumn for decimal alignment.
@@ -4420,8 +2726,18 @@ See the REVTeX 4 README file for restrictions and more information.
\def\ext@table{lot}
\def\fnum@table{\tablename~\thetable}
% \end{macrocode}
+% We allocate a box register for use in tallying the column inches of floats of this type.
+% \begin{macrocode}
+\expandafter\newbox\csname fbox@\ftype@table\endcsname
+\expandafter\setbox\csname fbox@\ftype@table\endcsname\hbox{}%
+% \end{macrocode}
% \end{macro}
%
+% \begin{macrocode}
+\def\listoftables{\print@toc{lot}}%
+\let\l@table\l@figure
+% \end{macrocode}
+%
% \begin{macro}{\table@hook}
% \begin{macro}{\squeezetable}
% Assign a meaning to the hook installed into float processing.
@@ -4440,15 +2756,13 @@ See the REVTeX 4 README file for restrictions and more information.
%
% \subsubsection{Deferring \env{table} Floats}%
%
-% We install a hook at
-% \cmd\AtBeginDocument\ time which determines if
-% tables will float or will be deferred until
-% \cmd\printtables\ time.
+% After all packages are loaded, we decide
+% if tables will float or will be deferred until \cmd\printtables\ time.
%
% We also deal with the possibility of \env{longtable} environments.
%
% \begin{macrocode}
-\appdef\class@documenthook{%
+\def\set@table@environments{%
\floats@sw{}{%
\let@environment{longtable@float}{longtable}%
\let@environment{longtable}{longtable@write}%
@@ -4459,6 +2773,9 @@ See the REVTeX 4 README file for restrictions and more information.
}%
\do@if@floats{table}{.tbx}%
}%
+\appdef\document@inithook{%
+ \set@table@environments
+}%
\appdef\class@enddocumenthook{%
\printtables\relax
}%
@@ -4488,12 +2805,9 @@ See the REVTeX 4 README file for restrictions and more information.
% the tables will be printed at the end of the document.
% If the command is given, but floats are not being deferred,
% it amounts to a no-op.
-% \changes{v4.0beta 2}{1999/06/20}
-% {only execute if appropriate}
-% \changes{v4.0beta 3}{1999/11/13}
-% {*-form mandates pagebreak}
-% \changes{v4.0beta 4}{2000/05/17}
-% {make longtable trigger the head, too}
+% \changes{4.0b}{1999/06/20}{only execute if appropriate}
+% \changes{4.0c}{1999/11/13}{*-form mandates pagebreak}
+% \changes{4.0d}{2000/05/17}{make longtable trigger the head, too}
% \begin{macrocode}
\newcommand\printtables{%
\begingroup
@@ -4530,9 +2844,102 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macro}
%
%
+% \subsection{Videos}
+%
+% \begin{environment}{video}
+% We define the \env{video} environment analogously to the
+% \env{figure} and \env{table} environments; it is intended to contain a video.
+%
+% \begin{macrocode}
+\newenvironment{video}
+ {\@float{video}}
+ {\end@float}%
+\newenvironment{video*}
+ {\@dblfloat{video}}
+ {\end@dblfloat}%
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\thevideo}
+% The video counter and float placement defaults.
+% \begin{macrocode}
+\newcounter{video}
+\renewcommand \thevideo {\@arabic\c@video}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\fps@video{tbp}%
+\def\ftype@video{4}%
+\def\ext@video{lov}%
+\def\fnum@video{\fname@video~\thevideo}%
+\def\fname@video{Video}%
+\appdef\document@inithook{%
+ \@ifxundefined\c@float@type{}{%
+ \global\setcounter{float@type}{8}%
+ }%
+}%
+% \end{macrocode}
+% We allocate a box register for use in tallying the column inches of floats of this type.
+% \begin{macrocode}
+\expandafter\newbox\csname fbox@\ftype@video\endcsname
+\expandafter\setbox\csname fbox@\ftype@video\endcsname\hbox{}%
+% \end{macrocode}
+% The documentation for the \classname{hyperref} package, \file{hyperref.dtx} states:
+% ``classes or package which introduce new elements need to define
+% an equivalent \verb+\theH<name>+ for every \verb+\the<name>+''
+% We do accordingly here.
+% \begin{macrocode}
+\let\theHvideo\thevideo
+% \end{macrocode}
+% But \file{hyperref.dtx} goes on to say,
+% ``We do make a trap to make \verb+\theH<name>+ be the same as \verb+\arabic{<name>}+,
+% if \verb+\theH<name>+ is not defined\ldots''
+% However, it's not doing that right now (as of 6.77u),
+% and I cannot find any such code in there anymore.
+% \end{macro}
+%
+% \begin{macrocode}
+\def\listofvideos{\print@toc{lov}}%
+\let\l@video\l@figure
+% \end{macrocode}
+%
+% \subsubsection{Deferring \env{video} Floats}%
+%
+% We determine if videos are to float or be deferred until \cmd\printvideos\ time.
+% If so, we open the stream that will receive the deferred document portions.
+% \begin{macrocode}
+\appdef\class@documenthook{%
+ \do@if@floats{video}{.vdx}%
+}%
+\appdef\class@enddocumenthook{%
+ \printvideos\relax
+}%
+% \end{macrocode}
+%
+% \begin{macro}{\printvideos}
+% The user-level command \cmd\printvideos\ determines
+% where the videos are to appear in a document in which
+% \cmd\floats@sw\ is false.
+% If the user invokes the \classoption{endfloats} class option and fails to
+% insert a \cmd\printvideos\ command,
+% the videos will be printed at the end of the document.
+% If the command is given, but floats are not being deferred,
+% it amounts to a no-op.
+% \begin{macrocode}
+\newcommand\printvideos{%
+ \@ifstar{\true@sw}{\floatp@sw{\true@sw}{\false@sw}}%
+ {%
+ \print@float{video}{\oneapage}%
+ }{%
+ \print@float{video}{}%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
%
% \section{Tabular}
-% Every tabular has a double (Scotch) rule above and below.
+% Every APS tabular has a double (Scotch) rule above and below.
% The column specifier ``d'' is implemented using the \classname{dcolumn}
% package, if available.
% FIXME: always load dcolumn!
@@ -4542,9 +2949,11 @@ See the REVTeX 4 README file for restrictions and more information.
% \begin{macrocode}
\def\endtabular@hook{}%
%\RequirePackage{dcolumn}%
-\appdef\class@documenthook{%
+\appdef\document@inithook{%
\@ifpackageloaded{dcolumn}{%
- \newcolumntype{d}{D{.}{.}{-1}}%
+ \expandafter\@ifnotrelax\csname NC@find@d\endcsname{}{%
+ \newcolumntype{d}{D{.}{.}{-1}}%
+ }%
}{}%
}%
\def\toprule{\hline\hline}%
@@ -4580,32 +2989,33 @@ See the REVTeX 4 README file for restrictions and more information.
%
% \section{Footnote Text}
%
-% \changes{v4.g}{1998/06/10}
-% {single space footnotes}
-% \changes{v4.0beta 2}{1999/06/20}
-% {%
-% Frank Mittelbach, has stated in \protect\classname{multicol}:
-% ``The kernel command \cs{@footnotetext} should not be modified.''
-% Thus, I have removed David Carlisle's redefinition of that command.
-% Note, however, that later versions of \protect\classname{multicol} do not require
-% this workaround. Belt and suspenders.
-% }%
+% \changes{4.0a}{1998/06/10}{single space footnotes}
+% \changes{4.0b}{1999/06/20}{Frank Mittelbach, has stated in \protect\classname{multicol}: ``The kernel command \cs{@footnotetext} should not be modified.'' Thus, I have removed David Carlisle's redefinition of that command. Note, however, that later versions of \protect\classname{multicol} do not require this workaround. Belt and suspenders.}%
%
% \begin{macro}{\@makefntext}
+% \begin{macro}{\@makefnmark}
+% We customize the presentation of the footnote mark: it will not be italic.
% \begin{macrocode}
\def\@makefntext#1{%
\def\baselinestretch{1}%
- \reset@font\footnotesize
- \parindent 1em%
+ \parindent1em%
\noindent
\hb@xt@1.8em{%
- \Hy@raisedlink{\hyper@anchorstart{footnote@\the\c@footnote}\hyper@anchorend}%
\hss\@makefnmark
}%
- #1\par
+ #1%
+ \par
+}%
+\def\@makefnmark{%
+ \hbox{%
+ \@textsuperscript{%
+ \normalfont\@thefnmark
+ }%
+ }%
}%
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
%
% \subsection{Citations, Bibliography, Endnotes}
@@ -4623,53 +3033,91 @@ See the REVTeX 4 README file for restrictions and more information.
% \cmd\NAT@set@cites\ into \cmd\AtBeginDocument\ which presumes
% that the proper \cmd\bibpunct\ command has been issued.
%
-% We have a problem with \classname{natbib} in that it does not
-% accomodate late binding of its package options. This means
-% that those options must be known at the time the package
-% loads. Therefore, we select \classoption{sort\&compress}
-% now, and thereby foreclose on alternative uses of \classname{natbib}.
-%
-% Certain societies may prefer an alternative; they are out of luck.
-% If you find yourself in this position, please let the author
-% of \classname{natbib} know that his package should be modified to
-% accomodate late binding of package options.
-%
-% To remedy the situation, note that the macro \cmd\NAT@sort\ controls
+% Note that the macro \cmd\NAT@sort\ controls
% whether citations are left alone (\cmd\NAT@sort=0), sorted (\cmd\NAT@sort=1), or sorted and compressed (\cmd\NAT@sort=2).
% Since we give \classname{natbib} the \classoption{sort\&compress} option,
-% if you prefer \classoption{sort}, you need only define \cmd\NAT@sort\ to be 1.
+% if you prefer \classoption{sort}, you need only \cmd\let \cmd\NAT@sort\ to be \cmd\@ne.
% However, if you prefer the effect of having neither \classoption{sort} nor \classoption{sort\&compress},
-% you must define \cmd\NAT@sort\ to be 0 and you must also define
-% \cmd\NAT@sort@cites:
-%\begin{verbatim}
-%\renewcommand\NAT@sort@cites[1]{\edef\NAT@cite@list{#1}}%
-%\end{verbatim}
+% you must \cmd\let \cmd\NAT@sort\ to be \cmd\z@ and you must also define
+% \cmd\let\cmd\NAT@cmprs\ to be \cmd\z@.
+%
+% As of version 8.2, \classname{natbib} now no longer binds at the point where it is read in.
+% This means that we can freely change \cmd\NAT@sort, \cmd\NAT@cmprs, and the new
+% \cmd\NAT@merge. Henceforth, we require that this later version be used.
%
% For other \classname{natbib} customizations, you may proceed as if you were going to use
% the \file{natbib.cfg} file: anything that you can modify by this means is fair game.
% Once \revtex\ is finished loading, you can assert any definitions for \classname{natbib} that you wish.
%
+% \begin{macro}{\rev@citet}
+% \begin{macro}{\rev@citealp}
+% \begin{macro}{\rev@citealpnum}
+% We define variants on \classname{natbib}'s commands \cmd\citet, \cmd\citealp, and \cmd\citealpnum.
+% \cmd\rev@citealpnum\ uses a numerical citation.
+% \cmd\rev@citealp\ and \cmd\rev@citealpnum\ are the aliases of \cmd\onlinecite,
+% \cmd\rev@citet\ that of \cmd\textcite.
+%
+% In each case, we invoke \cmd\rtx@swap@citea\ to effect different productions between
+% multiple arguments to the \cmd\cite\ command.
+%
+% \cmd\rev@citealpnum\ provides textual citations where superscript citations are the default.
+% These should be accessible via the \cmd\citet\ command.
+%
+% Therefore we remember how to do a numerical citation
+% even when the superscript citation has been selected.
% \begin{macrocode}
-\newenvironment{thebibliography}{}{}%
-\let\@listi\@empty
-\RequirePackage[sort&compress]{natbib}[1999/05/28 7.0]%
-\let\NAT@thebibliography\thebibliography
-\let\NAT@endthebibliography\endthebibliography
-\let\bibliographystyle@latex\bibliographystyle
+\expandafter\DeclareRobustCommand
+\expandafter\rev@citet
+\expandafter{%
+ \expandafter\begingroup
+ \expandafter\rtx@swap@citea
+ \expandafter\g@bblefirsttoken
+ \csname citet \endcsname
+}%
+\expandafter\DeclareRobustCommand
+\expandafter\rev@citealp
+\expandafter{%
+ \expandafter\begingroup
+ \expandafter\rtx@swap@citea
+ \expandafter\g@bblefirsttoken
+ \csname citealp \endcsname
+}%
+\expandafter\DeclareRobustCommand
+\expandafter\rev@citealpnum
+\expandafter{%
+ \expandafter\begingroup
+ \expandafter\rtx@swap@citenum
+ \expandafter\g@bblefirsttoken
+ \csname citealp \endcsname
+}%
+\def\rtx@swap@citenum{%
+ \rtx@swap@citea
+ \let\@cite\NAT@citenum
+ \let\NAT@mbox\mbox
+ \let\citeyear\NAT@citeyear
+ \let\NAT@space\NAT@spacechar
+}%
+\def\g@bblefirsttoken{%
+ \expandafter\true@sw
+ \expandafter\@empty
+}%
% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
-% \begin{macro}{\NAT@citesuper}
-% We redefine \classname{natbib}'s procedure \cmd\NAT@citesuper,
+% \begin{macro}{\rtx@citesuper}
+% We prepare to redefine \classname{natbib}'s procedure \cmd\NAT@citesuper,
% which is executed when setting a superscript citation.
% The \cmd\hspace\ is removed: in any case, it
% should really be \cmd\hspace*, to prevent an unwanted pagebreak.
% \begin{macrocode}
-\renewcommand\NAT@citesuper[3]{%
+\newcommand\rtx@citesuper[3]{%
\ifNAT@swa
\leavevmode
\unskip
% \hspace{1\p@}%
- \textsuperscript{#1}%
+ \textsuperscript{\normalfont#1}%
\if*#3*\else\ (#3)\fi
\else
#1%
@@ -4689,27 +3137,76 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\bibliographystyle}
-% We arrange for the selection of bibliography style
-% to occur either due to the document's explicit
-% \cmd\bibliographystyle\ statement or
-% via the journal substyle.
+% \begin{macro}{\rtx@bibsection}
+% Prepare to override \classname{natbib}'s definition of \cmd\bibsection.
+% \begin{macrocode}
+\def\rtx@bibsection{%
+ \@ifx@empty\refname{%
+ \par
+ }{%
+% \let\@hangfroms@section\@hang@froms
+ \expandafter\section\expandafter*\expandafter{\refname}%
+ \@nobreaktrue
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
%
-% Note that \revtex\ is now incompatible with
-% any package that patches \cmd\bibliographystyle,
-% except for those (like \classname{natbib}) that load before here.
+% \begin{macro}{\rtx@swap@citea}
+% \begin{macro}{\rtx@def@citea}
+% \begin{macro}{\rtx@def@citea@close}
+% \begin{macro}{\rtx@def@citea@box}
+% The procedures |\rtx@def@citea|, |\rtx@def@citea@close|, and |\rtx@def@citea@box|
+% can take over the management of \classname{natbib}'s |\@citea| macro to effect more sophisticated
+% behavior of the punctuation between textual citations. The switch is performed by \cmd\rtx@swap@citea.
% \begin{macrocode}
-\let\bibliographystyle@latex\bibliographystyle
-\def\bibliographystyle{\def\@bibstyle}%
+\def\rtx@swap@citea{%
+ \let\NAT@def@citea\rtx@def@citea
+ \let\NAT@def@citea@close\rtx@def@citea@close
+ \let\NAT@def@citea@box\rtx@def@citea@box
+}%
+\def\rtx@def@citea{%
+ \advance\c@NAT@ctr\@ne
+ \let\@citea\NAT@separator
+ \@ifnum{\count@>\tw@}{%
+ \@ifnum{\c@NAT@ctr=\count@}{\appdef\@citea{\NAT@conj\NAT@space}}{}%
+ }{%
+ \def\@citea{\NAT@space\NAT@conj\NAT@space}%
+ }%
+}%
+\def\rtx@def@citea@close{%
+ \rtx@def@citea
+ \prepdef\@citea{\NAT@@close}%
+}%
+\def\rtx@def@citea@box{%
+ \rtx@def@citea@close
+ \expandafter\def\expandafter\@citea\expandafter{\expandafter\NAT@mbox\expandafter{\@citea}}%
+}%
+\def\NAT@conj{and}%
% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
+% \end{macro}
% \end{macro}
%
-% \begin{macro}{\bibsection}
+% \begin{macrocode}
+\newenvironment{thebibliography}{}{}%
+\let\@listi\@empty
+\appdef\rtx@require@packages{%
+ \RequirePackage[sort&compress]{natbib}[2008/12/08 8.3a (PWD, AO)]%
+ \let@environment{NAT@thebibliography}{thebibliography}%
+ \let@environment{thebibliography}{rtx@thebibliography}%
+ \let\bibliographystyle@latex\bibliographystyle
+ \let\NAT@citesuper\rtx@citesuper
+% \end{macrocode}
+%
% \begin{macro}{\NAT@bibsetnum}
% \begin{macro}{\NAT@bibsetup}
% \begin{macro}{\bibpreamble}
% \begin{macro}{\newblock}
% \begin{macro}{\bibnumfmt}
+% \begin{macro}{\NAT@merge}
% We define the sectioning command to use when starting the bibliography
% and gently coax \classname{natbib} into using
% the formatting procedures that \emph{we} want it to use.
@@ -4725,18 +3222,12 @@ See the REVTeX 4 README file for restrictions and more information.
% definition will be used instead, which is what the \classname{natbib}
% package gives as its programming interface.
%
-% And if the substyle does not give a meaning to \cmd\place@bibnumber,
-% we give it that of the original \cmd\bibnumfmt.
+% We set \cmd\NAT@merge\ to \cmd\tw@, which turns on \classname{natbib}'s
+% \classname{mcite} capabilities. This is the default setting.
+% If numerical citations are not to be used, then \cmd\NAT@merge\
+% should be set to \cmd\@ne\ (syntax is still enabled, but semantics are turned off).
% \begin{macrocode}
-\def\bibsection{%
- \@ifx@empty\refname{%
- \par
- }{%
- \let\@hangfroms@section\@hang@froms
- \section*{\refname}%
- \@nobreaktrue
- }%
-}%
+\let\bibsection\rtx@bibsection
\let\NATx@bibsetnum\NAT@bibsetnum
\def\NAT@bibsetnum#1{%
\setlength{\topsep}{\z@}%
@@ -4756,13 +3247,10 @@ See the REVTeX 4 README file for restrictions and more information.
\def\newblock{\ }%
\let\NATx@bibnumfmt\bibnumfmt
\def\bibnumfmt{\place@bibnumber}%
-\AtEndOfClass{%
- \appdef\class@documenthook{%
- \@ifxundefined\place@bibnumber{%
- \let\place@bibnumber\NATx@bibnumfmt
- }{}%
- }%
-}%
+\let\NAT@merge\thr@@
+\let\NAT@citeyear\citeyear
+\let\onlinecite\rev@citealp
+\let\textcite\rev@citet
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -4771,124 +3259,125 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\NAT@onlinecite}
-% We anticipate using numerical citations.
-% If superscript citations are used, we nonetheless need a way to
-% use numerical citations as required by the author.
-% These should be accessible via the \cmd\citet\ command.
+% \begin{macro}{\bibliographystyle}
+% We arrange for the selection of bibliography style
+% to occur either due to the document's explicit
+% \cmd\bibliographystyle\ statement or
+% via the journal substyle.
%
-% Therefore we remember how to do a numerical citation
-% even when the superscript citation has been selected.
+% Note that \revtex\ is incompatible with
+% any package that patches \cmd\bibliographystyle.
+% Since \classname{natbib} does this, we need a fix.
+% \begin{macrocode}
+\let\bibliographystyle@latex\bibliographystyle
+\def\bibliographystyle{\def\@bibstyle}%
+% \end{macrocode}
+% We customize one of the productions of \classname{natbib}.
+% \begin{macrocode}
+\let\bibitemContinue\bibitemContinue@rtx
+% \end{macrocode}
+% \end{macro}
%
-% Can you say ``inelegant hack''? I knew you could!
+% Here ends the code to be executed at \cmd\rtx@require@packages\ time.
% \begin{macrocode}
-\let\NAT@citeyear\citeyear
-\def\NAT@onlinecite#1{%
- \begingroup
- \let\@cite\NAT@citenum
- \let\NAT@mbox\mbox
- \let\citeyear\NAT@citeyear
- \def\NAT@space{ }%
- \cite{#1}%
- \endgroup
}%
% \end{macrocode}
-% \end{macro}
+% \changes{4.1f}{2009/07/07}{(AO, 516) Merged references are separated with a semicolon}
+% Redefine a macro of \classname{natbib} so that merged references are separated with a semicolon.
+% \begin{macrocode}
+\def\bibitemContinue@rtx{;\spacefactor\@mmm\space}%
+% \end{macrocode}
%
-% \begin{macro}{+}
+% \begin{macro}{\onlinecite}
% \begin{macro}{\textcite}
% We extend \classname{natbib}'s syntax with two commands to set a citation
% on the baseline (as opposed to superscripted) and as text (rather than parenthetical), respectively.
% A journal substyle that makes citations be superscripted or parenthetical as the case may be, should ensure
-% that the author has continued access to these two styles.
+% that the author has continued access to these two styles.
+%
+% Note that the society or journal substyle override the meanings of \cmd\@onlinecite\ or
+% \cmd\@textcite\ given here.
%
% \begin{macrocode}
-\appdef\class@inithook{%
- \@ifxundefined\@onlinecite{\def\@onlinecite{\citealp}}{}%
- \@ifxundefined\@textcite{\def\@textcite{\citet}}{}%
-}%
\DeclareRobustCommand\onlinecite{\@onlinecite}%
\DeclareRobustCommand\textcite{\@textcite}%
% \end{macrocode}
% \end{macro}
% \end{macro}
%
-% \begin{environment}{thebibliography}%
+% \begin{macro}{\bibliography}
+% \changes{4.1a}{2008/01/18}{(AO, 457) Endnotes to be sorted in with numerical citations.}%
+% Provide a hook for supplying Bib\TeX\ a bibliographic database that may contain, say,
+% footnotes.
+%
+% Note that Bib\TeX\ chokes if the argument of the \cmd\bibdata\ command has null fields,
+% hence these tests.
+% \begin{macrocode}
+\let\bibliography@latex\bibliography
+\def\bibliography#1{%
+ \@ifx@empty{\pre@bibdata}{%
+ \bibliography@latex{#1}%
+ }{%
+ \@if@empty{#1}{%
+ \expandafter\bibliography@latex\expandafter{\pre@bibdata}%
+ }{%
+ \expandafter\bibliography@latex\expandafter{\pre@bibdata,#1}%
+ }%
+ }%
+ \let\auto@bib\@empty
+}%
+\let\pre@bibdata\@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{environment}{rtx@thebibliography}%
% \begin{macro}{\present@bibnote}%
% We put a tail patch into \cmd\thebibliogrphy\ and
% a headpatch into \cmd\endthebibliography.
%
-% We also apply a fix to the \cmd\list\ procedure
-% so that, at least within the bibliography,
-% items are not formatted via \cmd\parshape,
-% which caused problems during column balancing.
-% (Other list-like environments may also require fixing,
-% but we will save that for another day.)
-%
% Here we provide a default treatment for frontmatter notes
% deferred to the bibliography; a journal substyle
% might want to override the definition of \cmd\present@bibnote.
+%
+% \changes{4.1f}{2009/07/11}{(AO, 521) Lonely bibliography head}%
+% We make provisions for the case where there are no \cmd\bibitem s
+% for the bibliography: we produce no bibliography head at all.
+%
% \begin{macrocode}
-\renewenvironment{thebibliography}[1]{%
+\newenvironment{rtx@thebibliography}[1]{%
\NAT@thebibliography{#1}%
- \@clubpenalty\clubpenalty
\let\@TBN@opr\present@bibnote
\@FMN@list
}{%
- \@endnotesinbib
+%\@endnotesinbib
\edef\@currentlabel{\arabic{NAT@ctr}}%
\label{LastBibItem}%
- \NAT@endthebibliography
+ \endNAT@thebibliography
\global\let\auto@bib\@empty
}%
\def\present@bibnote#1#2{%
\item[%
\textsuperscript{%
\normalfont
- \Hy@raisedlink{\hyper@anchorstart{frontmatter@#1}\hyper@anchorend}%
+ \Hy@raisedlink{\hyper@anchorstart{frontmatter.#1}\hyper@anchorend}%
\begingroup
\c@footnote#1\relax
\frontmatter@thefootnote
\endgroup
}%
]#2\par
+%\global\let\NAT@bibitem@first@sw\@secondoftwo
}%
% \end{macrocode}
% \end{macro}
% \end{environment}
%
-% \begin{macro}{\place@bibnumber@sup}
-% \begin{macro}{\place@bibnumber@inl}
-% For producing the \cmd\bibitem\ device,
-% we define two procedures to select from.
-%
-% Note that we could have used \classname{natbib}'s \cmd\ifNAT@super\
-% switch, but it does not allow for altering the meaning of \cmd\bibnumfmt.
-% \begin{macrocode}
-\def\place@bibnumber@sup#1{\textsuperscript{#1}}%
-\def\place@bibnumber@inl#1{[#1]}%
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-%% \begin{macro}{\@cite}
-%% \begin{macro}{\nocite}
% \begin{macro}{write@bibliographystyle}
% We wish to delay committing the \cmd\bibliographystyle\ until as late as possible.
% The journal substyle will define a default bibliography style, and
% the document's explicit \cmd\bibliographystyle\ command, if any, will override that default.
-%% For the sake of Bib\TeX, we must execute the \cmd\bibliographystyle\ command
-%% (putting a \cmd\bibstyle\ command into the auxiliary file)
-%% somewhere before the first \cmd\cite\ command (or any other like command),
-%% which puts a \cmd\citation\ command into the auxiliary file.
-%%
-%% Therefore, we headpatch the two procedures in \classname{natbib} that can result in
-%% the appearance in the auxiliary file of a \cmd\citation\ command.
-%% These two procedures are \cmd\@cite\ and \cmd\nocite.
-%%
-%% Not!
-%
-% The \cmd\bibstyle\ command may appear quite late in the \filename{.aux} file.
+%
+% The \cmd\bibstyle\ command is allowed appear quite late in the \file{.aux} file.
% We now delay the automatic writing of the \cmd\bibstyle\ command to the end of the job.
%
% The procedure \cmd\write@bibliographystyle\ tests whether a \cmd\bibliographystyle\ command has
@@ -4897,12 +3386,6 @@ See the REVTeX 4 README file for restrictions and more information.
% (we only need to do this once per job).
%
% \begin{macrocode}
-%\AtBeginDocument{%
-% \let\natbib@@cite\@cite
-% \def\@cite{\write@bibliographystyle\natbib@@cite}%
-% \let\natbib@nocite\nocite
-% \def\nocite{\write@bibliographystyle\natbib@nocite}%
-%}%
\def\write@bibliographystyle{%
\@ifxundefined\@bibstyle{}{%
\expandafter\bibliographystyle@latex\expandafter{\@bibstyle}%
@@ -4912,84 +3395,120 @@ See the REVTeX 4 README file for restrictions and more information.
\AtEndDocument{\write@bibliographystyle}%
% \end{macrocode}
% \end{macro}
-%% \end{macro}
-%% \end{macro}
%
-% \begin{macro}{\super@cite}
-% \begin{macro}{\super@cite@}
-% The \cmd\super@cite\ procedure takes the place of \cmd\@citex\ and implements the feature of the
+% \begin{macro}{\rtx@@citetp}
+% \begin{macro}{\rtx@citex}
+% \begin{macro}{\super@cite@let}
+% \begin{macro}{\super@cite@end}
+% \begin{macro}{\super@cite@swap}
+% We wish to extend \classname{natbib} to move spaces and citations around
+% a subscript style citation, imitating Donald Arseneau's \classname{cite} package
+% with the \classoption{super}.
+%
+% The \cmd\rtx@@citetp\ procedure is substituted for \cmd\NAT@@citetp;
+% it then calls the \cmd\rtx@citex\ procedure and implements the features of the
% \classoption{citeautoscript} class option.
-% This means that the document should be marked up as if citations were \emph{not} superscripted,
+% In the end, \cmd\@citex\ is called with its customary parameters.
+%
+% The document should be marked up as if citations were \emph{not} superscripted,
% and then if you select a journal substyle that has superscripted citations, \revtex\ will do its best
% to alter the formatting of the \cmd\cite s to accomodate superscript style.
%
-% Note that the commands \cmd\onlinecite\ and \cmd\textcite\ are not affected by this procedure.
+% Only citations set as superscript are affected by this procedure,
+% because we check \cmd\@cite\ against \cmd\NAT@citesuper.
%
-% Here's a subtle one: when is the argument of \cmd\super@cite@@\ not the same as the token \cmd\@let@token?
+% Here's a subtle point: when is the argument of \cmd\super@cite@swap\ not the same as the token \cmd\@let@token?
% Answer: when the latter is \cmd\@sptoken! This case has to be handled separately.
%
-% \begin{macrocode}
-\def\super@cite[#1][#2]#3{%
- \leavevmode
- \skip@\lastskip
- \unskip
+% Note that whether a punctuation is movable is determined by the definition
+% of a particular control sequence name.
+% A society or journal can alter things: to remove a character from the set,
+% do, say, \cmd\expandafter \cmd\let \cmd\csname \texttt{rtx@automove;} \cmd\endcsname \cmd\relax.
+% To add a character to the set, do, say, \cmd\expandafter \cmd\let \cmd\csname \texttt{rtx@automove;} \cmd\endcsname \cmd\@empty.
+%
+% Implementation note: due to a \TeX\ peculiarity, we have to check for the case
+% where \cmd\@let@token\ is a space token \emph{before} we parse forward.
+% At issue is the corner case where an end of file is at hand. If we
+% were to let \cmd\super@cite@swap\ parse forward, we would encounter a \TeX\ end-of-file
+% error. Note that the test will be true in many distinct cases:
+% the file ends, the next character is a line terminator, the next character is a space.
+% \begin{macrocode}
+\def\rtx@@citetp[#1]{\@ifnextchar[{\rtx@citex[#1]}{\rtx@citex[][#1]}}%
+\def\rtx@citex[#1][#2]#3{%
\begingroup
\def\@tempa{[#1][#2]{#3}}%
- \super@cite@
+ \@ifx{\@cite\NAT@citesuper}{%
+ \leavevmode
+ \skip@\lastskip
+ \unskip
+ \super@cite@let
+ }{%
+ \super@cite@end
+ }%
+}%
+\def\super@cite@let{%
+ \futurelet\@let@token\super@cite@check
}%
-\def\super@cite@{%
- \futurelet\@let@token\super@cite@@
+\def\super@cite@end{%
+ \aftergroup\@citex\expandafter\endgroup\@tempa
}%
-\long\def\super@cite@@#1{%
+\def\super@cite@check{%
\@ifx{\@let@token\@sptoken}{%
- \aftergroup\@sptoken\false@sw
+ \super@cite@end
}{%
- \@ifx{\@let@token.}{\true@sw}{%
- \@ifx{\@let@token,}{\true@sw}{%
- \@ifx{\@let@token'}{\true@sw}{%
- \@ifx{\@let@token)}{\true@sw}{%
- \false@sw
- }%
- }%
- }%
- }%
+ \super@cite@swap
}%
- {%
+}%
+\long\def\super@cite@swap#1{%
+ \expandafter\@ifx\expandafter{\csname rtx@automove#1\endcsname\@empty}{%
#1%
- \super@cite@
+ \super@cite@let
}{%
- \expandafter\@citex@NAT\@tempa\endgroup
+ \super@cite@end
#1%
}%
}%
-\AtBeginDocument{%
+\expandafter\let\csname rtx@automove.\endcsname\@empty
+\expandafter\let\csname rtx@automove,\endcsname\@empty
+\expandafter\let\csname rtx@automove:\endcsname\@empty
+\expandafter\let\csname rtx@automove;\endcsname\@empty
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The following must execute only after \classname{natbib} is loaded and has set
+% up its parameters (which it does at \cmd\AtBeginDocument\ time).
+% If superscript citations have been selected, and
+% if the \classoption{citeautoscript} class option has been selected,
+% we patch into \classname{natbib}'s mechanism to migrate punctuation around the
+% citation, as in class \classname{cite} with the \classoption{superscript} option.
+% \begin{macrocode}
+\appdef\class@documenthook{%
\citeautoscript@sw{%
- \@ifx{\place@bibnumber\place@bibnumber@sup}{%
- \let\@citex@NAT\@citex\let\@citex\super@cite
+ \@ifx{\@cite\NAT@citesuper}{%
+ \let\NAT@@citetp\rtx@@citetp
}{}%
}{}%
}%
% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
%
% Resolve an incompatability between \classname{natbib} and \classname{listings}.
% The latter package tests \cmd\chapter (which has now been \cmd\let\ to \cmd\relax\ as a side effect \classname{natbib}'s use of \LaTeX's \cmd\@ifundefined).
%
% We couch our fix in such terms that will not be disruptive if \cmd\chapter\ is actually defined at this point.
-% \begin{macrocode}
-\@ifx{\chapter\relax}{\let\chapter\@undefined}{}%
-% \end{macrocode}
+%
+% \changes{4.1b}{2008/07/01}{(AO) No longer need to test \cs{chapter} as of \texttt{natbib} version 8.2}
+% \begin{verbatim}
+%\@ifx{\chapter\relax}{\let\chapter\@undefined}{}%
+% \end{verbatim}
%
%
% \subsubsection{\cs{endnote}s and \cs{rtx@bibnote}s}
-% FIXME: check hyperref compatibility!
%
% \begin{macro}{\mini@note}
% \begin{macro}{\save@note}
% \begin{macrocode}
-\def\mini@note{\save@note\mini@notes}%Implicit #1
+\def\mini@note{\save@note\mini@notes}%Implicit #2
\def\save@note#1#2{%
\stepcounter{footnote}%
\protected@xdef\@thefnmark{\the\c@footnote}%
@@ -5008,119 +3527,211 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macro}
%
% \begin{macro}{\endnote}
-% A version of footnote that appears at the end of the document.
-% Actually it just appears where \cmd\printendnotes\ appears.
-% \begin{macrocode}
-\def\endnote{%
- \begingroup
- \aftergroup\@footnotemark
- \aftergroup\@endnotetext
- \@ifnextchar[{%
- \@xendnote
- }{%
- \stepcounter{footnote}%
- \protected@xdef\@tempa{\thefootnote}%
- \expandafter\@xendnote\expandafter[\@tempa]%
- }%
-}%
-% \end{macrocode}
+% A version of footnote that appears in the bibliography, or where \cmd\printendnotes\ appears.
+% \begin{verbatim}
+%\def\@endnote{%
+% \begingroup
+% \aftergroup\@footnotemark
+% \aftergroup\@endnotetext
+% \@ifnextchar[{%
+% \@xendnote
+% }{%
+% \stepcounter{footnote}%
+% \protected@xdef\@tempa{\thefootnote}%
+% \expandafter\@xendnote\expandafter[\the\c@footnote]%
+% }%
+%}%
+% \end{verbatim}
% \end{macro}
%
% \begin{macro}{\@xendnote}
+% \changes{4.1a}{2008/01/18}{(AO, 457) Endnotes to be sorted in with numerical citations.}%
+% \begin{verbatim}
+%\def\unused@xendnote[#1]{%
+% \begingroup
+% \c@footnote#1\relax
+% \end{macrocode}
+% New for 4.1
% \begin{macrocode}
-\def\@xendnote[#1]{%
- \begingroup
- \c@footnote#1\relax
- \unrestored@protected@xdef\@thefnmark{endnote\thefootnote}%
- \endgroup
- \endgroup
-}%
-\def\@endnotemark{%
+% \unrestored@protected@xdef\@endnotelabel{Note\thefootnote}%
+% \authoryear@sw{%
+% \unrestored@protected@xdef\@thefnmark{\noexpand\ref{\@endnotelabel}}%
+% }{%
+% \unrestored@protected@xdef\@thefnmark{\@endnotelabel}%
+% }%
+% \end{macrocode}
+% Was:
+% \unrestored@protected@xdef\@thefnmark{endnote\thefootnote}%
+% End 4.1 changes
+% \begin{macrocode}
+% \endgroup
+% \endgroup
+%}%
+%\def\@endnotemark{%
+% \expandafter\cite\expandafter{\@thefnmark}%
+%}%
+% \end{verbatim}
+% \begin{macrocode}
+\def\rev@citemark#1{%
\expandafter\cite\expandafter{\@thefnmark}%
}%
+\def\rev@endtext#1{%
+ \let\@endnotelabel\@thefnmark
+ \@endnotetext
+}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\endnote@ext}
+% \begin{macro}{\bibdata@app}
+% \begin{macro}{\bibdata@ext}
+% The macro \cmd\endnote@ext\ is the file extension for the auxiliary file holding footnotes.
+% The \cmd\bibdata@app\ and \cmd\bibdata@ext\ macros are used to form the name of a
+% Bib\TeX\ database file holding footnotes.
% \begin{macrocode}
\def\endnote@ext{.end}%
+\def\bibdata@app{Notes}%
+\def\bibdata@ext{bib}%
% \end{macrocode}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@endnotetext}
+% \changes{4.1a}{2008/01/18}{(AO, 457) Endnotes to be sorted in with numerical citations.}%
+% The procedure \cmd\@endnotetext\ writes a Bib\TeX\ .bib file for the purpose
+% of insering a footnote into the (numbered, unsorted) bibliography.
+%
+% We need to define \cmd\pre@bibdata\ to be
+% \cmd\jobname\cmd\endnote@ext, and we probably should define \cmd\endnote@ext\ to
+% be something like ``Notes.bib''.
+%
+% In each case, the material to be written out requires robustification, provided by \cmd\endnote@relax.
% The commands \cmd\label, \cmd\index, and \cmd\glossary,
% which are robustified for \cmd\markright\ and \cmd\addcontentsline,
% are likewise robustified here.
%
-% Note the similarity to \cmd\protected@write.
+% Procedure \cmd\@endnotetext@note\ is the alias for \cmd\@endnotetext\ when the endnotes are to be
+% processed separately from the bibliography (generally true when citations are not sorted).
+% \begin{verbatim}
+%\long\def\unused@endnotetext@note#1{%
+% \@ifxundefined\@endnoteout{%
+% \newwrite\@endnoteout
+% \gdef\endnote@stream{\jobname\endnote@ext}%
+% \immediate\openout\@endnoteout\endnote@stream\relax
+% }{}%
+% \begingroup
+% \endnote@relax
+% \immediate\write\@endnoteout{\string\@doendnote{\@endnotelabel}{#1}}%
+% \endgroup
+%}%
+% \end{verbatim}
+%
+% \begin{macro}{\@doendnote}
+% \cmd\@doendnote\ is obsolete.
+% \begin{verbatim}
+%\def\@doendnote#1#2{\bibitem{#1}#2}%
+% \end{verbatim}
+% \end{macro}
+%
+% Procedure \cmd\@endnotetext\ is the operative procedure\ when the endnotes are to be
+% collated in with the other references, typically true when numerical citations are being used.
+% The technique involves writing a .bib file (\cmd\@bibdataout) with each endnote typed as
+% a \texttt{@MISC} entry.
+%
+% Timing note: doing \cmd\openout\ should be deferred until the beginning of the document,
+% as is done here. This allows one to make a format (\filename{.fmt}) file out of this class.
% \begin{macrocode}
\long\def\@endnotetext#1{%
- \@ifxundefined\@endnoteout{%
- \newwrite\@endnoteout
- \gdef\endnote@stream{\jobname\endnote@ext}%
- \immediate\openout\@endnoteout\endnote@stream\relax
- }{}%
\begingroup
- \let\label\relax \let\index\relax \let\glossary\relax
- \let\cite \relax \let\ref \relax \let\pageref \relax
- \let\( \relax \let\) \relax \let\\ \relax
-% \let\protect\noexpand
- \let \protect \@unexpandable@protect
- \newlinechar`\^^M%
-% \newlinechar`\ %
- \immediate\write\@endnoteout{\string\@doendnote{\@thefnmark}{#1}}%
+ \endnote@relax
+ \immediate\write\@bibdataout{@MISC{\@endnotelabel,note="#1"}}%year="\@endnotelabel",
\endgroup
}%
+\newwrite\@bibdataout
+\appdef\class@documenthook{%
+ \immediate\openout\@bibdataout\pre@bibdata.\bibdata@ext\relax
+}%
% \end{macrocode}
-% \end{macro}
%
-% \begin{macro}{\endnotetext}
+% Procedure \cmd\endnote@relax\ robustifies commands that ought not to be expanded when
+% the endnote is written out.
+% Note the similarity between \cmd\endnote@relax\ and \cmd\protected@write.
% \begin{macrocode}
-\def\endnotetext{%
- \@ifnextchar[{%
- \@xendnotenext
- }{%
- \protected@xdef\@thefnmark{\thefootnote}%
- \@endnotetext
- }%
+\def\endnote@relax{%
+ \let\label\relax \let\index\relax \let\glossary\relax
+ \let\cite \relax \let\ref \relax \let\pageref \relax
+ \let\( \relax \let\) \relax \let\\ \relax
+ \let~\relax
+%\let\protect\noexpand
+ \let \protect \@unexpandable@protect
+ \newlinechar`\^^M%
+%\newlinechar`\ %
+ \let\begin\relax \let\end\relax
}%
% \end{macrocode}
% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\endnotetext}
+% \begin{verbatim}
+%\def\unused@endnotetext{%
+% \@ifnextchar[{%
+% \@xendnotenext
+% }{%
+% \protected@xdef\@thefnmark{\thefootnote}%
+% \@endnotetext
+% }%
+%}%
+% \end{verbatim}
+% \end{macro}
%
% \begin{macro}{\@xendnotenext}
-% \begin{macrocode}
-\def\@xendnotenext[#1]{%
- \begingroup
- \c@footnote#1\relax
- \unrestored@protected@xdef\@thefnmark{\thefootnote}%
- \endgroup
- \@endnotetext
-}%
-% \end{macrocode}
+% \begin{verbatim}
+%\def\unused@xendnotenext[#1]{%
+% \begingroup
+% \c@footnote#1\relax
+% \unrestored@protected@xdef\@thefnmark{\thefootnote}%
+% \endgroup
+% \@endnotetext
+%}%
+% \end{verbatim}
% \end{macro}
%
% \begin{macro}{\printendnotes}
+% \changes{4.1f}{2009/07/10}{(AO, 520) Automatically produce \cs{bibliography} command when needed}%
+% We have removed the endnotes facility from REVTeX, so the \cmd\printendnotes\ command now does nothing.
+%
+% Moving footnotes to the bibliogrphy is now accomplished through
+% the automatic generation of a job BiB\TeX\ database (called \cmd\pre@bibdata) containing the footnotes.
% \begin{macrocode}
\def\printendnotes{%
- \@ifx{\@endnoteout\@undefined}{}{%
- \begingroup
- \c@secnumdepth-\maxdimen
- \section{%
- \notesname
- }%
- \immediate\closeout\@endnoteout
- \global\let\@endnoteout\@undefined
- \begin{enumerate}%
- \makeatletter
- \input{\endnote@stream}%
- \end{enumerate}%
- \endgroup
- }%
-}%
-\appdef\class@enddocumenthook{%
- \printendnotes
+ \class@warn{The \string\printendnotes\space command no longer serves any function. Please remove it from your document.}%
}%
% \end{macrocode}
+% \begin{verbatim}
+%\def\printendnotes{%
+% \@ifx{\@endnoteout\@undefined}{}{%
+% \begingroup
+% \c@secnumdepth-\maxdimen
+% \section{%
+% \notesname
+% }%
+% \immediate\closeout\@endnoteout
+% \global\let\@endnoteout\@undefined
+% \begin{enumerate}%
+% \makeatletter
+% \input{\endnote@stream}%
+% \end{enumerate}%
+% \endgroup
+% }%
+%}%
+%\appdef\class@enddocumenthook{%
+% \printendnotes
+%}%
+% \end{verbatim}
% \end{macro}
%
% \begin{macro}{\firstnote@num}
@@ -5133,6 +3744,7 @@ See the REVTeX 4 README file for restrictions and more information.
% If footnotes appear in the bibliography, we initialise
% the footnote counter to number of cites (found last time)
% via \cmd\set@firstnote.
+% \changes{4.1a}{2008/01/18}{(AO, 451) ``Cannot have more than 256 cites in a document''}%
%
% \begin{macrocode}
\mathchardef\firstnote@num\z@
@@ -5145,7 +3757,7 @@ See the REVTeX 4 README file for restrictions and more information.
\class@warn@end{Endnote numbers changed: rerun LaTeX}%
}%
\immediate\write\@mainaux{%
- \global\chardef\string\firstnote@num#1\relax
+ \global\mathchardef\string\firstnote@num#1\relax
}%
}%
% \end{macrocode}
@@ -5154,6 +3766,7 @@ See the REVTeX 4 README file for restrictions and more information.
%
% \begin{macro}{\@endnotesinbib}
% \begin{macro}{\@endnotesinbibliography}
+% \changes{4.1a}{2008/01/18}{(AO, 457) Endnotes to be sorted in with numerical citations.}%
% We define a function \cmd\@endnotesinbib,
% and a variant \cmd\@endnotesinbibliography.
% The former is invoked at the start of
@@ -5165,156 +3778,243 @@ See the REVTeX 4 README file for restrictions and more information.
% simply arrange for the footnote counter to be
% reset at the start of the document.
%
-% The switchover to setting footnotes in the bibliography
-% is done via \cmd\AtBeginDocument\ code that
-% changes the meaning of \cmd\footnote\ and
-% that substitutes the synonym for
-% \cmd\@endnotesinbib.
-%
% Note that this code make the assumption that
% the counter used in \env{thebibliography} is \cmd\c@NAT@ctr.
+% \changes{4.1f}{2009/07/10}{(AO, 520) Automatically produce \cs{bibliography} command when needed}%
%
+% Obsolete code is commented out.
+% \begin{verbatim}
+%\def\@endnotesinbib{%
+% \set@firstnote\z@
+%}%
+%\def\@endnotesinbibliography{%
+% \expandafter\set@firstnote\expandafter{\the\c@NAT@ctr}%
+% \@ifx{\@endnoteout\@undefined}{}{%
+% \immediate\closeout\@endnoteout
+% \global\let\@endnoteout\@undefined
+% \makeatletter
+% \input{\endnote@stream}%
+% }%
+%}%
+% \end{verbatim}
+% Here is the sole place where \cmd\footinbib@sw\ has an effect, other code simple assigning its value.
+% If it is false, or \cmd\authoryear@sw\ is true, then footnotes are handled by the default mechanism.
% \begin{macrocode}
-\def\@endnotesinbib{%
- \set@firstnote\z@
+\def\make@footnote@endnote{%
+ \footinbib@sw{%
+ \authoryear@sw{}{%
+ \ltx@footnote@push
+ \def\thempfn{Note\thefootnote}%
+ \let\ltx@footmark\rev@citemark
+ \let\ltx@foottext\rev@endtext
+% \end{macrocode}
+% The endnotes facility has been removed.
+% Also, there is no need to queue up \cmd\auto@bib\ here, since it is always queued up elsewhere.
+% \changes{4.1f}{2009/07/10}{(AO, 520) Automatically produce \cs{bibliography} command when needed}%
+% \begin{verbatim}
+% \appdef\class@enddocumenthook{\auto@bib}%
+% \let\printendnotes\relax
+% \end{verbatim}
+% \begin{macrocode}
+ }%
+ }{}%
}%
-\def\@endnotesinbibliography{%
- \expandafter\set@firstnote\expandafter{\the\c@NAT@ctr}%
- \@ifx{\@endnoteout\@undefined}{}{%
- \immediate\closeout\@endnoteout
- \global\let\@endnoteout\@undefined
- \makeatletter
- \input{\endnote@stream}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\ltx@footnote@push{%
+ \let\ltx@footmark@latex\ltx@footmark
+ \let\ltx@foottext@latex\ltx@foottext
+ \let\thempfn@latex\thempfn
+ \def\ltx@footnote@pop{%
+ \let\ltx@footmark\ltx@footmark@latex
+ \let\ltx@foottext\ltx@foottext@latex
+ \let\thempfn\thempfn@latex
}%
}%
+% \end{macrocode}
+%
+% The switchover to setting footnotes in the bibliography
+% changes the meaning of \cmd\footnote\ and
+% substitutes the synonym for \cmd\@endnotesinbib.
+%
+% We arrange for the procedure \cmd\make@footnote@endnote\ to be executed
+% at \cmd\class@documenthook\ time (we mustn't do this earlier because
+% the meaning of \cmd\@footnotemark\ must not be changed before then,
+% for the sake of \file{ltxutil.dtx}).
+% \begin{macrocode}
\appdef\class@documenthook{%
- \let\@makefnmark@latex\@makefnmark
- \let\@footnotemark@latex\@footnotemark
- \footinbib@sw{%
- \let\footnote\endnote
- \let\@footnotemark\@endnotemark
- \let\@makefnmark\@makefnmark@cite
- \let\@endnotesinbib\@endnotesinbibliography
- \appdef\class@enddocumenthook{\auto@bib}%
- \let\printendnotes\relax
- }{}%
+ \make@footnote@endnote
}%
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\auto@bib}
+% \changes{4.1f}{2009/07/10}{(AO, 520) Automatically produce \cs{bibliography} command when needed}%
% Under some circumstances, we must typeset the bibliography automatically.
-% For instance, the document specifies footnotes in the bibliography, but contains
-% no bibliography.
+% If the document requires footnotes to be set in the bibliography (effectively, class option \texttt{footinbib}),
+% or that frontmatter footnotes be set in the bibliography (effectively, class option \texttt{bibnotes}),
+% but contains no explicit \cmd\bibliography\ statement.
%
% Note that this facility is not able to work more than once per document.
% If multiple bibliographys are required (e.g., per article), it will be the responsibility of the journal style
% to restore \cmd\auto@bib\ to its original meaning so it can be re-invoked.
+%
+% In procedure \cmd\auto@bib, we first test for the presence of frontmatter footnotes deferred to the bibliography.
+% If none, we further test for the presence of \cmd\bibitem\ commands in the job's \filename{.bbl} file.
+% If either condition is met, we ask for a bibliography.
+% We know that the document itself lacks a \cmd\bibliography\ statement,
+% so we know the argument of the \cmd\bibliography\ that we will issue.
% \begin{macrocode}
\def\auto@bib{%
\@ifx@empty\@FMN@list{%
- \@ifxundefined\@endnoteout{%
- \false@sw
+ \footinbib@sw{%
+ \@ifnum{\thefootnote>\z@}{%
+ \true@sw
+ }{%
+ \test@bbl@sw
+ }%
}{%
- \true@sw
+ \test@bbl@sw
}%
}{%
\true@sw
- }{%
- \begin{thebibliography}{}\end{thebibliography}%
}%
+ {%
+ \bibliography{}%
+ }{}%
}%
% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@doendnote}
+% Testing the \filename{.bbl} file involves defanging all expected commands
+% and processing that file inside a box register (that will be simply discarded).
+% We provide a new meaning for the \cmd\bibitem\ command: it sets a Boolean.
+% \begin{macrocode}
+\def\test@bbl@sw{%
+ \begingroup
+ \let\providecommand\providecommand@j@nk
+ \let@environment{thebibliography}{thebibliography@nogroup}%
+ \let\bibfield\@gobbletwo
+ \let\bibinfo\@gobbletwo
+ \let\translation\@gobble
+ \let\BibitemOpen\@empty
+ \let\bibitemStop\@empty
+ \let\bibitemNoStop\@empty
+ \let\EOS\@empty
+ \let\BibitemShut\@gobble
+ \let\bibAnnoteFile\@gobbletwo
+ \let\bibAnnote\@gobblethree
+ \let\textbf\@gobble
+ \let\emph\@gobble
+ \@booleanfalse\bibitem@sw
+ \let\bibitem\bibitem@set
+ \setbox\z@\vbox{\IfFileExists {\jobname.bbl}{\@@input\@filef@und}{}}%
+ \bibitem@sw{\aftergroup\true@sw}{\aftergroup\false@sw}%
+ \endgroup
+}%
+\newcommand\bibitem@set[1][]{%
+ \bibitem@sw{}{%
+ \@booleantrue\bibitem@sw
+ \aftergroup\@booleantrue\aftergroup\bibitem@sw
+ }%
+}%
+% \end{macrocode}
+% The following should be part of \filename{ltxutil}.
% \begin{macrocode}
-\def\@doendnote#1#2{\bibitem{#1}#2}
+\long\def \@gobblethree #1#2#3{}%
+\def\providecommand@j@nk#1[#2]{%
+ \@ifnum{#2=\z@}{\def\j@nk}{%
+ \@ifnum{#2=\@ne}{\def\j@nk##1}{%
+ \@ifnum{#2=\tw@}{\def\j@nk##1##2}{%
+ \@ifnum{#2=\thr@@}{\def\j@nk##1##2##3}{%
+ }%
+ }%
+ }%
+ }%
+}%
+\def\thebibliography@nogroup#1{\endgroup\def\@currenvir{thebibliography}}%
+\def\endthebibliography@nogroup{\begingroup}%
% \end{macrocode}
% \end{macro}
%
-%
-%
% \section{Initial setup}
-% \changes{v4.0beta 2}{1999/06/20}
-% {Defer assignment until \cs{AtBeginDocument} time.}
-% Note that this code is executed at \cmd\AtBeginDocument\ time
-% in order to handle a particular timing problem.
-% Please do not move this code any earlier!
+%
+% The standard LaTeX document classes execute certain commands
+% that are best deferred until \cmd\class@documenthook\ time.
+% Here, we effectively split \cmd\pagenumbering\ into two halves,
+% with a default definition for \cmd\thepage
+% and an initialization of \cmd\c@page\ at \cmd\class@documenthook\ time.
+%
+% The meaning of \cmd\thepage\ can be overridden by society, journal, or
+% anywhere within the document pramble, and the counter itself will be
+% preset at the beginning of the document.
% \begin{macrocode}
-\appdef\class@documenthook{%
+\def\thepage{\@arabic\c@page}%
% \end{macrocode}
-% We assert our own page style only if nobody else has done so.
-% Users wishing to customize their documents will be able to invoke a \cmd\pagestyle\
-% command anywhere in the preamble.
-% \begin{macrocode}
- \@ifxundefined\@evenhead{%
- \@ifxundefined\@oddhead{%
- \@ifxundefined\@oddfoot{%
- \@ifxundefined\@evenfoot{%
- \preprintsty@sw{%
- \ps@preprint
- }{%
- \ps@article
- }%
- }{}%
- }{}%
- }{}%
- }{}%
- \pagenumbering{arabic}%
- \normalsize
+% \changes{4.0b}{1999/06/20}{Defer assignment until \cs{AtBeginDocument} time.}
+% Note that this code is executed at \cmd\setup@hook\ time
+% to allow for the possibility of overrides by packages like \classname{geometry}.
+% \begin{macrocode}
+\appdef\setup@hook{%
\tabbingsep \labelsep
\leftmargin\leftmargini
\labelwidth\leftmargin\advance\labelwidth-\labelsep
\let\@listi\@listI
\@listi
-% \end{macrocode}
-%
+}%
% \begin{macrocode}
-%\twoside@sw{}{%
-% \raggedbottom
-%}%
-% \end{macrocode}
-% We make sure that the ``environment'' component mark is set.
+%
+% We ensure that the ``environment'' component mark (implemented by \file{ltxgrid.dtx})
+% is initialized properly (via a hook, itself defined via \file{ltxutil.dtx}).
% \begin{macrocode}
+\appdef\class@documenthook{%
+ \global\c@page\@ne
\def\curr@envir{document}%
\mark@envir{\curr@envir}%
+}%
% \end{macrocode}
%
-% \changes{v4.0beta 3}{1999/11/13}
-% {Grid changes with ltxgrid}
-% \changes{v4.0beta 4}{2000/04/10}
-% {Also alter how lists get indented.}
-% When setting the column grid, we have to alter the procedure
-% for formatting lists. Because \cmd\twocolumngrid\ requires
-% rebalancing columns at some points, lists must \emph{not}
-% involve the use of \cmd\moveleft, \cmd\moveright, or \cmd\parshape.
-% The alternative procedure only involves the manipulation of
-% \cmd\leftskip\ and \cmd\rightskip.
+% \begin{macro}{\open@onecolumn}%
+% \begin{macro}{\open@column@two}%
+% \changes{4.0c}{1999/11/13}{Grid changes with ltxgrid}
+% \changes{4.0d}{2000/04/10}{Also alter how lists get indented.}
+% When setting the column grid, we have to override the procedure
+% for formatting lists.
+% Because \cmd\twocolumngrid\ requires rebalancing columns at some points,
+% typesetting must employ only the manipulation of
+% \cmd\leftskip\ and \cmd\rightskip, and must avoid the use of
+% \cmd\moveleft, \cmd\moveright, and \cmd\parshape.
+%
+% It is one of the stranger features of \TeX\ that these two separate
+% mechanisms exist. The latter three have the effect of adding things to the
+% Main Vertical List that cannot be removed and later added back with all their
+% properties intact.
+%
+% In detail, \cmd\moveleft, say, adds a box to the MVL with
+% its reference point shifted horizontally by some amount relative to the
+% reference point of the enclosing list. If that box is removed from the
+% MVL (via a \cmd\lastbox\ operation in the output routine), and later
+% thrown back to the MVL, the shift of the box will have been ``forgotten'' by \TeX.
+% This is a bug, but not one ``acceptible to D. E. Knuth'', so it will never be fixed.
%
-% FIXME: Always sloppy??
% \begin{macrocode}
- \twocolumn@sw{%
- \open@column@mlt\tw@
- \set@colht
- \@floatplacement
- \@dblfloatplacement
- \sloppy
- \@booleanfalse\raggedcolumn@sw
- \let\set@listindent\set@listindent@
- }{%
- \open@column@one\@ne
- \set@colht
- \@floatplacement
- \@dblfloatplacement
- \sloppy
-% \raggedbottom
- \let\set@listindent\set@listindent@parshape
- }%
+\def\open@onecolumn{%
+ \open@column@one\@ne
+ \set@colht
+ \@floatplacement
+ \@dblfloatplacement
+}%
+\def\open@twocolumn{%
+ \open@column@mlt\tw@
+ \set@colht
+ \@floatplacement
+ \@dblfloatplacement
+ \sloppy
+ \let\set@listindent\set@listindent@
}%
% \end{macrocode}
-%
+% \end{macro}
+% \end{macro}
%
% \section{\cs{appendix}}
%
@@ -5345,26 +4045,26 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macrocode}
%
% \section{Changing the page grid}
-% \changes{v4.0beta 2}{1999/06/20}
-% {Define three separate environments,
-% defer assignment to \cs{AtBeginDocument} time.
-% }
+% \changes{4.0b}{1999/06/20}{Define three separate environments, defer assignment to \cs{AtBeginDocument} time.}
%
% \subsection{Avoiding Grid Changes}%
%
% In preprint styles, ``wide text'' is a no-op, and the title page
% processing involves no grid change.
%
-% \begin{macro}{\title@column@default}%
-% \begin{macro}{\close@column@default}%
-%
-% \begin{macrocode}
-\def\title@column@default#1{%
+% \begin{macro}{\title@column}%
+% \begin{macro}{\close@column}%
+% Provide default meanings for \cmd\title@column\ and \cmd\close@column,
+% in case they were never defined.
+% Note that the society or journal substyle may define
+% \cmd\title@column\ or \cmd\close@column: this code will not override.
+% \begin{macrocode}
+\def\title@column#1{%
\minipagefootnote@init
#1%
\minipagefootnote@foot
}%
-\def\close@column@default{%
+\def\close@column{%
\newpage
}%
% \end{macrocode}
@@ -5406,14 +4106,12 @@ See the REVTeX 4 README file for restrictions and more information.
% In case \classoption{twocolumngrid} has been invoked,
% switch column grid using the column grid-changing commands.
% Supply stub definitions of those commands here.
-% \changes{v4.0beta 3}{1999/11/13}
-% {grid changes with ltxgrid}
+% \changes{4.0c}{1999/11/13}{grid changes with ltxgrid}
%
% \begin{macro}{\title@column@grid}%
% \begin{macro}{\close@column@grid}%
% The title block always starts at the top of a new page.
-% \changes{v4.0beta 3}{1999/11/13}
-% {grid changes with ltxgrid}
+% \changes{4.0c}{1999/11/13}{grid changes with ltxgrid}
%
% Note that, for the procedure \cmd\close@column@grid,
% we balance columns by switching to the one-column page grid,
@@ -5426,6 +4124,7 @@ See the REVTeX 4 README file for restrictions and more information.
\begingroup
\let\@footnotetext\frontmatter@footnotetext
\let\set@footnotewidth\set@footnotewidth@ii
+ \ltx@no@footnote
#1%
\endgroup
\twocolumngrid
@@ -5442,10 +4141,9 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macro}
%
% \begin{environment}{widetext@grid}
-% \changes{v4.0beta 3}{1999/11/13}
-% {grid changes via ltxgrid procedures}
-% \changes{v4.0beta 5}{2000/11/21}
-% {adornments above and below.}
+% \changes{4.0c}{1999/11/13}{grid changes via ltxgrid procedures}
+% \changes{4.0e}{2000/11/21}{adornments above and below.}
+% \changes{4.1g}{2009/10/07}{(AO, 525) Remove phantom paragraph above display math that is given in vertical mode}%
% We slip into the one-column page grid
% within the scope of this environment.
%
@@ -5470,6 +4168,7 @@ See the REVTeX 4 README file for restrictions and more information.
\dimen@\ht\widetext@top\advance\dimen@\dp\widetext@top
\cleaders\box\widetext@top\vskip\dimen@
\let\set@footnotewidth\set@footnotewidth@ii
+ \prep@math@patch
}{%
\par
\setbox\widetext@bot\vbox{%
@@ -5489,7 +4188,7 @@ See the REVTeX 4 README file for restrictions and more information.
%
% Decide, finally, how the page grid is to be manipulated.
% \begin{macrocode}
-\appdef\class@documenthook{%
+\def\set@page@grid{%
\twocolumn@sw{%
\let@environment{widetext}{widetext@grid}%
\let\title@column\title@column@grid
@@ -5506,26 +4205,13 @@ See the REVTeX 4 README file for restrictions and more information.
% \begin{macrocode}
\galley@sw{%
\let\widetext@outdent\galley@outdent
- }{%
- }%
+ }{}%
}%
}%
}%
+\appdef\setup@hook{\set@page@grid}%
% \end{macrocode}
%
-% \begin{macro}{\title@column}
-% Provide a default meaning for \cmd\title@column\
-% in case it was never defined.
-% \begin{macrocode}
-\appdef\class@inithook{%
- \@ifxundefined\title@column{%
- \let\title@column\title@column@default
- }{}%
-}%
-% \end{macrocode}
-% \end{macro}
-%
-%
% \section{Old font commands}
%
% \begin{macrocode}
@@ -5564,10 +4250,13 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macro}
%
% \begin{macro}{\notesname}
-% Text entity \cmd\notesname\ is used in \cmd\printendnotes.
-% \begin{macrocode}
-\def\notesname{Notes}
-% \end{macrocode}
+% Text entity \cmd\notesname\ had been used in \cmd\printendnotes.
+% \changes{4.1f}{2009/07/10}{(AO, 520) Automatically produce \cs{bibliography} command when needed}%
+% However, we have removed the endnotes facility from REVTeX.
+%
+% \begin{verbatim}
+%\def\notesname{Notes}
+% \end{verbatim}
% \end{macro}
%
% \begin{macro}{\partname}
@@ -5617,8 +4306,7 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macro}
%
% \begin{macro}{\figurename}
-% \changes{v4.0beta 2}{1999/06/20}
-% {Added localization of \cs{figuresname}}
+% \changes{4.0b}{1999/06/20}{Added localization of \cs{figuresname}}
% Text entity \cmd\figurename\ is used in \env{figure},
% \cmd\figuresname\ in \cmd\printfigures.
% \begin{macrocode}
@@ -5628,8 +4316,7 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macro}
%
% \begin{macro}{\tablename}
-% \changes{v4.0beta 2}{1999/06/20}
-% {Added localization of \cs{tablesname}}
+% \changes{4.0b}{1999/06/20}{Added localization of \cs{tablesname}}
% Text entity \cmd\tablename\ is used in \env{table},
% \cmd\tablesname\ in \cmd\printtables.
% \begin{macrocode}
@@ -5735,7 +4422,7 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macro}
%
% \section{Legacy Commands}
-% We deffine some commands left over from version 3.1, or give default meanings.
+% We define some commands left over from version 3.1, or give default meanings.
% Some definitions can be overridden
% in the document preamble or in included packages.
%
@@ -5819,15 +4506,15 @@ See the REVTeX 4 README file for restrictions and more information.
% \begin{macro}{\url}
%
% If not otherwise defined, give default meanings to certain commands.
-% \changes{v4.0beta 4}{2000/04/10}
-% {eprint takes an aoptional argument, syntactical only in this case.}
+% \changes{4.0d}{2000/04/10}{eprint takes an optional argument, syntactical only in this case.}
+%FIXME: \cmd\bibinfo?
% \begin{macrocode}
-\appdef\class@inithook{%
- \@ifxundefined\text{\let\text\REV@text}{}%
- \@ifxundefined\bm{\let\bm\REV@bm}{}%
+\let\text\REV@text
+\let\bm\REV@bm
+\appdef\setup@hook{%
\providecommand\bibinfo[2]{#2}%
\providecommand\eprint[2][]{#2}%
- \providecommand\url[1]{#1}%
+%\providecommand\url[1]{#1}%
}%
% \end{macrocode}
% \end{macro}
@@ -5869,25 +4556,72 @@ See the REVTeX 4 README file for restrictions and more information.
%
% We read in the symbol definitions.
% \begin{macrocode}
-\RequirePackage{revsymb}%
-\appdef\class@inithook{\revsymb@inithook}%
+\appdef\rtx@require@packages{%
+ \RequirePackage{revsymb4-1}%
+}%
+\appdef\class@documenthook{\revsymb@inithook}%
% \end{macrocode}
%
-% \section{Endgame for the Document Class}
+% \section{Patches for lineno.sty}
+%
+% The \filename{lineno.sty} package detects the case where the package has been loaded
+% and the document invokes \cmd\linelabel, but the \cmd\linenumbers\ command has not been
+% issued: it treats this case as an error.
+%
+% It is wrong for validity of document syntax to be dependent upon package semantics:
+% we make the condition a warning rather than an error.
%
-% This section contains definitions related to the
-% end-of-class processing:
-% we want to control exactly what happens next.
+% \begin{macrocode}
+\def\@LN@LLerror@org{%
+ \PackageError{lineno}{%
+ \string\linelabel\space without \string\linenumbers
+ }{%
+ Just see documentation. (New feature v4.11)%
+ }%
+ \@gobble
+}%
+\def\@LN@LLerror@ltx{%
+ \PackageWarning{lineno}{%
+ To make the \string\linelabel\space command work, you must issue the \string\linenumbers\ command
+ }%
+ \@gobble
+}%
+% \end{macrocode}
%
+% If appropriate, enable line numbering within the abstract.
+%
+% This mechanism applies generally:
+% Create the box in a context in which the meaning of \cmd\par\ has been patched by \filename{lineno.sty},
+% then \cmd\unvbox\ the box in a context where \cmd\set@linepenalties\ has been executed, and
+% follow up with \cmd\@linenumberpar, which forces a visit to the output routine just there.
+% Note that here, we have to de-fang \cmd\@LN@parpgbrk, which would otherwise causes the appearance
+% of a box with depth -1000 points. Go figure.
+% \begin{macrocode}
+\appdef\class@documenthook{%
+ \@ifx{\@LN@LLerror\@LN@LLerror@org}{%
+ \class@info{Overriding \string\@LN@LLerror}%
+ \let\@LN@LLerror\@LN@LLerror@ltx
+ }{}%
+ \@ifpackageloaded{lineno}{%
+ \@ifxundefined{\set@linepenalties}{}{%
+ \def\prep@absbox{\set@linepenalties}%
+ \def\post@absbox{\let\@LN@parpgbrk\@empty\@linenumberpar}%
+ }%
+ }{}%
+}%
+% \end{macrocode}
+%
+% One may well ask: how to obtain line numbering within an alignment in a float?
+% This objective, along with line numbering within footnotes, would require extraordinary measures.
+% The float would have to be thrown onto the MVL in order to acquire its line numbers, but
+% that fragment of MVL would then have to be protected from being shipped out.
+% The question of how to coordinate those lines' numbers with those of lines in the MVL would
+% also require dealing with.
+%
+% \section{Endgame for the Document Class}
+%
% We provide for a ``job macro package'' that can override
-% definitions made by the class or any other packages it loads.
-% We act on the value of \cmd\secnumarabic@sw;
-% this code is a model for dealing with the job macro package.
-% We also install a the very last procedures into
-% \cmd\AtEndOfClass, ones that need to tail on to
-% any processing performed either by the
-% class, by any of its included packages, or
-% by the job macro package and any packages it may have loaded.
+% definitions and assignments made by the class or any other packages it loads.
%
% \subsection{Job Macro Package}
% You can create a ``job macro package'' for your document
@@ -5907,70 +4641,158 @@ See the REVTeX 4 README file for restrictions and more information.
%
% If you choose to have a job macro package, you are well
% advised to read the \LaTeX\ guide to document classes,
-% \filename{clsguide.tex} or read up on the subject
-% in a book line the \LaTeX\ Companion.
+% \file{clsguide.tex} or read up on the subject
+% in a book like the \LaTeX\ Companion.
%
-% The file \filename{template.rty} contains a template for
+% The file \file{template.rty} contains a template for
% creating your own job macro package.
%
% \begin{macrocode}
-\AtEndOfClass{%
+\appdef\rtx@require@packages{%
\InputIfFileExists{\jobname.rty}{}{}%
}%
% \end{macrocode}
%
-% \subsection{\cs{secnumarabic@sw}}\label{sec:secnumarabic}
-% \begin{macro}{\secnumarabic@sw}
-% The flag \cmd\secnumarabic@sw\ signifies that sectioning commands are
-% to be numbered arabic.
-% The effect of this command should override any settings
-% made by the journal substyle or by the job macro package.
-% However, it should be lower in precedence to definitions
-% appearing in the document preamble.
-% Therefore, we install its code into \cmd\AtEndOfClass,
-% but do it \emph{after} the corresponding code
-% for the journal substyle and the job macro package.
+% \subsection{Endgame Processing for the Document Class}
+%
+% The remaining steps in processing the document class involve
+% determining the needed society, journal, and pointsize from
+% the document's class options and inputting the needed files or
+% executing the indicated procedures.
+%
+% Note that the society file is expected to declare options that will
+% allow us to determine the journal involved, and the society and journal
+% themselves determine the which pointsize options are declared, along with
+% their meanings.
+%
+% Note also that required packages are read in only after the document options
+% have been processed, because the latter can affect the former.
+%
+% Finally, the setup code is executed: this is code that depends on the
+% meanings of the switches we define and on the code within the packages we load.
+%
+% Note that there are other hooks in use: \cmd\document@inithook, which is
+% executed right at the beginning of the document, and \cmd\class@documenthook,
+% which serves as a vehicle for any \cmd\AtBeginDocument\ code we might wish to
+% execute.
+%
+%FIXME: use \cmd\class@documenthook\ only for things that bear on the MVL;
+% use \cmd\document@inithook\ for all patches to procedures defined within the preamble.
+%
+% Remember that \classname{natbib} changes its state at \cmd\AtBeginDocument\ time,
+% so we have to install our own code at a later point in the processing.
+%
+% We determine the proper \cmd\@society\ by examining the document's class options.
+% \begin{macrocode}
+\@parse@class@options@society
+% \end{macrocode}
+%
+% Then, we input the society's substyle
+% (which may in turn lead to loading a journal substyle or a pointsize substyle).
+% The substyle should not assume the value of any class option:
+% instead, it should install code into \cmd\setup@hook.
+% \begin{macrocode}
+\@process@society{aps}%
+% \end{macrocode}
%
-% Note: \cmd\thesection\ must \emph{not} be redefined,
-% say, at \cmd\AtBeginDocument\ time by some delayed code.
+% Now that the society has defined the class options relating to journals,
+% and has defined \cmd\@journal@default, we can process the journal substyle.
+% We parse the options for one that sets \cmd\@journal.
% \begin{macrocode}
-\AtEndOfClass{%
- \@ifxundefined\secnumarabic@sw{\@booleanfalse\secnumarabic@sw}{}%
- \secnumarabic@sw{%
- \def\p@section {}%
- \def\thesection {\arabic{section}}%
- \def\p@subsection {}%
- \def\thesubsection {\thesection.\arabic{subsection}}%
- \def\p@subsubsection {}%
- \def\thesubsubsection {\thesubsection.\arabic{subsubsection}}%
- }{}%
-}%
+\@parse@class@options@\@journal
% \end{macrocode}
-% \end{macro}
+% And we process the journal.
+% Note that \emph{it is an error} for a society file to fail to define
+% \cmd\@journal@default.
+%
+% \begin{macrocode}
+\expandafter\@process@journal\expandafter{\@journal@default}%
+% \end{macrocode}
+%
+% Now that the society and journal have finished defining any options relating to
+% point size, we process the class options for any that set \cmd\@pointsize.
+% \begin{macrocode}
+\@parse@class@options@\@pointsize
+% \end{macrocode}
+% And we process the pointsize.
+% Note that it is an error for the society and journal to leave \cmd\@pointsize@default\
+% undefined at this point, however, the journal may have overriden the assignment of the society.
+%
+% \begin{macrocode}
+\expandafter\@process@pointsize\expandafter{\@pointsize@default}%
+% \end{macrocode}
+%
+% Next, we process the class options for once and all.
+% Doing so sets values for some of the Booleans that were introduced along with
+% the \cmd\DeclareOption\ statements above.
+%
+%CHANGE: We process the options in the order declared in the document; this
+% gives the document greater control.
+%
+% \begin{macrocode}
+\@options
+% \end{macrocode}
+%
+% Now that the class options have been processed, we can load all the
+% packages that we know need loading.
+% \begin{macrocode}
+\rtx@require@packages
+% \end{macrocode}
+%
+% At this point, the society substyle, the journal substyle, and the
+% pointsize have all been processed, along with the document class options.
+% Some of these have left things for later; we do these now.
+%
+% \begin{macro}{\setup@hook}
%
-% \subsection{Hook for default values of Booleans}
% This portion of the code for this class file
-% \emph{must} appear at the very end.
-% \begin{macro}{\defaults@hook}
-% The procedure \cmd\defaults@hook\ should hereby
-% be the very last to be installed into \cmd\AtBeginDocument.
-% We provide it with a default in case it has not been
-% used up til now.
-%
-% CHECKME: is any other hook installed later than \cmd\defaults@hook?
-% \begin{macrocode}
-\AtEndOfClass{%
- \appdef\class@documenthook{%
- \defaults@hook
+% \emph{must} appear at the very end:
+% The procedure
+% \cmd\setup@hook\
+% should be executed at the very end of the class file.
+% Any code that relies on the value of any of the \texttt{@sw} switches
+% or will patch the code of one of the required packages
+% should be executed here.
+%
+% \begin{macrocode}
+\setup@hook
+% \end{macrocode}
+% \end{macro}
+%
+%
+% Warn if past maturation date. This code to be enabled only in beta software.
+% \changes{4.1f}{2009/07/11}{(AO, 522) Warn if software is expired}%
+% \changes{4.1h}{2009/10/09}{(AO) Remove expiry code in the release software}%
+% \begin{verbatim}
+% \def\rtx@fin@year{2010}%
+% \def\rtx@fin@month{01}%
+% \def\rtx@fin@day{01}%
+% \end{verbatim}
+% \begin{macrocode}
+\def\rtx@fin@warn{%
+ \@ifnum{\rtx@fin@year>\the\year\relax}{\true@sw}{%
+ \@ifnum{\rtx@fin@month>\the\month\relax}{\true@sw}{%
+ \@ifnum{\rtx@fin@day>\the\day\relax}{\true@sw}{%
+ \false@sw
+ }%
+ }%
+ }%
+ {%
+ \class@info{Beta software expires \rtx@fin@year-\rtx@fin@month-\rtx@fin@day; updates available at http://publish.aps.org/revtex4/}%
+ }{%
+ \class@warn{Outdated software expired \rtx@fin@year-\rtx@fin@month-\rtx@fin@day; please retrieve an update at http://publish.aps.org/revtex4/}%
}%
}%
-\@ifxundefined\defaults@hook{\let\defaults@hook\@empty}{}%
% \end{macrocode}
-% \end{macro}
+% In shipping (non-beta) software, the following line should be commented out.
+% \changes{4.1f}{2009/07/11}{(AO, 522) Warn if software is expired}%
+% \begin{verbatim}
+%\appdef\class@enddocumenthook{\rtx@fin@warn}%
+% \end{verbatim}
%
% End of the class file.
% \begin{macrocode}
-%</class-pst>
+%</package>
% \end{macrocode}
%
%
@@ -6010,8 +4832,7 @@ See the REVTeX 4 README file for restrictions and more information.
% DPC: Really should use a font that includes this glyph.
% Unfortunately not in AMS ones, but is in bbold, cmbb.
% (I think, must check),
-% \changes{v4.d}{1998/01/31}
-% {use font-dependent spacing}
+% \changes{4.0a}{1998/01/31}{use font-dependent spacing}
% FIXME: check for bbold.
% \begin{macrocode}
\DeclareRobustCommand\openone{\leavevmode\hbox{\small1\normalsize\kern-.33em1}}%
@@ -6022,9 +4843,9 @@ See the REVTeX 4 README file for restrictions and more information.
% \begin{macro}{\overdots}
% \begin{macro}{\overcirc}
% J\"org Knappen suggests the replacements:
-% replace \cmd\corresponds\ with \cmd\triangleq, source \classname{amssymb};
-% replace \cmd\overcirc\ with \cmd\mathring, source \classname{latex2e};
-% replace \cmd\overdots\ with \cmd\dddot, source \classname{amsmath}.
+% replace \cmd\corresponds\ with \cmd\triangleq, source \classname{amssymb};
+% replace \cmd\overcirc\ with \cmd\mathring, source \classname{latex2e};
+% replace \cmd\overdots\ with \cmd\dddot, source \classname{amsmath}.
%
% Any use of any of these commands will result in a warning message at the end
% of the log file. If the corresponding package is not loaded, a
@@ -6080,8 +4901,7 @@ See the REVTeX 4 README file for restrictions and more information.
% \begin{macro}{\overstar}
% \begin{macro}{\loarrow}
% \begin{macro}{\roarrow}
-% \changes{v4.0beta 2}{1999/06/20}
-% {AO: remove duplicates}
+% \changes{4.0b}{1999/06/20}{AO: remove duplicates}
% \begin{macrocode}
\DeclareRobustCommand\tensor[1]{\@ontopof{#1}{\leftrightarrow}{1.15}\mathord{\box2}}
\DeclareRobustCommand\overstar[1]{\@ontopof{#1}{\ast}{1.15}\mathord{\box2}}
@@ -6202,9 +5022,9 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\AtBeginDocument}
-% Package dependencies are taken care of
-% \cmd\AtBeginDocument\ time.
+% \begin{macro}{\revsymb@inithook}
+% \changes{4.1b}{2008/07/01}{(AO) make settings at class time instead of deferring them to later.}
+% Package dependencies are taken care of at \cmd\setup@hook\ time.
% \begin{macrocode}
\def\revsymb@inithook{%
\@ifxundefined\dddot{\let\dddot\REV@dddot}{}%
@@ -6224,15 +5044,28 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macrocode}
%
% \section{The \classoption{10pt} class option: the \texttt{10pt} module}
-% \changes{v4.0beta 2}{1999/06/20}
-% {AO: all code for \protect\classoption{10pt} is in this module.}
-% The file \file{10pt.rtx} is read in by the \classname{revtex4} document class
+% \changes{4.0b}{1999/06/20}{AO: all code for \protect\classoption{10pt} is in this module.}
+% The file \file{aps10pt.rtx} is read in by the \classname{revtex4} document class
% if \cmd\@pointsize\ has the value 10.
%
% \begin{macrocode}
%<*10pt>
% \end{macrocode}
%
+% \subsection{Defend Against Forseeable Errors}%
+% Protect this file from being read in by anything but \revtex.
+% \begin{macrocode}
+\ifx\undefined\substyle@ext
+ \def\@tempa{%
+ \endinput
+ \GenericWarning{I must be read in by REVTeX! (Bailing out)}%
+ }%
+ \expandafter\else
+ \def\@tempa{}%
+ \expandafter\fi\@tempa
+ \class@info{RevTeX pointsize 10pt selected}%
+% \end{macrocode}
+%
% \begin{macrocode}
\def\normalsize{%
\@setfontsize\normalsize\@xpt{11.5}%
@@ -6300,9 +5133,12 @@ See the REVTeX 4 README file for restrictions and more information.
}%
% \end{macrocode}
%
+% The values of these margin parameters are dependent upon
+% \cmd\twoside@sw; any society or journal that
+% has its own preferences should override these assignments
+% by doing \cmd\appdef\cmd\setup@hook.
% \begin{macrocode}
-%\appdef\class@documenthook{%
- \@ifxundefined\twoside@sw{\@booleanfalse\twoside@sw}{}%
+\appdef\setup@hook{%
\twoside@sw{%
% \oddsidemargin -.1in
% \evensidemargin -.4in
@@ -6314,7 +5150,7 @@ See the REVTeX 4 README file for restrictions and more information.
\evensidemargin -.25in
\marginparwidth 30pt
}%
-%}%
+}%
% \end{macrocode}
%
% \begin{macrocode}
@@ -6338,11 +5174,8 @@ See the REVTeX 4 README file for restrictions and more information.
\footskip 30pt
% \end{macrocode}
%
-% Was: 57\cmd\baselineskip + \cmd\topskip
% \begin{macrocode}
-%\appdef\set@pica@hook{%
\textheight = 56pc
-%}%
% \end{macrocode}
%
% \begin{macrocode}
@@ -6468,8 +5301,7 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macrocode}
%
% \section{The \classoption{11pt} class option: the \texttt{11pt} module}
-% \changes{v4.0beta 2}{1999/06/20}
-% {AO: all code for \protect\classoption{11pt} is in this module.}
+% \changes{4.0b}{1999/06/20}{AO: all code for \protect\classoption{11pt} is in this module.}
% The file \file{11pt.rtx} is read in by the \classname{revtex4} document class
% if \cmd\@pointsize\ has the value 11.
%
@@ -6477,6 +5309,20 @@ See the REVTeX 4 README file for restrictions and more information.
%<*11pt>
% \end{macrocode}
%
+% \subsection{Defend Against Forseeable Errors}%
+% Protect this file from being read in by anything but \revtex.
+% \begin{macrocode}
+\ifx\undefined\substyle@ext
+ \def\@tempa{%
+ \endinput
+ \GenericWarning{I must be read in by REVTeX! (Bailing out)}%
+ }%
+ \expandafter\else
+ \def\@tempa{}%
+ \expandafter\fi\@tempa
+ \class@info{RevTeX pointsize 11pt selected}%
+% \end{macrocode}
+%
% \begin{macrocode}
\def\normalsize{%
\@setfontsize\normalsize\@xipt{13.6}%
@@ -6547,8 +5393,7 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macrocode}
%
% \section{The \classoption{12pt} class option: the \texttt{12pt} module}
-% \changes{v4.0beta 2}{1999/06/20}
-% {AO: all code for \protect\classoption{12pt} is in this module.}
+% \changes{4.0b}{1999/06/20}{AO: all code for \protect\classoption{12pt} is in this module.}
% The file \file{12pt.rtx} is read in by the \classname{revtex4} document class
% if \cmd\@pointsize\ has the value 12.
%
@@ -6556,6 +5401,20 @@ See the REVTeX 4 README file for restrictions and more information.
%<*12pt>
% \end{macrocode}
%
+% \subsection{Defend Against Forseeable Errors}%
+% Protect this file from being read in by anything but \revtex.
+% \begin{macrocode}
+\ifx\undefined\substyle@ext
+ \def\@tempa{%
+ \endinput
+ \GenericWarning{I must be read in by REVTeX! (Bailing out)}%
+ }%
+ \expandafter\else
+ \def\@tempa{}%
+ \expandafter\fi\@tempa
+ \class@info{RevTeX pointsize 12pt selected}%
+% \end{macrocode}
+%
% \begin{macrocode}
\def\normalsize{%
\@setfontsize\normalsize\@xiipt{14pt}%
@@ -6634,8 +5493,7 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macrocode}
%
% \begin{macrocode}
-%\appdef\class@documenthook{%
- \@ifxundefined\twoside@sw{\@booleanfalse\twoside@sw}{}%
+\appdef\setup@hook{%
\twoside@sw{%
\oddsidemargin 0pt
\evensidemargin 0pt
@@ -6645,7 +5503,7 @@ See the REVTeX 4 README file for restrictions and more information.
\evensidemargin 0pt
\marginparwidth 44pt
}%
-%}%
+}%
% \end{macrocode}
%
% \begin{macrocode}
@@ -6670,15 +5528,17 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macrocode}
%
% \begin{macrocode}
-%\appdef\set@pica@hook{%
- \@ifxundefined\tightenlines@sw{\@booleanfalse\tightenlines@sw}{}%
- \textheight=665.5\p@
+\textheight=665.5\p@
+% \end{macrocode}
+%
+% \begin{macrocode}
+\appdef\setup@hook{%
\tightenlines@sw{%
\def\baselinestretch{1}%
}{%
\def\baselinestretch{1.5}%
}%
-%}%
+}%
% \end{macrocode}
%
% \begin{macrocode}
@@ -6787,28 +5647,38 @@ See the REVTeX 4 README file for restrictions and more information.
%</11pt|12pt>
% \end{macrocode}
%
-% \section{The \classoption{aps} class option: the \texttt{aps} module}
-% \changes{v4.0beta 2}{1999/06/20}
-% {AO: made aps.rtx part of revtex4.dtx}
+% \section{The \classoption{aps} class extension: the \texttt{aps} module}
+% \changes{4.0b}{1999/06/20}{AO: made aps.rtx part of revtex4.dtx}
% The file \file{aps.rtx} is read in by the \classname{revtex4} document class
% if \cmd\@society\ has the value \classoption{aps}.
%
% Here, code specific to APS journals is separated out from the \revtex\ document class.
% (Other societies can customize \revtex\ by supplying their own \file{.rtx} file.)
%
-% We first give some text entities (amounting to journal abbreviations),
+% This class extension file is a model for a class extension you might write yourself.
+%
+% First, incorporate a \cmd\ProvidesFile\ command with an optional argument giving
+% the version information, e.g.,
+% \begin{verbatim}
+% \ProvidesFile{foo}[2001/09/11 v1.1 Docinfo]%
+% \end{verbatim}
+%
+% Within the society substyle, there are two things we must do as well:
+% define the default journal,
+% \begin{verbatim}
+% \def\@journal@default{pra}%
+% \end{verbatim}
+% And do likewise for the point size:
+% \begin{verbatim}
+% \def\@pointsize@default{10}%
+% \end{verbatim}
+%
+% We first define some text entities (amounting to journal abbreviations),
% then some APS-specific initialisations,
% then code for particular APS journals.
% In the latter case, the choice is
% keyed off the macro \cmd\@journal.
%
-% Note on \cmd\AtEndOfClass:
-% this file, like all journal substyles, is read in at \cmd\AtEndOfClass\ time,
-% so you should not use this command in this file.
-% Mote for \LaTeX\ developers: It would be an improvement in \LaTeX\ to
-% \cmd\let\cmd\AtEndOfClass\ to something like \cmd\@firstofone.
-% This change would be effected in \cmd\@onefilewithoptions.
-%
% \begin{macrocode}
%<*aps>
% \end{macrocode}
@@ -6824,42 +5694,56 @@ See the REVTeX 4 README file for restrictions and more information.
\expandafter\else
\def\@tempa{}%
\expandafter\fi\@tempa
+ \class@info{RevTeX society APS selected}%
+% \end{macrocode}
+%
+% Here are the class options relating to the APS:
+% \begin{macrocode}
+\DeclareOption{pra}{\change@journal{pra}}%
+\DeclareOption{prb}{\change@journal{prb}}%
+\DeclareOption{prc}{\change@journal{prc}}%
+\DeclareOption{prd}{\change@journal{prd}}%
+\DeclareOption{pre}{\change@journal{pre}}%
+\DeclareOption{prl}{\change@journal{prl}}%
+\DeclareOption{prstab}{\change@journal{prstab}}%
+\DeclareOption{prstper}{\change@journal{prstper}}%
+\DeclareOption{rmp}{\change@journal{rmp}}%
% \end{macrocode}
%
% \subsection{Abbreviations}%
% The following macros constitute typing shortcuts for
% certain journal names.
% \begin{macrocode}
-\def\ao{Appl.\ Opt.\ }
-\def\ap{Appl.\ Phys.\ }
-\def\apl{Appl.\ Phys.\ Lett.\ }
-\def\apj{Astrophys.\ J.\ }
-\def\bell{Bell Syst.\ Tech.\ J.\ }
-\def\jqe{IEEE J.\ Quantum Electron.\ }
-\def\assp{IEEE Trans.\ Acoust.\ Speech Signal Process.\ }
-\def\aprop{IEEE Trans.\ Antennas Propag.\ }
-\def\mtt{IEEE Trans.\ Microwave Theory Tech.\ }
-\def\iovs{Invest.\ Ophthalmol.\ Vis.\ Sci.\ }
-\def\jcp{J.\ Chem.\ Phys.\ }
-\def\jmo{J.\ Mod.\ Opt.\ }
-\def\josa{J.\ Opt.\ Soc.\ Am.\ }
-\def\josaa{J.\ Opt.\ Soc.\ Am.\ A }
-\def\josab{J.\ Opt.\ Soc.\ Am.\ B }
-\def\jpp{J.\ Phys.\ (Paris) }
-\def\nat{Nature (London) }
-\def\oc{Opt.\ Commun.\ }
-\def\ol{Opt.\ Lett.\ }
-\def\pl{Phys.\ Lett.\ }
-\def\pra{Phys.\ Rev.\ A }
-\def\prb{Phys.\ Rev.\ B }
-\def\prc{Phys.\ Rev.\ C }
-\def\prd{Phys.\ Rev.\ D }
-\def\pre{Phys.\ Rev.\ E }
-\def\prl{Phys.\ Rev.\ Lett.\ }
-\def\rmp{Rev.\ Mod.\ Phys.\ }
-\def\pspie{Proc.\ Soc.\ Photo-Opt.\ Instrum.\ Eng.\ }
-\def\sjqe{Sov.\ J.\ Quantum Electron.\ }
-\def\vr{Vision Res.\ }
+\def\ao{Appl.\ Opt.\ }%
+\def\ap{Appl.\ Phys.\ }%
+\def\apl{Appl.\ Phys.\ Lett.\ }%
+\def\apj{Astrophys.\ J.\ }%
+\def\bell{Bell Syst.\ Tech.\ J.\ }%
+\def\jqe{IEEE J.\ Quantum Electron.\ }%
+\def\assp{IEEE Trans.\ Acoust.\ Speech Signal Process.\ }%
+\def\aprop{IEEE Trans.\ Antennas Propag.\ }%
+\def\mtt{IEEE Trans.\ Microwave Theory Tech.\ }%
+\def\iovs{Invest.\ Ophthalmol.\ Vis.\ Sci.\ }%
+\def\jcp{J.\ Chem.\ Phys.\ }%
+\def\jmo{J.\ Mod.\ Opt.\ }%
+\def\josa{J.\ Opt.\ Soc.\ Am.\ }%
+\def\josaa{J.\ Opt.\ Soc.\ Am.\ A }%
+\def\josab{J.\ Opt.\ Soc.\ Am.\ B }%
+\def\jpp{J.\ Phys.\ (Paris) }%
+\def\nat{Nature (London) }%
+\def\oc{Opt.\ Commun.\ }%
+\def\ol{Opt.\ Lett.\ }%
+\def\pl{Phys.\ Lett.\ }%
+\def\pra{Phys.\ Rev.\ A }%
+\def\prb{Phys.\ Rev.\ B }%
+\def\prc{Phys.\ Rev.\ C }%
+\def\prd{Phys.\ Rev.\ D }%
+\def\pre{Phys.\ Rev.\ E }%
+\def\prl{Phys.\ Rev.\ Lett.\ }%
+\def\rmp{Rev.\ Mod.\ Phys.\ }%
+\def\pspie{Proc.\ Soc.\ Photo-Opt.\ Instrum.\ Eng.\ }%
+\def\sjqe{Sov.\ J.\ Quantum Electron.\ }%
+\def\vr{Vision Res.\ }%
% \end{macrocode}
%
% \subsection{APS Setup}%
@@ -6873,27 +5757,61 @@ See the REVTeX 4 README file for restrictions and more information.
%
% \begin{macro}{\@fnsymbol}
% The \LaTeX\ kernel definition of \cmd\@fnsymbol\ is overridden.
+% The definition in \filename{fixltx2e.sty} serves as a guide to the new way to symbol,
+% working in both text- and math modes.
+%
+% \filename{fixltx2e.sty} duplicates some features of \filename{ltxgrid} and \filename{ltxutil},
+% however, so it may be incompatible with \revtex.
+% In case it is not loaded, we must provide a meaning for \cmd\TextOrMath,
+% which that package makes robust.
+% I believe that it is \cmd\@fnsymbol\ itself that ought to be robustified.
+% e\TeX\ further complicates matters; we do not especially accomodate it.
+%
+% \changes{4.1d}{2009/03/27}{Definition of \cs{ @fnsymbol} follows fixltx2e.sty}
+%
+% Not! \cmd\TextOrMath\ must be made robust in any case (Bug 530). I return things to follow
+% core \LaTeXe\ (\filename{latex.ltx}).
+% \changes{4.1f}{2009/10/05}{(AO, 530) \cs{@fnsymbol}: Failed to import fixltx2e.sty technology. Return to LaTeX core.}
% \begin{macrocode}
\def\@fnsymbol#1{%
\ensuremath{%
- \ifcase#1\or
- *\or \dagger \or
- \ddagger \or \mathsection \or
+ \ifcase#1\or
+ *\or
+ \dagger\or
+ \ddagger\or
+ \mathsection\or
\mathparagraph\or
- **\or \dagger\dagger \or
- \ddagger\ddagger \or \mathsection \mathsection \or
+% \|\or
+ **\or
+ \dagger\dagger\or
+ \ddagger\ddagger\else
+ \mathsection\mathsection\or
\mathparagraph\mathparagraph\or
- *{*}*\ignorespaces \or \dagger\dagger\dagger \or
- \ddagger\ddagger\ddagger\or \mathsection \mathsection \mathsection \or
+ ***\or
+ \dagger\dagger\dagger\or
+ \ddagger\ddagger\ddagger\else
+ \mathsection\mathsection\mathsection\or
\mathparagraph\mathparagraph\mathparagraph\or
- \else
- \@ctrerr
+%
+ \@ctrerr
\fi
}%
}%
+\appdef\document@inithook{%
+ \@ifxundefined\TextOrMath{%
+ \DeclareRobustCommand\TextOrMath{\@ifmmode{\false@sw}{\true@sw}}%
+ }{}%
+}%
+\let\thefootnote@latex\thefootnote
% \end{macrocode}
% \end{macro}
%
+% We assign the default titlepage style for APS; a journal or document instance
+% may override by invoking one of the other \cmd\clo@... procedures defined in \revtex.
+% \begin{macrocode}
+\clo@groupedaddress
+% \end{macrocode}
+%
% \begin{macro}{\titlepage}
% \begin{macrocode}
\renewenvironment{titlepage}{%
@@ -6901,7 +5819,10 @@ See the REVTeX 4 README file for restrictions and more information.
\onecolumngrid
\newpage
\thispagestyle{titlepage}%
- \c@page\z@% article sets this to one not zero???
+ \c@page\z@
+% \end{macrocode}
+% A comment: ``article.cls sets this to one not zero?''
+% \begin{macrocode}
}{%
\wastwocol@sw{\twocolumngrid}{\newpage}%
}%
@@ -6934,8 +5855,8 @@ See the REVTeX 4 README file for restrictions and more information.
%
% \begin{macro}{\frontmatter@abstractfont}
% All APS journals set the abstract body the same way.
-% \changes{v4.0beta 3}{1999/11/13}
-% {Bug 123: add parskip to the abstract.}
+% \changes{4.0c}{1999/11/13}{(AO, 123) add parskip to the abstract.}
+% \changes{4.1e}{2008/06/29}{(AO, 455) be nice to a list within the abstract}
% \begin{macrocode}
\def\frontmatter@abstractfont{%
\small
@@ -6951,32 +5872,42 @@ See the REVTeX 4 README file for restrictions and more information.
\advance\leftskip\dimen@
\advance\rightskip\dimen@
}%
+ \@totalleftmargin\leftskip
}%
% \end{macrocode}
% \end{macro}
%
% All APS journal preprints use separate titlepage and full-width abstract.
%
-% Note that we defer polling the \cmd\preprintsty@sw\ Boolean until
-% \cmd\AtBeginDocument\ time, because the document preamble
-% may legitimately change the state of that variable.
+% In effect, we establish a society default value for \cmd\preprintsty@sw,
+% and for \cmd\titlepage@sw.
% \begin{macrocode}
-\appdef\class@documenthook{%
+\@booleanfalse\preprintsty@sw
+\@booleantrue\titlepage@sw
+% \end{macrocode}
+%
+% We choose the page style for all APS journals.
+% The journal may override by inserting its own code in \cmd\setup@hook.
+% Users wishing to customize their documents will be able to invoke a \cmd\pagestyle\
+% command anywhere in the preamble; it will override the assignments here.
+%
+% Here is the big switch for APS preprints. Note that \cmd\preprintsty@sw
+% is also consulted in various procedures, but we assume its value does
+% not change after \cmd\setup@hook\ time.
+% \begin{macrocode}
+\appdef\setup@hook{%
\preprintsty@sw{%
- \@ifxundefined\titlepage@sw{\@booleantrue\titlepage@sw}{}%
-% \tightenlines@sw{%
-% \def\baselinestretch{1}%
-% }{%
-% \def\baselinestretch{1.5}%
-% }%
+ \ps@preprint
\def\frontmatter@abstractwidth{\textwidth}%
\def\frontmatter@affiliationfont{\it}%
\let\section\section@preprintsty
% \let\@hangfrom@section\@hangfrom@section@preprintsty
\let\subsection\subsection@preprintsty
\let\subsubsection\subsubsection@preprintsty
- }{}%
- }%
+ }{%
+ \ps@article
+ }%
+}%
% \end{macrocode}
%
% \begin{macro}{\frontmatter@authorformat}
@@ -7055,13 +5986,6 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macrocode}
% \end{macro}
%
-% Set up the default APS style for title block authors and affiliations.
-% \begin{macrocode}
-\@ifxundefined\groupauthors@sw{%
- \clo@groupedaddress
-}{}%
-% \end{macrocode}
-%
% \begin{macro}{\frontmatter@setup}
% All APS journals set the title page using the same font and size.
% However, justification varies for the title block elements, so
@@ -7098,7 +6022,7 @@ See the REVTeX 4 README file for restrictions and more information.
}%
}%
\def\frontmatter@authorbelow{%
- \addvspace{3\p@}%
+ \addvspace{3\p@}%
}%
% \end{macrocode}
% \end{macro}
@@ -7147,20 +6071,19 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macro}
%
% \begin{macro}{\ps@titlepage}
-% \changes{v4.g}{1998/06/10}
-% {multiple preprint commands}
-% \changes{v4.0beta 2}{1999/06/20}
-% {Stack \cs{preprint} args flush right at right margin.}
+% \changes{4.0a}{1998/06/10}{multiple preprint commands}
+% \changes{4.0b}{1999/06/20}{Stack \cs{preprint} args flush right at right margin.}
% Title page style. Currently empty except for preprint header,
% which consists of all the \cmd\preprint\ arguments,
% stacked flush right at the right margin.
-% \changes{v4.0beta 3}{1999/11/13}
-% {Insert procedure \cs{checkindate}}
+% \changes{4.0c}{1999/11/13}{Insert procedure \cs{checkindate}}
% \begin{macrocode}
\def\ps@titlepage{%
\def\@oddhead{%
\hfill
- \produce@preprints\@preprint
+ \preprint@sw{%
+ \expandafter\produce@preprints\expandafter{\@preprint}%
+ }{}%
}%
\let\@evenhead\@oddhead
\def\@oddfoot{%
@@ -7177,28 +6100,28 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macro}
%
% \begin{macro}{\produce@preprints}
-% \changes{v4.0beta 3}{1999/11/13}
-% {Bug 115. If three or more preprints specified, set on single line, with commas.}
+% \changes{4.0c}{1999/11/13}{(AO, 115) If three or more preprints specified, set on single line, with commas.}
% \begin{macrocode}
\def\produce@preprints#1{%
- \preprint@sw{%
- \vtop to \z@{%
- \def\baselinestretch{1}%
- \small
- \let\preprint\preprint@count
- \count@\z@#1\@ifnum{\count@>\tw@}{%
- \hbox{%
- \let\preprint\preprint@hlist
- #1\setbox\z@\lastbox
- }%
- }{%
- \let\preprint\preprint@cr
- \halign{\hfil##\cr#1\crcr}%
- \par
- \vss
+ \vtop to \z@{%
+ \def\baselinestretch{1}%
+ \small
+ \let\preprint\preprint@count
+ \count@\z@
+ #1%
+ \@ifnum{\count@>\tw@}{%
+ \hbox{%
+ \let\preprint\preprint@hlist
+ #1%
+ \setbox\z@\lastbox
}%
+ }{%
+ \let\preprint\preprint@cr
+ \halign{\hfil##\cr#1\crcr}%
+ \par
+ \vss
}%
- }{}%
+ }%
}%
\def\preprint@cr#1{#1\cr}%
\def\preprint@count#1{\advance\count@\@ne}%
@@ -7237,6 +6160,7 @@ See the REVTeX 4 README file for restrictions and more information.
}%
}%
\def\@hangfrom@section#1#2#3{\@hangfrom{#1#2}\MakeTextUppercase{#3}}%
+\def\@hangfroms@section#1#2{#1\MakeTextUppercase{#2}}%
% \end{macrocode}
%
% \begin{macrocode}
@@ -7349,23 +6273,21 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macro}
% \end{macro}
%
-% Effectively invoke the \classoption{bibnote} class option,
-% if \cmd\frontmatter@footnote@produce\ has not yet been set.
-% \begin{macrocode}
- \@ifxundefined\frontmatter@footnote@produce{%
- \let\frontmatter@footnote@produce\frontmatter@footnote@produce@endnote
- }{}%
-% \end{macrocode}
-%
+% By default, APS journals set titlepage notes as footnotes.
+% \begin{verbatim}
+\let\frontmatter@footnote@produce\frontmatter@footnote@produce@footnote
+% \end{verbatim}
%
% \subsubsection{Table of Contents}%
% The toc will itself make an entry in the toc,
% but we temporarily turn off toc formatting for the duration.
+% \changes{4.1a}{2008/01/19}{(AO, 461) Change the csname revtex uses from @dotsep to ltxu@dotsep. The former is understood in mu. (What we wanted was a dimension.)}%
% \begin{macrocode}
-\def\@pnumwidth{1.55em}
-\def\@tocrmarg {2.55em}
-\def\@dotsep{4.5pt}
-\setcounter{tocdepth}{3}
+\def\@pnumwidth{1.55em}%
+\def\@tocrmarg {2.55em}%
+\def\@dotsep{2}%
+\def\ltxu@dotsep{4.5pt}%
+\setcounter{tocdepth}{3}%
% \end{macrocode}
%
% \begin{macrocode}
@@ -7390,10 +6312,12 @@ See the REVTeX 4 README file for restrictions and more information.
}%
% \end{macrocode}
%
+% The following definition of \cmd\l@part\ is a variant on
+% the definition of \cmd\l@@sections\ in \file{ltxutil.dtx}.
% \begin{macrocode}
\def\l@part#1#2{\addpenalty{\@secpenalty}%
\begingroup
- \set@tocdim@pagenum{#2}%
+ \set@tocdim@pagenum\@tempboxa{#2}%
% \@tempdima 3em %
\parindent \z@
\rightskip\tocleft@pagenum plus 1fil\relax
@@ -7401,7 +6325,7 @@ See the REVTeX 4 README file for restrictions and more information.
\addvspace{2.25em plus\p@}%
\large \bf %
\leavevmode\ignorespaces#1\unskip\nobreak\hskip\skip@
- \hb@xt@\rightskip{\hfil\unhbox\z@}\hskip-\rightskip\hskip\z@skip
+ \hb@xt@\rightskip{\hfil\unhbox\@tempboxa}\hskip-\rightskip\hskip\z@skip
\par
\nobreak %
\endgroup
@@ -7410,6 +6334,9 @@ See the REVTeX 4 README file for restrictions and more information.
%
% \begin{macro}{\l@section}
% Determine which TOC elements are automatically indented.
+%
+% We set the TOC to the standard of RMP.
+% If APS has its own specification, we will code it, and RMP must override.
% \begin{macrocode}
\def\tocleft@{\z@}%
\def\tocdim@min{5\p@}%
@@ -7419,7 +6346,7 @@ See the REVTeX 4 README file for restrictions and more information.
\def\l@f@section{%
\addpenalty{\@secpenalty}%
\addvspace{1.0em plus\p@}%
- \bf
+ %\bf
}%
\def\l@subsection{%
\l@@sections{section}{subsection}% Implicit #3#4
@@ -7438,27 +6365,12 @@ See the REVTeX 4 README file for restrictions and more information.
\let\toc@post\toc@post@auto
% \end{macrocode}
%
-% \begin{macrocode}
-\def\listoffigures{\print@toc{lof}}%
-\def\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
-% \end{macrocode}
-%
-% \begin{macrocode}
-\def\listoftables{\print@toc{lot}}%
-\let\l@table\l@figure
-% \end{macrocode}
-%
% \subsubsection{Default column bottom}%
% All APS journal styles have flush bottoms.
%
-% Note that we defer polling the \cmd\raggedcolumn@sw\ Boolean until
-% \cmd\AtBeginDocument\ time, because the document preamble
-% may legitimately change the state of that variable.
+% APS journals may set with ragged bottoms.
% \begin{macrocode}
-\appdef\class@documenthook{%
- \@ifxundefined\raggedcolumn@sw{\@booleantrue\raggedcolumn@sw}{}%
- \raggedcolumn@sw{\raggedbottom}{\flushbottom}%
-}%
+\@booleantrue\raggedcolumn@sw
% \end{macrocode}
%
%
@@ -7491,14 +6403,12 @@ See the REVTeX 4 README file for restrictions and more information.
% \begin{macrocode}
\def\@makefntext#1{%
\def\baselinestretch{1}%
- \reset@font
- \footnotesize
- \leftskip1em
- \parindent1em
- \noindent\nobreak\hskip-\leftskip
+ \leftskip1em%
+ \parindent1em%
+ \noindent
+ \nobreak\hskip-\leftskip
\hb@xt@\leftskip{%
- \Hy@raisedlink{\hyper@anchorstart{footnote@\the\c@footnote}\hyper@anchorend}%
- \hss\@makefnmark\
+ \hss\@makefnmark\ %
}%
#1%
\par
@@ -7512,13 +6422,12 @@ See the REVTeX 4 README file for restrictions and more information.
% \begin{macro}{\@hangfrom@appendix}
% \begin{macro}{\@hangfroms@appendix}
% \begin{macro}{\@appendixcntformat}
-% \changes{v4.0beta 3}{1999/11/13}
-% {Bug 129: section* within appendix was producing appendixname}
+% \changes{4.0c}{1999/11/13}{(AO, 129) section* within appendix was producing appendixname}
% \begin{macrocode}
\prepdef\appendix{%
\par
\let\@hangfrom@section\@hangfrom@appendix
- \let\@hangfroms@section\@hangfroms@appendix
+%\let\@hangfroms@section\@hangfroms@appendix
\let\@sectioncntformat\@appendixcntformat
}%
\def\@hangfrom@appendix#1#2#3{%
@@ -7543,7 +6452,7 @@ See the REVTeX 4 README file for restrictions and more information.
%
% Customize \revtex\ for the journal substyle;
% this task requires three components:
-% the \BibTeX\ \file{apsrev.bst} style file,
+% the \BibTeX\ \file{apsrev.bst} and \file{apsrmp.bst} style files,
% customizing code for \file{natbib}, and
% customizations of the \env{thebibliography} environment.
%
@@ -7553,139 +6462,219 @@ See the REVTeX 4 README file for restrictions and more information.
% The user must have installed a \file{.bst} file of the corresponding name.
% This file will then be used by \BibTeX\ when compiling the document's \file{.bbl} file.
%
-% The default bibliography style for the APS journal substyles, \file{apsrev.bst},
-% was originally called \file{revtex.bst}, but
-% that name is much too generic and should be given to a \file{.bst} file that
-% that applies generally to any \revtex\ jounal substyle, an impossibility.
-%
-% To generate \file{apsrev.bst}, use \classname{custom-bib} version 4.0b2 or later.
+% To generate \file{apsrev.bst}, use \classname{custom-bib} version 4.21 or later.
% Run the \file{.bst} generator, \file{makebst.tex}, and
% accept all defaults, with the following exceptions:
%
+% \def\QandA#1#2#3{\item#1: \textbf{#2}: \texttt{#3}---}%
+% \def\CandE#1{\item\relax\texttt{#1}---}%
% \begin{enumerate}
-% \item
-% ORDERING OF REFERENCES: c: seq-no (references in order of Citation);
-% \item
-% AUTHOR NAMES: i: nm-init,ed-au (Initials + surname);
-% \item
-% NUMBER OF AUTHORS: l: max 12, min 12 (there will be three prompts total);
-% \item
-% TYPEFACE FOR AUTHORS IN LIST OF REFERENCES: u: nmft,nmft-def (User defined author font);
-% \item
-% FONT FOR FIRST NAMES: u: fnm-def (First names in user defined font);
-% \item
-% EDITOR NAMES IN INCOLLECTION ETC: a: nmfted (Editors incollection like authors);
-% \item
-% DATE FORMAT: p: yr-par (Date in parentheses);
-% \item
-% SUPPRESS MONTH: x: xmth (Date is year only);
-% \item
-% TITLE OF ARTICLE: i: tit-it (Title italic)
-% \item
-% ARTICLE TITLE PRESENT: x: jtit-x (No article title);
-% \item
-% JOURNAL NAME FONT: r: jttl-rm (Journal title normal);
-% \item
-% TECHNICAL REPORT TITLE: b: trtit-b (Tech. report title like books);
-% \item
-% JOURNAL VOLUME: b: vol-bf (Volume bold);
-% \item
-% VOLUME PUNCTUATION: c: volp-com (Volume with comma);
-% \item
-% PAGE NUMBERS: f: jpg-1 (Only start page number);
-% \item
-% JOURNAL NAME PUNCTUATION: x: jnm-x (Space after journal);
-% \item
-% PUBLISHER IN PARENTHESES: d: pub-date (Publisher and date in parentheses);
-% \item
-% PUBLISHER POSITION: p: pre-pub (Publisher before chapter, pages);
-% \item
-% ISBN NUMBER: isbn: (Include ISBN for books, booklets)
-% \item
-% ISSN NUMBER: issn: (Include ISSN for periodicals)
-% \item
-% EDITOR IN COLLECTIONS: b: edby (Booktitle, edited by \dots);
-% \item
-% PUNCTUATION BETWEEN SECTIONS (BLOCKS): c: blk-com (Comma between blocks);
-% \item
-% ABBREVIATE WORD `PAGES': a: pp (`Page' abbreviated);
-% \item
-% ABBREVIATE WORD `EDITORS': a: ed (`Editor' abbreviated);
-% \item
-% OTHER ABBREVIATIONS: a: abr (Abbreviations);
-% \item
-% ABBREVIATION FOR `EDITION': a: ednx (`Edition' abbreviated as `ed');
-% \item
-% EDITION NUMBERS: n: ord (Numerical editions);
-% \item
-% STORED JOURNAL NAMES: a: jabr (Abbreviated journal names);
-% \item
-% FONT OF `ET AL': i: etal-it (Italic et al);
-% \item
-% ADDITIONAL REVTeX DATA FIELDS: r: revdata, eprint, url, url-blk (Include REVTeX data fields collaboration, eid, eprint, numpages, url)
-% \item
-% NEW FONT SELECTION SCHEME: n: nfss (NFSS);
-% \item
-% ADDITIONAL REVTeX DATA FIELDS: y: revdata (additional data fields);
-% \item
-% REFERENCE COMPONENT TAGS: y: reference component tags;
-% \item
-% URL ADDRESS: n: URL as note;
+% \QandA{LANGUAGE FIELD}{l}{lang}Use language field to switch hyphenation patterns for title
+% \QandA{ANNOTATIONS}{a}{annote}Annotations in \texttt{annote} field or in \file{.tex} file of citekey name
+% \QandA{PRESENTATIONS}{b}{pres,pres-bf}Presentation, speaker bold face
+% \QandA{ORDERING OF REFERENCES}{c}{seq-no}Citation order (unsorted, like unsrt.bst)
+% \QandA{ORDER ON VON PART}{x}{vonx}Sort without von part (de la Maire after Mahone)
+% \QandA{AUTHOR NAMES}{i}{nm-init,ed-au}Initials + surname (J. F. Smith)
+% \QandA{POSITION OF JUNIOR}{*}{jnrlst}Junior comes last as Smith, John, Jr.
+% \QandA{TYPEFACE FOR AUTHORS IN LIST OF REFERENCES}{u}{nmft,nmft-def}User defined author font (\cmd\bibnamefont)
+% \QandA{FONT FOR FIRST NAMES}{u}{fnm-def}First names in user defined font (\cmd\bibfnamefont)
+% \QandA{EDITOR NAMES IN INCOLLECTION ETC}{a}{nmfted}Editors incollection like authors font
+% \QandA{FONT FOR `AND' IN LIST}{r}{nmand-rm}`And' in normal font (JONES and JAMES)
+% \QandA{FONT OF CITATION LABELS IN TEXT}{u}{lab,lab-def}User defined citation font (\cmd\citenamefont)
+% \QandA{FONT FOR `AND' IN CITATIONS}{r}{and-rm}Cited `and' in normal font
+% \QandA{DATE FORMAT}{*}{yr-par}Date in parentheses as (May 1993)
+% \QandA{DATE EMPTY}{-}{date-nil-x}If date is empty, then do not produce the surrounding punctuation (parens, brackets, colon, comma)
+% \QandA{TITLE OF ARTICLE}{d}{tit-qq}Title and punctuation in double quotes (``Title,'' ..)
+% \QandA{INPROCEEDINGS CHAPTER AND PAGES, LIKE INBOOK}{-}{inproceedings-chapter}produce pages after chapter, just as in InBook
+% \QandA{TITLE PRESENT IN ARTICLE, INCOLLECTION, AND INPROCEEDINGS}{x}{jtit-x}Title is ignored
+% \QandA{INPROCEEDINGS CHAPTER AND PAGES, LIKE INBOOK}{y}{inproceedings-chapter}produce pages after chapter, just as in InBook
+% \QandA{ARTICLE BOOKTITLE PRESENT}{}{article-booktitle}format booktitle
+% \QandA{ARTICLE SERIES PRESENT}{}{article-series}article can has series
+% \QandA{JOURNAL NAME FONT}{r}{jttl-rm}Journal name normal font
+% \QandA{JOURNAL NAME WITH ADDRESS}{y}{journal-address}Include address field (in parentheses) along with journal name
+% \QandA{BOOK TITLE FIELDS}{y}{book-bt}Field `booktitle', or if absent field `title', is book title
+% \QandA{THESIS TITLE OPTIONAL}{}{thesis-title-o}Title is optional: no warning issued if empty
+% \QandA{TECHNICAL REPORT TITLE}{b}{trtit-b}Tech. report title like books
+% \QandA{TECHNICAL REPORT INSTITUTION}{}{techreport-institution-par}format tech report institution like book publisher
+% \QandA{JOURNAL VOLUME}{b}{vol-bf}Volume bold as {\bf vol}(num)
+% \QandA{JOURNAL VOL AND NUMBER}{x}{vnum-x}Journal vol, without number as 34
+% \QandA{VOLUME PUNCTUATION}{c}{volp-com}Volume with comma as vol(num), ppp
+% \QandA{PAGE NUMBERS}{f}{jpg-1}Only start page number
+% \QandA{BOOK EDITOR W/O AUTHOR}{}{book-editor-booktitle}Book permits empty author, produces title before editor in this case
+% \QandA{INBOOK PERMITS TITLE, BOOKTITLE, AUTHOR, EDITOR}{a}{inbook-editor-booktitle}Allow using both title/booktitle, both author/editor
+% \QandA{CONFERENCE ADDRESS FOR BOOK, INBOOK, INCOLLECTION, INPROCEEDINGS, PROCEEDINGS}{a}{bookaddress}Italic booktitle followed by bookaddress in roman
+% \QandA{NUMBER AND SERIES FOR BOOK, INBOOK, INCOLLECTION, INPROCEEDINGS, PROCEEDINGS}{*}{num-xser}Allows number without series and suppresses word "number"
+% \QandA{WORD NUMBER CAPITALIZED FOR NUMBER AND SERIES}{c}{number-cap}Capitalize word `number' as: "Number 123"
+% \QandA{WORD CHAPTER CAPITALIZED}{c}{chapter-cap}Capitalize word `chapter' as: `Chapter 42'
+% \QandA{COMBINING NUMBER AND SERIES}{x}{series-number}Series number as: `Springer Lecture Notes No. 125'
+% \QandA{POSITION OF NUMBER AND SERIES}{b}{numser-booktitle}After book title and conference address, and before editors
+% \QandA{VOLUME AND SERIES FOR BOOKS/COLLECTIONS}{s}{ser-vol}Series, vol. 23
+% \QandA{VOLUME AND SERIES FORMATTING}{y}{ser-rm}format series roman , even when used with volume
+% \QandA{WORD VOLUME CAPITALIZED FOR VOLUME AND SERIES}{y}{volume-cap}Capitalize word `volume', as: `Volume 7 in Lecture Series'
+% \QandA{POSITION OF VOLUME AND SERIES FOR INCOLLECTION, INBOOK, AND INPROCEEDINGS}{e}{ser-ed}Series and volume after booktitle and before editors
+% \QandA{JOURNAL NAME PUNCTUATION}{x}{jnm-x}Space after journal name
+% \QandA{PAGES IN BOOK}{*}{pg-bk,book-chapter-pages}As chapter and page: chapter 42, page 345
+% \QandA{PUBLISHER IN PARENTHESES}{d}{pub-date}Publisher with address and date in parentheses (Oxford, 1994)
+% \QandA{EMPTY PUBLISHER PARENTHESES}{y}{ay-empty-pub-parens-x}eliminate parentheses altogether if nothing inside
+% \QandA{PUBLISHER POSITION}{}{pre-pub}Publisher before volume, chapter, pages
+% \QandA{}{}{pre-edn}Edition before publisher
+% \QandA{}{p}{pre-pub,pre-edn}Edition, publisher, volume, chapter, pages
+% \QandA{ISBN NUMBER}{*}{isbn}Include ISBN for books, booklets, etc.
+% \QandA{ISSN NUMBER}{*}{issn}Include ISSN for periodicals
+% \QandA{DOI NUMBER}{a}{doi-link,doi}Doi forms a link to the publication, anchored to the volume or title
+% \QandA{EDITOR IN COLLECTIONS}{b}{edby}In booktitle, edited by .. (where .. is names)
+% \QandA{PUNCTUATION BETWEEN SECTIONS (BLOCKS)}{c}{blk-com}Comma between blocks
+% \QandA{FINAL PUNCTUATION}{c}{fin-endbibitem}Command at end instead of period
+% \QandA{ABBREVIATE WORD `PAGES'}{a}{pp}`Page' abbreviated as p. or pp.
+% \QandA{ABBREVIATE WORD `EDITORS'}{a}{ed}`Editor' abbreviated as ed. or eds.
+% \QandA{OTHER ABBREVIATIONS}{a}{abr}Abbreviations of such words
+% \QandA{ABBREVIATION FOR `EDITION'}{a}{ednx}`Edition' abbreviated as `ed'
+% \QandA{EDITION NUMBERS}{n}{ord}Numerical editions as 1st, 2nd, 3rd, etc
+% \QandA{STORED JOURNAL NAMES}{a}{jabr}Abbreviated journal names
+% \QandA{FONT OF `ET AL'}{i}{etal-it}Italic et al
+% \QandA{ADDITIONAL REVTeX DATA FIELDS}{r}{revdata,eprint,url,url-blk,translation}Include REVTeX data fields collaboration, eid, eprint, archive, url, translation
+% \QandA{SLACcitation FIELD}{}{SLACcitation}Produce SLACcitation field
+% \QandA{NUMPAGES DATA FIELD}{*}{numpages-x}Do not include numpages field
+% \QandA{URL ADDRESS}{*}{url,url-prefix-x}URL without prefix (default: `URL ')
+% \QandA{REFERENCE COMPONENT TAGS}{b}{bibinfo}Reference component tags like \cmd\bibinfo in the content of \cmd\bibitem
+% \QandA{ELEMENT TAGS}{b}{bibfield}Element tags like \cmd\bibfield in the content of \cmd\bibitem
+% \QandA{COMPATIBILITY WITH PLAIN TEX}{*}{nfss}Use LaTeX commands which may not work with Plain TeX
% \end{enumerate}
%
% A file \file{apsrev.dbj} file equivalent to the following should result:
% \begin{verbatim}
-% \input docstrip
-% \preamble
-% ----------------------------------------
-% *** REVTeX-compatible apsrev.bst ***
-% \endpreamble
-% \postamble
-% End of customized bst file
-% \endpostamble
-% \keepsilent
-% \askforoverwritefalse
-% \def\MBopts{\from{merlin.mbs}{%
-% seq-no%: Citation order (unsorted, like unsrt.bst)
-% ,nm-init,ed-au%: Initials + surname (J. F. Smith)
-% ,nmlm%: Limited authors (et al replaces missing names)
-% ,x10%: Maximum of 10 authors
-% ,m10%: Minimum of 10 authors
-% ,nmft,nmft-def%: User defined author font (\bibnamefont)
-% ,fnm-def%: First names in user defined font (\bibfnamefont)
-% ,nmfted%: Editors incollection like authors font
-% ,yr-par%: Date in parentheses as (May 1993)
-% ,xmth%: Date is year only
-% ,tit-it%: Title italic (\em)
-% ,jtit-x%: No article title
-% ,jttl-rm%: Journal name normal font
-% ,trtit-b%: Tech. report title like books
-% ,vol-bf%: Volume bold as {\bf vol}(num)
-% ,volp-com%: Volume with comma as vol(num), ppp
-% ,jpg-1%: Only start page number
-% ,jnm-x%: Space after journal name
-% ,pub-date%: Publisher and date in parentheses (Oxford, 1994)
-% ,pre-pub%: Publisher before chapter, pages
-% ,isbn%: Include ISBN for books, booklets, etc.
-% ,issn%: Include ISSN for periodicals
-% ,edby%: In booktitle, edited by .. (where .. is names)
-% ,blk-com%: Comma between blocks
-% ,pp%: `Page' abbreviated as p. or pp.
-% ,ed%: `Editor' abbreviated as ed. or eds.
-% ,abr%: Abbreviations of such words
-% ,ednx%: `Edition' abbreviated as `ed'
-% ,ord%: Numerical editions as 1st, 2nd, 3rd, etc
-% ,jabr%: Abbreviated journal names
-% ,etal-it%: Italic et al
-% ,revdata,eprint,url,url-blk%: Include REVTeX data fields collaboration, eid, eprint, numpages, url
-% ,url,url-nt%: URL as note
-% ,bibinfo%: Reference component tags like \bibinfo in the content of \bibitem
-% ,nfss%: NFSS use \textbf, \emph, not \bf, \em
-% }}
-% \generate{\file{\jobname.bst}{\MBopts}}
-% \endbatchfile
+%\input docstrip
+%\preamble
+%----------------------------------------
+%*** REVTeX-compatible Phys Rev 2009-10-08 ***
+%\endpreamble
+%\postamble
+%End of customized bst file
+%\endpostamble
+%\keepsilent
+%\askforoverwritefalse
+%\def\MBopts{\from{merlin.mbs}{%
+% head,\MBopta}
+%\from{physjour.mbs}{\MBopta}
+%\from{geojour.mbs}{\MBopta}
+%\from{photjour.mbs}{\MBopta}
+%\from{merlin.mbs}{tail,\MBopta}}
+%\def\MBopta{%
+% lang,%: Use language field to switch hyphenation patterns for title
+% annote,%: Annotations in annote field or in .tex file of citekey name
+% pres,pres-bf,%: Presentation, speaker bold face
+% seq-no,%: Citation order (unsorted, like unsrt.bst)
+% vonx,%: Sort without von part (de la Maire after Mahone)
+% nm-init,ed-au,%: Initials + surname (J. F. Smith)
+% jnrlst,%: Junior comes last as Smith, John, Jr.
+% nmft,nmft-def,%: User defined author font (\bibnamefont)
+% fnm-def,%: First names in user defined font (\bibfnamefont)
+% nmfted,%: Editors incollection like authors font
+% nmand-rm,%: `And' in normal font (JONES and JAMES)
+% lab,lab-def,%: User defined citation font (\citenamefont)
+% and-rm,%: Cited `and' in normal font
+% yr-par,%: Date in parentheses as (May 1993)
+% date-nil-x,%: If date is empty, then do not produce the surrounding punctuation (parens, brackets, colon, comma)
+% tit-qq,%: Title and punctuation in double quotes (``Title,'' ..)
+% inproceedings-chapter,%: produce pages after chapter, just as in InBook
+% jtit-x,%: Title is ignored
+% inproceedings-chapter,%: produce pages after chapter just as in InBook
+% article-booktitle,%: format booktitle
+% article-series,%: article can has series
+% jttl-rm,%: Journal name normal font
+% journal-address,%: Include address field (in parentheses) along with journal name
+% book-bt,%: Field `booktitle', or if absent field `title', is book title
+% thesis-title-o,%: Title is optional: no warning issued if empty
+% trtit-b,%: Tech. report title like books
+% techreport-institution-par,%: format tech report institution like book publisher
+% vol-bf,%: Volume bold as {\bf vol}(num)
+% vnum-x,%: Journal vol, without number as 34
+% volp-com,%: Volume with comma as vol(num), ppp
+% jpg-1,%: Only start page number
+% book-editor-booktitle,%: Book permits empty author, produces title before editor in this case
+% inbook-editor-booktitle,%: Allow using both title/booktitle, both author/editor
+% bookaddress,%: Italic booktitle followed by bookaddress in roman
+% num-xser,%: Allows number without series and suppresses word "number"
+% number-cap,%: Capitalize word `number' as: "Number 123"
+% chapter-cap,%: Capitalize word `chapter' as: `Chapter 42'
+% series-number,%: Series number as: `Springer Lecture Notes No. 125'
+% numser-booktitle,%: After book title and conference address, and before editors
+% ser-vol,%: Series, vol. 23
+% ser-rm,%: format series roman , even when used with volume
+% volume-cap,%: Capitalize word `volume', as: `Volume 7 in Lecture Series'
+% ser-ed,%: Series and volume after booktitle and before editors
+% jnm-x,%: Space after journal name
+% pg-bk,book-chapter-pages,%: As chapter and page: chapter 42, page 345
+% pub-date,%: Publisher with address and date in parentheses (Oxford, 1994)
+% ay-empty-pub-parens-x,%: eliminate parentheses altogether if nothing inside
+% pre-pub,pre-edn,%: Edition, publisher, volume, chapter, pages
+% isbn,%: Include ISBN for books, booklets, etc.
+% issn,%: Include ISSN for periodicals
+% doi-link,doi,%: Doi forms a link to the publication, anchored to the volume or title
+% edby,%: In booktitle, edited by .. (where .. is names)
+% blk-com,%: Comma between blocks
+% fin-endbibitem,%: Command at end instead of period
+% pp,%: `Page' abbreviated as p. or pp.
+% ed,%: `Editor' abbreviated as ed. or eds.
+% abr,%: Abbreviations of such words
+% ednx,%: `Edition' abbreviated as `ed'
+% ord,%: Numerical editions as 1st, 2nd, 3rd, etc
+% jabr,%: Abbreviated journal names
+% etal-it,%: Italic et al
+% revdata,eprint,url,url-blk,translation,%: Include REVTeX data fields collaboration, eid, eprint, archive, url, translation
+% SLACcitation,%: Produce SLACcitation field
+% numpages-x,%: Do not include numpages field
+% url,url-prefix-x,%: URL without prefix (default: `URL ')
+% bibinfo,%: Reference component tags like \bibinfo in the content of \bibitem
+% bibfield,%: Element tags like \bibfield in the content of \bibitem
+% nfss,%: Use LaTeX commands which may not work with Plain TeX
+%,{%
+% }}
+%\generate{\file{apsrev4-1.bst}{\MBopts}}
+%\endbatchfile
% \end{verbatim}
%
+% Note that \file{apsrevlong.dbj} is the same as \file{apsrev.dbj}, except:
+% \begin{itemize}
+% \item
+% Remove \texttt{jtit-x}, \texttt{jpg-1}. This means article titles and full page range.
+% \item
+% Add \texttt{article-title-o}: article title is not required.
+% \item
+% Remove \texttt{nm-init}. This means full names.
+% \item
+% The file to be \cmd\generate d is \filename{apsrev4-1long.bst} instead of \filename{apsrev4-1.bst}.
+% \end{itemize}
+%
+%
+% \subsubsection{Comparing apsrev.bst and apsrmp.bst}
+% These two bibliographic styles differ as follows:
+% \file{apsrev.dbj} has the following guard codes, which \file{apsrmp.dbj} does not:
+% \begin{itemize}
+% \CandE{seq-no}%
+% Citation order (unsorted, like unsrt.bst)
+% \CandE{nm-init,ed-au}%
+% Initials + surname (J. F. Smith)
+% \CandE{yr-par}%
+% Date in parentheses as (May 1993)
+% \CandE{date-nil-x}%
+% If date is empty, then do not produce the surrounding punctuation (parens, brackets, colon, comma)
+% \CandE{inproceedings-chapter}%
+% produce pages after chapter, just as in InBook
+% \CandE{techreport-institution-par}%
+% format tech report institution like book publisher
+% \CandE{vnum-x}%
+% Journal vol, without number as 34
+% \CandE{pub-date}%
+% Publisher with address and date in parentheses (Oxford, 1994)
+% \CandE{pre-pub}%
+% Publisher before volume, chapter, pages
+% \CandE{pre-pub,pre-edn}%
+% Edition, publisher, volume, chapter, pages
+% \CandE{url,url-prefix-x}%
+% URL without prefix (default: `URL ')
+% \end{itemize}
+%
% To get a banner in the \file{.blg} file, patch by hand into \file{apsrev.bst}:
% \begin{verbatim}
% FUNCTION {banner.log} {"REVTeX-compatible apsrev.bst 9812" warning$}
@@ -7697,43 +6686,60 @@ See the REVTeX 4 README file for restrictions and more information.
% later on (see Section~\ref{sec:aps-defaults}).
% \end{macro}
%
+% \begin{macro}{\authoryear@sw}
+% \changes{4.1a}{2008/01/18}{(AO, 457) Endnotes to be sorted in with numerical citations.}%
+% Numerical citations: default value of \cmd\authoryear@sw\ is false.
+% \begin{macrocode}
+\@booleanfalse\authoryear@sw
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\bibpunct}
% The following commands effectively establish the style in which \cmd\cite\ commands are
% formatted.
% You can think of them as the second needed component for the bibliography.
%
-% Set up for numerical citations.
-%
-% The journal substyles can override these choices.
+% Set up for APS numerical citations (once the packages are loaded).
+% The journal substyle can override these choices.
%
-% Note that setting \cmd\NAT@sort\ at this late hour is not totally effective.
-% You have to give \classname{natbib} the relevant options at load time.
+% Note that, prior to \classname{natbib} version 8.21, changing \cmd\NAT@sort\ at this late hour would not be totally effective;
+% you would have to give \classname{natbib} the relevant options at load time.
+% From version 8.21 on, \cmd\NAT@sort\ and \cmd\NAT@cmprs\ are not bound at all.
+% \changes{4.1a}{2008/01/19}{For natbib versions before 8.21, \cs{NAT@sort} was consulted only as natbib was being read in. Now it is fully dynamic.}
% \begin{macrocode}
+\appdef\setup@hook{%
\bibpunct{[}{]}{,}{n}{}{,}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pre@bibdata}
+%
+% Set up to write endnotes to a .bib file; its data will be incorporated into the bibliography.
+% \begin{macrocode}
+ \def\pre@bibdata{\jobname\bibdata@app}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\bibsection}
% We define the sectioning command to use when starting the bibliography.
%
-% \changes{v4.0rc1}{2001/06/18}
-% {grid changes with push and pop}
+% \changes{4.0rc1}{2001/06/18}{grid changes with push and pop}
% \begin{macrocode}
+\appdef\setup@hook{%
\def\bibsection{%
\par
-% \twocolumn@sw{\onecolumngrid}{}%
\onecolumngrid@push
\begingroup
\baselineskip26\p@
-% \def\@currentHref{section.bib}%
\bib@device{\textwidth}{245.5\p@}%
- \endgroup
+ \endgroup
\nobreak\@nobreaktrue
\addvspace{19\p@}%
\par
-% \twocolumn@sw{\twocolumngrid}{}%
\onecolumngrid@pop
}%
+}%
% \end{macrocode}
% \end{macro}
%
@@ -7744,30 +6750,35 @@ See the REVTeX 4 README file for restrictions and more information.
% We define the sectioning command to use when starting the bibliography.
% \begin{macrocode}
\def\bib@device#1#2{%
- \hb@xt@#1{%
- \hfil
- \phantomsection
- \addcontentsline {toc}{section}{\protect\numberline{}\refname}%
-% \hyper@anchorstart {\@currentHref }%
- \hb@xt@#2{%
- \skip@\z@\@plus-1fil\relax
- \leaders\hrule height.25 \p@ depth.25 \p@ \hskip\z@\@plus1fil
- \hskip\skip@
- \hskip\z@\@plus0.125fil\leaders\hrule height.375\p@ depth.375\p@ \hskip\z@\@plus0.75fil \hskip\z@\@plus0.125fil
- \hskip\skip@
- \hskip\z@\@plus0.25 fil\leaders\hrule height.5 \p@ depth.5 \p@ \hskip\z@\@plus0.5 fil \hskip\z@\@plus0.25 fil
- \hskip\skip@
- \hskip\z@\@plus0.375fil\leaders\hrule height.625\p@ depth.625\p@ \hskip\z@\@plus0.25fil \hskip\z@\@plus0.375fil
- % \hskip\skip@
- % \hfil
- }%
-%\hyper@anchorend
- \hfil
- }%
+ \hb@xt@\z@{%
+ \hb@xt@#1{%
+ \hfil
+ \phantomsection
+ \addcontentsline {toc}{section}{\protect\numberline{}\refname}%
+% \hyper@anchorstart {\@currentHref }%
+ \hb@xt@#2{%
+ \skip@\z@\@plus-1fil\relax
+ \leaders\hrule height.25 \p@ depth.25 \p@ \hskip\z@\@plus1fil
+ \hskip\skip@
+ \hskip\z@\@plus0.125fil\leaders\hrule height.375\p@ depth.375\p@ \hskip\z@\@plus0.75fil \hskip\z@\@plus0.125fil
+ \hskip\skip@
+ \hskip\z@\@plus0.25 fil\leaders\hrule height.5 \p@ depth.5 \p@ \hskip\z@\@plus0.5 fil \hskip\z@\@plus0.25 fil
+ \hskip\skip@
+ \hskip\z@\@plus0.375fil\leaders\hrule height.625\p@ depth.625\p@ \hskip\z@\@plus0.25fil \hskip\z@\@plus0.375fil
+ % \hskip\skip@
+ % \hfil
+ }%
+% \hyper@anchorend
+ \hfil
+ }%
+ \hss
+ }%
+}%
+\appdef\setup@hook{%
+ \let\bibpreamble\@empty
+ \bibsep\z@\relax
+ \def\newblock{\ }%
}%
-\let\bibpreamble\@empty
-\bibsep\z@\relax
-\def\newblock{\ }%
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -7778,22 +6789,22 @@ See the REVTeX 4 README file for restrictions and more information.
% We define the font switch that applies to the body of the bibliography.
%
% \begin{macrocode}
+\appdef\setup@hook{%
\def\bibfont{%
\small
+ \@clubpenalty\clubpenalty
}%
+}%
% \end{macrocode}
% \end{macro}
%
%
% \subsubsection{Index}%
% FIXME: the following call to \cmd\twocolumn\ appears wrong if we were in two-column grid.
-% \changes{v4.0beta 3}{1999/11/13}
-% {grid changes with ltxgrid}
-% \changes{v4.0rc1}{2001/06/18}
-% {grid changes with push and pop}
+% \changes{4.0c}{1999/11/13}{grid changes with ltxgrid}
+% \changes{4.0rc1}{2001/06/18}{grid changes with push and pop}
% \begin{macrocode}
\newenvironment{theindex}{%
-%\let\wastwocol@sw\twocolumn@sw
\columnseprule \z@
\columnsep 35\p@
\c@secnumdepth-\maxdimen
@@ -7803,63 +6814,68 @@ See the REVTeX 4 README file for restrictions and more information.
\parindent\z@
\parskip\z@ plus.3\p@\relax
\let\item\@idxitem
-%\wastwocol@sw{\twocolumngrid}{}%
\onecolumngrid@pop
}{%
%\onecolumngrid@pop
}%
%
-\def\@idxitem{\par\hangindent 40\p@}
+\def\@idxitem{\par\hangindent 40\p@}%
%
-\def\subitem{\par\hangindent 40\p@ \hspace*{20\p@}}
+\def\subitem{\par\hangindent 40\p@ \hspace*{20\p@}}%
%
-\def\subsubitem{\par\hangindent 40\p@ \hspace*{30\p@}}
+\def\subsubitem{\par\hangindent 40\p@ \hspace*{30\p@}}%
%
-\def\indexspace{\par \vskip 10\p@ plus5\p@ minus3\p@\relax}
+\def\indexspace{\par \vskip 10\p@ plus5\p@ minus3\p@\relax}%
% \end{macrocode}
%
%
-% \subsection{Journal-Specific Code}%
+% \subsection{Journal- and Pointsize-Specific Code}%
%
-% For APS journals, we supply code specific to PRA, PRB, PRC, PRD, PRE, PRL, and RMP.
-% At present, they are identical,
-% with the exception of PRB's code for superscript citations.
-%
+% After this substyle is read in, we will execute the code specific to the selected
+% journal: execute the society/journal \file{.rtx} file if it exists, or
+% execute the society/journal macro (if the latter is not defined, it will \cmd\relax\ out).
+% Here we define the default journal.
% \begin{macrocode}
-\def\journal@pra{pra}%
-\def\journal@prb{prb}%
-\def\journal@prc{prc}%
-\def\journal@prd{prd}%
-\def\journal@pre{pre}%
-\def\journal@prl{prl}%
-\def\journal@prstab{prstab}%
-\def\journal@rmp{rmp}%
+\def\@journal@default{pra}%
% \end{macrocode}
%
-% Note: the convention in this document class is that
+% \subsection{Typesize-Specific Code}%
+%
+% After this society file is read in, we will process the \cmd\@pointsize-specific
+% code. Here we define the default.
+% \begin{macrocode}
+\def\@pointsize@default{10}%
+% \end{macrocode}
+%
+% Note: the convention in \revtex\ and its substyles is that
% the substyle must not override any explicit class options
% declared by the document.
% This means that the various Booleans of Section~\ref{sec:options}
% may be assigned here only if they are still undefined at this point.
%
+% For the APS, we supply code specific to journals PRA, PRB, PRC, PRD, PRE, PRL, and RMP.
+% At present, they are identical,
+% with the exception of PRB and RMP.
+%
% For most all of the APS journals, the journal-dependent
% code is relatively meager and is therefore embedded in this file.
% However, the RMP code is sufficiently extensive that
% splitting it out into a separate file is more convenient.
%
% \subsubsection{\classoption{pra}}%
+% There is no code specific to \classoption{pra}.
% \begin{macrocode}
-\@ifx{\@journal\journal@pra}{%
-% \end{macrocode}
-%
-% End of \classoption{pra} code.
-% \begin{macrocode}
-}{}%
+\def\rtx@apspra{%
+ \class@info{APS journal PRA selected}%
+}%
% \end{macrocode}
%
% \subsubsection{\classoption{prb}}%
+% We define a \cmd\citealp-like procedure that uses a numerical citation; it is for use in
+% the PRB journal.
% \begin{macrocode}
-\@ifx{\@journal\journal@prb}{%
+\def\rtx@apsprb{%
+ \class@info{APS journal PRB selected}%
% \end{macrocode}
% PRB requires superscript citations.
% We use Patrick Daly's \classname{natbib} package,
@@ -7869,79 +6885,85 @@ See the REVTeX 4 README file for restrictions and more information.
% By default, PRB selects the \classoption{bibnotes} option.
% We also set up for numerical citations.
% \begin{macrocode}
- \@ifxundefined\bibnotes@sw{\@booleantrue\bibnotes@sw}{}%
- \bibpunct{}{}{,}{s}{}{\textsuperscript{,}}%
- \def\@onlinecite#1{\begingroup\let\@cite\NAT@citenum\citealp{#1}\endgroup}%
+ \let\frontmatter@footnote@produce\frontmatter@footnote@produce@endnote
+ \appdef\setup@hook{%
+ \bibpunct{}{}{,}{s}{}{\textsuperscript{,}}%
+ \let\onlinecite\rev@citealpnum
+ }%
% \end{macrocode}
% \end{macro}
%
-% Invoke \classoption{superbib} option if the document
-% has made no selection of its own.
+% \begin{macro}{\pre@bibdata}
+% \begin{macro}{\@endnotetext}
+% \changes{4.1a}{2008/01/18}{(AO, 457) Endnotes to be sorted in with numerical citations.}%
+%
+% Set up to write endnotes to a .bib file; its data will be incorporated into the bibliography.
% \begin{macrocode}
- \appdef\class@documenthook{%
- \@ifxundefined\place@bibnumber{%
- \let\place@bibnumber\place@bibnumber@sup
- }{}%
- }%
+ \def\pre@bibdata{\jobname\bibdata@app}%
% \end{macrocode}
+% \end{macro}
+% \end{macro}
%
-% End of \classoption{prb} code.
+% Invoke \classoption{superbib} option.
+% If the document makes a selection of its own, it will override this assignment.
% \begin{macrocode}
-}{}%
+ \let\place@bibnumber\place@bibnumber@sup
% \end{macrocode}
%
-% \subsubsection{\classoption{prc}}%
+% End of \classoption{prb} code.
% \begin{macrocode}
-\@ifx{\@journal\journal@prc}{%
+}%
% \end{macrocode}
%
-% End of \classoption{prc} code.
+% \subsubsection{\classoption{prc}}%
+% There is no code specific to \classoption{prc}.
% \begin{macrocode}
-}{}%
+\def\rtx@apsprc{%
+ \class@info{APS journal PRC selected}%
+}%
% \end{macrocode}
%
% \subsubsection{\classoption{prd}}%
+% There is no code specific to \classoption{prd}.
% \begin{macrocode}
-\@ifx{\@journal\journal@prd}{%
-% \end{macrocode}
-%
-% End of \classoption{prd} code.
-% \begin{macrocode}
-}{}%
+\def\rtx@apsprd{%
+ \class@info{APS journal PRD selected}%
+}%
% \end{macrocode}
%
% \subsubsection{\classoption{pre}}%
+% There is no code specific to \classoption{pre}.
% \begin{macrocode}
-\@ifx{\@journal\journal@pre}{%
-% \end{macrocode}
-%
-% End of \classoption{prd} code.
-% \begin{macrocode}
-}{}%
+\def\rtx@apspre{%
+ \class@info{APS journal PRE selected}%
+}%
% \end{macrocode}
%
% \subsubsection{\classoption{prl}}%
% \begin{macrocode}
-\@ifx{\@journal\journal@prl}{%
+\def\rtx@apsprl{%
+ \class@info{APS journal PRL selected}%
% \end{macrocode}
% In PRL, the default is the \classoption{bibnotes} option,
% and the Acknowledgments section has no head.
%
-% However, the References head is a device that may be described as a lozenge centered on the baseline,
+% The References head is a device that may be described as a lozenge centered on the baseline,
% 71 points wide by 2 points thick, with the ends tapering to a half point in thickness.
% Space above 26 points base to base, below 31 base to base.
+%FIXME: this code may confound \classname{geometry}
% \begin{macrocode}
- \@ifxundefined\bibnotes@sw{\@booleantrue\bibnotes@sw}{}%
+ \let\frontmatter@footnote@produce\frontmatter@footnote@produce@endnote
\@booleanfalse\acknowledgments@sw
-%\let\acknowledgmentsname\@empty
- \def\bibsection{%
- \par
- \begingroup
- \baselineskip26\p@
- \bib@device{\hsize}{72\p@}%
- \endgroup
- \nobreak\@nobreaktrue
- \addvspace{19\p@}%
+ \appdef\setup@hook{%
+ \def\bibsection{%
+ \par
+ \begingroup
+ \baselineskip26\p@
+ \bib@device{\hsize}{72\p@}%
+ \endgroup
+ \nobreak\@nobreaktrue
+ \addvspace{19\p@}%
+ }%
}%
% \end{macrocode}
% Implement length checking.
@@ -7950,17 +6972,19 @@ See the REVTeX 4 README file for restrictions and more information.
% to make the formatted output be true
% to the metrics of the journal.
%
-% Wait. Do not use mathtime after all. APS has their own way of doing math pi, involving
-% Adobe Mathematical Pi and other fonts.
% \begin{macrocode}
-%\appdef\class@documenthook{%
- \@ifxundefined\lengthcheck@sw{\@booleanfalse\lengthcheck@sw}{}%
+\appdef\setup@hook{%
\lengthcheck@sw{%
\RequirePackage{times}%
+% \end{macrocode}
+% Wait. Do not use mathtime after all. APS has their own way of doing math pi, involving
+% Adobe Mathematical Pi and other fonts.
+% \begin{verbatim}
% \RequirePackage{mathtime}%
- }{%
- }%
-%}%
+% \end{verbatim}
+% \begin{macrocode}
+ }{}%
+}%
% \end{macrocode}
% A PRL does not have numbered sections.
% \begin{macrocode}
@@ -7968,7 +6992,7 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macrocode}
% Note: we defer this code until after type size file is read in.
% \begin{macrocode}
- \appdef\set@typesize@hook{%
+ \appdef\setup@hook{%
\@ifnum{\@pointsize=10\relax}{%
\lengthcheck@sw{%
\def\large{%
@@ -8005,44 +7029,53 @@ See the REVTeX 4 README file for restrictions and more information.
}%
}{}%
}%
-%\appdef\set@pica@hook{%
- \@ifnum{\@pointsize=10\relax}{%
- \textheight = 694.0\p@
-% \textheight = 55\baselineskip
-% \advance\textheight by \topskip
- }{}%
-%}%
+ \textheight = 694.0\p@
% \end{macrocode}
%
% End of \classoption{prl} code.
% \begin{macrocode}
-}{}%
+}%
% \end{macrocode}
%
-% \subsubsection{\classoption{prstab}}%
+% \subsubsection{\classoption{per}}%
+% Here is code specific to \classoption{per}.
% \begin{macrocode}
-\@ifx{\@journal\journal@prstab}{%
+\def\rtx@apsprstper{%
+ \class@info{APS journal PRST-PER selected}%
% \end{macrocode}
+% To first order, PER is the same as PRB, with superscript citations.
%
-% End of \classoption{prstab} code.
% \begin{macrocode}
-}{}%
+ \rtx@apsprb
% \end{macrocode}
%
-% \subsubsection{\classoption{rmp}}%
-% Read in the code from a file.
+% ``Section heads are bold, centered (Roman numeral, Latin letter)''
+%
+% Article titles do not have surrounding double-quotes!
+%
+% End of \classoption{prb} code.
% \begin{macrocode}
-\@ifx{\@journal\journal@rmp}{\input{\@journal\substyle@ext}}{}%
+}%
% \end{macrocode}
%
+% \subsubsection{\classoption{prstab}}%
+% There is no code specific to \classoption{prstab}.
+% \begin{macrocode}
+\def\rtx@apsprstab{%
+ \class@info{APS journal PRSTAB selected}%
+}%
+% \end{macrocode}
+%
+% \subsubsection{\classoption{rmp}}%
+% If this option has been selected, we will read in the needed code from the file \file{apsrmp.rtx}.
%
% \subsection{Establish APS Defaults}\label{sec:aps-defaults}
%
% \begin{macro}{\footinbib@sw}
-% All APS journals except RMP invoke the \classoption{footinbib} option.
-% We rely on the RMP-specific code to give a value to this switch.
+% All APS journals except RMP effectively invoke the \classoption{footinbib} option.
+% We rely on the RMP-specific code to override this assignment.
% \begin{macrocode}
-\@ifxundefined\footinbib@sw{\@booleantrue\footinbib@sw}{}%
+\@booleantrue\footinbib@sw
% \end{macrocode}
% \end{macro}
%
@@ -8050,23 +7083,54 @@ See the REVTeX 4 README file for restrictions and more information.
% \begin{macro}{\@bibstyle}
% We install code that will select the presentation for \cmd\bibitem s
% and govern the \BibTeX\ processing.
-% If the user has not selected any related option and if
-% the journal substyle also has not, then the \classoption{aps}
-% option choses these defaults.
% \begin{macrocode}
-\appdef\class@documenthook{%
- \@ifxundefined\place@bibnumber{%
- \let\place@bibnumber\place@bibnumber@inl
- }{}%
- \@ifxundefined\@bibstyle{%
- \def\@bibstyle{apsrev}%
+\let\place@bibnumber\place@bibnumber@inl
+\def\@bibstyle{apsrev\substyle@post}%
+\appdef\setup@hook{%
+ \longbibliography@sw{%
+ \appdef\@bibstyle{long}%
}{}%
}%
% \end{macrocode}
% \end{macro}
% \end{macro}
%
+% \subsection{APS Sanity Checking}\label{sec:aps-sanity}
+% \changes{4.1f}{2009/07/20}{(AO, 524) Makes no sense if citations are superscript numbers and so are footnotes}
+%
+% Rule: if \cmd\place@bibnumber\ is \cmd\place@bibnumber@sup\
+% (citations are numbered and set superscript),
+% then it makes no sense for \cmd\footinbib@sw\ to be \cmd\false@sw\
+% (footnotes set in the bibliography, as endnotes).
+% If both conditions prevailed, then the document would have footnotes
+% and citations both as superscript arabic numbers, but independently numbered,
+% which would be confusing.
+%
+% Any society that provides for both superscript numbered citations as well as for
+% numbered footnotes should check for this same condition, and deal with it.
+%
+% Note: an alternative would be for footnotes to use the same sequence of footnote devices
+% that are used by the frontmatter footnotes
+% (\cmd\frontmatter@thefootnote\ instead of arabic numbers).
%
+% In this case, we would want to refrain from resetting \cmd\c@footnote\ at the end of
+% the title page formatting.
+% We would also want to treat body footnotes identically to frontmatter footnotes:
+% the assignments in \cmd\titleblock@produce\ would persist throughout the document.
+%
+% But APS do not choose to go that route.
+% \begin{macrocode}
+\appdef\setup@hook{%
+ \@ifx{\place@bibnumber\place@bibnumber@sup}{%
+ \footinbib@sw{}{%
+ \class@warn{Citations are superscript numbers: footnotes must be endnotes; changing to that configuration}%
+ \@booleantrue\footinbib@sw
+ }%
+ }{}%
+}%
+% \end{macrocode}
+%
+% Here ends the substyle for society APS.
% \begin{macrocode}
%</aps>
% \end{macrocode}
@@ -8074,11 +7138,11 @@ See the REVTeX 4 README file for restrictions and more information.
%
% \section{The \classoption{rmp} journal substyle: the \texttt{rmp} module}
%
-% The file \file{rmp.rtx} is read in by the \classname{revtex4} document class
+% The file \file{apsrmp.rtx} is read in by the \classname{revtex4} document class
% if \cmd\@society\ has the value \classoption{aps}
% and \cmd\@journal\ has the value \classoption{rmp}.
%
-% It is read at the end of the \filename{aps.rtx}, so all definitions
+% It is read at the end of the \file{aps.rtx}, so all definitions
% and assignments in that file are operative unless overridden here.
%
%
@@ -8099,18 +7163,30 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macrocode}
%
% Protect this file from being read in as a society instead of a journal.
-% In such a case, \cmd\@journal\ will be \cmd\@empty.
+% In such a case, \cmd\@journal\ will be undefined.
% \begin{macrocode}
-\@ifx@empty\@journal{%
- \class@warn{I have to read in the aps substyle first!}%
- \endinput
- \def\@society{aps}\def\@journal{rmp}%
- \expandafter\input\expandafter{\@society\substyle@ext}%
+\@ifxundefined\@journal{%
+% \end{macrocode}
+% One alternative: abort the document.
+% Another alternative: try to recover: force load the aps society file
+% \begin{macrocode}
+ \class@warn{Please specify the REVTeX options [aps,rmp]!}%
+ \@@end
}{}%
% \end{macrocode}
+% Log the journal substyle.
+% \begin{macrocode}
+ \class@info{APS journal RMP selected}%
+% \end{macrocode}
%
% \subsection{Frontmatter}%
%
+% We assign the titlepage style for RMP; a document instance
+% may override by invoking one of the class options of \revtex.
+% \begin{macrocode}
+\clo@groupedaddress
+% \end{macrocode}
+%
% \begin{macro}{\frontmatter@setup}
%
% \begin{macrocode}
@@ -8141,6 +7217,8 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macro}
%
% \begin{macro}{\frontmatter@authorformat}
+% \changes{4.1b}{2008/08/04}{Rag the right even more: .8\cs{hsize}. Also, assign \cs{@totalleftmargin}.}%
+% \changes{4.1b}{2008/06/29}{(AO, 455) Be nice to a list within the abstract (assign \cs{@totalleftmargin}).}
% Set the rag to a milder value, because we want to do true ragged right
% typesetting, as opposed to the \LaTeX\ default, which gives very poor results.
%
@@ -8149,15 +7227,18 @@ See the REVTeX 4 README file for restrictions and more information.
\def\frontmatter@authorformat{%
\preprintsty@sw{\vskip0.5pc\relax}{}%
\@tempskipa\@flushglue
- \@flushglue\z@ plus50\p@\relax
+ \@flushglue\z@ plus.8\hsize
\raggedright\advance\leftskip.5in\relax
\@flushglue\@tempskipa
\parskip\z@skip
+ \@totalleftmargin\leftskip
}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@affiliationfont}
+% \changes{4.1b}{2008/08/04}{As with author formatting, rag the right more, and assign \cs{@totalleftmargin}. Also neutralize \cs{def@after@address}.}%
+% \changes{4.1b}{2008/06/29}{(AO, 455) Be nice to a list within the abstract (assign \cs{@totalleftmargin}).}
% The hook \cmd\frontmatter@affiliationfont\ controls the formatting of affiliations and affiliation groups.
% The hook \cmd\frontmatter@above@affilgroup\ is invoked just before proceeding with author/affiliation processing.
% The \cmd\frontmatter@above@affiliation\ is the amount of space above affiliations in the \classoption{groupedaddress} style,
@@ -8168,9 +7249,11 @@ See the REVTeX 4 README file for restrictions and more information.
\def\frontmatter@affiliationfont{% Helvetica 9/10.2
\small\slshape\selectfont\baselineskip10.5\p@\relax
\@tempskipa\@flushglue
- \@flushglue\z@ plus50\p@\relax
+ \@flushglue\z@ plus.8\hsize
\raggedright\advance\leftskip.5in\relax
\@flushglue\@tempskipa
+ \@totalleftmargin\leftskip
+ \let\def@after@address\def@after@address@empty
}%
\def\frontmatter@above@affilgroup{\addvspace{7.2\p@}}% additional leading above an author
\def\frontmatter@above@affiliation{\addvspace{5.3\p@}}%
@@ -8179,15 +7262,20 @@ See the REVTeX 4 README file for restrictions and more information.
% \end{macro}
%
% Set up the default RMP style for title block authors and affiliations.
-% This command should effectively override the effect of the
-% corresponding command in the parent substyle.
+% We assign the titlepage style for RMP; a document instance
+% may override by invoking one of the class options of \revtex.
+% \changes{4.1b}{2008/08/04}{The \texttt{rmp} journal substyle selects \texttt{groupedaddress} by default.}%
+% \changes{4.1b}{2008/07/01}{(AO) make settings at class time instead of deferring them to later.}
+%
+% This command should override the effect of the
+% corresponding command in the society substyle,
+% and any document class option bearing on same will in turn override.
% \begin{macrocode}
-\@ifxundefined\groupauthors@sw{%
- \clo@groupedaddress
-}{}%
+\clo@groupedaddress
% \end{macrocode}
%
% \begin{macro}{\frontmatter@RRAP@format}
+% \changes{4.1b}{2008/06/29}{(AO, 455) Be nice to a list within the abstract (assign \cs{@totalleftmargin}).}
% Note: in RMP, if we are not in preprint mode, the date will not be produced.
%
% Note: Helvetica C/lc, 8.98bp, space above: 16.3bp b-b.
@@ -8196,12 +7284,8 @@ See the REVTeX 4 README file for restrictions and more information.
\addvspace{7.3\p@}%
\small
\raggedright\advance\leftskip.5in\relax
-% \parskip.5ex\relax
-% \everypar{\hbox\bgroup(\@gobble@leavemode@uppercase}%
-% \def\par{\@ifvmode{}{\unskip)\egroup\@@par}}%
-% \preprintsty@sw{}{\let\@date\@empty}%
+ \@totalleftmargin\leftskip
}%
-%\def\@gobble@leavemode@uppercase#1#2{\expandafter\MakeTextUppercase}%
\def\produce@RRAP#1{%
\@if@empty{#1}{}{%
\@ifvmode{\leavevmode}{}%
@@ -8229,15 +7313,14 @@ See the REVTeX 4 README file for restrictions and more information.
%
% \begin{macro}{\frontmatter@abstractfont}
% TimesTen 8.93bp/9.6bp X 360bp, indented 36bp, with 21.9/37.6bp b-b above/below
+% \changes{4.1b}{2008/06/29}{(AO, 455) Be nice to a list within the abstract (assign \cs{@totalleftmargin}).}
% \begin{macrocode}
\def\frontmatter@abstractfont{%
\footnotesize
\hsize360\p@
\leftskip=0.5in
- \advance\hsize\leftskip
-%\rightskip=\leftskip
\parindent\z@
-%\hsize5.5in
+ \@totalleftmargin\leftskip
}%
% \end{macrocode}
% \end{macro}
@@ -8259,19 +7342,19 @@ See the REVTeX 4 README file for restrictions and more information.
%
% \subsection{General Text}%
%
-% If not in preprint mode, set the type size to 10/12 point. Note: s/b 11.6bp leading
+% \changes{4.1b}{2008/07/01}{(AO) make settings at class time instead of deferring them to later.}
+% If not in preprint mode, RMP sets the type size to 10/12 point. Note: s/b 11.6bp leading
+%FIXME: define \cmd\normalsize\ only if nobody else has done so.
% \begin{macrocode}
- \appdef\set@typesize@hook{%
- \@ifxundefined\preprintsty@sw{}{%
- \preprintsty@sw{}{%
- \def\normalsize{%
- \@setsize\normalsize{12pt}\xpt\@xpt
- \abovedisplayskip 10\p@ plus2\p@ minus5\p@
- \belowdisplayskip \abovedisplayskip
- \abovedisplayshortskip \abovedisplayskip
- \belowdisplayshortskip \abovedisplayskip
- \let\@listi\@listI
- }%
+ \appdef\setup@hook{%
+ \preprintsty@sw{}{%
+ \def\normalsize{%
+ \@setsize\normalsize{12pt}\xpt\@xpt
+ \abovedisplayskip 10\p@ plus2\p@ minus5\p@
+ \belowdisplayskip \abovedisplayskip
+ \abovedisplayshortskip \abovedisplayskip
+ \belowdisplayshortskip \abovedisplayskip
+ \let\@listi\@listI
}%
}%
}%
@@ -8286,22 +7369,40 @@ See the REVTeX 4 README file for restrictions and more information.
%
%
% \subsection{Sectioning}
+% \changes{4.1b}{2008/08/04}{Use \cs{setup@hook} to initialize all.}
+% \changes{4.1b}{2008/08/01}{Section numbering via procedures \cs{secnums@rtx} and \cs{secnums@arabic}.}
%
+% We override the meaning of \cmd\secnums@rtx.
+% The class option \classoption{secnumarabic} will continue to work.
% \begin{macrocode}
-\def\thepart{\Roman{part}} %
-\def\thesection{\Roman{section}}
-\def\p@section{}
-\def\thesubsection{\Alph{subsection}}
-\def\p@subsection{\thesection.}
-\def\thesubsubsection{\arabic{subsubsection}}
-\def\p@subsubsection{\thesection.\thesubsection.}
-\def\theparagraph{\alph{paragraph}}
-\def\p@paragraph{\thesection.\thesubsection.\thesubsubsection.}
-\def\thesubparagraph{\arabic{subparagraph}}
-\def\p@subparagraph{\thesection.\thesubsection.\thesubsubsection.\theparagraph.}
+\def\secnums@rtx{%
+ \@ifxundefined\thepart{%
+ \def\thepart{\Roman{part}}%
+ }{}%
+ \@ifxundefined\thesection{%
+ \def\thesection {\Roman{section}}%
+ \def\p@section {}%
+ }{}%
+ \@ifxundefined\thesubsection{%
+ \def\thesubsection {\Alph{subsection}}%
+ \def\p@subsection {\thesection.}%
+ }{}%
+ \@ifxundefined\thesubsubsection{%
+ \def\thesubsubsection {\arabic{subsubsection}}%
+ \def\p@subsubsection {\thesection.\thesubsection.}%
+ }{}%
+ \@ifxundefined\theparagraph{%
+ \def\theparagraph {\alph{paragraph}}%
+ \def\p@paragraph {\thesection.\thesubsection.\thesubsubsection.}%
+ }{}%
+ \@ifxundefined\thesubparagraph{%
+ \def\thesubparagraph {\arabic{subparagraph}}%
+ \def\p@subparagraph {\thesection.\thesubsection.\thesubsubsection.\theparagraph.}%
+ }{}%
+}%
% \end{macrocode}
%
-% In RMP, put a period (.), followed by nut space, after the section number.
+% In RMP, put a period (.), followed by `nut space', after the section number.
% Also, hang the section number (the \LaTeX\ default).
% \begin{macrocode}
\def\@seccntformat#1{\csname the#1\endcsname.\hskip0.5em\relax}%
@@ -8315,6 +7416,7 @@ See the REVTeX 4 README file for restrictions and more information.
%
% To accomplish this, we use the \cmd\@hangfrom@\ hook, which was developed for this
% purpose.
+% \changes{4.1b}{2008/07/01}{Add \cs{@hangfroms@section}}
% \begin{macrocode}
\def\section{%
\@startsection{section}{1}{\z@}{0.8cm plus1ex minus.2ex}{0.4cm}%
@@ -8325,6 +7427,7 @@ See the REVTeX 4 README file for restrictions and more information.
}%
}%
\def\@hangfrom@section#1#2#3{\@hangfrom{#1#2}\MakeTextUppercase{#3}}%
+ \def\@hangfroms@section#1#2{#1\MakeTextUppercase{#2}}%
\def\subsection{%
\@startsection{subsection}{2}{\z@}{0.8cm plus1ex minus.2ex}{0.4cm}%
{%
@@ -8361,10 +7464,10 @@ See the REVTeX 4 README file for restrictions and more information.
% \begin{macro}{\@hangfrom@appendix}
% \begin{macro}{\@hangfroms@appendix}
% \begin{macro}{\@appendixcntformat}
+% \changes{4.1b}{2008/07/01}{Add \cs{@hangfroms@section}}
% \begin{macrocode}
\appdef\appendix{%
\let\@hangfrom@section\@hangfrom@appendix
- \let\@hangfroms@section\@hangfroms@appendix
\let\@sectioncntformat\@appendixcntformat
}%
\def\@hangfrom@appendix#1#2#3{%
@@ -8388,6 +7491,7 @@ See the REVTeX 4 README file for restrictions and more information.
%
% \subsection{Figure and Table Caption Formatting}
% \begin{macro}{\@makecaption}
+% \changes{4.1b}{2008/07/01}{Break out \cs{@caption@fignum@sep}}
%
% \begin{macrocode}
\setlength\belowcaptionskip{2\p@}
@@ -8396,12 +7500,12 @@ See the REVTeX 4 README file for restrictions and more information.
\vbox{%
\flushing
\small\rmfamily
-% \hsize\@capwidth
\noindent
- #1\nobreak\hskip.5em plus.2em\ignorespaces#2\par
+ #1\@caption@fignum@sep#2\par
}%
\vskip\belowcaptionskip
}%
+\def\@caption@fignum@sep{\nobreak\hskip.5em plus.2em\ignorespaces}%
% \end{macrocode}
% \end{macro}
%
@@ -8423,169 +7527,264 @@ See the REVTeX 4 README file for restrictions and more information.
% To generate \file{apsrmp.bst}, use \classname{custom-bib} version 3.89d1 or later.
% Run the \file{.bst} generator, \file{makebst.tex}, with the following options:
%
+% \def\QandA#1#2#3{\item#1: \textbf{#2}: \texttt{#3}---}%
+% \def\CandE#1{\item\relax\texttt{#1}---}%
% \begin{enumerate}
-% \item
-% STYLE OF CITATIONS: a: ay( Author-year with some non-standard interface)
-% \item
-% AUTHOR-YEAR SUPPORT SYSTEM: nat: (Natbib for use with natbib v5.3 or later)
-% \item
-% ORDERING OF REFERENCES: *: (Alphabetical);
-% \item
-% ORDER ON VON PART: x: vonx (Sort without von part---de la Maire after Mahone)
-% \item
-% AUTHOR NAMES: a: nm-rev1 (Only first name reversed, initials---AGU style: Smith, J. F., H. K. Jones)
-% \item
-% POSITION OF JUNIOR: jnrlst (Junior comes last as Smith, John, Jr.)
-% \item
-% NUMBER OF AUTHORS: l: max 12, min 12 (three prompts in all);
-% \item
-% TYPEFACE FOR AUTHORS IN LIST OF REFERENCES: u: nmft, nmft-def (User defined author font---\cmd\bibnamefont)
-% \item
-% FONT FOR FIRST NAMES: u: fnm-def (First names in user defined font---\cmd\bibfnamefont)
-% \item
-% EDITOR NAMES IN INCOLLECTION ETC: a: nmfted (Editors incollection like authors font)
-% \item
-% FONT FOR `AND' IN LIST: r: nmand-rm (`And' in normal font---JONES and JAMES)
-% \item
-% FONT OF CITATION LABELS IN TEXT: u: lab, lab-def (User-defined citation font---\cmd\citenamefont)
-% \item
-% LABEL WHEN AUTHORS MISSING: keyxyr (Year blank when KEY replaces missing author---for natbib 7.0)
-% \item
-% DATE POSITION: b: dt-beg (Date after authors)
-% \item
-% SUPPRESS MONTH: xmth (Date is year only)
-% \item
-% DATE FORMAT: yr-com (Date preceded by comma as `, 1993')
-% \item
-% TRUNCATE YEAR: note-yr (Year text full as 1990--1993 or `in press')
-% \item
-% ARTICLE TITLE PRESENT: x: jtit-x (No article title);
-% \item
-% JOURNAL TITLE FONT: r: jttl-rm (Journal title normal);
-% \item
-% TECHNICAL REPORT TITLE: b: trtit-b (Tech. report title like books);
-% \item
-% JOURNAL VOLUME: b: vol-bf (Volume bold);
-% \item
-% VOLUME PUNCTUATION: c: volp-com (Volume with comma);
-% \item
-% PAGE NUMBERS: f: jpg-1 (Only start page number);
-% \item
-% POSITION OF PAGES: e: pp-last (Pages at end, but before any notes)
-% \item
-% NUMBER AND SERIES FOR COLLECTIONS: num-xser (Allows number without series and suppresses word ``number'')
-% \item
-% JOURNAL NAME PUNCTUATION: x: jnm-x (Space after journal);
-% \item
-% PUBLISHER IN PARENTHESES: p: pub-par (Publisher in parentheses)
-% \item
-% PUBLISHER POSITION: p: pre-pub (Publisher before chapter, pages);
-% \item
-% ISBN NUMBER: *: isbn (Include ISBN);
-% \item
-% ISSN NUMBER: *: isbn (Include ISSN for periodicals);
-% \item
-% `EDITOR' AFTER NAMES: a: edpar (`Name (editor),' in parentheses, after name, comma after)
-% \item
-% EDITOR IN COLLECTIONS: b: edby (In booktitle, edited by\dots---where \dots is names)
-% \item
-% PUNCTUATION BETWEEN SECTIONS (BLOCKS): c: blk-com (Comma between blocks);
-% \item
-% `IN' WITH JOURNAL NAMES: i: injnl (Add `in' before journal name in style for incollection)
-% \item
-% ABBREVIATE WORD `PAGES': a: pp (`Page' abbreviated);
-% \item
-% ABBREVIATE WORD `EDITORS': a: ed (`Editor' abbreviated);
-% \item
-% ABBREVIATION FOR `EDITION': a: ednx (`Edition' abbreviated as `ed');
-% \item
-% EDITION NUMBERS: xedn (Editions as in database saving much processing memory)
-% \item
-% STORED JOURNAL NAMES: a: jabr (Abbreviated journal names);
-% \item
-% FONT OF `ET AL': i: etal-it (Italic et al);
-% \item
-% ADDITIONAL REVTeX DATA FIELDS: r: revdata, eprint, url, url-blk (Include REVTeX data fields)
-% \item
-% NEW FONT SELECTION SCHEME: n: nfss (NFSS);
-% \item
-% ADDITIONAL REVTeX DATA FIELDS: y: revdata (additional data fields);
-% \item
-% REFERENCE COMPONENT TAGS: r: bibinfo (reference component tags);
+% \QandA{STYLE OF CITATIONS}{a}{ay}Author-year with some non-standard interface
+% \QandA{AUTHOR}{*}{nat}Natbib for use with natbib v5.3 or later
+% \QandA{LANGUAGE FIELD}{l}{lang}Use language field to switch hyphenation patterns for title
+% \QandA{ANNOTATIONS}{a}{annote}Annotations in annote field or in .tex file of citekey name
+% \QandA{PRESENTATIONS}{b}{pres,pres-bf}Presentation, speaker bold face
+% \QandA{ORDER ON VON PART }{x}{vonx}Sort without von part (de la Maire after Mahone)
+% \QandA{AUTHOR NAMES}{a}{nm-rev1}Only first name reversed, initials (AGU style: Smith, J. F., H. K. Jones)
+% \QandA{POSITION OF JUNIOR }{*}{jnrlst}Junior comes last as Smith, John, Jr.
+% \QandA{TYPEFACE FOR AUTHORS IN LIST OF REFERENCES}{u}{nmft,nmft-def}User defined author font (\cmd\bibnamefont)
+% \QandA{FONT FOR FIRST NAMES }{u}{fnm-def}First names in user defined font (\cmd\bibfnamefont)
+% \QandA{EDITOR NAMES IN INCOLLECTION ETC}{a}{nmfted}Editors incollection like authors font
+% \QandA{FONT FOR `AND' IN LIST}{r}{nmand-rm}`And' in normal font (JONES and JAMES)
+% \QandA{FONT OF CITATION LABELS IN TEXT }{u}{lab,lab-def}User defined citation font (\cmd\citenamefont)
+% \QandA{FONT FOR `AND' IN CITATIONS }{r}{and-rm}Cited `and' in normal font
+% \QandA{LABEL WHEN AUTHORS MISSING }{*}{keyxyr}Year blank when KEY replaces missing author (for natbib 7.0)
+% \QandA{DATE POSITION}{b}{dt-beg}Date after authors
+% \QandA{DATE FORMAT }{m}{yr-com}Date preceded by comma as `, 1993'
+% \QandA{INCLUDE MONTHS}{m}{aymth}Include month in date
+% \QandA{REVERSED DATE }{r}{dtrev}Date as year month
+% \QandA{TRUNCATE YEAR }{*}{note-yr}Year text full as 1990--1993 or `in press'
+% \QandA{TITLE OF ARTICLE}{d}{tit-qq}Title and punctuation in double quotes (``Title,'' ..)
+% \QandA{TITLE PRESENT IN ARTICLE, INCOLLECTION, AND INPROCEEDINGS}{x}{jtit-x}Title is ignored
+% \QandA{INPROCEEDINGS CHAPTER AND PAGES, LIKE INBOOK}{y}{inproceedings-chapter}produce pages after chapter just as in InBook
+% \QandA{ARTICLE BOOKTITLE PRESENT}{?}{article-booktitle}format booktitle
+% \QandA{ARTICLE SERIES PRESENT}{?}{article-series}article can has series
+% \QandA{JOURNAL NAME FONT}{r}{jttl-rm}Journal name normal font
+% \QandA{JOURNAL NAME WITH ADDRESS}{y}{journal-address}Include address field (in parentheses) along with journal name
+% \QandA{BOOK TITLE FIELDS}{y}{book-bt}Field `booktitle', or if absent field `title', is book title
+% \QandA{THESIS TITLE OPTIONAL}{?}{thesis-title-o}Title is optional: no warning issued if empty
+% \QandA{TECHNICAL REPORT TITLE}{b}{trtit-b}Tech. report title like books
+% \QandA{JOURNAL VOLUME}{b}{vol-bf}Volume bold as {\bf vol}(num)
+% \QandA{JOURNAL VOL AND NUMBER}{s}{vnum-sp}Journal vol (num) as 34 (2)
+% \QandA{VOLUME PUNCTUATION}{c}{volp-com}Volume with comma as vol(num), ppp
+% \QandA{PAGE NUMBERS}{f}{jpg-1}Only start page number
+% \QandA{POSITION OF PAGES}{e}{pp-last}Pages at end but before any notes
+% \QandA{BOOK EDITOR W/O AUTHOR}{}{book-editor-booktitle}Book permits empty author, produces title before editor in this case
+% \QandA{INBOOK PERMITS TITLE, BOOKTITLE, AUTHOR, EDITOR}{a}{inbook-editor-booktitle}Allow using both title/booktitle, both author/editor
+% \QandA{CONFERENCE ADDRESS FOR BOOK, INBOOK, INCOLLECTION, INPROCEEDINGS, PROCEEDINGS}{a}{bookaddress}Italic booktitle followed by bookaddress in roman
+% \QandA{NUMBER AND SERIES FOR BOOK, INBOOK, INCOLLECTION, INPROCEEDINGS, PROCEEDINGS}{*}{num-xser}Allows number without series and suppresses word "number"
+% \QandA{WORD NUMBER CAPITALIZED FOR NUMBER AND SERIES}{c}{number-cap}Capitalize word `number' as: "Number 123"
+% \QandA{WORD CHAPTER CAPITALIZED}{c}{chapter-cap}Capitalize word `chapter' as: `Chapter 42'
+% \QandA{COMBINING NUMBER AND SERIES}{x}{series-number}Series number as: `Springer Lecture Notes No. 125'
+% \QandA{POSITION OF NUMBER AND SERIES}{b}{numser-booktitle}After book title and conference address, and before editors
+% \QandA{VOLUME AND SERIES FOR BOOKS}{s}{ser-vol}Series, vol. 23
+% \QandA{VOLUME AND SERIES FORMATTING}{y}{ser-rm}format series roman , even when used with volume
+% \QandA{WORD VOLUME CAPITALIZED FOR VOLUME AND SERIES}{y}{volume-cap}Capitalize word `volume', as: `Volume 7 in Lecture Series'
+% \QandA{POSITION OF VOLUME AND SERIES FOR INCOLLECTION, INBOOK, AND INPROCEEDINGS}{e}{ser-ed}Series and volume after booktitle and before editors
+% \QandA{JOURNAL NAME PUNCTUATION}{x}{jnm-x}Space after journal name
+% \QandA{PAGES IN BOOK}{*}{pg-bk,book-chapter-pages}As chapter and page: chapter 42, page 345
+% \QandA{PUBLISHER IN PARENTHESES}{p}{pub-par}Publisher in parentheses
+% \QandA{EMPTY PUBLISHER PARENTHESES}{y}{ay-empty-pub-parens-x}eliminate parentheses altogether if nothing inside
+% \QandA{PUBLISHER POSITION}{e}{pre-edn}Edition before publisher
+% \QandA{SCHOOL}{p}{school-par}school/address in parens: `(school, address)'
+% \QandA{ISBN NUMBER}{*}{isbn}Include ISBN for books, booklets, etc.
+% \QandA{ISSN NUMBER}{*}{issn}Include ISSN for periodicals
+% \QandA{DOI NUMBER}{a}{doi-link,doi}Doi forms a link to the publication, anchored to the volume or title
+% \QandA{`EDITOR' AFTER NAMES}{a}{bkedcap}`Name Editor,' as above, editor upper case
+% \QandA{EDITOR IN COLLECTIONS}{b}{edby}In booktitle, edited by .. (where .. is names)
+% \QandA{PUNCTUATION BETWEEN SECTIONS }{c}{blk-com}Comma between blocks
+% \QandA{FINAL PUNCTUATION}{c}{fin-endbibitem}Command at end instead of period
+% \QandA{ABBREVIATE WORD `PAGES' }{a}{pp}`Page' abbreviated as p. or pp.
+% \QandA{ABBREVIATE WORD `EDITORS'}{a}{ed}`Editor' abbreviated as ed. or eds.
+% \QandA{OTHER ABBREVIATIONS}{a}{abr}Abbreviations of such words
+% \QandA{ABBREVIATION FOR `EDITION' }{a}{ednx}`Edition' abbreviated as `ed'
+% \QandA{EDITION NUMBERS}{n}{ord}Numerical editions as 1st, 2nd, 3rd, etc
+% \QandA{STORED JOURNAL NAMES}{a}{jabr}Abbreviated journal names
+% \QandA{COMMA BEFORE `AND'}{c}{and-com}Comma even with 2 authors as `Tom, and Harry'
+% \QandA{FONT OF `ET AL'}{i}{etal-it}Italic et al
+% \QandA{ADDITIONAL REVTeX DATA FIELDS}{r}{revdata,eprint,url,url-blk,translation}Include REVTeX data fields collaboration, eid, eprint, archive, url, translation
+% \QandA{SLACcitation FIELD}{?}{SLACcitation}Produce SLACcitation field
+% \QandA{NUMPAGES DATA FIELD}{*}{numpages-x}Do not include numpages field
+% \QandA{REFERENCE COMPONENT TAGS}{b}{bibinfo}Reference component tags like \cmd\bibinfo\ in the content of \cmd\bibitem
+% \QandA{ELEMENT TAGS}{b}{bibfield}Element tags like \cmd\bibfield\ in the content of \cmd\bibitem
+% \QandA{COMPATIBILITY WITH PLAIN TEX}{*}{nfss}Use LaTeX commands which may not work with Plain TeX
% \end{enumerate}
%
% A file \file{apsrmp.dbj} file equivalent to the following should result:
% \begin{verbatim}
-% \input docstrip
-% \preamble
-% ----------------------------------------
-% *** REVTeX-compatible apsrmp.bst ***
-% \endpreamble
-% \postamble
-% End of customized bst file
-% \endpostamble
-% \keepsilent
-% \askforoverwritefalse
-% \def\MBopts{\from{merlin.mbs}{%
-% ay%: Author-year with some non-standard interface
-% ,nat%: Natbib for use with natbib v5.3 or later
-% ,vonx%: Sort without von part (de la Maire after Mahone)
-% ,nm-rev1%: Only first name reversed, initials (AGU style: Smith, J. F., H. K. Jones)
-% ,jnrlst%: Junior comes last as Smith, John, Jr.
-% ,nmlm%: Limited authors (et al replaces missing names)
-% ,x10%: Maximum of 10 authors
-% ,m10%: Minimum of 10 authors
-% ,nmft,nmft-def%: User defined author font (\bibnamefont)
-% ,fnm-def%: First names in user defined font (\bibfnamefont)
-% ,nmfted%: Editors incollection like authors font
-% ,nmand-rm%: `And' in normal font (JONES and JAMES)
-% ,lab,lab-def%: User defined citation font (\citenamefont)
-% ,keyxyr%: Year blank when KEY replaces missing author (for natbib 7.0)
-% ,dt-beg%: Date after authors
-% ,xmth%: Date is year only
-% ,yr-com%: Date preceded by comma as `, 1993'
-% ,note-yr%: Year text full as 1990--1993 or `in press'
-% ,jtit-x%: No article title
-% ,jttl-rm%: Journal name normal font
-% ,trtit-b%: Tech. report title like books
-% ,vol-bf%: Volume bold as {\bf vol}(num)
-% ,volp-com%: Volume with comma as vol(num), ppp
-% ,jpg-1%: Only start page number
-% ,pp-last%: Pages at end but before any notes
-% ,num-xser%: Allows number without series and suppresses word "number"
-% ,jnm-x%: Space after journal name
-% ,pub-par%: Publisher in parentheses
-% ,pre-pub%: Publisher before chapter, pages
-% ,isbn%: Include ISBN for books, booklets, etc.
-% ,issn%: Include ISSN for periodicals
-% ,edpar%: `Name (editor),' in parentheses, after name, comma after
-% ,edby%: In booktitle, edited by .. (where .. is names)
-% ,blk-com%: Comma between blocks
-% ,injnl%: Add `in' before journal name in style for incollection
-% ,pp%: `Page' abbreviated as p. or pp.
-% ,ed%: `Editor' abbreviated as ed. or eds.
-% ,xedn%: Editions as in database saving much processing memory
-% ,jabr%: Abbreviated journal names
-% ,etal-it%: Italic et al
-% ,revdata,eprint,url,url-blk%: Include REVTeX data fields collaboration, eid, eprint, numpages, url
-% ,bibinfo%: Reference component tags like \bibinfo in the content of \bibitem
-% ,nfss%: NFSS use \textbf, \emph, not \bf, \em
-% }}
-% \generate{\file{\jobname.bst}{\MBopts}}
-% \endbatchfile
+%\input docstrip
+%\preamble
+%----------------------------------------
+%*** REVTeX-compatible RMP 2009-10-08 ***
+%\endpreamble
+%\postamble
+%End of customized bst file
+%\endpostamble
+%\keepsilent
+%\askforoverwritefalse
+%\def\MBopts{\from{merlin.mbs}{%
+% head,\MBopta}
+%\from{physjour.mbs}{\MBopta}
+%\from{geojour.mbs}{\MBopta}
+%\from{photjour.mbs}{\MBopta}
+%\from{merlin.mbs}{tail,\MBopta}}
+%\def\MBopta{%
+% ay,%: Author-year with some non-standard interface
+% nat,%: Natbib for use with natbib v5.3 or later
+% lang,%: Use language field to switch hyphenation patterns for title
+% annote,%: Annotations in annote field or in .tex file of citekey name
+% pres,pres-bf,%: Presentation, speaker bold face
+% vonx,%: Sort without von part (de la Maire after Mahone)
+% nm-rev1,%: Only first name reversed, initials (AGU style: Smith, J. F., H. K. Jones)
+% jnrlst,%: Junior comes last as Smith, John, Jr.
+% nmft,nmft-def,%: User defined author font (\bibnamefont)
+% fnm-def,%: First names in user defined font (\bibfnamefont)
+% nmfted,%: Editors incollection like authors font
+% nmand-rm,%: `And' in normal font (JONES and JAMES)
+% lab,lab-def,%: User defined citation font (\citenamefont)
+% and-rm,%: Cited `and' in normal font
+% keyxyr,%: Year blank when KEY replaces missing author (for natbib 7.0)
+% dt-beg,%: Date after authors
+% yr-com,%: Date preceded by comma as `, 1993'
+% aymth,%: Include month in date
+% dtrev,%: Date as year month
+% date-nil-x,%: If date is empty, then do not produce the surrounding punctuation (parens, brackets, colon, comma)
+% note-yr,%: Year text full as 1990--1993 or `in press'
+% tit-qq,%: Title and punctuation in double quotes (``Title,'' ..)
+% inproceedings-chapter,%: produce pages after chapter, just as in InBook
+% jtit-x,%: Title is ignored
+% inproceedings-chapter,%: produce pages after chapter just as in InBook
+% article-booktitle,%: format booktitle
+% article-series,%: article can has series
+% jttl-rm,%: Journal name normal font
+% journal-address,%: Include address field (in parentheses) along with journal name
+% book-bt,%: Field `booktitle', or if absent field `title', is book title
+% thesis-title-o,%: Title is optional: no warning issued if empty
+% trtit-b,%: Tech. report title like books
+% techreport-institution-par,%: format tech report institution like book publisher
+% vol-bf,%: Volume bold as {\bf vol}(num)
+% vnum-sp,%: Journal vol (num) as 34 (2)
+% volp-com,%: Volume with comma as vol(num), ppp
+% jpg-1,%: Only start page number
+% pp-last,%: Pages at end but before any notes
+% book-editor-booktitle,%: Book permits empty author, produces title before editor in this case
+% inbook-editor-booktitle,%: Allow using both title/booktitle, both author/editor
+% bookaddress,%: Italic booktitle followed by bookaddress in roman
+% num-xser,%: Allows number without series and suppresses word "number"
+% number-cap,%: Capitalize word `number' as: "Number 123"
+% chapter-cap,%: Capitalize word `chapter' as: `Chapter 42'
+% series-number,%: Series number as: `Springer Lecture Notes No. 125'
+% numser-booktitle,%: After book title and conference address, and before editors
+% ser-vol,%: Series, vol. 23
+% ser-rm,%: format series roman , even when used with volume
+% volume-cap,%: Capitalize word `volume', as: `Volume 7 in Lecture Series'
+% ser-ed,%: Series and volume after booktitle and before editors
+% jnm-x,%: Space after journal name
+% pg-bk,book-chapter-pages,%: As chapter and page: chapter 42, page 345
+% pub-par,%: Publisher in parentheses
+% ay-empty-pub-parens-x,%: eliminate parentheses altogether if nothing inside
+% pre-edn,%: Edition before publisher
+% school-par,%: school/address in parens: `(school, address)'
+% isbn,%: Include ISBN for books, booklets, etc.
+% issn,%: Include ISSN for periodicals
+% doi-link,doi,%: Doi forms a link to the publication, anchored to the volume or title
+% bkedcap,%: `Name Editor,' as above, editor upper case
+% edby,%: In booktitle, edited by .. (where .. is names)
+% blk-com,%: Comma between blocks
+% fin-endbibitem,%: Command at end instead of period
+% pp,%: `Page' abbreviated as p. or pp.
+% ed,%: `Editor' abbreviated as ed. or eds.
+% abr,%: Abbreviations of such words
+% ednx,%: `Edition' abbreviated as `ed'
+% ord,%: Numerical editions as 1st, 2nd, 3rd, etc
+% jabr,%: Abbreviated journal names
+% and-com,%: Comma even with 2 authors as `Tom, and Harry'
+% etal-it,%: Italic et al
+% revdata,eprint,url,url-blk,translation,%: Include REVTeX data fields collaboration, eid, eprint, archive, url, translation
+% SLACcitation,%: Produce SLACcitation field
+% numpages-x,%: Do not include numpages field
+% url,url-prefix-x,%: URL without prefix (default: `URL ')
+% bibinfo,%: Reference component tags like \bibinfo in the content of \bibitem
+% bibfield,%: Element tags like \bibfield in the content of \bibitem
+% nfss,%: Use LaTeX commands which may not work with Plain TeX
+%,{%
+% }}
+%\generate{\file{apsrmp4-1.bst}{\MBopts}}
+%\endbatchfile
% \end{verbatim}
%
+% Note that \file{apsrmplong.dbj} is the same as \file{apsrmp.dbj}, except:
+% \begin{itemize}
+% \item
+% Remove \texttt{jtit-x}, \texttt{jpg-1}. This means article titles and full page range.
+% \item
+% Add \texttt{article-title-o}: article title is optional.
+% \item
+% Remove \texttt{nm-rev1}, remove \texttt{nm-revv1}. This means full author names.
+% \end{itemize}
+%
+% \subsubsection{Comparing apsrev.bst and apsrmp.bst}
+% These two bibliographic styles differ as follows:
+% \file{apsrmp.dbj} has the following guard codes, which \file{apsrev.dbj} does not:
+% \begin{itemize}
+% \CandE{ay}%
+% Author-year with some non-standard interface
+% \CandE{nat}%
+% Natbib for use with natbib v5.3 or later
+% \CandE{nm-rev1}%
+% Only first name reversed, initials (AGU style: Smith, J. F., H. K. Jones)
+% \CandE{keyxyr}%
+% Year blank when KEY replaces missing author (for natbib 7.0)
+% \CandE{dt-beg}%
+% Date after authors
+% \CandE{yr-com}%
+% Date preceded by comma as `, 1993'
+% \CandE{aymth}%
+% Include month in date
+% \CandE{dtrev}%
+% Date as year month
+% \CandE{note-yr}%
+% Year text full as 1990--1993 or `in press'
+% \CandE{vnum-sp}%
+% Journal vol (num) as 34 (2)
+% \CandE{pp-last}%
+% Pages at end but before any notes
+% \CandE{pub-par}%
+% Publisher in parentheses
+% \CandE{school-par}%
+% school/address in parens: `(school, address)'
+% \CandE{bkedcap}%
+% `Name Editor,' as above, editor upper case
+% \CandE{and-com}%
+% Comma even with 2 authors as `Tom, and Harry'
+% \end{itemize}
+%
+%
+% \changes{4.1c}{2008/08/15}{Document class option longbibliography via \cs{substyle@post}}
% \begin{macrocode}
-\appdef\class@documenthook{%
- \@ifxundefined\@bibstyle{%
- \def\@bibstyle{apsrmp}%
- }{}%
-}%
+\def\@bibstyle{apsrmp\substyle@post}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\authoryear@sw}
+% \changes{4.1a}{2008/01/18}{(AO, 457) Endnotes to be sorted in with numerical citations.}%
+% Author-year citations: default value of \cmd\authoryear@sw\ is true.
+% \begin{macrocode}
+\@booleantrue\authoryear@sw
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cite}
+% Per Mark Doyle, \cmd\cite\ is mapped to \cmd\citep\ in RMP.
+%
+% \begin{macrocode}
+\let\cite\citep
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\bibpunct}
-% The following commands effectively etablish the style in which \cmd\cite\ commands are
+% \begin{macro}{\bibsection}
+% \begin{macro}{\bibpreamble}
+% \begin{macro}{\newblock}
+% \begin{macro}{\bibhang}
+% \begin{macro}{\bibsep}
+% The following commands effectively establish the style in which \cmd\cite\ commands are
% formatted.
% You can think of them as the second needed component for the bibliography.
%
@@ -8603,59 +7802,69 @@ See the REVTeX 4 README file for restrictions and more information.
% The fifth argument puts a comma after the author when the year is not in parens:
% (Lee et al., 1996).
%
+% Incidently, this \cmd\bibpunct\ command specifies the \classname{natbib} default values.
+%
+% We define the sectioning command to use when starting the bibliography.
+%
+% We change \classname{natbib}'s \cmd\NAT@def@citea\ procedure to effect more elaborate
+% punctuation for RMP: see item 473:
+% \cmd\cite\ order punctuation: ``If possible, \cmd\textcite should put the word 'and' between two citations and before the last citation in a list of 3 or more.''
+%
% \begin{macrocode}
- \bibpunct{(}{)}{;}{a}{,}{,}%
+\appdef\setup@hook{%
% \end{macrocode}
-% \end{macro}
%
-% \begin{macro}{\cite}
-% Per Mark Doyle, \cmd\cite\ is mapped to \cmd\citep\ in RMP.
+% We define the punctuation to use in the \cmd\cite\ command's production.
%
% \begin{macrocode}
- \let\cite\citep
+ \bibpunct{(}{)}{;}{a}{,}{,}%
% \end{macrocode}
-% \end{macro}
%
-% \begin{macro}{\bibsection}
-% \begin{macro}{\bibpreamble}
-% \begin{macro}{\newblock}
-% \begin{macro}{\bibhang}
-% \begin{macro}{\bibsep}
% We define the sectioning command to use when starting the bibliography.
%
% \begin{macrocode}
-\def\bibsection{%
- \let\@hangfroms@section\@hang@froms
- \section*{\refname}%
- \@nobreaktrue
+ \def\bibsection{%
+ \expandafter\section\expandafter*\expandafter{\refname}%
+ \@nobreaktrue
+ }%
+ \let\bibpreamble\@empty
+ \def\newblock{\ }%
+ \bibhang10\p@
+ \bibsep\z@
}%
-\let\bibpreamble\@empty
-\def\newblock{\ }%
-\bibhang10\p@
-\bibsep\z@
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\footinbib@sw}
-% Footnotes in bibliography are inconsistent with author-year
-% references, and are particularly nast under \classname{natbib}:
+% Footnotes in bibliography are consistent only with numbered citations,
+% and are particularly nasty under \classname{natbib}:
% the packcage will automatically change to numbered references if
% any \cmd\bibitem\ commands lack the optional argument.
% Therefore, we must uninvoke it now, even if invoked by the document.
+% The same is quietly done with
+% \classname{natbib}'s \classoption{mcite} and \classoption{compress} options.
+%
+% \changes{4.1f}{2009/07/15}{(AO, 523) Add class option nomerge, to turn off new natbib 8.3 syntax}
+% (AO 523) I changed the code that alters \cmd\NAT@merge\ so that it will not override
+% when \cmd\NAT@merge\ has been set to \cmd\z@.
% \begin{macrocode}
-\@ifxundefined\footinbib@sw{}{%
+\@booleanfalse\footinbib@sw
+\appdef\setup@hook{%
\footinbib@sw{%
\class@warn{%
Footnotes in bibliography are incompatible with RMP.^^J%
Undoing the footinbib option.
}%
+ \@booleanfalse\footinbib@sw
}{}%
+ \@ifnum{\NAT@merge>\@ne}{\let\NAT@merge\@ne}{}%
+ \def\NAT@cmprs{\z@}%
}%
-\@booleanfalse\footinbib@sw
% \end{macrocode}
% \end{macro}
%
@@ -8670,14 +7879,15 @@ See the REVTeX 4 README file for restrictions and more information.
%
% We set up for auto-sizing of certain TOC elements.
%
-% To do this, we override certain definitions for
-% the default TOC font (\cmd\toc@@font) and spacing (\@dotsep),
+% To do this, we override the definitions for
+% the default TOC font (\cmd\toc@@font),
% and define
% formatting for the needed elements (\cmd\l@\dots).
% Finally, we activate the autosizing by
% assigning \cmd\toc@pre\ and \cmd\toc@post.
%
% \begin{macro}{\toc@@font}
+% \changes{4.1a}{2008/01/19}{(AO, 461) Change the csname revtex uses from @dotsep to ltxu@dotsep. The former is understood in mu. (What we wanted was a dimension.)}%
% Set the formatting characteristics of the auto-indenting part
% of the TOC.
% \begin{macrocode}
@@ -8685,7 +7895,7 @@ See the REVTeX 4 README file for restrictions and more information.
\footnotesize\rmfamily
\def\\{\space\ignorespaces}%
}%
-\def\@dotsep{5.5pt}%
+\def\ltxu@dotsep{5.5pt}%
% \end{macrocode}
% \end{macro}
%
diff --git a/Master/texmf-dist/source/latex/revtex/revtex4.ins b/Master/texmf-dist/source/latex/revtex/revtex4.ins
deleted file mode 100644
index 96cf5b09722..00000000000
--- a/Master/texmf-dist/source/latex/revtex/revtex4.ins
+++ /dev/null
@@ -1,36 +0,0 @@
-% This file requires docstrip version 2.4 or higher available from
-% ftp://ctan.tug.org/tex-archive/macros/latex/unpacked/docstrip.tex
-\input docstrip
-\preamble
-
-This file is part of the APS files in the REVTeX 4 distribution.
-For the version number, search on the string %FileInfo
-
-Original version by David Carlisle
-Modified by Arthur Ogawa (mailto:ogawa@teleport.com)
-
-Copyright (c) 1999 The American Physical Society.
-http://publish.aps.org/revtex4/
-mailto:revtex4@aps.org
-
-See the REVTeX 4 README file for restrictions and more information.
-
-\endpreamble
-\keepsilent
-\askforoverwritefalse
-\generate{
- \file{revtex4.cls}{%
- \from{revtex4.dtx}{class-pre}%
- \from{ltxutil.dtx}{ltxutil-krn}%
- \from{ltxgrid.dtx}{ltxgrid-krn}%
- \from{textcase.dtx}{package}%
- \from{revtex4.dtx}{class-pst}%
- }%
- \file{aps.rtx}{\from{revtex4.dtx}{aps}}
- \file{rmp.rtx}{\from{revtex4.dtx}{rmp}}
- \file{10pt.rtx}{\from{revtex4.dtx}{10pt}}
- \file{11pt.rtx}{\from{revtex4.dtx}{11pt}}
- \file{12pt.rtx}{\from{revtex4.dtx}{12pt}}
- \file{revsymb.sty}{\from{revtex4.dtx}{revsymb}}
-}
-\endbatchfile
diff --git a/Master/texmf-dist/source/latex/revtex/textcase.dtx b/Master/texmf-dist/source/latex/revtex/textcase.dtx
deleted file mode 100644
index 60010e5ee67..00000000000
--- a/Master/texmf-dist/source/latex/revtex/textcase.dtx
+++ /dev/null
@@ -1,404 +0,0 @@
-% \iffalse
-%% Source File: textcase.dtx
-%% Copyright 1997 1998 David Carlisle
-%%
-%% This file may be distributed under the terms of the LPPL.
-%% See 00readme.txt for details.
-%
-%<*dtx>
- \ProvidesFile{textcase.dtx}
-%</dtx>
-%<package>\NeedsTeXFormat{LaTeX2e}
-%<package>\ProvidesPackage{textcase}
-%<driver> \ProvidesFile{textcase.drv}
-% \fi
-% \ProvidesFile{textcase.dtx}
- [1998/11/12 v0.06 Text only upper/lower case changing (DPC)]
-%
-% \iffalse
-%<*driver>
-\documentclass{ltxdoc}
-\usepackage{textcase}
-\begin{document}
-\DocInput{textcase.dtx}
-\end{document}
-%</driver>
-% \fi
-%
-% \GetFileInfo{textcase.dtx}
-% \CheckSum{110}
-%
-% \changes{v0.01}{1997/09/28}
-% {Posted to c.t.t}
-% \changes{v0.02}{1997/09/28}
-% {Support \cs{ensuremath}}
-% \changes{v0.03}{1997/12/12}
-% {Donald Arseneau: support \cs{ref} \cs{cite} \cs{label}}
-% \changes{v0.04}{1997/12/14}
-% {Convert to dtx form, add \cs{NoCaseChange}}
-% \changes{v0.04}{1997/12/14}
-% {Support (most uses of) optional argument of \cs{cite}}
-% \changes{v0.05}{1997/12/16}
-% {More comments from Donald,
-% perhaps I should just give him this package for Christmas}
-% \changes{v0.06}{1998/11/12}
-% {overload option}
-%
-%
-% \title{The \textsf{textcase} package\thanks{This file
-% has version number \fileversion, last
-% revised \filedate.}}
-% \author{David Carlisle\thanks{%^^A
-% Reorganisation to suppport skipping a wider class of
-% things than just math done by Donald Arseneau}}
-%
-% \date{\filedate}
-%
-% \maketitle
-%
-% \section{Introduction}\label{intro}
-% |\MakeTextUppercase| and |\MakeTextLowercase| are versions of the
-% standard |\MakeUppercase| and |\MakeLowercase| that do not change
-% the case of any math sections in their arguments.
-%\begin{verbatim}
-% \MakeTextUppercase{abc\ae\ \( a = b \) and $\alpha \neq a$
-% or even \ensuremath{x=y} and $\ensuremath{x=y}$}
-%\end{verbatim}
-% Should produce:
-% \begin{quotation}
-% ABC\AE\ \( a = b \) AND $\alpha \neq a$
-% OR EVEN \ensuremath{x=y} AND $\ensuremath{x=y}$
-% \end{quotation}
-%
-% Version 0.03 of this package incorporates some changes suggested by
-% Donald Arseneau so that as well as math mode, the arguments of
-% |\cite|, |\label| and |\ref| are also prevented from being uppercased.
-% So you can now go
-%\begin{verbatim}
-% \MakeTextUppercase{%
-% Text in section~\ref{intro}, about \cite[pp 2--4]{bbb}}
-%\end{verbatim}
-% which produces
-% \begin{quotation}
-% \MakeTextUppercase{%
-% Text in section~\ref{intro}, about \cite[pp 2--4]{bbb}}
-% \end{quotation}
-% If, instead, the standard |\MakeUppercase| were used here, the keys
-% `into' and `bbb' would be uppercased and generate errors about
-% undefined references to INTRO and BBB.
-%
-% Sometimes there may be a special section of text that should not be
-% uppercased. This can be marked with |\NoCaseChange|, as follows.
-%\begin{verbatim}
-% \MakeTextUppercase{%
-% Text \NoCaseChange{More Text} yet more text}
-%\end{verbatim}
-% which produces
-% \begin{quotation}
-% \MakeTextUppercase{%
-% Text \NoCaseChange{More Text} yet more text}
-% \end{quotation}
-%
-% |\NoCaseChange| has other uses. If for some reason you need a
-% tabular environment within an uppercased section, then you need
-% to ensure that the name `tabular' and the preamble (eg `ll')
-% does not get uppercased:
-%\begin{verbatim}
-% \MakeTextUppercase{%
-% Text \NoCaseChange{\begin{tabular}{ll}}%
-% table&stuff\\goes&here
-% \NoCaseChange{\end{tabular}}
-% More text}
-%\end{verbatim}
-% which produces
-% \begin{quotation}
-% \MakeTextUppercase{%
-% Text \NoCaseChange{\begin{tabular}{ll}}%^^A
-% table&stuff\\goes&here
-% \NoCaseChange{\end{tabular}}
-% More text}
-% \end{quotation}
-%
-% \section{Features and Foibles}
-%
-% \subsection{Nested text}
-% The commands defined here only skip math sections and |\ref| arguments
-% if they are not `hidden' inside a |{ }| brace group. All text inside
-% such a group will be made uppercase just as with the standard
-% |\MakeUppercase|.
-%\begin{verbatim}
-% \MakeTextUppercase{a b {c $d$} $e$}
-%\end{verbatim}
-% produces
-% \begin{quotation}
-% \MakeTextUppercase{a b {c $d$} $e$}
-% \end{quotation}
-% Of course, this restriction does not apply to the arguments of the
-% supported commands |\ensuremath|, |\label|, |\ref|, and |\cite|.
-%
-% If you cannot arrange for your
-% mathematics to be at the outer level of brace grouping, you should
-% use the following basic technique (which works even with the standard
-% |\MakeUppercase| command). Define a new command that expands to your
-% math expression, and then use that command, with |\protect|, in the
-% text to be uppercased. Note that if the text being uppercased is in a
-% section title or other moving argument you may need to make the
-% definition in the document preamble, rather than just before the
-% section command, so that the command is defined when the table of
-% contents file is read.
-%\begin{verbatim}
-% \MakeTextUppercase{%
-% Text \fbox{$a=b$ and $x=y$}}%
-%
-% \newcommand{\mathexprone}{$a=b$}
-% \newcommand{\mathexprtwo}{$x=y$}
-% \MakeTextUppercase{%
-% Text \fbox{\protect\mathexprone\ and \protect\mathexprtwo}}%
-%\end{verbatim}
-% which produces
-% \begin{quotation}
-% \MakeTextUppercase{%
-% Text \fbox{$a=b$ and $x=y$}}%
-%
-% \newcommand{\mathexprone}{$a=b$}
-% \newcommand{\mathexprtwo}{$x=y$}
-% \MakeTextUppercase{%
-% Text \fbox{\protect\mathexprone\ and \protect\mathexprtwo}}%
-% \end{quotation}
-%
-% \subsection{Citations}
-% As documented above, |\cite| and |\ref| commands are not uppercased by
-% |\MakeTextUppercase|. If you are using a non-numeric citation scheme
-% you may want the replacement text for |\cite| to be uppercased.
-%
-% It is difficult to arrange that |\MakeTextUppercase| uppercases such
-% text, not least because this would lead to interaction with the many
-% bibliography packages which redefine |\cite| one way or another. One
-% possibility to achieve this is to use Donald Arseneau's cite package
-% and to locally redefine |\citeform| to add |\MakeUppercase| around
-% the final text string produced by |\cite|.
-%\begin{verbatim}
-% \MakeTextUppercase{%
-% Text \cite{bbb} and \cite{ccc}}
-%
-% {\renewcommand\citeform{\MakeUppercase}\MakeTextUppercase{%
-% Text \cite{bbb} and \cite{ccc}}}
-%\end{verbatim}
-% which produces\footnote{This is faked, so this document does not
-% rely on \texttt{cite.sty} being installed}
-% \begin{quotation}
-% TEXT [1] AND [David Carlisle 1997]
-%
-% TEXT [1] AND [DAVID CARLISLE 1997]
-% \end{quotation}
-%
-% \subsection{overload Option}
-% By default the package only defines new commands, |\MakeTextUppercase|
-% and |\MakeTextlowercase| as described above. You may wish to redefine
-% the standard |\MakeUppercase| and |\MakeLowercase| commands to be
-% the same as these new commands. So that for example headings in the
-% book class have this new feature without any further redefinition.
-% You may use the package option |[overload]| in which case these
-% new definitions will be overloaded on to the existing command names.
-%
-% \begin{thebibliography}{9}
-%
-% \bibitem{bbb} Something numeric
-% \bibitem[David Carlisle 1997]{ccc} Something textual
-% \end{thebibliography}
-%
-% \StopEventually{}
-%
-% \section{Implementation}
-%
-% \begin{macrocode}
-%<*package>
-% \end{macrocode}
-%
-% \begin{macro}{\@uclcnotmath}
-% This is the main macro of this package. It is basically
-% a copy of |\MakeTextUppercase| and |\MakeTextLowercase|
-% from the \LaTeX\ kernel, modified slightly so that they
-% can share code (that modification could be done to the
-% standard versions as well) and then further changed to
-% skip certain features like math mode and |\label| arguments.
-%
-% The arguments are:\\
-% |#1|: Extra commands to apply for case changing.
-% Used to locally redefine |\i| and |\j| for uppercasing.\\
-% |#2|: Either |##1##2| or |##2##1| to control the order
-% in which |\let| is applied to the pairs of control
-% sequences in |\@uclclist|.\\
-% |#3|: |\uppercase| or |\lowercase|.\\
-% |#4|: The text to be upper (or lower) cased.
-% \begin{macrocode}
-\def\@uclcnotmath#1#2#3#4{\begingroup
-% \end{macrocode}
-% Run extra commands (currently just to redefine |\i| and |\j|).
-% \begin{macrocode}
- #1%
-% \end{macrocode}
-%
-% Locally set |\( \)| to be just |$ $|, so that the math skipping
-% code can be simplified, just to look for |$|.
-% \begin{macrocode}
- \def\({$}\let\)\(%
-% \end{macrocode}
-%
-% Set up the `non-math' things that also have to be skipped.
-% \begin{macrocode}
- \def\NoCaseChange##1{\noexpand\NoCaseChange{\noexpand##1}}%
- \@nonchangecase\label
- \@nonchangecase\ref
- \@nonchangecase\ensuremath
-% \end{macrocode}
-%
-% |\cite| a bit trickier, as we want to uppercase any optional argument.
-% This will fail if the optional argument contains a brace group, but
-% should catch most cases.
-%
-% |text \cite[page 1]{foo} more text| ends up as
-%\begin{verbatim}
-% \uppercase{text \toks@{\cite[page1]}%
-% \the\toks@{foo}%
-% \uppercase{ more text}
-%\end{verbatim}
-% \begin{macrocode}
- \def\cite##1##{\toks@{\noexpand\cite##1}\@citex}%
- \def\@citex##1{\NoCaseChange{\the\toks@{##1}}}%
-% \end{macrocode}
-% (|\@citex| is a scratch macro here, not a redefinition of the existing
-% |\@citex|.)
-%
-% The following is essentially taken from |\MakeUppercase|.
-% Recursively execute |\reserved@a| to |\let| the pairs in |\@uclclist|.
-% The strange construction with |\@gobble| at the end just gobbles the
-% final recursive call.
-%
-% Incidentally, packages should not use the |\reserved@|\ldots\ scratch
-% macros, which are `reserved' for use within the \LaTeX\ kernel, but
-% (a) this code is essentially a copy from the kernel, and
-% (b) I'm allowed to break the rules, so there.
-% \begin{macrocode}
- \def\reserved@a##1##2{\let#2\reserved@a}%
- \expandafter\reserved@a\@uclclist\reserved@b{\reserved@b\@gobble}%
-% \end{macrocode}
-%
-% Expand everything first so that the `skipping' code can see what to
-% skip and so that tokens are revealed to |\uppercase|.
-% This makes the argument `moving'.
-% The |$\valign$| is just a fake math expression used to terminate
-% the parsing done by |\@skipmath|.
-% \begin{macrocode}
- \protected@edef\reserved@a{\endgroup
- \noexpand\@skipmath#3#4$\valign$}%
-% \end{macrocode}
-%
-% \begin{macrocode}
- \reserved@a}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@nonchangecase}
-% \begin{macrocode}
-\def\@nonchangecase#1{\def#1##1{\NoCaseChange{#1{##1}}}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\NoCaseChange}
-% For hiding arbitrary text from |\uppercase|. This innocuous
-% definition is used for any occurrence of |\NoCaseChange|
-% in text that is not passed to |\MakeTextUppercase|. For example a
-% section heading may be uppercased, but the toc entry may not.
-% It is also used for nested definitions of |\cite| etc, where the
-% |\NoCaseChange| is inserted by expansion, but not removed as it is
-% hidden by the brace group.
-% \begin{macrocode}
-\let\NoCaseChange\@firstofone
-% \end{macrocode}
-% \end{macro}
-%
-%\begin{macro}{\@skipmath}
-% |#1|: operation |\uppercase| / |\lowercase|\\
-% |#2|: text up to first (next) |$|\\
-% |#3|: first math mode material (or |\valign| sentinel)
-% \begin{macrocode}
-\def\@skipmath#1#2$#3${%
- \@skip@nonchangecase#1#2\NoCaseChange\valign
- \ifx\valign#3%
- \else
- $#3$%
- \expandafter\@skipmath\expandafter#1%
- \fi}
-% \end{macrocode}
-% \end{macro}
-%
-%\begin{macro}{\@skip@nonchangecase}
-% |#1|: |\uppercase| or |\lowercase|\\
-% |#2|: Text up to the first command (such as |\cite|) made `safe'.
-% or the first use of |\NoCaseChange|.
-% \begin{macrocode}
-\def\@skip@nonchangecase#1#2\NoCaseChange#3{%
- #1{#2}%
- \ifx\valign#3%
- \else
- #3%
- \expandafter\@skip@nonchangecase\expandafter#1%
- \fi}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\MakeTextUppercase}
-% \changes{v0.06}{1998/11/12}
-% {Add edef to make behaviour more like \cs{MakeUppercase}}
-% Put it all together. Arrange for \i\ and \j\ to uppercase, and
-% to read the pairs in the ucase list `forwards'.
-% \begin{macrocode}
-\DeclareRobustCommand\MakeTextUppercase{%
- \@uclcnotmath{\def\i{I}\def\j{J}}{##1##2}\uppercase}
-% \end{macrocode}
-%
-% \begin{macrocode}
-\protected@edef\MakeTextUppercase#1{\MakeTextUppercase{#1}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\MakeTextLowercase}
-% \changes{v0.06}{1998/11/12}
-% {Add edef to make behaviour more like \cs{MakeLowercase}}
-% probably will never be used, but it is easy to implement.
-% Use |\lowercase| and read the pairs in the uppercase list `backwards'.
-% \begin{macrocode}
-\DeclareRobustCommand\MakeTextLowercase{%
- \@uclcnotmath{}{##2##1}\lowercase}
-% \end{macrocode}
-%
-% \begin{macrocode}
-\protected@edef\MakeTextLowercase#1{\MakeTextLowercase{#1}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\MakeUppercase}
-% \begin{macro}{\MakeLowercase}
-% \changes{v0.06}{1998/11/12}
-% {Option to overload added. latex/2906}
-% \begin{macrocode}
-\DeclareOption{overload}{%
- \expandafter\let\csname MakeUppercase \expandafter\endcsname
- \csname MakeTextUppercase \endcsname
- \expandafter\let\csname MakeLowercase \expandafter\endcsname
- \csname MakeTextLowercase \endcsname}
-% \end{macrocode}
-%
-% \begin{macrocode}
-\ProcessOptions
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macrocode}
-%</package>
-% \end{macrocode}
-%
-% \Finale
-%