% \iffalse meta-comment
% aip.dtx: package to change page grid, MVL.
% Copyright (c) 2008 American Institute of Physics
% mailto:tex@aip.org
%
% Disclaimer
%   This file is distributed WITHOUT ANY WARRANTY;
%   without even the implied warranty of
%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
% License
%   You may distribute this file under the conditions of the 
%   LaTeX Project Public License 1.3 or later 
%   (http://www.latex-project.org/lppl.txt).
% ReadMe
%   For the documentation and more detailed instructions for
%   installation, typeset this document with \LaTeX.
% Maintenance Status
%   This work has the LPPL maintenance status "maintained";
%   Current Maintainer of this work is Arthur Ogawa.
%
% This work consists of the main source file aip.dtx
% and the derived files
%    aip.rtx, aip.pdf, aip.ins, aip.drv.
% Distribution:
%    CTAN:macros/latex/contrib/aip/
%
% Unpacking:
%    tex aip.dtx
%
% Documentation:
%    latex aip.dtx; ...
%
%    Programm calls to get the documentation (example):
%       pdflatex aip.dtx
%       makeindex -s gind.ist aip
%       makeindex -s gglo.ist -o aip.gls aip.glo
%       pdflatex aip.dtx
%       makeindex -s gind.ist aip
%       pdflatex aip.dtx
%
% Installation:
%    TDS:bibtex/bst/aip/
%    TDS:doc/latex/aip/
%    TDS:source/latex/aip/
%    TDS:tex/latex/aip/
%
% Thanks, Heiko!
%    This method of letting a single .dtx file serve as both
%    documentation (via latex) and installer (via tex) follows
%    the example of Heiko Oberdiek. Thanks!
%<*ignore>
\begingroup
  \def\x{LaTeX2e}%
\expandafter\endgroup
\ifcase
 0\expandafter\ifx\csname processbatchFile\endcsname\relax\else1\fi\ifx\fmtname\x\else 1\fi
 \relax
\else
 \csname fi\endcsname
%</ignore>
%<*install>
%% This file will generate documentation and runtime files
%% from aip.dtx when run through LaTeX or TeX.
%% This file requires docstrip version 2.4 or higher available from
%% ftp://ctan.tug.org/tex-archive/macros/latex/unpacked/docstrip.tex
\input docstrip
\preamble

This is a generated file;
altering it directly is inadvisable;
instead, modify the original source file.
See the URL in the file README.

Copyright (c) 2008 American Institute of Physics.
mailto:tex@aip.org

Maintained by Arthur Ogawa (mailto:arthur_ogawa at sbcglobal.net)
under contract to American Institute of Physics.

License
   You may distribute this file under the conditions of the 
   LaTeX Project Public License 1.3 or later 
   (http://www.latex-project.org/lppl.txt).
   
   This file is distributed WITHOUT ANY WARRANTY; 
   without even the implied warranty of MERCHANTABILITY 
   or FITNESS FOR A PARTICULAR PURPOSE.

\endpreamble
\askforoverwritefalse
\keepsilent
 \generate{%
  %{ignore}
% \file{aip.ins}{\from{aip.dtx}{install}}%
% \file{aip.drv}{\from{aip.dtx}{driver}}%
% \usedir{tex/latex/aip}%
  \file{aip4-1.rtx}{\from{aip.dtx}{package}}%
 }%
\ifToplevel{
\Msg{***********************************************************}
\Msg{*}
\Msg{* To finish the installation, please move}
\Msg{*    aip.rtx}
\Msg{* into a directory searched by TeX;}
\Msg{* in a TDS-compliant installation:}
\Msg{* texmf/tex/macros/latex/aip/.}
\Msg{*}
\Msg{* To produce the documentation,
       run aip.dtx through LaTeX.}
\Msg{*}
\Msg{* Happy TeXing}
\Msg{***********************************************************}
}
\endbatchfile
%</install>
%<*ignore>
\fi
%</ignore>
% \fi
%
% \GetFileInfo{aip.dtx}
%
% \iffalse ltxdoc klootch
%<*package>
%%%  @LaTeX-file{
%%%     filename        = "aip.dtx",
%%%     version         = "4.1s",
%%%     date            = "2020/09/30",
%%%     author          = "Arthur Ogawa (mailto:arthur_ogawa at sbcglobal.net),
%%%                        commissioned by the American Institute of Physics.
%%%                        ",
%%%     copyright       = "Copyright (C) 2008 American Institute of Physics,
%%%                        distributed under the terms of the 
%%%                        LaTeX Project Public License, see
%%%                        ftp://ctan.tug.org/macros/latex/base/lppl.txt
%%%                        ",
%%%     address         = "AIP Journal Program
%%%                        American Institute of Physics, 
%%%                        Suite 1NO1, 2 Huntington Quadrangle, 
%%%                        Melville, NY 11747 USA",
%%%     telephone       = "",
%%%     FAX             = "",
%%%     email           = "mailto colon tex at aip.org",
%%%     codetable       = "ISO/ASCII",
%%%     keywords        = "latex, page grid, main vertical list",
%%%     supported       = "yes",
%%%     abstract        = "aip substyle for REVTeX",
%%%  }
%</package>
% \fi
%
% \iffalse ltxdoc klootch
% The following references the \file{README} file,
% which contains basic information about this package.
% The contents of this file are generated when
% you typeset the programmer's documentation.
% Search on "{filecontents*}{README}" to locate it.
% \fi\input{README}%
%
% \subsection{Bill of Materials}
%
% Following is a list of the files in this distribution arranged
% according to provenance.
%
% \subsubsection{Primary Source}%
% One single file generates all.
%\begin{verbatim}
%aip.dtx
%\end{verbatim}
%
% \subsubsection{Generated by \texttt{latex aip.dtx}}%
% Typesetting the source file under \LaTeX\
% generates the readme and the installer.
%\begin{verbatim}
%README   aip.ins
%\end{verbatim}
%
% \subsubsection{Generated by \texttt{tex aip.dtx}}%
% Typesetting the installer generates
% the package files.
%\begin{verbatim}
%aip.rtx
%\end{verbatim}
%
% \subsubsection{Documentation}%
% The following are the online documentation:
% \begin{verbatim}
%aip.pdf
% \end{verbatim}
%
% \subsubsection{Auxiliary}%
% The following are auxiliary files generated
% in the course of running \LaTeX:
% \begin{verbatim}
%aip.aux aip.idx aip.ind aip.log aip.toc
% \end{verbatim}
%
% \section{Code common to all modules}%
%
% The following may look a bit klootchy, but we
% want to require only one place in this file
% where the version number is stated,
% and we also want to ensure that the version
% number is embedded into every generated file.
%
% Now we declare that
% these files can only be used with \LaTeXe.
% An appropriate message is displayed if
% a different \TeX{} format is used.
%    \begin{macrocode}
%<*driver|package>
\NeedsTeXFormat{LaTeX2e}[1996/12/01]%
%</driver|package>
%    \end{macrocode}
% As desired, the following modules all
% take common version information:
%    \begin{macrocode}
%<package>\ProvidesFile{aip4-1.rtx}%
%<*driver>
\expandafter\ProvidesFile\expandafter{\jobname.dtx}%
%</driver>
%    \end{macrocode}
%
% The following line contains, for once and for all,
% the version and date information.
% By various means, this information is reproduced
% consistently in all generated files and in the
% typeset documentation.
%    \begin{macrocode}
%<*driver|package>
%<version>
 [2020/09/30 4.1s AIP substyle for REVTeX]% \fileversion
%</driver|package>
%    \end{macrocode}
%
%
% \section{The driver module \texttt{driver}}
%
% This module, consisting of the present section,
% typesets the programmer's documentation,
% generating the \file{.ins} installer and \file{README} as required.
%
% Because the only uncommented-out lines of code at the beginning of
% this file constitute the \file{driver} module itself,
% we can simply typeset the \file{.dtx} file directly,
% and there is thus rarely any need to
% generate the ``driver'' {\sc docstrip} module.
% Module delimiters are nonetheless required so that
% this code does not find its way into the other modules.
%
% The \enve{document} command concludes the typesetting run.
%
%    \begin{macrocode}
%<*driver>
%    \end{macrocode}
%
% \subsection{The Preamble}
% The programmers documentation is formatted
% with the \classname{ltxdoc} class with local customizations,
% and with the usual code line indexing.
%    \begin{macrocode}
\documentclass{ltxdoc}
\RequirePackage{ltxdocext}%
\let\url\undefined
\RequirePackage[colorlinks=true,linkcolor=blue]{hyperref}%
\expandafter\ifx\csname package@font\endcsname\relax\else
 \expandafter\expandafter
 \expandafter\RequirePackage
 \expandafter\expandafter
 \expandafter{\csname package@font\endcsname}%
\fi
\gdef\lquote{`}\gdef\rquote{'}%
\CodelineIndex\EnableCrossrefs % makeindex -s gind.ist aip
\RecordChanges % makeindex -s gglo.ist -o aip.gls aip.glo
%    \end{macrocode}
%
% \subsubsection{Docstrip and info directives}
%    We use so many {\sc docstrip} modules that we set the
%    \texttt{StandardModuleDepth} counter to 1.
%    \begin{macrocode}
\setcounter{StandardModuleDepth}{1}
%    \end{macrocode}
%    The following command retrieves the date and version information
%    from this file.
%    \begin{macrocode}
\expandafter\GetFileInfo\expandafter{\jobname.dtx}%
%    \end{macrocode}
%
% \subsection{The ``Read Me'' File}
% As promised above, here is the contents of the
% ``Read Me'' file. That file serves a double purpose,
% since it also constitutes the beginining of the
% programmer's documentation. What better thing, after
% all, to have appear at the beginning of the
% typeset documentation?
%
% A good discussion of how to write a ReadMe file can be found in
% Engst, Tonya, ``Writing a ReadMe File? Read This''
% \emph{MacTech} October 1998, p. 58.
%
% Note the appearance of the
% \cmd\StopEventually\ command, which marks the
% dividing line between the user documentation
% and the programmer documentation.
%
% The usual user will not be asked to
% do a full build, not to speak
% of the bootstrap.
% Instructions for carrying these processes
% begin the programmer's manual.
%
%\changes{4.1b}{2008/08/06}{Beta candidate b}
%    \begin{macrocode}
\begin{filecontents*}[overwrite]{README}
\title{%
 The \classname{aip} substyle for REV\TeX%
 \protect\thanks{%
  \fileversion\ \copyright 2009 American Institute of Physics
  % For version number and date,
  % search on "\fileversion" in the .dtx file,
  % or see the end of the README file.
 }%
}%

\author{%
Arthur Ogawa\thanks{mailto:arthur\_ogawa at sbcglobal.net}%
}%
\date{Version \fileversion, dated \filedate}%
\maketitle

This file embodies the implementation of the 
AIP journal substyles for APS's \revtex\ 4.1 document class
for electronic submissions to AIP journals.

The distribution point for this work is
\url{http://authors.aip.org/REVTEX}.
The archive contains ready-to-Install files, documentation, and full source.

This package is also distributed via CTAN:
\url{http://www.ctan.org/pub/tex-archive/macros/latex/contrib/aip}, and as a ready-to-install image as
\url{http://www.ctan.org/pub/tex-archive/install/macros/latex/contrib/aip.tds.zip}.

The \classname{aip} package was commissioned by the American Institute of Physics
and is distributed under the terms of the \LaTeX\ Project Public License,
the same license under which all the portions of \LaTeX\ itself is distributed.
Please see \url{http://ctan.tug.org/macros/latex/base/lppl.txt} for details.

To use this document class, you must have a working
\TeX\ installation equipped with \LaTeXe\ 
and possibly pdftex and Adobe Acrobat Reader or equivalent.

To install, retrieve the distribution,
unpack it into a directory on the target computer,
and move the file \file{aip.rtx}
into a location in your filesystem where it will be found by \LaTeX.

To use, read the user documentation \file{auguide.pdf}.

\tableofcontents

\section{Overview}%
\revtex\ is a \LaTeXe\ document class, somewhat like a hybrid of 
the standard \LaTeX\ \classname{book} and \classname{article} classes.

This document class implements the AIP society and journal substyles: 
the journals represent a set of mutually exclusive class options that, in this case, allow the 
document class to address multiple journals within the AIP family.
This society is obtained with class option \classoption{aip}.

\section{Processing Instructions}

The package file \file{aip.rtx}
is generated from this file, \file{aip.dtx},
using the {\sc docstrip} facility of \LaTeX
via |tex aip.dtx|.
The typeset documentation that you are now reading is generated from
the same file by typesetting it with \LaTeX\ or pdftex
via |latex aip.dtx| or |pdflatex aip.dtx|.

\subsection{Build Instructions}

You may bootstrap this suite of files solely from \file{aip.dtx}.
Prepare by installing \LaTeXe\ (and either tex or pdftex) on your computer,
then carry out the following steps:
\begin{enumerate}
\item
Within an otherwise empty directory,
typeset \file{aip.dtx} with \LaTeX\ or pdflatex;
you will obtain the typeset documentation you are now reading,
along with
the installer \file{aip.ins},
and the file \file{README}.

Note: you will have to run \LaTeX\ twice, then \file{makeindex}, then
\LaTeX\ again in order to obtain a valid index and table of contents.
\item
Now typeset \file{aip.dtx} with \TeX (not \LaTeX),
thereby generating the package file \file{aip.rtx}.
\item
Install \classname{aip.rtx}
by moving it to a location
in your filesystem where it will be found by \LaTeX,
like \file{tex/latex/aip}.
\item
Install \classname{aip.pdf}
by moving it to 
\file{doc/latex/aip}.
\item 
Using the \file{.dbj} information herein, 
generate the needed \file{.bst} files and install them in
\file{bibtex/bst/aip}.
\end{enumerate}
\end{filecontents*}
%    \end{macrocode}
%
% \subsection{The Document Body}
%
% Here is the document body, containing only a
% \cmd\DocInput\ directive---referring to this very file.
% This very cute self-reference is a common \classname{ltxdoc} idiom.
%    \begin{macrocode}
\begin{document}%
\newcommand\revtex{REV\TeX}%
\expandafter\DocInput\expandafter{\jobname.dtx}%
% ^^A\PrintChanges
\end{document}
%    \end{macrocode}
%
%    \begin{macrocode}
%</driver>
%    \end{macrocode}
%
% \section{AIP: A set of journal-specifc extensions to \revtex}
%
% To create a journal substyle, you create 
% a \file{.rtx} file, in our case \file{aip.rtx}.
% Within that file, you override procedures and parameter assignments as you see fit.
% Ideally they will be generally applicable to all of that society's
% journals (see the file \file{aps.rtx} for a realization of this scheme).
% Also within that file, you include a 
% section of code for each journal, that for JMP looks like:
% \begin{verbatim}
% \@ifx{\@journal\journal@jmp}{%
% <code specific to the JMP>
% }{}%
% \end{verbatim}
% 
% \section{The \classoption{aip} class option: the \texttt{aip} module}
% The file \file{aip.rtx} is read in by the \classname{revtex4} document class
% if \cmd\@society\ has the value \classoption{aip}.
%
% Here, code specific to AIP journals appears.
%
% We first give some text entities (amounting to journal abbreviations),
% then some AIP-specific initialisations,
% then code for particular AIP journals.
% In the latter case, the choice is 
% keyed off the macro \cmd\@journal.
%
% Note on \cmd\AtEndOfClass:
% this file, like all journal substyles, is read in at \cmd\AtEndOfClass\ time,
% so you should not use this command in this file. 
% Note for \LaTeX\ developers: It would be an improvement in \LaTeX\ to 
% \cmd\let\cmd\AtEndOfClass\ to something like \cmd\@firstofone.
% This change would be effected in \cmd\@onefilewithoptions.
%
%    \begin{macrocode}
%<*package>
%    \end{macrocode}
%
% \subsection{Defend Against Forseeable Errors}%
% Protect this file from being read in by anything but \revtex.
%    \begin{macrocode}
\ifx\undefined\substyle@ext
 \def\@tempa{%
  \endinput
  \GenericWarning{I must be read in by REVTeX! (Bailing out)}%
 }%
 \expandafter\else
  \def\@tempa{}%
 \expandafter\fi\@tempa
 \class@info{RevTeX society AIP selected}%
%    \end{macrocode}
%
% \subsection{Substyle Options}%
%
% Here are the class options relating to the AIP:
%    \begin{macrocode}
\DeclareOption{jcp}{\change@journal{jcp}}%
\DeclareOption{pop}{\change@journal{pop}}%
\DeclareOption{rsi}{\change@journal{rsi}}%
\DeclareOption{jap}{\change@journal{jap}}%
\DeclareOption{apl}{\change@journal{apl}}%
\DeclareOption{cha}{\change@journal{cha}}%
\DeclareOption{pof}{\change@journal{pof}}%
\DeclareOption{bmf}{\change@journal{bmf}}%
\DeclareOption{rse}{\change@journal{rse}}%
\DeclareOption{jmp}{\change@journal{jmp}}%
%    \end{macrocode}
% 
% Option allowing for ``numerical author-year'' bibliography. 
%    \begin{macrocode}
\DeclareOption{author-numerical}{%
  \@booleantrue\authoryear@sw
  \@booleantrue\authornum@sw
}%
%    \end{macrocode}
% 
% Optionally allow article title in bibliography entries. 
% A new switch is defined here: \cmd\aip@jtitx@sw\ signifies that 
% the numbered style bibliography is to be prepared without article titles in @ARTICLE entries.
% Otherwise, such titles are incorporated if present in the \file{.bib} entry. 
% By default, exclude the article titles.
%    \begin{macrocode}
\DeclareOption{article-title}{%
  \@booleanfalse\aip@jtitx@sw
}%
\@booleantrue \aip@jtitx@sw
%    \end{macrocode}
%
% Establish default options for this society.
% 
%    \begin{macrocode}
\@booleanfalse\authoryear@sw
\@booleanfalse\authornum@sw
%    \end{macrocode}
%
% \begin{macro}{\@bibdataout@init}
% \begin{macro}{\@bibdataout@aip}
% \changes{4.1o}{2010/02/12}{(AO, 580) Control .bst at run time.}%
% Procedure \cmd\@bibdataout@aip\ has the job of writing the control record into the
% job's \cmd\jobname\filename{.bib} file, where it will adjust the options to \filename{.bst} processing. 
% It is installed into the initialization procedure \cmd\@bibdataout@init, and its meaning 
% is set by the society (AIP) and journal. 
% 
%    \begin{macrocode}
\appdef\@bibdataout@rev{\@bibdataout@aip}%
\def\@bibdataout@aip{%
 \immediate\write\@bibdataout{%
%    \end{macrocode}
% An entry that controls processing of the \filename{.bst} file has entry type \texttt{@CONTROL}. 
%    \begin{macrocode}
  @CONTROL{%
   aip41Control%
%    \end{macrocode}
% Say whether we want long bibliography style (the default), or the abbreviated style. 
%    \begin{macrocode}
   \longbibliography@sw{\true@sw}{\aip@jtitx@sw{\false@sw}{\true@sw}}%
   {%
    ,pages="1",title="0"%
   }{%
    ,pages="0",title=""%
   }%
  }%
 }%
%    \end{macrocode}
% Place a \cmd\citation\ into the auxiliary file corresponding to this entry. 
%    \begin{macrocode}
 \if@filesw
  \immediate\write\@auxout{\string\citation{aip41Control}}%
 \fi
}%
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% For AIP, the preprint style \classoption{preprint} is the default.
%    \begin{macrocode}
\@booleantrue\preprintsty@sw
%    \end{macrocode}
%
% \begin{macro}{\showPACS@sw}
% \begin{macro}{\showKEYS@sw}
% If \cmd\showPACS@sw\ is true, print the PACS information in the title block,
% otherwise not.
% Similarly for \cmd\showKEYS@sw\ and the keywords.
%    \begin{macrocode}
\@booleantrue\showPACS@sw
\@booleantrue\showKEYS@sw
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\refname}
% 
% In reprint style only, we eliminate the head above the bibliography.
%    \begin{macrocode}
\appdef\setup@hook{%
 \preprintsty@sw{}{%
  \let\refname\@empty
 }%
}%
%    \end{macrocode}
% \end{macro}
%
% \subsection{AIP Setup}%
% Here we define the default procedures for AIP journals.
% Individual AIP journals may override these definitions.
%
% \subsubsection{Running header and footer}%
%
% Page style for all AIP journals.
% We assert our own page style only if nobody else has done so.
% Users wishing to customize their documents will be able to invoke a \cmd\pagestyle\
% command anywhere in the preamble.
%FIXME: \cmd\preprintsty@sw\ is defined?
%    \begin{macrocode}
\appdef\setup@hook{%
 \preprintsty@sw{%
  \ps@preprint
 }{%
  \ps@article
 }%
}%
%    \end{macrocode}
%
% The spc says: ``Running title must be provided on title page'',
% and that journal classes 1b and 2 have no running title.
%    \begin{macrocode}
\def\ps@preprint{%
  \def\@oddhead{\@runningtitle\hfil}%
  \def\@evenhead{\@runningtitle\hfil}%
  \def\@oddfoot{\hfil\thepage\quad\checkindate\hfil}%
  \def\@evenfoot{\hfil\thepage\quad\checkindate\hfil}%
  \let\@mkboth\@gobbletwo
  \let\sectionmark\@gobble
  \let\subsectionmark\@gobble
}%
\def\ps@article{%
  \def\@evenhead{\let\\\heading@cr\thepage\quad\checkindate\hfil\@runningtitle}%
  \def\@oddhead{\let\\\heading@cr\@runningtitle\hfil\checkindate\quad\thepage}%
  \def\@oddfoot{}%
  \def\@evenfoot{}%
  \let\@mkboth\@gobbletwo
  \let\sectionmark\@gobble
  \let\subsectionmark\@gobble
}%
\def\@runningtitle{\@shorttitle}%
%    \end{macrocode}
%
% \subsubsection{Title block}%
%
% The specifics of the title block.
% Apply to all AIP journals; individual journals may override these settings.
%
% \begin{macro}{\titlepage}
%    \begin{macrocode}
\renewenvironment{titlepage}{%
  \let\wastwocol@sw\twocolumn@sw
  \onecolumngrid
  \newpage
  \thispagestyle{titlepage}%
  \c@page\z@% article sets this to one not zero???
}{%
  \wastwocol@sw{\twocolumngrid}{\newpage}%
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@fnsymbol}
% On the title page, footnotes are lettered with right parenthesis: ``a)''.
%    \begin{macrocode}
\let\@fnsymbol@latex\@fnsymbol
\let\@fnsymbol\@alph
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\adjust@abstractwidth}
% This procedure is used by many titlepage elements to indent on the left by a particular 
% amount. The author list uses \cmd\frontmatter@authorformat\ to accomplish the same.
%    \begin{macrocode}
\def\adjust@abstractwidth{%
 \parindent1em\relax
 \advance\leftskip.5in\relax
 \@totalleftmargin\leftskip
 \@afterheading\@afterindentfalse
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@abstractheading}
% AIP Journals all set the abstract head the same way, with no head.
%    \begin{macrocode}
\def\frontmatter@abstractheading{}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@abstractfont}
% All AIP journals set the abstract body the same way.
%    \begin{macrocode}
\def\frontmatter@abstractfont{%
%\small
 \adjust@abstractwidth
}%
%    \end{macrocode}
% \end{macro}
%
% All AIP journal preprints use separate titlepage and full-width abstract.
%    \begin{macrocode}
\appdef\setup@hook{%
 \preprintsty@sw{%
  \@booleantrue\titlepage@sw
% \def\frontmatter@affiliationfont{\it}%
  \let\section\section@preprintsty
% \let\@hangfrom@section\@hangfrom@section@preprintsty
  \let\subsection\subsection@preprintsty
  \let\subsubsection\subsubsection@preprintsty
 }{}%
}%
%    \end{macrocode}
%
% \begin{macro}{\frontmatter@authorformat}
% All AIP journals set the author list the same.
% The leading is 11.5 points, and
% there is 11.5 points of extra space above the first author line
% (which amounts to the same thing as 11.5 points extra below the title)
% for a total of 23 points base-to-base.
%
%    \begin{macrocode}
\def\frontmatter@@indent{%
 \skip@\@flushglue
 \@flushglue\z@ plus.3\hsize\relax
 \raggedright
 \advance\leftskip.5in\relax
 \@totalleftmargin\leftskip
 \@flushglue\skip@
}%
\def\frontmatter@authorformat{%
 \frontmatter@@indent
 \sffamily
%\advance\baselineskip\p@
%\parskip11.5\p@\relax
}%
\renewcommand*\email[1][Electronic mail: ]{\begingroup\sanitize@url\@email{#1}}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@above@affilgroup}
% The default amount of space above affiliation.
%    \begin{macrocode}
\def\frontmatter@above@affilgroup{%
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@above@affiliation}
% \begin{macro}{\frontmatter@above@affiliation@script}
% The default amount of space above affiliation.
%    \begin{macrocode}
\def\frontmatter@above@affiliation@script{%
 \frontmatter@@indent
%\addvspace{3.5\p@}%
}%
\def\frontmatter@above@affiliation{%
}%
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\frontmatter@affiliationfont}
% All AIP journals set the affiliation the same.
% Like the author, but in italic. 
%    \begin{macrocode}
\def\frontmatter@affiliationfont{%
 \frontmatter@@indent
 \preprintsty@sw{}{\small}%
 \it
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@collaboration@above}
%    \begin{macrocode}
\def\frontmatter@collaboration@above{%
}%
%    \end{macrocode}
% \end{macro}
%
% Set up the default AIP style for title block authors and affiliations.
%
% \begin{macro}{\frontmatter@setup}
% All AIP journals set the title page using the same font and size.
% However, justification varies for the title block elements, so
% we assert none here.
%    \begin{macrocode}
\def\frontmatter@setup{%
 \normalfont
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@title@above}
% \begin{macro}{\frontmatter@title@format}
% \begin{macro}{\frontmatter@title@below}
% All AIP journals set the article title 12 point Times Roman, bold, flush left.
%
%    \begin{macrocode}
\def\frontmatter@title@above{\addvspace{6\p@}}%
\def\frontmatter@title@format{%
 \preprintsty@sw{}{\Large}%
 \sffamily
 \bfseries
 \raggedright
 \parskip\z@skip
}%
\def\frontmatter@title@below{\addvspace{3\p@}}%
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\frontmatter@makefnmark}
% All AIP journals share this procedure for setting the titlepage footnote text:
% superior lowercase letter, with right parenthesis.
%    \begin{macrocode}
\def\@author@parskip{3\p@}%
\@booleantrue\altaffilletter@sw
\def\frontmatter@makefnmark{%
 \@textsuperscript{%
  \normalfont\@thefnmark%(
  )%
 }%
}%
\def\frontmatter@authorbelow{%
	\addvspace{3\p@}%
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\affil@cutoff}
% We override \cmd\affil@cutoff\ to enforce the rule that,
% if a single affiliation appears on the title page, then
% no affiliation superscript at all is produced.
%    \begin{macrocode}
\let\affil@cutoff\tw@
%    \end{macrocode}
% De awa. 
% \end{macro}
%
% \begin{macro}{\frontmatter@RRAP@format}
% All AIP journals use the same format for the ``Received, Revised, etc.'' block on the title page.
%
% Change note: 11.5 points b-b from author/affiliation down to date.
%    \begin{macrocode}
\def\frontmatter@RRAP@format{%
  \addvspace{5\p@}%
  \small
  \raggedright
  \advance\leftskip.5in\relax
 \@totalleftmargin\leftskip
% \preprintsty@sw{}{\parskip.5ex\relax}%
  \everypar{%
   \hbox\bgroup(\@gobble@leavemode@uppercase%)
  }%
  \def\par{%
   \@ifvmode{}{%(
    \unskip)\egroup\@@par
   }%
  }%
}%
\def\punct@RRAP{;\egroup\ \hbox\bgroup}%
\def\@gobble@leavemode@uppercase#1#2{\expandafter\MakeTextUppercase}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@PACS@format}
% 
%    \begin{macrocode}
\def\frontmatter@PACS@format{%
   \addvspace{11\p@}%
%  \footnotesize
   \adjust@abstractwidth
   \parskip\z@skip
   \samepage
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frontmatter@keys@format}
% 
%    \begin{macrocode}
\def\frontmatter@keys@format{%
%  \footnotesize
   \adjust@abstractwidth
   \samepage
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ps@titlepage}
% Title page style. Currently empty except for preprint header,
% which consists of all the \cmd\preprint\ arguments,
% stacked flush right at the right margin.
%    \begin{macrocode}
\def\ps@titlepage{%
  \def\@oddhead{%
   \@runningtitle
   \hfill
   \produce@preprints\@preprint
  }%
  \let\@evenhead\@oddhead
  \def\@oddfoot{%
   \hb@xt@\z@{\byrevtex\hss}%
   \hfil
   \preprintsty@sw{\thepage}{}%
   \quad\checkindate
   \hfil
  }%
  \let\@evenfoot\@oddfoot
}%
\def\byrevtex{\byrevtex@sw{Typeset by REV\TeX and AIP}{}}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\produce@preprints}
%    \begin{macrocode}
\def\produce@preprints#1{%
 \preprint@sw{%
  \vtop to \z@{%
   \def\baselinestretch{1}%
   \small
   \let\preprint\preprint@count
   \count@\z@#1\@ifnum{\count@>\tw@}{%
    \hbox{%
     \let\preprint\preprint@hlist
     #1\setbox\z@\lastbox
    }%
   }{%
    \let\preprint\preprint@cr
    \halign{\hfil##\cr#1\crcr}%
    \par
    \vss
   }%
  }%
 }{}%
}%
\def\preprint@cr#1{#1\cr}%
\def\preprint@count#1{\advance\count@\@ne}%
\def\preprint@hlist#1{#1\hbox{, }}%
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Lead-in paragraph}%
%
% The \env{Lead-in paragraph} environment formats the AIP ``lead paragraph''.
% To avoid introducing new syntax, we take over the \env{quotation} environment
% until the first \cmd\section\ (or other sectioning command) appears.
%
%    \begin{macrocode}
\newenvironment{Lead@inParagraph}{%
 \par
 \bfseries
 \@afterheading\@afterindentfalse
}{%
 \par
 \hb@xt@\hsize{\hfil\leaders\hrule\hfil\leaders\hrule\hfil\hfil}%
}%
%    \end{macrocode}
% At the beginning of the document temporarily change the meaning of 
% the \env{quotation} environment, restoring it once the first sectioning
% command is given. 
%    \begin{macrocode}
\appdef\frontmatter@init{%
 \let@environment{quotation@ltx}{quotation}%
 \let@environment{quotation}{Lead@inParagraph}%
}%
\appdef\@startsection@hook{%
 \let@environment{quotation}{quotation@ltx}%
}%
%    \end{macrocode}
%
% \subsubsection{Stacked Heads}%
% All AIP journals put a period (.), followed by quad space, after the section number.
% Also, no hanging section number.
%    \begin{macrocode}
\def\@seccntformat#1{\csname the#1\endcsname.\quad}%
\def\@hang@from#1#2#3{#1#2#3}%
%    \end{macrocode}
%
% Note that in the following, we wish to set the section head uppercase, so we use
% David Carlisle's \cmd\MakeTextUppercase. However, because this procedure effectively 
% parses its argument (looking for things to \emph{not} translate), it has to be invoked
% in such a way that the argument of the \cmd\section\ command is passed to it as its
% own argument. 
%
% To accomplish this, we use the \cmd\@hangfrom@\ hook, which was developed for this 
% purpose.
%
%    \begin{macrocode}
\def\section{%
  \@startsection
    {section}%
    {1}%
    {\z@}%
    {0.8cm \@plus1ex \@minus .2ex}%
    {0.5cm}%
    {%
     \normalfont
     \small
     \sffamily
     \bfseries
     \raggedright
    }%
}%
\def\@hangfrom@section#1#2#3{\@hangfrom{#1#2}\MakeTextUppercase{#3}}%
\def\@hangfroms@section#1#2{#1\MakeTextUppercase{#2}}%
%    \end{macrocode}
%
% See, e.g., BMF\_044101\_1 (1) or BMF\_044103\_1 (1)
%    \begin{macrocode}
\def\subsection{%
  \@startsection
    {subsection}%
    {2}%
    {\z@}%
    {.8cm \@plus1ex \@minus .2ex}%
    {.5cm}%
    {%
     \normalfont
     \small
     \sffamily
     \bfseries
     \raggedright
    }%
}%
%    \end{macrocode}
%
% See, e.g., BMF\_044104\_1 (1), JMP\_123520\_1 (48), 
%    \begin{macrocode}
\def\subsubsection{%
  \@startsection
    {subsubsection}%
    {3}%
    {\z@}%
    {.8cm \@plus1ex \@minus .2ex}%
    {.5cm}%
    {%
     \normalfont
     \small
     \sffamily
     \bfseries
     \itshape
     \raggedright
    }%
}%
%    \end{macrocode}
%
% \subsubsection{Runin Heads}%
%    \begin{macrocode}
\def\paragraph{%
  \@startsection
    {paragraph}%
    {4}%
    {\parindent}%
    {\z@}%
    {-1em}%
    {\normalfont\normalsize\itshape}%
}%
%    \end{macrocode}
%
%    \begin{macrocode}
\def\subparagraph{%
  \@startsection
    {subparagraph}%
    {5}%
    {\parindent}%
    {3.25ex \@plus1ex \@minus .2ex}%
    {-1em}%
    {\normalfont\normalsize\bfseries}%
}%
%    \end{macrocode}
%
% \begin{macro}{\section@preprintsty}
% \begin{macro}{\subsection@preprintsty}
% \begin{macro}{\subsubsection@preprintsty}
% Here are the formatting procedures specific to the preprint style;
% the only difference is that the heads are flush left instead of centered.
%
%    \begin{macrocode}
\def\section@preprintsty{%
  \@startsection
    {section}%
    {1}%
    {\z@}%
    {0.8cm \@plus1ex \@minus .2ex}%
    {0.5cm}%
    {%
     \normalfont
     \bfseries
     \raggedright
    }%
}%
%\def\@hangfrom@section@preprintsty#1#2#3{\@hangfrom{#1#2}\MakeTextUppercase{#3}}%
%    \end{macrocode}
%    \begin{macrocode}
\def\subsection@preprintsty{%
  \@startsection
    {subsection}%
    {2}%
    {\z@}%
    {.8cm \@plus1ex \@minus .2ex}%
    {.5cm}%
    {%
     \normalfont
     \bfseries
     \raggedright
    }%
}%
%    \end{macrocode}
%    \begin{macrocode}
\def\subsubsection@preprintsty{%
  \@startsection
    {subsubsection}%
    {3}%
    {\z@}%
    {.8cm \@plus1ex \@minus .2ex}%
    {.5cm}%
    {%
     \normalfont
%    \small
     \itshape\bfseries
     \raggedright
    }%
}%
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% For examples of 
% \env{theorem}, \env{proposition}, \env{lemma}, \env{remark}, \env{corollary}, \env{example},
% and \env{proof} (with optional title), 
% using independent numbering for each class,
% and with numbered and roman lists therein, 
% see JMP\_122901\_1 (48). 
%
% For theorems, etc, numbered by section, (and with theorems in the appendix)
% but equations numbered throughout, 
% see JMP\_123301\_1 (48). 
%
% For a (roman) list in text, theorem, and proof,
% see JMP\_123514\_1 (48).
%
% For numbered list in text, 
% and equations numbered by section, 
% see JMP\_123518\_1 (48).
%
% All AIP journals use frontmatter footnotes by default. 
%    \begin{macrocode}
\let\frontmatter@footnote@produce\frontmatter@footnote@produce@footnote
%    \end{macrocode}
%
%
% \subsubsection{Table of Contents}%
% The toc will itself make an entry in the toc, 
% but we temporarily turn off toc formatting for the duration.
%    \begin{macrocode}
\def\@pnumwidth{1.55em}
\def\@tocrmarg {2.55em}
\def\@dotsep{2}
\def\ltxu@dotsep{4.5pt}
\setcounter{tocdepth}{3}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\tableofcontents{%
 \addtocontents{toc}{\string\tocdepth@munge}%
 \print@toc{toc}%
 \addtocontents{toc}{\string\tocdepth@restore}%
}%
%    \end{macrocode}
%
%    \begin{macrocode}
\def\tocdepth@munge{%
  \let\l@section@saved\l@section
  \let\l@section\@gobble@tw@
}%
\def\@gobble@tw@#1#2{}%
%    \end{macrocode}
%
%    \begin{macrocode}
\def\tocdepth@restore{%
  \let\l@section\l@section@saved
}%
%    \end{macrocode}
%
%    \begin{macrocode}
\def\l@part#1#2{\addpenalty{\@secpenalty}%
 \begingroup
  \set@tocdim@pagenum{#2}%
% \@tempdima 3em %
  \parindent \z@
  \rightskip\tocleft@pagenum plus 1fil\relax
  \skip@\parfillskip\parfillskip\z@
  \addvspace{2.25em plus\p@}%
  \large \bf %
  \leavevmode\ignorespaces#1\unskip\nobreak\hskip\skip@
  \hb@xt@\rightskip{\hfil\unhbox\z@}\hskip-\rightskip\hskip\z@skip
  \par
  \nobreak %
 \endgroup
}%
%    \end{macrocode}
%
% \begin{macro}{\l@section}
% Determine which TOC elements are automatically indented.
%    \begin{macrocode}
\def\tocleft@{\z@}%
\def\tocdim@min{5\p@}%
\def\l@section{%
 \l@@sections{}{section}% Implicit #3#4
}%
\def\l@f@section{%
 \addpenalty{\@secpenalty}%
 \addvspace{1.0em plus\p@}%
 \bf
}%
\def\l@subsection{%
 \l@@sections{section}{subsection}% Implicit #3#4
}%
\def\l@subsubsection{%
 \l@@sections{subsection}{subsubsection}% Implicit #3#4
}%
\def\l@paragraph#1#2{}%
\def\l@subparagraph#1#2{}%
%    \end{macrocode}
% \end{macro}
%
% Activate the auto TOC processing.
%    \begin{macrocode}
\let\toc@pre\toc@pre@auto
\let\toc@post\toc@post@auto
%    \end{macrocode}
%
%    \begin{macrocode}
\def\listoffigures{\print@toc{lof}}%
\def\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
%    \end{macrocode}
%
%    \begin{macrocode}
\def\listoftables{\print@toc{lot}}%
\let\l@table\l@figure
%    \end{macrocode}
%
% \subsubsection{Default column bottom}%
% All AIP journal styles have flush bottoms.
%
%    \begin{macrocode}
\@booleanfalse\raggedcolumn@sw
%    \end{macrocode}
%
%
% \subsubsection{Table alignment style}%
%
% \begin{macro}{\tableft@skip@float}
% \begin{macro}{\tabmid@skip@float}
% \begin{macro}{\tabright@skip@float}
% \begin{macro}{\array@row@pre@float}
% \begin{macro}{\array@row@pst@float}
% All AIP publications have the same table specification:
% Scotch rules above and below, centered in column.
%    \begin{macrocode}
\def\tableft@skip@float{\z@ plus\hsize}%
\def\tabmid@skip@float{\@flushglue}%
\def\tabright@skip@float{\z@ plus\hsize}%
\def\array@row@pre@float{\hline\hline\noalign{\vskip\doublerulesep}}%
\def\array@row@pst@float{\noalign{\vskip\doublerulesep}\hline\hline}%
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
% \subsubsection{Footnote formatting}%
% We customize the formatting of footnotes for all AIP journals.
% \begin{macro}{\@makefntext}
%    \begin{macrocode}
\def\@makefntext#1{%
 \def\baselinestretch{1}%
 \leftskip1em%
 \parindent1em%
 \noindent
 \nobreak\hskip-\leftskip
 \hb@xt@\leftskip{%
  \hss\@makefnmark\ %
 }%
 #1%
 \par
}%
%    \end{macrocode}
% \end{macro}
%
%
% \subsubsection{Appendix}%
% \begin{macro}{\appendix}
% \begin{macro}{\@hangfrom@appendix}
% \begin{macro}{\@hangfroms@appendix}
% \begin{macro}{\@appendixcntformat}
%    \begin{macrocode}
\prepdef\appendix{%
 \par
 \let\@hangfrom@section\@hangfrom@appendix
%\let\@hangfroms@section\@hangfroms@appendix
 \let\@sectioncntformat\@appendixcntformat
}%
\def\@hangfrom@appendix#1#2#3{%
 #1%
 \@if@empty{#2}{%
  #3%
 }{%
  #2\@if@empty{#3}{}{:\ #3}%
 }%
}%
\def\@hangfroms@appendix#1#2{%
 #1#2%
}%
\def\@appendixcntformat#1{\appendixname\ \csname the#1\endcsname}%
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsubsection{Bibliography}%
%
% Customize the \revtex\ for the AIP society.
% this task requires three components:
% the \BibTeX\ \file{aipnum.bst} and \file{aipauth.bst} style files, 
% customizing code for \file{natbib}, and
% customizations of the \env{thebibliography} environment.
%
% \begin{macro}{\@bibstyle}
% Define the argument of the \cmd\bibliographystyle\ command.
% The user must have installed a \file{.bst} file of the corresponding name.
% This file will then be used by \BibTeX\ when compiling the document's \file{.bbl} file.
%
% The default bibliography style for the AIP journal substyles are \file{aipnum.bst} and \file{aipauth.bst}. 
%  To generate them, use \classname{custom-bib} version 4.21 or later.
%  Run the \file{.bst} generator, \file{makebst.tex}, and
%  accept all defaults, with the following exceptions:
%
% \begin{enumerate}
% \item
%  ORDERING OF REFERENCES: c: seq-no (references in order of Citation);
% \item
%  AUTHOR NAMES: i: nm-init,ed-au (Initials + surname);
% \item
%  NUMBER OF AUTHORS: l: max 12, min 12 (there will be three prompts total);
% \item
%  TYPEFACE FOR AUTHORS IN LIST OF REFERENCES: u: nmft,nmft-def (User defined author font);
% \item
%  FONT FOR FIRST NAMES: u: fnm-def (First names in user defined font);
% \item
%  EDITOR NAMES IN INCOLLECTION ETC: a: nmfted (Editors incollection like authors);
% \item
%  DATE FORMAT: p: yr-par (Date in parentheses);
% \item
%  SUPPRESS MONTH: x: xmth (Date is year only);
% \item
%  TITLE OF ARTICLE: i: tit-it (Title italic)
% \item
%  ARTICLE TITLE PRESENT: x: jtit-x (No article title);
% \item
%  JOURNAL NAME FONT: r: jttl-rm (Journal title normal);
% \item
%  TECHNICAL REPORT TITLE: b: trtit-b (Tech. report title like books);
% \item
%  JOURNAL VOLUME: b: vol-bf (Volume bold);
% \item
%  VOLUME PUNCTUATION: c: volp-com (Volume with comma);
% \item
%  PAGE NUMBERS: f: jpg-1 (Only start page number);
% \item
%  JOURNAL NAME PUNCTUATION: x: jnm-x (Space after journal);
% \item
%  PUBLISHER IN PARENTHESES: d: pub-date (Publisher and date in parentheses);
% \item
%  PUBLISHER POSITION: p: pre-pub (Publisher before chapter, pages);
% \item
% ISBN NUMBER: isbn: (Include ISBN for books, booklets)
% \item
% ISSN NUMBER: issn: (Include ISSN for periodicals)
% \item
%  EDITOR IN COLLECTIONS: b: edby (Booktitle, edited by \dots);
% \item
%  PUNCTUATION BETWEEN SECTIONS (BLOCKS): c: blk-com (Comma between blocks);
% \item
%  ABBREVIATE WORD `PAGES': a: pp (`Page' abbreviated);
% \item
%  ABBREVIATE WORD `EDITORS': a: ed (`Editor' abbreviated);
% \item
%  OTHER ABBREVIATIONS: a: abr (Abbreviations);
% \item
%  ABBREVIATION FOR `EDITION': a: ednx (`Edition' abbreviated as `ed');
% \item
%  EDITION NUMBERS: n: ord (Numerical editions);
% \item
%  STORED JOURNAL NAMES: a: jabr (Abbreviated journal names);
% \item
%  FONT OF `ET AL': i: etal-it (Italic et al);
% \item
%  ADDITIONAL REVTeX DATA FIELDS: r: revdata, eprint, url, url-blk (Include REVTeX data fields collaboration, eid, eprint, numpages, url)
% \item
%  NEW FONT SELECTION SCHEME: n: nfss (NFSS);
% \item
%  ADDITIONAL REVTeX DATA FIELDS: y: revdata (additional data fields);
% \item
%  REFERENCE COMPONENT TAGS: y: reference component tags;
% \item
%  URL ADDRESS: n: URL as note;
% \end{enumerate}
%
% A file \file{aipnum.dbj} file equivalent to the following should result:
% \begin{verbatim}
%\input docstrip
%\preamble
%----------------------------------------
%*** REVTeX-compatible aipnum4-1.bst 2009-10-08 ***
%\endpreamble
%\postamble
%End of customized bst file
%\endpostamble
%\keepsilent
%\askforoverwritefalse
%\def\MBopts{\from{merlin.mbs}{%
%  head,\MBopta}
%\from{physjour.mbs}{\MBopta}
%\from{geojour.mbs}{\MBopta}
%\from{photjour.mbs}{\MBopta}
%\from{merlin.mbs}{tail,\MBopta}}
%\def\MBopta{%
%  lang,%: Use language field to switch hyphenation patterns for title
%  pres,pres-bf,%: Presentation, speaker bold face 
%  seq-no,%: Citation order (unsorted, like unsrt.bst)
%  vonx,%: Sort without von part (de la Maire after Mahone)
%  nm-init,ed-au,%: Initials + surname (J. F. Smith)
%  nmft,nmft-def,%: User defined author font (\bibnamefont)
%  fnm-def,%: First names in user defined font (\bibfnamefont)
%  nmfted,%: Editors incollection like authors font
%  nmand-rm,%: `And' in normal font (JONES and JAMES)
%  lab,lab-def,%: User defined citation font (\citenamefont)
%  and-rm,%: Cited `and' in normal font 
%  yr-par,%: Date in parentheses as (May 1993)
%  date-nil-x,%: If date is empty, then do not produce the surrounding punctuation (parens, brackets, colon, comma)
%  tit-qq,%: Title and punctuation in double quotes (``Title,'' ..)
%  inproceedings-chapter,%: produce pages after chapter, just as in InBook
%  jtit-x,%: Title is ignored
%  inproceedings-chapter,%: produce pages after chapter just as in InBook
%  article-booktitle,%: format booktitle 
%  article-series,%: article can has series
%  jttl-rm,%: Journal name normal font
%  journal-address,%: Include address field (in parentheses) along with journal name
%  book-bt,%: Field `booktitle', or if absent field `title', is book title 
%  thesis-title-o,%: Title is optional: no warning issued if empty
%  techreport-institution-par,%: format tech report institution like book publisher
%  vol-bf,%: Volume bold as {\bf vol}(num)
%  vnum-x,%: Journal vol, without number as 34
%  volp-com,%: Volume with comma as vol(num), ppp
%  jpg-1,%: Only start page number 
%  book-editor-booktitle,%: Book permits empty author, produces title before editor in this case
%  inbook-editor-booktitle,%: Allow using both title/booktitle, both author/editor
%  bookaddress,%: Italic booktitle followed by bookaddress in roman
%  num-xser,%: Allows number without series and suppresses word "number"
%  number-cap,%: Capitalize word `number' as: "Number 123"
%  chapter-cap,%: Capitalize word `chapter' as: `Chapter 42'
%  series-number,%: Series number as: `Springer Lecture Notes No. 125'
%  numser-booktitle,%: After book title and conference address, and before editors 
%  ser-vol,%: Series, vol. 23
%  ser-rm,%: format series roman , even when used with volume
%  volume-cap,%: Capitalize word `volume', as: `Volume 7 in Lecture Series'
%  ser-ed,%: Series and volume after booktitle and before editors
%  jnm-x,%: Space after journal name
%  pg-bk,book-chapter-pages,%: As chapter and page: chapter 42, page 345
%  pub-date,%: Publisher with address and date in parentheses (Oxford, 1994)
%  ay-empty-pub-parens-x,%: eliminate parentheses altogether if nothing inside
%  pre-pub,%: Publisher before volume, chapter, pages 
%  pre-edn,%: Edition before publisher
%  pre-pub,pre-edn,%: Edition, publisher, volume, chapter, pages
%  isbn,%: Include ISBN for books, booklets, etc.
%  issn,%: Include ISSN for periodicals
%  doi-link,doi,%: Doi forms a link to the publication, anchored to the volume or title
%  edby,%: In booktitle, edited by ..  (where .. is names)
%  blk-com,%: Comma between blocks 
%  fin-endbibitem,%: Command at end instead of period 
%  pp,%: `Page' abbreviated as p. or pp.
%  ed,%: `Editor' abbreviated as ed. or eds.
%  abr,%: Abbreviations of such words
%  ednx,%: `Edition' abbreviated as `ed' 
%  ord,%: Numerical editions as 1st, 2nd, 3rd, etc
%  jabr,%: Abbreviated journal names 
%  etal-it,%: Italic et al 
%  revdata,eprint,url,url-blk,translation,%: Include REVTeX data fields collaboration, eid, eprint, archive, url, translation
%  SLACcitation,%: Produce SLACcitation field
%  numpages-x,%: Do not include numpages field 
%  url,url-prefix-x,%: URL without prefix (default: `URL ')
%  bibinfo,%: Reference component tags like \bibinfo in the content of \bibitem
%  bibfield,%: Element tags like \bibfield in the content of \bibitem
%  nfss,%: Use LaTeX commands which may not work with Plain TeX
%,{%
%  }}
%\generate{\file{aipnum4-1.bst}{\MBopts}}
%\endbatchfile
% \end{verbatim}
%
% Between the two files \file{aipnum.dbj} and \file{aipauth.dbj}, 
% the differences are limited:
% \file{aipnum.dbj} has two lines lacking in \file{aipauth.dbj}:
% \begin{verbatim}
%  seq-no,%: Citation order (unsorted, like unsrt.bst)
%  nm-init,ed-au,%: Initials + surname (J. F. Smith)
% \end{verbatim}
% thus, the ``numbered citation'' bibliography is sorted by citation order, and
% the names are give first inital, then last name.
%
% Likewise, \file{aipauth.dbj} has one line lacking in \file{aipnum.dbj}:
% \begin{verbatim}
%  nm-rev,%: Surname + comma + initials (Smith, J. F.)
% \end{verbatim}
% Thus, the ``author-year'' bibliography is sorted by author name, and
% names are given last name first, followed by initials.
%
% We ensure that the journal substyle has the first word
% in the matter by installing the (default) AIP code 
% later on (see Section~\ref{sec:aip-defaults}).
% \end{macro}
%
% \begin{macro}{\pre@bibdata}
% 
% Set up to write endnotes to a .bib file; its data will be incorporated into the bibliography.
%    \begin{macrocode}
 \def\pre@bibdata{\jobname\bibdata@app}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\bibsection}
% We define the sectioning command to use when starting the bibliography
% (we use \cmd\refname). 
%    \begin{macrocode}
\def\refname{References}%
\def\rtx@bibsection{%
 \@ifx@empty\refname{%
  \par\vspace{6\p@ plus 6\p@}%
 }{%
%    \end{macrocode}
% The following line has been commented out:
%    \begin{verbatim}
% \let\@hangfroms@section\@hang@froms
%    \end{verbatim}
%    \begin{macrocode}
  \expandafter\section\expandafter*\expandafter{\refname}%
  \@nobreaktrue
 }%
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\bibpreamble}
% \begin{macro}{\bibsep}
% \begin{macro}{\newblock}
%    \begin{macrocode}
\let\bibpreamble\@empty
\appdef\setup@hook{%
 \bibsep\z@\relax
}%
\def\newblock{\ }%
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\bibfont}
% We define the font switch that applies to the body of the bibliography.
%
%    \begin{macrocode}
\appdef\setup@hook{%
 \def\bibfont{%
  \preprintsty@sw{}{\footnotesize}%
  \@clubpenalty\clubpenalty
  \labelsep\z@
 }%
}%
\let\place@bibnumber\place@bibnumber@sup
%    \end{macrocode}
% \end{macro}
%
%
% \subsubsection{Index}%
%    \begin{macrocode}
\newenvironment{theindex}{%
 \columnseprule \z@
 \columnsep 35\p@
 \c@secnumdepth-\maxdimen
 \onecolumngrid@push
 \section{\indexname}%
 \thispagestyle{plain}%
 \parindent\z@
 \parskip\z@ plus.3\p@\relax
 \let\item\@idxitem
 \onecolumngrid@pop
}{%
}%
%
\def\@idxitem{\par\hangindent 40\p@}
%
\def\subitem{\par\hangindent 40\p@ \hspace*{20\p@}}
%
\def\subsubitem{\par\hangindent 40\p@ \hspace*{30\p@}}
%
\def\indexspace{\par \vskip 10\p@ plus5\p@ minus3\p@\relax}
%    \end{macrocode}
%
%
% \subsubsection{Typesize Processing}%
% The formatting specification for the preprint option is:
% Times Roman 12 pt, double spacing, with 1-inch margins on letter paper.
% Paragraphs indented ``five spaces''.
% Display math on standard indent, with equation number flush right in parenthesis, with subequations roman.
%
% That for reprint option is to format similar to the printed journal; with most journals
% set (approximately analyzed) 10-point, 2-column grid, letter paper.
%    \begin{macrocode}
\expandafter\def\csname rtx@aip10pt\endcsname{%
 \let\@currname@class\@currname
 \def\@currname{aps10pt\substyle@post}%
 \class@info{Reading file \@currname.\substyle@ext}%
 \input{\@currname.\substyle@ext}%
 \let\@currname\@currname@class
 \class@info{Overriding 10pt}%
 \aipreprint
}%
\expandafter\def\csname rtx@aip11pt\endcsname{\csname rtx@aip12pt\endcsname}%
\expandafter\def\csname rtx@aip12pt\endcsname{%
 \let\@currname@class\@currname
 \def\@currname{aps12pt\substyle@post}%
 \class@info{Reading file \@currname.\substyle@ext}%
 \input{\@currname.\substyle@ext}%
 \let\@currname\@currname@class
 \class@info{Overriding 12pt}%
 \aippreprint
}%
%    \end{macrocode}
%
% \begin{macro}{\today}
% Procedure \cmd\today\ is used in the article class, but not in 
% this document class.
%    \begin{macrocode}
\def\today{%
  \number\day\space
  \ifcase\month
   \or January\or February\or March\or     April\or   May\or      June%
   \or July\or    August\or   September\or October\or November\or December%
  \fi\space
  \number\year
}%
%    \end{macrocode}
%    \end{macro}
% 
% \subsection{A. Running Title}
% User-provided running title \cmd\@shorttitle\ to be set.
%
% \subsection{B. Equation numbering, figure and table numbering}
% Equations can be numbered throughout, or by section, with appendix equations prepended by the appendix label.
% Figures and tables are numbered throughout.
% 
%
% \subsection{C. Title}
% Title page may break above abstract, within author list.
% Title notes are signified by superior letter followed by right parenthesis.
%
% \subsection{D. Author footnote}
% Set short line above these footnotes.
%
% \subsection{E. Author}
% Class option \classoption{superscriptaddress} is standard.
%    \begin{macrocode}
 \clo@superscriptaddress
%    \end{macrocode}
%
% \subsection{F. Affiliations}
% Set italic.
%
% \subsection{G. Received date}
% 
%
% \subsection{H. Abstract}
% Single paragraph, no indent.
%
% \subsection{J. Lead Paragraph}
% Set boldface, flush left before main text, single paragraph.
% Separated from text by a short centered rule.
%
% \subsection{K. Headings}
% Use labels: ROMAN, LETTER, arabic, letter.
% Set ALLCAPS, boldface; Initial cap, boldface; Initial cap, bold-italic; Initial cap, italic.
%
% Theorem, proof title followed by colon. Follow author.
%
% \subsection{L. Text Footnotes}
% Not permitted; use endnotes.
%
% \subsection{M. Citations and Bibliography}
% Numerical \filename{aipnum.bst}, author-year \filename{aipauth.bst}, and numbered author-year \filename{aipnumauth.bst} are the available choices. 
% Numerical is standard, with all styles permitted in journal classes 3a and 4b.
%
%
% \subsection{N. References}
% 
% Article Title usage:
%
%			 Article title required in all journals with "unpublished", "to be published", "in press" and "submitted" refs.
% 
% Exceptions:
%
% Journal classes 1a,1b,2,4a:
%
%       Article title not allowed in published references, except in the case of  "in press" or submitted" (see sample references below). 
%
% Journal class 3a:
%
%       Article title allowed but not required in author-year references (use must be consistent within a single manuscript).
%
% Journal class 3b:
%
%       Article title required in all journal references and report references.
%
% Journal class 4b:
%
%       Article title allowed in journal references in author-year mode. 
%
% \subsection{O. Examples of Numerical References}
% 
%
% \subsection{P. References in Author-year mode}
% 
%
% \subsection{Q. Numbered Author-year References}
% 
%
% \subsection{R. Tables}
% Placed within text (floated), labeled with Roman numeral. 
%
% Table caption placed above table, followed by space, 
% two double lines, space, table column headings, space, 
% single line, table contents, two double lines.
%
% Footnotes labeled with superior lower-case letter, set below table contents. 
%
% \subsection{S. Figures}
% Placed within text (floated), labeled with arabic numbers.
% 
% Caption set below figure. A citation to be set inline, not superscripted.
%
% \subsection{Society defaults}%
%
% After this society file is read in, we will process the 
% \cmd\@journal- and \cmd\@pointsize-specific code. 
% Here we define the defaults. 
%
% We select \textbf{Chaos} as the default journal substyle, because it is 
% the most permissive in terms of bibliography and citation style,
% and it is formatted in two column in the reprint style. 
% 
%    \begin{macrocode}
\def\@journal@default{cha}%
\def\@pointsize@default{12}%
%    \end{macrocode}
%
% \subsection{Journal-Specific Code}%
%
% For AIP journals, we supply code specific to JCP, POP, RSI, JAP, APL, CHA, POF, BMF, RSE, JMP.
%
% \subsubsection{\classoption{jcp}}%
%A member of the journal class 1a.
%    \begin{macrocode}
\def\rtx@aipjcp{%
 \typeout{Using journal substyle \@journal.}%
%    \end{macrocode}
% Journal class 1a uses the (superscript) numerical citation style by default.
%    \begin{macrocode}
 \@booleanfalse\authoryear@sw
%    \end{macrocode}
%
% End of \classoption{jcp} code.
%    \begin{macrocode}
}%
%    \end{macrocode}
%
% \subsubsection{\classoption{pop}}%
%A member of the journal class 1a.
%    \begin{macrocode}
\def\rtx@aippop{%
 \typeout{Using journal substyle \@journal.}%
%    \end{macrocode}
% Journal class 1a uses the (superscript) numerical citation style by default.
%    \begin{macrocode}
 \@booleanfalse\authoryear@sw
%    \end{macrocode}
%
% End of \classoption{pop} code.
%    \begin{macrocode}
}%
%    \end{macrocode}
%
% \subsubsection{\classoption{rsi}}%
%A member of the journal class 1a.
%    \begin{macrocode}
\def\rtx@aiprsi{%
 \typeout{Using journal substyle \@journal.}%
%    \end{macrocode}
% Journal class 1a uses the (superscript) numerical citation style by default.
%    \begin{macrocode}
 \@booleanfalse\authoryear@sw
%    \end{macrocode}
%
% End of \classoption{rsi} code.
%    \begin{macrocode}
}%
%    \end{macrocode}
%
% \subsubsection{\classoption{jap}}%
%Sole member of the journal class 1b.
%
% No running title.
%    \begin{macrocode}
\def\rtx@aipjap{%
 \typeout{Using journal substyle \@journal.}%
%    \end{macrocode}
% Journal class 1b uses the (superscript) numerical citation style by default.
%    \begin{macrocode}
 \@booleanfalse\authoryear@sw
 \let\@runningtitle\@empty
%    \end{macrocode}
%
% End of \classoption{jap} code.
%    \begin{macrocode}
}%
%    \end{macrocode}
%
% \subsubsection{\classoption{apl}}%
%Sole member of the journal class 2.
%
% No running title.
%    \begin{macrocode}
\def\rtx@aipapl{%
 \typeout{Using journal substyle \@journal.}%
%    \end{macrocode}
% Journal class 2 uses the (superscript) numerical citation style by default.
%    \begin{macrocode}
 \@booleanfalse\authoryear@sw
 \let\@runningtitle\@empty
%    \end{macrocode}
%
% End of \classoption{apl} code.
%    \begin{macrocode}
}%
%    \end{macrocode}
%
% \subsubsection{\classoption{cha}}%
%Sole member of the journal class 3a.
%    \begin{macrocode}
\def\rtx@aipcha{%
 \typeout{Using journal substyle \@journal.}%
%    \end{macrocode}
% Article titles are allowed.
%    \begin{macrocode}
 \@booleanfalse\aip@jtitx@sw
%    \end{macrocode}
%
% End of \classoption{cha} code.
%    \begin{macrocode}
}%
%    \end{macrocode}
%
% \subsubsection{\classoption{pof}}%
%Sole member of the journal class 3b.
%    \begin{macrocode}
\def\rtx@aippof{%
 \typeout{Using journal substyle \@journal.}%
%    \end{macrocode}
% Journal class 3b uses the (superscript) numerical citation style by default.
% Article titles are required, so we include them if available, 
% but if absent, we can do no more than make a warning in the \file{.blg}.
%    \begin{macrocode}
 \@booleanfalse\authoryear@sw
 \@booleanfalse\aip@jtitx@sw
%    \end{macrocode}
%
% End of \classoption{pof} code.
%    \begin{macrocode}
}%
%    \end{macrocode}
%
% \subsubsection{\classoption{bmf}}%
% A member of the journal class 4a, 
% the Biomicrofluidics journal is single column. 
%    \begin{macrocode}
\def\rtx@aipbmf{%
 \typeout{Using journal substyle \@journal.}%
%    \end{macrocode}
% Journal class 4a uses the (superscript) numerical citation style by default.
% Journal is formatted in a single column.
%    \begin{macrocode}
 \@booleanfalse\authoryear@sw
 \@booleanfalse\twocolumn@sw
%    \end{macrocode}
%
% End of \classoption{bmf} code.
%    \begin{macrocode}
}%
%    \end{macrocode}
%
% \subsubsection{\classoption{rse}}%
%A member of the journal class 4a.
%    \begin{macrocode}
\def\rtx@aiprse{%
 \typeout{Using journal substyle \@journal.}%
%    \end{macrocode}
% Journal class 4a uses the (superscript) numerical citation style by default.
%    \begin{macrocode}
 \@booleanfalse\authoryear@sw
%    \end{macrocode}
%
% End of \classoption{rse} code.
%    \begin{macrocode}
}%
%    \end{macrocode}
%
% \subsubsection{\classoption{jmp}}%
% Sole member of the journal class 4b, Journal of Mathematical Physics is single column.
% For an example of \env{itemize}, see JMP\_122901\_1 (48).
%    \begin{macrocode}
\def\rtx@aipjmp{%
 \typeout{Using journal substyle \@journal.}%
%    \end{macrocode}
% Article titles are allowed.
% Journal is formatted in a single column.
%    \begin{macrocode}
 \@booleanfalse\aip@jtitx@sw
 \@booleanfalse\twocolumn@sw
%    \end{macrocode}
%
% End of \classoption{jmp} code.
%    \begin{macrocode}
}%
%    \end{macrocode}
%
% \subsection{Establish AIP Defaults\label{sec:aip-defaults}}
%
% \begin{macro}{\footinbib@sw}
% All AIP journals invoke the \classoption{footinbib} option.
%    \begin{macrocode}
\@booleantrue\footinbib@sw
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\place@bibnumber}
% \begin{macro}{\@bibstyle}
% \begin{macro}{\bibpunct}
% We install code that will 
% govern the style in which \cmd\cite\ commands are
% formatted, 
% select the presentation for \cmd\bibitem s
% and control the \BibTeX\ processing.
%
% Note that a journal substyle may override these settings.
% Likewise, document preamble may itself invoke \cmd\bibpunct\ or \cmd\bibliographystyle,
% thereby overriding these settings and those of the journal substyle. 
%
% The numbered citations of \file{aipnum} and \file{aipauthnum}
% are compatible with \classoption{footinbib} and 
% the compression and coalescing features of \classname{natbib}, 
% while \file{aipauth}'s author-year citations are not.
% Therefore, we de-select such options if we are selecting author-year citations. 
%
% Note on \classname{natbib} presets:
% \file{aipnum} and \file{aipauthnum} uses the Chicago \cmd\bibpunct\ style;
% while \file{aipauth} uses that of Nature. 
%
% Note on \cmd\NAT@mcite: if not using numerical citations, we set \cmd\NAT@mcite\ 
% to a lower value, to turn off the mcite semantics of \classname{natbib}. 
%    \begin{macrocode}
\let\place@bibnumber\place@bibnumber@sup
\appdef\setup@hook{%
 \authoryear@sw{%
  \aip@jtitx@sw{%
   \def\@bibstyle{aipauth\substyle@post}%
  }{%
   \def\@bibstyle{aipauth\substyle@post}%
  }%
  \authornum@sw{%
   \bibpunct{}{}{,}{s}{}{\textsuperscript{,}}%
   \let\onlinecite\rev@citealpnum
  }{%
   \bibhang10\p@
   \bibpunct{(%)
              }{%(
                )}{; }{a}{,}{,}%
   \@booleanfalse\footinbib@sw
   \let\NAT@mcite\@ne
   \let\NAT@sort\z@
   \def\NAT@cmprs{\z@}%
   \let\NAT@def@citea\rtx@def@citea
   \let\NAT@def@citea@close\rtx@def@citea@close
  }%
 }{%
  \aip@jtitx@sw{%
   \def\@bibstyle{aipnum\substyle@post}%
  }{%
   \def\@bibstyle{aipnum\substyle@post}%
  }%
  \bibpunct{}{}{,}{s}{}{\textsuperscript{,}}%
  \let\onlinecite\rev@citealpnum
 }%
}%
\def\make@footnote@endnote{%
 \footinbib@sw{%
  \authoryear@sw{\authornum@sw{\false@sw}{\true@sw}}{\false@sw}%
  {}{%
   \ltx@footnote@push
   \def\thempfn{Note\thefootnote}%
   \let\ltx@footmark\rev@citemark
   \let\ltx@foottext\rev@endtext
   \appdef\class@enddocumenthook{\auto@bib}%
   \let\printendnotes\relax
  }%
 }{}%
}%
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\aipreprint}%
% We want to override \filename{aps10pt.rtx}.
%    \begin{macrocode}
\def\aipreprint{%
}%
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\aippreprint}%
% We want to override \filename{aps12pt.rtx}.
%    \begin{macrocode}
\def\aippreprint{%
}%
%    \end{macrocode}
% \end{macro}
%
%    \begin{macrocode}
%</package>
%    \end{macrocode}
%
% \Finale
% %Here ends the programmer's documentation.
% \endinput
%
\endinput
