Debian Codegraph @

texmf-dist/source/latex/revtex/ltxfront.dtx

raw
1 % \iffalse meta-comment balanced on line 108
2 % ltxfront.dtx: package to change page grid, MVL.
3 % Copyright (c) 2009 Arthur Ogawa
4 %
5 % Disclaimer
6 % This file is distributed WITHOUT ANY WARRANTY;
7 % without even the implied warranty of
8 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9 % License
10 % You may distribute this file under the conditions of the
11 % LaTeX Project Public License 1.3c or later
12 % (http://www.latex-project.org/lppl.txt).
13 % ReadMe
14 % For the documentation and more detailed instructions for
15 % installation, typeset this document with \LaTeX.
16 % Maintenance Status
17 % This work has the LPPL maintenance status "maintained";
18 % Current Maintainer of this work is Arthur Ogawa.
19 %
20 % This work consists of the main source file ltxfront.dtx
21 % and the derived files
22 % ltxfront.sty, ltxfront.pdf
23 % Distribution:
24 % CTAN:macros/latex/contrib/revtex/
25 %
26 % Unpacking:
27 % tex ltxfront.dtx
28 %
29 % Documentation:
30 % latex ltxfront.dtx; ...
31 %
32 % Programm calls to get the documentation (example):
33 % pdflatex ltxfront.dtx
34 % makeindex -s gind.ist ltxfront.idx
35 % makeindex -s gglo.ist -o ltxfront.gls ltxfront.glo
36 % pdflatex ltxfront.dtx
37 % makeindex -s gind.ist ltxfront.idx
38 % pdflatex ltxfront.dtx
39 %
40 % Installation:
41 % TDS:doc/latex/revtex/
42 % TDS:source/latex/revtex/
43 % TDS:tex/latex/revtex/
44 %
45 % Thanks, Heiko!
46 % This method of letting a single .dtx file serve as both
47 % documentation (via latex) and installer (via tex) follows
48 % the example of Heiko Oberdiek. Thanks!
49 %<*ignore>
50 \begingroup
51 \def\x{LaTeX2e}%
52 \expandafter\endgroup
53 \ifcase
54 0\expandafter\ifx\csname processbatchFile\endcsname\relax\else1\fi\ifx\fmtname\x\else 1\fi
55 \relax
56 \else
57 \csname fi\endcsname
58 %</ignore>
59 %<*install>
60 %% This file will generate documentation and runtime files
61 %% from ltxfront.dtx when run through LaTeX or TeX.
62 \input docstrip
63 \preamble
64
65 This is a generated file;
66 altering it directly is inadvisable;
67 instead, modify the original source file.
68 See the URL in the file README-LTXFRONT.tex.
69
70 License
71 You may distribute this file under the conditions of the
72 LaTeX Project Public License 1.3c or later
73 (http://www.latex-project.org/lppl.txt).
74
75 This file is distributed WITHOUT ANY WARRANTY;
76 without even the implied warranty of MERCHANTABILITY
77 or FITNESS FOR A PARTICULAR PURPOSE.
78
79 \endpreamble
80 \askforoverwritefalse
81 \keepsilent
82 \generate{%
83 %{ignore}
84 % \usedir{tex/latex/revtex}%
85 \file{ltxfront.sty}{%
86 \from{ltxfront.dtx}{package,options,kernel}%
87 }%
88 }%
89 \ifToplevel{
90 \Msg{***********************************************************}
91 \Msg{*}
92 \Msg{* To finish the installation, please move}
93 \Msg{* ltxfront.sty}
94 \Msg{* into a directory searched by TeX;}
95 \Msg{* in a TDS-compliant installation:}
96 \Msg{* texmf/tex/macros/latex/revtex/.}
97 \Msg{*}
98 \Msg{* To produce the documentation,
99 run ltxfront.dtx through LaTeX.}
100 \Msg{*}
101 \Msg{* Happy TeXing}
102 \Msg{***********************************************************}
103 }
104 \endbatchfile
105 %</install>
106 %<*ignore>
107 \fi
108 %</ignore>
109 % \fi
110 %
111 % \GetFileInfo{ltxfront.dtx}
112 %
113 % \iffalse ltxdoc klootch
114 %<*package>
115 %%% @LaTeX-file{
116 %%% filename = "ltxfront.dtx",
117 %%% version = "4.2f",
118 %%% date = "2022/06/05",
119 %%% author = "Arthur Ogawa (mailto:arthur_ogawa at sbcglobal.net),
120 %%% commissioned by the American Physical Society.
121 %%% ",
122 %%% copyright = "Copyright (C) 1999, 2009 Arthur Ogawa,
123 %%% distributed under the terms of the
124 %%% LaTeX Project Public License 1.3c, see
125 %%% ftp://ctan.tug.org/macros/latex/base/lppl.txt
126 %%% ",
127 %%% address = "Arthur Ogawa,
128 %%% USA",
129 %%% telephone = "",
130 %%% FAX = "",
131 %%% email = "mailto colon arthur_ogawa at sbcglobal.net",
132 %%% codetable = "ISO/ASCII",
133 %%% keywords = "latex, page grid, main vertical list",
134 %%% supported = "yes",
135 %%% abstract = "package to change page grid, MVL",
136 %%% }
137 %</package>
138 % \fi
139 %
140 % \iffalse ltxdoc klootch
141 % The following references the \file{README-LTXFRONT} file,
142 % which contains basic information about this package.
143 % The contents of this file are generated when
144 % you typeset the programmer's documentation.
145 % Search on "{filecontents*}{README-LTXFRONT.tex}" to locate it.
146 % \fi\input{README-LTXFRONT}%
147 %
148 % \subsection{Bill of Materials}
149 %
150 % Following is a list of the files in this distribution arranged
151 % according to provenance.
152 %
153 % \subsubsection{Primary Source}%
154 % One single file generates all.
155 %\begin{verbatim}ltxfront.dtx\end{verbatim}
156 %
157 % \subsubsection{Generated by \texttt{latex ltxfront.dtx}}%
158 % Typesetting the source file under \LaTeX\
159 % generates the readme and the documentation.
160 %\begin{verbatim}README-LTXFRONT\end{verbatim}
161 %
162 % \subsubsection{Generated by \texttt{tex ltxfront.dtx}}%
163 % Typesetting the installer generates
164 % the package files.
165 %\begin{verbatim}ltxfront.sty\end{verbatim}
166 %
167 % \subsubsection{Documentation}%
168 % The following are the online documentation:
169 % \begin{verbatim}ltxfront.pdf\end{verbatim}
170 %
171 % \subsubsection{Auxiliary}%
172 % The following are auxiliary files generated
173 % in the course of running \LaTeX:
174 % \begin{verbatim}ltxfront.aux ltxfront.idx ltxfront.ind ltxfront.log ltxfront.toc\end{verbatim}
175 %
176 % \section{Code common to all modules}%
177 %
178 % We want to require only one place in this file
179 % where the version number is stated,
180 % and we also want to ensure that the version
181 % number is embedded into every generated file.
182 %
183 % Now we declare that
184 % these files can only be used with \LaTeXe.
185 % An appropriate message is displayed if
186 % a different \TeX{} format is used.
187 % \begin{macrocode}
188 %<*doc|package>
189 \NeedsTeXFormat{LaTeX2e}[1995/12/01]%
190 %</doc|package>
191 % \end{macrocode}
192 % As desired, the following modules all
193 % take common version information:
194 % \begin{macrocode}
195 %<kernel&!package&!doc>\typeout{%
196 %<*package|doc>
197 \ProvidesFile{%
198 %</package|doc>
199 %<*kernel|package|doc>
200 ltxfront%
201 %</kernel|package|doc>
202 %<*doc>
203 .dtx%
204 %</doc>
205 %<package>.sty%
206 %<*package|doc>
207 }%
208 %</package|doc>
209 % \end{macrocode}
210 %
211 % The following line contains, for once and for all,
212 % the version and date information.
213 % By various means, this information is reproduced
214 % consistently in all generated files and in the
215 % typeset documentation.
216 % \begin{macrocode}
217 %<*doc|package|kernel>
218 %<version>
219 [2022/06/05 4.2f frontmatter package (AO,DPC,MD)]% \fileversion
220 %</doc|package|kernel>
221 %<kernel&!package&!doc>}%
222 % \end{macrocode}
223 %
224 %
225 % \section{The doc module \texttt{doc}}
226 %
227 % This module, consisting of the present section,
228 % typesets the programmer's documentation,
229 % generating the \file{README-LTXFRONT} and sample document as needed.
230 %
231 % Because the only uncommented-out lines of code at the beginning of
232 % this file constitute the \file{doc} module itself,
233 % we can simply typeset the \file{.dtx} file directly,
234 % and there is thus rarely any need to
235 % generate the ``doc'' {\sc docstrip} module.
236 % Module delimiters are nonetheless required so that
237 % this code does not find its way into the other modules.
238 %
239 % The \enve{document} command concludes the typesetting run.
240 %
241 % \begin{macrocode}
242 %<*doc>
243 % \end{macrocode}
244 %
245 % \subsection{The Preamble}
246 % The programmers documentation is formatted
247 % with the \classname{ltxdoc} class with local customizations,
248 % and with the usual code line indexing.
249 % \begin{macrocode}
250 \documentclass{ltxdoc}
251 \RequirePackage{ltxdocext}%
252 \let\url\undefined
253 \RequirePackage[colorlinks=true,linkcolor=blue]{hyperref}%
254 %\expandafter\ifx\csname package@font\endcsname\@undefined\else
255 % \expandafter\RequirePackage\expandafter{\csname package@font\endcsname}%
256 %\fi
257 \CodelineIndex\EnableCrossrefs % makeindex -s gind.ist ltxfront
258 \RecordChanges % makeindex -s gglo.ist -o ltxfront.gls ltxfront.glo
259 % \end{macrocode}
260 %
261 % \subsubsection{Docstrip and info directives}
262 % We use so many {\sc docstrip} modules that we set the
263 % \texttt{StandardModuleDepth} counter to 1.
264 % \begin{macrocode}
265 \setcounter{StandardModuleDepth}{1}
266 % \end{macrocode}
267 % The following command retrieves the date and version information
268 % from this file.
269 % \begin{macrocode}
270 \expandafter\GetFileInfo\expandafter{\jobname.dtx}%
271 % \end{macrocode}
272 %
273 % \subsection{The ``Read Me'' File}
274 % As promised above, here is the contents of the
275 % ``Read Me'' file. That file serves a double purpose,
276 % since it also constitutes the beginining of the
277 % programmer's documentation. What better thing, after
278 % all, to have appear at the beginning of the
279 % typeset documentation?
280 %
281 % A good discussion of how to write a ReadMe file can be found in
282 % Engst, Tonya, ``Writing a ReadMe File? Read This''
283 % \emph{MacTech} October 1998, p. 58.
284 %
285 % Note the appearance of the
286 % \cmd\StopEventually\ command, which marks the
287 % dividing line between the user documentation
288 % and the programmer documentation.
289 %
290 % The usual user will not be asked to
291 % do a full build, not to speak
292 % of the bootstrap.
293 % Instructions for carrying these processes
294 % begin the programmer's manual.
295 %
296 % \begin{macrocode}
297 \begin{filecontents*}{README-LTXFRONT.tex}
298 \title{%
299 A \LaTeX\ Package for\\the frontmatter and title page%
300 \thanks{%
301 This file has version number \fileversion,
302 last revised \filedate.%
303 }%
304 \thanks{%
305 Version \fileversion\ \copyright\ 2019 American Physical Society
306 }%
307 }%
308
309 \author{%
310 Arthur Ogawa%
311 \thanks{\texttt{mailto:arthur\_ogawa at sbcglobal.net}}%
312 }%
313 %\iffalse
314 % For version number and date,
315 % search on "\fileversion" in the .dtx file,
316 % or see the end of the README-LTXFRONT file.
317 %\fi
318 \maketitle
319
320 This file embodies the \classname{ltxfront} package,
321 the implementation and its user documentation.
322
323 The distribution point for this work is
324 \url{https://journals.aps.org/revtex},
325 which contains fully unpacked, prebuilt runtime files and documentation.
326
327 The \classname{ltxfront} package was commissioned by the American Physical Society
328 and is distributed under the terms of the \LaTeX\ Project Public License 1.3c,
329 the same license under which all the portions of \LaTeX\ itself is distributed.
330 Please see \url{http://ctan.tug.org/macros/latex/base/lppl.txt} for details.
331
332 To use this document class, you must have a working
333 \TeX\ installation equipped with \LaTeXe\
334 and possibly pdftex and Adobe Acrobat Reader or equivalent.
335
336 To install, retrieve the distribution,
337 unpack it into a directory on the target computer,
338 and move the file \file{ltxfront.sty}
339 into a location in your filesystem where it will be found by \LaTeX.
340
341 To use, read the user documentation \file{ltxfront.pdf}.
342
343 \tableofcontents
344
345 \section{Processing Instructions}
346
347 The package file \file{ltxfront.sty}
348 is generated from this file, \file{ltxfront.dtx},
349 using the {\sc docstrip} facility of \LaTeX
350 via |tex ltxfront.dtx|.
351 The typeset documentation that you are now reading is generated from
352 the same file by typesetting it with \LaTeX\ or pdftex
353 via |latex ltxfront.dtx| or |pdflatex ltxfront.dtx|.
354
355 \subsection{Build Instructions}
356
357 You may bootstrap this suite of files solely from \file{ltxfront.dtx}.
358 Prepare by installing \LaTeXe\ (and either tex or pdftex) on your computer,
359 then carry out the following steps:
360 \begin{enumerate}
361
362 \item
363 Within an otherwise empty directory,
364 typeset \file{ltxfront.dtx} with \TeX\ or pdftex,
365 thereby generating the package file \file{ltxfront.sty}.
366
367 \item
368 Next typeset \file{ltxfront.dtx} with \LaTeX\ or pdflatex;
369 you will obtain the typeset documentation you are now reading,
370 along with
371 the sample document \file{ltxfront-test.tex}
372 and the file \file{README-LTXFRONT}.
373
374 Note: you will have to run \LaTeX, then
375 \file{makeindex} \texttt{-s gind.ist ltxfront.idx}, then
376 \file{makeindex} \texttt{-s gglo.ist -o ltxfront.gls ltxfront.glo}, then
377 \LaTeX\ again in order to obtain a valid index and table of contents.
378 \item
379 Now typeset \file{ltxfront.dtx} with \TeX (not \LaTeX),
380 thereby generating the package file \file{ltxfront.sty}.
381 \item
382 Install the following files into indicated locations within your
383 TDS-compliant \texttt{texmf} tree (you may need root access):
384 \begin{itemize}
385 \item
386 \file{$TEXMF/}\file{tex/}\file{latex/}\file{revtex/}\classname{ltxfront.sty}
387 \item
388 \file{$TEXMF/}\file{source/}\file{latex/}\file{revtex/}\classname{ltxfront.dtx}
389 \item
390 \file{$TEXMF/}\file{doc/}\file{latex/}\file{revtex/}\classname{ltxfront.pdf}
391 \end{itemize}
392 where \file{$TEXMF/} stands for \file{texmf-local/}, or some other \texttt{texmf} tree
393 in your installation.
394 \item
395 Run \texttt{mktexlsr} on \file{$TEXMF/} (you may need root access).
396 \item
397 Build and installation are now complete;
398 now put a \cmd\usepackage\texttt{\{ltxfront\}} in your document preamble!
399 \end{enumerate}
400
401 \subsection{Change Log}
402 \changes{4.0b}{1999/06/20}{Change handling of \cs{@author} to prevent parsing problems. (Helps in error recovery when syntax errors exist)}
403 \changes{4.0b}{1999/06/20}{Gathered all code for the abstract environment together and abstracted out the formatting details for journals to override.}
404 \changes{4.0b}{1999/06/20}{Separate option now controls production}
405 \changes{4.0b}{1999/06/20}{Set \cs{footnote} to \LaTeX\ standard version for this scope.}
406 \changes{4.0c}{1999/11/13}{grid changes with ltxgrid}
407 \changes{4.0d}{1998/01/31}{\cs{comma@space}}
408 \changes{4.0d}{1998/01/31}{change name from \cs{tempaffiliation}}
409 \changes{4.0d}{1998/01/31}{hookify}
410 \changes{4.0d}{1998/01/31}{If empty \cs{abstractname} omit spacing}
411 \changes{4.0d}{1998/01/31}{PACS boxed to width of abstract}
412 \changes{4.0e}{2000/09/20}{Keywords on same footing as PACS}
413 \changes{4.0e}{2000/09/20}{Warn if no production}
414 \changes{4.0f}{2001/02/13}{Actually append \cs{AU@grp} to \cs{@AAClist}.}
415 \changes{4.0g}{1998/06/10}{multiple preprint commands}
416 \changes{4.0h}{1998/06/25}{Changes to support groups of affiliations}
417 \changes{4.0h}{1998/06/25}{new hook}
418 \changes{4.0l}{1998/09/01}{add optional argument handling back}
419 \changes{4.0l}{1998/09/01}{Changes to add collaboration processing, which now means doing comma/and processing on each sublist}
420 \changes{4.0l}{1998/09/01}{macro added}
421 \changes{4.1a}{2008-06-30}{(AO, 443) create an entry in the PDF bookmarks for the abstract via the toc}
422 \changes{4.1a}{2008-07-01}{(AO, 496) remove default prependation to \cs{email}.}
423 \changes{4.1a}{2008-07-01}{(AO, 496) remove default prependation to \cs{homepage}.}
424 \changes{4.1a}{2008/06/16}{removed code that had been commented out}
425 \changes{4.1b}{2008/06/29}{(AO, 455) provide a \texttt{description} environment for the abstract}
426 \changes{4.1b}{2008/08/02}{(AO, 486) \cs{collaboration} to work with \texttt{groupedaddress}}
427 \changes{4.1b}{2008/08/02}{Change csname \cs{AFS@opr} to \cs{AFG@opr}}
428 \changes{4.1b}{2008/08/02}{Make the syntax of this package switch optional}%
429 \changes{4.1b}{2008/08/02}{Provide for diagnostics via \cs{frontmatterverbose@sw}}
430 \changes{4.1b}{2008/08/02}{Use \cs{@affil@def} for all access to \cs{@affil}}
431 \changes{4.1b}{2008/08/02}{Use \cs{frontmatter@init} as the vehicle for all initialization}
432 \changes{4.1b}{2008/08/04}{(AO, 443) PDF Bookmark for title page}%
433 \changes{4.1b}{2008/08/04}{Provide facility \cs{affil@cutoff}: if there is only one affiliation on the title page, no superscript}%
434 \changes{4.1c}{2008/08/04}{Hyperref compatibility: take \cs{maketitle} back.}
435 \changes{4.1c}{2008/08/04}{Parametrize the production after the address}%
436 \changes{4.1c}{2008/08/04}{Produce PACS, keywords only if specified}%
437 \changes{4.1d}{2008/10/17}{(AO, 410) compare \cs{@tempa} to \cs{blankaffiliation}.}%
438 \changes{4.1f}{2009/07/07}{(AO, 515) Use \cs{set@footnotefont}, which is defined in ltxutil}
439 \changes{4.1g}{2009/10/05}{(AO, 535) Robustify \cs{footnote} while \cs{class@warn} is expanding its argument}
440 \changes{4.1g}{2009/10/05}{(AO, 539) Robustify \cs{class@warn} against TOC processing}%
441 \changes{4.1i}{2009/10/18}{(AO, 540) More runtime diagnostics via \cs{frontmatterverbose@sw}}
442 \changes{4.1i}{2009/10/23}{(AO, 540) Rationalize code that appends to \cs{AF@grp}}
443 \changes{4.1i}{2009/10/23}{(AO, 540) Optimize boolean logic }
444 \changes{4.1i}{2009/10/23}{(AO, 544) Class options runinaddress and unsortedaddress stopped working}
445 \changes{4.1m}{2009/11/20}{(AO, 563) \cs{collaboration} to work with both \texttt{groupedaddress} and \texttt{superscriptaddress}}
446 \changes{4.1m}{2009/11/20}{(AO, 563) More complete runtime diagnostics via \cs{frontmatterverbose@sw}}
447 \changes{4.1m}{2009/11/20}{(AO, 563) Let \cs{@collaboration@gobble} parse all three arguments of \cs{CO@opr}}
448 \changes{4.1n}{2009/11/30}{(AO, 567) Handle \cs{noaffiliation} case}
449 \changes{4.1n}{2009/11/30}{(AO, 567) Handle punctuation for \classoption{superscriptaddress} style authors' extra information, such as \cs{email}}
450 \changes{4.1n}{2009/12/03}{(AO) remove http:// from \cs{href} call}
451 \changes{4.1n}{2010/01/02}{(AO, 571) Interface \cs{set@footnotewidth} for determining the set width of footnotes}%
452 \changes{4.1n}{2010/01/02}{(AO, 571) allow split after last line of footnote}%
453 \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
454 \changes{4.2a}{2018/12/12}{(MD) Updated name of README file and use standard fonts when typesetting}%
455
456 \end{filecontents*}
457 % \end{macrocode}
458 %
459 % \subsection{A Gnuly Created Sample Document}
460 %
461 % \begin{macrocode}
462 \begin{filecontents*}{ltxfront-test.tex}
463 \documentclass{article}% use any combination of titlepage, twocolumn
464 \usepackage[]{ltxfront}% use inactive to turn off features
465 \begin{document}
466
467 \title{Gnu Veldt Cuisine}
468
469 \author{G. Picking}
470 \thanks{Supported by a grant from the GSF.}
471 \affiliation{Acme Kitchen Products}
472
473 \author{R. Dillo}
474 \thanks{On leave during 1985.}
475 \affiliation{Cordon Puce School}
476
477 \date{24 July 1984}%
478 \revised{5 January 1985}%
479
480 \maketitle
481
482 \section{Introduction}%
483 We reproduce most features of \LaTeX\ manual, Figure C.4, p. 183.
484 \end{document}
485 \end{filecontents*}
486 % \end{macrocode}
487 %
488 % \subsection{The Document Body}
489 %
490 % Here is the document body, containing only a
491 % \cmd\DocInput\ directive---referring to this very file.
492 % This very cute self-reference is a common \classname{ltxdoc} idiom.
493 % \begin{macrocode}
494 \begin{document}%
495 \expandafter\DocInput\expandafter{\jobname.dtx}%
496 % ^^A\PrintChanges
497 \end{document}
498 % \end{macrocode}
499 %
500 % \begin{macrocode}
501 %</doc>
502 % \end{macrocode}
503 %
504 % \section{Using this package}
505 % Once this package is installed on your filesystem, you can employ it in
506 % adding functionality to \LaTeX\ by invoking it in your document or document class.
507 %
508 % \subsection{Invoking the package}
509 % In your document, you can simply call it up in your preamble:
510 % \begin{verbatim}
511 %\documentclass{book}%
512 %\usepackage{ltxfront}%
513 %\begin{document}
514 %<your document here>
515 %\end{document}\end{verbatim}
516 % However, the preferred way is to invoke this package from within your
517 % customized document class:
518 % \begin{verbatim}
519 %\NeedsTeXFormat{LaTeX2e}[1995/12/01]%
520 %\ProvidesClass{myclass}%
521 %\RequirePackage{ltxfront}%
522 %\LoadClass{book}%
523 %<class customization commands>
524 %\endinput\end{verbatim}
525 %
526 % Once loaded, the package gives you acccess to certain procedures,
527 % usually to be invoked by a \LaTeX\ command or environment.
528 %
529 % \section{Frontmatter commands}
530 %
531 % A document using this package will use commands like \cmd\title, \cmd\author, \cmd\thanks,
532 % the \texttt{abstract} environment
533 % and \cmd\maketitle.
534 % These are part of \LaTeX's standard document classes.
535 % But this package supplements \LaTeX\ syntax with additional commands, such as
536 % \cmd\affiliation, \cmd\collaboration, \cmd\email, \cmd\homepage, and others.
537 %
538 % Furthermore, you can have multiple \cmd\author, \cmd\affiliation, and \cmd\collaboration\ commands,
539 % each with their own set of \cmd\email, \cmd\homepage, etc. commands.
540 %
541 % \section{The Front Matter}\label{sec:front}
542 %
543 % This section describes the macros
544 % this package provides for formatting the front matter of an
545 % article. The behavior and usage of these macros can be quite
546 % different from those provided in \LaTeXe.
547 %
548 % \subsection{Setting the title}
549 %
550 % The title of the manuscript is simply specified by using the
551 % \cmd\title\arg{title} macro. A \verb+\\+ may be used to put a line
552 % break in a long title.
553 % The \cmd\title\ commnd takes an optional argument, which you will use to
554 % give an abbreviated title for use in the running header.
555 %
556 % \subsection{Specifying a date}%
557 %
558 % The \cmd\date\marg{date} command outputs the date on the manuscript.
559 % Using \cmd\today\ will cause \LaTeX{} to insert the
560 % current date whenever the file is run:
561 % \begin{verbatim}\date{\today}\end{verbatim}
562 %
563 % \subsection{Specifying authors and affiliations}
564 %
565 % Commands specifying author and affilliation have been improved to save
566 % labor for authors and in production. Authors and affiliations are
567 % arranged into groupings called, appropriately enough, \emph{author
568 % groups}. Each author group is a set of authors who share the same set
569 % of affiliations. Author names are specified with the \cmd\author\
570 % macro while affiliations (or addresses) are specified with the
571 % \cmd\affiliation\ macro. Author groups are specified by sequences of
572 % \cmd\author\ macros followed by \cmd\affiliation\ macros. An
573 % \cmd\affiliation\ macro applies to all previously specified
574 % \cmd\author\ macros which don't already have an affiliation supplied.
575 %
576 % For example, if Bugs Bunny and Roger Rabbit are both at Looney Tune
577 % Studios, while Mickey Mouse is at Disney World, the markup would be:
578 % \begin{verbatim}
579 % \author{Bugs Bunny}
580 % \author{Roger Rabbit}
581 % \affiliation{Looney Tune Studios}
582 % \author{Mickey Mouse}
583 % \affiliation{Disney World}\end{verbatim}
584 % The default is to display this as
585 % \begin{center}
586 % Bugs Bunny and Roger Rabbit\\
587 % \emph{Looney Tune Studios}\\
588 % Mickey Mouse\\
589 % \emph{Disney World}\\
590 % \end{center}
591 % This layout style for displaying authors and their affiliations is
592 % chosen by selecting the class option
593 % \classoption{groupedaddress}. This option is the default for all APS
594 % journal styles, so it does not need to be specified explicitly.
595 % The other major way of displaying this
596 % information is to use superscripts on the authors and
597 % affiliations. This can be accomplished by selecting the class option
598 % \classoption{superscriptaddress}. To achieve the display
599 % \begin{center}
600 % Bugs Bunny,$^{1}$ Roger Rabbit,$^{1,2}$ and Mickey Mouse$^{2}$\\
601 % \emph{$^{1}$Looney Tune Studios}\\
602 % \emph{$^{2}$Disney World}\\
603 % \end{center}
604 % one would use the markup
605 % \begin{verbatim}
606 % \author{Bugs Bunny}
607 % \affiliation{Looney Tune Studios}
608 % \author{Roger Rabbit}
609 % \affiliation{Looney Tune Studios}
610 % \affiliation{Disney World}
611 % \author{Mickey Mouse}
612 % \affiliation{Disney World}\end{verbatim}
613 %
614 % Note that this package takes care of any commas and \emph{and}'s that join
615 % the author names together and font selection, as well as any
616 % superscript numbering. Only the author names and affiliations should
617 % be given within their respective macros.
618 %
619 % There is a third class option, \classoption{unsortedaddress}, for
620 % controlling author/affiliation display. The default
621 % \classoption{groupedaddress} will actually sort authors into the
622 % approriate author groups if one chooses to specify an affiliation for
623 % each author. The markup:
624 % \begin{verbatim}
625 % \author{Bugs Bunny}
626 % \affiliation{Looney Tune Studios}
627 % \author{Mickey Mouse}
628 % \affiliation{Disney World}
629 % \author{Roger Rabbit}
630 % \affiliation{Looney Tune Studios}\end{verbatim}
631 % will result in the same display as for the first case given
632 % above even though Roger Rabbit is specified after Mickey Mouse. To
633 % avoid Roger Rabbit being moved into the same author group as Bugs
634 % Bunny, use the
635 % \classoption{unsortedaddress} option instead. In general, it is safest
636 % to list authors in the order they should appear and specify
637 % affiliations for multiple authors rather than one at a time. This will
638 % afford the most independence for choosing the display option. Finally,
639 % it should be mentioned that the affiliations for the
640 % \classoption{superscriptaddress} are presented and numbered
641 % in the order that they are encountered. This means that the order
642 % will usually follow the order of the authors. An alternative ordering
643 % can be forced by including a list of \cmd\affiliation\ commands before
644 % the first \cmd{\author} in the desired order. Then use the exact same
645 % text for each affilation when specifying them for each author.
646 %
647 % If an author doesn't have an affiliation, the \cmd\noaffiliation\
648 % macro may be used in the place of an \cmd\affiliation\ macro.
649 %
650 %
651 % \subsubsection{Collaborations}
652 %
653 % A collaboration name can be specified with the \cmd\collaboration\
654 % command. This is very similar to the \cmd\author\ command.
655 % It should appear at the end of an author group.
656 % The collaboration name will appear centered in parentheses.
657 % You may have multiple author groups, each with its own \cmd\collaboration.
658 % Because collaborations don't normally have affiliations, one needs to follow the
659 % \cmd\collaboration\ with \cmd\noaffiliation.
660 %
661 % \subsubsection{Footnotes for authors, collaborations, affiliations or title}\label{sec:footau}
662 %
663 % Often one wants to specify additional information associated with an
664 % author, collaboration, or affiliation such an e-mail address, an
665 % alternate affiliation, or some other ancillary information.
666 % This package introduces several new macros just for this purpose. They
667 % are:
668 % \begin{itemize}
669 % \item\cmd\email\oarg{optional text}\arg{e-mail address}
670 % \item\cmd\homepage\oarg{optional text}\arg{URL}
671 % \item\cmd\altaffiliation\oarg{optional text}\arg{affiliation}
672 % \item\cmd\thanks\arg{miscellaneous text}
673 % \end{itemize}
674 % In the first three, the \emph{optional text} will be prepended before the
675 % actual information specified in the required argument. \cmd\email\ and
676 % \cmd\homepage\ each have a default text for their optional arguments
677 % (`Electronic address:' and `URL:' respectively). The \cmd\thanks\
678 % macro should only be used if one of the other three do not apply. Any
679 % author name can have multiple instances of these four commands.
680 % Note that unlike the
681 % \cmd\affiliation\ macro, these macros only apply to the \cmd\author\
682 % that directly precedes it. Any \cmd\affiliation\ \emph{must} follow
683 % the other author-specific macros. A typical usage might be as follows:
684 % \begin{verbatim}
685 % \author{Bugs Bunny}
686 % \email[E-mail me at: ]{[email protected]}
687 % \homepage[Visit: ]{http://looney.com/}
688 % \altaffiliation[Permanent address: ]
689 % {Warner Brothers}
690 % \affiliation{Looney Tunes}\end{verbatim}
691 % This would result in the footnote ``E-mail me at: \texttt{[email protected]},
692 % Visit: \texttt{http://looney.com/}, Permanent address: Warner
693 % Brothers'' being attached to Bugs Bunny. Note that:
694 % \begin{itemize}
695 % \item Only an e-mail address, URL, or affiliation should go in the
696 % required argument in the curly braces.
697 % \item The font is automatically taken care of.
698 % \item An explicit space is needed at the end of the optional text if one is
699 % desired in the output.
700 % \item Use the optional arguments to provide customized
701 % text only if there is a good reason to.
702 % \end{itemize}
703 %
704 % The \cmd\collaboration\ , \cmd\affiliation, or even \cmd\title\ can
705 % also have footnotes attached via these commands. If any ancillary data
706 % (\cmd\thanks, \cmd\email, \cmd\homepage, or
707 % \cmd\altaffiliation) are given in the wrong context (e.g., before any
708 % \cmd\title, \cmd\author, \cmd\collaboration, or \cmd\affiliation\
709 % command has been given), then a warning is given in the \TeX\ log, and
710 % the command is ignored.
711 %
712 % Duplicate sets of ancillary data are merged, giving rise to a single
713 % shared footnote. However, this only applies if the ancillary data are
714 % identical: even the order of the commands specifying the data must be
715 % identical. Thus, for example, two authors can share a single footnote
716 % indicating a group e-mail address.
717 %
718 % Duplicate \cmd\affiliation\ commands may be given in the course of the
719 % front matter, without the danger of producing extraneous affiliations
720 % on the title page. However, ancillary data should be specified for
721 % only the first instance of any particular institution's
722 % \cmd\affiliation\ command; a later instance with different ancillary
723 % data will result in a warning in the \TeX\ log.
724 %
725 % It is preferable to arrange authors into
726 % sets. Within each set all the authors share the same group of
727 % affiliations. For each author, give the \cmd\author\ (and appropriate
728 % ancillary data), then follow this author group with the needed group
729 % of \cmd\affiliation\ commands.
730 %
731 % If affiliations have been listed before the first
732 % \cmd\author\ macro to ensure a particular ordering, be sure
733 % that any later \cmd\affiliation\ command for the given institution is
734 % an exact copy of the first, and also ensure that no ancillary data is
735 % given in these later instances.
736 %
737 %
738 % A journal may determine the placement of these
739 % ancillary information footnotes. One journal may put all
740 % such footnotes at the start of the bibliography while another
741 % journal may display them on the first page, as a footnote. One can override a
742 % journal style's default behavior by specifying explicitly the class
743 % option
744 % \classoption{bibnotes} (puts the footnotes at the start of the
745 % bibliography) or \classoption{nobibnotes} (puts them on the first page).
746 %
747 % \subsubsection{Specifying first names and surnames}
748 %
749 % Many authors have names in which either the surname appears first
750 % or in which the surname is made up of more than one name. To ensure
751 % that such names are accurately captured for indexing and other
752 % purposes, the \cmd\surname\ macro should be used to indicate which portion
753 % of a name is the surname. Similarly, there is a \cmd\firstname\ macro
754 % as well, although usage of \cmd\surname\ should be sufficient. If an
755 % author's surname is a single name and written last, it is not
756 % necessary to use these macros. These macros do nothing but indicate
757 % how a name should be indexed. Here are some examples;
758 % \begin{verbatim}
759 % \author{Andrew \surname{Lloyd Weber}}
760 % \author{\surname{Mao} Tse-Tung}\end{verbatim}
761 %
762 % \subsection{The abstract}
763 % An abstract for a paper is specified by using the \env{abstract}
764 % environment:
765 % \begin{verbatim}
766 % \begin{abstract}
767 % Text of abstract
768 % \end{abstract}\end{verbatim}
769 % Note that with this package, the abstract must be specified before the
770 % \cmd\maketitle\ command, and there is no need to embed it in an explicit
771 % minipage environment.
772 %
773 % \subsection{PACS codes}
774 % Some authors are asked to supply suggested PACS codes with their
775 % submissions. The \cmd\pacs\ macro is provided as a way to do this:
776 % \begin{verbatim}\pacs{23.23.+x, 56.65.Dy}\end{verbatim}
777 % The actual display of the PACS numbers below the abstract is
778 % controlled by two class options: \classoption{showpacs} and
779 % \classoption{noshowpacs}. In particular, this is now independent of
780 % the \classoption{preprint} option. \classoption{showpacs} must be
781 % explicitly included in the class options to display the PACS codes.
782 %
783 % \subsection{Keywords}
784 % A \cmd\keywords\ macro may also be used to indicate keywords for the
785 % article.
786 % \begin{verbatim}\keywords{nuclear form; yrast level}\end{verbatim}
787 % This will be displayed below the abstract and PACS (if supplied). Like
788 % PACS codes, the actual display of the the keywords is controlled by
789 % two classoptions: \classoption{showkeys} and
790 % \classoption{noshowkeys}. An explicit \classoption{showkeys} must be
791 % included in the \cmd\documentclass\ line to display the keywords.
792 %
793 % \subsection{Institutional report numbers}
794 % Institutional report numbers can be specified using the \cmd\preprint\
795 % macro. These will be displayed in the upper lefthand corner of the
796 % first page. Multiple \cmd\preprint\ macros may be supplied (space is
797 % limited though, so only three or less may actually fit).
798 %
799 % \subsection{maketitle}
800 % After specifying the title, authors, affiliations, abstract, PACS
801 % codes, and report numbers, the final step for formatting the front
802 % matter of the manuscript is to issue the \cmd\maketitle\ command:
803 % \begin{verbatim}\maketitle\end{verbatim}
804 % This command must follow all of the macros listed above.
805 % The macro will format the front matter in accordance with the various
806 % class options that were specified in the
807 % \cmd\documentclass\ line (either implicitly through defaults or
808 % explicitly).
809 %
810 %
811 % \section{Compatability with \LaTeX's Required Packages}
812 % Certain packages, usually ones written by members of the
813 % \LaTeX\ Project itself, have been designated ``required'' and
814 % are distributed as part of standard \LaTeX.
815 % These packages have been placed in a priviledged position
816 % vis \'a vis the \LaTeX\ kernel in that they override the definitions of certain kernel macros.
817 %
818 % The \classname{ltxfront} package will be incompatible with any package that
819 % redefines any of the kernel macros that \classname{ltxfront} patches---if that
820 % package is loaded \emph{after} \classname{ltxfront}.
821 %
822 % Hereinafter follows some notes on specific \LaTeX\ packages.
823 %
824 %\StopEventually{}
825 %
826 % \section{Implementation of package}
827 %
828 % \subsection{Beginning of the \file{package} {\sc docstrip} module}
829 % \begin{macrocode}
830 %<*package>
831 \def\package@name{ltxfront}%
832 \expandafter\PackageInfo\expandafter{\package@name}{%
833 Title page macros for \protect\LaTeXe,
834 by A. Ogawa (arthur_ogawa at sbcglobal.net)%
835 }%
836 % \end{macrocode}
837 %
838 % \subsection{Prerequisites}%
839 %
840 % This package requires the use of the \classname{ltxutil} package.
841 % \begin{macrocode}
842 \let\class@name\package@name
843 \RequirePackage{ltxutil}%
844 %</package>
845 % \end{macrocode}
846 % End of the preliminary portion of the package code.
847 % \begin{macrocode}
848 % \end{macrocode}
849 %
850 % \subsection{Options}%
851 % Package options are treated in this portion of the dtx file.
852 % This portion is guarded by the \texttt{options} \classname{docstrip} code so that it can be
853 % merged into a larger package gracefully.
854 % \begin{macrocode}
855 %<*options>
856 % \end{macrocode}
857 %
858 % Package option turns on diagnostics that trace its operation.
859 % \cmd\frontmatterverbose@sw\ is set false by default: we do not elect to monitor
860 % the workings of these procedures.
861 % \begin{macrocode}
862 \DeclareOption{frontmatterverbose}{\@booleantrue\frontmatterverbose@sw}%
863 \@booleanfalse\frontmatterverbose@sw
864 % \end{macrocode}
865 %
866 % Package option inactivates its syntax, for testing purposes.
867 % \begin{macrocode}
868 \DeclareOption{inactive}{\@booleanfalse\frontmatter@syntax@sw}%
869 \@booleantrue\frontmatter@syntax@sw
870 % \end{macrocode}
871 %
872 % \begin{macro}{\runinaddress@sw}
873 % The flag \cmd\runinaddress@sw\ signifies that author addresses are to be set on the same
874 % line with the author.
875 %
876 % The \classoption{runinaddress} option is the only one that sets \cmd\runinaddress@sw\ to true.
877 %
878 % FIXME: this option pertains to cases where \cmd\groupauthors@sw\ is true, but is independant of \cmd\@affils@sw.
879 % So, it should be possible to assert both \classoption{runinaddress} and \classoption{unsortedaddress} as well as
880 % each separately.
881 % \begin{macrocode}
882 \@booleanfalse\runinaddress@sw
883 % \end{macrocode}
884 % \end{macro}
885 %
886 % \begin{macro}{\@affils@sw}
887 % If \cmd\@affils@sw\ is false, an address is never recognised as ``new''
888 % and is therefore always entered into the affiliation list,
889 % stopping groups of authors at the same address being consolidated
890 % into the same list:
891 % the address will be printed the same number of times it is entered.
892 %
893 % The \classoption{unsortedaddress} option is the only one that sets \cmd\@affils@sw\ to false.
894 % \begin{macrocode}
895 \@booleantrue\@affils@sw
896 % \end{macrocode}
897 % \end{macro}
898 %
899 % \begin{macro}{\groupauthors@sw}
900 % The flag \cmd\groupauthors@sw\ signifies that authors are to be grouped,
901 % affecting the meaning of \cmd\@author@present.
902 %
903 % Clients will want to set \cmd\groupauthors@sw\ true if they want grouped addresses
904 % or either of the following variants:
905 % for unsorted addresses: set \cmd\@affils@sw\ false;
906 % for run-in addresses, set \cmd\runinaddress@sw\ true.
907 % \begin{macrocode}
908 \@booleanfalse\groupauthors@sw
909 % \end{macrocode}
910 % \end{macro}
911 %
912 % \begin{macro}{groupedaddress}
913 % If we take the \classoption{groupedaddress} option as the default, then we can look upon
914 % the \classoption{superscriptaddress} option as simply turning \cmd\groupauthors@sw\ to \cmd\false@sw.
915 %
916 % \classoption{groupedaddress}, the default in APS journals, groups authors above a common address.
917 % \begin{macrocode}
918 \DeclareOption{groupedaddress}{\clo@groupedaddress}%
919 \def\clo@groupedaddress{%
920 \@booleantrue\groupauthors@sw
921 \@booleantrue\@affils@sw
922 \@booleanfalse\runinaddress@sw
923 }%
924 % \end{macrocode}
925 % \end{macro}
926 %
927 % \begin{macro}{unsortedaddress}
928 % \classoption{unsortedaddress} is similar to \classoption{groupedaddress},
929 % but turns off \cmd\@affils@sw,
930 % with the result that each address that is entered will be printed.
931 % \begin{macrocode}
932 \DeclareOption{unsortedaddress}{\clo@unsortedaddress}%
933 \def\clo@unsortedaddress{%
934 \@booleantrue\groupauthors@sw
935 \@booleanfalse\@affils@sw
936 \@booleanfalse\runinaddress@sw
937 }%
938 % \end{macrocode}
939 % \end{macro}
940 %
941 % \begin{macro}{runinaddress}
942 %
943 % \classoption{runinaddress} is similar to \classoption{groupedaddress},
944 % with the addition of the Boolean \cmd\runinaddress@sw,
945 % which causes the authors associated with a particular address group
946 % to be formatted in a paragraph instead of on separate lines.
947 % \begin{macrocode}
948 \DeclareOption{runinaddress}{\clo@runinaddress}%
949 \def\clo@runinaddress{%
950 \@booleantrue\groupauthors@sw
951 \@booleantrue\@affils@sw
952 \@booleantrue\runinaddress@sw
953 }%
954 % \end{macrocode}
955 % \end{macro}
956 %
957 % \begin{macro}{superscriptaddress}
958 % \classoption{superscriptaddress} presents author affiliations
959 % as superscripts. Authors with like affiliations share the same
960 % superscript.
961 %
962 % FIXME: if \cmd\groupauthors@sw\ is false, would not \cmd\@affils@sw\ be a don't care?
963 % \begin{macrocode}
964 \DeclareOption{superscriptaddress}{\clo@superscriptaddress}%
965 \def\clo@superscriptaddress{%
966 \@booleanfalse\groupauthors@sw
967 \@booleantrue\@affils@sw
968 \@booleanfalse\runinaddress@sw
969 }%
970 % \end{macrocode}
971 % \end{macro}
972 %
973 % \begin{macrocode}
974 %</options>
975 % \end{macrocode}
976 %
977 % \subsection{Process package options}%
978 % \begin{macrocode}
979 %<*package>
980 \DeclareOption*{\OptionNotUsed}%
981 \ProcessOptions*
982 %</package>
983 % \end{macrocode}
984 %
985 % \section{Kernel of Front Matter}
986 % Here begins the kernel of the \classname{frontmatter} package.
987 % \begin{macrocode}
988 %<*kernel>
989 % \end{macrocode}
990 %
991 % This package implements a new syntax for the title page of an article.
992 %
993 % Special acknowledgment: this package uses concepts pioneered
994 % and first realized by William Baxter (mailto:web at superscript.com)
995 % in his SuperScript line of commercial typesetting tools, and
996 % which are used here with his permission.
997 %
998 % These macros were first coded by David P. Carlisle for the American Physical
999 % society in the late 1990s as part of the development of REV\TeX4.
1000 % That development work was taken over by Arthur Ogawa, who is the author of
1001 % this package.
1002 %
1003 % \subsection{Initialization}%
1004 %
1005 % \begin{macro}{\frontmatter@init}
1006 % The \cmd\frontmatter@init\ procedure sets up all the registers for
1007 % processing the title page.
1008 % At present, this is done once, at \cmd\class@documenthook\ time.
1009 % If multiple title pages are to be processed within a job,
1010 % the initialization must be done for each.
1011 % \begin{macrocode}
1012 \appdef\class@documenthook{\frontmatter@init}%
1013 \let\frontmatter@init\@empty
1014 % \end{macrocode}
1015 % \end{macro}
1016 %
1017 % \subsection{The title command}%
1018 %
1019 % \begin{macro}{\title}
1020 % \begin{macro}{\do@title}
1021 % The author uses \cmd\title\ to specify the title. As in the AMS
1022 % classes, \cmd\title\ has an optional argument specifying a short form
1023 % for use in running heads.
1024 %
1025 % Once the \cmd\title\ is given, you can specify any combination of
1026 % \cmd\thanks, \cmd\email, \cmd\homepage, and \cmd\altaffiliation\ commands,
1027 % applying to the title of the document.
1028 %
1029 % Compatibility note: as with all of the standard \LaTeX\ commands that we override,
1030 % we make here a private definition and later switch it in if so required.
1031 % \changes{4.1b}{2008/08/02}{Make the syntax of this package switch optional}%
1032 % \begin{macrocode}
1033 \newcommand\frontmatter@title[2][]{%
1034 \def\@title{#2}%
1035 \def\@shorttitle{#1}%
1036 \let\@AF@join\@title@join
1037 }%
1038 % \end{macrocode}
1039 % \end{macro}
1040 % \end{macro}
1041 %
1042 % \begin{macro}{\@title}
1043 % \begin{macro}{\@shorttitle}
1044 % The arguments to \cmd\title\ are saved in these internal
1045 % macros, which are set up to produce a warning if \cmd\title\ has not
1046 % been used before \cmd\maketitle.
1047 % \changes{4.1b}{2008/08/02}{Use \cs{frontmatter@init} as the vehicle for all initialization}
1048 %
1049 % Extensibility note: by using \cmd\frontmatter@init\ as the initialization procedure,
1050 % we open the possibility of more than one title page per document.
1051 % \begin{macrocode}
1052 \appdef\frontmatter@init{%
1053 \def\@title{\class@warn{No title}}%
1054 \let\@shorttitle\@empty
1055 \let\@title@aux\@title@aux@cleared
1056 }%
1057 % \end{macrocode}
1058 % \end{macro}
1059 % \end{macro}
1060 %
1061 % \begin{macro}{\@title@join}
1062 % \begin{macro}{\@title@join@}
1063 % \begin{macro}{\@title@aux@cleared}
1064 %
1065 % \begin{macrocode}
1066 \def\@title@join{\expandafter\@title@join@\@title@aux}%
1067 \def\@title@join@#1#2{%
1068 \def\@title@aux{{\@join{\@separator}{#1}{#2}}}%
1069 }%
1070 \def\@title@aux@cleared{{}}%
1071 % \end{macrocode}
1072 % \end{macro}
1073 % \end{macro}
1074 % \end{macro}
1075 %
1076 %
1077 % \subsection{The author, affiliation, and related commands}%
1078 %
1079 % \begin{macro}{\c@affil}
1080 % \begin{macro}{\c@collab}
1081 % \changes{4.1b}{2008/08/02}{(AO, 486) \cs{collaboration} to work with \texttt{groupedaddress}}
1082 %
1083 % \cmd\c@affil\ stores the affiliation numbers used for the superscript marks.
1084 % The \cmd\newcounter\ command defines \cmd\theaffil, which we never use:
1085 % this counter is evaluated solely via \cmd\the.
1086 %
1087 % \cmd\c@collab\ stores the collaboration numbers.
1088 % The \cmd\newcounter\ command defines \cmd\thecollab.
1089 % As with \cmd\c@affil, we never use \cmd\thecollab; only \cmd\the\ \cmd\c@collab.
1090 %
1091 % Each counter must be cleared before frontmatter can be processed.
1092 % \begin{macrocode}
1093 \newcounter{affil}%
1094 \newcounter{collab}%
1095 \appdef\frontmatter@init{%
1096 \c@affil\z@
1097 \c@collab\z@
1098 }%
1099 % \end{macrocode}
1100 % \end{macro}
1101 % \end{macro}
1102 %
1103 % \subsubsection{Commands for author or collaboration}%
1104 %
1105 % \begin{macro}{\author}
1106 % Each author is given in a \emph{separate} \cmd\author\ command.
1107 % This is similar to the AMS classes, but the AMS also try to support
1108 % the \classname{article} class's \cmd\and\ command for putting multiple
1109 % authors in one \cmd\author\ command.
1110 % This package, however, does not support the \cmd\and\ command.
1111 %
1112 % When the \cmd\author\ command is encountered,
1113 % the previous author, author group, affiliation, and affiliation group are at an end.
1114 % This procedure moves the previous author to the author group (\cmd\move@AU),
1115 % moves the previous affiliation to the affiliation group (\cmd\move@AF),
1116 % and terminates the previous author/affiliation group (\cmd\move@AUAF) as the case may require.
1117 %
1118 % Compatibility note: as with all of the standard \LaTeX\ commands that we override,
1119 % we make here a private definition and later switch it in if so required.
1120 % \changes{4.1b}{2008/08/02}{Make the syntax of this package switch optional}%
1121 % \begin{macrocode}
1122 \newcommand\frontmatter@author{% implicit #1
1123 \@author@def{}% implicit #2
1124 }%
1125 % \end{macrocode}
1126 % \end{macro}
1127 %
1128 % \begin{macro}{\collaboration}
1129 % Specify the collaboration (given after a group of authors).
1130 %
1131 % This procedure does exactly what \cmd\author\ does, and sets
1132 % a flag signifying that the \cmd\collaboration\ command was given.
1133 %
1134 % Note: earlier versions attempted to ignore the collaboration command if it was considered inappropriate.
1135 % We must not do this, however, because it throws the state machine out of kilter.
1136 % \changes{4.1b}{2008/08/02}{(AO, 486) \cs{collaboration} to work with \texttt{groupedaddress}}
1137 % \begin{macrocode}
1138 \def\collaboration{% implicit #1
1139 \@author@def{\@booleantrue\collaboration@sw}% implicit #2
1140 }%
1141 \appdef\frontmatter@init{%
1142 \@booleanfalse\collaboration@sw
1143 }%
1144 % \end{macrocode}
1145 % \end{macro}
1146 %
1147 % \begin{macro}{\@author@init}
1148 % \begin{macro}{\@author@cleared}
1149 % \begin{macro}{\@authorclear@sw}
1150 % \begin{macro}{\@author@def}
1151 % \begin{macro}{\@author@join@}
1152 % \begin{macro}{\@author@join}
1153 % \changes{4.0b}{1999/06/20}{Change handling of \cs{@author} to prevent parsing problems. (Helps in error recovery when syntax errors exist)}
1154 % \changes{4.1b}{2008/08/02}{(AO, 486) \cs{collaboration} to work with \texttt{groupedaddress}}
1155 % \changes{4.1b}{2008/08/02}{Use \cs{frontmatter@init} as the vehicle for all initialization}
1156 %
1157 % Here are all the access procedures for the author data structure.
1158 %
1159 % We define a flag value for \cmd\@author (private),
1160 % a procedure \cmd\@author@gobble\ to read author data without any effect,
1161 % a procedure for setting \cmd\@author\ to the flag value (\cmd\@author@init),
1162 % a Boolean to test against the flag value (\cmd\@authorclear@sw),
1163 % and a procedure to add new ancillary data to the author.
1164 %
1165 % Note that expanding the functionality of the \cmd\collaboration\ command entailed changing
1166 % the data structures, because now all authors must remember the collaboration they belong to.
1167 % This change affects procedures \cmd\@author@cleared\ and \cmd\@author@gobble.
1168 % \begin{macrocode}
1169 \def\@author@cleared{{}{}{}}%
1170 \def\@author@gobble#1#2#3{}%
1171 \def\@author@init{%
1172 \let\@author\@author@cleared
1173 \@booleanfalse\collaboration@sw
1174 }%
1175 \def\@authorclear@sw{\@ifx{\@author\@author@cleared}}%
1176 \appdef\frontmatter@init{%
1177 \@author@init
1178 }%
1179 % \end{macrocode}
1180 % \changes{4.1i}{2009/10/18}{(AO, 540) More runtime diagnostics via \cs{frontmatterverbose@sw}}
1181 % \begin{macrocode}
1182 \def\@author@def#1#2{%
1183 \frontmatterverbose@sw{\typeout{\string\author\space\string\collaboration}}{}%
1184 \move@AU\move@AF\move@AUAF
1185 \let\@AF@join\@author@join
1186 #1%
1187 \def\@author{{#2}{}}%
1188 }%
1189 \def\@author@join@#1#2#3{%
1190 \def\@author{{#1}{\@join{\@separator}{#2}{#3}}}%
1191 }%
1192 \def\@author@join{\expandafter\@author@join@\@author}%
1193 % \end{macrocode}
1194 % \end{macro}
1195 % \end{macro}
1196 % \end{macro}
1197 % \end{macro}
1198 % \end{macro}
1199 % \end{macro}
1200 %
1201 % \begin{macro}{\move@AU}
1202 % \begin{macro}{\add@AUCO@grp}
1203 % \changes{4.1b}{2008/08/02}{(AO, 486) \cs{collaboration} to work with \texttt{groupedaddress}}
1204 % The \cmd\move@AU\ procedure moves the most recent author to the current author group \cmd\AU@grp,
1205 % or the most recent collaboration to the collaboration group \cmd\CO@grp.
1206 % If we recently did a \cmd\@author@init, this is a no-op.
1207 %
1208 % To accommodate the expanded syntax of \cmd\collaboration, we add a new field to
1209 % those associated with an author (collaborator), namely the value of the
1210 % collaboration counter.
1211 % \begin{macrocode}
1212 \def\move@AU{%
1213 \@authorclear@sw{}{%
1214 \collaboration@sw{%
1215 \advance\c@collab\@ne
1216 \@argswap{\CO@grp\CO@opr}%
1217 }{%
1218 \@argswap{\AU@grp\AU@opr}%
1219 }%
1220 {%
1221 \expandafter\@argswap@val
1222 \expandafter{\@author}%
1223 {\expandafter\@argswap@val\expandafter{\the\c@collab}{\add@AUCO@grp}}%
1224 }%
1225 }%
1226 \@author@init
1227 }%
1228 % \end{macrocode}
1229 % \changes{4.1b}{2008/08/02}{Provide for diagnostics via \cs{frontmatterverbose@sw}}
1230 % The procedure \cmd\add@AUCO@grp\ adds to the specified group \#3 using the
1231 % given intercollated operator \#4, with arguments \{\#1\} and \#2,
1232 % where the first argument is the collaboration number,
1233 % the second is the author name, and the third the joined attributes of the author.
1234 % For example, \cmd\move@AU\ could finally execute:
1235 % \cmd\appdef\ \cmd\AU@grp\ \{\cmd\AU@opr\{1\}\{A. Author\}\{\}\}.
1236 % \begin{macrocode}
1237 \def\add@AUCO@grp#1#2#3#4{%
1238 \appdef#3{#4{#1}#2}%
1239 \frontmatterverbose@sw{\say#3}{}%
1240 }%
1241 % \end{macrocode}
1242 % \end{macro}
1243 % \end{macro}
1244 %
1245 % \begin{macro}{\@author@finish}
1246 % We define a procedure to terminate author/affiliation parsing just before the title block is formatted.
1247 % We detect the case where an author group is not followed by an affiliation group.
1248 % \changes{4.0f}{2001/02/13}{Actually append \cs{AU@grp} to \cs{@AAClist}.}
1249 % \changes{4.1b}{2008/08/02}{(AO, 486) \cs{collaboration} to work with \texttt{groupedaddress}}
1250 % \changes{4.1b}{2008/08/02}{Use \cs{@affil@def} for all access to \cs{@affil}}
1251 % \changes{4.1b}{2008/08/02}{Provide for diagnostics via \cs{frontmatterverbose@sw}}
1252 % \changes{4.1g}{2009/10/05}{(AO, 535) Robustify \cs{footnote} while \cs{class@warn} is expanding its argument}
1253 % \changes{4.1i}{2009/10/18}{(AO, 540) More runtime diagnostics via \cs{frontmatterverbose@sw}}
1254 % \changes{4.1m}{2009/11/20}{(AO, 563) \cs{collaboration} to work with both \texttt{groupedaddress} and \texttt{superscriptaddress}}
1255 % \changes{4.1n}{2009/11/30}{(AO, 567) Handle \cs{noaffiliation} case}
1256 %
1257 % We first finish off any author- or affiliation groups in progress.
1258 % Next, we detect the case where there is an author group or a collaboration group in progress, but no affiliation group.
1259 % If so, we emit a diagnositic message and act as if a \cmd\noaffiliation\ command had been given.
1260 % In any case, we finish off any author/affiliation pair that may remain.
1261 % Formatting of the title block may now proceed.
1262 % \begin{macrocode}
1263 \def\@author@finish{%
1264 \frontmatterverbose@sw{\typeout{\string\@author@finish}}{}%
1265 \move@AU\move@AF
1266 \@ifx{\AU@grp\@empty}{%
1267 \@ifx{\CO@grp\@empty}%
1268 }{%
1269 \false@sw
1270 }%
1271 {}{%
1272 \@ifx{\AF@grp\@empty}{%
1273 \begingroup
1274 \let\href\@secondoftwo
1275 \let\AU@opr\@secondofthree
1276 \let\CO@opr\@secondofthree
1277 \let\footnote\@gobble
1278 \@ifx{\CO@grp\@empty}{%
1279 \class@warn{Assuming \string\noaffiliation\space for authors}%
1280 \frontmatterverbose@sw{\say\AU@grp}%
1281 }{%
1282 \class@warn{Assuming \string\noaffiliation\space for collaboration}%
1283 \frontmatterverbose@sw{\say\CO@grp}{}%
1284 }%
1285 \endgroup
1286 \@affil@none\move@AF
1287 }{}%
1288 }%
1289 \move@AUAF
1290 }%
1291 \def\@secondofthree#1#2#3{#2}%
1292 % \end{macrocode}
1293 % \end{macro}
1294 %
1295 % \begin{macro}{\@join}
1296 % The procedure \cmd\@join\ inserts
1297 % a separator between two tokens, or, if the first token is
1298 % nil, elides both that token and the separator.
1299 % \begin{macrocode}
1300 \def\@join#1#2#3{%
1301 \@if@empty{#2}{#3}{#2#1#3}%
1302 }%
1303 \def\@separator{;\space}%
1304 % \end{macrocode}
1305 % \end{macro}
1306 %
1307 % \begin{macro}{\surname}
1308 % \begin{macro}{\firstname}
1309 % No-op to allow better post-processing of the file.
1310 % \begin{macrocode}
1311 \let\surname\@firstofone
1312 \let\firstname\@firstofone
1313 % \end{macrocode}
1314 % \end{macro}
1315 % \end{macro}
1316 %
1317 % \begin{macro}{\and}
1318 % The original \LaTeX\ idea of using one \cmd\author\ command to capture
1319 % all authors and their address just doesn't work with multiple authors
1320 % possibly sharing addresses, so in this class disable \cmd\and.
1321 % \begin{macrocode}
1322 \newcommand\frontmatter@and{\class@err{\protect\and\space is not supported}}
1323 % \end{macrocode}
1324 % \end{macro}
1325 %
1326 %
1327 % \subsubsection{Commands for affiliation}%
1328 %
1329 % \begin{macro}{\affiliation}
1330 % \changes{4.1b}{2008/08/02}{Use \cs{@affil@def} for all access to \cs{@affil}}
1331 % After each group of authors with the same address,
1332 % give that address in \cmd\affiliation.
1333 % If later in the list you have an author
1334 % with the address of an earlier author, repeat the \cmd\affiliation\
1335 % command: the system will detect the equivalence and (if using the \classoption{superscriptaddress} option)
1336 % only print the affiliation once, reusing the superscript marker.
1337 %
1338 % When the \cmd\affiliation\ command is encountered, the current author and author group (if any) are at an end.
1339 % Also, the current affiliation is at an end.
1340 %
1341 % \changes{4.1i}{2009/10/18}{(AO, 540) More runtime diagnostics via \cs{frontmatterverbose@sw}}
1342 % FIXME: changes to catcode required elsewhere now?
1343 % \begin{macrocode}
1344 \def\cat@comma@active{\catcode`\,\active}%
1345 {\cat@comma@active\gdef,{\active@comma}}%
1346 \def\active@comma{,\penalty-300\relax}%
1347 \newcommand\affiliation{%
1348 \frontmatterverbose@sw{\typeout{\string\affiliation}}{}%
1349 \move@AU\move@AF
1350 \begingroup
1351 \cat@comma@active
1352 \@affiliation
1353 }%
1354 \def\@affiliation#1{%
1355 \endgroup
1356 \let\@AF@join\@affil@join
1357 \@affil@def{#1}%
1358 }%
1359 % \end{macrocode}
1360 % \end{macro}
1361 %
1362 % \begin{macro}{\noaffiliation}
1363 % \changes{4.1b}{2008/08/02}{Use \cs{@affil@def} for all access to \cs{@affil}}
1364 % \changes{4.1i}{2009/10/18}{(AO, 540) More runtime diagnostics via \cs{frontmatterverbose@sw}}
1365 % \changes{4.1n}{2009/11/30}{(AO, 567) Handle \cs{noaffiliation} case}
1366 % User-level command \cmd\noaffiliation\ signifies that the current group of authors, or the current collaboration, has \emph{no} affiliation.
1367 %
1368 % This is implemented by acting as if the \cmd\affiliation\ command has been given, and using a
1369 % flag value of \{\cmd\relax\}, which adds an element to the affiliation group of this author,
1370 % albeit a nil one (\cmd\AFF@opr\ \{\cmd\relax\} \{\}).
1371 %
1372 % 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).
1373 % \begin{macrocode}
1374 \newcommand\frontmatter@noaffiliation{%
1375 \frontmatterverbose@sw{\typeout{\string\noaffiliation}}{}%
1376 \move@AU\move@AF
1377 % \end{macrocode}
1378 % In \cmd\@author@finish, there is code testing if an effective
1379 % \cmd\noaffiliation\ should be executed now. Here, we do so in any case.
1380 % \begin{macrocode}
1381 \@affil@none\move@AF
1382 \move@AUAF
1383 }%
1384 \def\blankaffiliation{{}}%
1385 % \end{macrocode}
1386 % \end{macro}
1387 %
1388 % \begin{macro}{\@affil@cleared}
1389 % \begin{macro}{\@affil@nil}
1390 % \begin{macro}{\@affil@init}
1391 % \begin{macro}{\@affil@none}
1392 % \begin{macro}{\@affilclear@sw}
1393 % \begin{macro}{\@affil@def}
1394 % \begin{macro}{\@affil@join@}
1395 % \begin{macro}{\@affil@join}
1396 % \changes{4.1b}{2008/08/02}{Use \cs{@affil@def} for all access to \cs{@affil}}
1397 % \changes{4.1n}{2009/11/30}{(AO, 567) Handle \cs{noaffiliation} case}
1398 %
1399 % Here are all the access procedures for the affiliation data structure.
1400 % Note the similarity to those of the \cmd\@author\ data structure.
1401 %
1402 % We define a flag value for \cmd\@affil\ (private),
1403 % a procedure for setting \cmd\@affil\ to the flag value (\cmd\@affil@init),
1404 % a Boolean to test against the flag value (\cmd\@affilclear@sw),
1405 % a procedure \cmd\@affil@def\ to load a value into the structure,
1406 % and a procedure to add new ancillary data to the affiliation.
1407 % \begin{macrocode}
1408 \def\@affil@cleared{{{}}{}}%
1409 \def\@affil@nil{{\relax}{}}%
1410 \appdef\frontmatter@init{%
1411 \@affil@init
1412 }%
1413 \def\@affil@none{%
1414 \let\@affil\@affil@nil
1415 }%
1416 \def\@affil@init{%
1417 \let\@affil\@affil@cleared
1418 }%
1419 \def\@affilclear@sw{\@ifx{\@affil\@affil@cleared}}%
1420 \def\@affil@def#1{%
1421 \def\@affil{{#1}{}}%
1422 }%
1423 \def\@affil@join@#1#2#3{%
1424 \def\@affil{{#1}{\@join{\@separator}{#2}{#3}}}%
1425 }%
1426 \def\@affil@join{\expandafter\@affil@join@\@affil}%
1427 % \end{macrocode}
1428 % \end{macro}
1429 % \end{macro}
1430 % \end{macro}
1431 % \end{macro}
1432 % \end{macro}
1433 % \end{macro}
1434 % \end{macro}
1435 % \end{macro}
1436 %
1437 % \begin{macro}{\move@AF}
1438 % \changes{4.1b}{2008/08/02}{(AO, 486) \cs{collaboration} to work with \texttt{groupedaddress}}
1439 % \changes{4.1i}{2009/10/23}{(AO, 540) Rationalize code that appends to \cs{AF@grp}}
1440 % \changes{4.1n}{2009/11/30}{(AO, 567) Handle \cs{noaffiliation} case}
1441 % Move the most recent affiliation to the affiliation group.
1442 % If we recently did a \cmd\@affil@init, this is a no-op.
1443 %
1444 % Set the \cmd\temp@sw\ to false, then execute the affiliation list (\cmd\@AFF@list)
1445 % with the intercollated operator set to \cmd\@affil@match\
1446 % and with \cmd\@tempa\ holding the first component of \cmd\@affil, the current affiliation, which is to be matched.
1447 %
1448 % If the current affiliation has been seen before, then by side effect
1449 % \cmd\temp@sw\ will be set to true,
1450 % \cmd\@tempc\ will be set to the matching affiliation number,
1451 % and \cmd\@tempd\ will be set to the affiliation's ancillary data.
1452 % The Boolean \cmd\@affils@sw\ being false prevents this test from ever returning a ``true'' result.
1453 %
1454 % This procedure uses \cmd\@tempa\ and sets \cmd\@tempc, \cmd\@tempd, and \cmd\temp@sw.
1455 % \begin{macrocode}
1456 \def\move@AF{%
1457 \@affilclear@sw{}{%
1458 \@booleanfalse\temp@sw
1459 \let\@tempd\@empty
1460 \@affils@sw{%
1461 \expandafter\@affil@addr@def\expandafter\@tempa\@affil
1462 \def\AFF@opr{\@affil@match\@tempa}%
1463 \@AFF@list
1464 }{}\temp@sw
1465 % \end{macrocode}
1466 % True clause: This affiliation has been seen before.
1467 % If ancillary data for the affiliation have been given, but are not identical to those seen before, give a warning.
1468 % \begin{macrocode}
1469 {%
1470 \expandafter\@affil@aux@def\expandafter\@tempb\@affil
1471 \@ifx{\@tempb\@empty}{}{%
1472 \@ifx{\@tempb\@tempd}{}{%
1473 \class@warn{%
1474 Ancillary information for \@tempa\space must not be different!
1475 Please put all of it on the first instance%
1476 }%
1477 }%
1478 }%
1479 }%
1480 % \end{macrocode}
1481 % False clause: This affiliation is a new one:
1482 % increment the affiliation counter to get a unique affiliation ID
1483 % and append the new ID, collaboration number, address, and auxiliary information
1484 % to the list \cmd\@AFF@list.
1485 %
1486 % Note that, with the expanded syntax of \cmd\collaboration, we need to label each address with
1487 % its associated collaboration.
1488 %
1489 % Note also that the \cmd\noaffiliation\ case is handled by recognizing the flag value \cmd\@affil@nil.
1490 % \begin{macrocode}
1491 {%
1492 \@ifx{\@affil\@affil@nil}{%
1493 \def\@tempc{0}%
1494 \@argswap@val{0}%
1495 }{%
1496 \advance\c@affil\@ne
1497 \expandafter\def\expandafter\@tempc\expandafter{\the\c@affil}%
1498 \expandafter\@argswap@val\expandafter{\the\c@affil}%
1499 }%
1500 {%
1501 \expandafter\@argswap@val\expandafter{\the\c@collab}{%
1502 \expandafter\@argswap@val\expandafter{\@affil}{%
1503 \add@list@val@val@val\@AFF@list\AFF@opr
1504 }%
1505 }%
1506 }%
1507 }%
1508 % \end{macrocode}
1509 % In either case, append this affiliation number to the \cmd\AF@grp, the affiliation group of the current author group.
1510 % (It will later be considered for the \cmd\@AFG@list.)
1511 % Then assign the flag value to \cmd\@affil\ that signifies it has been cleared.
1512 % \changes{4.1i}{2009/10/18}{(AO, 540) Rationalize code that appends to \cs{AF@grp}}
1513 % \begin{macrocode}
1514 \appdef@eval\AF@grp\@tempc
1515 \frontmatterverbose@sw{\say\AF@grp}{}%
1516 \@affil@init
1517 }%
1518 }%
1519 \def\@affil@addr@def#1#2#3{%
1520 \def#1{#2}%
1521 }%
1522 \def\@affil@aux@def#1#2#3{%
1523 \def#1{#3}%
1524 }%
1525 % \end{macrocode}
1526 % \changes{4.1b}{2008/08/02}{Provide for diagnostics via \cs{frontmatterverbose@sw}}
1527 % Procedure \cmd\add@list@val@val@val\ appends to the given list \#1 using the given intercollated operator \#2,
1528 % with arguments \#5 (affiliation ID) and \#4 (collaboration ID) delimited by braces, and \#3 bare.
1529 % In the end, \cmd\move@AF\ may execute something like
1530 % \cmd\appdef\ \cmd\@AFF@list\ \cmd\AFF@opr\ \{1\} \{3\} \{My Institution\} \{thanks\}.
1531 % \begin{macrocode}
1532 \def\add@list@val@val@val#1#2#3#4#5{%
1533 \appdef#1{#2{#5}{#4}#3}%
1534 \frontmatterverbose@sw{\say#1}{}%
1535 }%
1536 % \end{macrocode}
1537 % \end{macro}
1538 %
1539 % \begin{macro}{\@affil@match}
1540 % \changes{4.1b}{2008/08/02}{(AO, 486) \cs{collaboration} to work with \texttt{groupedaddress}}
1541 % The procedure \cmd\@affil@match\ is the definition for \cmd\AFF@opr,
1542 % the intercollated operator for \cmd\@AFF@list,
1543 % when adding a new affiliation: it seeks a match with any earlier affiliation.
1544 % When the affiliation list is executed, this procedure tests each entry against
1545 % the `new' affiliation (which has been stored in \cmd\@tempa) and its associated
1546 % collaboration number (in \cmd\@tempb).
1547 %
1548 % If \cmd\groupauthors@sw\ is true, then we require the collaboration ID to match,
1549 % otherwise there is no such requirement,
1550 % as is appropriate for the \classoption{superscriptaddress} class option.
1551 %
1552 % Uses \cmd\temp@sw, \cmd\@tempc, and \cmd\@tempd\ to communicate back:
1553 % if it returns \cmd\temp@sw\ true, a match was found.
1554 % Then
1555 % \cmd\@tempc\ will be the affiliation ID of the matching entry
1556 % and \cmd\@tempd\ will be the auxiliary information of the matching entry.
1557 % \begin{macrocode}
1558 \def\@affil@match#1#2#3#4#5{%
1559 \temp@sw{}{%
1560 \def\@tempifx{#4}%
1561 \@ifx{\@tempifx#1}{%
1562 \groupauthors@sw{%
1563 \@ifnum{#3=\c@collab}{%
1564 \true@sw
1565 }{%
1566 \false@sw
1567 }%
1568 }{%
1569 \true@sw
1570 }%
1571 }{%
1572 \false@sw
1573 }%
1574 {%
1575 \@booleantrue\temp@sw
1576 \def\@tempc{#2}%
1577 \def\@tempd{#5}%
1578 }{%
1579 }%
1580 }%
1581 }%
1582 % \end{macrocode}
1583 % \end{macro}
1584 %
1585 % \begin{macro}{\move@AUAF}
1586 % \changes{4.0h}{1998/06/25}{Changes to support groups of affiliations}
1587 % \changes{4.1b}{2008/08/02}{(AO, 486) \cs{collaboration} to work with \texttt{groupedaddress}}
1588 % \changes{4.1b}{2008/08/02}{Change csname \cs{AFS@opr} to \cs{AFG@opr}}
1589 % \changes{4.1b}{2008/08/02}{Provide for diagnostics via \cs{frontmatterverbose@sw}}
1590 % Append \cmd\AF@grp, \cmd\AU@grp, and \cmd\CO@grp\ to \cmd\@AAC@list,
1591 % append \cmd\CO@grp\ to \cmd\@AFG@list,
1592 % and merge any new \cmd\AF@grp\ to \cmd\@AFG@list.
1593 %
1594 % The entire procedure is predicated on something non-trivial to move.
1595 %
1596 % If both author group \cmd\AU@grp\ and affiliation group \cmd\AF@grp\ are nil, bail out.
1597 %
1598 % No, try that again:
1599 %
1600 % If we have seen any affiliations (\cmd\AF@grp\ is not nil),
1601 % then it is time to move the current affiliation group and author group to \cmd\@AAC@list.
1602 % If not, we are picking up authors into an author group, and we should bail out.
1603 %
1604 % To extend this scheme to the new \cmd\collaboration\ abilities, we must append an affiliation \cmd\AF@opr\ to \cmd\@AAC@list\
1605 % also in the case where there was no affiliation specified (e.g., \cmd\noaffiliation). This affiliation will be a nil affiliation:
1606 % \cmd\AF@opr\verb+{{0}}+.
1607 %
1608 %FIXME: only one of \cmd\CO@grp\ or \cmd\AU@grp\ is non-empty at this point,
1609 % but this code does not appear to recognize this fact!
1610 % \changes{4.1i}{2009/10/18}{(AO, 540) More runtime diagnostics via \cs{frontmatterverbose@sw}}
1611 % \begin{macrocode}
1612 \def\move@AUAF{%
1613 \frontmatterverbose@sw{\say\AU@grp\say\AF@grp\say\CO@grp}{}%
1614 \@ifx{\AF@grp\@empty}{%
1615 \@ifx{\@empty\CO@grp}{%
1616 % \end{macrocode}
1617 % Both \cmd\AF@grp\ and \cmd\CO@grp\ are empty: nothing to do. But what if \cmd\AU@grp\ is not empty?
1618 % \begin{macrocode}
1619 }{%
1620 % \end{macrocode}
1621 % Append the nil \cmd\AF@opr\ to \cmd\@AAC@list.
1622 % \begin{macrocode}
1623 \appdef \@AAC@list{\AF@opr{{0}}}%
1624 % \end{macrocode}
1625 % Append the collaboration group to the \cmd\@AAC@list; no intercollated operator need be added,
1626 % because we already have \cmd\CO@opr.
1627 % \begin{macrocode}
1628 \appdef@e \@AAC@list{\CO@grp}%
1629 \appdef@e \@AFG@list{\CO@grp}%
1630 \let\CO@grp\@empty
1631 }%
1632 }{%
1633 % \end{macrocode}
1634 % Append current affiliation group (expansion of \cmd\AF@grp)
1635 % to the author/affiliation list (\cmd\@AAC@list),
1636 % using \cmd\AF@opr\ as the intercollated operator;
1637 % also append the current authors (\cmd\AU@grp).
1638 % \begin{macrocode}
1639 \appdef \@AAC@list{\AF@opr}%
1640 \appdef@eval\@AAC@list{\AF@grp}%
1641 \appdef@e \@AAC@list{\AU@grp}%
1642 % \end{macrocode}
1643 % Determine if either \cmd\AU@grp\ or \cmd\CO@grp\ is non-empty.
1644 % \begin{macrocode}
1645 \@ifx{\@empty\AU@grp}{%
1646 \@ifx{\@empty\CO@grp}%
1647 }{%
1648 \false@sw
1649 }%
1650 % \end{macrocode}
1651 % At this point, there is a Boolean in \TeX's scanner;
1652 % it will parse the following two brace-delimited sequences and select one of them.
1653 % \begin{macrocode}
1654 {%
1655 % \end{macrocode}
1656 % This branch is executed if and only if both \cmd\AU@grp\ and \cmd\CO@grp\ are empty.
1657 % \begin{macrocode}
1658 }{%
1659 % \end{macrocode}
1660 % There was either a \cmd\author\ or a \cmd\collaboration\ command.
1661 % Append the current affiliation group to \cmd\@AFG@list,
1662 % (only if it is not already there)
1663 % using \cmd\AFG@opr\ as the intercollated operator.
1664 %
1665 % Note that \cmd\@AFG@list\ is a list of \emph{unique} affiliation \emph{groups},
1666 % and building it entails an \(N^2\) computation.
1667 % \begin{macrocode}
1668 \@booleanfalse\temp@sw
1669 \def\AFG@opr{\x@match\AF@grp}%
1670 \let\CO@opr\@author@gobble
1671 \@AFG@list
1672 \temp@sw{}{%
1673 \appdef \@AFG@list{\AFG@opr}%
1674 \appdef@eval\@AFG@list{\AF@grp}%
1675 }%
1676 % \end{macrocode}
1677 % If the collaboration \cmd\CO@grp\ is not empty, we append it to the \cmd\@AFG@list\ and to the \cmd\@AAC@list.
1678 % \changes{4.1m}{2009/11/20}{(AO, 563) \cs{collaboration} to work with both \texttt{groupedaddress} and \texttt{superscriptaddress}}
1679 % \begin{macrocode}
1680 \@ifx{\@empty\CO@grp}{}{%
1681 \appdef@e \@AAC@list{\CO@grp}%
1682 \appdef@e \@AFG@list{\CO@grp}%
1683 \let\CO@grp\@empty
1684 }%
1685 }%
1686 % \end{macrocode}
1687 % Finally, null out the macros holding the author group \cmd\AU@grp, affiliation group \cmd\AF@grp, and collaboration group \cmd\CO@grp.
1688 % \begin{macrocode}
1689 \let\CO@grp\@empty
1690 \let\AU@grp\@empty
1691 \let\AF@grp\@empty
1692 }%
1693 \frontmatterverbose@sw{\say\@AAC@list\say\@AFG@list}{}%
1694 }%
1695 % \end{macrocode}
1696 % \end{macro}
1697 %
1698 % \begin{macro}{\AU@grp}
1699 % \begin{macro}{\AF@grp}
1700 % \begin{macro}{\@AAC@list}
1701 % \begin{macro}{\@AFG@list}
1702 % \begin{macro}{\@AFF@list}
1703 %
1704 % The control sequence name \cmd\AU@grp\ accumulates
1705 % consecutive \cmd\author\ entries (with \cmd\AU@opr\ as the intercollated operator)
1706 % and \cmd\collaboration\ entries (with \cmd\CO@opr\ as the intercollated operator).
1707 % Ultimately, its contents are appended to the author/affiliation list \cmd\@AAC@list\
1708 % and to the list of affiliation groups, \cmd\@AFG@list.
1709 % It must be initialized to \cmd\@empty.
1710 %
1711 % 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.
1712 % Therefore we invariably assign values to the pair of them within the same procedure.
1713 %
1714 % The macro \cmd\AF@grp\ accumulates affiliation IDs into an affiliation group.
1715 % It must be empty at the beginning of the frontmatter.
1716 %
1717 % The \cmd\@AAC@list\ macro accumulates
1718 % authors (using \cmd\AU@opr\ as the intercollated operator),
1719 % collaborations (using \cmd\CO@opr\ as the intercollated operator),
1720 % and
1721 % affiliations (using \cmd\AF@opr\ as the intercollated operator).
1722 %
1723 % It must be empty at the beginning of the frontmatter.
1724 %
1725 % The macro \cmd\@AFG@list\ accumulates
1726 % affiliation groups, with \cmd\AFG@opr\ as the intercollated operator,
1727 % and collaborations, with no intercollated operator.
1728 % This token list is employed when and only when \classoption{groupedaddress} is in effect.
1729 %
1730 % The macro \cmd\@AFF@list\ accumulates the list of affiliations
1731 % with \cmd\AFF@opr\ as the intercollated operator.
1732 % It must be empty at the beginning of the frontmatter.
1733 %
1734 % Each \cmd\affiliation\ command in the document contributes
1735 % to this list, as long as the argument of that instance of the command
1736 % is ``new''.
1737 %
1738 % Each entry in this list consists of the \cmd\AFF@opr\ intercollated operator
1739 % followed by three brace-delimited tokens, representing, in order:
1740 % \begin{enumerate}
1741 % \item
1742 % the affiliation's unique ID, a number increasing monotonically for
1743 % each new entry,
1744 % \item
1745 % the optional argument of the \cmd\affiliation\ command,
1746 % the footnote to the affiliation, and
1747 % \item
1748 % the text of the affiliation.
1749 % \end{enumerate}
1750 %
1751 % At various junctures in the code, the control sequence name
1752 % \cmd\AFF@opr\ assumes the meaning of
1753 % \cmd\@affil@group, \cmd\affil@script,
1754 % or is defined to expand to \cmd\@affil@match\cmd\@tempa,
1755 % and the list \cmd\@AFF@list\ is expanded.
1756 %
1757 % For each of these lists, here is the syntax of an element and the usage of the associated operator:
1758 % \begin{verbatim}
1759 %\@AFF@list \AFF@opr{<affiliation ID>}{<collaboration ID>}{<address>}{<auxiliary info>} \frontmatter@author@produce@script \affils@present@group
1760 %\@AFG@list \AFG@opr{{<affiliation ID>}..{<affiliation ID>}} \frontmatter@author@produce@group
1761 %\@AAC@list \AF@opr{{<affiliation ID>}..{<affiliation ID>}} (\AU@opr|\CO@opr){<collaboration ID>}{<author>}{<auxilliary info>} \frontmatter@author@produce@script \frontmatter@author@produce@group \affils@present@group
1762 %
1763 %\AFF@opr \@affil@match\@tempa \@affil@script \@affil@group
1764 %\AFG@opr \affils@present@group \x@match\AF@grp
1765 %\AF@opr \@gobble \@affilID@def \@affilID@count\AF@temp\@tempcnta \@affilID@match\AF@temp
1766 %\AU@opr \@secondofthree \@author@count\@tempcnta \@author@present \@author@gobble \@author@count#2 \@author@present
1767 %\CO@opr \@secondofthree \@collaboration@count\AU@temp\@tempcnta \@collaboration@present\AU@temp \@collaboration@present\AU@temp \@collaboration@gobble
1768 %
1769 %\CO@opr\@author@cleared
1770 % \end{verbatim}
1771 % \begin{macrocode}
1772 \appdef\frontmatter@init{%
1773 \let\AU@grp\@empty
1774 \let\CO@grp\@empty
1775 \let\AF@grp\@empty
1776 \let\@AAC@list\@empty
1777 \let\@AFG@list\@empty
1778 \let\@AFF@list\@empty
1779 }%
1780 % \end{macrocode}
1781 % \end{macro}
1782 % \end{macro}
1783 % \end{macro}
1784 % \end{macro}
1785 % \end{macro}
1786 %
1787 % \begin{macro}{\@AF@join}
1788 % The \cmd\csname\ \cmd\@AF@join\ is a procedure used within
1789 % \cmd\email, \cmd\homepage, \cmd\thanks, and \cmd\altaffiliation.
1790 % When such a command appears after an \cmd\author, \cmd\collaboration, or \cmd\affiliation
1791 % command, the \cmd\@AF@join\ procedure appends the argument given to the appropriate
1792 % macro.
1793 % Its default is to give an error message, since these commands are legal only within
1794 % the particular context mentioned.
1795 % \begin{macrocode}
1796 \appdef\frontmatter@init{%
1797 \let\@AF@join\@AF@join@error
1798 }%
1799 \def\@AF@join@error#1{%
1800 \class@warn{%
1801 \string\email, \string\homepage, \string\thanks, or \string\altaffiliation\space
1802 appears in wrong context.
1803 }%
1804 }%
1805 % \end{macrocode}
1806 % \end{macro}
1807 %
1808 %
1809 % \subsubsection{Commands for auxiliary information}%
1810 %
1811 % \begin{macro}{\email}
1812 % Just tacks the email address on to the current author or affiliation.
1813 % \changes{4.1a}{2008-07-01}{(AO, 496) remove default prependation to \cs{email}.}
1814 % \begin{macrocode}
1815 \def\sanitize@url{%
1816 \@makeother\%%
1817 \@makeother\~%
1818 \@makeother\_%
1819 }%
1820 \newcommand*\email[1][]{\begingroup\sanitize@url\@email{#1}}%
1821 \def\@email#1#2{%
1822 \endgroup
1823 \@AF@join{#1\href{mailto:#2}{#2}}%
1824 }%
1825 % \end{macrocode}
1826 % \end{macro}
1827 %
1828 % \begin{macro}{\homepage}
1829 % Just tacks the URL on to the current author or affiliation.
1830 % Note: group opened in \cmd\homepage\ is closed in \cmd\@homepage.
1831 % \changes{4.1a}{2008-07-01}{(AO, 496) remove default prependation to \cs{homepage}.}
1832 % \changes{4.1n}{2009/12/03}{(AO) remove http:// from \cs{href} call}
1833 % \begin{macrocode}
1834 \newcommand*\homepage[1][]{\begingroup\sanitize@url\@homepage{#1}}%
1835 \def\@homepage#1#2{%
1836 \endgroup
1837 \@AF@join{#1\href{#2}{#2}}%
1838 }%
1839 % \end{macrocode}
1840 % \end{macro}
1841 %
1842 % \begin{macro}{\href}
1843 % The document may load a package that defines either of these commands;
1844 % if not, we give a default meaning.
1845 % \begin{macrocode}
1846 \appdef\class@documenthook{%
1847 \providecommand\href[1]{}%
1848 }%
1849 % \end{macrocode}
1850 % \end{macro}
1851 %
1852 % \begin{macro}{\thanks}
1853 % \changes{4.1b}{2008/08/02}{Make the syntax of this package switch optional}%
1854 %
1855 % The operative version of \cmd\thanks\ appends an item to \cmd\@author, or \cmd\@affil's auxiliary data.
1856 % \begin{macrocode}
1857 \def\frontmatter@thanks{% implicit #1
1858 \@AF@join
1859 }%
1860 % \end{macrocode}
1861 % \end{macro}
1862 %
1863 % \begin{macro}{\altaffiliation}
1864 % \changes{4.0d}{1998/01/31}{change name from \cs{tempaffiliation}}
1865 % \changes{4.0l}{1998/09/01}{add optional argument handling back}
1866 % Implemented more or less like \cmd\thanks\ but shares the affiliation
1867 % counter.
1868 % Optional argument may be used to give explanatory text eg
1869 % `currently staying at'
1870 % This will be placed before the address, if used in a footnote.
1871 % \begin{macrocode}
1872 \newcommand*\altaffiliation[2][]{%
1873 \@AF@join{#1#2}%
1874 }%
1875 % \end{macrocode}
1876 % \end{macro}
1877 %
1878 %
1879 % \subsubsection{Procedures for author, collaboration, and affiliation}%
1880 %
1881 % Macros that list off, say, authors, and which require punctuation, like ``A, B, and C'', will use
1882 % \cmd\set@listcomma@list, \cmd\set@listcomma@count, \cmd\@listand, and \cmd\@listcomma.
1883 % These macros use the \cmd\@tempcnta\ register to keep track of how many items remain to be listed off.
1884 %
1885 % At present, \cmd\@author@present\ will decrement that counter.
1886 %
1887 % \begin{macro}{\set@listcomma@list}
1888 % \begin{macro}{\set@listcomma@count}
1889 % \changes{4.0l}{1998/09/01}{macro added}
1890 % Pop the author count for this collaboration.
1891 %
1892 % Note: by side effect, it assigns \cmd\@listcomma:
1893 % for a list of length two, suppress comma addition.
1894 % \begin{macrocode}
1895 \def\set@listcomma@list#1{%
1896 \expandafter\@reset@ac\expandafter#1#1{0}\@reset@ac{%
1897 \let\@listcomma\relax
1898 }{%
1899 \let\@listcomma\@listcomma@comma
1900 }%
1901 }%
1902 \def\set@listcomma@count#1{%
1903 \@ifnum{#1=\tw@}{%
1904 \let\@listcomma\relax
1905 }{%
1906 \let\@listcomma\@listcomma@comma
1907 }%
1908 }%
1909 % \end{macrocode}
1910 % Does the actual pop operation, then generates a Boolean which selects one of the two assignments for \cmd\@listcomma.
1911 %
1912 % Note: this procedure sets \cmd\@tempcnta\ to reflect the number of items to list off.
1913 % \begin{macrocode}
1914 \def\@reset@ac#1#2#3\@reset@ac{%
1915 \def#1{#3}%
1916 \@tempcnta#2\relax
1917 \@ifnum{#2=\tw@}%
1918 }%
1919 % \end{macrocode}
1920 % \end{macro}
1921 % \end{macro}
1922 %
1923 % \begin{macro}{\listand}
1924 % Might need extending with penalties etc.
1925 %
1926 % Note: this procedure expects \cmd\@tempcnta\ to reflect the current number of items remaining to list off.
1927 % \begin{macrocode}
1928 \def\@listand{\@ifnum{\@tempcnta=\tw@}{\andname\space}{}}%
1929 % \end{macrocode}
1930 % \end{macro}
1931 %
1932 % \begin{macro}{\@listcomma}
1933 % This definition, with \cmd\@ne\ puts a comma before and.
1934 %
1935 % David Carlisle says: In UK English (at least) would have \cmd\tw@\ here,
1936 % which would then implement the convention of indicating conjunction with comma or ``and'', but not both.
1937 %
1938 % Note: this procedure expects \cmd\@tempcnta\ to reflect the current number of items remaining to list off.
1939 % \begin{macrocode}
1940 \def\@listcomma@comma{\@ifnum{\@tempcnta>\@ne}{,}{}}%
1941 \def\@listcomma@comma@UK{\@ifnum{\@tempcnta>\tw@}{,}{}}%
1942 % \end{macrocode}
1943 % \end{macro}
1944 %
1945 % \begin{macro}{\@collaboration@gobble}
1946 % This command will be the synonym of \cmd\CO@grp\ during the expansion of \cmd\@AAC@list,
1947 % within \cmd\affils@present@group execution (in a \classoption{groupedaddress} situation).
1948 %
1949 % \changes{4.1m}{2009/11/20}{(AO, 563) Let \cs{@collaboration@gobble} parse all three arguments of \cs{CO@opr}}
1950 % \begin{macrocode}
1951 \def\@collaboration@gobble#1#2#3{}%
1952 % \end{macrocode}
1953 % \end{macro}
1954 %
1955 % \begin{macro}{\doauthor}
1956 % \changes{4.1b}{2008/08/04}{Provide facility \cs{affil@cutoff}: if there is only one affiliation on the title page, no superscript}%
1957 % \changes{4.1n}{2009/11/30}{(AO, 567) Handle punctuation for \classoption{superscriptaddress} style authors' extra information, such as \cs{email}}
1958 % Main control over how authors are typeset.
1959 %
1960 % |#1| is loaded by \cmd\author
1961 %
1962 % |#2| is loaded by \cmd\email, \cmd\homepage, \cmd\altaffiliation, or \cmd\thanks
1963 %
1964 % |#3| is the superscript affiliation, if at all used.
1965 %
1966 % First, the author name is formatted, followed by a comma,
1967 % then come any marks relating to affiliation (if present),
1968 % then come the homepage URL and email address, if any, with
1969 % appropriate punctuation.
1970 %
1971 % Here, as in \cmd\@affil@script, the parameter \cmd\affil@cutoff\
1972 % controls whether the argument \#3 is produced as a superscript label
1973 % connecting this author with its affiliation. (If there is only one
1974 % affiliation on the title page, it makes sense to remove the superscript.)
1975 %
1976 % Note that argument \#3 must effectively execute either
1977 % \cmd\aftergroup\cmd\true@sw\ or \cmd\aftergroup\cmd\false@sw\ (exactly once!).
1978 % In the case of \classoption{superscriptaddress}, this is done when
1979 % \cmd\@author@present@script\ invokes \cmd\doauthor\ with its third argument containing
1980 % \cmd\@affil@present@script.
1981 % Otherwise (e.g., \classoption{groupedaddress}), \cmd\doauthor\ is invoked by
1982 % \cmd\@author@present@group\ with its third argument containing \cmd\@affil@present@group.
1983 % \begin{macrocode}
1984 \def\doauthor#1#2#3{%
1985 \ignorespaces#1\unskip\@listcomma
1986 \begingroup
1987 #3%
1988 % \end{macrocode}
1989 % At this point, we must have queued up a Boolean (either \cmd\true@sw\ or \cmd\false@sw).
1990 % \begin{macrocode}
1991 \@if@empty{#2}{\endgroup{}{}}{\endgroup{\comma@space}{}\frontmatter@footnote{#2}}%
1992 \space \@listand
1993 }%
1994 % \end{macrocode}
1995 % \end{macro}
1996 %
1997 % \begin{macro}{\x@match}
1998 % Procedure \cmd\x@match\ is used as an alias \cmd\AFG@opr,
1999 % probing the list of affiliation groups
2000 % and setting a Boolean if a match is found to \#1 (usually the current affiliation group).
2001 %
2002 % Procedure \cmd\y@match\ is used as an alias to \cmd\@TBN@opr,
2003 % probing the list of unique title block footnotes for a match to the footnote text:
2004 % when the first match is found it sets a Boolean,
2005 % defining \cmd\@tempb\ to the number of that footnote.
2006 % \begin{macrocode}
2007 \def\x@match#1#2{%
2008 \temp@sw{}{%
2009 \def\@tempifx{#2}%
2010 \@ifx{\@tempifx#1}{%
2011 \@booleantrue\temp@sw
2012 }{%
2013 }%
2014 }%
2015 }%
2016 \def\y@match#1#2#3{%
2017 \temp@sw{}{%
2018 \def\@tempifx{#3}%
2019 \@ifx{\@tempifx#1}{%
2020 \@booleantrue\temp@sw
2021 \def\@tempb{#2}%
2022 }{%
2023 }%
2024 }%
2025 }%
2026 % \end{macrocode}
2027 % \end{macro}
2028 %
2029 % \begin{macro}{\frontmatter@footnote}
2030 % Used when typesetting a title block footnote.
2031 % (Item 290: merge duplicates.)
2032 %
2033 % Maintains a list of frontmatter footnotes along with associated device.
2034 % Uniquifies each footnote by traversing the list and looking for a match to the footnote text.
2035 % If found, define \cmd\@tempb\ to the corresponding footnote device, and typeset it with \cmd\@footnotemark.
2036 % If never found, manually increment footnote counter,
2037 % determine the corresponding footnote device, and
2038 % add footnote text and device to the list of frontmatter footnotes.
2039 %
2040 % The list \cmd\@FMN@list\ is processed later in the title block production.
2041 %
2042 % Note that this method of making footnotes runs afoul of \classname{hyperref}'s patches of the \LaTeX\ kernel.
2043 % Therefore, we avoid trouble by refraining from using \cmd\@footnotemark\ and by creating our own hypertext links.
2044 % \begin{macrocode}
2045 \def\frontmatter@footnote#1{%
2046 \begingroup
2047 \@booleanfalse\temp@sw
2048 \def\@tempa{#1}%
2049 \let\@tempb\@empty
2050 \def\@TBN@opr{\y@match\@tempa}%
2051 \@FMN@list
2052 % \end{macrocode}
2053 % By side effect, \cmd\@tempb\ holds the value of the footnote counter if
2054 % This note has been seen before. Otherwise \cmd\temp@sw\ is false.
2055 % \begin{macrocode}
2056 \temp@sw{%
2057 \expandafter\frontmatter@footnotemark
2058 \expandafter{\@tempb}%
2059 }{%
2060 % \end{macrocode}
2061 % Execute \cmd\frontmatter@foot@mark, feeding it the value of the current footnote counter.
2062 % This call requires two levels of pre-expansion to accomplish, the first to expand \cmd\csname, the second to evaluate \cmd\the.
2063 % \begin{macrocode}
2064 \stepcounter\@mpfn
2065 \expandafter\expandafter
2066 \expandafter\frontmatter@foot@mark
2067 \expandafter\expandafter
2068 \expandafter{%
2069 \expandafter \the\csname c@\@mpfn\endcsname
2070 }{#1}%
2071 }%
2072 \endgroup
2073 }%
2074 % \end{macrocode}
2075 % Procedure \cmd\frontmatter@foot@mark\ lays down the footnote device (mark) and takes care of the footnote text.
2076 % The latter merely involves queueing that text (along with its associated device) into \cmd\@FMN@list.
2077 % \begin{macrocode}
2078 \def\frontmatter@foot@mark#1#2{%
2079 \frontmatter@footnotemark{#1}%
2080 \g@addto@macro\@FMN@list{\@TBN@opr{#1}{#2}}%
2081 }%
2082 \appdef\frontmatter@init{%
2083 \global\let\@FMN@list\@empty
2084 }%
2085 % \end{macrocode}
2086 % \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
2087 % \begin{macrocode}
2088 \def\frontmatter@footnotemark#1{%
2089 \leavevmode
2090 \ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi
2091 \begingroup
2092 \hyper@linkstart {link}{frontmatter.#1}%
2093 \csname c@\@mpfn\endcsname#1\relax
2094 \def\@thefnmark{\frontmatter@thefootnote}%
2095 \@makefnmark
2096 \hyper@linkend
2097 \endgroup
2098 \ifhmode\spacefactor\@x@sf\fi
2099 \relax
2100 }%
2101 % \end{macrocode}
2102 % \end{macro}
2103 %
2104 %
2105 %
2106 % \subsection{The keywords command}%
2107 % \begin{macro}{\keywords}
2108 % \begin{macro}{\@keywords}
2109 % Usual game, save text in a macro for processing by \cmd\maketitle.
2110 % \begin{macrocode}
2111 \def\keywords#1{%
2112 \aftermaketitle@chk{\keywords}%
2113 \gdef\@keywords{#1}%
2114 }%
2115 \appdef\frontmatter@init{%
2116 \let\@keywords\@empty
2117 }%
2118 % \end{macrocode}
2119 % \end{macro}
2120 % \end{macro}
2121 %
2122 % \subsection{The \cs{date} command and related commands}%
2123 % \begin{macro}{\date}
2124 % \begin{macro}{\received}
2125 % \begin{macro}{\revised}
2126 % \begin{macro}{\accepted}
2127 % \begin{macro}{\published}
2128 % \begin{macro}{\@date}
2129 % \begin{macro}{\@received}
2130 % \begin{macro}{\@revised}
2131 % \begin{macro}{\@accepted}
2132 % \begin{macro}{\@published}
2133 % \changes{4.1b}{2008/08/02}{Make the syntax of this package switch optional}%
2134 % Use the \cmd\date\ command to specify the document date,
2135 % the \cmd\received\ command to specify the date received,
2136 % \cmd\revised\ for date revised,
2137 % \cmd\accepted\ for date accepted, and
2138 % \cmd\published\ for date published.
2139 % Normally only \cmd\date\ to be used by author,
2140 % the remainder used only by editors.
2141 %
2142 % DPC: As for \cmd\keywords, but this time don't flag a warning if there is no
2143 % revision date specified.
2144 %
2145 % In each case the user-level command defines the value of a
2146 % macro which buffers the data entered by the user.
2147 % For instance, \cmd\received\ causes \cmd\@received\ to
2148 % acquire a value.
2149 % The optional argument allows the user to override the
2150 % text that will be typeset along with the date;
2151 % the default value of that text is itself
2152 % a localized macro.
2153 % \begin{macrocode}
2154 \newcommand*\frontmatter@date[2][\Dated@name]{\def\@date{#1#2}}%
2155 \def\@date{}%
2156 \newcommand*\received[2][\Received@name]{\def\@received{#1#2}}%
2157 \def\@received{}%
2158 \newcommand*\revised[2][\Revised@name]{\def\@revised{#1#2}}%
2159 \def\@revised{}%
2160 \newcommand*\accepted[2][\Accepted@name]{\def\@accepted{#1#2}}%
2161 \def\@accepted{}%
2162 \newcommand*\published[2][\Published@name]{\def\@published{#1#2}}%
2163 \def\@published{}%
2164 % \end{macrocode}
2165 %
2166 % \end{macro}
2167 % \end{macro}
2168 % \end{macro}
2169 % \end{macro}
2170 % \end{macro}
2171 % \end{macro}
2172 % \end{macro}
2173 % \end{macro}
2174 % \end{macro}
2175 % \end{macro}
2176 %
2177 % \subsection{The pacs command}%
2178 % PACS, the Physics and Astronomy Classification Scheme.
2179 % \begin{macro}{\pacs}
2180 % \begin{macro}{\@pacs}
2181 % As for \cmd\keywords\
2182 % \begin{macrocode}
2183 \def\pacs#1{%
2184 \aftermaketitle@chk{\pacs}%
2185 \gdef\@pacs{#1}%
2186 }%
2187 \appdef\frontmatter@init{%
2188 \let\@pacs\@empty
2189 }%
2190 % \end{macrocode}
2191 % \end{macro}
2192 % \end{macro}
2193 %
2194 % \subsection{The \cs{preprint} command}
2195 %
2196 % \changes{4.0g}{1998/06/10}{multiple preprint commands}
2197 % \begin{macrocode}
2198 \def\preprint#1{\gappdef\@preprint{\preprint{#1}}}%
2199 \appdef\frontmatter@init{%
2200 \let\@preprint\@empty
2201 }%
2202 % \end{macrocode}
2203 %
2204 % \subsection{The \env{abstract} environment}%
2205 %
2206 % \changes{4.0b}{1999/06/20}{Gathered all code for the abstract environment together and abstracted out the formatting details for journals to override.}
2207 %
2208 % \begin{macro}{\absbox}
2209 %
2210 % \begin{macrocode}
2211 \newbox\absbox
2212 % \end{macrocode}
2213 % \end{macro}
2214 %
2215 % \begin{environment}{abstract}
2216 % Abstract, as in AMS classes, must be specified \emph{before}
2217 % \cmd\maketitle. It just saves everything up in \cmd\absbox.
2218 % \changes{4.0d}{1998/01/31}{If empty \cs{abstractname} omit spacing}
2219 % \changes{4.0d}{1998/01/31}{hookify}
2220 % Note that the specifics of how the abstract is to be
2221 % formatted are set by \cmd\frontmatter@abstractwidth,
2222 % \cmd\frontmatter@abstractheading, and \cmd\frontmatter@abstractfont.
2223 %
2224 % Here we wish to set the abstract into type but save it away in a box, much like
2225 % the \cmd\minipage\ command does.
2226 %
2227 % Note that the \cmd\endabstract\ portion of the environment
2228 % begins with code that mostly duplicates \cmd\endminipage, but without the \cmd\@iiiparbox.
2229 % At the end, we simply transfer the contents of the \cmd\minipage\
2230 % into a box of our own.
2231 %
2232 % However, we also have to end the gratuitous
2233 % paragraph begun by \cmd\minipage.
2234 % We ensure that no trace of that paragraph is left,
2235 % by absorbing the \cmd\parindent\ box.
2236 % Doing so destroys the paragraph entirely, except
2237 % for the \cmd\parskip\ glue, and that morsel is pruned, because we are at the top
2238 % of a page.
2239 %
2240 % This mechanism is vulnerable, however, because anything placed into the horizontal list
2241 % after the \cmd\parindent\ box will confound it.
2242 % And that is exactly what happens under Mik\TeX:
2243 % There seems to be an extension to the \TeX\ standard operating here which inserts a \cmd\special \ at the beginning of every paragraph.
2244 % (The mechnism is \emph{not} based on \cmd\everypar.)
2245 %
2246 % To accomodate this state of affairs,
2247 % we have a new mechanism that offers an even more complete rewrite of \env{minipage}.
2248 %
2249 % Note that an entry is made in the toc for the abstract; this has the side effect
2250 % of creating a PDF bookmark for this element if the \classname{hyperref} package is in effect.
2251 % \changes{4.1a}{2008-06-30}{(AO, 443) create an entry in the PDF bookmarks for the abstract via the toc}
2252 % \begin{macrocode}
2253 \def\toclevel@abstract{1}%
2254 \def\addcontents@abstract{%
2255 \phantomsection
2256 \expandafter\def\csname Parent0\endcsname{section*.2}%
2257 \expandafter\@argswap@val\expandafter{\abstractname}{\addcontentsline{toc}{abstract}}%
2258 }%
2259 \newenvironment{frontmatter@abstract}{%
2260 \aftermaketitle@chk{\begin{abstract}}%
2261 \global\setbox\absbox\vbox\bgroup
2262 \color@begingroup
2263 \columnwidth\textwidth
2264 \hsize\columnwidth
2265 \@parboxrestore
2266 % \end{macrocode}
2267 % The following line switches footnotes to the \texttt{mpfoootnote} series.
2268 % This action should rather be taken by \cmd\frontmatter@abstractfont, which can be customized.
2269 % There is also an interaction with \cmd\mini@note.
2270 % \begin{macrocode}
2271 \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@
2272 \let\@footnotetext\frontmatter@footnotetext
2273 \minipagefootnote@init
2274 \let\set@listindent\set@listindent@
2275 \let\@listdepth\@mplistdepth \@mplistdepth\z@
2276 \let@environment{description}{frontmatter@description}%
2277 \@minipagerestore
2278 \@setminipage
2279 \frontmatter@abstractheading
2280 \frontmatter@abstractfont
2281 \let\footnote\mini@note
2282 \expandafter\everypar\expandafter{\the\everypar\addcontents@abstract\everypar{}}%
2283 }{%
2284 \par
2285 \unskip
2286 \minipagefootnote@here
2287 \@minipagefalse %% added 24 May 89
2288 \color@endgroup
2289 \egroup
2290 }%
2291 % \end{macrocode}
2292 % \end{environment}
2293 %
2294 % \begin{macro}{\frontmatter@footnotetext}
2295 % We reimplement \cmd\@mpfootnotetext\ under a new name (so as not to be overridden by the \classname{hyperref} package)
2296 % and extend it to accomodate hyperrefs.
2297 %
2298 % Note that this procedure is very like \classname{ltxutil}'s \cmd\mp@footnotetext, except that it
2299 % uses \cmd\frontmatter@makefntext\ instead of \cmd\@makefntext.
2300 %
2301 % \changes{4.1f}{2009/07/07}{(AO, 515) Use \cs{set@footnotefont}, which is defined in ltxutil}
2302 % \changes{4.1n}{2010/01/02}{(AO, 571) allow split after last line of footnote}%
2303 % \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
2304 % \begin{macrocode}
2305 \long\def\frontmatter@footnotetext#1{%
2306 \minipagefootnote@pick
2307 \set@footnotefont
2308 \set@footnotewidth
2309 \@parboxrestore
2310 \protected@edef\@currentlabel{\csname p@\@mpfn\endcsname\@thefnmark}%
2311 \color@begingroup
2312 \frontmatter@makefntext{%
2313 \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox\vadjust{\vskip\z@skip}%
2314 }%
2315 \color@endgroup
2316 \minipagefootnote@drop
2317 }%
2318 % \end{macrocode}
2319 % \end{macro}
2320 %
2321 % \begin{macro}{\ltx@no@footwarn}
2322 %
2323 % \begin{macrocode}
2324 \def\ltx@no@footnote{%
2325 \let\ltx@xfootnote\ltx@no@xfootnote\let\ltx@yfootnote\ltx@no@yfootnote
2326 \let\ltx@xfootmark\ltx@no@xfootmark\let\ltx@yfootmark\ltx@no@yfootmark
2327 \let\ltx@xfoottext\ltx@no@xfoottext\let\ltx@yfoottext\ltx@no@yfoottext
2328 }%
2329 \def\ltx@no@xfootnote[#1]#2{\ltx@no@footwarn\footnote}%
2330 \def\ltx@no@yfootnote#1{\ltx@no@footwarn\footnote}%
2331 \def\ltx@no@xfootmark[#1]{\ltx@no@footwarn\footnotemark}%
2332 \def\ltx@no@yfootmark{\ltx@no@footwarn\footnotemark}%
2333 \def\ltx@no@xfoottext[#1]#2{\ltx@no@footwarn\footnotetext}%
2334 \def\ltx@no@yfoottext#1{\ltx@no@footwarn\footnotetext}%
2335 \def\ltx@no@footwarn#1{%
2336 \class@warn{%
2337 The \string#1\space command is not legal on the title page;
2338 using \string\thanks\space instead might suit you: consult the manual for details%
2339 }%
2340 }%
2341 % \end{macrocode}
2342 % \end{macro}
2343 %
2344 % \begin{macro}{\frontmatter@abstractheading}
2345 % The default abstract head; journals will override this procedure.
2346 % \begin{macrocode}
2347 \def\frontmatter@abstractheading{%
2348 \begingroup
2349 \centering\large
2350 \abstractname
2351 \par
2352 \endgroup
2353 }%
2354 % \end{macrocode}
2355 % \end{macro}
2356 %
2357 % \begin{macro}{\frontmatter@abstractfont}
2358 % The default type specification for the body of the abstract.
2359 % Journals will override this setting.
2360 % \begin{macrocode}
2361 \def\frontmatter@abstractfont{}%
2362 % \end{macrocode}
2363 % \end{macro}
2364 %
2365 % \begin{macro}{frontmatter@description}
2366 % \changes{4.1b}{2008/06/29}{(AO, 455) provide a \texttt{description} environment for the abstract}
2367 % Within the abstract, the description environment is defined as follows:
2368 % \begin{macrocode}
2369 \newenvironment{frontmatter@description}{%
2370 \list{}{%
2371 \leftmargin\z@
2372 \labelwidth\z@
2373 % \end{macrocode}
2374 % \begin{verbatim}
2375 % \itemindent-\leftmargin
2376 % \end{verbatim}
2377 % \begin{macrocode}
2378 \itemindent\z@
2379 \let\makelabel\frontmatter@descriptionlabel
2380 }%
2381 }{%
2382 \endlist
2383 }%
2384 \def\frontmatter@descriptionlabel#1{%
2385 \hspace\labelsep
2386 \normalfont\bfseries
2387 #1:%
2388 }%
2389 % \end{macrocode}
2390 % \end{macro}
2391 %
2392 % \begin{macro}{\frontmatter@abstractwidth}
2393 % The default setting is the full text width;
2394 % journals can override this setting.
2395 % \begin{macrocode}
2396 \def\frontmatter@abstractwidth{\textwidth}
2397 % \end{macrocode}
2398 % \end{macro}
2399 %
2400 % \begin{macro}{\frontmatter@abstract@produce}
2401 % This procedure determines how the abstract is incorporated
2402 % into the title block. We split this out in anticipation
2403 % of the need to lift the limitation that the abstract not break over pages.
2404 %
2405 % If we are in preprint style, we provide an easy pagebreak point immediately above the abstract.
2406 % This means that the abstract will either fit entirely on the same page as the title block,
2407 % or it will start a page of its own (which may itself break onto a subsequent page if necessary).
2408 % \begin{macrocode}
2409 \def\frontmatter@abstract@produce{%
2410 \par
2411 \preprintsty@sw{%
2412 \do@output@MVL{%
2413 \vskip\frontmatter@preabstractspace
2414 \vskip200\p@\@plus1fil
2415 \penalty-200\relax
2416 \vskip-200\p@\@plus-1fil
2417 }%
2418 }{%
2419 \addvspace{\frontmatter@preabstractspace}%
2420 }%
2421 \begingroup
2422 \dimen@\baselineskip
2423 \setbox\z@\vtop{\unvcopy\absbox}%
2424 \advance\dimen@-\ht\z@\advance\dimen@-\prevdepth
2425 \@ifdim{\dimen@>\z@}{\vskip\dimen@}{}%
2426 \endgroup
2427 \begingroup
2428 \prep@absbox
2429 \unvbox\absbox
2430 \post@absbox
2431 \endgroup
2432 \@ifx{\@empty\mini@notes}{}{\mini@notes\par}%
2433 \addvspace\frontmatter@postabstractspace
2434 }%
2435 \appdef\frontmatter@init{\let\mini@notes\@empty}%
2436 \let\prep@absbox\@empty
2437 \let\post@absbox\@empty
2438 % \end{macrocode}
2439 % \end{macro}
2440 %
2441 % \begin{macro}{\frontmatter@preabstractspace}
2442 % \begin{macro}{\frontmatter@postabstractspace}
2443 % Space above and space below abstract in title block
2444 % \begin{macrocode}
2445 \def\frontmatter@preabstractspace{.5\baselineskip}
2446 \def\frontmatter@postabstractspace{.5\baselineskip}
2447 % \end{macrocode}
2448 % \end{macro}
2449 % \end{macro}
2450 %
2451 %
2452 %
2453 % \subsection{Formatting the title block}%
2454 %
2455 % \begin{environment}{titlepage}
2456 % This is \LaTeXe's \classname{article} class version,
2457 % with modifications.
2458 % \changes{4.0c}{1999/11/13}{grid changes with ltxgrid}
2459 % \changes{4.1b}{2008/08/02}{Make the syntax of this package switch optional}%
2460 % \begin{macrocode}
2461 \newenvironment{frontmatter@titlepage}{%
2462 \twocolumn@sw{\onecolumngrid}{\newpage}%
2463 \thispagestyle{titlepage}%
2464 \setcounter{page}\@ne
2465 }{%
2466 \twocolumn@sw{\twocolumngrid}{\newpage}%
2467 \twoside@sw{}{%
2468 \setcounter{page}\@ne
2469 }%
2470 }%
2471 % \end{macrocode}
2472 % \end{environment}
2473 %
2474 % \begin{macro}{\maketitle}
2475 % \changes{4.0d}{1998/01/31}{hookify}
2476 % Put it all together to format the title block.
2477 %
2478 % Gotcha!
2479 % If you expand \cmd\csname undefined\cmd\endcsname, you change the meaning of \cmd\undefined\ from
2480 % ``Undefined'' to \cmd\relax.
2481 % Watchout!
2482 % \begin{macrocode}
2483 \def\frontmatter@maketitle{%
2484 \@author@finish
2485 \title@column\titleblock@produce
2486 \suppressfloats[t]%
2487 % \end{macrocode}
2488 % Now save some memory.
2489 % \begin{macrocode}
2490 \let\and\relax
2491 \let\affiliation\@gobble
2492 \let\author\@gobble
2493 \let\@AAC@list\@empty
2494 \let\@AFF@list\@empty
2495 \let\@AFG@list\@empty
2496 \let\@AF@join\@AF@join@error
2497 \let\email\@gobble
2498 \let\@address\@empty
2499 \let\maketitle\relax
2500 \let\thanks\@gobble
2501 \let\abstract\@undefined\let\endabstract\@undefined
2502 \titlepage@sw{%
2503 \vfil
2504 \clearpage
2505 }{}%
2506 }%
2507 % \end{macrocode}
2508 % \end{macro}
2509 %
2510 % \begin{macro}{\maketitle@Hy}
2511 % \changes{4.1c}{2008/08/04}{Hyperref compatibility: take \cs{maketitle} back.}
2512 % We provide the means to take back the definition of \cmd\maketitle\ from \classname{hyperref}:
2513 % we do not need its help in providing hypertext services in the title page.
2514 % \begin{macrocode}
2515 \def\maketitle@Hy{%
2516 \let\Hy@saved@footnotemark\@footnotemark
2517 \let\Hy@saved@footnotetext\@footnotetext
2518 \let\@footnotemark\H@@footnotemark
2519 \let\@footnotetext\H@@footnotetext
2520 \@ifnextchar[%]
2521 \Hy@maketitle@optarg
2522 {%
2523 \HyOrg@maketitle
2524 \Hy@maketitle@end
2525 }%
2526 }%
2527 \appdef\class@documenthook{%
2528 \@ifx{\maketitle\maketitle@Hy}{%
2529 \class@info{Taking \string\maketitle\space back from hyperref}%
2530 \let\maketitle\frontmatter@maketitle
2531 }{%
2532 }%
2533 }%
2534 % \end{macrocode}
2535 % \end{macro}
2536 %
2537 % \begin{macro}{\titleblock@produce}
2538 % This procedure produces the title block.
2539 %
2540 % It effectively executes inside a group
2541 % and always returns us to vertical mode.
2542 %
2543 % Note: we assume that it is OK to set the footnote counter to zero at this point.
2544 % Is this a safe assumption?
2545 % \begin{macrocode}
2546 \def\titleblock@produce{%
2547 \begingroup
2548 % \end{macrocode}
2549 % \changes{4.0b}{1999/06/20}{Set \cs{footnote} to \LaTeX\ standard version for this scope.}
2550 % First, we restore the footnote mechanism to its default state,
2551 % then we customize the way the footnote mark is produced and how it is formatted.
2552 % \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
2553 % \begin{macrocode}
2554 \ltx@footnote@pop
2555 % \end{macrocode}
2556 % The following three lines establish an independent footnote counter for use in the title block.
2557 % \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
2558 % \begin{macrocode}
2559 \def\@mpfn{mpfootnote}%
2560 \def\thempfn{\thempfootnote}%
2561 \c@mpfootnote\z@
2562 \let\@makefnmark\frontmatter@makefnmark
2563 \frontmatter@setup
2564 \thispagestyle{titlepage}\label{FirstPage}%
2565 % \end{macrocode}
2566 % Produce the title:
2567 % \begin{macrocode}
2568 \frontmatter@title@produce
2569 % \end{macrocode}
2570 % Produce the author list:
2571 % \begin{macrocode}
2572 \groupauthors@sw{%
2573 \frontmatter@author@produce@group
2574 }{%
2575 \frontmatter@author@produce@script
2576 }%
2577 % \end{macrocode}
2578 % Produce the dates:
2579 % \begin{macrocode}
2580 \frontmatter@RRAPformat{%
2581 \expandafter\produce@RRAP\expandafter{\@date}%
2582 \expandafter\produce@RRAP\expandafter{\@received}%
2583 \expandafter\produce@RRAP\expandafter{\@revised}%
2584 \expandafter\produce@RRAP\expandafter{\@accepted}%
2585 \expandafter\produce@RRAP\expandafter{\@published}%
2586 }%
2587 % \end{macrocode}
2588 % Produce the abstract, PACS, and keywords, and end any paragraph.
2589 % \changes{4.1c}{2008/08/04}{Produce PACS, keywords only if specified}%
2590 % \begin{macrocode}
2591 \frontmatter@abstract@produce
2592 \@ifx@empty\@pacs{}{%
2593 \@pacs@produce\@pacs
2594 }%
2595 \@ifx@empty\@keywords{}{%
2596 \@keywords@produce\@keywords
2597 }%
2598 \par
2599 \frontmatter@finalspace
2600 \endgroup
2601 }%
2602 % \end{macrocode}
2603 % \end{macro}
2604 %
2605 % \begin{macro}{\frontmatter@title@produce}
2606 % The default formatting procedure for the article title.
2607 % This procedure should take care of the vertical space below the title.
2608 %
2609 % Clients may override this procedure, but it is more likely that they will
2610 % use the hooks \cmd\frontmatter@title@above, \cmd\frontmatter@title@format, and \cmd\frontmatter@title@below.
2611 % \changes{4.1b}{2008/08/04}{(AO, 443) PDF Bookmark for title page}%
2612 % \begin{macrocode}
2613 \def\toclevel@title{0}%
2614 \def\frontmatter@title@produce{%
2615 \begingroup
2616 \frontmatter@title@above
2617 \frontmatter@title@format
2618 \@title
2619 \unskip
2620 \phantomsection\expandafter\@argswap@val\expandafter{\@title}{\addcontentsline{toc}{title}}%
2621 \@ifx{\@title@aux\@title@aux@cleared}{}{%
2622 \expandafter\frontmatter@footnote\expandafter{\@title@aux}%
2623 }%
2624 \par
2625 \frontmatter@title@below
2626 \endgroup
2627 }%
2628 \appdef\let@mark{\let\\\relax}%
2629 % \end{macrocode}
2630 % \end{macro}
2631 %
2632 % \begin{macro}{\frontmatter@title@above}
2633 % \begin{macro}{\frontmatter@title@format}
2634 % \begin{macro}{\frontmatter@title@below}
2635 % The default values for formatting specifications for the article title.
2636 %
2637 % The procedure \cmd\frontmatter@title@above\ should take care of the vertical space above the title;
2638 % \cmd\frontmatter@title@below\ below.
2639 % The procedure \cmd\frontmatter@title@format\ should invoke any font switches, etc.
2640 % that may apply to the title.
2641 %
2642 % Journals will override this procedure.
2643 % \begin{macrocode}
2644 \def\frontmatter@title@above{}%
2645 \def\frontmatter@title@format{}%
2646 \def\frontmatter@title@below{\addvspace{\baselineskip}}%
2647 % \end{macrocode}
2648 % \end{macro}
2649 % \end{macro}
2650 % \end{macro}
2651 %
2652 % \subsubsection{Authors and affiliations in superscriptaddress style}
2653 %
2654 % \begin{macro}{\frontmatter@author@produce@script}
2655 % \changes{4.1b}{2008/08/02}{Provide for diagnostics via \cs{frontmatterverbose@sw}}
2656 % \cmd\frontmatter@author@produce@script\ is an alias for \cmd\frontmatter@author@produce,
2657 % the procedure that formats the author/affiliation list.
2658 %
2659 % In this case, the authors affiliations are being superscripted
2660 % (class option \classoption{superscriptaddress}).
2661 %
2662 % This procedure must ensure that any paragraph that it starts gets ended finally.
2663 % \changes{4.1i}{2009/10/18}{(AO, 540) More runtime diagnostics via \cs{frontmatterverbose@sw}}
2664 % \changes{4.1m}{2009/11/20}{(AO, 563) More complete runtime diagnostics via \cs{frontmatterverbose@sw}}
2665 % \begin{macrocode}
2666 \def\frontmatter@author@produce@script{%
2667 \begingroup
2668 \let\@author@present\@author@present@script
2669 \frontmatterverbose@sw{\typeout{\string\frontmatter@author@produce@script:}\say\@AAC@list\say\@AFF@list\say\@AFG@list}{}%
2670 % \end{macrocode}
2671 % \changes{4.0l}{1998/09/01}{Changes to add collaboration processing, which now means doing comma/and processing on each sublist}
2672 % When the author/affiliation list \cmd\@AAC@list\ is executed,
2673 % \cmd\@tempcnt\ counts each author,
2674 % and
2675 % \cmd\@tempa\ stores a list of author indices for the current collaboration.
2676 %
2677 % Note: this procedure uses \cmd\AU@temp\ to hold a list of author counts for each collaboration.
2678 % Note: also uses \cmd\@tempcnta\ to communicate between procedures.
2679 % This usage ot \cmd\@tempcnta\ is OK, because the expansion of \cmd\@AAC@list\ will trigger only the execution of
2680 % our own procedures.
2681 % \begin{macrocode}
2682 \let\AU@temp\@empty
2683 \@tempcnta\z@
2684 % \end{macrocode}
2685 %
2686 % We wish to know how many authors are in each collaboration, for the purposes of \cmd\listcomma\ and \cmd\listand.
2687 %
2688 % Here we assign values for the intercollated operators appearing within \cmd\@AAC@list,
2689 % then execute that macro, registering the authors in each collaboration.
2690 % Afterwards, clean up by emulating an empty collaboration.
2691 %
2692 % The result, stored in \cmd\AU@temp, is a list of brace-delmited tokens, each a number
2693 % representing the number of authors in that collaboration.
2694 % \begin{macrocode}
2695 \let\AF@opr \@gobble
2696 \def\AU@opr{\@author@count\@tempcnta}%
2697 \def\CO@opr{\@collaboration@count\AU@temp\@tempcnta}%
2698 \@AAC@list
2699 \expandafter\CO@opr\@author@cleared
2700 % \end{macrocode}
2701 % Next, present the authors and their affiliations, with the collaborations interleaved.
2702 %
2703 % We assign values for the intercollated operators appearing within \cmd\@AAC@list.
2704 % Next, assign \cmd\@listcomma\ based on the number of authors in the first collaboration.
2705 % Then expand \cmd\@AAC@list.
2706 %
2707 % Upon completion, there will be two space tokens following the last author because of \cmd\listand\ processing;
2708 % remove them, then end the last paragraph.
2709 %
2710 % FIXME: this juncture would be a good time to effectively eliminate
2711 % the unused affiliations in \cmd\@AFF@list.
2712 % \begin{macrocode}
2713 \begingroup
2714 \frontmatter@authorformat
2715 \let\AF@opr \@affilID@def
2716 \let\AU@opr \@author@present
2717 \def\CO@opr{\@collaboration@present\AU@temp}%
2718 \set@listcomma@list\AU@temp
2719 \@AAC@list
2720 \unskip\unskip
2721 \par
2722 \endgroup
2723 % \end{macrocode}
2724 % We now list out the affiliations in the order they appeared.
2725 % \begin{macrocode}
2726 \begingroup
2727 \frontmatter@above@affiliation@script
2728 \let\AFF@opr \@affil@script
2729 \@AFF@list
2730 \frontmatter@footnote@produce
2731 \par
2732 \endgroup
2733 \endgroup
2734 }%
2735 % \end{macrocode}
2736 % \end{macro}
2737 %
2738 % \begin{macro}{\@author@count}
2739 % This version of \cmd\AU@opr\ counts the number of authors it processes.
2740 % \begin{macrocode}
2741 \def\@author@count#1{%
2742 \advance#1\@ne
2743 \@author@gobble
2744 }%
2745 % \end{macrocode}
2746 % \end{macro}
2747 %
2748 % \begin{macro}{\@collaboration@present}
2749 % Format a collaboration.
2750 % Note that we immediately end the paragraph thus begun, because we only support
2751 % \classoption{superscriptaddress}-style processing.
2752 %
2753 % Note also that the execution of the production procedures takes place inside of a group;
2754 % for reasons of protective programming.
2755 %
2756 % Bug note: originally, the number of authors in each collaboration was stored in \cmd\@tempa,
2757 % but this exposed us to procedures in our production that modified the meaning of \cmd\@tempa.
2758 %
2759 % The last action done in this procedure is to assign \cmd\@listcomma\ based on the number of authors in the next collaboration.
2760 % \begin{macrocode}
2761 \def\@collaboration@present#1#2#3#4{%
2762 \par
2763 \begingroup
2764 \frontmatter@collaboration@above
2765 \@affilID@def{}%
2766 \@tempcnta\z@
2767 \@author@present{}{(\ignorespaces#3\unskip)}{#4}%
2768 \par
2769 \endgroup
2770 \set@listcomma@list#1%
2771 }%
2772 \def\frontmatter@collaboration@above{}%
2773 % \end{macrocode}
2774 % \end{macro}
2775 %
2776 % \begin{macro}{\@collaboration@count}
2777 % Simply register each author in this collaboration.
2778 % Note: \#1 is a \cmd\csname\ to hold the value, \#2 is the \cmd\count\ register holding the count of interest.
2779 % \begin{macrocode}
2780 \def\@collaboration@count#1#2{%
2781 \appdef@eval#1{\the#2}#2\z@
2782 \@author@gobble
2783 }%
2784 % \end{macrocode}
2785 % \end{macro}
2786 %
2787 % \begin{macro}{\@affilID@def}
2788 %
2789 % The \cmd\@affilID@def\ procedure, an alias of \cmd\AF@opr\ used during \cmd\frontmatter@author@produce@script\ processing,
2790 % memorizes the affiliation in \cmd\@affilID@temp.
2791 % \begin{macrocode}
2792 \def\@affilID@def{\def\@affilID@temp}%
2793 % \end{macrocode}
2794 % \end{macro}
2795 %
2796 % \begin{macro}{\@affilID@temp}
2797 %
2798 % The macro \cmd\@affilID@temp\ is used to communicate between
2799 % \cmd\doauthor\ and instances of \cmd\AF@opr\ within the author list.
2800 % \begin{macrocode}
2801 \let\@affilID@temp\@empty
2802 % \end{macrocode}
2803 % \end{macro}
2804 %
2805 % \begin{macro}{\affils@present@script}
2806 % An alias of \cmd\AFG@opr, this procedure is applied to elements in \cmd\@AFG@list.
2807 % It builds \cmd\@AFU@list, a list of unique affiliations found within affiliation groups.
2808 %
2809 % \changes{4.1a}{2008/06/16}{removed code that had been commented out}
2810 % \begin{verbatim}
2811 %\def\affils@present@script#1{%
2812 % \get@affil#1{}%
2813 %}%
2814 %\def\get@affil#1{%
2815 % \def\@tempa{#1}%
2816 % \@ifx{\@empty\@tempa}{}{%
2817 % \@booleanfalse\temp@sw
2818 % \def\AF@opr{\x@match\@tempa}%
2819 % \@AFU@list
2820 % \temp@sw{}{%
2821 % \appdef\@AFU@list{\AF@opr{#1}}%
2822 % }%
2823 % \get@affil
2824 % }%
2825 %}%
2826 % \end{verbatim}
2827 % \end{macro}
2828 %
2829 % \begin{macro}{\affil@present@script}
2830 % An alias of \cmd\AF@opr, this procedure is applied to \cmd\@AFU@list\ when formatting the affiliations
2831 % under \classoption{superscriptaddress}.
2832 % It in turn applies \cmd\affil@script\ to \cmd\@AFF@list, thereby formatting the affiliation
2833 % associated with this affiliation index.
2834 %
2835 % Note: it traverses the \cmd\@AFF@list\ for each entry in the \cmd\@AFU@list, thereby making this
2836 % portion of code execute in $N^{2}$ time.
2837 % \changes{4.1a}{2008/06/16}{removed code that had been commented out}
2838 % \begin{verbatim}
2839 %\def\affil@present@script#1{%
2840 % \def\@tempa{#1}%
2841 % \begingroup
2842 % \frontmatter@affiliationfont
2843 % \let\AFF@opr \affil@script
2844 % \@AFF@list
2845 % \endgroup
2846 %}%
2847 % \end{verbatim}
2848 % \end{macro}
2849 %
2850 % \begin{macro}{\affil@script}
2851 % Alias of \cmd\AFF@opr, this procedure is applied to \cmd\@AFF@list\ when formatting the affiliations
2852 % under \classoption{superscriptaddress}.
2853 % It rejects all entries not matching the affiliation index held in \cmd\@tempa.
2854 % \begin{macrocode}
2855 \def\affil@script#1#2#3{%
2856 \def\@tempifx{#1}\@ifx{\@tempifx\@tempa}{%
2857 \@if@empty{#2}{}{%
2858 \par
2859 \begingroup
2860 \def\@thefnmark{#1}\@makefnmark\ignorespaces
2861 #2%
2862 \@if@empty{#3}{}{\frontmatter@footnote{#3}}%
2863 \par
2864 \endgroup
2865 }%
2866 }{}%
2867 }%
2868 % \end{macrocode}
2869 % \end{macro}
2870 %
2871 % \begin{macro}{\@affil@script}
2872 % Alias of \cmd\AFF@opr:
2873 % The affiliations are being formatted in the case
2874 % where affiliations are being superscripted:
2875 % make a list out of the affiliations with the numbers printed.
2876 % Society-specific code can change the formatting
2877 % by overriding the definition of \cmd\frontmatter@affiliationfont.
2878 %
2879 % A client may choose to set \cmd\affil@cutoff\ to either \cmd\@ne\ (the default)
2880 % or \cmd\tw@. The latter setting will enforce a rule to the effect that
2881 % if a single affiliation appears on the title page,
2882 % then no affiliation superscript at all is produced.
2883 %
2884 % |#1|---Affiliation ID: a number; zero signifies a \cmd\noaffiliation.
2885 %
2886 % |#2|---Collaboration ID
2887 %
2888 % |#3|---Affiliation address
2889 %
2890 % |#4|---Auxiliary info
2891 % \begin{macrocode}
2892 \def\@affil@script#1#2#3#4{%
2893 % \end{macrocode}
2894 % If the affiliation is the \cmd\noaffiliation, then we do nothing.
2895 % \begin{macrocode}
2896 \@ifnum{#1=\z@}{}{%
2897 \par
2898 \begingroup
2899 \frontmatter@affiliationfont
2900 \@ifnum{\c@affil<\affil@cutoff}{}{%
2901 \def\@thefnmark{#1}\@makefnmark
2902 }%
2903 \ignorespaces#3%
2904 \@if@empty{#4}{}{\frontmatter@footnote{#4}}%
2905 \par
2906 \endgroup
2907 }%
2908 }%
2909 \let\affil@cutoff\@ne
2910 % \end{macrocode}
2911 % \end{macro}
2912 %
2913 % \begin{macro}{\@author@present@script}
2914 % \changes{4.0h}{1998/06/25}{Changes to support groups of affiliations}
2915 % \changes{4.1n}{2009/11/30}{(AO, 567) Handle \cs{noaffiliation} case}
2916 % This version of \cmd\AU@opr\ applies to the \classoption{superscriptaddress} class option.
2917 % Need to add commas between groups
2918 % of address numbers, which are passed in the macro \cmd\@affilID@temp\ in the form
2919 % |{3}{4}{7}| if this set of authors is related to addresses, 3, 4 and 7.
2920 % \begin{macrocode}
2921 \def\@author@present@script#1#2#3{%
2922 \begingroup
2923 \gdef\comma@space{\textsuperscript{,\,}}%
2924 \doauthor{#2}{#3}{\@affil@present@script}%
2925 \endgroup
2926 \advance\@tempcnta\m@ne
2927 }%
2928 \def\@affilcomma#1#2{%
2929 \@ifx{\z@#1}{%
2930 \@ifx{\relax#2}{}{%
2931 \@affilcomma{#2}%
2932 }%
2933 }{%
2934 #1%
2935 \@ifx{\relax#2}{}{%
2936 \@ifx{\z@#2}{%
2937 \@affilcomma
2938 }{%
2939 ,\,\@affilcomma{#2}%
2940 }%
2941 }%
2942 }%
2943 }%
2944 % \end{macrocode}
2945 % \end{macro}
2946 %
2947 % \begin{macro}{\@affil@present@script}
2948 % \begin{macro}{\@affil@present@script@}
2949 % \changes{4.1n}{2009/11/30}{(AO, 567) Handle punctuation for \classoption{superscriptaddress} style authors' extra information, such as \cs{email}}
2950 % The \cmd\@affil@present@script\ procedure presents the reference to the affiliations in the case of superscript addresses.
2951 %
2952 % The affiliations are presented to \cmd\@affil@present@script@ as a list of brace-delimited tokens, each containing the affiliation ID (a number).
2953 % The list is terminated by the token \cmd\relax.
2954 % The macro recurses (via tail recursion) until the terminating token is encountered.
2955 % Note that an affiliation ID of zero signifies a \cmd\noaffiliation:
2956 % references to the \cmd\noaffiliation\ are passed over.
2957 %
2958 % Upon termination, the affiliations, if any, are produced via \cmd\textsuperscript\ and the appropriate boolean is queued via \cmd\aftergroup.
2959 % The boolean signifies that a non-trivial affiliation was produced, so that the proper punctuation can be produced.
2960 % The group in question is that opened and closed by the \cmd\doauthor\ procedure.
2961 %
2962 % This procedure uses \cmd\@tempa\ as a scratch register.
2963 % \begin{macrocode}
2964 \def\@affil@present@script{%
2965 \let\@tempa\@empty
2966 \expandafter\@affil@present@script@\@affilID@temp\relax
2967 }%
2968 \def\@affil@present@script@#1{%
2969 \@ifx{\relax#1}{%
2970 \@ifx{\@tempa\@empty}{%
2971 \aftergroup\false@sw
2972 }{%
2973 \textsuperscript{\expandafter\@affilcomma\@tempa\relax\relax}%
2974 \aftergroup\true@sw
2975 }%
2976 }{%
2977 \@ifnum{#1=\z@}{}{\appdef\@tempa{{#1}}}%
2978 \@affil@present@script@
2979 }%
2980 }%
2981 \@provide\@author@parskip{\z@skip}%
2982 % \end{macrocode}
2983 % \end{macro}
2984 % \end{macro}
2985 %
2986 %
2987 % \subsubsection{Authors and affiliations in groupedaddress style}
2988 %
2989 % \begin{macro}{\frontmatter@author@produce@group}
2990 % \changes{4.1b}{2008/08/02}{Provide for diagnostics via \cs{frontmatterverbose@sw}}
2991 % Alias for \cmd\frontmatter@author@produce when \classoption{groupedaddress} is in effect,
2992 % the procedure that formats the author/affiliation list.
2993 %
2994 % In this case, the authors are being grouped above their shared addresses.
2995 % How it works: the \cmd\@AFG@list, a list of all unique affiliation groups, is expanded.
2996 % For each such group, all authors belonging to that group are formatted above the affiliation group.
2997 % Collaborations are silently passed over.
2998 %
2999 % This procedure must ensure that any paragraph that it starts gets ended finally.
3000 % \changes{4.1i}{2009/10/18}{(AO, 540) More runtime diagnostics via \cs{frontmatterverbose@sw}}
3001 % \changes{4.1m}{2009/11/20}{(AO, 563) More complete runtime diagnostics via \cs{frontmatterverbose@sw}}
3002 % \begin{macrocode}
3003 \def\frontmatter@author@produce@group{%
3004 \begingroup
3005 \let\@author@present\@author@present@group
3006 \frontmatter@authorformat
3007 \frontmatterverbose@sw{\typeout{\string\frontmatter@author@produce@group:}\say\@AAC@list\say\@AFF@list\say\@AFG@list}{}%
3008 \let\AU@temp\@empty
3009 \set@listcomma@list\AU@temp
3010 \def\CO@opr{\@collaboration@present\AU@temp}%
3011 \let\AFG@opr \affils@present@group
3012 \let\@listcomma\relax
3013 \@AFG@list
3014 \frontmatter@footnote@produce
3015 \par
3016 \endgroup
3017 \frontmatter@authorbelow
3018 }%
3019 \@provide\frontmatter@authorbelow{}%
3020 % \end{macrocode}
3021 % \end{macro}
3022 %
3023 % \begin{macro}{\affils@present@group}
3024 % \changes{4.1b}{2008/08/02}{Provide for diagnostics via \cs{frontmatterverbose@sw}}
3025 % Alias of \cmd\AFG@opr, this procedure is used on every element of
3026 % \cmd\@AFG@list, the list of unique affiliation groups,
3027 % when formatting the author/affiliation block:
3028 % It presents all authors sharing this affiliation group.
3029 %
3030 % This procedure is called via the procedure
3031 % \cmd\frontmatter@author@produce@group, an alias for \cmd\frontmatter@author@produce,
3032 %
3033 % Its use pertains to the class options
3034 % \classoption{groupedaddress}, \classoption{unsortedaddress}, and \classoption{runinaddress}
3035 % (that is, \cmd\groupauthors@sw\ is true).
3036 %
3037 % For each invocation, the entire \cmd\@AAC@list\ is run through (twice),
3038 % making this process execute in $N^{2}$ time. (Is this really true?)
3039 % \begin{macrocode}
3040 \def\affils@present@group#1{%
3041 % \end{macrocode}
3042 % Count (using \cmd\@tempcnta) the authors in the author list whose affiliation group
3043 % matches the argument |#1|.
3044 %
3045 % Note that \cmd\AF@temp\ is used as a storage register for the argument
3046 % of the procedure, for purposes of comparison using \cmd\ifx.
3047 %
3048 % Note: here we use \cmd\@tempcnta\ to accumulate the number of authors in the current affiliation set.
3049 %
3050 % QUERY: do the value of \cmd\AF@temp\ and \cmd\AF@opr\ need to persist?
3051 %
3052 % QUERY: what value does \cmd\AU@opr\ have at this point?
3053 % ANSWER: the \cmd\@affilID@count\ and \cmd\@affilID@match\ procedures
3054 % assign meanings to \cmd\AU@opr\ and \cmd\CO@opr\ dynamically.
3055 % We initialize the two operators to \cmd\@undefined\ so as to catch the
3056 % pathological cases.
3057 % \begin{macrocode}
3058 \begingroup
3059 \def\AF@temp{#1}%
3060 \@tempcnta\z@
3061 \let\AU@opr \@undefined
3062 \let\CO@opr \@undefined
3063 \def\AF@opr{\@affilID@count\AF@temp\@tempcnta}%
3064 \@AAC@list
3065 % \end{macrocode}
3066 %
3067 % If there are no authors using this affiliation group, skip it.
3068 % \begin{macrocode}
3069 \@ifnum{\@tempcnta=\z@}{}{%
3070 % \end{macrocode}
3071 %
3072 % DPC: If we have a list of length two, need to locally zap a comma.
3073 % \begin{macrocode}
3074 \begingroup
3075 \frontmatter@above@affilgroup
3076 \set@listcomma@count\@tempcnta
3077 % \end{macrocode}
3078 % Run through the author list, presenting (with \cmd\@author@present)
3079 % those authors whose affiliation matched the given one.
3080 % \begin{macrocode}
3081 \let\AU@opr \@undefined
3082 \let\CO@opr \@undefined
3083 \def\AF@opr{\@affilID@match\AF@temp}%
3084 \@AAC@list
3085 \endgroup
3086 % \end{macrocode}
3087 % Now that the authors have all been presented, present the affiliations, grouped.
3088 %
3089 % Note: \cmd\@tempcnta\ is the number of affiliations for this set of authors.
3090 % \begin{macrocode}
3091 \begingroup
3092 \par
3093 \frontmatter@above@affiliation
3094 \frontmatter@affiliationfont
3095 \let\\\frontmatter@addressnewline
3096 \@tempcnta\z@
3097 \@tfor\AF@temp:=#1\do{%
3098 \expandafter\@ifx\expandafter{\expandafter\z@\AF@temp}{}{%
3099 \advance\@tempcnta\@ne
3100 }%
3101 }%
3102 \@ifnum{\@tempcnta=\tw@}{%
3103 \let\@listcomma\relax
3104 }{}%
3105 \def@after@address
3106 \runinaddress@sw{%
3107 }{%
3108 \tightenlines@sw{}{%
3109 % \end{macrocode}
3110 % The following line determines the space between affilations in grouped mode
3111 % \begin{macrocode}
3112 \parskip\z@
3113 }%
3114 \appdef\after@address\par
3115 }%
3116 \let\AFF@opr \@affil@group
3117 \do@affil@fromgroup\@AFF@list#1\relax
3118 \endgroup
3119 % \end{macrocode}
3120 % End of branch handling authors.
3121 % \begin{macrocode}
3122 }%
3123 % \end{macrocode}
3124 %
3125 % \begin{macrocode}
3126 \par
3127 \endgroup
3128 }%
3129 % \end{macrocode}
3130 % \end{macro}
3131 %
3132 % \begin{macro}{\def@after@address}
3133 % \begin{macro}{\def@after@address@empty}
3134 % \changes{4.1c}{2008/08/04}{Parametrize the production after the address}%
3135 %
3136 % Each of these procedures assigns a meaning to \cmd\after@address, the first
3137 % a useful default, the second a nil.
3138 % A society or journal substyle may define it according to its own requirements.
3139 % \begin{macrocode}
3140 \def\def@after@address{\def\after@address{\@listcomma\ \@listand}}%
3141 \def\def@after@address@empty{\let\after@address\@empty}%
3142 % \end{macrocode}
3143 % \end{macro}
3144 % \end{macro}
3145 %
3146 % \begin{macro}{\@affilID@count}
3147 % \begin{macro}{\@affilID@match}
3148 %
3149 % The control sequence name \cmd\AF@opr\ is placed in the
3150 % author/affiliation list (\cmd\@AAC@list) for each (new) affiliation, with that affiliation as its argument.
3151 %
3152 % The control sequence name \cmd\AF@opr\ is an alias of a procedure
3153 % to count the number of authors at a given affiliation (\cmd\@affilID@count)
3154 % or to present the given authors (\cmd\@affilID@match).
3155 % These two procedures are executed when formatting under the \classoption{groupedaddress} class option.
3156 % \begin{macrocode}
3157 \def\@affilID@count#1#2#3{%
3158 \def\@tempifx{#3}%
3159 \@ifx{\@tempifx#1}{%
3160 \def\AU@opr{\@author@count#2}%
3161 }{%
3162 \let\AU@opr \@author@gobble
3163 }%
3164 \let\CO@opr \@collaboration@gobble
3165 }%
3166 \def\@affilID@match#1#2{%
3167 \def\@tempifx{#2}%
3168 \@ifx{\@tempifx#1}{%
3169 \let\AU@opr \@author@present
3170 }{%
3171 \let\AU@opr \@author@gobble
3172 }%
3173 \let\CO@opr \@collaboration@gobble
3174 }%
3175 % \end{macrocode}
3176 % \end{macro}
3177 % \end{macro}
3178 %
3179 % \begin{macro}{\do@affil@fromgroup}
3180 % Executes iteratively:
3181 % selects the next address ID to print,
3182 % and then re-execute the list of addresses to print the text of that address.
3183 %
3184 % Note: an argument of \cmd\relax\ breaks out of this iteration,
3185 % while an argument of \cmd\z@\ (\cmd\noaffiliation) is a no-op.
3186 %
3187 % Note: we have created an $N^{2}$ computing process.
3188 % FIXME: can use hashing instead, you know.
3189 % \begin{macrocode}
3190 \def\do@affil@fromgroup#1#2{%
3191 \@ifx{\relax#2}{}{%
3192 \count@#2\relax
3193 \@ifnum{\z@=\count@}{}{#1}%
3194 \do@affil@fromgroup#1%
3195 }%
3196 }%
3197 % \end{macrocode}
3198 % \end{macro}
3199 %
3200 % \begin{macro}{\@affil@group}
3201 % The alias of \cmd\AFF@opr\ when the list \cmd\@AFF@list\
3202 % is executed by \cmd\do@affil@fromgroup\ (\classoption{groupedaddress}):
3203 % Print the address if its number matches \cmd\count@\ (value set by \cmd\do@affil@fromgroup).
3204 %
3205 % Note that we detect a \cmd\noaffiliation\ here by the affiliation address being
3206 % the same as the expansion of \cmd\blankaffiliation.
3207 %
3208 % \changes{4.1d}{2008/10/17}{(AO, 410) compare \cs{@tempa} to \cs{blankaffiliation}.}%
3209 %
3210 % I made a mistake when coding the comparison to \cmd\blankaffiliation:
3211 % it originally read \cmd\@ifx\{\#3\cmd\blankaffiliation\}.
3212 % This is obviously wrong once you think twice.
3213 % \begin{macrocode}
3214 \def\@affil@group#1#2#3#4{%
3215 \@ifnum{#1=\count@}{%
3216 \def\@tempa{#3}%
3217 \@ifx{\@tempa\blankaffiliation}{}{%
3218 #3%
3219 \@if@empty{#4}{}{%
3220 \frontmatter@footnote{#4}%
3221 }%
3222 \after@address
3223 }%
3224 \advance\@tempcnta\m@ne
3225 }{}%
3226 }%
3227 % \end{macrocode}
3228 % \end{macro}
3229 %
3230 % \begin{macro}{\@author@present@group}
3231 % \begin{macro}{\@affil@present@group}
3232 % \changes{4.0d}{1998/01/31}{\cs{comma@space}}
3233 % This version of \cmd\AU@opr\ applies to the \classoption{groupedaddress} class option and its ilk.
3234 % Traverse the list calling the \cmd\doauthor\ hook on each author.
3235 %
3236 % The third argument of \cmd\doauthor\ fulfills the requirement that it
3237 % queue up a boolean via \cmd\aftergroup.
3238 % \begin{macrocode}
3239 \def\@author@present@group#1#2#3{%
3240 \gdef\comma@space{\gdef\comma@space{\textsuperscript{,\,}}}%
3241 \doauthor{#2}{#3}{\@affil@present@group}%
3242 \advance\@tempcnta\m@ne
3243 }%
3244 \def\@affil@present@group{%
3245 \aftergroup\false@sw
3246 }%
3247 % \end{macrocode}
3248 % \end{macro}
3249 % \end{macro}
3250 %
3251 %
3252 % \begin{macro}{\@pacs@produce}
3253 % PACS, keywords and dates.
3254 % \changes{4.0d}{1998/01/31}{PACS boxed to width of abstract}
3255 % \changes{4.0b}{1999/06/20}{Separate option now controls production}
3256 % \changes{4.0e}{2000/09/20}{Warn if no production}
3257 % \begin{macrocode}
3258 \def\@pacs@produce#1{%
3259 \showPACS@sw{%
3260 \begingroup
3261 \frontmatter@PACS@format
3262 \@pacs@name#1\par
3263 \endgroup
3264 }{%
3265 \@if@empty{#1}{}{%
3266 \class@warn{\PACS@warn}%
3267 }%
3268 }%
3269 }%
3270 \def\PACS@warn{If you want your PACS to appear in your output, use document class option showpacs}%
3271 % \end{macrocode}
3272 % \end{macro}
3273 %
3274 % \begin{macro}{\@keywords@produce}
3275 % \changes{4.0e}{2000/09/20}{Keywords on same footing as PACS}
3276 % \begin{macrocode}
3277 \def\@keywords@produce#1{%
3278 \showKEYS@sw{%
3279 \begingroup
3280 \frontmatter@keys@format
3281 \@keys@name#1\par
3282 \endgroup
3283 }{%
3284 \@if@empty{#1}{}{%
3285 \class@warn{If you want your keywords to appear in your output, use document class option showkeys}%
3286 }%
3287 }%
3288 }%
3289 % \end{macrocode}
3290 % \end{macro}
3291 %
3292 % \begin{macro}{\frontmatter@footnote@produce@footnote}
3293 % \begin{macro}{\frontmatter@footnote@produce@endnote}
3294 % Produce any footnotes to appear at the bottom of the title page.
3295 %
3296 % If frontmatter footnotes have been redirected to the bibliography, this will be a no-op.
3297 % ref.: \cmd\present@bibnote.
3298 % \begin{macrocode}
3299 \def\frontmatter@footnote@produce@footnote{%
3300 \let\@TBN@opr\present@FM@footnote
3301 \@FMN@list
3302 \global\let\@FMN@list\@empty
3303 }%
3304 % \end{macrocode}
3305 % \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
3306 % \begin{macrocode}
3307 \def\present@FM@footnote#1#2{%
3308 \begingroup
3309 \csname c@\@mpfn\endcsname#1\relax
3310 \def\@thefnmark{\frontmatter@thefootnote}%
3311 \frontmatter@footnotetext{#2}%
3312 \endgroup
3313 }%
3314 \def\frontmatter@footnote@produce@endnote{%
3315 }%
3316 % \end{macrocode}
3317 % \end{macro}
3318 % \end{macro}
3319 %
3320 % \section{Package defaults}
3321 %
3322 % \begin{macro}{\title@column}
3323 % \begin{macro}{\preprintsty@sw}
3324 % \begin{macro}{\collaboration@sw}
3325 % \begin{macro}{\frontmatter@footnote@produce}
3326 % \begin{macro}{\do@output@MVL}
3327 % \begin{macro}{\comma@space}
3328 % We give meanings to the Booleans and other macros that a client document class would
3329 % set on our behalf.
3330 % \begin{macrocode}
3331 \appdef\frontmatter@init{%
3332 \@ifxundefined\title@column {\let\title@column\@empty}{}%
3333 \@ifxundefined\preprintsty@sw {\@booleanfalse\preprintsty@sw}{}%
3334 \@ifxundefined\frontmatter@footnote@produce{\let\frontmatter@footnote@produce\frontmatter@footnote@produce@footnote}{}%
3335 \@ifxundefined\do@output@MVL {\let\do@output@MVL\@firstofone}{}%
3336 \@ifxundefined\comma@space {\let\comma@space\@empty}{}%
3337 }%
3338 % \end{macrocode}
3339 % \end{macro}
3340 % \end{macro}
3341 % \end{macro}
3342 % \end{macro}
3343 % \end{macro}
3344 % \end{macro}
3345 %
3346 % \begin{macro}{\frontmatter@thefootnote}
3347 % \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
3348 % In the title block, the footnote symbol (used for alternate affiliation and sundry)
3349 % is a \cmd\@fnsymbol\ or a lowercase letter, as selected by a boolean.
3350 % The society or journal may override this definition.
3351 % \begin{macrocode}
3352 \def\frontmatter@thefootnote{%
3353 \altaffilletter@sw{\@alph}{\@fnsymbol}{\csname c@\@mpfn\endcsname}%
3354 }%
3355 \@ifx{\altaffilletter@sw\@undefined}{\@booleantrue\altaffilletter@sw}{}%
3356 % \end{macrocode}
3357 % \end{macro}
3358 %
3359 % \begin{macro}{\frontmatter@makefnmark}
3360 % The default procedure for setting the footnote mark within the frontmatter.
3361 % A client may override this procedure.
3362 % \begin{macrocode}
3363 \def\frontmatter@makefnmark{%
3364 \@textsuperscript{%
3365 \normalfont\@thefnmark
3366 }%
3367 }%
3368 % \end{macrocode}
3369 % \end{macro}
3370 %
3371 % \begin{macro}{\frontmatter@makefntext}
3372 % This procedure is used when setting footnotes within the title block.
3373 %
3374 % Note that we are \classname{hyperref} friendly: we invoke \cmd\Hy@raisedlink\
3375 % so that this footnote becomes a hypertext anchor. If \classname{hyperref} is
3376 % not loaded, then \classname{ltxutil} has our act covered via some stubs.
3377 %
3378 % \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
3379 % \begin{macrocode}
3380 \long\def\frontmatter@makefntext#1{%
3381 \parindent 1em
3382 \noindent
3383 \Hy@raisedlink{\hyper@anchorstart{frontmatter.\expandafter\the\csname c@\@mpfn\endcsname}\hyper@anchorend}%
3384 \@makefnmark
3385 #1%
3386 }%
3387 % \end{macrocode}
3388 % \end{macro}
3389 %
3390 % \begin{macro}{\frontmatter@setup}
3391 % The default type specification for the title page.
3392 % Clients will override this definition.
3393 % \begin{macrocode}
3394 \def\frontmatter@setup{}%
3395 % \end{macrocode}
3396 % \end{macro}
3397 %
3398 % \begin{macro}{\frontmatter@RRAPformat}
3399 % \begin{macro}{\punct@RRAP}
3400 % \begin{macro}{\produce@RRAP}
3401 % The procedure \cmd\frontmatter@RRAPformat\ is the formatting procedure
3402 % for the ``Received, Revised, etc.'' block on the title page.
3403 % The macro \cmd\punct@RRAP\ produces the punctuation between the entries.
3404 % Clients will override these two definitions.
3405 %
3406 % The procedure \cmd\produce@RRAP\ is fairly general, and should be used by most
3407 % journal substyles.
3408 %
3409 % The procedure \cmd\frontmatter@RRAP@format\ will be overridden by the journal.
3410 % \begin{macrocode}
3411 \def\frontmatter@RRAPformat#1{%
3412 \removelastskip
3413 \begingroup
3414 \frontmatter@RRAP@format
3415 #1\par
3416 \endgroup
3417 }%
3418 \def\punct@RRAP{; }%
3419 \def\produce@RRAP#1{%
3420 \@if@empty{#1}{}{%
3421 \@ifvmode{\leavevmode}{\unskip\punct@RRAP\ignorespaces}%
3422 #1%
3423 }%
3424 }%
3425 % \end{macrocode}
3426 % \end{macro}
3427 % \end{macro}
3428 % \end{macro}
3429 %
3430 % \begin{macro}{\frontmatter@authorformat}
3431 % The default type specification for the author list.
3432 % Clients will override this definition.
3433 % For one alternative, see the \classname{revtex4} document class.
3434 % \begin{macrocode}
3435 \def\frontmatter@authorformat{}%
3436 % \end{macrocode}
3437 % \end{macro}
3438 %
3439 % \begin{macro}{\frontmatter@above@affilgroup}
3440 % The default amount of space above an affiliation group
3441 % (in a \cmd\affils@present@group\ production).
3442 % Clients will override this definition.
3443 % \begin{macrocode}
3444 \def\frontmatter@above@affilgroup{}%
3445 % \end{macrocode}
3446 % \end{macro}
3447 %
3448 % \begin{macro}{\frontmatter@above@affiliation}
3449 % \begin{macro}{\frontmatter@above@affiliation@script}
3450 % The \cmd\frontmatter@above@affiliation\ is the amount of space above affiliations in the \classoption{groupedaddress}
3451 % style, and \cmd\frontmatter@above@affiliation@script\ is that for \classoption{superscriptaddress}.
3452 % Clients will override this definition.
3453 % For one alternative, see the \classname{revtex4} document class.
3454 % \begin{macrocode}
3455 \def\frontmatter@above@affiliation{}%
3456 \def\frontmatter@above@affiliation@script{}%
3457 % \end{macrocode}
3458 % \end{macro}
3459 % \end{macro}
3460 %
3461 % \begin{macro}{\frontmatter@affiliationfont}
3462 % The default type specification for the affiliation.
3463 % Clients will override this definition.
3464 % For one alternative, see the \classname{revtex4} document class, where
3465 % several alternative definitions are made.
3466 % \begin{macrocode}
3467 \def\frontmatter@affiliationfont{\itshape\selectfont}%
3468 % \end{macrocode}
3469 % \end{macro}
3470 %
3471 % \begin{macro}{\frontmatter@RRAP@format}
3472 % The default type specification for the dates.
3473 % Clients will override this definition.
3474 % \begin{macrocode}
3475 \def\frontmatter@RRAP@format{}%
3476 % \end{macrocode}
3477 % \end{macro}
3478 %
3479 % \begin{macro}{\frontmatter@PACS@format}
3480 % Specify the formatting of the title page PACS statement.
3481 %
3482 % Journals will override.
3483 % \begin{macrocode}
3484 \def\frontmatter@PACS@format{}%
3485 % \end{macrocode}
3486 % \end{macro}
3487 %
3488 % \begin{macro}{\frontmatter@keys@format}
3489 % Specify the formatting of the title page keywords statement.
3490 %
3491 % Journals will override.
3492 % \begin{macrocode}
3493 \def\frontmatter@keys@format{}%
3494 % \end{macrocode}
3495 % \end{macro}
3496 %
3497 % \begin{macro}{\frontmatter@finalspace}
3498 %
3499 % \begin{macrocode}
3500 \def\frontmatter@finalspace{\addvspace{18\p@}}
3501 % \end{macrocode}
3502 % \end{macro}
3503 %
3504 % \begin{macro}{\frontmatter@addressnewline}
3505 % \changes{4.0h}{1998/06/25}{new hook}
3506 % The definition of \cmd\\\ for address handling. Default puts all the `lines'
3507 % on a run-in line, separated by comma and space.
3508 % DPC: was \newline space between lines of addresss.
3509 % \begin{macrocode}
3510 \def\frontmatter@addressnewline{%
3511 \@ifhmode{\skip@\lastskip\unskip\unpenalty\break\hskip\skip@}{}%
3512 % was: \vskip-.5ex
3513 }%
3514 % \end{macrocode}
3515 % \end{macro}
3516 %
3517 %
3518 % \begin{macro}{\frontmatter@preabstractspace}
3519 % \begin{macro}{\frontmatter@postabstractspace}
3520 % Space above and space below abstract in title block
3521 % \begin{macrocode}
3522 \def\frontmatter@preabstractspace{5.5\p@}
3523 \def\frontmatter@postabstractspace{6.5\p@}
3524 % \end{macrocode}
3525 % \end{macro}
3526 % \end{macro}
3527 %
3528 % \begin{macro}{\aftermaketitle@chk}
3529 % Error-checking code.
3530 % \begin{macrocode}
3531 \def\aftermaketitle@chk#1{%
3532 \@ifx{\maketitle\relax}{%
3533 \class@err{\protect#1 must be used before \protect\maketitle}%
3534 }{}%
3535 }%
3536 % \end{macrocode}
3537 % \end{macro}
3538 %
3539 % \begin{macro}{\ps@titlepage}
3540 % Default page style for title page.
3541 % Journals will override this procedure.
3542 % \begin{macrocode}
3543 \def\ps@titlepage{\ps@empty}%
3544 % \end{macrocode}
3545 % \end{macro}
3546 %
3547 %FIXME: there is a limitation to the default meaning of
3548 % \cmd\@startpage: the label ``FirstPage'' is only
3549 % defined if the document has a \cmd\maketitle\ command.
3550 %
3551 % \begin{macrocode}
3552 \def\volumeyear#1{\gdef\@volumeyear{#1}}%
3553 \def\@volumeyear{}%
3554 \def\volumenumber#1{\gdef\@volumenumber{#1}}%
3555 \def\@volumenumber{}%
3556 \def\issuenumber#1{\gdef\@issuenumber{#1}}%
3557 \def\@issuenumber{}%
3558 \def\eid#1{\gdef\@eid{#1}}%
3559 \def\@eid{}%
3560 %
3561 \def\startpage#1{\gdef\@startpage{#1}\c@page#1\relax}%
3562 \def\@startpage{\pageref{FirstPage}}%
3563 \def\endpage#1{\gdef\@endpage{#1}}%
3564 \def\@endpage{\pageref{LastPage}}%
3565 % \end{macrocode}
3566 %
3567 %
3568 % \subsection{Printing out the ``list-of'' elements}%
3569 %
3570 % FIXME: The \cmd\appendix@toc\ procedure should change the meaning
3571 % of \cmd\l@section\ so that the \cmd\section s can be appropriately formatted,
3572 % reflecting their status as appendices.
3573 %
3574 % \begin{macrocode}
3575 \def\print@toc#1{%
3576 \begingroup
3577 \expandafter\section
3578 \expandafter*%
3579 \expandafter{%
3580 \csname#1name\endcsname
3581 }%
3582 \let\appendix\appendix@toc
3583 \@starttoc{#1}%
3584 \endgroup
3585 }%
3586 \def\appendix@toc{}%
3587 % \end{macrocode}
3588 %
3589 % \begin{macro}{\Dated@name}
3590 % \begin{macro}{\Received@name}
3591 % \begin{macro}{\Revised@name}
3592 % \begin{macro}{\Accepted@name}
3593 % \begin{macro}{\Published@name}
3594 % These strings are used in the \cmd\date, et al. commands.
3595 % \begin{macrocode}
3596 \def\Dated@name{Dated }%
3597 \def\Received@name{Received }%
3598 \def\Revised@name{Revised }%
3599 \def\Accepted@name{Accepted }%
3600 \def\Published@name{Published }%
3601 % \end{macrocode}
3602 % \end{macro}
3603 % \end{macro}
3604 % \end{macro}
3605 % \end{macro}
3606 % \end{macro}
3607 %
3608 % \changes{4.1g}{2009/10/05}{(AO, 539) Robustify \cs{class@warn} against TOC processing}%
3609 % Two commands require robustifying against harsh treatment when TOC entries are written out.
3610 % Note that \cmd\class@warn\ is not user-level markup, but crops up when
3611 % the \cmd\title\ command is missing from the document.
3612 % \begin{macrocode}
3613 \appdef\robustify@contents{%
3614 \let\thanks\@gobble\let\class@warn\@gobble
3615 \def\begin{\string\begin}\def\end{\string\end}%
3616 }%
3617 % \end{macrocode}
3618 %
3619 % \subsection{Syntax switch}%
3620 % \changes{4.1b}{2008/08/02}{Make the syntax of this package switch optional}%
3621 %
3622 % Shall we take over the syntax of \LaTeX?
3623 % By default, Yes, unless the Boolean below has already been defined.
3624 % In the package version, this is controlled by an option;
3625 % in the kernel version, the Boolean remains undefined.
3626 %
3627 % \cmd\maketitle\ presents a complication. If this code will execute under
3628 % \classname{ltxgrid}, then its version of the procedure will do fine.
3629 %
3630 % As a package, under \classname{article}, things are different.
3631 % In this case, what should be done depends upon \cmd\if@titlepage.
3632 % If true, then just execute \cmd\maketitle\ as it stands.
3633 % If false, then the \classname{article} class has defined its wrapper
3634 % procedure, and we should take over the meaning of \cmd\@maketitle\ instead.
3635 %
3636 % Here is a list of the commands defined by this package that potentially override
3637 % those of standard \LaTeX:
3638 % \cmd\frontmatter@title,
3639 % \cmd\frontmatter@author,
3640 % \cmd\frontmatter@and,
3641 % \cmd\frontmatter@thanks,
3642 % \cmd\frontmatter@date,
3643 % \env{frontmatter@abstract},
3644 % \env{frontmatter@titlepage},
3645 % \cmd\frontmatter@maketitle.
3646 %
3647 % The following code will perform that override, given the appropriate state of the Boolean.
3648 % \begin{macrocode}
3649 \@ifxundefined\frontmatter@syntax@sw{\@booleantrue\frontmatter@syntax@sw}{}%
3650 \frontmatter@syntax@sw{%
3651 \let\title \frontmatter@title
3652 \let\author \frontmatter@author
3653 \let\date \frontmatter@date
3654 \@ifxundefined\@maketitle{%
3655 \let\maketitle \frontmatter@maketitle
3656 \@booleantrue \titlepage@sw
3657 }{%
3658 \let\@maketitle \frontmatter@maketitle
3659 \prepdef\maketitle\@author@finish
3660 }%
3661 \let\noaffiliation \frontmatter@noaffiliation
3662 \let\thanks@latex \thanks
3663 \let\thanks \frontmatter@thanks
3664 \let\and@latex \and
3665 \let\and \frontmatter@and
3666 \let@environment{titlepage}{frontmatter@titlepage}%
3667 \let@environment{abstract}{frontmatter@abstract}%
3668 }{%
3669 \let\noaffiliation\@empty
3670 }%
3671 % \end{macrocode}
3672 %
3673 % \subsection{End of the \file{ltxfront} kernel}
3674 % The kernel portion of the \classname{ltxfront} package is complete.
3675 % \begin{macrocode}
3676 %</kernel>
3677 % \end{macrocode}
3678 %
3679 % \subsection{Remainder of the \classname{ltxfront} package}
3680 %
3681 % Include any code here that ought to be incorporated into the package,
3682 % but should not be part of the kernel.
3683 %
3684 % \begin{macrocode}
3685 %<*package>
3686 % \end{macrocode}
3687 %
3688 % \begin{macrocode}
3689 % \end{macrocode}
3690 % Define formatting as like as possible to the article class.
3691 % Comands that prepare for \cmd\maketitle: \cmd\author, \cmd\title, \cmd\date.
3692 %
3693 % Argument of the above three may contain \cmd\\ and \cmd\thanks; argument of \cmd\author may contain \cmd\and.
3694 % The \cmd\\ may still work fine; \cmd\and\ will be ignored (warning);
3695 % \cmd\thanks\ even though it should not reside in the argument, will work.
3696 %
3697 % An explicit \cmd\footnote should be treated as if it were \cmd\thanks.
3698 %
3699 % \begin{verbatim}
3700 % \@maketitle: \frontmatter@footnote@produce
3701 % \end{verbatim}
3702 % \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
3703 %
3704 % \begin{macrocode}
3705 \def\thanks@latex#1{%
3706 \footnotemark
3707 \expandafter\expandafter
3708 \expandafter\gappdef
3709 \expandafter\expandafter
3710 \expandafter\@thanks
3711 \expandafter\expandafter
3712 \expandafter{%
3713 \expandafter\expandafter
3714 \expandafter\footnotetext
3715 \expandafter\expandafter
3716 \expandafter[%
3717 \expandafter\the\csname c@\@mpfn\endcsname]{#1}}%
3718 }%
3719 \@booleanfalse\altaffilletter@sw
3720 \@if@sw\if@titlepage\fi{\@booleantrue}{\@booleanfalse}\titlepage@sw
3721 \def\frontmatter@title@above{\newpage\null\vskip2em\relax}%
3722 \def\frontmatter@title@format{\centering\LARGE\let\thanks\thanks@latex}%
3723 \def\frontmatter@title@below{\vskip1.5em\relax}%
3724 \def\frontmatter@authorformat{\centering\large\advance\baselineskip\p@\parskip11.5\p@\let\thanks\thanks@latex\let\and\and@space}%
3725 \def\frontmatter@authorbelow{\vskip 1em\relax}%
3726 \def\frontmatter@above@affiliation{}%
3727 \def\frontmatter@above@affiliation@script{}%
3728 \def\frontmatter@affiliationfont{\centering\itshape}%
3729 \def\frontmatter@RRAP@format{\centering\large}%
3730 \def\frontmatter@preabstractspace{1.5em}%
3731 % \end{macrocode}
3732 % \changes{4.1n}{2010/01/02}{(AO, 572) Independent footnote counter for title block. Abstract footnote counter shared with body.}%
3733 % \begin{macrocode}
3734 \long\def\frontmatter@footnotetext{%
3735 \expandafter\expandafter
3736 \expandafter\footnotetext
3737 \expandafter\expandafter
3738 \expandafter[%
3739 \expandafter\the\csname c@\@mpfn\endcsname]%
3740 }%
3741 \def\and@space{\\}%
3742 \def\andname{and}%
3743 % \end{macrocode}
3744 % Implement the feature of the article class whereby there is a default \cmd\@date, left over
3745 % from the \LaTeX\ kernel.
3746 % This package does not have a default date. The user must put in an explicit command, like
3747 % \cmd\date\arg{\cmd\today}, which will retore \LaTeX's default behavior.
3748 %
3749 % What if the abstract environment falls after the \cmd\maketitle\ command?
3750 % The environment will be undefined; the user will have to deal with this.
3751 % \begin{macrocode}
3752 % \end{macrocode}
3753 % End of the package.
3754 % \begin{macrocode}
3755 %</package>
3756 % \end{macrocode}
3757 %
3758 % \Finale
3759 % %Here ends the programmer's documentation.
3760 % \endinput
3761 %
3762 \endinput
3763 %%EOF