summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/revtex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-03-18 23:53:14 +0000
committerKarl Berry <karl@freefriends.org>2010-03-18 23:53:14 +0000
commitaeb40e4eddc0e83dfd8f55c18ffd3b94540c0f47 (patch)
treeae4269d5a89406c04493af63b04c8fabc71fb754 /Master/texmf-dist/source/latex/revtex
parent481fc83998309f749f51e74a5e711829a5a3c80b (diff)
revtex 4.1p (17mar10)
git-svn-id: svn://tug.org/texlive/trunk@17498 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/revtex')
-rw-r--r--Master/texmf-dist/source/latex/revtex/aip.dtx75
-rw-r--r--Master/texmf-dist/source/latex/revtex/ltxdocext.dtx1
-rw-r--r--Master/texmf-dist/source/latex/revtex/ltxfront.dtx530
-rw-r--r--Master/texmf-dist/source/latex/revtex/ltxgrid.dtx1022
-rw-r--r--Master/texmf-dist/source/latex/revtex/ltxutil.dtx320
-rw-r--r--Master/texmf-dist/source/latex/revtex/revtex4-1.dtx979
6 files changed, 2092 insertions, 835 deletions
diff --git a/Master/texmf-dist/source/latex/revtex/aip.dtx b/Master/texmf-dist/source/latex/revtex/aip.dtx
index 1059874638d..04a47c748dc 100644
--- a/Master/texmf-dist/source/latex/revtex/aip.dtx
+++ b/Master/texmf-dist/source/latex/revtex/aip.dtx
@@ -124,9 +124,9 @@ License
%<*package>
%%% @LaTeX-file{
%%% filename = "aip.dtx",
-%%% version = "4.1h",
-%%% date = "2009/10/09",
-%%% time = "11:23:00 GMT+8",
+%%% version = "4.1p",
+%%% date = "2010/03/12",
+%%% time = "16:23:00 GMT-8",
%%% checksum = "1163",
%%% author = "Arthur Ogawa (mailto:arthur_ogawa at sbcglobal.net),
%%% commissioned by the American Institute of Physics.
@@ -231,7 +231,8 @@ License
% typeset documentation.
% \begin{macrocode}
%<*driver|package>
- [2009/10/09 4.1h AIP substyle for REVTeX]% \fileversion
+%<version>
+ [2010/03/12 4.1p AIP substyle for REVTeX]% \fileversion
%</driver|package>
% \end{macrocode}
%
@@ -527,6 +528,45 @@ generate the needed \file{.bst} files and install them in
\@booleanfalse\authornum@sw
% \end{macrocode}
%
+% \begin{macro}{\@bibdataout@init}
+% \begin{macro}{\@bibdataout@aip}
+% \changes{4.1o}{2010/02/12}{(AO, 580) Control .bst at run time.}%
+% Procedure \cmd\@bibdataout@aip\ has the job of writing the control record into the
+% job's \cmd\jobname\filename{.bib} file, where it will adjust the options to \filename{.bst} processing.
+% It is installed into the initialization procedure \cmd\@bibdataout@init, and its meaning
+% is set by the society (AIP) and journal.
+%
+% \begin{macrocode}
+\appdef\@bibdataout@init{\@bibdataout@aip}%
+\def\@bibdataout@aip{%
+ \immediate\write\@bibdataout{%
+% \end{macrocode}
+% An entry that controls processing of the \filename{.bst} file has entry type \texttt{@CONTROL}.
+% \begin{macrocode}
+ @CONTROL{%
+ aip41Control%
+% \end{macrocode}
+% Say whether we want long bibliography style (the default), or the abbreviated style.
+% \begin{macrocode}
+ \longbibliography@sw{\true@sw}{\aip@jtitx@sw{\false@sw}{\true@sw}}%
+ {%
+ ,pages="1",title="0"%
+ }{%
+ ,pages="0",title="-1"%
+ }%
+ }%
+ }%
+% \end{macrocode}
+% Place a \cmd\citation\ into the auxiliary file corresponding to this entry.
+% \begin{macrocode}
+ \if@filesw
+ \immediate\write\@auxout{\string\citation{aip41Control}}%
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% For AIP, the preprint style \classoption{preprint} is the default.
% \begin{macrocode}
\@booleantrue\preprintsty@sw
@@ -1467,22 +1507,19 @@ generate the needed \file{.bst} files and install them in
%\endbatchfile
% \end{verbatim}
%
-% Between the two files \file{aipnum.dbj} and \file{aipnum.dbj},
+% Between the two files \file{aipnum.dbj} and \file{aipauth.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)
+% 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}:
+% Likewise, \file{aipauth.dbj} has one line 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.)
+% nm-rev,%: Surname + comma + 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.
@@ -1493,21 +1530,11 @@ generate the needed \file{.bst} files and install them in
% 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}).
@@ -1969,7 +1996,7 @@ generate the needed \file{.bst} files and install them in
\aip@jtitx@sw{%
\def\@bibstyle{aipauth\substyle@post}%
}{%
- \def\@bibstyle{aipauth\substyle@post long}%
+ \def\@bibstyle{aipauth\substyle@post}%
}%
\authornum@sw{%
\bibpunct{}{}{,}{s}{}{\textsuperscript{,}}%
@@ -1990,7 +2017,7 @@ generate the needed \file{.bst} files and install them in
\aip@jtitx@sw{%
\def\@bibstyle{aipnum\substyle@post}%
}{%
- \def\@bibstyle{aipnum\substyle@post long}%
+ \def\@bibstyle{aipnum\substyle@post}%
}%
\bibpunct{}{}{,}{s}{}{\textsuperscript{,}}%
\let\onlinecite\rev@citealpnum
diff --git a/Master/texmf-dist/source/latex/revtex/ltxdocext.dtx b/Master/texmf-dist/source/latex/revtex/ltxdocext.dtx
index a6ca9e78b9a..ec2ccd8870f 100644
--- a/Master/texmf-dist/source/latex/revtex/ltxdocext.dtx
+++ b/Master/texmf-dist/source/latex/revtex/ltxdocext.dtx
@@ -217,6 +217,7 @@ License
% consistently in all generated files and in the
% typeset documentation.
% \begin{macrocode}
+%<version>
[2008/08/04 1.1b2 ltxdoc extensions package]% \fileversion
% \end{macrocode}
%
diff --git a/Master/texmf-dist/source/latex/revtex/ltxfront.dtx b/Master/texmf-dist/source/latex/revtex/ltxfront.dtx
index b9432481136..1a519133be4 100644
--- a/Master/texmf-dist/source/latex/revtex/ltxfront.dtx
+++ b/Master/texmf-dist/source/latex/revtex/ltxfront.dtx
@@ -108,15 +108,15 @@ License
%</ignore>
% \fi
%
-% \GetFileInfo{ltxfront.dtx}\CheckSum{2012}
+% \GetFileInfo{ltxfront.dtx}\CheckSum{2094}
%
% \iffalse ltxdoc klootch
%<*package>
%%% @LaTeX-file{
%%% filename = "ltxfront.dtx",
-%%% version = "4.1h",
-%%% date = "2009/10/09",
-%%% time = "11:23:00 GMT+8",
+%%% version = "4.1p",
+%%% date = "2010/02/25",
+%%% time = "18:00:00 UT-8",
%%% checksum = "2012",
%%% author = "Arthur Ogawa (mailto:arthur_ogawa at sbcglobal.net),
%%% commissioned by the American Physical Society.
@@ -145,7 +145,7 @@ License
% 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.
+% Search on "{filecontents*}{00readme.tex}" to locate it.
% \fi\input{00readme}%
%
% \subsection{Bill of Materials}
@@ -188,17 +188,27 @@ License
% An appropriate message is displayed if
% a different \TeX{} format is used.
% \begin{macrocode}
-%<*driver|package>
+%<*doc|package>
\NeedsTeXFormat{LaTeX2e}[1995/12/01]%
-%</driver|package>
+%</doc|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>
+%<kernel&!package&!doc>\typeout{%
+%<*package|doc>
+\ProvidesFile{%
+%</package|doc>
+%<*kernel|package|doc>
+ltxfront%
+%</kernel|package|doc>
+%<*doc>
+.dtx%
+%</doc>
+%<package>.sty%
+%<*package|doc>
+}%
+%</package|doc>
% \end{macrocode}
%
% The following line contains, for once and for all,
@@ -207,30 +217,32 @@ License
% consistently in all generated files and in the
% typeset documentation.
% \begin{macrocode}
-%<*driver|package>
- [2009/10/09 4.1h frontmatter package]% \fileversion
-%</driver|package>
+%<*doc|package|kernel>
+%<version>
+ [2010/02/25/18:00:00 4.1p frontmatter package (AO,DPC)]% \fileversion
+%</doc|package|kernel>
+%<kernel&!package&!doc>}%
% \end{macrocode}
%
%
-% \section{The driver module \texttt{driver}}
+% \section{The doc module \texttt{doc}}
%
% 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,
+% this file constitute the \file{doc} module itself,
% we can simply typeset the \file{.dtx} file directly,
% and there is thus rarely any need to
-% generate the ``driver'' {\sc docstrip} module.
+% generate the ``doc'' {\sc docstrip} module.
% Module delimiters are nonetheless required so that
% this code does not find its way into the other modules.
%
% The \enve{document} command concludes the typesetting run.
%
% \begin{macrocode}
-%<*driver>
+%<*doc>
% \end{macrocode}
%
% \subsection{The Preamble}
@@ -429,6 +441,19 @@ now put a \cmd\usepackage\texttt{\{ltxfront\}} in your document preamble!
\changes{4.1f}{2009/07/07}{(AO, 515) Use \cs{set@footnotefont}, which is defined in ltxutil}
\changes{4.1g}{2009/10/05}{(AO, 535) Robustify \cs{footnote} while \cs{class@warn} is expanding its argument}
\changes{4.1g}{2009/10/05}{(AO, 539) Robustify \cs{class@warn} against TOC processing}%
+\changes{4.1i}{2009/10/18}{(AO, 540) More runtime diagnostics via \cs{frontmatterverbose@sw}}
+\changes{4.1i}{2009/10/23}{(AO, 540) Rationalize code that appends to \cs{AF@grp}}
+\changes{4.1i}{2009/10/23}{(AO, 540) Optimize boolean logic }
+\changes{4.1i}{2009/10/23}{(AO, 544) Class options runinaddress and unsortedaddress stopped working}
+\changes{4.1m}{2009/11/20}{(AO, 563) \cs{collaboration} to work with both \texttt{groupedaddress} and \texttt{superscriptaddress}}
+\changes{4.1m}{2009/11/20}{(AO, 563) More complete runtime diagnostics via \cs{frontmatterverbose@sw}}
+\changes{4.1m}{2009/11/20}{(AO, 563) Let \cs{@collaboration@gobble} parse all three arguments of \cs{CO@opr}}
+\changes{4.1n}{2009/11/30}{(AO, 567) Handle \cs{noaffiliation} case}
+\changes{4.1n}{2009/11/30}{(AO, 567) Handle punctuation for \classoption{superscriptaddress} style authors' extra information, such as \cs{email}}
+\changes{4.1n}{2009/12/03}{(AO) remove http:// from \cs{href} call}
+\changes{4.1n}{2010/01/02}{(AO, 571) Interface \cs{set@footnotewidth} for determining the set width of footnotes}%
+\changes{4.1n}{2010/01/02}{(AO, 571) allow split after last line of footnote}%
+\changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
\end{filecontents*}
% \end{macrocode}
@@ -475,7 +500,7 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% \end{macrocode}
%
% \begin{macrocode}
-%</driver>
+%</doc>
% \end{macrocode}
%
% \section{Using this package}
@@ -615,7 +640,7 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% 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
+% in the order that they are encountered. This means that the order
% will usually follow the order of the authors. An alternative ordering
% can be forced by including a list of \cmd\affiliation\ commands before
% the first \cmd{\author} in the desired order. Then use the exact same
@@ -810,24 +835,12 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
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>
@@ -863,6 +876,10 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% line with the author.
%
% The \classoption{runinaddress} option is the only one that sets \cmd\runinaddress@sw\ to true.
+%
+% FIXME: this option pertains to cases where \cmd\groupauthors@sw\ is true, but is independant of \cmd\@affils@sw.
+% So, it should be possible to assert both \classoption{runinaddress} and \classoption{unsortedaddress} as well as
+% each separately.
% \begin{macrocode}
\@booleanfalse\runinaddress@sw
% \end{macrocode}
@@ -871,7 +888,7 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% \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
+% stopping groups of authors at the same address being consolidated
% into the same list:
% the address will be printed the same number of times it is entered.
%
@@ -882,9 +899,8 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% \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.
+% The flag \cmd\groupauthors@sw\ signifies that authors are to be grouped,
+% affecting the meaning of \cmd\@author@present.
%
% Clients will want to set \cmd\groupauthors@sw\ true if they want grouped addresses
% or either of the following variants:
@@ -897,9 +913,9 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
%
% \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.
+% the \classoption{superscriptaddress} option as simply turning \cmd\groupauthors@sw\ to \cmd\false@sw.
%
-% \classoption{groupedaddress}, the default, groups authors above a common address.
+% \classoption{groupedaddress}, the default in APS journals, groups authors above a common address.
% \begin{macrocode}
\DeclareOption{groupedaddress}{\clo@groupedaddress}%
\def\clo@groupedaddress{%
@@ -1162,7 +1178,11 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
\appdef\frontmatter@init{%
\@author@init
}%
+% \end{macrocode}
+% \changes{4.1i}{2009/10/18}{(AO, 540) More runtime diagnostics via \cs{frontmatterverbose@sw}}
+% \begin{macrocode}
\def\@author@def#1#2{%
+ \frontmatterverbose@sw{\typeout{\string\author\space\string\collaboration}}{}%
\move@AU\move@AF\move@AUAF
\let\@AF@join\@author@join
#1%
@@ -1232,26 +1252,40 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% \changes{4.1b}{2008/08/02}{Use \cs{@affil@def} for all access to \cs{@affil}}
% \changes{4.1b}{2008/08/02}{Provide for diagnostics via \cs{frontmatterverbose@sw}}
% \changes{4.1g}{2009/10/05}{(AO, 535) Robustify \cs{footnote} while \cs{class@warn} is expanding its argument}
+% \changes{4.1i}{2009/10/18}{(AO, 540) More runtime diagnostics via \cs{frontmatterverbose@sw}}
+% \changes{4.1m}{2009/11/20}{(AO, 563) \cs{collaboration} to work with both \texttt{groupedaddress} and \texttt{superscriptaddress}}
+% \changes{4.1n}{2009/11/30}{(AO, 567) Handle \cs{noaffiliation} case}
%
% We first finish off any author- or affiliation groups in progress.
-% Next, we detect the case where there is an author group in progress, but no affiliation group.
+% Next, we detect the case where there is an author group or a collaboration group in progress, but no affiliation group.
% If so, we emit a diagnositic message and act as if a \cmd\noaffiliation\ command had been given.
% In any case, we finish off any author/affiliation pair that may remain.
% Formatting of the title block may now proceed.
% \begin{macrocode}
\def\@author@finish{%
+ \frontmatterverbose@sw{\typeout{\string\@author@finish}}{}%
\move@AU\move@AF
- \@ifx{\AU@grp\@empty}{}{%
+ \@ifx{\AU@grp\@empty}{%
+ \@ifx{\CO@grp\@empty}%
+ }{%
+ \false@sw
+ }%
+ {}{%
\@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}%
+ \@ifx{\CO@grp\@empty}{%
+ \class@warn{Assuming \string\noaffiliation\space for authors}%
+ \frontmatterverbose@sw{\say\AU@grp}%
+ }{%
+ \class@warn{Assuming \string\noaffiliation\space for collaboration}%
+ \frontmatterverbose@sw{\say\CO@grp}{}%
+ }%
\endgroup
- \@affil@def{}\move@AF
+ \@affil@none\move@AF
}{}%
}%
\move@AUAF
@@ -1300,18 +1334,20 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% 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.
+% command: the system will detect the equivalence and (if using the \classoption{superscriptaddress} option)
+% only print the affiliation once, reusing the superscript marker.
%
% When the \cmd\affiliation\ command is encountered, the current author and author group (if any) are at an end.
% Also, the current affiliation is at an end.
%
+% \changes{4.1i}{2009/10/18}{(AO, 540) More runtime diagnostics via \cs{frontmatterverbose@sw}}
% FIXME: changes to catcode required elsewhere now?
% \begin{macrocode}
\def\cat@comma@active{\catcode`\,\active}%
{\cat@comma@active\gdef,{\active@comma}}%
\def\active@comma{,\penalty-300\relax}%
\newcommand\affiliation{%
+ \frontmatterverbose@sw{\typeout{\string\affiliation}}{}%
\move@AU\move@AF
\begingroup
\cat@comma@active
@@ -1327,15 +1363,24 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
%
% \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.
+% \changes{4.1i}{2009/10/18}{(AO, 540) More runtime diagnostics via \cs{frontmatterverbose@sw}}
+% \changes{4.1n}{2009/11/30}{(AO, 567) Handle \cs{noaffiliation} case}
+% User-level command \cmd\noaffiliation\ signifies that the current group of authors, or the current collaboration, has \emph{no} affiliation.
%
% This is implemented by acting as if the \cmd\affiliation\ command has been given, and using a
-% flag value of \{\}, which adds an element to the affiliation group of this author,
-% albeit a nil one (\cmd\AFF@opr\ \{\cmd\z@\} \{\}).
+% flag value of \{\cmd\relax\}, which adds an element to the affiliation group of this author,
+% albeit a nil one (\cmd\AFF@opr\ \{\cmd\relax\} \{\}).
+%
+% Note that this procedure does substantially the same as \cmd\@author@finish. (the latter, If it does not bail out altogether, differs chiefly in providing diagnostics).
% \begin{macrocode}
\newcommand\frontmatter@noaffiliation{%
+ \frontmatterverbose@sw{\typeout{\string\noaffiliation}}{}%
\move@AU\move@AF
- \@affil@def{}\move@AF
+% \end{macrocode}
+% In \cmd\@author@finish, there is code testing if an effective
+% \cmd\noaffiliation\ should be executed now. Here, we do so in any case.
+% \begin{macrocode}
+ \@affil@none\move@AF
\move@AUAF
}%
\def\blankaffiliation{{}}%
@@ -1343,12 +1388,15 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% \end{macro}
%
% \begin{macro}{\@affil@cleared}
+% \begin{macro}{\@affil@nil}
% \begin{macro}{\@affil@init}
+% \begin{macro}{\@affil@none}
% \begin{macro}{\@affilclear@sw}
% \begin{macro}{\@affil@def}
% \begin{macro}{\@affil@join@}
% \begin{macro}{\@affil@join}
% \changes{4.1b}{2008/08/02}{Use \cs{@affil@def} for all access to \cs{@affil}}
+% \changes{4.1n}{2009/11/30}{(AO, 567) Handle \cs{noaffiliation} case}
%
% Here are all the access procedures for the affiliation data structure.
% Note the similarity to those of the \cmd\@author\ data structure.
@@ -1360,9 +1408,13 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% and a procedure to add new ancillary data to the affiliation.
% \begin{macrocode}
\def\@affil@cleared{{{}}{}}%
+\def\@affil@nil{{\relax}{}}%
\appdef\frontmatter@init{%
\@affil@init
}%
+\def\@affil@none{%
+ \let\@affil\@affil@nil
+}%
\def\@affil@init{%
\let\@affil\@affil@cleared
}%
@@ -1381,9 +1433,13 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\move@AF}
% \changes{4.1b}{2008/08/02}{(AO, 486) \cs{collaboration} to work with \texttt{groupedaddress}}
+% \changes{4.1i}{2009/10/23}{(AO, 540) Rationalize code that appends to \cs{AF@grp}}
+% \changes{4.1n}{2009/11/30}{(AO, 567) Handle \cs{noaffiliation} case}
% Move the most recent affiliation to the affiliation group.
% If we recently did a \cmd\@affil@init, this is a no-op.
%
@@ -1391,11 +1447,11 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% 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,
+% If the current affiliation has been seen before, then by side effect
% \cmd\temp@sw\ will be set to true,
% \cmd\@tempc\ will be set to the matching affiliation number,
% and \cmd\@tempd\ will be set to the affiliation's ancillary data.
-% The Boolean \cmd\@affils@sw\ being false prevents this test from ever returning a positive result.
+% The Boolean \cmd\@affils@sw\ being false prevents this test from ever returning a ``true'' result.
%
% This procedure uses \cmd\@tempa\ and sets \cmd\@tempc, \cmd\@tempd, and \cmd\temp@sw.
% \begin{macrocode}
@@ -1410,7 +1466,7 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
}{}\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.
+% 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
@@ -1418,15 +1474,10 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
\@ifx{\@tempb\@tempd}{}{%
\class@warn{%
Ancillary information for \@tempa\space must not be different!
- Please put it on the first instance%
+ Please put all of 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:
@@ -1434,15 +1485,18 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% 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
+% Note that, with the expanded syntax of \cmd\collaboration, we need to label each address with
% its associated collaboration.
+%
+% Note also that the \cmd\noaffiliation\ case is handled by recognizing the flag value \cmd\@affil@nil.
% \begin{macrocode}
{%
- \@if@empty{\expandafter\@firstoftwo\@affil}{%
- \def\@tempc{\z@}%
- \@argswap@val{\z@}%
+ \@ifx{\@affil\@affil@nil}{%
+ \def\@tempc{0}%
+ \@argswap@val{0}%
}{%
\advance\c@affil\@ne
+ \expandafter\def\expandafter\@tempc\expandafter{\the\c@affil}%
\expandafter\@argswap@val\expandafter{\the\c@affil}%
}%
{%
@@ -1452,11 +1506,15 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
}%
}%
}%
- \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.
+% In either case, append this affiliation number to the \cmd\AF@grp, the affiliation group of the current author group.
+% (It will later be considered for the \cmd\@AFG@list.)
+% Then assign the flag value to \cmd\@affil\ that signifies it has been cleared.
+% \changes{4.1i}{2009/10/18}{(AO, 540) Rationalize code that appends to \cs{AF@grp}}
% \begin{macrocode}
+ \appdef@eval\AF@grp\@tempc
+ \frontmatterverbose@sw{\say\AF@grp}{}%
\@affil@init
}%
}%
@@ -1482,15 +1540,16 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
%
% \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.
+% The procedure \cmd\@affil@match\ is the definition for \cmd\AFF@opr,
+% the intercollated operator for \cmd\@AFF@list,
+% when adding a new affiliation: it seeks a match with any earlier affiliation.
% When the affiliation list is executed, this procedure tests each entry against
% the `new' affiliation (which has been stored in \cmd\@tempa) and its associated
% collaboration number (in \cmd\@tempb).
%
% If \cmd\groupauthors@sw\ is true, then we require the collaboration ID to match,
-% otherwise there is not such a requirement
-% (as is appropriate for the \classoption{superscriptaddress} class option).
+% otherwise there is no such requirement,
+% as is appropriate for the \classoption{superscriptaddress} class option.
%
% Uses \cmd\temp@sw, \cmd\@tempc, and \cmd\@tempd\ to communicate back:
% if it returns \cmd\temp@sw\ true, a match was found.
@@ -1544,46 +1603,70 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% 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,
+% To extend this scheme to the new \cmd\collaboration\ abilities, we must append an affiliation \cmd\AF@opr\ to \cmd\@AAC@list\
+% also in the case where there was no affiliation specified (e.g., \cmd\noaffiliation). This affiliation will be a nil affiliation:
+% \cmd\AF@opr\verb+{{0}}+.
+%
+%FIXME: only one of \cmd\CO@grp\ or \cmd\AU@grp\ is non-empty at this point,
+% but this code does not appear to recognize this fact!
+% \changes{4.1i}{2009/10/18}{(AO, 540) More runtime diagnostics via \cs{frontmatterverbose@sw}}
% \begin{macrocode}
\def\move@AUAF{%
- \@ifx{\AF@grp\@empty}%
- {%
- \@ifx{\@empty\CO@grp}{}{%
+ \frontmatterverbose@sw{\say\AU@grp\say\AF@grp\say\CO@grp}{}%
+ \@ifx{\AF@grp\@empty}{%
+ \@ifx{\@empty\CO@grp}{%
+% \end{macrocode}
+% Both \cmd\AF@grp\ and \cmd\CO@grp\ are empty: nothing to do. But what if \cmd\AU@grp\ is not empty?
+% \begin{macrocode}
+ }{%
+% \end{macrocode}
+% Append the nil \cmd\AF@opr\ to \cmd\@AAC@list.
+% \begin{macrocode}
+ \appdef \@AAC@list{\AF@opr{{0}}}%
+% \end{macrocode}
+% Append the collaboration group to the \cmd\@AAC@list; no intercollated operator need be added,
+% because we already have \cmd\CO@opr.
+% \begin{macrocode}
\appdef@e \@AAC@list{\CO@grp}%
\appdef@e \@AFG@list{\CO@grp}%
\let\CO@grp\@empty
}%
}{%
% \end{macrocode}
-% First, append current affiliation group (expansion of \cmd\AF@grp)
+% 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}{}%
+ \appdef \@AAC@list{\AF@opr}%
+ \appdef@eval\@AAC@list{\AF@grp}%
+ \appdef@e \@AAC@list{\AU@grp}%
+% \end{macrocode}
+% Determine if either \cmd\AU@grp\ or \cmd\CO@grp\ is non-empty.
+% \begin{macrocode}
+ \@ifx{\@empty\AU@grp}{%
+ \@ifx{\@empty\CO@grp}%
+ }{%
+ \false@sw
+ }%
+% \end{macrocode}
+% At this point, there is a Boolean in \TeX's scanner;
+% it will parse the following two brace-delimited sequences and select one of them.
+% \begin{macrocode}
+ {%
+% \end{macrocode}
+% This branch is executed if and only if both \cmd\AU@grp\ and \cmd\CO@grp\ are empty.
+% \begin{macrocode}
+ }{%
% \end{macrocode}
-% Next, append the current affiliation group to \cmd\@AFG@list,
+% There was either a \cmd\author\ or a \cmd\collaboration\ command.
+% Append the current affiliation group to \cmd\@AFG@list,
% (only if it is not already there)
% using \cmd\AFG@opr\ as the intercollated operator.
%
% Note that \cmd\@AFG@list\ is a list of \emph{unique} affiliation \emph{groups},
% and building it entails an \(N^2\) computation.
% \begin{macrocode}
- \@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
@@ -1592,15 +1675,18 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
\appdef \@AFG@list{\AFG@opr}%
\appdef@eval\@AFG@list{\AF@grp}%
}%
- }%
+% \end{macrocode}
+% If the collaboration \cmd\CO@grp\ is not empty, we append it to the \cmd\@AFG@list\ and to the \cmd\@AAC@list.
+% \changes{4.1m}{2009/11/20}{(AO, 563) \cs{collaboration} to work with both \texttt{groupedaddress} and \texttt{superscriptaddress}}
+% \begin{macrocode}
\@ifx{\@empty\CO@grp}{}{%
+ \appdef@e \@AAC@list{\CO@grp}%
\appdef@e \@AFG@list{\CO@grp}%
\let\CO@grp\@empty
}%
- }{%
}%
% \end{macrocode}
-% Finally, null out the macros holding the author group and affiliation group, respectively.
+% Finally, null out the macros holding the author group \cmd\AU@grp, affiliation group \cmd\AF@grp, and collaboration group \cmd\CO@grp.
% \begin{macrocode}
\let\CO@grp\@empty
\let\AU@grp\@empty
@@ -1620,7 +1706,8 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% 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.
+% Ultimately, its contents are appended to the author/affiliation list \cmd\@AAC@list\
+% and to the list of affiliation groups, \cmd\@AFG@list.
% It must be initialized to \cmd\@empty.
%
% Note on \cmd\AU@opr\ and \cmd\CO@opr: it is essential to treat these two operators to the greatest extent possible on an equal footing.
@@ -1637,9 +1724,9 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
%
% 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.
-%
+% The macro \cmd\@AFG@list\ accumulates
+% affiliation groups, with \cmd\AFG@opr\ as the intercollated operator,
+% and collaborations, with no intercollated operator.
% This token list is employed when and only when \classoption{groupedaddress} is in effect.
%
% The macro \cmd\@AFF@list\ accumulates the list of affiliations
@@ -1669,7 +1756,7 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% 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:
+% For each of these lists, here is the syntax of an element and the usage of the associated operator:
% \begin{verbatim}
%\@AFF@list \AFF@opr{<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
@@ -1679,7 +1766,7 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
%\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 \@secondofthree \@collaboration@count\AU@temp\@tempcnta \@collaboration@present\AU@temp \@collaboration@present\AU@temp \@collaboration@gobble
%
%\CO@opr\@author@cleared
% \end{verbatim}
@@ -1744,27 +1831,25 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% Just tacks the URL on to the current author or affiliation.
% Note: group opened in \cmd\homepage\ is closed in \cmd\@homepage.
% \changes{4.1a}{2008-07-01}{(AO, 496) remove default prependation to \cs{homepage}.}
+% \changes{4.1n}{2009/12/03}{(AO) remove http:// from \cs{href} call}
% \begin{macrocode}
\newcommand*\homepage[1][]{\begingroup\sanitize@url\@homepage{#1}}%
\def\@homepage#1#2{%
\endgroup
- \@AF@join{#1\url{#2}}%
+ \@AF@join{#1\href{#2}{#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}%
@@ -1859,21 +1944,19 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% \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{macro}{\@collaboration@gobble}
+% This command will be the synonym of \cmd\CO@grp\ during the expansion of \cmd\@AAC@list,
+% within \cmd\affils@present@group execution (in a \classoption{groupedaddress} situation).
+%
+% \changes{4.1m}{2009/11/20}{(AO, 563) Let \cs{@collaboration@gobble} parse all three arguments of \cs{CO@opr}}
% \begin{macrocode}
-\def\@collaboration@err#1#2{%
-%\class@warn{An illegal \string\collaboration\ command has been entered!}%
-}%
+\def\@collaboration@gobble#1#2#3{}%
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\doauthor}
% \changes{4.1b}{2008/08/04}{Provide facility \cs{affil@cutoff}: if there is only one affiliation on the title page, no superscript}%
+% \changes{4.1n}{2009/11/30}{(AO, 567) Handle punctuation for \classoption{superscriptaddress} style authors' extra information, such as \cs{email}}
% Main control over how authors are typeset.
%
% |#1| is loaded by \cmd\author
@@ -1889,28 +1972,24 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
%
% 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.
+% connecting this author with its affiliation. (If there is only one
+% affiliation on the title page, it makes sense to remove the superscript.)
%
+% Note that argument \#3 must effectively execute either
+% \cmd\aftergroup\cmd\true@sw\ or \cmd\aftergroup\cmd\false@sw\ (exactly once!).
+% In the case of \classoption{superscriptaddress}, this is done when
+% \cmd\@author@present@script\ invokes \cmd\doauthor\ with its third argument containing
+% \cmd\@affil@present@script.
+% Otherwise (e.g., \classoption{groupedaddress}), \cmd\doauthor\ is invoked by
+% \cmd\@author@present@group\ with its third argument containing \cmd\@affil@present@group.
% \begin{macrocode}
\def\doauthor#1#2#3{%
\ignorespaces#1\unskip\@listcomma
\begingroup
- \def\@tempifx{#3}%
- \@ifx{\@tempifx\@empty}{%
- \false@sw
- }{%
- \@ifnum{\c@affil<\affil@cutoff}{%
- \false@sw
- }{%
- \true@sw
- }%
- }%
- {%
- #3\aftergroup\true@sw
- }{%
- \aftergroup\false@sw
- }%
+ #3%
+% \end{macrocode}
+% At this point, we must have queued up a Boolean (either \cmd\true@sw\ or \cmd\false@sw).
+% \begin{macrocode}
\@if@empty{#2}{\endgroup{}{}}{\endgroup{\comma@space}{}\frontmatter@footnote{#2}}%
\space \@listand
}%
@@ -1972,33 +2051,49 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
\let\@tempb\@empty
\def\@TBN@opr{\y@match\@tempa}%
\@FMN@list
+% \end{macrocode}
+% By side effect, \cmd\@tempb\ holds the value of the footnote counter if
+% This note has been seen before. Otherwise \cmd\temp@sw\ is false.
+% \begin{macrocode}
\temp@sw{%
\expandafter\frontmatter@footnotemark
\expandafter{\@tempb}%
}{%
+% \end{macrocode}
+% Execute \cmd\frontmatter@foot@mark, feeding it the value of the current footnote counter.
+% This call requires two levels of pre-expansion to accomplish, the first to expand \cmd\csname, the second to evaluate \cmd\the.
+% \begin{macrocode}
\stepcounter\@mpfn
- \protected@xdef\@tempb{\the\csname c@\@mpfn\endcsname}%
- \expandafter\frontmatter@footnotemark
- \expandafter{\@tempb}%
- \expandafter\g@addto@macro
- \expandafter\@FMN@list
+ \expandafter\expandafter
+ \expandafter\frontmatter@foot@mark
+ \expandafter\expandafter
\expandafter{%
- \expandafter \@TBN@opr
- \expandafter {\@tempb}{#1}%
- }%
+ \expandafter \the\csname c@\@mpfn\endcsname
+ }{#1}%
}%
\endgroup
}%
+% \end{macrocode}
+% Procedure \cmd\frontmatter@foot@mark\ lays down the footnote device (mark) and takes care of the footnote text.
+% The latter merely involves queueing that text (along with its associated device) into \cmd\@FMN@list.
+% \begin{macrocode}
+\def\frontmatter@foot@mark#1#2{%
+ \frontmatter@footnotemark{#1}%
+ \g@addto@macro\@FMN@list{\@TBN@opr{#1}{#2}}%
+}%
\appdef\frontmatter@init{%
\global\let\@FMN@list\@empty
}%
+% \end{macrocode}
+% \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
+% \begin{macrocode}
\def\frontmatter@footnotemark#1{%
\leavevmode
\ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi
\begingroup
\hyper@linkstart {link}{frontmatter.#1}%
\csname c@\@mpfn\endcsname#1\relax
- \def\@thefnmark{\thempfn}%
+ \def\@thefnmark{\frontmatter@thefootnote}%
\@makefnmark
\hyper@linkend
\endgroup
@@ -2153,9 +2248,6 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% 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}
@@ -2173,6 +2265,11 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
\columnwidth\textwidth
\hsize\columnwidth
\@parboxrestore
+% \end{macrocode}
+% The following line switches footnotes to the \texttt{mpfoootnote} series.
+% This action should rather be taken by \cmd\frontmatter@abstractfont, which can be customized.
+% There is also an interaction with \cmd\mini@note.
+% \begin{macrocode}
\def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@
\let\@footnotetext\frontmatter@footnotetext
\minipagefootnote@init
@@ -2201,20 +2298,21 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% 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.
+% uses \cmd\frontmatter@makefntext\ instead of \cmd\@makefntext.
%
% \changes{4.1f}{2009/07/07}{(AO, 515) Use \cs{set@footnotefont}, which is defined in ltxutil}
+% \changes{4.1n}{2010/01/02}{(AO, 571) allow split after last line of footnote}%
+% \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
% \begin{macrocode}
\long\def\frontmatter@footnotetext#1{%
\minipagefootnote@pick
\set@footnotefont
\set@footnotewidth
\@parboxrestore
- \protected@edef\@currentlabel{\csname p@mpfootnote\endcsname\@thefnmark}%
+ \protected@edef\@currentlabel{\csname p@\@mpfn\endcsname\@thefnmark}%
\color@begingroup
\frontmatter@makefntext{%
- \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox
+ \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox\vadjust{\vskip\z@skip}%
}%
\color@endgroup
\minipagefootnote@drop
@@ -2453,11 +2551,17 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% \changes{4.0b}{1999/06/20}{Set \cs{footnote} to \LaTeX\ standard version for this scope.}
% First, we restore the footnote mechanism to its default state,
% then we customize the way the footnote mark is produced and how it is formatted.
+% \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
% \begin{macrocode}
\ltx@footnote@pop
- \let\thefootnote\frontmatter@thefootnote
+% \end{macrocode}
+% The following three lines establish an independent footnote counter for use in the title block.
+% \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
+% \begin{macrocode}
+ \def\@mpfn{mpfootnote}%
+ \def\thempfn{\thempfootnote}%
+ \c@mpfootnote\z@
\let\@makefnmark\frontmatter@makefnmark
- \global\c@footnote\z@
\frontmatter@setup
\thispagestyle{titlepage}\label{FirstPage}%
% \end{macrocode}
@@ -2558,11 +2662,13 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% (class option \classoption{superscriptaddress}).
%
% This procedure must ensure that any paragraph that it starts gets ended finally.
+% \changes{4.1i}{2009/10/18}{(AO, 540) More runtime diagnostics via \cs{frontmatterverbose@sw}}
+% \changes{4.1m}{2009/11/20}{(AO, 563) More complete runtime diagnostics via \cs{frontmatterverbose@sw}}
% \begin{macrocode}
\def\frontmatter@author@produce@script{%
\begingroup
\let\@author@present\@author@present@script
- \frontmatterverbose@sw{\say\@AAC@list}{}%
+ \frontmatterverbose@sw{\typeout{\string\frontmatter@author@produce@script:}\say\@AAC@list\say\@AFF@list\say\@AFG@list}{}%
% \end{macrocode}
% \changes{4.0l}{1998/09/01}{Changes to add collaboration processing, which now means doing comma/and processing on each sublist}
% When the author/affiliation list \cmd\@AAC@list\ is executed,
@@ -2594,7 +2700,7 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
\@AAC@list
\expandafter\CO@opr\@author@cleared
% \end{macrocode}
-% Next, present the authors and their affiliations.
+% Next, present the authors and their affiliations, with the collaborations interleaved.
%
% We assign values for the intercollated operators appearing within \cmd\@AAC@list.
% Next, assign \cmd\@listcomma\ based on the number of authors in the first collaboration.
@@ -2622,7 +2728,6 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
\begingroup
\frontmatter@above@affiliation@script
\let\AFF@opr \@affil@script
- \frontmatterverbose@sw{\say\@AFF@list}{}%
\@AFF@list
\frontmatter@footnote@produce
\par
@@ -2660,6 +2765,7 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
\begingroup
\frontmatter@collaboration@above
\@affilID@def{}%
+ \@tempcnta\z@
\@author@present{}{(\ignorespaces#3\unskip)}{#4}%
\par
\endgroup
@@ -2699,8 +2805,8 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% \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.
+% An alias of \cmd\AFG@opr, this procedure is applied to elements in \cmd\@AFG@list.
+% It builds \cmd\@AFU@list, a list of unique affiliations found within affiliation groups.
%
% \changes{4.1a}{2008/06/16}{removed code that had been commented out}
% \begin{verbatim}
@@ -2777,12 +2883,18 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% if a single affiliation appears on the title page,
% then no affiliation superscript at all is produced.
%
-% |#1|---Affiliation ID
+% |#1|---Affiliation ID: a number; zero signifies a \cmd\noaffiliation.
+%
% |#2|---Collaboration ID
+%
% |#3|---Affiliation address
+%
% |#4|---Auxiliary info
% \begin{macrocode}
\def\@affil@script#1#2#3#4{%
+% \end{macrocode}
+% If the affiliation is the \cmd\noaffiliation, then we do nothing.
+% \begin{macrocode}
\@ifnum{#1=\z@}{}{%
\par
\begingroup
@@ -2802,6 +2914,7 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
%
% \begin{macro}{\@author@present@script}
% \changes{4.0h}{1998/06/25}{Changes to support groups of affiliations}
+% \changes{4.1n}{2009/11/30}{(AO, 567) Handle \cs{noaffiliation} case}
% This version of \cmd\AU@opr\ applies to the \classoption{superscriptaddress} class option.
% Need to add commas between groups
% of address numbers, which are passed in the macro \cmd\@affilID@temp\ in the form
@@ -2810,10 +2923,7 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
\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
- }%
+ \doauthor{#2}{#3}{\@affil@present@script}%
\endgroup
\advance\@tempcnta\m@ne
}%
@@ -2833,19 +2943,47 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
}%
}%
}%
-\def\@affil@present@script#1{%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@affil@present@script}
+% \begin{macro}{\@affil@present@script@}
+% \changes{4.1n}{2009/11/30}{(AO, 567) Handle punctuation for \classoption{superscriptaddress} style authors' extra information, such as \cs{email}}
+% The \cmd\@affil@present@script\ procedure presents the reference to the affiliations in the case of superscript addresses.
+%
+% The affiliations are presented to \cmd\@affil@present@script@ as a list of brace-delimited tokens, each containing the affiliation ID (a number).
+% The list is terminated by the token \cmd\relax.
+% The macro recurses (via tail recursion) until the terminating token is encountered.
+% Note that an affiliation ID of zero signifies a \cmd\noaffiliation:
+% references to the \cmd\noaffiliation\ are passed over.
+%
+% Upon termination, the affiliations, if any, are produced via \cmd\textsuperscript\ and the appropriate boolean is queued via \cmd\aftergroup.
+% The boolean signifies that a non-trivial affiliation was produced, so that the proper punctuation can be produced.
+% The group in question is that opened and closed by the \cmd\doauthor\ procedure.
+%
+% This procedure uses \cmd\@tempa\ as a scratch register.
+% \begin{macrocode}
+\def\@affil@present@script{%
+ \let\@tempa\@empty
+ \expandafter\@affil@present@script@\@affilID@temp\relax
+}%
+\def\@affil@present@script@#1{%
\@ifx{\relax#1}{%
- \@ifx{\@tempa\@empty}{}{%
+ \@ifx{\@tempa\@empty}{%
+ \aftergroup\false@sw
+ }{%
\textsuperscript{\expandafter\@affilcomma\@tempa\relax\relax}%
+ \aftergroup\true@sw
}%
}{%
- \@ifx{\z@#1}{}{\appdef\@tempa{{#1}}}%
- \@affil@present@script
+ \@ifnum{#1=\z@}{}{\appdef\@tempa{{#1}}}%
+ \@affil@present@script@
}%
}%
\@provide\@author@parskip{\z@skip}%
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
%
% \subsubsection{Authors and affiliations in groupedaddress style}
@@ -2853,7 +2991,7 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% \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 .
+% 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.
@@ -2861,12 +2999,14 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% Collaborations are silently passed over.
%
% This procedure must ensure that any paragraph that it starts gets ended finally.
+% \changes{4.1i}{2009/10/18}{(AO, 540) More runtime diagnostics via \cs{frontmatterverbose@sw}}
+% \changes{4.1m}{2009/11/20}{(AO, 563) More complete runtime diagnostics via \cs{frontmatterverbose@sw}}
% \begin{macrocode}
\def\frontmatter@author@produce@group{%
\begingroup
\let\@author@present\@author@present@group
\frontmatter@authorformat
- \frontmatterverbose@sw{\say\@AFG@list}{}%
+ \frontmatterverbose@sw{\typeout{\string\frontmatter@author@produce@group:}\say\@AAC@list\say\@AFF@list\say\@AFG@list}{}%
\let\AU@temp\@empty
\set@listcomma@list\AU@temp
\def\CO@opr{\@collaboration@present\AU@temp}%
@@ -2918,7 +3058,6 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% pathological cases.
% \begin{macrocode}
\begingroup
- \frontmatterverbose@sw{\say\@AAC@list}{}%
\def\AF@temp{#1}%
\@tempcnta\z@
\let\AU@opr \@undefined
@@ -2968,9 +3107,11 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
\def@after@address
\runinaddress@sw{%
}{%
- \tightenlines@sw{%
- }{%
- \parskip\z@ %space between affilations in grouped mode
+ \tightenlines@sw{}{%
+% \end{macrocode}
+% The following line determines the space between affilations in grouped mode
+% \begin{macrocode}
+ \parskip\z@
}%
\appdef\after@address\par
}%
@@ -3022,7 +3163,7 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
}{%
\let\AU@opr \@author@gobble
}%
- \let\CO@opr \@collaboration@err
+ \let\CO@opr \@collaboration@gobble
}%
\def\@affilID@match#1#2{%
\def\@tempifx{#2}%
@@ -3031,7 +3172,7 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
}{%
\let\AU@opr \@author@gobble
}%
- \let\CO@opr \@collaboration@err
+ \let\CO@opr \@collaboration@gobble
}%
% \end{macrocode}
% \end{macro}
@@ -3089,17 +3230,25 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% \end{macro}
%
% \begin{macro}{\@author@present@group}
+% \begin{macro}{\@affil@present@group}
% \changes{4.0d}{1998/01/31}{\cs{comma@space}}
-% This version of \cmd\AU@opr\ applies to the \classoption{groupedaddress} class option.
+% This version of \cmd\AU@opr\ applies to the \classoption{groupedaddress} class option and its ilk.
% Traverse the list calling the \cmd\doauthor\ hook on each author.
+%
+% The third argument of \cmd\doauthor\ fulfills the requirement that it
+% queue up a boolean via \cmd\aftergroup.
% \begin{macrocode}
\def\@author@present@group#1#2#3{%
\gdef\comma@space{\gdef\comma@space{\textsuperscript{,\,}}}%
- \doauthor{#2}{#3}{}%
+ \doauthor{#2}{#3}{\@affil@present@group}%
\advance\@tempcnta\m@ne
}%
+\def\@affil@present@group{%
+ \aftergroup\false@sw
+}%
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
%
% \begin{macro}{\@pacs@produce}
@@ -3154,10 +3303,13 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
\@FMN@list
\global\let\@FMN@list\@empty
}%
+% \end{macrocode}
+% \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
+% \begin{macrocode}
\def\present@FM@footnote#1#2{%
\begingroup
\csname c@\@mpfn\endcsname#1\relax
- \def\@thefnmark{\thempfn}%
+ \def\@thefnmark{\frontmatter@thefootnote}%
\frontmatter@footnotetext{#2}%
\endgroup
}%
@@ -3194,12 +3346,13 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% \end{macro}
%
% \begin{macro}{\frontmatter@thefootnote}
+% \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
% In the title block, the footnote symbol (used for alternate affiliation and sundry)
% is a \cmd\@fnsymbol\ or a lowercase letter, as selected by a boolean.
% The society or journal may override this definition.
% \begin{macrocode}
\def\frontmatter@thefootnote{%
- \altaffilletter@sw{\@alph}{\@fnsymbol}\c@footnote
+ \altaffilletter@sw{\@alph}{\@fnsymbol}{\csname c@\@mpfn\endcsname}%
}%
\@ifx{\altaffilletter@sw\@undefined}{\@booleantrue\altaffilletter@sw}{}%
% \end{macrocode}
@@ -3223,11 +3376,13 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% Note that we are \classname{hyperref} friendly: we invoke \cmd\Hy@raisedlink\
% so that this footnote becomes a hypertext anchor. If \classname{hyperref} is
% not loaded, then \classname{ltxutil} has our act covered via some stubs.
+%
+% \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
% \begin{macrocode}
\long\def\frontmatter@makefntext#1{%
\parindent 1em
\noindent
- \Hy@raisedlink{\hyper@anchorstart{frontmatter.\the\c@footnote}\hyper@anchorend}%
+ \Hy@raisedlink{\hyper@anchorstart{frontmatter.\expandafter\the\csname c@\@mpfn\endcsname}\hyper@anchorend}%
\@makefnmark
#1%
}%
@@ -3392,7 +3547,7 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
% \end{macro}
%
%FIXME: there is a limitation to the default meaning of
-% \cmd\@startpage, the label ``FirstPage'' is only
+% \cmd\@startpage: the label ``FirstPage'' is only
% defined if the document has a \cmd\maketitle\ command.
%
% \begin{macrocode}
@@ -3543,25 +3698,27 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
%
% 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}
+% \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
+%
% \begin{macrocode}
\def\thanks@latex#1{%
\footnotemark
+ \expandafter\expandafter
\expandafter\gappdef
+ \expandafter\expandafter
\expandafter\@thanks
+ \expandafter\expandafter
\expandafter{%
+ \expandafter\expandafter
\expandafter\footnotetext
- \expandafter[\the\c@footnote]{#1}}%
+ \expandafter\expandafter
+ \expandafter[%
+ \expandafter\the\csname c@\@mpfn\endcsname]{#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}%
@@ -3573,7 +3730,16 @@ We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
\def\frontmatter@affiliationfont{\centering\itshape}%
\def\frontmatter@RRAP@format{\centering\large}%
\def\frontmatter@preabstractspace{1.5em}%
-\def\frontmatter@footnotetext{\footnotetext[\csname c@\@mpfn\endcsname]}%
+% \end{macrocode}
+% \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
+% \begin{macrocode}
+\long\def\frontmatter@footnotetext{%
+ \expandafter\expandafter
+ \expandafter\footnotetext
+ \expandafter\expandafter
+ \expandafter[%
+ \expandafter\the\csname c@\@mpfn\endcsname]%
+}%
\def\and@space{\\}%
\def\andname{and}%
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/revtex/ltxgrid.dtx b/Master/texmf-dist/source/latex/revtex/ltxgrid.dtx
index fdd4a9fbfc5..059f3b2bb4b 100644
--- a/Master/texmf-dist/source/latex/revtex/ltxgrid.dtx
+++ b/Master/texmf-dist/source/latex/revtex/ltxgrid.dtx
@@ -108,15 +108,15 @@ License
%</ignore>
% \fi
%
-% \GetFileInfo{ltxgrid.dtx}\CheckSum{5462}
+% \GetFileInfo{ltxgrid.dtx}\CheckSum{5898}
%
% \iffalse ltxdoc klootch
%<*package>
%%% @LaTeX-file{
%%% filename = "ltxgrid.dtx",
-%%% version = "4.1h",
-%%% date = "2009/10/09",
-%%% time = "11:23:00 GMT+8",
+%%% version = "4.1p",
+%%% date = "2010/02/25",
+%%% time = "18:00:00 UT-8",
%%% checksum = "5462",
%%% author = "Arthur Ogawa (mailto:arthur_ogawa at sbcglobal.net),
%%% commissioned by the American Physical Society.
@@ -206,10 +206,20 @@ License
% As desired, the following modules all
% take common version information:
% \begin{macrocode}
-%<package>\ProvidesFile{ltxgrid.sty}%
-%<*driver>
-\expandafter\ProvidesFile\expandafter{\jobname.dtx}%
-%</driver>
+%<kernel&!package&!doc>\typeout{%
+%<*package|doc>
+\ProvidesFile{%
+%</package|doc>
+%<*kernel|package|doc>
+ltxgrid%
+%</kernel|package|doc>
+%<*doc>
+.dtx%
+%</doc>
+%<package>.sty%
+%<*package|doc>
+}%
+%</package|doc>
% \end{macrocode}
%
% The following line contains, for once and for all,
@@ -217,10 +227,13 @@ License
% By various means, this information is reproduced
% consistently in all generated files and in the
% typeset documentation.
+% Give credit where due.
% \begin{macrocode}
-%<*driver|package>
- [2009/10/09 4.1h page grid package]% \fileversion
-%</driver|package>
+%<*doc|package|kernel>
+%<version>
+ [2010/02/25/18:00:00 4.1p page grid package (portions licensed from W. E. Baxter web at superscript.com)]% \fileversion
+%</doc|package|kernel>
+%<kernel&!package&!doc>}%
% \end{macrocode}
%
%
@@ -419,16 +432,26 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
\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} }
+\changes{4.1n}{2009/12/02}{Restore the \cs{lastbox} if it is not a footnote}
+\changes{4.1n}{2009/12/02}{More diagnostics of column balancing}
+\changes{4.1n}{2009/12/18}{(AO, 571) Deconstruct balanced footnotes when needed}
+\changes{4.1n}{2010/01/02}{(AO, 571) Interface \cs{set@footnotewidth} for determining the set width of footnotes}%
+\changes{4.1n}{2010/01/02}{(AO, 571) Footnotes, when columns are balanced or when they are composed with their column}%
+\changes{4.1n}{2010/01/02}{(AO, 571) Abandon \cs{recover@footins} in favor of \cs{recover@column}}%
+\changes{4.1n}{2010/01/02}{(AO, 571) Use procedures \cs{output@do@prep} and \cs{output@column@do} as dispatchers}
+\changes{4.1n}{2010/01/02}{(AO, 571) coding convention: use \cs{bgroup}, \cs{egroup} (instead of braces) when a box is being built}%
+\changes{4.1n}{2010/01/02}{(AO, 571) calling sequence of \cs{combine@foot@inserts} and \cs{grid@column} to expose box registers; that of \cs{append@column@} its column counters}%
+\changes{4.1n}{2010/01/02}{(AO, 571) footnote rule is leaders, so that it may be removed by \cs{vsplit}; mechanism of \cs{kern} signals to indicate footnote height}%
+\changes{4.1o}{2010/02/02}{(AO, 576) Allow \classname{lscape} to act on \cs{@outputbox} at the right time}%
+\changes{4.1p}{2010/02/24}{(AO, 583) Provide setup code also for footnotes in a one-column document}%
\end{filecontents*}
% \end{macrocode}
@@ -780,20 +803,19 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
% \end{macrocode}
%
% \subsection{Banner}%
-% Credit where due.
% \begin{macrocode}
%<*kernel>
-\typeout{%
- ltxgrid [2009/07/07 4.1f]: portions licensed from W. E. Baxter (web at superscript.com)%
-}%
% \end{macrocode}
%
% \subsection{Sundry}%
% Here are assorted macro definitions.
% \begin{macro}{\lineloop}
-% The document-level command \cmd\lineloop\ sets numbered lines until the
-% specified count is reached.
-% This command is mainly used to construct test documents.
+% \begin{macro}{\linefoot}
+% The (document-level) command \cmd\lineloop\ sets numbered lines until the
+% specified count is reached.
+% The command \cmd\linefoot\ sets a single, automatically numbered line, but with a footnote (with the specified label);
+% it automatically increments the line counter.
+% These commands are typically 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.
@@ -805,15 +827,23 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
\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
+ \@tempa\edef\@tempa{\special{line:\@tempa}}\@tempa
\vrule depth2.5\p@#2\leaders\hrule\hfil
}%
}%
\def\lineloop#1{%
\loopwhile{\loop@line\c@linecount{}\@ifnum{#1>\c@linecount}}%
}%
+\def\linefoot#1{%
+ \loop@line\c@linecount{%
+ \footnote{%
+ #1\special{foot:#1}\vrule depth2.5\p@\leaders\hrule\hfill
+ }%
+ }%
+}%
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
%
% \subsection{Mark Components}%
@@ -1212,10 +1242,12 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
}%
% \end{macrocode}
% Now test if the dispatcher is the special case of \cmd\execute@message@pen, in which case execute the \cmd\@message@saved.
+% \changes{4.1n}{2009/12/02}{More diagnostics of column balancing}
% \begin{macrocode}
\expandafter\@ifx\expandafter{\csname output@-\the\execute@message@pen\endcsname\output@procedure}{%
\let\output@procedure\@message@saved
}{}%
+ \ltxgrid@info@sw{\class@info{\string\dispatch@output}\say\output@procedure\saythe\holdinginserts}{}%
\outputdebug@sw{\output@debug}{}%
\output@procedure
}%
@@ -1228,48 +1260,68 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
}%
% \end{macrocode}
%
+% \changes{4.1n}{2009/12/02}{More diagnostics of column balancing}
+% The following procedure is executed at the beginning of each visit to the output routine,
+% contingent on the level of diagnostics specified.
+% However, it bails out when the visit is part of a tight sequence of visits to the output routine.
% \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
+ \def\@tempa{\save@message}%
+ \@ifx{\output@procedure\@tempa}{%
+ \true@sw
+ }{%
+ \@ifnum{\outputpenalty=-\save@column@insert@pen}{%
+ \@ifnum{\holdinginserts>\z@}%
+ }{%
+ \false@sw
+ }%
}%
+ {}{\output@debug@}%
+}%
+\def\output@debug@{%
+%<ignore> \saythe\inputlineno
+ \saythe\outputpenalty
+ \saythe\interlinepenalty
+ \saythe\brokenpenalty
+ \saythe\clubpenalty
+ \saythe\widowpenalty
+ \saythe\displaywidowpenalty
+ \saythe\predisplaypenalty
+ \saythe\interdisplaylinepenalty
+ \saythe\postdisplaypenalty
+ \saythe\badness
+ \say\thepagegrid
+ \saythe\pagegrid@col
+ \saythe\pagegrid@cur
+%<ignore> \say\bot@envir
+ \saythe\insertpenalties
+%<ignore> \say\@@topmark
+%<ignore> \say\saved@@topmark
+%<ignore> \say\@@firstmark
+%<ignore> \say\saved@@firstmark
+ \say\@@botmark
+%<ignore> \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
+% \end{macrocode}
+% Klootch! The following line provides only for two-column page grid; if debugging more columns, you must
+% add more statements here.
+% \begin{macrocode}
+ \showbox\csname col@1\endcsname
+ \showbox\footsofar
+ \showbox\footins
+ \showbox\footins@saved
+ \showlists
+ }%
}%
\@ifxundefined{\outputdebug@sw}{%
\@booleanfalse\outputdebug@sw
@@ -1425,11 +1477,12 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
% 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.
+% Floats can be committed at the top of a column, in the middle, 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.
+% a column of text was committed. Note that even after a column is committed, we could change our minds:
+% for instance if in multicolumn grid and we decide to balance the columns.
%
%
% \subsection{The natural output routine}
@@ -1612,6 +1665,7 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
% 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}}
+% \changes{4.1n}{2010/01/02}{(AO, 571) Use procedures \cs{output@do@prep} and \cs{output@column@do} as dispatchers}
% \begin{macrocode}
\def\output@moving{%
\set@top@firstmark
@@ -1623,13 +1677,9 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
}%
}{}%
\@cclv@nontrivial@sw{%
- \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@}%
+ \expandafter\output@do@prep\csname output@prep@\bot@envir \endcsname
\@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@}%
+ \expandafter\output@column@do\csname output@column@\thepagegrid\endcsname
\protect@penalty\do@startcolumn@pen
\clearpage@sw{%
\protect@penalty\do@endpage@pen
@@ -1644,6 +1694,20 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
\global\@mparbottom\z@
\global\@textfloatsheight\z@
}%
+% \end{macrocode}
+% Procedure \cmd\output@do@prep\ dispatches to the proper procedure to prepare page.
+% \begin{macrocode}
+\def\output@do@prep#1{%
+ \outputdebug@sw{\class@info{Prep: \string#1}}{}%
+ \@ifx{#1\relax}{\output@prep@document}{#1}%
+}%
+% \end{macrocode}
+% Procedure \cmd\output@column@do\ dispatches to the proper procedure to output column or page.
+% \begin{macrocode}
+\def\output@column@do#1{%
+ \outputdebug@sw{\class@info{Output column: \string#1}}{}%
+ \@ifx{#1\relax}{\output@column@one}{#1}%
+}%
\def\void@cclv{\begingroup\setbox\z@\box\@cclv\endgroup}%
\def\remove@lastbox{\setbox\z@\lastbox}%
% \end{macrocode}
@@ -1838,24 +1902,33 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
% 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}}
+% \changes{4.1n}{2009/12/02}{More diagnostics of column balancing}
% \begin{macrocode}
\def\output@init@document{%
- \set@adj@footins\vsize\global\vsize\vsize
+ \ltxgrid@info@sw{\class@info{\string\output@init@document}}{}%
+ \global\vsize\vsize
}%
% \end{macrocode}
% QUERY: the following procedure is very like \cmd\combine@foot@inserts. Should it be the same?
+% Answer: no, the two differ: this procedure makes a local assignment of \cmd\footins;
+% the latter makes a global assignment of \cmd\footsofar.
+%
+% Note: In a multicolumn document, footnotes must \emph{not} be balanced at this point.
+% \changes{4.1n}{2009/12/02}{More diagnostics of column balancing}
% \begin{macrocode}
\def\output@prep@document{%
- \@ifvoid\footsofar{}{%
- \setbox\footins\vbox\bgroup
+ \ltxgrid@foot@info@sw{\class@info{\string\output@prep@document}\trace@scroll{\showbox\footins\showbox\footsofar}}{}%
+ \@ifvoid\footsofar{%
+ }{%
+ \global\setbox\footins\vbox\bgroup
\unvbox\footsofar
\@ifvoid\footins{}{%
\marry@baselines
\unvbox\footins
}%
\egroup
+ \ltxgrid@foot@info@sw{\trace@box\footins}{}%
}%
}%
\def\output@post@document{}%
@@ -1889,34 +1962,38 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
% 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}
+% \changes{4.1n}{2009/12/02}{More diagnostics of column balancing}
+% \changes{4.1n}{2010/01/02}{(AO, 571) coding convention: use \cs{bgroup}, \cs{egroup} (instead of braces) when a box is being built}%
+% \changes{4.1n}{2010/01/02}{(AO, 571) change calling sequence of \cs{combine@foot@inserts} to expose box registers}%
% 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\@makecolumn#1{%
- \setbox\@outputbox\vbox{%
+ \ltxgrid@foot@info@sw{\class@info{\string\@makecolumn\string#1}}{}%
+ \setbox\@outputbox\vbox\bgroup
\boxmaxdepth\@maxdepth
\@tempdima\dp\@cclv
\unvbox\@cclv
\vskip-\@tempdima
- }%
+ \egroup
\xdef\@freelist{\@freelist\@midlist}\global\let\@midlist\@empty
\show@text@box@size
\@combinefloats
#1{%
\@combineinserts\@outputbox\footins
}{%
- \combine@foot@inserts
+ \combine@foot@inserts\footsofar\footins
}%
\set@adj@colht\dimen@
\count@\vbadness
\vbadness\@M
- \setbox\@outputbox\vbox to\dimen@{%
+ \setbox\@outputbox\vbox to\dimen@\bgroup
\@texttop
\dimen@\dp\@outputbox
\unvbox\@outputbox
\vskip-\dimen@
\@textbottom
- }%
+ \egroup
\vbadness\count@
\global\maxdepth\@maxdepth
}%
@@ -1925,27 +2002,98 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
% \end{macro}
%
% \begin{macro}{\@combineinserts}
-% We split out the procedure to add the \cmd\footins\ insertions to the packaged-up page.
-% Any other non-trivial insertions should also be dealt with at this time.
+% The procedure to add the specified insertions to the packaged-up page.
+% All other classes of insertions should also be dealt with at this time.
+%
+% Note that the second argument must be a \cmd\newinsert\ register: we access the \cmd\box\ along with the \cmd\skip.
+% \changes{4.1n}{2009/12/02}{More diagnostics of column balancing}
+% \changes{4.1n}{2010/01/02}{(AO, 571) coding convention: use \cs{bgroup}, \cs{egroup} (instead of braces) when a box is being built}%
+% \changes{4.1n}{2010/01/02}{(AO, 571) footnote rule is leaders, so that it may be removed by \cs{vsplit}; mechanism of \cs{kern} signals to indicate footnote height}%
% \begin{macrocode}
\def\@combineinserts#1#2{%
- \setbox#1\vbox{%
+ \ltxgrid@foot@info@sw{\class@info{\string\@combineinserts\string#1\string#2}\trace@box#2}{}%
+ \setbox#1\vbox\bgroup
\unvbox#1%
- \vbox{%
- \@ifvoid#2{}{%
- \show@box@size{Combining inserts}#2%
- \vskip\skip#2%
- \color@begingroup
- \normalcolor
- \footnoterule
- \nointerlineskip
- \box#2%
- \color@endgroup
- }{}%
+ \@ifvoid{#2}{}{%
+ \dimen@\ht#2\advance\dimen@\dp#2\advance\dimen@\skip#2%
+ \show@box@size{Combining inserts}#2%
+ \vskip\skip#2%
+% \end{macrocode}
+% The footnote rule is created as leaders, so that it may be removed automatically (via \cmd\vsplit)
+% in the event the footnote is recovered from this column.
+% Note that if \cmd\color@begingroup\ or \cmd\normalcolor\ produce marks, this technique will be confounded.
+% \begin{macrocode}
+ \setbox\z@\vbox{\footnoterule}\dimen@i\ht\z@
+ \color@begingroup
+ \normalcolor
+ \cleaders\box\z@\vskip\dimen@i\kern-\dimen@i
+ \csname combine@insert@\the\pagegrid@col\endcsname#2%
+ \color@endgroup
+% \end{macrocode}
+% The following tells \cmd\recover@column\ the size of the footnotes added here, including the skip glue above.
+% \begin{macrocode}
+ \kern-\dimen@\kern\dimen@
}%
- }%
+ \egroup
+ \ltxgrid@foot@info@sw{\trace@box#1}{}%
}%
% \end{macrocode}
+% We provide for a layer of abstraction for the laying down of footnotes at the bottom of this column or page.
+% \end{macro}
+%
+% \begin{macro}{\combine@insert@tw@}
+% \begin{macro}{\combine@insert@@ne}
+% \begin{macro}{\twocolumn@grid@setup}
+% \begin{macro}{\onecolumn@grid@setup}
+% \begin{macro}{\columngrid@setup}
+% \changes{4.1p}{2010/02/24}{(AO, 583) Provide setup code also for footnotes in a one-column document}%
+% The following two definitions cover the cases of a two-column document (with footnotes set on a single-column width),
+% and a one-column document.
+% However, the case of a two-column document with footnotes set on full text width is not covered.
+%
+% For a document in an overall two-column page grid, execute the commands
+% \cmd\twocolumn@grid@setup\ followed by \cmd\open@twocolumn;
+% if on the full page width (one-column grid), the command \cmd\onecolumn@grid@setup.
+%
+% The following is the way REVTeX does the initialization.
+% The procedure \cmd\select@column@grid\ is executed at \cmd\AtBeginDocument\ time;
+% the boolean \cmd\twocolumn@sw\ selects between the two alternatives.
+% \begin{verbatim}
+%\def\select@column@grid{%
+% \twocolumn@sw{%
+% \twocolumn@grid@setup
+% \open@twocolumn
+% }{%
+% \onecolumn@grid@setup
+% }%
+%}%
+%\appdef\class@documenthook{%
+% \select@column@grid
+%}%
+% \end{verbatim}
+%
+% \begin{macrocode}
+\def\combine@insert@tw@#1{%
+ \compose@footnotes@two#1\@ifvbox{#1}{\unvbox}{\box}#1%
+}%
+\def\combine@insert@@ne#1{%
+ \compose@footnotes@one#1\@ifvbox{#1}{\unvbox}{\box}#1%
+}%
+\def\twocolumn@grid@setup{%
+ \expandafter\let\csname combine@insert@1\endcsname\combine@insert@tw@
+ \expandafter\let\csname combine@insert@2\endcsname\combine@insert@@ne
+}%
+\def\onecolumn@grid@setup{%
+ \expandafter\let\csname combine@insert@1\endcsname\combine@insert@@ne
+ \expandafter\let\csname combine@insert@2\endcsname\combine@insert@@ne
+}%
+\let\columngrid@setup\onecolumn@grid@setup
+\columngrid@setup
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
% \end{macro}
%
% \begin{macro}{\@floatplacement}
@@ -2472,7 +2620,7 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
%
% An optimization might be to clear \cmd\clearpage@sw\ as part of the same interrupt,
% but that would actually not work properly, because it is necessary for \cmd\do@endpage\ to
-% possibly invoke furhter visits to the output routine before clearpage processing ceases.
+% possibly invoke further visits to the output routine before clearpage processing ceases.
% \begin{macrocode}
\def\newpage@prep{%
\if@noskipsec
@@ -2549,20 +2697,32 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
% \end{macro}
%
% \begin{macro}{\@clearfloatplacement}
-% The procedure \cmd\@clearfloatplacement\ sets all of the float placement parameters
-% to completely permissive values. The standard values appear as comments.
+% The procedure \cmd\@clearfloatplacement\ sets the float placement parameters
+% to completely permissive values (except for \cmd\@fpmin). The standard values are:
+%
+% \begin{tabular}{ll}
+%\cmd\@topnum &\cmd\c@topnumber\\
+%\cmd\@toproom &\cmd\topfraction\cmd\@colht\\
+%\cmd\@botnum &\cmd\c@bottomnumber\\
+%\cmd\@botroom &\cmd\bottomfraction\cmd\@colht\\
+%\cmd\@colnum &\cmd\c@totalnumber\\
+%\cmd\@fpmin &\cmd\floatpagefraction\cmd\@colht\\
+%\cmd\@dbltopnum &\cmd\c@dbltopnumber\\
+%\cmd\@dbltoproom &\cmd\dbltopfraction\cmd\@colht\\
+%\cmd\@textmin &\cmd\@colht\cmd\advance\cmd\@textmin -\cmd\@dbltoproom\\
+%\cmd\@fpmin &\cmd\dblfloatpagefraction\cmd\textheight
+% \end{tabular}
% \begin{macrocode}
\def\@clearfloatplacement{%
- \global\@topnum \maxdimen % \c@topnumber
- \global\@toproom \maxdimen % \topfraction\@colht
- \global\@botnum \maxdimen % \c@bottomnumber
- \global\@botroom \maxdimen % \bottomfraction\@colht
- \global\@colnum \maxdimen % \c@totalnumber
-%\global\@fpmin \z@ % \floatpagefraction\@colht
- \global\@dbltopnum \maxdimen % \c@dbltopnumber
- \global\@dbltoproom \maxdimen % \dbltopfraction\@colht
- \global\@textmin \z@ % \@colht\advance \@textmin -\@dbltoproom
- \global\@fpmin \z@ % \dblfloatpagefraction\textheight
+ \global\@topnum \maxdimen
+ \global\@toproom \maxdimen
+ \global\@botnum \maxdimen
+ \global\@botroom \maxdimen
+ \global\@colnum \maxdimen
+ \global\@dbltopnum \maxdimen
+ \global\@dbltoproom \maxdimen
+ \global\@textmin \z@
+ \global\@fpmin \z@
\let\@testfp\@gobble
\appdef\@setfloattypecounts{\@fpstype16\advance\@fpstype\m@ne}%
}%
@@ -2570,12 +2730,18 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
% \end{macro}
%
% \begin{macro}{\@doclearpage}
+% \begin{macro}{\@makefcolumn}
+% \begin{macro}{\@makecol}
% The \cmd\@doclearpage\ procedure is now obsoleted, as is \cmd\@makefcolumn, which it invoked.
+% We also completely avoid using \cmd\@makecol\ (in favor of \cmd\@makecolumn).
% \begin{macrocode}
\let\@doclearpage\@undefined
\let\@makefcolumn\@undefined
+\let\@makecol\@undefined
% \end{macrocode}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\clr@top@firstmark}
% \begin{macro}{\set@top@firstmark}
@@ -2679,6 +2845,10 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
}%
% \end{macrocode}
% \changes{4.1b}{2008/08/04}{Turn off the \cs{set@footnotewidth} mechanism; a float `knows' its proper typesetting context}
+% \changes{4.1n}{2010/01/02}{(AO, 571) Interface \cs{set@footnotewidth} for determining the set width of footnotes}%
+% \cmd\@yfloat\ is the go-to procdure for creating the proper environment for the content of a float.
+% Argument \verb+#1+ is the width of the float environment (we disable \cmd\set@footnotewidth), and
+% we establish a self-contained (minipage) environment for footnotes.
% \begin{macrocode}
\def\@yfloat#1#2[#3]{%
\@xfloat{#2}[#3]%
@@ -3200,8 +3370,8 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
% It is called by \cmd\execute@message@insert\ (i.e., at a grid change)
% and saves away the current page and preserves marks.
% In addition, it saves away any insertions that fall on the current page.
-% As with the regular output routine, it executes in two phases,
-% first with \cmd\holdinginserts\ set, then with it cleared.
+% As with the natural output routine, it executes in two phases,
+% first with \cmd\holdinginserts\ set, then cleared.
% \begin{macrocode}
\mathchardef\save@column@insert@pen=10017
\@namedef{output@-\the\save@column@insert@pen}{\toggle@insert{\savecolumn@holding}{\savecolumn@moving}}%
@@ -3226,28 +3396,45 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
}%
}%
% \end{macrocode}
-% The procedure \cmd\save@column@moving\ is the second phase of saving a column with its inserts.
+% \changes{4.1b}{2008/08/04}{New procedure for showing a box contents, \cs{trace@box}}
+% \changes{4.1n}{2009/12/02}{More diagnostics of column balancing}
+% The procedure \cmd\save@column@moving\ is the second phase of saving a column with its inserts.
% Now that \cmd\holdinginserts\ is cleared, we can look in the various \cmd\insert\ registers for
-% our inserts (at present there is only one, \cmd\footins).
-% if anything is there, we save it away and ask for another cycle (because it may have split).
+% our inserts (at present there is only one, \cmd\footins, along with \cmd\footins@saved).
+% if anything is there, we save it away and ask for another cycle (because it may have split).
%
% 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{%
+ \ltxgrid@info@sw{\class@info{\string\savecolumn@moving}}{}%
\@cclv@nontrivial@sw{%
\save@column
}{%
\void@cclv
}%
\@ifvoid\footins{}{%
- \outputdebug@sw{\trace@box\footins}{}%
- \global\setbox\footins@saved\vbox{\unvbox\footins@saved\marry@baselines\unvbox\footins}%
+ \ltxgrid@foot@info@sw{\class@info{\string\savecolumn@moving}\trace@scroll{\showbox\footins@saved\showbox\footins}}{}%
+% \end{macrocode}
+% Save all away in \cmd\footins@saved. Note that if \cmd\footins\ is void, then \cmd\footins@saved\ remains untouched.
+% \begin{macrocode}
+ \@ifvoid\footins@saved{%
+ \global\setbox\footins@saved\box\footins
+ }{%
+ \global\setbox\footins@saved\vbox\bgroup
+ \unvbox\footins@saved
+ \marry@baselines
+ \unvbox\footins
+ \egroup
+ }%
+ \ltxgrid@foot@info@sw{\trace@box\footins@saved}{}%
\protect@penalty\save@column@insert@pen
}%
}%
\newbox\footins@saved
+\newbox\footins@recovered
+\newbox\column@recovered
% \end{macrocode}
% \end{macro}
%
@@ -3349,9 +3536,14 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
% Note:
% If more insertions are added to \LaTeX\ (presumably via \cmd\newinsert), then they
% must be dealt with in a way entirely analogous to \cmd\footins.
+% \changes{4.1n}{2009/12/02}{More diagnostics of column balancing}
% \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
+ \ltxgrid@foot@info@sw{\class@info{\string\execute@message@insert}\trace@box\footins}{}%
+ #1%
+ }%
}%
% \end{macrocode}
% \end{macro}
@@ -3653,26 +3845,58 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
%
% \begin{macro}{\pagesofar}
% \begin{macro}{\footsofar}
+% The box register \cmd\pagesofar\ holds the portion of the (full-width) page that is already composed into columns.
+% This, plus the finished columns, each with its floats, plus \cmd\box255 constitute the full galley.
+%
+% The box register \cmd\footsofar\ holds all of the footnotes associated with \cmd\pagesofar.
% \begin{macrocode}
\newbox\pagesofar
\newbox\footsofar
-\def\combine@foot@inserts{%
- \@ifvoid\footins{%
- }{%
- \@ifvoid\footsofar{%
- \global\setbox\footsofar\box\footins
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\combine@foot@inserts}
+% \changes{4.1n}{2010/01/02}{(AO, 571) calling sequence of \cs{combine@foot@inserts} and \cs{grid@column} to expose box registers; that of \cs{append@column@} its column counters}%
+% \changes{4.1n}{2010/01/02}{(AO, 571) coding convention: use \cs{bgroup}, \cs{egroup} (instead of braces) when a box is being built}%
+% The procedure \cmd\combine@foot@inserts\ is for the purpose of merging
+% the recently contributed footnotes (usually \cmd\box\cmd\footins)
+% with those saved from earlier on the page (usually \cmd\box\cmd\footsofar).
+%
+% It is employed in a number of circumstances.
+%
+% \cmd\@makecolumn (when its argument is \cmd\false@sw):
+% we are not shipping out, so we need to salt away any footnotes there may be.
+%
+% \cmd\shut@column@one: we are leaving the one-column page grid, so recover the footnotes from that material
+% and combine them with those of \cmd\pagesofar.
+%
+% \expandafter\cmd\csname balance@2\endcsname: two columns of type have been balanced, so now balance the footnotes.
+% The \cmd\combine@foot@inserts\ procedure is first used to gather footnotes from the columns balanced with those of \cmd\pagesofar.
+%
+% Bug 571 note: if balancing a two-column page grid, and there had been footnotes in the \cmd\pagesofar,
+% those footnotes will have been balanced into a page-width box, \cmd\box\cmd\footsofar.
+% We need to now re-cast them into a single, column-width galley, and only then
+% combine them with those in \cmd\box\cmd\footins.
+%
+% \begin{macrocode}
+\def\combine@foot@inserts#1#2{%
+ \ltxgrid@info@sw{\class@info{\string\combine@foot@inserts\string#1\string#2}}{}%
+ \@ifvoid#1{%
+ \ltxgrid@foot@info@sw{\trace@box#2}{}\global\setbox#1\box#2%
}{%
- \global\setbox\footsofar\vbox\bgroup
- \unvbox\footsofar
- \marry@baselines
- \unvbox\footins
+ \global\setbox#1\vbox\bgroup
+ \ltxgrid@foot@info@sw{\trace@box#1}{}\unvbox#1%
+ \@ifvoid#2{}{%
+ \marry@baselines
+ \ltxgrid@foot@info@sw{\trace@box#2}{}\unvbox#2%
+ }%
\egroup
}%
- }%
+ \ltxgrid@foot@info@sw{\trace@scroll{\showbox#1\showbox#2}}{}%
}%
% \end{macrocode}
% \end{macro}
-% \end{macro}
%
%
% \subsubsection{One-column page grid}
@@ -3702,14 +3926,32 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
% 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}}
+% \changes{4.1n}{2009/12/02}{More diagnostics of column balancing}
% \begin{macrocode}
\def\open@column@one#1{%
+ \ltxgrid@info@sw{\class@info{\string\open@column@one\string#1}}{}%
+% \end{macrocode}
+% Throw the \cmd\pagesofar\ back onto the Main Vertical List.
+% At this point, we must also \cmd\insert\ the footnotes back into the MVL.
+% \changes{4.1n}{2010/01/02}{(AO, 571) coding convention: use \cs{bgroup}, \cs{egroup} (instead of braces) when a box is being built}%
+% \begin{macrocode}
\unvbox\pagesofar
+ \@ifvoid{\footsofar}{}{%
+ \insert\footins\bgroup\unvbox\footsofar\egroup
+ \penalty\z@
+ }%
+% \end{macrocode}
+% Record which page grid we are using. Then calculate the set width (\cmd\hsize) and the goal height (\cmd\vsize).
+%
+% Klootch: we set the \cmd\count\cmd\footins\ to a magic number. This is only correct in the case of a two-column document.
+% \begin{macrocode}
\gdef\thepagegrid{one}%
\global\pagegrid@col#1%
\global\pagegrid@cur\@ne
- \set@colht
+ \global\count\footins\@m
+ \global\divide\count\footins\tw@
\set@column@hsize\pagegrid@col
+ \set@colht
}%
% \end{macrocode}
%
@@ -3720,15 +3962,34 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
% \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}
+% \changes{4.1n}{2009/12/02}{More diagnostics of column balancing}
+% \changes{4.1n}{2010/01/02}{(AO, 571) calling sequence of \cs{combine@foot@inserts} and \cs{grid@column} to expose box registers; that of \cs{append@column@} its column counters}%
+% We recover the footnotes into \cmd\footsofar\ (globally) and the column into \cmd\pagesofar\ (also globally), voiding \cmd\@outputbox\ by side effect.
% \begin{macrocode}
\def\shut@column@one{%
+ \ltxgrid@info@sw{\class@info{\string\shut@column@one}}{}%
\@makecolumn\false@sw
- \global\setbox\pagesofar\vbox{\unvbox\@outputbox\recover@footins}%
- \combine@foot@inserts
+% \end{macrocode}
+% Split text portion of \cmd\@outputbox\ into \cmd\pagesofar,
+% and add its footnote portion to \cmd\footsofar.
+% Then void out \cmd\@outputbox.
+% \begin{macrocode}
+ \global\setbox\pagesofar\vbox\bgroup
+ \recover@column\@outputbox\footsofar\column@recovered\footins@recovered
+ \egroup
+ \begingroup\setbox\z@\box\@outputbox\endgroup
+% \end{macrocode}
+% FIXME: is \cmd\combine@foot@inserts\ needed?
+% Also: if this procedure is immediately followed by \cmd\open@column@ \texttt{grid}, then \cmd\set@colht\ will be unneeded.
+% \begin{macrocode}
+ \combine@foot@inserts\footsofar\footins
\set@colht
}%
% \end{macrocode}
%
+%FIXME: the first line of a footnote should have an up-strut, and the last line a down-strut, so that they can marry baselines.
+% The latter is the case; how about the former?
+%
% 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.
%
@@ -3826,6 +4087,9 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
% \begin{macro}{\end@column@mlt}
% \begin{macro}{\output@column@mlt}
% \begin{macro}{\@addmarginpar@mlt}
+% \begin{macro}{\set@footnotewidth@mlt}
+% \begin{macro}{\set@footnotewidth@two}
+% \begin{macro}{\compose@footnotes@two}
% Here are all the procedures necessary for the standard page grid named ``mlt'':
% the multi-column page grid. With an argument of "2", it is,
% of course, \LaTeX's familiar \cmd\twocolumn\ layout.
@@ -3852,11 +4116,35 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
% 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}}
+%
+% Bug 571 note: it is not enough to have the \cmd\pagesofar, we must also deal with the \cmd\footsofar.
+% At this juncture, we should treat the case where the document has an essentially two-column page grid,
+% with occasional excursions into the one-column grid.
+% If a footnote is set within the latter grid, its set width should be that of the two-column grid.
+%
+% When a page is shipped out, if we are currently in a one-column grid, we will compose the footnotes onto the page
+% in the form of balanced columns. This is only one way to handle footnotes: \classname{multicol}
+% appears to set footnotes on the full text width.
% \begin{macrocode}
\def\open@column@mlt#1{%
+ \ltxgrid@info@sw{\class@info{\string\open@column@mlt\string#1}}{}%
+% \end{macrocode}
+% At this point, we must \cmd\insert\ the footnotes back into the Main Vertical List.
+% \changes{4.1n}{2010/01/02}{(AO, 571) coding convention: use \cs{bgroup}, \cs{egroup} (instead of braces) when a box is being built}%
+% \begin{macrocode}
+ \@ifvoid{\footsofar}{}{%
+ \insert\footins\bgroup\unvbox\footsofar\egroup
+ }%
+% \end{macrocode}
+% Record which page grid we are using. Then calculate the set width (\cmd\hsize) and the goal height (\cmd\vsize).
+%
+% Klootch: we set the \cmd\count\cmd\footins\ to a magic number. This value is valid whether footnotes are being
+% set on the column width or the full text width.
+% \begin{macrocode}
\gdef\thepagegrid{mlt}%
\global\pagegrid@col#1%
\global\pagegrid@cur\@ne
+ \global\count\footins\@m
\set@column@hsize\pagegrid@col
\set@colht
}%
@@ -3877,8 +4165,11 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
% \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}}
+% \changes{4.1n}{2009/12/02}{More diagnostics of column balancing}
+% \changes{4.1n}{2010/01/02}{(AO, 571) calling sequence of \cs{combine@foot@inserts} and \cs{grid@column} to expose box registers; that of \cs{append@column@} its column counters}%
% \begin{macrocode}
\def\shut@column@mlt{%
+ \ltxgrid@info@sw{\class@info{\string\shut@column@mlt}}{}%
\@cclv@nontrivial@sw{%
\@makecolumn\false@sw
\@ifnum{\pagegrid@cur<\pagegrid@col}{%
@@ -3890,7 +4181,7 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
}%
\@ifnum{\pagegrid@cur>\@ne}{%
\csname balance@\the\pagegrid@col\endcsname
- \grid@column{}%
+ \grid@column\@outputbox{}%
\@combinepage\false@sw
\@combinedblfloats
\global\setbox\pagesofar\box\@outputbox
@@ -3969,6 +4260,7 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
%
% 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}}
+% \changes{4.1n}{2010/01/02}{(AO, 571) calling sequence of \cs{combine@foot@inserts} and \cs{grid@column} to expose box registers; that of \cs{append@column@} its column counters}%
% \begin{macrocode}
\def\output@column@mlt{%
\@ifnum{\pagegrid@cur<\pagegrid@col}{%
@@ -3976,7 +4268,7 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
\global\advance\pagegrid@cur\@ne
}{%
\set@adj@colht\dimen@
- \grid@column{}%
+ \grid@column\@outputbox{}%
\@output@combined@page
}%
}%
@@ -3999,6 +4291,60 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
\@ifnum{\pagegrid@cur=\@ne}%
}%
% \end{macrocode}
+%
+% \cmd\set@footnotewidth@one\ sets the width of type within footnotes to span the full text width;
+% \cmd\set@footnotewidth@two\ to span a single column of the two-column grid, and
+% more generally \cmd\set@footnotewidth@mlt\ for a multi-column page grid.
+% \begin{macrocode}
+\def\set@footnotewidth@one{%
+ \hsize\columnwidth
+ \linewidth\hsize
+}%
+\def\set@footnotewidth@two{\set@footnotewidth@mlt\tw@}%
+\def\set@footnotewidth@mlt#1{%
+ \hsize\textwidth
+ \advance\hsize\columnsep
+ \divide\hsize#1%
+ \advance\hsize-\columnsep
+ \linewidth\hsize
+}%
+% \end{macrocode}
+%
+% \cmd\compose@footnotes\ is the procedure for arranging the footnotes for
+% placement at the bottom of the page or column.
+% In the former case, the material will be shipped out; in the latter, we must allow
+% the column to possibly be balanced later on.
+%
+% \cmd\compose@footnotes@one\ is a no-op, because the footnotes require no rearrangement.
+% In a scheme where footnotes are set on the full text width, this would be the procedure called.
+%
+% \cmd\compose@footnotes@two\ implements the case where a two-column document has been interrupted
+% with full-page-width text (e.g., the widetext environment or the end of the document),
+% and a natural page break appears.
+%
+% In either case, we assume that argument \verb+#1+ is an \cmd\insert\ register and must be assigned globally,
+% so that when it is accessed with \cmd\box\ or \cmd\unvbox, it will be voided globally as well.
+%
+% To extend this scheme to a three-column page grid \cmd\compose@footnotes@thr@@\ would be created:
+% it would balance the saved up footnotes into three columns.
+%
+% \begin{macrocode}
+\def\compose@footnotes@one#1{%
+ \ltxgrid@foot@info@sw{\class@info{\string\compose@footnotes@one\string#1}\trace@box#1}{}%
+}%
+\let\compose@footnotes\compose@footnotes@one
+\def\compose@footnotes@two#1{%
+ \ltxgrid@foot@info@sw{\class@info{\string\compose@footnotes@two\string#1}\trace@box#1}{}%
+ \setbox\z@\box\@tempboxa
+ \let\recover@column\recover@column@null
+ \let\marry@baselines\@empty
+ \balance@two#1\@tempboxa
+ \global\setbox#1\hbox to\textwidth{\box#1\hfil\box\@tempboxa}%
+ \ltxgrid@foot@info@sw{\trace@box#1}{}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
@@ -4011,9 +4357,8 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
%
% \begin{macro}{\pagegrid@cur}
% \begin{macro}{\pagegrid@col}
-% \begin{macro}{\col@}
% \begin{macro}{\pagegrid@init}
-% We take over \LaTeX's \cmd\col@number\ and \cmd\@leftcolumn, which are obsolete.
+% We take over \LaTeX's \cmd\col@number, and \cmd\@leftcolumn, which are obsolete (\cmd\@holdpg\ could also be taken over).
% We create two counters to hold the columns in the page grid and the current column within.
% We also create the first of a set of box registers to hold the committted columns.
% \begin{macrocode}
@@ -4032,13 +4377,13 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
\pagegrid@col\tw@
% \end{macrocode}
%
-% The procedure \cmd\pagegrid@init\ exercises \cmd\newbox\ sufficiently to create the
-% boxes for holding the columns in the page grid.
+% The procedure \cmd\pagegrid@init\ is a loop, exercising \cmd\newbox\ sufficiently to create the
+% boxes for holding the columns in the page grid; these have names like \expandafter\cmd\csname col@1\endcsname, etc.
% \begin{macrocode}
\def\pagegrid@init{%
\advance\pagegrid@cur\@ne
\@ifnum{\pagegrid@cur<\pagegrid@col}{%
- \csname newbox\expandafter\endcsname\csname col@\the\pagegrid@cur\endcsname
+ \csname newbox\expandafter\endcsname\csname col@\the\pagegrid@cur\endcsname
\pagegrid@init
}{%
}%
@@ -4050,32 +4395,39 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
% \end{macro}
% \end{macro}
% \end{macro}
-% \end{macro}
%
% \begin{macro}{\grid@column}
+% \changes{4.1n}{2010/01/02}{(AO, 571) calling sequence of \cs{combine@foot@inserts} and \cs{grid@column} to expose box registers; that of \cs{append@column@} its column counters}%
% The procedure \cmd\grid@column\ knows how to lay up the columns in a multi-column page grid.
-% It uses utility procedures \cmd\append@column\ and \cmd\box@column.
+% It uses utility procedures \cmd\append@column@\ and \cmd\box@column.
+%
+% The first argument is the box register to create, usually \cmd\@outputbox, and provides both input and output.
+% The second argument a dimension, allowing us to strut down the depth of the box we create.
%
% \begin{macrocode}
-\def\grid@column#1{%
- \global\setbox\@outputbox\vbox{%
- \hb@xt@\textwidth{%
- \vrule\@height\z@\@width\z@\@if@empty{#1}{}{\@depth#1}%
+\def\grid@column#1#2{%
+ \ltxgrid@info@sw{\class@info{\string\grid@column\string#1}}{}%
+ \global\setbox#1\vbox\bgroup
+ \hb@xt@\textwidth\bgroup
+ \vrule\@height\z@\@width\z@\@if@empty{#2}{}{\@depth#2}%
\pagegrid@cur\@ne
- \append@column
- \box@column\@outputbox
- }%
- \vskip\z@skip % FIXME: page depth!
- }%
+ \@ifnum{\pagegrid@cur<\pagegrid@col}{\loopwhile{\append@column@\pagegrid@cur\pagegrid@col}}{}%
+ \box@column#1%
+ \egroup
+% \end{macrocode}
+% FIXME: page depth!
+% \begin{macrocode}
+ \vskip\z@skip
+ \egroup
}%
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\append@column}
+% \begin{macro}{\append@column@}
% \begin{macro}{\box@column}
% \begin{macro}{\marry@baselines}
-% The procedure \cmd\append@column\ appends columns for \cmd\grid@column,
-% \cmd\box@column\ builds the columns for \cmd\append@column,
+% 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{4.0a}{2001/06/18}{Introduce \cs{marry@height} }
%
@@ -4112,38 +4464,61 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
% In any case, we are not attempting to solve the more general problem of how to marry baselines
% where the leading can change arbitrarily within the galley or where glue could have been trimmed
% at a page top.
+%
+% \changes{4.1n}{2010/01/02}{(AO, 571) calling sequence of \cs{combine@foot@inserts} and \cs{grid@column} to expose box registers; that of \cs{append@column@} its column counters}%
+% Procedure \cmd\append@column@\ composes a column onto the horizontal list along with its \cmd\columnseprule.
+% Its arguments are: \verb+#1+---\cmd\pagegrid@cur, and \verb+#2+---\cmd\pagegrid@col
% \begin{macrocode}
-\def\append@column{%
- \@ifnum{\pagegrid@cur<\pagegrid@col}{%
- \expandafter\box@column\csname col@\the\pagegrid@cur\endcsname
- \hfil
- \vrule \@width\columnseprule
- \hfil
- \advance\pagegrid@cur\@ne
- \append@column
- }{%
- }%
+\def\append@column@#1#2{%
+ \expandafter\box@column\csname col@\the#1\endcsname
+ \hfil\vrule\@width\columnseprule\hfil
+ \advance#1\@ne
+% \end{macrocode}
+% This procedure is the argument of \cmd\loopwhile, so it must leave a Boolean (e.g., \cmd\true@sw) in \TeX's scanner.
+% \begin{macrocode}
+ \@ifnum{#1<#2}%
}%
+% \end{macrocode}
+% \changes{4.1n}{2010/01/02}{(AO, 571) calling sequence of \cs{combine@foot@inserts} and \cs{grid@column} to expose box registers; that of \cs{append@column@} its column counters}%
+% \changes{4.1n}{2009/12/02}{More diagnostics of column balancing}
+% \changes{4.1n}{2010/01/02}{(AO, 571) coding convention: use \cs{bgroup}, \cs{egroup} (instead of braces) when a box is being built}%
+% Procdure \cmd\box@column, used by \cmd\append@column@, puts down a box containing the specified column.
+% Its height is adjusted down to \cmd\@colht, if needed; likewise, the width is set to \cmd\columnwidth.
+% The rag at the bottom is controlled by \cmd\raggedcolumn@skip.
+% \begin{macrocode}
\def\box@column#1{%
+ \ltxgrid@info@sw{\class@info{\string\box@column\string#1}}{}%
\raise\topskip
- \hb@xt@\columnwidth{%
+ \hb@xt@\columnwidth\bgroup
\dimen@\ht#1\@ifdim{\dimen@>\@colht}{\dimen@\@colht}{}%
-% \advance\dimen@-\topskip
\count@\vbadness\vbadness\@M
\dimen@ii\vfuzz\vfuzz\maxdimen
- \outputdebug@sw{\saythe\@colht\saythe\dimen@}{}%
- \vtop to\dimen@
-% \@ifdim{\ht#1>\textheight}{to\textheight}{}%
- {\hrule\@height\z@
+ \ltxgrid@info@sw{\saythe\@colht\saythe\dimen@}{}%
+ \vtop to\dimen@\bgroup
+ \hrule\@height\z@
\unvbox#1%
\raggedcolumn@skip
- }%
+ \egroup
\vfuzz\dimen@ii
\vbadness\count@
\hss
- }%
+ \egroup
}%
+% \end{macrocode}
+% The purpose of procedure \cmd\marry@baselines\ is to ensure that the baseline spacing is correct;
+% it does this by making adjustments to the previous line, compensating for its depth, and by adding in
+% skip glue in an amount that assumes the added material has \cmd\topskip\ glue above.
+% \begin{macrocode}
\def\marry@baselines{%
+ \begingroup
+ \setbox\z@\lastbox
+ \@ifvoid{\z@}{%
+ \endgroup
+ }{%
+ \aftergroup\kern
+ \aftergroup-%
+ \expandafter\box\expandafter\z@\expandafter\endgroup\the\dp\z@\relax
+ }%
\vskip\marry@skip\relax
}%
\gdef\marry@skip{\z@skip}%
@@ -4178,10 +4553,12 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
%
% \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.}
+% \changes{4.1n}{2009/12/02}{More diagnostics of column balancing}
%
% QUERY: In the following, if \cmd\box\cmd\footins\ is not void, its contents are lost. Can this ever happen?
% \begin{macrocode}
\def\@combinepage#1{%
+ \ltxgrid@foot@info@sw{\class@info{\string\@combinepage\string#1}}{}%
\@ifvoid\pagesofar{}{%
\setbox\@outputbox\vbox{%
\unvbox\pagesofar
@@ -4191,8 +4568,15 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
}%
#1{%
\@ifvoid\footsofar{}{%
+% \end{macrocode}
+% At this point, \cmd\footins\ is empty; all of the footnotes have been combined into \cmd\footsofar.
+% \begin{macrocode}
\show@box@size{Combining page footnotes}\footsofar
\setbox\footins\box\footsofar
+% \end{macrocode}
+% Depending on the page grid, we compose the footnotes for placement on the page.
+% \begin{macrocode}
+ \compose@footnotes
\@combineinserts\@outputbox\footins
}%
}{%
@@ -4312,7 +4696,11 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
%
% 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\@makecolumn; footnotes need help.
+% Column-width committed floats are incorporated by \cmd\@makecolumn.
+%
+% As to footnotes, our scheme is to keep the \cmd\footins\ insert register up to date, and to use the insert mechanism
+% to ensure room for footnotes.
+% When a change is made to the page grid, the footnotes will need to be propagated back into the MVL.
%
% 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.
@@ -4329,6 +4717,7 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
% On the other hand, why not simply forget all this caching and (re-)calculate \cmd\vsize\ as late as possible?
% Particularly, \cmd\@colht\ is an artifact of the old way of doing things, where once it was set, it would never change.
%
+% \changes{4.1n}{2009/12/02}{More diagnostics of column balancing}
% \begin{macrocode}
\def\set@colht{%
\set@adj@textheight\@colht
@@ -4336,42 +4725,44 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
\set@colroom
}%
\def\set@adj@textheight#1{%
+ \ltxgrid@info@sw{\class@info{\string\set@adj@textheight\string#1}\saythe\textheight}{}%
#1\textheight
\def\@elt{\adj@page#1}%
\@booleantrue\firsttime@sw\@dbltoplist
\let\@elt\relax
\global#1#1\relax
- \outputdebug@sw{\saythe#1}{}%
+ \ltxgrid@info@sw{\saythe#1}{}%
}%
\def\set@colroom{%
+ \ltxgrid@info@sw{\class@info{\string\set@colroom}}{}%
\set@adj@colht\@colroom
\@if@empty\enlarge@colroom{}{%
\global\advance\@colroom\enlarge@colroom\relax
- \outputdebug@sw{\saythe\@colroom}{}%
+ \ltxgrid@info@sw{\saythe\@colroom}{}%
}%
\@ifdim{\@colroom>\topskip}{}{%
\ltxgrid@info{Not enough room: \string\@colroom=\the\@colroom; increasing to \the\topskip}%
\@colroom\topskip
}%
\global\@colroom\@colroom
+%<ignore> \ltxgrid@info@sw{\class@info{\string\set@colroom\string\vsize=\string\colroom}\saythe\vsize}{}%
\set@vsize
}%
%
\def\set@vsize{%
\global\vsize\@colroom
- \outputdebug@sw{\saythe\vsize}{}%
+ \ltxgrid@info@sw{\class@info{\string\set@vsize\string\vsize=\string\colroom}\saythe\vsize}{}%
}%
% \end{macrocode}
-% \changes{4.1b}{2008/08/04}{Procedure \cs{set@adj@footins} to adjust for footnotes and other inserts}
+% \changes{4.1n}{2009/12/02}{More diagnostics of column balancing}
% \begin{macrocode}
\def\set@adj@colht#1{%
#1\@colht
- \outputdebug@sw{\saythe#1}{}%
+ \ltxgrid@info@sw{\class@info{\string\set@adj@colht\string#1-\string\pagesofar}\saythe#1}{}%
\@ifvoid\pagesofar{}{%
\advance#1-\ht\pagesofar\advance#1-\dp\pagesofar
- \outputdebug@sw{\saythe#1}{}%
+ \ltxgrid@info@sw{\class@info{\string\pagesofar}\saythe#1}{}%
}%
- \set@adj@footins#1%
\def\@elt{\adj@column#1}%
\@booleantrue\firsttime@sw\@toplist
\@booleantrue\firsttime@sw\@botlist
@@ -4380,33 +4771,18 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
\def\adj@column#1#2{%
\advance#1-\ht#2%
\advance#1-\firsttime@sw{\textfloatsep\@booleanfalse\firsttime@sw}{\floatsep}%
- \outputdebug@sw{\saythe#1}{}%
+ \ltxgrid@info@sw{\class@info{\string\adj@column\string#1-\string#2}\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}{}%
+ \ltxgrid@info@sw{\class@info{\string\adj@page\string#1-\string#2}\saythe#1}{}%
}%
\def\set@adj@box#1#2{%
\@ifvoid#2{}{%
\advance#1-\ht#2\advance#1-\dp#2%
\@booleantrue\temp@sw
- \outputdebug@sw{\saythe#1}{}%
+ \ltxgrid@foot@info@sw{\class@info{\string\set@adj@box\string#2}\saythe#1}{}%
}%
}%
% \end{macrocode}
@@ -4450,6 +4826,9 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
% 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.
+%
+% Here is a conundrum: if we switch between single-, two-, and three-column page grids:
+% On what measure should the footnotes be set?
% \begin{macrocode}
\begingroup
\catcode`\1=\cat@letter
@@ -4458,23 +4837,20 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
% \cmd\toks@\ contains the repacement part for an effective \cmd\def\cs{balance@2}.
% \begin{macrocode}
\toks@{%
+% \end{macrocode}
+% \cmd\balance@two, by side effect, strips footnotes into \cmd\box\cmd\footins.
+% \begin{macrocode}
\setbox\footins\box\footsofar
\balance@two\col@1\@outputbox
% \end{macrocode}
-% \begin{verbatim}
-% \global\setbox\col@1\box\col@1
-% \end{verbatim}
+% We ensure that the box assignments are global.
% \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
- }%
+ \global\setbox\col@1\box\col@1
+ \global\setbox\@outputbox\box\@outputbox
+% \end{macrocode}
+% The following line puts all footnotes into the footnote galley, \cmd\footsofar.
+% \begin{macrocode}
+ \combine@foot@inserts\footsofar\footins
}%
\aftergroup\def\aftergroup\balance@2\expandafter
\endgroup\expandafter{\the\toks@}%
@@ -4483,12 +4859,12 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
%
% \begin{macro}{\balance@two}
% The procedure \cmd\balance@two\ takes two columns and balances them; in the process it removes
-% any footnotes that may be present to a place of safety, for later placement at the foot of the
-% shipped-out page.
+% any footnotes that may be present to a place of safety \cmd\footsofar,
+% for later placement at the foot of the shipped-out page.
% The box register \cmd\box\cmd\@ne\ is the aggregate of all columns.
% The box register \cmd\box\cmd \z@\ is the last column.
% The box register \cmd\box\cmd\tw@\ is the first column.
-% The \cmd\dimen\ register \cmd\dimen@\ is the trial value to balance to,
+% The \cmd\dimen\ register \cmd\dimen@\ is the trial value to \cmd\vsplit\ to,
% initially half the height of \cmd\box\cmd\@ne.
% The \cmd\dimen\ register \cmd\dimen@i\ is the increment for the next trial;
% its initial value is equal to the initial value of \cmd\dimen@.
@@ -4547,103 +4923,192 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
% 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}}
+% \changes{4.1n}{2009/12/02}{More diagnostics of column balancing}
+% \changes{4.1n}{2010/01/02}{(AO, 571) coding convention: use \cs{bgroup}, \cs{egroup} (instead of braces) when a box is being built}%
+% \changes{4.1n}{2010/01/02}{(AO, 571) Footnotes, when columns are balanced or when they are composed with their column}%
+% \changes{4.1n}{2010/01/02}{(AO, 571) Change \cs{balance@two}'s balancing algorithm to more successfully balance extremely short columns.}
% \begin{macrocode}
\def\balance@two#1#2{%
+ \ltxgrid@info@sw{\class@info{\string\balance@two\string#1\string#2}}{}%
\outputdebug@sw{\trace@scroll{\showbox#1\showbox#2}}{}%
- \setbox\@ne\vbox{%
- \@ifvoid#1{}{%
- \unvcopy#1\recover@footins
- \@ifvoid#2{}{\marry@baselines}%
+% \end{macrocode}
+% The first step is to recover the footnotes from the bottoms of the two columns (globally, into \cmd\footsofar)
+% and to combine the text into \cmd\box\cmd\@ne, but without voiding either of the argument boxes.
+% \begin{macrocode}
+ \setbox\thr@@\copy\footsofar
+ \setbox\@ne\vbox\bgroup
+ \@ifvoid{#1}{}{%
+ \recover@column#1\footsofar\column@recovered\footins@recovered
+ \@ifvoid{#2}{}{\marry@baselines}%
}%
- \@ifvoid#2{}{%
- \unvcopy#2\recover@footins
+ \@ifvoid{#2}{}{%
+ \recover@column#2\footsofar\column@recovered\footins@recovered
}%
- }%
+ \egroup
+ \outputdebug@sw{\trace@scroll{\showbox\@ne}}{}%
+ \ltxgrid@foot@info@sw{\trace@scroll{\showbox\footsofar}}{}%
+% \end{macrocode}
+% Hereunder, \cmd\dimen@\ is the split value. We adjust it until the step size is small enough, while the split is acceptable.
+% Also, \cmd\dimen@i\ is the step size. Once this value is greater than a half point, we must iterate.
+% \begin{macrocode}
\dimen@\ht\@ne\divide\dimen@\tw@
\dimen@i\dimen@
\vbadness\@M
\vfuzz\maxdimen
+ \splittopskip\topskip
\loopwhile{%
- \dimen@i=.5\dimen@i
- \outputdebug@sw{\saythe\dimen@\saythe\dimen@i\saythe\dimen@ii}{}%
\setbox\z@\copy\@ne\setbox\tw@\vsplit\z@ to\dimen@
- \setbox\z@ \vbox{%
- \unvcopy\z@
- \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@\remove@lastbox\aftergroup\vskip\aftergroup-\expandafter}\the\dp\z@\relax
- }%
+ \remove@depth\z@\remove@depth\tw@
+% \end{macrocode}
+% The following line would provide a diagnostic of the iterations of column balancing, were we to use it.
+% \begin{verbatim}
+% \outputdebug@sw{\trace@scroll{\showbox\tw@\showbox\z@}}{}%
+% \end{verbatim}
+% Hereunder, \cmd\dimen@ii\ is used to reckon the difference in height between the left box and the right.
+% \begin{macrocode}
\dimen@ii\ht\tw@\advance\dimen@ii-\ht\z@
- \@ifdim{\dimen@i>.5\p@}{%
- \advance\dimen@\@ifdim{\dimen@ii<\z@}{}{-}\dimen@i
- \true@sw
+ \dimen@i=.5\dimen@i
+ \ltxgrid@info@sw{\saythe\dimen@\saythe\dimen@i\saythe\dimen@ii}{}%
+% \end{macrocode}
+% If the columns are within a half-point of each other,
+% \begin{macrocode}
+ \@ifdim{\dimen@ii<.5\p@}{%
+ \@ifdim{\dimen@ii>-.5\p@}%
}{%
- \@ifdim{\dimen@ii<\z@}{%
- \advance\dimen@\tw@\dimen@i
- \true@sw
- }{%
- \false@sw
- }%
+ \false@sw
}%
- }%
- \outputdebug@sw{\saythe\dimen@\saythe\dimen@i\saythe\dimen@ii}{}%
- \@ifdim{\ht\z@=\z@}{%
- \@ifdim{\ht\tw@=\z@}{%
+% \end{macrocode}
+% The above results in a Boolean, which now chooses between the following two brace-delimited clauses.
+% If the step size is less than a half-point, then terminate the loop.
+% \begin{macrocode}
+ {%
\true@sw
}{%
+ \@ifdim{\dimen@i<.5\p@}%
+ }%
+% \end{macrocode}
+% The above results in a Boolean, which now chooses between the following two brace-delimited clauses.
+% The true-part terminates the loop, otherwise iterate.
+% \begin{macrocode}
+ {%
\false@sw
}%
+ {%
+% \end{macrocode}
+% For the next iteration, the candidate split dimension \cmd\dimen@\ will be one step larger
+% if the height of the left box is less than that of the right box.
+% Otherwise it will be one step smaller.
+% \begin{macrocode}
+ \advance\dimen@\@ifdim{\dimen@ii<\z@}{}{-}\dimen@i
+ \true@sw
+ }%
+ }%
+% \end{macrocode}
+% The loop has terminated.
+% \begin{macrocode}
+ \ltxgrid@info@sw{\saythe\dimen@\saythe\dimen@i\saythe\dimen@ii}{}%
+% \end{macrocode}
+% The algorithm has failed to find a satisfactory result if
+% the left column is of non-zero height and the right column is of zero height.
+% \begin{macrocode}
+ \@ifdim{\ht\z@=\z@}{%
+ \@ifdim{\ht\tw@=\z@}%
}{%
\true@sw
}%
+% \end{macrocode}
+% The \cmd\false@sw\ branch is executed if the algorithm has failed.
+% We restore the original boxes.
+% \begin{macrocode}
{%
}{%
\ltxgrid@info{Unsatifactorily balanced columns: giving up}%
\setbox\tw@\box#1%
\setbox\z@ \box#2%
+ \global\setbox\footsofar\box\thr@@
}%
\setbox\tw@\vbox{\unvbox\tw@\vskip\z@skip}%
\setbox\z@ \vbox{\unvbox\z@ \vskip\z@skip}%
\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@}{}%
+ \ltxgrid@info@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{\trace@scroll{\showbox#1\showbox#2}}{}%
}%
% \end{macrocode}
+% Procedure \cmd\remove@depth\ rearranges the given (vertical) box register so that it has zero depth.
+% \begin{macrocode}
+\def\remove@depth#1{%
+ \setbox#1\vbox\bgroup
+ \unvcopy#1%
+ \setbox\z@\vbox\bgroup
+ \unvbox#1%
+ \setbox\z@\lastbox
+ \aftergroup\kern\aftergroup-\expandafter
+ \egroup
+ \the\dp\z@\relax
+ \egroup
+}%
+% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\recover@footins}
-% 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
- \@ifvoid\z@{}{%
- \global\setbox\footsofar\vbox{%
- \unvbox\footsofar
- \@ifvbox\z@{%
- \unvbox\z@
- }{%
- \box\z@
- }%
- }%
- }%
+% \changes{4.1n}{2010/01/02}{(AO, 571) Abandon \cs{recover@footins} in favor of \cs{recover@column}}%
+% Procedure \cmd\recover@column\ is a utility to separate a column box into text and footnotes;
+% the former being contributed to the current (vertical) list, the latter appended to the given register, usually \cmd\footsofar.
+%
+% Argument \verb+#1+ is the input: it should be a \cmd\vbox, and it remains unaltered.
+% Argument \verb+#2+ is the box into which to (globally) add the footnotes, usually \cmd\footsofar.
+% Arguments \verb+#3+ and \verb+#4+ are scratch box registers to use in this calculation.
+% As a side effect, \verb+#3+ will be unboxed into whatever vertical mode we are in at the moment (should be a \cmd\vbox).
+% \begin{macrocode}
+\def\recover@column#1#2#3#4{%
+ \ltxgrid@info@sw{\class@info{\string\recover@column\string#1\string#2\string#3\string#4}}{}%
+ \setbox#4\vbox{\unvcopy#1}%
+ \ltxgrid@foot@info@sw{\trace@scroll{\showbox#4}}{}%
+ \dimen@\ht#4%
+ \ltxgrid@foot@info@sw{\saythe\dimen@}{}%
+ \setbox#4\vbox\bgroup
+ \unvbox#4\unskip
+% \end{macrocode}
+% We now strip the footnotes from the bottom of this box, adding them to \cmd\footsofar.
+% The method relies on a signal, consisting of a complementary pair of kerns, placed at the bottom of the box by \cmd\@combineinserts.
+% \begin{macrocode}
+ \dimen@i\lastkern\unkern\advance\dimen@i\lastkern
+ \@ifdim{\dimen@i=\z@}{%
+ \dimen@i\lastkern\unkern
+ \ltxgrid@foot@info@sw{\saythe\dimen@i}{}%
+ \aftergroup\dimen@i
+ \expandafter\egroup\the\dimen@i\relax
+ }{%
+ \egroup
}%
- }{}%
- \outputdebug@sw{\trace@box\footsofar}{}%
+% \end{macrocode}
+% Split the column into \verb+#3+ and the footnote into \verb+#4+.
+% Append the footnote to \verb+#2+.
+% \begin{macrocode}
+ \@ifdim{\dimen@i<\z@}{%
+ \advance\dimen@\dimen@i
+ \ltxgrid@foot@info@sw{\saythe\dimen@i\saythe\dimen@}{}%
+ \splittopskip\z@skip
+ \global\setbox#3\vsplit#4 to\dimen@
+ \global\setbox#4\vbox{\unvbox#4}%
+ \ltxgrid@foot@info@sw{\trace@scroll{\showbox#1\showbox#2\showbox#3\showbox#4}}{}%
+ \global\setbox#2\vbox\bgroup\unvbox#2\vskip\z@skip\unvbox#4\egroup
+ }{%
+% \end{macrocode}
+% What if \cmd\dimen@i\ is zero?
+% In that case, \cmd\setbox\#3\cmd\box\#4, and do not touch \cmd\box\#2.
+% \begin{macrocode}
+ \setbox#3\box#4%
+ \ltxgrid@foot@info@sw{\trace@scroll{\showbox#1\showbox#2\showbox#3\showbox#4}}{}%
+ }%
+ \unvbox#3%
+ \loopwhile{\dimen@\lastskip\@ifdim{\dimen@>\z@}{\unskip\true@sw}{\false@sw}}%
+}%
+\def\recover@column@null#1#2#3#4{%
+ \unvcopy#1%
}%
% \end{macrocode}
% \end{macro}
@@ -5300,19 +5765,9 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
}%
\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
@@ -5448,6 +5903,20 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\@outputpage@head}
+% For compatibility with David Carlisle's \classname{lscape} package, we need to allow the
+% \cmd\LS@rot\ procedure to mung \cmd\@outputbox.
+%
+% Implementation note: the \classname{lscape} package effectively tailpatches two \LaTeX\ internals to accomplish its purpose,
+% an approach that is not robust. It is more robust to headpatch \cmd\@outputpage, which is what we do here.
+% \changes{4.1o}{2010/02/02}{(AO, 576) Allow \classname{lscape} to act on \cs{@outputbox} at the right time}%
+% \begin{macrocode}
+\appdef\@outputpage@head{%
+ \@ifx{\LS@rot\@undefined}{}{\LS@rot}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
% \subsubsection{Warning message}
%
% \begin{macro}{\ltxgrid@info}
@@ -5463,6 +5932,7 @@ now put a \cmd\usepackage\texttt{\{ltxgrid\}} in your document preamble!
\ltxgrid@warn@sw{\class@warn}{\@gobble}%
}%
\@booleantrue\ltxgrid@warn@sw
+\@booleanfalse\ltxgrid@foot@info@sw
% \end{macrocode}
% \end{macro}
% \end{macro}
diff --git a/Master/texmf-dist/source/latex/revtex/ltxutil.dtx b/Master/texmf-dist/source/latex/revtex/ltxutil.dtx
index bf9000c82af..485620035d2 100644
--- a/Master/texmf-dist/source/latex/revtex/ltxutil.dtx
+++ b/Master/texmf-dist/source/latex/revtex/ltxutil.dtx
@@ -79,9 +79,11 @@ License
\keepsilent
\generate{%
%{ignore}
-% \usedir{tex/latex/revtex}%
\file{ltxutil.sty}{%
- \from{ltxutil.dtx}{package,kernel}%{ltxutil,ltxutil-krn}%
+ \from{ltxutil.dtx}{package,kernel}%
+ }%
+ \file{ltxutil.krn}{%
+ \from{ltxutil.dtx}{kernel}%
}%
}%
\ifToplevel{
@@ -106,15 +108,15 @@ License
%</ignore>
% \fi
%
-% \GetFileInfo{ltxutil.dtx}\CheckSum{4094}
+% \GetFileInfo{ltxutil.dtx}\CheckSum{4291}
%
% \iffalse ltxdoc klootch
%<*package>
%%% @LaTeX-file{
%%% filename = "ltxutil.dtx",
-%%% version = "4.1h",
-%%% date = "2009/10/09",
-%%% time = "11:23:00 GMT+8",
+%%% version = "4.1p",
+%%% date = "2010/02/25",
+%%% time = "18:00:00 UT-8",
%%% checksum = "4094",
%%% author = "Arthur Ogawa (mailto:arthur_ogawa at sbcglobal.net),
%%% commissioned by the American Physical Society.
@@ -197,10 +199,20 @@ License
% As desired, the following modules all
% take common version information:
% \begin{macrocode}
-%<package>\ProvidesFile{ltxutil.sty}%
+%<kernel&!package&!doc>\typeout{%
+%<*package|doc>
+\ProvidesFile{%
+%</package|doc>
+%<*kernel|package|doc>
+ltxutil%
+%</kernel|package|doc>
%<*doc>
-\expandafter\ProvidesFile\expandafter{\jobname.dtx}%
+.dtx%
%</doc>
+%<package>.sty%
+%<*package|doc>
+}%
+%</package|doc>
% \end{macrocode}
%
% The following line contains, for once and for all,
@@ -208,10 +220,13 @@ License
% By various means, this information is reproduced
% consistently in all generated files and in the
% typeset documentation.
+% Give credit where due.
% \begin{macrocode}
-%<*doc|package>
- [2009/10/09 4.1h utilities package]% \fileversion
-%</doc|package>
+%<*doc|package|kernel>
+%<version>
+ [2010/02/25/18:00:00 4.1p utilities package (portions licensed from W. E. Baxter web at superscript.com)]% \fileversion
+%</doc|package|kernel>
+%<kernel&!package&!doc>}%
% \end{macrocode}
%
%
@@ -426,6 +441,14 @@ now put a \cmd\usepackage\texttt{\{ltxutil\}} in your document preamble!
\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.}%
+\changes{4.1n}{2009/12/05}{(AO, 569) Use of \classname{hyperref} interferes with column balancing of last page}%
+\changes{4.1n}{2009/12/06}{(AO) Incorporate change to ltmiscen.dtx v1.1i 2000/05/19}%
+\changes{4.1n}{2009/12/09}{(AO, 569) execute \classname{atveryend}'s \cs{Call@AfterLastShipout} at the proper time}%
+\changes{4.1n}{2009/12/13}{(AO, 574) protect against \classname{lineno.sty}, which forces a visit to the output routine, which appears to destroy the value of \cs{@tempdima}}%
+\changes{4.1n}{2010/01/02}{(AO, 571) Interface \cs{set@footnotewidth} for determining the set width of footnotes}%
+\changes{4.1n}{2010/01/02}{(AO, 571) allow split after last line of footnote}%
+\changes{4.1n}{2010/01/06}{(AO, 572) title block footnotes numbered independently from body footnotes}%
+\changes{4.1p}{2010/02/24}{(AO, 582) A patch of \classname{hyperref.sty} to provide backward compatibility to \TeX Live 2007's version 6.75r}%
\end{filecontents*}
@@ -523,12 +546,8 @@ now put a \cmd\usepackage\texttt{\{ltxutil\}} in your document preamble!
% \end{macrocode}
%
% \subsection{Banner and beginning of the \file{kernel} {\sc docstrip} module}%
-% Credit where due.
% \begin{macrocode}
%<*kernel>
-\typeout{%
- ltxutil [2009/07/07 4.1f]: portions licensed from W. E. Baxter (web at superscript.com)%
-}%
% \end{macrocode}
%
% \subsection{Errors and warnings}
@@ -967,6 +986,7 @@ now put a \cmd\usepackage\texttt{\{ltxutil\}} in your document preamble!
% \begin{macro}{\enddocument}
% \begin{macro}{\check@aux}
% \begin{macro}{\do@check@aux}
+% \changes{4.1n}{2009/12/05}{(AO, 569) Use of \classname{hyperref} interferes with column balancing of last page}%
% The standard \LaTeX\ \enve{document} processing is a potential problem,
% particularly when the output routine has been changed by \classname{ltxgrid}.
% We separate out the procedure that checks the auxiliary file at the end of
@@ -977,14 +997,28 @@ now put a \cmd\usepackage\texttt{\{ltxutil\}} in your document preamble!
% with the output routine.
% \begin{macrocode}
\def\enddocument{%
+% \end{macrocode}
+% \changes{4.1n}{2009/12/06}{(AO) Incorporate change to ltmiscen.dtx v1.1i 2000/05/19}%
+% The following line from \filename{ltmiscen.dtx} `resets \cmd\AtEndDocument for latex/3060'.
+% \begin{macrocode}
+ \let\AtEndDocument\@firstofone
+% \end{macrocode}
+% \begin{macrocode}
\@enddocumenthook
\@checkend{document}%
+% \end{macrocode}
+% The \cmd\clear@document\ statement ends the current page (we must guarantee no further shipouts),
+% then executes all cleanup procedures that must occur only after the last shipout.
+% Clients will queue up their procedures via \cmd\AfterLastShipout, if it exists, otherwise by doing \cmd\appdef\cmd\clear@document.
+% \begin{macrocode}
\clear@document
+% \end{macrocode}
+% We are very close to ending the \TeX\ run, now.
+% \begin{macrocode}
\check@aux
\deadcycles\z@
\@@end
}%
-\def\clear@document{\clearpage}%
\def\check@aux{\do@check@aux}%
\def\do@check@aux{%
\@if@sw\if@filesw\fi{%
@@ -1022,6 +1056,36 @@ now put a \cmd\usepackage\texttt{\{ltxutil\}} in your document preamble!
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\clear@document}
+% \changes{4.1n}{2009/12/05}{(AO, 569) Use of \classname{hyperref} interferes with column balancing of last page}%
+% The procedure \cmd\clear@document\ is responsible for flushing out the last page of the document,
+% if not already done.
+% The procedure then executes those procedures that must wait for execution until
+% after the last page is shipped out.
+% Clients of \classname{ltxutil}, such as \classname{ltxgrid} and \classname{revtex4}
+% will queue these procedures up via \cmd\AfterLastShipout, if it exists, otherwise by doing \cmd\appdef\cmd\clear@document.
+%
+% The command \cmd\Call@AfterLastShipout\ is provided by Heiko Oberdiek's \classname{atveryend} package.
+% This package is compatible with \classname{ltxutil}.
+%
+% Note on compatibility with \classname{atveryend}:
+% we arrange for \cmd\Call@AfterLastShipout\ to be called from the safety of the output routine,
+% thereby ensuring that all of the procedures queued up by that package's
+% \cmd\AfterLastShipout\ are executed at the right time.
+% We also ensure that \cmd\Call@AfterLastShipout\ has a default definition, in case the package was never loaded.
+% \changes{4.1n}{2009/12/09}{(AO, 569) execute \classname{atveryend}'s \cs{Call@AfterLastShipout} at the proper time}%
+% \begin{macrocode}
+\def\clear@document{%
+ \clearpage
+ \do@output@cclv{%
+ \Call@AfterLastShipout
+ }%
+}%
+\appdef\class@documenthook{%
+ \providecommand\Call@AfterLastShipout{}%
+}%
+% \end{macrocode}
+% \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}.}
@@ -1512,8 +1576,12 @@ now put a \cmd\usepackage\texttt{\{ltxutil\}} in your document preamble!
% is not the right parameter to use for the set width of a footnote.
% In such a case, for the applicable scope, you should define
% \cmd\set@footnotewidth\ to perform this job correctly.
+%
+% If we are setting type on multiple page grids, we must still ensure that all footnotes that
+% find their way into the \cmd\footins\ insert register are set on the same width.
+% This implies the need for a document to have an ``overall'' page grid, which determines the set width of all footnotes
+% with the exception of minipage footnotes.
%
-% A procedure, \cmd\set@footnotewidth@ii, illustrates how to do this when in a two-column page grid.
% In general, remember that footnotes, like all insertions (including floats),
% are a step outside of the galley context, and all aspects of insertions need to be
% properly handled, including the set width.
@@ -1538,20 +1606,53 @@ now put a \cmd\usepackage\texttt{\{ltxutil\}} in your document preamble!
\make@footnotetext
}%
% \end{macrocode}
+% Procedure \cmd\make@footnotetext\ sets the footnote \verb+#1+ into type, with the proper
+% font, color, leading, width, and label in effect.
+% It also establishes a strut and null glue at the end of the last paragraph of the footnote;
+% The strut helps compensate for the lack of \cmd\interlineskip\ glue between \cmd\insert s;
+% the glue establishes a feasible \cmd\vsplit\ point between footnotes.
+%
+% Note that in the title block (\classname{ltxfront}), the alternative definition, under the name \cmd\frontmatter@footnotetext, is used.
+% The only material difference there is the reference to \cmd\frontmatter@makefntext\ instead of \cmd\@makefntext.
+%
+% Dependency note: the \cmd\@makefntext\ procedure is used to further process the footnote text
+% and to execute the \cmd\@makefnmark\ procedure to produce the footnote mark.
+% The definition of the former is customarily found in the document class (hereunder that of \filename{article.cls}),
+% the latter in \filename{latex.ltx}. They are as follows:
+% \begin{verbatim}
+%\newcommand\@makefntext[1]{%
+% \parindent 1em\noindent
+% \hb@xt@1.8em{\hss\@makefnmark}%
+% #1%
+%}%
+%\def\@makefnmark{%
+% \hbox{\@textsuperscript{\normalfont\@thefnmark}}%
+%}%
+% \end{verbatim}
+%
+% \changes{4.1n}{2010/01/06}{(AO, 572) title block footnotes numbered independently from body footnotes}%
% \begin{macrocode}
\long\def\make@footnotetext#1{%
\set@footnotefont
% \end{macrocode}
-% As noted above, we do \emph{not} do \cmd\floatingpenalty\ \cmd\@MM.
+% As noted above, we do \emph{not} do \cmd\floatingpenalty\ \cmd\@MM, as in standard \LaTeX.
% \begin{macrocode}
\set@footnotewidth
\@parboxrestore
\protected@edef\@currentlabel{%
- \csname p@footnote\endcsname\@thefnmark
+% \end{macrocode}
+% Note that we employ \cmd\@mpfn\ as a level of redirection for the footnotecounter.
+% \begin{macrocode}
+ \csname p@\@mpfn\endcsname\@thefnmark
}%
\color@begingroup
\@makefntext{%
- \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox
+ \rule\z@\footnotesep\ignorespaces#1%
+% \end{macrocode}
+% \changes{4.1n}{2010/01/02}{(AO, 571) allow split after last line of footnote}%
+% The following strut and glue are for spacing and splitting, as mentioned above.
+% \begin{macrocode}
+ \@finalstrut\strutbox\vadjust{\vskip\z@skip}%
}%
\color@endgroup
\minipagefootnote@drop
@@ -1569,20 +1670,10 @@ now put a \cmd\usepackage\texttt{\{ltxutil\}} in your document preamble!
}%
% \end{macrocode}
% \cmd\set@footnotewidth\ is the procedure for setting the width of a footnote.
+% The default page grid, a single, full-width column, sets footnotes on the width of the text.
+% \changes{4.1n}{2010/01/02}{(AO, 571) Interface \cs{set@footnotewidth} for determining the set width of footnotes}%
% \begin{macrocode}
-\def\set@footnotewidth{%
- \hsize\columnwidth
- \linewidth\hsize
-}%
-% \end{macrocode}
-% \begin{macrocode}
-\def\set@footnotewidth@ii{%
- \hsize\textwidth
- \advance\hsize\columnsep
- \divide\hsize\tw@
- \advance\hsize-\columnsep
- \linewidth\hsize
-}%
+\def\set@footnotewidth{\set@footnotewidth@one}%
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -3927,14 +4018,23 @@ now put a \cmd\usepackage\texttt{\{ltxutil\}} in your document preamble!
\@nameuse{l@f@#2}%
\ignorespaces#3\unskip\nobreak\hskip\skip@
\hb@xt@\rightskip{\hfil\unhbox\@tempboxa}\hskip-\rightskip\hskip\z@skip
- \par
- \expandafter\aftergroup\csname tocdim@#2\endcsname\expandafter
- \endgroup\the\@tempdima\relax
+% \end{macrocode}
+% \changes{4.1n}{2009/12/13}{(AO, 574) protect against \classname{lineno.sty}, which forces a visit to the output routine, which appears to destroy the value of \cs{@tempdima}}%
+%
+% By side effect, set the value of, e.g., \cmd\tocdim@section.
+%
+% Note that the \cmd\par\ must not be executed before the value of \cmd\@tempdima\ is expanded (outside the current group).
+% Otherwise, the \classname{lineno.sty} package may interfere (it unfortunately does a global assignment of \cmd\@tempdima).
+% \begin{macrocode}
+ \expandafter\par
+ \expandafter\aftergroup\csname tocdim@#2%
+ \expandafter\endcsname
+ \expandafter\endgroup
+ \the\@tempdima\relax
}%
% \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.
+% 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}%
@@ -4026,26 +4126,36 @@ now put a \cmd\usepackage\texttt{\{ltxutil\}} in your document preamble!
% \begin{macro}{\href}
% \begin{macro}{\url}
% \begin{macro}{\URL@prefix}
+% \begin{macro}{\doi}
+% \begin{macro}{\doibase}
% \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.
+% We provide support for the \cmd\href, \cmd\url, and \cmd\doi\ 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}%
+% \changes{4.1j}{2009/10/24}{(AO, 545) Provide definition for \cs{doi} that does hypertext}%
% \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 }%
+\providecommand\href[0]{\begingroup\@sanitize@url\@href}%
+\def\@href#1{\@@startlink{#1}\endgroup\@@href}%
+\def\@@href#1{#1\@@endlink}%
+\providecommand \url [0]{\begingroup\@sanitize@url \@url }%
\def \@url #1{\endgroup\@href {#1}{\URL@prefix#1}}%
\providecommand \URL@prefix [0]{URL }%
+\providecommand\doi[0]{\begingroup\@sanitize@url\@doi}%
+\def\@doi#1{\endgroup\@@startlink{\doibase#1}doi:\discretionary {}{}{}#1\@@endlink }%
+\providecommand \doibase [0]{http://dx.doi.org/}%
+\providecommand \@sanitize@url[0]{\chardef\cat@space\the\catcode`\ \@sanitize\catcode`\ \cat@space}%
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@@startlink}
% \begin{macro}{\@@endlink}
% \begin{macro}{\pdfstartlink@attr}
+% \begin{macro}{\hypertext@enable@ltx}
% 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
@@ -4054,21 +4164,135 @@ now put a \cmd\usepackage\texttt{\{ltxutil\}} in your document preamble!
% 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.
+% \changes{4.1j}{2009/10/25}{(AO, 545) hypertext capabilities off by default; enable with \classoption{hypertext}}
+%
+% A class or package that wishes to employ hypertext capabilities should
+% execute the \cmd\hypertext@enable@ltx\ procedure.
% \begin{macrocode}
+\def\@@startlink#1{}%
+\def\@@endlink{}%
\@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@hypertext#1{\leavevmode\special{html:<a href="#1">}}%
+ \def\@@endlink@hypertext{\special{html:</a>}}%
}{%
- \def\@@startlink#1{%
+ \def\@@startlink@hypertext#1{%
\leavevmode
\pdfstartlink\pdfstartlink@attr
user{/Subtype/Link/A<</Type/Action/S/URI/URI(#1)>>}%
\relax
}%
- \def\@@endlink{\pdfendlink}%
+ \def\@@endlink@hypertext{\pdfendlink}%
\def\pdfstartlink@attr{attr{/Border[0 0 1 ]/H/I/C[0 1 1]}}%
}%
+\def\hypertext@enable@ltx{%
+ \let\@@startlink\@@startlink@hypertext
+ \let\@@endlink\@@endlink@hypertext
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\href}
+% \changes{4.1p}{2010/02/24}{(AO, 582) A patch of \classname{hyperref.sty} to provide backward compatibility to \TeX Live 2007's version 6.75r}%
+% The \cmd\href\ command of \classname{hyperref} was extend somewhere
+% between versions 6.75r and 6.80e. We apply a repair to the earlier
+% version (if present) so that it works like the later version.
+%
+% The issue is the presence of whitespace, either following the \cmd\href\ token
+% or following the first argument's closing brace character.
+%
+% \begin{macrocode}
+\def\href@Hy{\hyper@normalise \href@ }%
+\def\href@Hy@ltx{\@ifnextchar\bgroup\Hy@href{\hyper@normalise\href@}}%
+\def\Hy@href#{\hyper@normalise\href@}%
+\begingroup
+ \endlinechar=-1 %
+ \catcode`\^^A=14 %
+ \catcode`\^^M\active
+ \catcode`\%\active
+ \catcode`\#\active
+ \catcode`\_\active
+ \catcode`\$\active
+ \catcode`\&\active
+ \gdef\hyper@normalise@ltx{^^A
+ \begingroup
+ \catcode`\^^M\active
+ \def^^M{ }^^A
+ \catcode`\%\active
+ \let%\@percentchar
+ \let\%\@percentchar
+ \catcode`\#\active
+ \def#{\hyper@hash}^^A
+ \def\#{\hyper@hash}^^A
+ \@makeother\&^^A
+ \edef&{\string&}^^A
+ \edef\&{\string&}^^A
+ \edef\textunderscore{\string_}^^A
+ \let\_\textunderscore
+ \catcode`\_\active
+ \let_\textunderscore
+ \let~\hyper@tilde
+ \let\~\hyper@tilde
+ \let\textasciitilde\hyper@tilde
+ \let\\\@backslashchar
+ \edef${\string$}^^A
+ \Hy@safe@activestrue
+ \hyper@n@rmalise
+ }^^A
+ \catcode`\#=6 ^^A
+ \gdef\Hy@ActiveCarriageReturn@ltx{^^M}^^A
+ \gdef\hyper@n@rmalise@ltx#1#2{^^A
+ \def\Hy@tempa{#2}^^A
+ \ifx\Hy@tempa\Hy@ActiveCarriageReturn
+ \Hy@ReturnAfterElseFi{^^A
+ \hyper@@normalise{#1}^^A
+ }^^A
+ \else
+ \Hy@ReturnAfterFi{^^A
+ \hyper@@normalise{#1}{#2}^^A
+ }^^A
+ \fi
+ }^^A
+ \gdef\hyper@@normalise@ltx#1#2{^^A
+ \edef\Hy@tempa{^^A
+ \endgroup
+ \noexpand#1{\Hy@RemovePercentCr#2%^^M\@nil}^^A
+ }^^A
+ \Hy@tempa
+ }^^A
+ \gdef\Hy@RemovePercentCr@ltx#1%^^M#2\@nil{^^A
+ #1^^A
+ \ifx\limits#2\limits
+ \else
+ \Hy@ReturnAfterFi{^^A
+ \Hy@RemovePercentCr #2\@nil
+ }^^A
+ \fi
+ }^^A
+\endgroup
+\def\switch@hyperref@href{%
+ \expandafter\@ifx\expandafter{\csname href \endcsname\href@Hy}{
+ \class@info{Repairing hyperref 6.75r \string\href}%
+ \let\hyper@normalise\hyper@normalise@ltx
+ \let\hyper@@normalise\hyper@@normalise@ltx
+ \let\hyper@n@rmalise\hyper@n@rmalise@ltx
+ \let\Hy@ActiveCarriageReturn\Hy@ActiveCarriageReturn@ltx
+ \let\Hy@RemovePercentCr\Hy@RemovePercentCr@ltx
+ \let\href\href@Hy@ltx
+ }{}%
+}%
+\appdef\document@inithook{\switch@hyperref@href}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\typeout}
+% We make the \cmd\typeout\ procedure of \LaTeX\ be \cmd\long,
+% because sometimes we are talking about \cmd\par.
+% \begin{macrocode}
\def\typeout@org#1{%
\begingroup
\set@display@protect
@@ -4087,8 +4311,6 @@ now put a \cmd\usepackage\texttt{\{ltxutil\}} in your document preamble!
}{}%
% \end{macrocode}
% \end{macro}
-% \end{macro}
-% \end{macro}
%
% \subsection{End of the \file{kernel} {\sc docstrip} module}
% Here ends the module.
diff --git a/Master/texmf-dist/source/latex/revtex/revtex4-1.dtx b/Master/texmf-dist/source/latex/revtex/revtex4-1.dtx
index 9d517bf02a5..3806fe8f786 100644
--- a/Master/texmf-dist/source/latex/revtex/revtex4-1.dtx
+++ b/Master/texmf-dist/source/latex/revtex/revtex4-1.dtx
@@ -127,9 +127,9 @@ See the REVTeX 4 README file for restrictions and more information.
%<*package>
%%% @LaTeX-file{
%%% filename = "revtex4-1.dtx",
-%%% version = "4.1g",
-%%% date = "2009/10/08",
-%%% time = "11:23:00 GMT+8",
+%%% version = "4.1p",
+%%% date = "2010/03/15",
+%%% time = "20:00:00 UT-8",
%%% checksum = "7177",
%%% author = "Arthur Ogawa (mailto:arthur_ogawa at sbcglobal.net),
%%% commissioned by the American Physical Society.
@@ -221,8 +221,13 @@ See the REVTeX 4 README file for restrictions and more information.
\ProvidesFile{revtex4-1.dtx}
%</doc>
%<*!package&!options>
- [2009/10/08:11:23 4.1g (http://publish.aps.org/revtex4/ for documentation)]%FileInfo
+%<version>
+ [2010/03/15/20:00:00 4.1p (http://publish.aps.org/revtex4/ for documentation)]% \fileversion
%</!package&!options>
+% \end{macrocode}
+% The current class name is remembered in \cmd\class@name.
+% This is something of a klootch, relying as it does on knowledge of the implementation of \cmd\ProvidesPackage.
+% \begin{macrocode}
%<kernel>\let\class@name\@gtempa
% \end{macrocode}
%
@@ -400,7 +405,7 @@ The file \file{template.aps} is a boilerplate file.
\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, 513) Add class option linenumbers: number the lines a la \classname{lineno}}
\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}%
@@ -411,6 +416,32 @@ The file \file{template.aps} is a boilerplate file.
\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}%
+\changes{4.1i}{2009/10/23}{(AO, 541) Defer assignment of \cs{cite} until after natbib loads}
+\changes{4.1j}{2009/10/24}{(AO, 549) Repairing natbib's \cs{BibitemShut} and \cs{bibAnnote}}
+\changes{4.1j}{2009/10/25}{(AO, 545) hypertext capabilities off by default; enable with \classoption{hypertext}}
+\changes{4.1j}{2009/10/25}{(AO, 552) Repair spacing in \cs{onlinecite}}
+\changes{4.1k}{2009/11/06}{(AO, 554) give the \cs{newlabel} command syntax appropriate to the hyperref package}
+\changes{4.1n}{2009/11/06}{(AO, 565) restore 4.0 behavior: invoking class option preprint implies class option preprintnumbers}
+\changes{4.1n}{2009/11/30}{(AO, 566) restore 4.0 behavior: flush column bottoms}
+\changes{4.1n}{2009/12/05}{(AO, 569) Use of \classname{hyperref} interferes with column balancing of last page}%
+\changes{4.1n}{2009/12/09}{(AO, 569) execute the after-last-shipout procedures from within the safety of the output routine}%
+\changes{4.1n}{2010/01/02}{(AO, 571) Interface \cs{set@footnotewidth} for determining the set width of footnotes}%
+\changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
+\changes{4.1n}{2009/12/13}{(AO, 573) arrange to load \classname{lineno} after any other packages.}%
+\changes{4.1n}{2010/01/04}{(AO, 575) the default for journal prstper is longbibliography}%
+\changes{4.1n}{2010/01/04}{(AO, 576) In .bst files, remove support for the annote field}%
+\changes{4.1n}{2010/01/02}{(AO) fine-tune spacing above and below widetext}%
+\changes{4.1n}{2010/01/02}{(AO, 571) class file must set \cs{splittopskip}; fine tune \cs{skip}\cs{footins}; \cs{footnoterule} defined in terms of \cs{skip}\cs{footins}}%
+\changes{4.1n}{2010/01/02}{(AO, 572) \cs{@makefntext} and \cs{frontmatter@makefntext} must be defined harmoniously}%
+\changes{4.1o}{2010/02/02}{(AO, 575) Automatically incorporate the (Bib\TeX-generated) .bbl into an explicit \env{thebibliography}}%
+\changes{4.1o}{2010/02/05}{(AO, 549) Remove patch to natbib, which is now at version 8.31a}
+\changes{4.1o}{2010/02/07}{(AO, 578) accommodate the possible space character preceding \cs{BibitemShut}.}
+\changes{4.1o}{2010/02/05}{(AO, 579) Endnote shall comprise their own Bib\TeX\ entry type: @FOOTNOTE.}
+\changes{4.1o}{2010/02/10}{(AO, 580) Provide a document class option to turn off production of eprint field in bibliography.}
+\changes{4.1o}{2010/02/12}{(AO, 580) Control .bst at run time.}%
+\changes{4.1o}{2010/02/09}{(AO, 581) Handle case: merged references, with first ending in a stop character.}
+\changes{4.1p}{2010/02/24}{(AO, 583) Provide interface to \classname{ltxgrid} \cs{onecolumn@grid@setup} and \cs{twocolumn@grid@setup}}
+\changes{4.1p}{2010/02/24}{(AO, 584) Per MD, remove trailing space character from each journal abbreviation: it had caused an extraneous space in the .bbl}
\end{filecontents*}
% \end{macrocode}
@@ -852,17 +883,20 @@ The file \file{template.aps} is a boilerplate file.
% \subsubsection{Showing preprint numbers}%
%
% \begin{macro}{\preprint@sw}
+% \changes{4.0d}{2000/04/10}{New option}
% \changes{4.1b}{2008/07/01}{(AO) make settings at class time instead of deferring them to later.}
+% \changes{4.1n}{2009/11/06}{(AO, 565) restore 4.0 behavior: default value of \cs{preprint@sw} follows \cs{preprintsty@sw}}
% 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
+\appdef\setup@hook{%
+ \@ifxundefined\preprint@sw{\let\preprint@sw\preprintsty@sw}{}%
+}%
% \end{macrocode}
% \end{macro}
%
@@ -1087,6 +1121,18 @@ The file \file{template.aps} is a boilerplate file.
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\eprint@enable@sw}
+% \changes{4.1o}{2010/02/10}{(AO, 580) Provide a document class option to turn off production of eprint field in bibliography.}
+%
+% The document class options \classoption{eprint} and \classoption{noeprint}
+% give the user the ability to turn off production of the \texttt{eprint} field in the bibliography.
+% \begin{macrocode}
+\DeclareOption{eprint}{\@booleantrue\eprint@enable@sw}%
+\DeclareOption{noeprint}{\@booleanfalse\eprint@enable@sw}%
+\@booleantrue\eprint@enable@sw
+% \end{macrocode}
+% \end{macro}
+%
% \subsubsection{Simplex/Duplex Pages}%
%
% \begin{macro}{\twoside@sw}
@@ -1124,6 +1170,7 @@ The file \file{template.aps} is a boilerplate file.
%
% \begin{macro}{\twocolumn@sw}
% \changes{4.1b}{2008/07/01}{(AO) make settings at class time instead of deferring them to later.}
+% \changes{4.1p}{2010/02/24}{(AO, 583) Provide interface to \classname{ltxgrid} \cs{onecolumn@grid@setup} and \cs{twocolumn@grid@setup}}
% The flag \cmd\twocolumn@sw\ signifies that the document is to be
% formatted in the two-column page grid.
%
@@ -1132,20 +1179,7 @@ The file \file{template.aps} is a boilerplate file.
% Up to that point, the class can check if \cmd\twocolumn@sw\
% is \cmd\undefined\ to see if any related options have been invoked.
%
-% 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 procedure is executed after all typesetting is complete
-% i.e., after items like \cmd\printtables.)
-% \begin{macrocode}
-\def\clear@document{%
- \close@column
-}%
-% \end{macrocode}
-%
% \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}
@@ -1167,9 +1201,15 @@ The file \file{template.aps} is a boilerplate file.
% \begin{macrocode}
\def\select@column@grid{%
\twocolumn@sw{%
+ \twocolumn@grid@setup
\open@twocolumn
}{%
+ \onecolumn@grid@setup
+% \end{macrocode}
+% \begin{verbatim}
% \open@onecolumn
+% \end{verbatim}
+% \begin{macrocode}
}%
}%
\appdef\class@documenthook{%
@@ -1179,6 +1219,30 @@ The file \file{template.aps} is a boilerplate file.
%
% \end{macro}
%
+% \begin{macro}{\clear@document}
+% \changes{4.1n}{2009/12/05}{(AO, 569) Use of \classname{hyperref} interferes with column balancing of last page}%
+%
+% We install into \cmd\class@enddocumenthook\
+% a trap for the procedure \cmd\clearpage\ that attempts to end the current page.
+% This procedure needs to be headpatched with \cmd\close@column\ to end the current page grid.
+%
+% This procedure is executed after all typesetting is complete
+% i.e., after items like \cmd\printtables, as well as all commands queued up by \cmd\AtEndDocument.
+%
+% \begin{macrocode}
+\appdef\setup@hook{%
+ \let\clearpage@ltx\clearpage
+ \prepdef\clear@document{\let\clearpage\clearpage@ltx\let\clear@document\@empty\close@column}%
+ \appdef\class@documenthook{%
+ \appdef\class@enddocumenthook{%
+ \let\clearpage\clear@document
+ }%
+ }%
+}%
+% \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.
@@ -1678,8 +1742,16 @@ The file \file{template.aps} is a boilerplate file.
% package \classname{ltxgrid}. Only people who really want to see this output will select these class options.
% Consult documentation for the \classname{ltxgrid} package to see what output the related switches enable.
% \begin{macrocode}
-\DeclareOption{ltxgridinfo}{\@booleantrue\ltxgrid@info@sw}%
-\DeclareOption{outputdebug}{\@booleantrue\outputdebug@sw}%
+\DeclareOption{ltxgridinfo}{%
+ \@booleantrue\ltxgrid@info@sw
+%\@booleantrue\ltxgrid@foot@info@sw
+}%
+\DeclareOption{outputdebug}{%
+ \@booleantrue\outputdebug@sw
+ \@booleantrue\ltxgrid@info@sw
+ \@booleantrue\ltxgrid@foot@info@sw
+ \traceoutput
+}%
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1716,14 +1788,19 @@ The file \file{template.aps} is a boilerplate file.
% \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}.
+% \changes{4.1f}{2009/07/07}{(AO, 513) Add class option linenumbers: number the lines a la \classname{lineno}}
+% \changes{4.1n}{2009/12/13}{(AO, 573) arrange to load \classname{lineno} after any other packages.}%
+% An option to number the lines of type in the output in the manner of \classname{lineno}.
%
% 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).
+%
+% However, compatibility with \classname{amsmath} requires that \classname{lineno} be loaded afterwards.
+% Therefore, we defer loading of this package until after the preamble is completed.
% \begin{macrocode}
\DeclareOption{linenumbers}{%
- \appdef\rtx@require@packages{%
+ \appdef
+ \class@documenthook{%
\RequirePackage{lineno}[2005/11/02 v4.41]%
\linenumbersep4pt\relax
\linenumbers\relax
@@ -1830,6 +1907,18 @@ The file \file{template.aps} is a boilerplate file.
% \end{macro}
% \end{macro}
%
+% \changes{4.1j}{2009/10/25}{(AO, 545) hypertext capabilities off by default; enable with \classoption{hypertext}}
+% The class option \classoption{hypertext} enables the built-in hypertext capabilities,
+% which coincide with those of \classname{custom-bib}-generated BIBTeX styles
+% using the guard code \texttt{hypertext}.
+%
+% Note that APS has these capabilities turned off by default;
+% Loading the hyperref package turns them on.
+% \begin{macrocode}
+\DeclareOption{hypertext}{\hypertext@enable@ltx}%
+\appdef\document@inithook{\@ifpackageloaded{hyperref}{\hypertext@enable@ltx}{}}%
+% \end{macrocode}
+%
% The default handling for a document class option depends upon whether the \cmd\@society\ is
% defined.
%
@@ -2034,6 +2123,7 @@ The file \file{template.aps} is a boilerplate file.
% \begin{macro}{\lastpage@putlabel}
% Support the default meaning of \cmd\@endpage.
% \changes{4.0a}{1998/01/31}{Move after process options, so \cs{clearpage} not in scope of twocolumn}
+% \changes{4.1k}{2009/11/06}{(AO, 554) give the \cs{newlabel} command syntax appropriate to the hyperref package}
% Name of this macro (and the \cmd\label\ key) taken from
% \url{CTAN:/macros/latex/contrib/other/lastpage}%
% with code optimised slightly.
@@ -2042,7 +2132,7 @@ The file \file{template.aps} is a boilerplate file.
\if@filesw
\begingroup
\advance\c@page\m@ne
- \immediate\write\@auxout{\string\newlabel{LastPage}{{}{\thepage}}}%
+ \immediate\write\@auxout{\string\newlabel{LastPage}{{}{\thepage}{}{}{}}}%
\endgroup
\fi
}%
@@ -2052,13 +2142,14 @@ The file \file{template.aps} is a boilerplate file.
% 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.
+% Note that we assume no further \cmd\shipout s will be done past this point.
+% \changes{4.1n}{2009/12/09}{(AO, 569) execute the after-last-shipout procedures from within the safety of the output routine}%
% \begin{macrocode}
\appdef\clear@document{%
- \clearpage
- \lastpage@putlabel
- \tally@box@size@sw{\total@text}{}%
+ \do@output@cclv{%
+ \lastpage@putlabel
+ \tally@box@size@sw{\total@text}{}%
+ }%
}%
\providecommand\write@column@totals{}%
% \end{macrocode}
@@ -2948,7 +3039,11 @@ The file \file{template.aps} is a boilerplate file.
% \begin{environment}{ruledtabular}
% \begin{macrocode}
\def\endtabular@hook{}%
+% \end{macrocode}
+% \begin{verbatim}
%\RequirePackage{dcolumn}%
+% \end{verbatim}
+% \begin{macrocode}
\appdef\document@inithook{%
\@ifpackageloaded{dcolumn}{%
\expandafter\@ifnotrelax\csname NC@find@d\endcsname{}{%
@@ -3159,6 +3254,33 @@ The file \file{template.aps} is a boilerplate file.
% 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.
+%
+% \changes{4.1j}{2009/10/25}{(AO, 552) Repair spacing in \cs{onlinecite}}
+% In these procedures, we use \cmd\count@\ to count the number of arguments of the \cmd\cite\ command,
+% and we use \cmd\c@NAT@ctr\ to keep track of which argument we are processing.
+% The latter counter is created by \classname{natbib} and used there solely in bibliography processing,
+% where it keeps track of the reference number.
+% We take over its use in these macros, but only locally; therefore these procedures should work properly, even within the bibliography.
+%FIXME: check whether this is true!
+%
+% Because we are using a scratch counter \cmd\count@, we are vulnerable to other \TeX\ programmers
+% who patch in to \classname{natbib}'s processing and who might use that counter at the same time we are doing so.
+% This is a potential source of trouble for us.
+%FIXME: store the value of \cmd\count@\ in a private \cmd\csname!
+%
+% Note that \cmd\rtx@def@citea\ begins the same as \cmd\NAT@def@citea, which it replaces,
+% then makes further decisions based on the values of the counters.
+%
+% Note also that, in \classname{natbib}, the replacement part of \cmd\NAT@def@citea@close\ could be rewritten as
+% \cmd\NAT@def@citea\cmd\prepdef\cmd\@citea\verb+{+\cmd\NAT@@close\verb+}+, which
+% would them obviate the need for us to override its meaning.
+%
+% Note, too, the effect of \cmd\rtx@def@citea@box, which replaces \cmd\NAT@def@citea@box,
+% is almost the same as the latter, except the entire \cmd\@citea\ is given as the argument
+% of \cmd\NAT@mbox.
+%
+% Finally, bear in mind that the English (and some American editors) do not place a comma
+% before the ``and''; our procedures do (but they could be rewritten with that convention).
% \begin{macrocode}
\def\rtx@swap@citea{%
\let\NAT@def@citea\rtx@def@citea
@@ -3166,8 +3288,8 @@ The file \file{template.aps} is a boilerplate file.
\let\NAT@def@citea@box\rtx@def@citea@box
}%
\def\rtx@def@citea{%
+ \def\@citea{\NAT@separator\NAT@space}%
\advance\c@NAT@ctr\@ne
- \let\@citea\NAT@separator
\@ifnum{\count@>\tw@}{%
\@ifnum{\c@NAT@ctr=\count@}{\appdef\@citea{\NAT@conj\NAT@space}}{}%
}{%
@@ -3190,11 +3312,56 @@ The file \file{template.aps} is a boilerplate file.
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\BibitemShut}
+% \begin{macro}{\bibAnnote}
+% \changes{4.1j}{2009/10/24}{(AO, 549) Repairing natbib's \cs{BibitemShut} and \cs{bibAnnote}}
+% \changes{4.1o}{2010/02/05}{(AO, 549) Remove patch to natbib, which is now at version 8.31a}
+% \changes{4.1o}{2010/02/07}{(AO, 578) accommodate the possible space character preceding \cs{BibitemShut}.}
+% We remember a temporary patch to \classname{natbib}'s definition of \cmd\BibitemShut.
+% \begin{macrocode}
+\def\NAT@BibitemShut#1{%
+ \def\@bibstop{#1}%
+ \let\bibitem@Stop\bibitemStop
+ \let\bibitem@NoStop\bibitemNoStop
+ \@ifx{\bibitemShut\relax}{\let\@bibitemShut\@empty}{%
+ \expandafter\def\expandafter\@bibitemShut\expandafter{\bibitemShut}%
+ }%
+}%
+% \end{macrocode}
+% The following is a bug fix to \classname{natbib} version 8.31b.
+% \begin{macrocode}
+\def\BibitemShut@ltx#1{%
+ \unskip
+ \def\@bibstop{#1}%
+ \let\bibitem@Stop\bibitemStop
+ \let\bibitem@NoStop\bibitemNoStop
+ \@ifx{\bibitemShut\relax}{\let\@bibitemShut\@empty}{%
+ \expandafter\def\expandafter\@bibitemShut\expandafter{\bibitemShut}%
+ }%
+}%
+% \end{macrocode}
+%
+% \begin{verbatim}
+%\providecommand{\bibAnnote}[3]{%
+% \BibitemShut{#1}%
+% \def\@tempa{#3}\@ifx{\@tempa\@empty}{}{%
+% \begin{quotation}\noindent
+% \textsc{Key:}\ #2\\\textsc{Annotation:}\ \@tempa
+% \end{quotation}%
+% }%
+% \ignorespaces
+%}%
+%\def\@bibitemShut{}%
+% \end{verbatim}
+% \end{macro}
+% \end{macro}
+%
+%
% \begin{macrocode}
\newenvironment{thebibliography}{}{}%
\let\@listi\@empty
\appdef\rtx@require@packages{%
- \RequirePackage[sort&compress]{natbib}[2008/12/08 8.3a (PWD, AO)]%
+ \RequirePackage[sort&compress]{natbib}[2009/11/07 8.31a (PWD, AO)]%
\let@environment{NAT@thebibliography}{thebibliography}%
\let@environment{thebibliography}{rtx@thebibliography}%
\let\bibliographystyle@latex\bibliographystyle
@@ -3252,6 +3419,13 @@ The file \file{template.aps} is a boilerplate file.
\let\onlinecite\rev@citealp
\let\textcite\rev@citet
% \end{macrocode}
+% The following is needed until \classname{natbib} is at 8.31b.
+% \begin{macrocode}
+\@ifx{\BibitemShut\NAT@BibitemShut}{%
+ \class@info{Repairing natbib's \string\BibitemShut}%
+ \let\BibitemShut\BibitemShut@ltx
+}{}%
+% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
@@ -3272,11 +3446,49 @@ The file \file{template.aps} is a boilerplate file.
\let\bibliographystyle@latex\bibliographystyle
\def\bibliographystyle{\def\@bibstyle}%
% \end{macrocode}
-% We customize one of the productions of \classname{natbib}.
+% \end{macro}
+%
+% \changes{4.1j}{2009/11/03}{(AO, 551) Punctuation at end of reference when optional arguments to the cite key are given.}
+% The following had been bug fixes to \classname{natbib} version 8.31a.
+% \begin{verbatim}
+%\def\bibitemStop{\@bibitemShut}%
+%\def\NAT@bibitem@cont{%
+% \let\bibitem@Stop\bibitemContinue
+% \let\bibitem@NoStop\bibitemContinue
+%}%
+% \end{verbatim}
+% The following are alterations to \classname{natbib} version 8.31a to
+% accommodate the possible space character preceding \cmd\BibitemShut,
+% and to handle the case of merged references, where the first ends with a stop character.
+% \changes{4.1o}{2010/02/07}{(AO, 578) accommodate the possible space character preceding \cs{BibitemShut}.}
+% \changes{4.1o}{2010/02/09}{(AO, 581) Handle case: merged references, with first ending in a stop character.}
% \begin{macrocode}
-\let\bibitemContinue\bibitemContinue@rtx
+\def\NAT@bibitem@cont{%
+ \let\bibitem@Stop\bibitemContinue@Stop
+ \let\bibitem@NoStop\bibitemContinue
+}%
+% \end{macrocode}
+% \begin{macrocode}
+\def\bibitemNoStop{%
+ \@ifx@empty\@bibitemShut{.\spacefactor\@mmm\space}{\@bibitemShut}%
+}%
+% \end{macrocode}
+% \begin{macrocode}
+\def\bibitemContinue{%
+ \@ifx@empty\@bibitemShut{;\spacefactor\@mmm\space}{\@bibitemShut}%
+}%
+% \end{macrocode}
+% \begin{macrocode}
+\def\bibitemContinue@Stop{%
+ \@ifx@empty\@bibitemShut{\spacefactor\@mmm\space}{\@bibitemShut}%
+}%
% \end{macrocode}
-% \end{macro}
+%
+% \changes{4.1k}{2009/11/11}{(AO, 561) remove dead code relating to \cs{bibitemContinue}}
+% We used to customize one of the productions of \classname{natbib}, but no longer.
+% \begin{verbatim}
+%\let\bibitemContinue\bibitemContinue@rtx
+% \end{verbatim}
%
% Here ends the code to be executed at \cmd\rtx@require@packages\ time.
% \begin{macrocode}
@@ -3284,9 +3496,10 @@ The file \file{template.aps} is a boilerplate file.
% \end{macrocode}
% \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}
+% \changes{4.1k}{2009/11/11}{(AO, 561) remove dead code relating to \cs{bibitemContinue}}
+% \begin{verbatim}
+% \def\bibitemContinue@rtx{;\spacefactor\@mmm\space}%
+% \end{verbatim}
%
% \begin{macro}{\onlinecite}
% \begin{macro}{\textcite}
@@ -3315,16 +3528,19 @@ The file \file{template.aps} is a boilerplate file.
% \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}%
+ \auto@bib@empty
+ \begingroup
+ \let\auto@bib@innerbib\@empty
+ \@ifx@empty{\pre@bibdata}{%
+ \bibliography@latex{#1}%
}{%
- \expandafter\bibliography@latex\expandafter{\pre@bibdata,#1}%
+ \@if@empty{#1}{%
+ \expandafter\bibliography@latex\expandafter{\pre@bibdata}%
+ }{%
+ \expandafter\bibliography@latex\expandafter{\pre@bibdata,#1}%
+ }%
}%
- }%
- \let\auto@bib\@empty
+ \endgroup
}%
\let\pre@bibdata\@empty
% \end{macrocode}
@@ -3340,6 +3556,8 @@ The file \file{template.aps} is a boilerplate file.
% might want to override the definition of \cmd\present@bibnote.
%
% \changes{4.1f}{2009/07/11}{(AO, 521) Lonely bibliography head}%
+% \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
+% \changes{4.1o}{2010/02/02}{(AO, 575) Automatically incorporate the (Bib\TeX-generated) .bbl into an explicit \env{thebibliography}}%
% We make provisions for the case where there are no \cmd\bibitem s
% for the bibliography: we produce no bibliography head at all.
%
@@ -3348,12 +3566,18 @@ The file \file{template.aps} is a boilerplate file.
\NAT@thebibliography{#1}%
\let\@TBN@opr\present@bibnote
\@FMN@list
+ \auto@bib@innerbib
}{%
+% \end{macrocode}
+% The following line was commented out:
+% \begin{verbatim}
%\@endnotesinbib
+% \end{verbatim}
+% \begin{macrocode}
\edef\@currentlabel{\arabic{NAT@ctr}}%
\label{LastBibItem}%
\endNAT@thebibliography
- \global\let\auto@bib\@empty
+ \aftergroup\auto@bib@empty
}%
\def\present@bibnote#1#2{%
\item[%
@@ -3361,12 +3585,17 @@ The file \file{template.aps} is a boilerplate file.
\normalfont
\Hy@raisedlink{\hyper@anchorstart{frontmatter.#1}\hyper@anchorend}%
\begingroup
- \c@footnote#1\relax
+ \csname c@\@mpfn\endcsname#1\relax
\frontmatter@thefootnote
\endgroup
}%
]#2\par
+% \end{macrocode}
+% The following line was commented out:
+% \begin{verbatim}
%\global\let\NAT@bibitem@first@sw\@secondoftwo
+% \end{verbatim}
+% \begin{macrocode}
}%
% \end{macrocode}
% \end{macro}
@@ -3402,7 +3631,7 @@ The file \file{template.aps} is a boilerplate file.
% \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
+% a superscript-style citation, imitating Donald Arseneau's \classname{cite} package
% with the \classoption{super}.
%
% The \cmd\rtx@@citetp\ procedure is substituted for \cmd\NAT@@citetp;
@@ -3475,6 +3704,9 @@ The file \file{template.aps} is a boilerplate file.
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \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).
@@ -3507,11 +3739,13 @@ The file \file{template.aps} is a boilerplate file.
%
% \begin{macro}{\mini@note}
% \begin{macro}{\save@note}
+% \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
+% QUERY: how do footnotes get thrown to the bibliography. \cmd\footinbib@sw\ appears to be irrelevant.
% \begin{macrocode}
\def\mini@note{\save@note\mini@notes}%Implicit #2
\def\save@note#1#2{%
- \stepcounter{footnote}%
- \protected@xdef\@thefnmark{\the\c@footnote}%
+ \stepcounter\@mpfn
+ \protected@xdef\@thefnmark{\thempfn}%
\@footnotemark
\expandafter\g@addto@macro
\expandafter#1%
@@ -3627,17 +3861,16 @@ The file \file{template.aps} is a boilerplate file.
%}%
% \end{verbatim}
%
-% \begin{macro}{\@doendnote}
% \cmd\@doendnote\ is obsolete.
% \begin{verbatim}
%\def\@doendnote#1#2{\bibitem{#1}#2}%
% \end{verbatim}
-% \end{macro}
%
+% \changes{4.1o}{2010/02/05}{(AO, 579) Endnote shall comprise their own Bib\TeX\ entry type: @FOOTNOTE.}
% 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.
+% a \texttt{@FOOTNOTE} 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.
@@ -3645,14 +3878,27 @@ The file \file{template.aps} is a boilerplate file.
\long\def\@endnotetext#1{%
\begingroup
\endnote@relax
- \immediate\write\@bibdataout{@MISC{\@endnotelabel,note="#1"}}%year="\@endnotelabel",
+ \immediate\write\@bibdataout{%
+ @FOOTNOTE{%
+ \@endnotelabel,%
+% \end{macrocode}
+% The \texttt{key} field is recommended in cases where there is no author (see \filename{btxdoc}).
+% \begin{macrocode}
+ key="\@endnotelabel",%
+% \end{macrocode}
+% The \texttt{note} field is simply the content of the footnote.
+% \begin{macrocode}
+ note="#1"%
+ }%
+ }%
\endgroup
}%
\newwrite\@bibdataout
-\appdef\class@documenthook{%
- \immediate\openout\@bibdataout\pre@bibdata.\bibdata@ext\relax
-}%
% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\endnote@relax}
+% At \cmd\AtBeginDocument\ time, we open the job's \filename{.bib} file.
%
% Procedure \cmd\endnote@relax\ robustifies commands that ought not to be expanded when
% the endnote is written out.
@@ -3663,41 +3909,59 @@ The file \file{template.aps} is a boilerplate file.
\let\cite \relax \let\ref \relax \let\pageref \relax
\let\( \relax \let\) \relax \let\\ \relax
\let~\relax
+% \end{macrocode}
+% \begin{verbatim}
%\let\protect\noexpand
+% \end{verbatim}
+% \begin{macrocode}
\let \protect \@unexpandable@protect
\newlinechar`\^^M%
+% \end{macrocode}
+% \begin{verbatim}
%\newlinechar`\ %
+% \end{verbatim}
+% \begin{macrocode}
\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}
+% \begin{macro}{\@bibdataout@init}
+% \begin{macro}{\@bibdataout@aps}
+% \changes{4.1o}{2010/02/10}{(AO, 580) Provide a document class option to turn off production of eprint field in bibliography.}
+% \changes{4.1o}{2010/02/12}{(AO, 580) Control .bst at run time.}%
+% At \cmd\AtBeginDocument\ time, we open the job's \filename{.bib} file.
+% The hook is available for use by a society to place its own @CONTROL record in the \cmd\@bibdataout\ stream.
+% \begin{macrocode}
+\appdef\class@documenthook{\@bibdataout@init}%
+\def\@bibdataout@init{%
+ \immediate\openout\@bibdataout\pre@bibdata.\bibdata@ext\relax
+ \@bibdataout@rev
+}%
+\def\@bibdataout@rev{%
+ \immediate\write\@bibdataout{%
+% \end{macrocode}
+% The entry that controls processing of the \filename{.bst} file has entry type \texttt{@CONTROL}.
+% The citation key (REVTEX41Control) is effectively a version number,
+% which the \filename{.bst} can use to interpret the bib entry.
+% \begin{macrocode}
+ @CONTROL{%
+ REVTEX41Control%
+% \end{macrocode}
+% Say if we want the \texttt{eprint} field disabled. Otherwise accept the default of the \filename{.bst}.
+% \begin{macrocode}
+ \eprint@enable@sw{}{,eprint=""}%
+ }%
+ }%
+% \end{macrocode}
+% Place a \cmd\citation\ into the auxiliary file corresponding to this entry.
+% \begin{macrocode}
+ \if@filesw
+ \immediate\write\@auxout{\string\citation{REVTEX41Control}}%
+ \fi
+}%
+% \end{macrocode}
% \end{macro}
-%
-% \begin{macro}{\@xendnotenext}
-% \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}
@@ -3711,57 +3975,6 @@ The file \file{template.aps} is a boilerplate file.
\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}
-% \begin{macro}{\set@firstnote}
-%
-% In \revtex, we have permanently altered the way
-% that the footnote counter gets reset at the beginning
-% of the document.
-%
-% 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@
-\appdef\class@documenthook{%
- \global\c@footnote\firstnote@num
- \appdef\maketitle{\global\c@footnote\firstnote@num}%
-}%
-\def\set@firstnote#1{%
- \@ifnum{\firstnote@num=#1\relax}{}{%
- \class@warn@end{Endnote numbers changed: rerun LaTeX}%
- }%
- \immediate\write\@mainaux{%
- \global\mathchardef\string\firstnote@num#1\relax
- }%
-}%
-% \end{macrocode}
-% \end{macro}
% \end{macro}
%
% \begin{macro}{\@endnotesinbib}
@@ -3782,21 +3995,6 @@ The file \file{template.aps} is a boilerplate file.
% 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}
@@ -3851,7 +4049,14 @@ The file \file{template.aps} is a boilerplate file.
% \end{macro}
%
% \begin{macro}{\auto@bib}
+% \begin{macro}{\auto@bib@empty}
+% \begin{macro}{\test@bbl@sw}
+% \begin{macro}{\bibitem@set}
+% \begin{macro}{\auto@bib@innerbib}
+% \begin{macro}{\thebibliography@nogroup}
% \changes{4.1f}{2009/07/10}{(AO, 520) Automatically produce \cs{bibliography} command when needed}%
+% \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
+% \changes{4.1o}{2010/02/02}{(AO, 575) Automatically incorporate the (Bib\TeX-generated) .bbl into an explicit \env{thebibliography}}%
% Under some circumstances, we must typeset the bibliography automatically.
% 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}),
@@ -3870,7 +4075,7 @@ The file \file{template.aps} is a boilerplate file.
\def\auto@bib{%
\@ifx@empty\@FMN@list{%
\footinbib@sw{%
- \@ifnum{\thefootnote>\z@}{%
+ \@ifnum{\csname c@\@mpfn\endcsname>\z@}{%
\true@sw
}{%
\test@bbl@sw
@@ -3885,15 +4090,17 @@ The file \file{template.aps} is a boilerplate file.
\bibliography{}%
}{}%
}%
+\def\auto@bib@empty{%
+ \let\auto@bib\@empty
+}%
% \end{macrocode}
% 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.
+% We provide a new meaning for the \cmd\bibitem\ command: it queues a Boolean.
% \begin{macrocode}
\def\test@bbl@sw{%
- \begingroup
+ \setbox\z@\vbox\bgroup
\let\providecommand\providecommand@j@nk
- \let@environment{thebibliography}{thebibliography@nogroup}%
\let\bibfield\@gobbletwo
\let\bibinfo\@gobbletwo
\let\translation\@gobble
@@ -3908,10 +4115,13 @@ The file \file{template.aps} is a boilerplate file.
\let\emph\@gobble
\@booleanfalse\bibitem@sw
\let\bibitem\bibitem@set
- \setbox\z@\vbox{\IfFileExists {\jobname.bbl}{\@@input\@filef@und}{}}%
+ \auto@bib@innerbib
\bibitem@sw{\aftergroup\true@sw}{\aftergroup\false@sw}%
- \endgroup
+ \egroup
}%
+% \end{macrocode}
+% The \cmd\bibitem@set\ is an alias for \cmd\bibitem\ for the purpose of detecting a non-trivial bibliography.
+% \begin{macrocode}
\newcommand\bibitem@set[1][]{%
\bibitem@sw{}{%
\@booleantrue\bibitem@sw
@@ -3919,6 +4129,25 @@ The file \file{template.aps} is a boilerplate file.
}%
}%
% \end{macrocode}
+% The \cmd\auto@bib@innerbib\ procedure reads in the \filename{.bbl} file (if it exists)
+% within a context where its \env{thebibliography} environment does nothing, not even establishing a group.
+% \begin{macrocode}
+\def\auto@bib@innerbib{%
+ \begingroup
+ \let@environment{thebibliography}{thebibliography@nogroup}%
+ \bibliography{}%
+ \endgroup
+}%
+% \end{macrocode}
+% Environment \env{thebibliography@nogroup} is an alias of the \env{thebibliography} environment that cancels itself.
+% It assumes that it is called within a \env{thebibliography} environment.
+% \begin{macrocode}
+\def\thebibliography@nogroup#1{%
+ \endgroup
+ \def\@currenvir{thebibliography}%
+}%
+\def\endthebibliography@nogroup{\begingroup}%
+% \end{macrocode}
% The following should be part of \filename{ltxutil}.
% \begin{macrocode}
\long\def \@gobblethree #1#2#3{}%
@@ -3932,10 +4161,13 @@ The file \file{template.aps} is a boilerplate file.
}%
}%
}%
-\def\thebibliography@nogroup#1{\endgroup\def\@currenvir{thebibliography}}%
-\def\endthebibliography@nogroup{\begingroup}%
% \end{macrocode}
% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \section{Initial setup}
%
@@ -4079,7 +4311,7 @@ The file \file{template.aps} is a boilerplate file.
% DPC: We're in galley style so do a lob sided display environment.
%
% QUERY: How can we be sure that we are in galley style?
-% ANSWER: as noted elsewhere, require both \cmd\twocolumn@sw\ and \cmd\preprintsty@sw\ to be false.
+% ANSWER: as noted elsewhere, require that both \cmd\twocolumn@sw\ and \cmd\preprintsty@sw\ be false.
% \begin{macrocode}
\def\galley@outdent{\rightmargin-\columnwidth\advance\rightmargin-\columnsep}%
\let\widetext@outdent\@empty
@@ -4114,16 +4346,14 @@ The file \file{template.aps} is a boilerplate file.
% \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,
-% then we return to a two-column page grid in anticipation of the
-% upcoming \cmd\clearpage.
+% we balance columns by switching to the one-column page grid.
% \begin{macrocode}
\def\title@column@grid#1{%
\minipagefootnote@init
\onecolumngrid
\begingroup
\let\@footnotetext\frontmatter@footnotetext
- \let\set@footnotewidth\set@footnotewidth@ii
+%<ignore> \let\set@footnotewidth\set@footnotewidth@two
\ltx@no@footnote
#1%
\endgroup
@@ -4133,7 +4363,7 @@ The file \file{template.aps} is a boilerplate file.
\def\close@column@grid{%
\balancelastpage@sw{%
\onecolumngrid
-% \twocolumngrid
+%<ignore> \twocolumngrid
}{}%
}%
% \end{macrocode}
@@ -4149,34 +4379,39 @@ The file \file{template.aps} is a boilerplate file.
%
% Note that we set adornments above and below the \env{widettext}.
% These are set as leaders, so they will disappear at a page break.
+% \changes{4.1n}{2010/01/02}{(AO) fine-tune spacing above and below widetext}%
% \begin{macrocode}
\newenvironment{widetext@grid}{%
\par\ignorespaces
\setbox\widetext@top\vbox{%
- \vskip15\p@
+%<ignore> \vskip15\p@
\hb@xt@\hsize{%
\leaders\hrule\hfil
\vrule\@height6\p@
}%
- \vskip6\p@
+%<ignore> \vskip6\p@
}%
\setbox\widetext@bot\hb@xt@\hsize{%
\vrule\@depth6\p@
\leaders\hrule\hfil
}%
\onecolumngrid
+ \vskip10\p@
\dimen@\ht\widetext@top\advance\dimen@\dp\widetext@top
\cleaders\box\widetext@top\vskip\dimen@
- \let\set@footnotewidth\set@footnotewidth@ii
+%<ignore> \let\set@footnotewidth\set@footnotewidth@two
+ \vskip6\p@
\prep@math@patch
}{%
\par
+ \vskip6\p@
\setbox\widetext@bot\vbox{%
\hb@xt@\hsize{\hfil\box\widetext@bot}%
- \vskip14\p@
+%<ignore> \vskip14\p@
}%
\dimen@\ht\widetext@bot\advance\dimen@\dp\widetext@bot
\cleaders\box\widetext@bot\vskip\dimen@
+ \vskip8.5\p@
\twocolumngrid\global\@ignoretrue
\@endpetrue
}%
@@ -4190,6 +4425,13 @@ The file \file{template.aps} is a boilerplate file.
% \begin{macrocode}
\def\set@page@grid{%
\twocolumn@sw{%
+% \end{macrocode}
+% The following two assignments determine what procedures are to be executed when
+% the footnote set width is calculated, and how footnotes are to be composed at the bottom of the page.
+% A society or journal wishing to do otherwise will override this code.
+% \begin{macrocode}
+ \let\set@footnotewidth\set@footnotewidth@two
+ \let\compose@footnotes\compose@footnotes@two
\let@environment{widetext}{widetext@grid}%
\let\title@column\title@column@grid
\let\close@column\close@column@grid
@@ -4564,7 +4806,7 @@ The file \file{template.aps} is a boilerplate file.
%
% \section{Patches for lineno.sty}
%
-% The \filename{lineno.sty} package detects the case where the package has been loaded
+% The \classname{lineno} 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.
%
@@ -4591,7 +4833,7 @@ The file \file{template.aps} is a boilerplate file.
% 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},
+% Create the box in a context in which the meaning of \cmd\par\ has been patched by \classname{lineno},
% 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
@@ -4763,26 +5005,26 @@ The file \file{template.aps} is a boilerplate file.
% 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
+%<*ignore>
+ \def\rtx@fin@year{2010}%
+ \def\rtx@fin@month{01}%
+ \def\rtx@fin@day{01}%
+ \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/}%
+ }%
}%
- {%
- \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/}%
- }%
-}%
+%</ignore>
% \end{macrocode}
% 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}%
@@ -5166,8 +5408,10 @@ The file \file{template.aps} is a boilerplate file.
\headsep 16pt
% \end{macrocode}
%
+% \changes{4.1n}{2010/01/02}{(AO, 571) class file must set \cs{splittopskip}; fine tune \cs{skip}\cs{footins}; \cs{footnoterule} defined in terms of \cs{skip}\cs{footins}}%
% \begin{macrocode}
\topskip 10pt
+\splittopskip\topskip
% \end{macrocode}
%
% \begin{macrocode}
@@ -5187,10 +5431,14 @@ The file \file{template.aps} is a boilerplate file.
\columnseprule 0pt
% \end{macrocode}
%
+% \changes{4.1n}{2010/01/02}{(AO, 571) class file must set \cs{splittopskip}; fine tune \cs{skip}\cs{footins}; \cs{footnoterule} defined in terms of \cs{skip}\cs{footins}}%
% \begin{macrocode}
\footnotesep 1pt
-\skip\footins 39pt plus 4pt minus 2pt
-\def\footnoterule{\kern-19pt\hrule width.5in\kern18.6pt\relax}%
+\skip\footins 39pt plus 4pt minus 12pt
+\def\footnoterule{%
+ \dimen@\skip\footins\divide\dimen@\tw@
+ \kern-\dimen@\hrule width.5in\kern\dimen@
+}%
% \end{macrocode}
%
% \begin{macrocode}
@@ -5519,8 +5767,10 @@ The file \file{template.aps} is a boilerplate file.
\headsep 25pt
% \end{macrocode}
%
+% \changes{4.1n}{2010/01/02}{(AO, 571) class file must set \cs{splittopskip}; fine tune \cs{skip}\cs{footins}; \cs{footnoterule} defined in terms of \cs{skip}\cs{footins}}%
% \begin{macrocode}
\topskip 10pt
+\splittopskip\topskip
% \end{macrocode}
%
% \begin{macrocode}
@@ -5550,10 +5800,14 @@ The file \file{template.aps} is a boilerplate file.
\columnseprule 0pt
% \end{macrocode}
%
+% \changes{4.1n}{2010/01/02}{(AO, 571) class file must set \cs{splittopskip}; fine tune \cs{skip}\cs{footins}; \cs{footnoterule} defined in terms of \cs{skip}\cs{footins}}%
% \begin{macrocode}
\footnotesep 1pt
-\skip\footins 25.25pt plus 4pt minus 2pt
-\def\footnoterule{\kern-5.25pt\hrule width.5in\kern4.85pt\relax}
+\skip\footins 25.25pt plus 4pt minus 12pt
+\def\footnoterule{%
+ \dimen@\skip\footins\divide\dimen@\f@ur
+ \kern-\dimen@\hrule width.5in\kern\dimen@
+}%
% \end{macrocode}
%
% \begin{macrocode}
@@ -5711,39 +5965,40 @@ The file \file{template.aps} is a boilerplate file.
% \end{macrocode}
%
% \subsection{Abbreviations}%
+% \changes{4.1p}{2010/02/24}{(AO, 584) Per MD, remove trailing space character from each journal abbreviation: it had caused an extraneous space in the .bbl}
% 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}%
@@ -5901,7 +6156,12 @@ The file \file{template.aps} is a boilerplate file.
\def\frontmatter@abstractwidth{\textwidth}%
\def\frontmatter@affiliationfont{\it}%
\let\section\section@preprintsty
+% \end{macrocode}
+% The following line of code had been commented out at this point.
+% \begin{verbatim}
% \let\@hangfrom@section\@hangfrom@section@preprintsty
+% \end{verbatim}
+% \begin{macrocode}
\let\subsection\subsection@preprintsty
\let\subsubsection\subsubsection@preprintsty
}{%
@@ -5925,9 +6185,14 @@ The file \file{template.aps} is a boilerplate file.
\advance\baselineskip\p@
\parskip11.5\p@\relax
\@flushglue\skip@
+% \end{macrocode}
+% The following line of code had been commented out at this point.
+% \begin{verbatim}
%\preprintsty@sw{}{%
% \addvspace{0\p@}%
%}%
+% \end{verbatim}
+% \begin{macrocode}
}%
% \end{macrocode}
% \end{macro}
@@ -5937,9 +6202,14 @@ The file \file{template.aps} is a boilerplate file.
% APS Journals have 24 points b-b above an affiliation group.
% \begin{macrocode}
\def\frontmatter@above@affilgroup{%
+% \end{macrocode}
+% The following line of code had been commented out at this point.
+% \begin{verbatim}
%\preprintsty@sw{}{%
% \addvspace{11\p@}%
%}%
+% \end{verbatim}
+% \begin{macrocode}
}%
% \end{macrocode}
% \end{macro}
@@ -5958,7 +6228,12 @@ The file \file{template.aps} is a boilerplate file.
}%
\def\frontmatter@above@affiliation{%
\preprintsty@sw{}{%
+% \end{macrocode}
+% The following line of code had been commented out at this point.
+% \begin{verbatim}
% \addvspace{12\p@}%
+% \end{verbatim}
+% \begin{macrocode}
}%
}%
% \end{macrocode}
@@ -6035,7 +6310,12 @@ The file \file{template.aps} is a boilerplate file.
\def\frontmatter@RRAP@format{%
\small
\centering
+% \end{macrocode}
+% The following line of code had been commented out at this point.
+% \begin{verbatim}
% \preprintsty@sw{}{\parskip.5ex\relax}%
+% \end{verbatim}
+% \begin{macrocode}
\everypar{\hbox\bgroup(\@gobble@leavemode@uppercase}%
\def\par{\@ifvmode{}{\unskip)\egroup\@@par}}%
}%
@@ -6367,10 +6647,9 @@ The file \file{template.aps} is a boilerplate file.
%
% \subsubsection{Default column bottom}%
% All APS journal styles have flush bottoms.
-%
-% APS journals may set with ragged bottoms.
+%\changes{4.1n}{2009/11/30}{(AO, 566) restore 4.0 behavior: flush column bottoms}
% \begin{macrocode}
-\@booleantrue\raggedcolumn@sw
+\@booleanfalse\raggedcolumn@sw
% \end{macrocode}
%
%
@@ -6398,10 +6677,11 @@ The file \file{template.aps} is a boilerplate file.
%
%
% \subsubsection{Footnote formatting}%
+% \changes{4.1n}{2010/01/02}{(AO, 572) \cs{@makefntext} and \cs{frontmatter@makefntext} must be defined harmoniously}%
% We customize the formatting of footnotes for all APS journals.
% \begin{macro}{\@makefntext}
% \begin{macrocode}
-\def\@makefntext#1{%
+\long\def\@makefntext#1{%
\def\baselinestretch{1}%
\leftskip1em%
\parindent1em%
@@ -6415,6 +6695,26 @@ The file \file{template.aps} is a boilerplate file.
}%
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\frontmatter@makefntext}
+% We ensure that frontmatter footnotes format similarly to body footnotes.
+% But we provide our own hypertext anchor, otherwise not provided.
+% \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
+% \begin{macrocode}
+\long\def\frontmatter@makefntext#1{%
+ \def\baselinestretch{1}%
+ \leftskip1em%
+ \parindent1em%
+ \noindent
+ \nobreak\hskip-\leftskip
+ \Hy@raisedlink{\hyper@anchorstart{frontmatter.\expandafter\the\csname c@\@mpfn\endcsname}\hyper@anchorend}%
+ \hb@xt@\leftskip{%
+ \hss\@makefnmark\ %
+ }%
+ #1%
+ \par
+}%
+% \end{macrocode}
+% \end{macro}
%
%
% \subsubsection{Appendix}%
@@ -6449,11 +6749,11 @@ The file \file{template.aps} is a boilerplate file.
% \end{macro}
%
% \subsubsection{Bibliography}%
+% \changes{4.1n}{2010/01/04}{(AO, 576) In .bst files, remove support for the annote field}%
%
% Customize \revtex\ for the journal substyle;
% this task requires three components:
-% the \BibTeX\ \file{apsrev.bst} and \file{apsrmp.bst} style files,
-% customizing code for \file{natbib}, and
+% the \BibTeX\ \file{apsrev.bst} and \file{apsrmp.bst} style files, and
% customizations of the \env{thebibliography} environment.
%
% \begin{macro}{\@bibstyle}
@@ -6470,7 +6770,6 @@ The file \file{template.aps} is a boilerplate file.
% \def\CandE#1{\item\relax\texttt{#1}---}%
% \begin{enumerate}
% \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)
@@ -6546,7 +6845,7 @@ The file \file{template.aps} is a boilerplate file.
%\input docstrip
%\preamble
%----------------------------------------
-%*** REVTeX-compatible Phys Rev 2009-10-08 ***
+%*** REVTeX-compatible Phys Rev 2010-02-12 ***
%\endpreamble
%\postamble
%End of customized bst file
@@ -6560,10 +6859,11 @@ The file \file{template.aps} is a boilerplate file.
%\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
-% seq-no,%: Citation order (unsorted, like unsrt.bst)
+% seq-no,%: Citation order (unsorted, only meaningful for numericals)
% 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.
@@ -6573,7 +6873,10 @@ The file \file{template.aps} is a boilerplate file.
% 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)
+% keyxyr,%: Year blank when KEY replaces missing author (for natbib 7.0)
+% blkyear,%: Missing date left blank
+% yr-par,%: Year in parentheses as (1993)
+% dtrev,%: Date as year month
% 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
@@ -6637,17 +6940,19 @@ The file \file{template.aps} is a boilerplate file.
% 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.
+% Remove \texttt{jpg-1}. This means full page range.
% \item
-% Add \texttt{article-title-o}: article title is not required.
+% Remove \texttt{jtit-x}, and add \texttt{article-title-o}: article title is accepted, but not required.
% \item
% Remove \texttt{nm-init}. This means full names.
% \item
+% Add \texttt{note-yr}. This means year field produced in full.
+% \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}
+% \subsubsection{Comparing apsrev.bst and apsrmp.bst}\label{sec:CompRevRmp}
% These two bibliographic styles differ as follows:
% \file{apsrev.dbj} has the following guard codes, which \file{apsrmp.dbj} does not:
% \begin{itemize}
@@ -6655,8 +6960,8 @@ The file \file{template.aps} is a boilerplate file.
% 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{blkyear}%
+% Missing date left blank
% \CandE{date-nil-x}%
% If date is empty, then do not produce the surrounding punctuation (parens, brackets, colon, comma)
% \CandE{inproceedings-chapter}%
@@ -6664,22 +6969,33 @@ The file \file{template.aps} is a boilerplate file.
% \CandE{techreport-institution-par}%
% format tech report institution like book publisher
% \CandE{vnum-x}%
-% Journal vol, without number as 34
+% 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 ')
+% Edition, publisher, volume, chapter, pages. Note that both use guard code pre-edn.
% \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$}
-% \end{verbatim}
-% and invoke \texttt{banner.log} from within \texttt{begin.bib}
+% \file{apsrmp.dbj} has the following guard codes, which \file{apsrev.dbj} does not:
+% \begin{itemize}
+% \CandE{nm-rev1}%
+% Only first name reversed, initials (AGU style: Smith, J. F., H. K. Jones)
+% \CandE{dt-beg}%
+% Date after authors
+% \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}
%
% We ensure that the journal substyle has the first word
% in the matter by installing the (default) APS code
@@ -7048,6 +7364,11 @@ The file \file{template.aps} is a boilerplate file.
% \begin{macrocode}
\rtx@apsprb
% \end{macrocode}
+% Per Mark Doyle (2009-12-22), the default is longbibliography.
+% \changes{4.1n}{2010/01/04}{(AO, 575) the default for journal prstper is longbibliography}%
+% \begin{macrocode}
+ \@booleantrue\longbibliography@sw
+% \end{macrocode}
%
% ``Section heads are bold, centered (Roman numeral, Latin letter)''
%
@@ -7079,6 +7400,46 @@ The file \file{template.aps} is a boilerplate file.
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\@bibdataout@init}
+% \begin{macro}{\@bibdataout@aps}
+% \changes{4.1o}{2010/02/12}{(AO, 580) Control .bst at run time.}%
+% Procedure \cmd\@bibdataout@aps\ has the job of writing the control record into the
+% job's \cmd\jobname\filename{.bib} file, where it will adjust the options to \filename{.bst} processing.
+% It is installed into the initialization procedure \cmd\@bibdataout@init, and its meaning
+% is set by the society (APS) and journal.
+% For all but RMP, we select the Physical Review style.
+% For the latter case, we change the meaning, per the code in \file{apsrmp.rtx}.
+%
+% \begin{macrocode}
+\appdef\@bibdataout@init{\@bibdataout@aps}%
+\def\@bibdataout@aps{%
+ \immediate\write\@bibdataout{%
+% \end{macrocode}
+% An entry that controls processing of the \filename{.bst} file has entry type \texttt{@CONTROL}.
+% \begin{macrocode}
+ @CONTROL{%
+ apsrev41Control%
+% \end{macrocode}
+% Say whether we want long bibliography style (the default), or the abbreviated style.
+% \begin{macrocode}
+ \longbibliography@sw{%
+ ,author="00",editor="1",pages="1",title="0",year="0"%
+ }{%
+ ,author="08",editor="1",pages="0",title="",year="1"%
+ }%
+ }%
+ }%
+% \end{macrocode}
+% Place a \cmd\citation\ into the auxiliary file corresponding to this entry.
+% \begin{macrocode}
+ \if@filesw
+ \immediate\write\@auxout{\string\citation{apsrev41Control}}%
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\place@bibnumber}
% \begin{macro}{\@bibstyle}
% We install code that will select the presentation for \cmd\bibitem s
@@ -7086,12 +7447,14 @@ The file \file{template.aps} is a boilerplate file.
% \begin{macrocode}
\let\place@bibnumber\place@bibnumber@inl
\def\@bibstyle{apsrev\substyle@post}%
-\appdef\setup@hook{%
- \longbibliography@sw{%
- \appdef\@bibstyle{long}%
- }{}%
-}%
% \end{macrocode}
+% \begin{verbatim}
+%\appdef\setup@hook{%
+% \longbibliography@sw{%
+% \appdef\@bibstyle{long}%
+% }{}%
+%}%
+% \end{verbatim}
% \end{macro}
% \end{macro}
%
@@ -7361,10 +7724,14 @@ The file \file{template.aps} is a boilerplate file.
% \end{macrocode}
%
% Footnote mods:
+% \changes{4.1n}{2010/01/02}{(AO, 571) class file must set \cs{splittopskip}; fine tune \cs{skip}\cs{footins}; \cs{footnoterule} defined in terms of \cs{skip}\cs{footins}}%
% \begin{macrocode}
\footnotesep 9.25pt
- \skip\footins 36pt plus 4pt minus 2pt
- \def\footnoterule{\kern-13pt\hrule width.5in\kern15.6pt\relax}%
+ \skip\footins 36pt plus 4pt minus 12pt
+ \def\footnoterule{%
+ \dimen@\skip\footins\divide\dimen@\thr@@
+ \kern-\dimen@\hrule width.5in\kern\dimen@
+ }%
% \end{macrocode}
%
%
@@ -7533,7 +7900,6 @@ The file \file{template.aps} is a boilerplate file.
% \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)
@@ -7611,7 +7977,7 @@ The file \file{template.aps} is a boilerplate file.
%\input docstrip
%\preamble
%----------------------------------------
-%*** REVTeX-compatible RMP 2009-10-08 ***
+%*** REVTeX-compatible RMP 2010-02-12 ***
%\endpreamble
%\postamble
%End of customized bst file
@@ -7628,7 +7994,6 @@ The file \file{template.aps} is a boilerplate file.
% 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)
@@ -7641,11 +8006,9 @@ The file \file{template.aps} is a boilerplate file.
% 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
+% yr-par,%: Year in parentheses as (1993)
% 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
@@ -7712,49 +8075,18 @@ The file \file{template.aps} is a boilerplate file.
% 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.
+% Remove \texttt{jpg-1}. This means full page range.
+% \item
+% Remove \texttt{jtit-x}, and add \texttt{article-title-o}: article title is accepted, but not required.
+% \item
+% Remove \texttt{nm-revv1}, and add \texttt{nm-rev1}. This means full author names, with first author reversed.
% \item
-% Add \texttt{article-title-o}: article title is optional.
+% Add \texttt{note-yr}. This means year field produced in full.
% \item
-% Remove \texttt{nm-rev1}, remove \texttt{nm-revv1}. This means full author names.
+% The file to be \cmd\generate d is \filename{apsrmp4-1long.bst} instead of \filename{apsrmp4-1.bst}.
% \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}
-%
+% For a comparison between apsrmp.bst and apsrev.bst, see Section~\ref{sec:CompRevRmp}.
%
% \changes{4.1c}{2008/08/15}{Document class option longbibliography via \cs{substyle@post}}
% \begin{macrocode}
@@ -7770,11 +8102,36 @@ The file \file{template.aps} is a boilerplate file.
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\cite}
-% Per Mark Doyle, \cmd\cite\ is mapped to \cmd\citep\ in RMP.
-%
+% \begin{macro}{\@bibdataout@rmp}
+% \changes{4.1o}{2010/02/12}{(AO, 580) Control .bst at run time.}%
+% When the journal is RMP, the meaning of the procedure \cmd\@bibdataout@aps\ needs to be different
+% because of the way the author names are formatted. In other respects, it is the same.
% \begin{macrocode}
-\let\cite\citep
+\def\@bibdataout@aps{%
+ \immediate\write\@bibdataout{%
+% \end{macrocode}
+% An entry that controls processing of the \filename{.bst} file has entry type \texttt{@CONTROL}.
+% This entry's cite key is \texttt{apsrmp41Control}, which serves as a version number.
+% \begin{macrocode}
+ @CONTROL{%
+ apsrmp41Control%
+% \end{macrocode}
+% Say whether we want long bibliography style (the default), or the abbreviated style.
+% \begin{macrocode}
+ \longbibliography@sw{%
+ ,author="03",editor="0",pages="1",title="0",year="0"%
+ }{%
+ ,author="0B",editor="0",pages="0",title="",year="1"%
+ }%
+ }%
+ }%
+% \end{macrocode}
+% Place a \cmd\citation\ into the auxiliary file corresponding to this entry.
+% \begin{macrocode}
+ \if@filesw
+ \immediate\write\@auxout{\string\citation{apsrmp41Control}}%
+ \fi
+}%
% \end{macrocode}
% \end{macro}
%
@@ -7784,6 +8141,7 @@ The file \file{template.aps} is a boilerplate file.
% \begin{macro}{\newblock}
% \begin{macro}{\bibhang}
% \begin{macro}{\bibsep}
+% \begin{macro}{\cite}
% 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.
@@ -7817,7 +8175,9 @@ The file \file{template.aps} is a boilerplate file.
% We define the punctuation to use in the \cmd\cite\ command's production.
%
% \begin{macrocode}
- \bibpunct{(}{)}{;}{a}{,}{,}%
+ \bibpunct{(%)
+ }{%(
+ )}{;}{a}{,}{,}%
% \end{macrocode}
%
% We define the sectioning command to use when starting the bibliography.
@@ -7831,6 +8191,16 @@ The file \file{template.aps} is a boilerplate file.
\def\newblock{\ }%
\bibhang10\p@
\bibsep\z@
+% \end{macrocode}
+%
+% Per Mark Doyle, \cmd\cite\ is mapped to \cmd\citep\ in RMP.
+% \changes{4.1i}{2009/10/23}{(AO, 541) Defer assignment of \cs{cite} until after natbib loads}
+% \begin{macrocode}
+ \let\cite\citep
+% \end{macrocode}
+%
+% End of code to be delayed until after \classname{natbib} loads.
+% \begin{macrocode}
}%
% \end{macrocode}
% \end{macro}
@@ -7839,6 +8209,7 @@ The file \file{template.aps} is a boilerplate file.
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\footinbib@sw}
% Footnotes in bibliography are consistent only with numbered citations,