4.2 Author's Guide
American Physical Society
1 Research Road, Ridge, NY 11961

§ INTRODUCTION

This is the author's guide to  4.2, the preferred submission
format for all APS and AIP journals. This guide is intended to be a concise
introduction to  4.2. The documentation has been separated out
into smaller units to make it easier to locate essential

The following documentation is also part of the  4.2
distribution. Updated versions of these will be maintained at
the  4.2 homepage located at <http://journals.aps.org/revtex/>.

* APS Author Guide for  4.2

* Author's Guide to AIP Substyles for  4.2

*  4.2 Command and Options Summary

This guide assumes a working  4.2
installation. Please see the installation instructions included with the

§.§ Changes in  4.2

The  system for  began its development in 1986 and has gone through three major revisions since then.   4 was released in August, 2001. Since that time, many user requests for new features were received. These requests were taken care of in the  4.1, which was released in August, 2010.  4.2 is the current release.

4.2 incorporates the following changes:

* Added support for additional APS journals,  Physical Review X,  Physical Review Accelerators and Beams, Physical Review Applied, Physical Review Fluids, Physical Review Materials, and Physical Review Physics Education Research. There are new options ,  , , , and , and .

* Added a unified  option for Physical Review journal style (the Phys. Rev. journals have no or few variations).

* The  option now conforms with Physical Review B's updated style that uses the same non-superscripted citations as other APS journals.

* Added support for additional AIP journals, AIP Advances, Applied Physics Letters Materials, and Structural Dynamics as well as AIP Conference Proceedings. There are new options , , , and .

* Added support for the  Society of Rheology () and its journal, Journal of Rheology ().

* The  style for AIP's journal JMP was changed to one-column formatting.

* For all APS journal options, complete article titles are now displayed in bibliography entries citing journal articles when using Bib by default.

* In the Phys. Rev. Bib style file, article titles in the bibliography are set in roman font.

* The behavior of the  option has been improved.

* Support has been added for citing data sets in the Bib styles.

* Support for citing journals that use a DOI instead of pages or article identifiers has been improved (for APS Phys. Rev. Bib style).

* The indentation of tables of contents have been improved.

* The  option no longer defaults to creating a separate title page.

* The  option is completely ignored now.

* A bug when using  has been fixed.

* The formatting of references for some commonly cited journals has been improved in the Phys. Rev. Bib style.

* URLs generated for DOIs now use  as the base in the Bib styles.

* URLs generated for arXiv.org e-print identifiers now use  as the base in the Bib styles.

§.§  4 Backwards Compatibility

Documents prepared under  4 and  4.1 should process correctly under  4.2. However, the formatting of the pages and, if using Bib, the references may change. Under 4.2, articles typeset with the  option will be typeset  commands differently and adjacent punctuation may need to be moved accordingly. Default behaviors some other options may also have changed as described above.

§.§ Submitting to APS Journals

Authors using  4.2 to prepare a manuscript for submission to
Physical Review Letters, Physical Review,  Reviews of Modern Physics,
or other APS journals must also read the companion document APS Author Guide for  4.2
distributed with  and follow the guidelines detailed there.

The  4.2 distribution includes both a template
(apstemplate.tex) and a sample document (apssamp.tex).
The template is a good starting point for a manuscript. In the
following sections are instructions that should be sufficient for
creating a paper using  4.2.

Further information about submissions to the American
Physical Society may be found at <http://journals.aps.org/revtex/>.

§.§ Submitting to AIP Journals

4.2 includes support for the journals of the American Institute of Physics.
The style files and authoring guides for these journals are distributed as part
4.2 distribution. The distribution includes both a template
(aiptemplate.tex) and a sample document (aipsamp.tex).
The template is a good starting point for a manuscript. In the
following sections are instructions that should be sufficient for
creating a paper using  4.2.

More information may be found at
<http://publishing.aip.org/authors/preparing-your-manuscript>. Please consult the Author's Guide to AIP Substyles for  4.2 for more information about submissions to AIP journals, AIP styles files, and other AIP-specific information.

§.§ Contact Information

Any bugs, problems, or inconsistencies with  or the APS journal style files should be reported to
support at . Reports should include information on the error and a small
sample document that manifests the problem if possible (please don't send large files!). Issues related to the AIP journal styles should be sent directly to .

§ SOME  BASICS

4.2 must sometimes patch the underlying
kernel. This means that  4.2 requires a fairly recent version of
. Versions prior to 2005/12/01 may not work
correctly.  4.2 will be maintained to be compatible with future
versions of .

§.§ Useful  Markup

markup is the preferred way to accomplish many basic tasks.

§.§.§ Fonts

Because  4.2 is based upon , it inherits all of the
macros used for controlling fonts. Of particular importance are the
macros , ,  for changing to
an italic, bold, or typewriter font respectively. One should always
use these macros rather than the lower-level  macros ,
, and . The  macros offer
improvements such as better italic correction and scaling in super-
and subscripts for example. Table <ref>
summarizes the font selection commands in .

font commands

2cText Fonts

Font command     Explanation

text      Italics

text      Boldface

text      Typewriter

text      Roman

text      Slanted

text      Sans Serif

text      Small Caps

text      Medium Series

text     Normal Series

text      Upright Series

2cMath Fonts

text      Math Italics

text      Math Boldface

text      Math Typewriter

text      Math Sans Serif

text      Calligraphic

text     Math Normal

text    Bold math for Greek letters

and other symbols

text[1]      Fraktur

text[1]     Blackboard Bold

[1]Requires amsfonts or amssymb class option

§.§.§ User-defined macros

provides several macros that enable users to easily create new
macros for use in their manuscripts:

* nargoptdef

* *+

* nargoptdef

* *+

* nargoptdef

* *+

command is the name of the macro being defined,
narg is the number of arguments the macro takes,
opt are optional default values for the arguments, and
def is the actually macro definiton. reates a
new macro, edefines a previously defined macro,
and ill define a macro only if it hasn't
been defined previously. The *-ed versions are an optimization that
indicates that the macro arguments will always be “short” arguments. This is
almost always the case, so the *-ed versions should be used whenever

The use of these macros is preferred over using plain 's low-level
macros such as
,, and . APS authors must follow the
APS Author Guide for  4.2 when defining macros.

§.§.§ Symbols

has added some convenient commands for some special symbols
and effects. These are summarized in Table <ref>. See
[Kopka, 1995] for details.

commands for special symbols and effects

Command     Symbol/Effect

—    —

–    –

¡    ¡

¿    ¿

“    “

”    ”

‘    ‘

’    ’

•    •

˙    ˙

␣    ␣

Break a ligature

char     Circle a character

provides additional symbols in a
separate package called latexsym. To use these symbols, include
the package using:

§.§ Using  packages with

Many  packages are available, for instance, on CTAN at
and at
<http://www.ctan.org/tex-archive/macros/latex/contrib/>. Full  distributions
such as  Live  <http://www.tug.org/texlive/> provide an excellent and complete installation of  that is
easy to maintain.  Some of these packages
are automatically loaded by  4.2 when certain class options are
invoked and are, thus, “required.”  They will either be distributed
with  or are already included with a standard distribution.

Required packages are automatically loaded by  on an as-needed
basis.  Other packages should be loaded using the
command. To load the
hyperref package, the document preamble might look like:

Some common (and very useful)  packages are a priori
important enough that  4.2 has been designed to be specifically
compatible with them.
A bug stemming from the use of one of these packages in
conjunction with any of the APS journals may be reported by contacting

AMS packages  4.2 is compatible with and depends
upon the AMS packages
amssymb, and
amsmath. In fact,  4.2 requires use of these packages
to accomplish some common tasks. See Section <ref> for more.
4.2 requires version 2.0 or higher of the AMS- package.

array and dcolumn
The array and dcolumn packages are part of
's required suite of packages. dcolumn is required
to align table columns on decimal points (and it in turn depends upon
the array package).

longtable.sty may be used for large tables that will span more than one
page.  4.2 dynamically applies patches to longtable.sty so that
it will work in two-column mode.

hyperref hyperref.sty is a package that is
used for putting hypertext links into  documents.
4.2 has hooks to allow e-mail addresses and URL's to become
hyperlinks if hyperref is loaded.

booktabs  4.2 improves compatibility with booktabs.sty.

Other packages will conflict with  4.2 and should be
avoided. Usually such a conflict arises because the package adds
enhancements that  4.2 already includes. Here are some common
packages that clash with  4.2:

multicol multicol.sty is a package by Frank Mittelbach
that adds support for multiple columns. In fact, early versions of
4.2 used multicol.sty for precisely this.
incorporates its own support for multiple-column typesetting.

cite Donald Arseneau's cite.sty is often used to provide
support for sorting a <cit.>command's arguments into numerical
order and to collapse consecutive runs of reference numbers.  4.2
has this functionality built-in already via the natbib package.

mcite  4.2 already contains a lot of this
functionality through its updated syntax for the <cit.>command and
the latest  natbib package.

endfloat The same functionality can be accomplished
using the endfloats class option.

float  provides a mechanism for creating new float classes with just a few commands.  4.2 has limited compatible with float.sty. If attempting to use this package, be sure to put any  commands after the  line.

§ THE DOCUMENT PREAMBLE

The preamble of a  document is the set of commands that precede
the document line. It contains a
line to load the  4.2 class (i.e.,
all of the  4.2 macro definitions), macros to
load other macro packages, and other macro definitions.

§.§ The documentclass line

The basic formatting of the manuscript is controlled by setting
class options using
The optional arguments that appear in the square brackets control the layout of the
document. At this point, one only needs to choose:

* Either the aps (default) or aip society option

* One of the chosen society's journal styles such as prl or apl

* A layout option such as preprint (single-column formatting), reprint (an approximation
to the selected journal's actual layout which may be one- or two-column depending on the journal), or twocolumn

Usually, one would want to use preprint for draft papers. Paper size options are also
available as well. In particular, a4paper is available
as well as the rest of the standard  paper sizes. A
full list of class options is given in the  4.2 Command
and Options Summary.

§.§ Loading other packages

Other packages may be loaded into a  4.2 document by using the
standard  command. For instance, to load
the graphics package, one would use

§ THE FRONT MATTER

After choosing the basic look and feel of the document by selecting
the appropriate class options and loading in whatever other macros are
needed, one is ready to move on to creating a new manuscript. After
the preamble, be sure to put in a document line (and put
in an document as well). This section describes the macros
4.2 provides for formatting the front matter of the
article. The behavior and usage of these macros can be quite
different from those provided in the  article class.

§.§ Setting the title

The title of the manuscript is simply specified by using the
title macro. A  may be used to put a line
break in a long title.

§.§ Specifying a date

The date command outputs the date on the
manuscript.  Using August 27, 2024 will cause  to insert the
current date whenever the file is run:

§.§ Specifying authors and affiliations

The  4.2 macros  for specifying authors and their affiliations are designed
to save labor for authors and during production. Authors and affiliations are
arranged into groupings called, appropriately enough, author
groups. Each author group is a set of authors who share the same set
of affiliations. Author names are specified with the macro while affiliations (or addresses) are specified with the
macro. Author groups are specified by sequences of
macros followed by  macros. An
macro applies to all previously specified
macros which don't already have an affiliation supplied.

For example, if Bugs Bunny and Roger Rabbit are both at Looney Tune
Studios, while Mickey Mouse is at Disney World, the markup would be:

The default is to display this as

Bugs Bunny and Roger Rabbit

Looney Tune Studios

Mickey Mouse

Disney World

This layout style for displaying authors and their affiliations is
chosen by selecting the class option
groupedaddress. Journal styles usually default this option,
so it need not be specified explicitly. The other major way of displaying this
information is to use superscripts on the authors and
affiliations. This can be accomplished by selecting the class option
superscriptaddress. To achieve the display

Bugs Bunny,$^{1}$ Roger Rabbit,$^{1,2}$ and Mickey Mouse$^{2}$

$^{1}$Looney Tune Studios

$^{2}$Disney World

one would use the markup

Note that  4.2 takes care of any commas and and's that join
the author names together and font selection, as well as any
superscript numbering. Only the author names and affiliations should
be given within their respective macros. See below for further information
regarding the proper way to add footnotes to author names and affiliations.

There is a third class option, unsortedaddress, for
controlling author/affiliation display. The default
groupedaddress will actually sort authors into the
approriate author groups if one chooses to specify an affiliation for
each author. The markup:

will result in the same display as for the first case given
above even though Roger Rabbit is specified after Mickey Mouse. To
avoid Roger Rabbit being moved into the same author group as Bugs
Bunny, use the
unsortedaddress option instead. In general, it is safest
to list authors in the order they should appear and specify
affiliations for multiple authors rather than one at a time. This will
afford the most independence for choosing the display option. Finally,
it should be mentioned that the affiliations for the
superscriptaddress are presented and numbered
in the order that they are encountered. These means that the order
will usually follow the order of the authors. An alternative ordering
can be forced by including a list of  commands before
the first  in the desired order. Then use the exact same
text for each affilation when specifying them for each author.

If an author doesn't have an affiliation, the macro may be used in the place of an  macro.

§.§.§ Collaborations

A collaboration name can be specified with the command. This is very similar to the command. In  4.2, it can
be used with both the superscriptaddress and groupedaddress class options. The
command should appear at the end of the list of
authors. The collaboration name will be appear centered in parentheses
between the list of authors and the list of
affiliations. Because collaborations
don't normally have affiliations, one needs to follow the
with .

§.§.§ Footnotes for authors, collaborations, affiliations or title

Often one wants to specify additional information associated with an
author, collaboration, or affiliation such as an e-mail address, an
alternate affiliation, or some other ancillary information.
4.2 introduces several new macros just for this purpose. They

* optional texte-mail address

* optional textURL

* optional textaffiliation

* miscellaneous text

In the first three, the optional text will be prepended before the
actual information specified in the required argument. In the APS journal style files,  and  no longer have a default value. However, in the AIP styles, each have a default text for their optional arguments
(`Electronic address:' and `URL:' respectively). The macro should only be used if one of the other three do not apply. Any
author name can have multiple occurences of these four macros. Note
that unlike the
macro, these macros only apply to the that directly precedes it. Any  must follow
the other author-specific macros. A typical usage might be as follows:

This would result in the footnote “E-mail me at: ,
Visit: , Permanent address: Warner
Brothers” being attached to Bugs Bunny. Note that:

* Only an e-mail address, URL, or affiliation should go in the
required argument in the curly braces.

* The font is automatically taken care of.

* An explicit space is needed at the end of the optional text if one is
desired in the output.

* Use the optional arguments to provide customized
text only if there is a good reason to.

The  ,  , or even can
also have footnotes attached via these commands. If any ancillary data
(, , , or
) are given in the wrong context (e.g., before any
, or command has been given), then a warning is given in the  log, and
the command is ignored.

Duplicate sets of ancillary data are merged, giving rise to a single
shared footnote. However, this only applies if the ancillary data are
identical: even the order of the commands specifying the data must be
identical. Thus, for example, two authors can share a single footnote
indicating a group e-mail address.

Duplicate  commands may be given in the course of the
front matter, without the danger of producing extraneous affiliations
on the title page. However, ancillary data should be specified for
only the first instance of any particular institution's
command; a later instance with different ancillary
data will result in a warning in the  log.

It is preferable to arrange authors into
sets. Within each set all the authors share the same group of
affiliations. For each author, give the (and appropriate
ancillary data), then follow this author group with the needed group
of  commands.

If affiliations have been listed before the first
macro to ensure a particular ordering, be sure
that any later  command for the given institution is
an exact copy of the first, and also ensure that no ancillary data is
given in these later instances.

Each journal class option has a default behavior for the placement of these
ancillary information footnotes. For instance, the prb option puts all
such footnotes at the start of the bibliography while the prl
journal styles displays them on the first page. One can override a
journal style's default behavior by specifying explicitly the class
bibnotes (puts the footnotes at the start of the
bibliography) or nobibnotes (puts them on the first page).
Please consult the documentation for the various journal style files for further information.

§.§.§ Specifying first names and surnames

Many authors have names in which either the surname appears first
or in which the surname is made up of more than one name. To ensure
that such names are accurately captured for indexing and other
purposes, the  macro should be used to indicate which portion
of a name is the surname. Similarly, there is a  macro
as well, although usage of  should be sufficient. If an
author's surname is a single name and written last, it is not
necessary to use these macros. These macros do nothing but indicate
how a name should be indexed. Here are some examples:

§.§ The abstract

An abstract for a paper is specified by using the abstract

Note that in  4.2 the abstract must be specified before the
command and there is no need to embed it in an explicit
minipage environment.

§.§.§ Structured abstracts

A new feature in  4.2 is support for structured abstracts. A “structured" abstract is an abstract divided into labeled sections. For instance, Physical Review C would like authors to provide abstracts with sections summarizing the paper's  Background, Purpose, Method, Results, and Conclusions. This can be accomplished by using the  environment within the  environment.  For example:

§.§ PACS codes

PACS codes are obsolete. The showpacs option does nothing, but is present so that older documents may still be processed under  4.2.

§.§ Keywords

A macro may also be used to indicate keywords for the

This will be displayed below the abstract and PACS (if supplied). Like
PACS codes, the actual display of the the keywords is controlled by
two classoptions: showkeys and
noshowkeys. An explicit showkeys must be
included in the line to display the keywords.

§.§ Institutional report numbers

Institutional report numbers can be specified using the macro. If the preprintnumbers class option is specified, these will be displayed in the upper right corner of the first page. Multiple  macros maybe supplied (space is
limited though, so only three or less may actually fit). Please note that the preprint class option does not automatically invoke preprintnumbers.

§.§ maketitle

After specifying the title, authors, affiliations, abstract, PACS
codes, and report numbers, the final step for formatting the front
matter of the manuscript is to execute the  macro by
simply including it:

The  macro must follow all of the macros listed
above. The macro will format the front matter in accordance with the various
class options that were specified in the
line (either implicitly through defaults or

§ THE BODY OF THE PAPER

For typesetting the body of a paper,  4.2 relies heavily on
standard  and other packages (particulary those that are part
of AMS-). Users unfamiliar with these packages should read the
following sections carefully.

§.§ Section headings

Section headings are input as in .
The output is similar, with a few extra features.

Four levels of headings are available in :

title text

title text

title text

title text

Use the starred form of the command to suppress the automatic numbering; e.g.,

To label a section heading for cross referencing, best practice is to
place the key within the argument specifying the heading:

In some journal substyles, such as those of the APS,
all text in the

command is automatically set uppercase.
If a lowercase letter is needed, use x.
For example, to use “He” for helium in a

title text command, type
e in title text.

Use  to force a line break in a section heading.
(Fragile commands must be protected in section headings, captions, and
footnotes and  is a fragile command.)

§.§ Paragraphs and General Text

Paragraphs always end with a blank input line.  Because automatically calculates linebreaks and word hyphenation in a
paragraph, it is not necessary to force linebreaks or hyphenation.  Of
course, compound words should still be explicitly hyphenated, e.g.,
“author-prepared copy.”

Use directional quotes for quotation marks around quoted text
(), not straight double quotes ().
For opening quotes, use one or two backquotes; for closing quotes,
use one or two forward quotes (apostrophes).

§.§ One-column vs. two-column layouts

One of the hallmarks of Physical Review and many of the AIP journals is their two-column
formatting.  4.2 provides the reprint class option that provides for each
journal class option a close approximation to the journal's actual production formatting. Note that
the reprint option will give either one or two-column formatting as appropriate for the particular journal.
For most APS and AIP journals, the reprint option will take care of formatting the front matter
(including the abstract) as a single column and will typeset the body in two columns.  4.2 has its own
built-in two-column formatting macros to provide well-balanced columns as well as reasonable control over the placement of floats in either
one- or two-column modes. When drafting papers, it is common to use a one-column format. This is best achieved by using the
preprint class option. Authors may override a particular journal's formatting by using the lower level options onecolumn and twocolumn, but best practice is to stick with the preprint and reprint options.

Please note that the reprint class option is only an approximation of a journal's final layout. Because of font differences, figure rescaling, and other factors, authors should not expect the reprint option to give fully accurate estimates of an article's ultimate length after being typeset for the journal.

Occasionally it is necessary to change the formatting from two-column to
one-column to better accommodate very long equations that are more
easily read when typeset to the full width of the page. This is
accomplished using the widetext environment:

In two-column mode, this will temporarily return to one-column mode,
balancing the text before the environment into two short columns, and
returning to two-column mode after the environment has
finished.  4.2 will also add horizontal rules to guide the
reader's eye through what may otherwise be a confusing break in the
flow of text. The
widetext environment has no effect on the output under the
preprint class option because this already uses
one-column formatting.

Use of the widetext environment should be restricted to the bare
minimum of text that needs to be typeset this way. However, short pieces
of paragraph text and/or math between nearly contiguous wide equations
should be incorporated into the surrounding wide sections.

Low-level control over the column grid can be accomplished with the
and  commands. Using these, one
can avoid the horizontal rules added by widetext. These commands
should only be used if absolutely necessary. Wide figures and tables
should be accommodated using the proper  environments.

§.§ Cross-referencing

inherits the  features for labeling and cross-referencing
section headings, equations, tables, and figures. This section
contains a simplified explanation of these cross-referencing features.
The proper usage in the context of section headings, equations,
tables, and figures is discussed in the appropriate sections.

Cross-referencing depends upon the use of “tags,” which are defined by
the user.  The key command is used to identify tags for
. Tags are strings of characters that serve to label section
headings, equations, tables, and  figures that replace explicit,
by-hand numbering.

Files that use cross-referencing (and almost all manuscripts do)
need to be processed through  at least twice to
ensure that the tags have been properly linked to appropriate numbers.
If any tags are added in subsequent editing sessions,
will display a warning message in the log file that ends with
Running the file through  again (possibly more than once) will
resolve the cross-references.  If the error message persists, check
the labels; the same key may have been used to label more than one

Another  warning is ,
which indicates the use of a key in a <ref>without ever
using it in a statement.

performs autonumbering exactly as in standard .
When the file is processed for the first time,
creates an auxiliary file (with the .aux extension) that
records the value of each key.  Each subsequent run retrieves
the proper number from the auxiliary file and updates the auxiliary
file.  At the end of each run, any change in the value of a key
produces a  warning message.

Note that with footnotes appearing in the bibliography, extra passes
of  may be needed to resolve all cross-references. For
instance, putting a <cit.>inside a [ ]will require at
least three passes.

Using the hyperref package to create hyperlinked PDF files
will cause reference ranges to be expanded to list every
reference in the range. This behavior can be avoided by using the
hypernat package available from <www.ctan.org>.

§.§ Acknowledgments

Use the acknowledgments environment for an acknowledgments
section.  Depending on the journal substyle, this element may be
formatted as an unnumbered section titled Acknowledgments or
simply as a paragraph. Please note the spelling of

§.§ Appendices

The  command signals that all following sections are
appendices, so

title text after  will set
title text as an appendix heading (an empty title text
is permitted). For a single appendix, use a
followed by

title text
command to suppress the appendix letter in the section heading.

§.§ Line numbering

4.2 provides the linenumbers class option to enable line numbering. While it is
possible to directly call in the lineno.sty, using the class option ensures
that the default parameters needed to properly typeset the line numbers are set up correctly. It is
still possible for authors to override parameters such as  as usual, however.

§ MATH AND EQUATIONS

§.§ Math in text

Not surprisingly,  uses the  math  delimiters
for math embedded in text. For example,
gives $a^{z}$.  Within math mode, use
math for superscripts and
math for subscripts. If the braces after the
are omitted,  will
superscript the next token (generally a single character or
command). Thus it is safest to use explicit braces .

As with text, math should not require extensive explicit vertical or
horzontal motion commands, because  calculates math spacing
itself automatically.  In particular, explicit spacing around
relations (e.g., $=$) or operators (e.g., $+$) should be
unnecessary. These suggestions notwithstanding, some fine-tuning of
math is required in specific cases, see Chapter 18 in the book[Knuth, 1986].

§.§ Text in math

There are times when normal, non-italic text needs to be inserted
into a math expression.  The text command is the
preferred method of accomplishing this.  It produces regular text
and scales correctly in superscripts:
“$y=x \text{ for } x_{\text{e-p}}$”. To use the  command,
the amsmath package must be loaded: include a
amsmath command in the document
preamble or use the class option amsmath. Please note
that  4.2 requires version 2.0 or higher of amsmath.

Other common alternatives may be less desirable. Using the standard
text will give normal text, including a hyphen,
but will not scale correctly in superscripts:
gives “$x_{\mbox{e-p}}$”.
The  command
only switches to Roman font for math letters.  It does not, for
example, handle hyphens correctly:
gives “$x_{\rm e-p}$”. But note that with
, it does work:  gives “$x_{\textrm{e-p}}$”.

§.§ Displayed equations

Equations are set centered in the column width or flush left depending
on the selected journal substyle.

For the simplest type of displayed equation, a numbered, one-line
equation, use the equation environment.
takes care of the equation number
—the number will be set below the equation if necessary.
\[\dots\cmd\]
for a single, one-line unnumbered display equation.

Use the eqnarray environment when more than one consecutive
equation occurs, putting each equation in a separate row of the
environment, and using  before the row end (
) to
suppress the equation number where necessary.  If the equations are
related to each other, align each on the respective relation operator
(such as $=$).

When an equation is broken over lines or is continued over multiple
relation operators, it is called a multi-line or continued equation,
respectively; here, too, use the eqnarray environment.

For a continued equation, align each row on the relation operator just
as with multiple equations, and use the  command to
suppress auto-numbering on broken lines.  Also, use the starred form
of the row end (
) to prevent a pagebreak at that

Short displayed equations that can appear together on a single line
separated by      space may be placed in a single
equation environment.

As explained in Section <ref>, occasionally in two-column
mode a long equation, in order to fit it in the narrow column width,
would need to be broken into so many lines that it would affect
readibility. Set it in a wide column using the widetext
environment. Then return to the normal text width as soon as

The sample file apssamp.tex illustrates how to obtain each of
the above effects.

§.§ Numbering displayed equations

4.2 automatically numbers equations.
For single-line and multi-line equations, use the
equation and eqnarray environments as described above.
For unnumbered single-line equations, use the …
construction.  The command  will suppress the numbering
on a single line of an
For a multi-line equation with no equation numbers at all,
use the eqnarray* environment.

A series of equations can be a labeled with a lettered sequence,
e.g., (3a), (3b), and (3c), by
putting the respective equation or eqnarray environment within a
subequations environment.
The amsmath package (can be loaded with the
amsmath class option) is required for this.

Use the command number to produce an idiosyncratic
equation number: $(1')$, for example.  Numbers assigned by are completely independent of 's automatic numbering.  The
package amsmath is required for using the command. Please
note that the use of the  command may conflict with the use of the hyperref package
due an incompatibility between amsmath and hyperref.

To have  reset the equation numbers at the start of each section,
use the eqsecnum class option in the document preamble.

See the sample file apssamp.tex for some examples.

§.§ Cross-referencing displayed equations

To refer to a numbered equation, use
the key and <ref>key commands.
The key command is used within the referenced equation
(on the desired line of the eqnarray, if a multi-line equation):

\begin{equation}
A=B \label{pauli}
\end{equation}

... It follows from Eq. (<ref>)
that this is the case ...

\begin{eqnarray}
A & = &B,\label{pauli2}\\
A'& = &B'
\end{eqnarray}

Please note the parentheses surrounding the <ref>command.
These are not provided automatically and, thus, must be
explicitly incorporated.

Numbers produced with  can also be cross-referenced by adding
a command after the  command.

Using a after subequations to reference the
general number of the equations in the
subequations environment. For example, if

gives the output

\begin{eqnarray}
\\
\\
\end{eqnarray}

then  gives “Eq. (<ref>)”.

Note: incorrect cross-referencing will result if
is used in an unnumbered single-line equation
(i.e., within the  and  commands),
or if is used on a line of an eqnarray that is not being numbered
(i.e., a line that has a ).

§.§ Using the AMS packages amsfonts,
amssymb, and amsmath

The American Mathematical Society's AMS- packages provided extra
fonts, symbols, and math markup that are quite convenient.  4.2
supports the use of these packages directly. To use the amsfonts,
amssymb, and amsmath class options,
AMS- (and perhaps the additional AMS fonts) will need to be
installed. Please note that  4.2 requires version 2.0 or higher
of AMS-. These packages can be downloaded from

There are two class options for accessing the AMS fonts:
amsfonts and amssymb.
The amsfonts option defines the  and
commands to switch to the Fraktur and
Blackboard Bold fonts, respectively.
These fonts are selected with the  and font-switching commands:
gives a Fraktur “$\mathfrak{G}$”
and  gives a Blackboard Bold “$\mathbb{Z}$”.
does not currently support the use of the extra Euler fonts
(the AMS fonts starting with  or ) or the
Cyrillic fonts (the AMS fonts starting with ).

The amssymb class option gives all the font
capabilities of the
amsfonts class option and further defines the commands
for many commonly used math symbols. These symbols will scale
correctly in superscripts and other places. See the AMS-documentation for the complete list of symbols available.

§.§ Bold symbols in math

4.2 uses the standard  Bold Math (bm) package as the
basis for creating bold symbols in math mode. As usual, this requires
an explicit bm in the document
preamble. The command
symbol makes symbol bold in math mode, ensuring
that it is the correct size, even in superscripts. If the correct font
in the correct size is not available then result is the symbol
set at the
correct size in lightface and a  warning that says
“…”. Most bold special
characters will require that the AMS fonts be installed and the
amsfonts class option be invoked.

is the proper means to get bold Greek characters—upper- and
lowercase—and other symbols.
The following will come out bold with :
normal math italic letters, numbers,
Greek letters (uppercase and lowercase),
small bracketing and operators, and . Fraktur
characters will come out bold in a ; however, Blackboard Bold
requires using the  command rather than .
The amsfonts option adds support for bold math
letters and symbols in smaller sizes and in superscripts when a
symbol is used.
For example,  gives a bold
lowercase pi in the superscript position: $^{\pi\bm{\pi}}$.

Note that math is a fragile command and, thus, should be
preceded by  in commands with moving arguments.

§ FOOTNOTES

's standard [ ]command is available in
4.2. The footnote text can either appear at the bottom of a page or
as part of the bibliography. This choice can be controlled by two class options:
footinbib and nofootinbib.  4.2
defaults to the former.  Specific journal options may select a
different value than the default.

Please note that even if  Bib is not being used for the references, you
may have to run Bib if you are using footnotes without the nofootinbib option.
The log file will contain errors about missing references such as  in this case and a file ending in
will have been produced during the processing of the  file.

Note that in the latter case, the
argument of the
[ ]command is a moving argument in the sense of the ,
Appendix C.1.3: any fragile command within that argument must be
preceded by a  command.

The [ ]macro should not be used in the front
matter for indicating author/affiliation relationships or to provide
additional information about authors (such as an e-mail
address). See Section <ref> for the proper way to do

Finally, footnotes that appear in tables behave differently. They
will be typeset as part of the table itself. See
Section <ref> for details.

§ CITATIONS AND REFERENCES

4.2 adds significant new functionality to  4's
typesetting of citations and references. The new functionality is
designed to make it easier to use Bib and produce the desired output
in the reference section without having to edit Bib's output. The new features include:

* Endnotes created with the [ ]command are automatically interleaved with the bibliographic references.  4 would typeset all endnotes at the end of the bibliography.

* Combining multiple references automatically into a single entry in the bibliography.  4 required by-hand editing of Bib output. This is achieved by prepending an asterisk (*) to the reference's key in the <cit.>command.  would make a single entry in the bibliography by combining into one  the entries from the  file with keys key1 and key2. See Section <ref> for more details.

* Text can be prepended or appended to an entry in the bibliography.  4 required by-hand editing of the Bib output. See Section <ref> for an example of how to do this.

Proper formatting of references requires Patrick Daly's natbib citation package.  style files
for APS and AIP journals are created using his custom-bib tool kit. From an author's point of view, all this means is that a proper
4.2 installation requires having natbib (version 8.31a
or higher) installed. It also means that the full set of
natbib functionality is available from within  4.2
(but see the APS Author Guide for  4.2 and Author's Guide to AIP Substyles for  4.2 for restrictions if
submitting to an APS or AIP journal). The natbib documentation contains many examples; see in
particular the  file for a convenient summary. Please also note that natbib 8.3 and later now gives an error (rather than merely a warning as in earlier versions) if you try to use a Bib file that isn't compatible with author-year style citations with a journal style that requires author-year citations (such as Reviews of Modern Physics).

§.§ Citing a reference

As in standard , references are cited in text using the
<cit.>key command and are listed in the bibliography using
the key command. The <cit.> macro enables
4.2 to automatically number the references in the manuscript.

A typical example might be:

The corresponding  would be:

Journals differ in how the <cit.>will be displayed.  Most APS journals
display the citation in-line, as a number, enclosed in square brackets,
e.g., “String theory[1] attempts….” Other journals
may instead use a number in a superscript: “String theory$^{1}$ attempts….”
Selecting the journal substyle using a class option will invoke the appropriate style.
In journal substyles using superscripts,
the macro the key is necessary to get the number
to appear on the baseline.
For example, “String theory (see, for example,
)” will give the output
“String theory (see, for example, Ref. 1).”

The  command has the same semantics as
natbib's  command.

A <cit.>command with multiple keys is formatted with consecutive
reference numbers collapsed; e.g., [1,2,3,5] will be output as
[1–3,5].  To split the list over more than one line, use
a  character immediately following a comma:

The  avoids unwanted spaces.

§.§ Author/Year (Non-numeric) Citations

Reviews of Modern Physics uses a citation style based on the
first author's last name and the year of the reference rather than a
simple number. Support for this style of citing references is the
primary reason  4.2 uses the natbib
package. natbib uses an optional argument to the
macro to specify what text to use for the <cit.>text:

where short-name is the author name used in a parenthetical citation,
long-name that used in a textual citation, and
year is the year. More concretely, the  example
above would appear as

When the citation constitutes part of the grammar of the sentence,
the key command may be used (analogous to the
command above). Both  and
are built upon natbib's rich repertoire of
macros (<cit.>, <cit.>, etc.). These macros are available in
4.2; however, APS authors must follow the
APS Author Guide for  4.2
guidelines regarding natbib's macros.

§.§ Combined Author/Year and Numeric Citations

AIP's Journal of Mathematical Physics uses a combined author/year and numerical citation style.  4.2 supports this referencing style. Please see the Author's Guide to AIP Substyles for  4.2 for more information about this style.

§.§ Using Bib

The  entries can be coded by hand as above, of course, but the
use of  with the new style files provided with  4.2 makes
it particularly simple to generate marked-up references that can, for
instance, take advantage of packages like
hyperref for linking. They also save the trouble of having
to specify formatting like the italics for the book title in the above
example. And, for those wishing to use author/year citations,
will automatically generate the appropriate optional arguments for the

is an adjunct to  that aids in the
preparation of  bibliographies.  allows authors to build up a
database or collection of bibliography entries that may be used for many
manuscripts. A  style file then specifies how to transform the
entries into a proper  for a particular journal. Here we
give a brief summary of how to get started with . More details can be
found in the LaTeX books listed in the references.

Selecting a journal style by using an appropriate class option will
automatically select the correct  style file from those included in
4.2. Five basic  style files are included: apsrev4-2.bst (APS journals using a numeric citation style, i.e., all but RMP), apsrmp4-2.bst (author/year style citations for RMP),
aipauth4-2.bst (AIP journal using an author/year citation style),  aipnum4-2.bst (AIP journals using a numeric citation style) and aapmrev4-2.bst for AAPM journals. The selection can be overridden by specifying an
alternative .bst file using the standard  macro. This must appear in the preamble
before the document line in  4.2 (this differs from
standard ).

The  database files will contain entries such as:

There are entry formats for articles, technical reports, e-prints,
theses, books, proceedings, and articles that appear in books or
proceedings. The styles provided with
4.2 also allows URL's and e-print identifiers to be specified
for any of the different entry types. There is also an additional
“collaboration” field that can be used in addition to “author'.'

To actually create the bibliography in the manuscript, the
bib files macro is used.
Here bib files is a comma-separated list of  bibliography
database files, each with the .bib extension. The
macro should be placed at the location where the
references are to appear (usually after the main body of the
paper). When the manuscript is processed with  for the first
time, the keys corresponding for the <cit.> macros used in the
manuscript are written out to the .aux file. Then  should
be run (if the manuscript is called paper.tex, the command would
be . This will produce a .bbl file containing all
of the 's for the manuscript. Subsequent runs of will call this file in to resolve the references.  should be run
repeatedly until all references are resolved.

The -produced 's created using the  style files appear considerably more complex than the example given
above. This is because the style files add in ,
, , and <> macros for
specifying additional formatting and tagging. The  macro
is mostly a do-nothing macro that serves merely to tag the information with
the field information from the original entry in the  database.
The  and < >macros can be used to create the
appropriate hyperlinks in target formats such as PDF.

For more information on using  with , see Sections 4.3.1
and C.11.3 of the [Lamport, 1996], Section 13.2 of [Goossens, 1994],
or the online  manual btxdoc.tex from

§.§.§  support

4.2 supports citing e-prints from  For instance, the  entry

will include the arXiv.org e-print identifier as  and hyperlink it (if using ). The newer format for arXiv identifiers with primary classifications will produce appropriate output  For example,

will generate  and hyperlink it.

§.§.§  option

In the  4.2 Bib style files, the behavior of the  option was changed to only suppress the arXiv identifiers for journal references, but keep them for e-print references.

§.§.§ Citing data sets with a DOI

Bib styles in  4.2 add support for citing data sets using the new Bib type :

This results in the formatted reference: “J. A. Haigh, N. J. Lambert, S. Sharma, Y. Blanter, G. E. W. Bauer, and A. J. Ramsay, Data from Figures in “Selection
rules for cavity-enhanced Brillouin light scattering from magnetostatic modes" [Data set], 10.5281/zenodo.1284434 (2018),

This is primarily intended for data sets that have a DOI assigned to them.

§.§.§ Journal references with only DOIs

Some journals have moved to using only a volume and DOI to identify an article and do not assign page numbers or article identifiers. In the  Bib style file used for the Phys. Rev. journals, If the  field is absent from an entry in the  file, but the  field is present, the DOI will be explicitly displayed and linked in the formatted reference.

§.§.§ Journals that use the year and issue for unique citations

The  style used for Phys. Rev. journals now includes support for four journals that use the year in place of a volume and require an explicit issue to uniquely cite a paper:

* J. High Energy Phys.

* J. Cosmol. Astropart. Phys.

* J. Instrum.

* J. Stat. Mech.: Theory Exp.

The Bib entry must exactly match one of the these four abbreviated journal names or use the corresponding macro, , , , or , resp., to invoke the proper formatting. For example:

will be formatted as  “S. Cotogno, T. van Daal, and P. J. Mulders, Positivity bounds on gluon TMDs for hadrons of spin $\le$ 1, J. High Energy Phys. 2017 (11), 185."

§.§ Multiple references in a single bibliography entry

4.2 allows multiple references within a single bibliography entry when using Bib. This done by using a starred (*) argument to the <cit.>command, and it requires a compatible version of  and the  files that come with  4.2. To combine multiple references into a single , precede the second, third, etc. citation keys in the <cit.>command with an asterisk (*). For example  will combine the s with keys , , and  into a single entry in the bibliography separated by semicolons.

§.§ Prepending and/or appending text to a citation

The expanded syntax for the  <cit.>command argument can also be used to specify text before and/or after a citation. For instance, a citation such as:

may be created by the following <cit.>command:

Please note the use of curly braces to enclose the text within the square brackets as well as the spaces next to the brackets.

§ FIGURES AND ARTWORK

§.§  environment

Figures may be included into a  4.2 manuscript by using the
standard  macros. It should be noted that  includes
several powerful packages for including the files in various
formats. The two main packages are graphics and
graphicx. Both offer a macro called
they mainly differ in how arguments for
controlling figure scaling, translation, and orientation
are specified. For more information on the enhancements of the graphicx package,
see [Goossens, 1997] or the guide grfguide.pdf available at
4.2 no longer has the epsf class option, though
the epsfig package provides a similar interface.

The figure environment should be used to add a caption to the figure and
to allow  to number and place the figures where they fit best.
will label and automatically number the captions FIG. 1,
FIG. 2, etc. For example:

Note how the key command is used to cross-reference
figures in text. The key command should be inserted
inside the figure caption. As usual, the <ref>key macro can
then by used to refer to the label: “As depicted in

Figures are normally set to the width of the column in
which they are placed. This means that in two-column mode, the figure
will be placed in a single, narrow column. For wide figures, the
environment should be used
instead. This will place the figure across both columns (the figure
usually will
appear either at the top or the bottom of the following page).

Captions less than one line long are centered under the figure,
otherwise they span the width of the figure.

Note that is unnecessary (and undesirable) to use explicit centering
commands inside the float environments.

§.§  environment

Papers often refer to multimedia material such as videos. The  environment is identical to the  environment, but the caption will be labeled as a Video (with its own counter independent of figures). A URL can also be specified so that the caption label can be linked to the online video (if using the  package). The included graphic (using from the  or  package) would be a representation frame from the video. A  is also provided.  For example:

There is also a corresponding  command.

§ TABLES

Tables are very similar to figures. They should be input using the
table environment as detailed below, and
will label and number the captions TABLE 1, TABLE 2, etc.
(or in whatever format required by the chosen journal
substyle). Tables without captions won't be numbered.

Each table must begin with table, end with table. A
caption can be specified using the text command.
Captions less than one line long are centered under the figure,
otherwise they span the width of the figure.
To refer to the table via cross-referencing, a key
command should appear within the .  Use the
<ref>key command to cite tables in text. The table
environment will set the table to the width of the column. Thus, in
two-column mode, the table will be confined to a single column. To set a
table to the full width of the page, rather than the column, use the
table* environment.

The heart of the table is the
tabular environment. This will behave for the most part as in
standard  (please refer to Section 3.6.3 and Appendix C.10.2 of the
for more details about the tabular environment).
Note that  4.2 no longer automatically adds double (Scotch) rules
around tables. Nor does the tabular environment set various
table parameters for column spacing as before. Instead, a new
environment ruledtabular provides this functionality. This
environment should surround the tabular environment:

A basic table looks as follows:

The quasitable environment is no longer in  4.2. The
standard tabular environment can be used instead because it
no longer puts in the double rules.

§.§ Aligning on a decimal point

Numerical columns should align on the decimal point (or
decimal points if more than one is is present). This is accomplished
by again using a standard  package, dcolumn which
must be loaded in the manuscript's preamble:

Once this package is loaded, the column specifier `' can be
used in the table's tabularpreamble enviroment preamble.
The `' should be used for simple numeric data with a single
decimal point.

The entry of a  column is typeset in math mode; do not
insert any  math delimiters into a `' column.  Items
without a decimal point are simply set in math mode, centered.  If
text is required in the column, use  or as
appropriate.  If multiple decimal points are present then the last is
used for alignment. To escape from the `' column use
as usual. See the sample file apssamp.tex for examples.

§.§ Footnotes in Tables

Footnotes in a table are labeled a, b, c,
etc. They can be specified by using the  []command. Furthermore,
and  can be used so that multiple entries
can to refer to the same footnote. The footnotes for a table are typeset
at the bottom of the table, rather than at the bottom of the page or
at the end of the references. The arguments for  and
should be numbers 1, 2, …. The journal style
will convert these to letters.  See sample file apssamp.tex for
examples and explanations of use.

§.§ Dealing with Long Tables

By default, tables are set in a smaller size than the text body
(). The  declaration makes the table font
smaller still ().  Thus, putting the
command before the table line in a table
will reduce the font size. If this isn't sufficient to fit
the table on a page, the standard  longtable
package may be used. The scope of the
command must be limited by enclosing it with a group:

Tables are normally set to the width of the column in
which they are placed. This means that in two-column mode, the table
will be placed in a single, narrow column. For wide tables, the
environment should be used
instead. This will place the table across both columns (the table
usually will
appear either at the top or the bottom of the following page).

To break tables across pages,  4.2 requires adding to the
table a float placement option of [H] (meaning put the table “here”
and effectively “unfloating” the table) to the table
command. The commands  and  can be used to
control where the page breaks occur (these are the same as for the
eqnarray environment).

Long tables are more robustly handled by using the
longtable.sty package included with the standard distribution (put  in the preamble). This
package gives precise control over the layout of the table.
The  4.2 package contains patches that enable the
longtable package to work in two-column mode. Of course, a
table set in two-column mode needs to be narrow enough to fit within
the column. Otherwise, the columns may overlap.  4.2 provides
an additional environment longtable* which allows a longtable to
span the whole page width. Currently, the longtable* and
ruledtabular environments are incompatible. In order to get the
double (Scotch) rule, it is necessary to add the
manually (or define  and
appropriately).  For more documentation on the longtable
environment and on the package options of the
longtable package, please see the documentation available at
<http://www.ctan.org/macros/latex/required/tools/longtable.dtx> or
refer to [Goossens, 1994].

§ PLACEMENT OF FIGURES, TABLES, AND OTHER FLOATS

By default, figures and tables (and any other “floating” environments
defined by other packages) float to the top or bottom of the page
using the standard  float placement mechanism.  Initially, each
figure or table environment should be put immediately
following its first reference in the text; this will usually result in
satisfactory placement on the page.  An optional argument for either
environment adjusts the float placement. For example:

where placement can be any combination of , signifying
“here”, “top”, “bottom”, “page”, and “as soon as possible”,
respectively. The same placement argument may be added to a
table. For more details about float placement,
see the instructions in the , Appendix C.9.1.

In two-column mode, a page may contain both a widetext
environment and a float.  4.2 may not always be able to
automatically put the float in the optimal place. For instance, a
float may be placed at the bottom of a column just before the
widetext begins. To workaround this, try moving the float
environment below the widetext environment. Alternative
placements may also alleviate the problem.

figure and table environments should not
be enclosed in a widetext environment to make them span
the page to accommodate wide figures or tables. Rather, the
figure* or table* environments should be used instead.

Sometimes in  the float placement mechanism breaks down and a
float can't be placed. Such a “stuck” float may mean that it and all
floats that follow are moved to the end of the job (and if there are
too many of floats, the fatal error
will occur).  4.2 provides the class option
floatfix which attempts to invoke emergency float
processing to avoid creating a “stuck” float.  4.2 will provide
a message suggesting the use of
floatfix. If floatfix doesn't work or if
the resulting positioning of the float is poor, the float should be
repositioned by hand.

4.2 offers an additional possibility for placing the floats. By
using the either the endfloats or the
endfloats* class option all floats may be held
back (using an external file) and then set elsewhere in the document
using the the commands  and ,
placed where the tables and figures are to be printed (usually at the
end of the document).  (This is similar to the standard
command). Using a -form of the commands
( and
) will begin the figures
or tables on a new page. Alternatively, the option
endfloats* may be used to change the behavior of the
non--forms so that every float will appear on a separate
page at the end.

Without one of the endfloats class options, these float
placement commands are silently ignored, so it is always safe to use
them.  If one of the endfloats class options is given,
but the  command is missing, the tables will be
printed at the end of the document. Likewise, if  is
missing, the figures will be printed at the end of the document.
Therefore it is also safe to omit these commands as long as 's
default choices for ordering figures and tables are satisfactory.

The endfloats option (or perhaps some journal substyle
that invokes it), requires explicit figure, figure,
table, and table lines. In particular, do not
define typing shortcuts for table and figure environments, such as

Please note that it is generally undesirable to have all floats moved
to the end of the manuscript. APS no longer requires this for
submissions. In fact, the editors and referees will have an easier time
reading the paper if the floats are set in their normal positions.

§ ROTATING FLOATS

Often a figure or table is too wide to be typeset in the standard
orientation and it is necessary to rotate the float 90
degrees.  4.2 provides a new environment turnpage as an
easy means to accomplish this. The turnpage environment depends
on one of the packages graphics or graphicx
being loaded. To use the turnpage environment, simply enclose
the figure or table environment with the turnpage

A turnpage float will be typeset on a page by itself. Currently, there
is no mechanism for breaking such a float across multiple pages.

§  4.2 SYMBOLS AND THE REVSYMB4-2 PACKAGE

Symbols made available in earlier versions of  are
defined in a separate package, revsymb4-2,
so that they may be used with other classes.
This might be useful if, say, copying text from a  document to
a non- document.  4.2 automatically includes these
symbols so it is not necessary to explicitly call them in with a

Table <ref> summarizes the symbols defined in this package.
Note that , , and  are
no longer in  4.2. Use  (standard in ),
⃛ (with the amsmath package loaded), and
≜ (with the amssymb class option) respectively.
≿, ≾, ≲, and ≳ are
also defined either in amsmath or amssymb. The
AMS versions of these commands will be used if the appropriate AMS
package is loaded.

Special  4.2 symbols, accents, and
boldfaced parentheses defined in revsymb.sty

$\lambdabar$        $\openone$

$\altsuccsim$         $\altprecsim$

$\alt$         $\agt$

x     $\tensor x$      x     $\overstar x$

x     $\loarrow x$      x     $\roarrow x$

( )     $\biglb( \bigrb)$
( )    $\Biglb( \Bigrb)$

( )     $\bigglb( \biggrb)$
(  )     $\Bigglb( \Biggrb)$

§ OTHER  4.2 FEATURES

§.§ Job-specific Override Files

4.2 allows manuscript-specific macro definitions to be put
in a file separate from the main  file. One merely creates a file
with the same basename as the  file, but with the extension
`.rty'. Thus, if the  file is names man.tex, the macro
definitions would go in man.rty. Note that the .rty file should be in
the same directory as the  file. APS authors should follow the
guidelines in the APS Author Guide for  4.2 when
submitting. Similarly, AIP authors should refer to the Author's Guide to AIP Substyles for  4.2

[Knuth, 1986] D.E. Knuth, The book,
(Addison-Wesley, Reading, MA, 1986).
[Lamport, 1996] L. Lamport, , a Document
Preparation System, (Addison-Wesley, Reading, MA, 1996).
[Kopka, 1995] H. Kopka and P. Daly, A Guide to
, (Addison-Wesley, Reading, MA, 1995).
[Goossens, 1994] M. Goossens, F. Mittelbach, and
A. Samarin, The Companion, (Addison-Wesley, Reading, MA, 1994).
[Goossens, 1997] M. Goossens, S. Rahtz, and
F. Mittelbach, The
Graphics Companion, (Addison-Wesley, Reading, MA, 1997).
[Rahtz, 1999] S. Rahtz, M. Goossens, et
al.,The  Web Companion, (Addison-Wesley, Reading, MA, 1999).


# QUANTIZED DECODER IN LEARNED IMAGE COMPRESSION FOR DETERMINISTIC
RECONSTRUCTION

###### Abstract

Learned image compression has a problem of non-bit-exact reconstruction due to
different calculations of floating point arithmetic on different devices. This
paper shows a method to achieve a deterministic reconstructed image by
quantizing only the decoder of the learned image compression model. From the
implementation perspective of an image codec, it is beneficial to have the
results reproducible when decoded on different devices. In this paper, we
study quantization of weights and activations without overflow of accumulator
in all decoder subnetworks. We show that the results are bit-exact at the
output, and the resulting BD-rate loss of quantization of decoder is 0.5% in
the case of 16-bit weights and 16-bit activations, and 7.9% in the case of
8-bit weights and 16-bit activations.

Index Terms—  quantization, learned image coding, reproducibility

##  1 INTRODUCTION

The demand for storage and transmission of multimedia data rapidly increases,
therefore continuous improvement of image/video compression algorithms and
their deployment is desired. JPEG [1], JPEG2000 [2], HEVC [3] and the state-
of-the-art VVC [4] are widely used standards based on classical compression
methods. End-to-end learning based methods [5, 6, 7, 8, 9] have been studied
extensively, some outperforming VVC. It is not a straightforward task to
deploy the learned image codecs on devices due to the non-deterministic
behaviour of neural networks and complexity of the computations.

Neural network based image codecs are trained with floating point (fp32)
arithmetic. Storing the resulting models requires a much larger memory than is
needed for storing integer models (int8/int16) with the same number of
parameters. Also the run time of floating point operations is higher than the
run time of integer operations. Quantization of the neural network as a
solution to the complexity problem has been studied by previous work in [10,
11, 12, 13, 14, 15]. Another problem of learned image compression are the
totally corrupted images occurring at the cross platform tests. Quantization
of the weights and activations of the entropy part to fix this issue have been
proposed by [14, 15, 16].

Our aim is to achieve bit-exact reconstructed images at decoder when running
on different platforms. For this it is sufficient to only quantize the neural
network components at the decoder. For many of the use cases of image coding,
the decoder of the image codec is fixed, while the encoder design is flexible.
Therefore, we quantize only the decoder in order to provide bit exact
reconstruction and keep the encoder side free for complex hardware
implementation. We reuse the idea in [16] for post-training quantization of
weights and activations without overflow and extend it to all decoder
subnetworks of the base operation point of JPEG AI VM (verification model)
[17] as shown in Fig. 1. We show that by quantizing only decoder networks by
reusing the method to eliminate the overflow of the 32-bit accumulator for
16-bit weights and 16-bit activations, we could achieve the deterministic
decoded reconstructed images with a minor loss. Also, we provide more
experiments to study the 8-bit weights with 16-bit activations, and also to
compare the effect of choosing the optimal clipping range instead of clipping
to the maximal range for both cases with 8-bit and 16-bit weights. In Section
2, we summarize the previous related work and compare it to ours. The overall
description of the learned image coding architecture is given in Section 3.1,
and its quantized components are explained in Section 3.2. In Section 3.3, the
method of quantization is described. The experimental results are provided in
Section 4 and conclusions are given in Section 5.

Fig. 1: High-level architecture diagram of the JPEG AI base operating point.
Encoder side subnetworks are $g_{a}$, $h_{a}$, $h_{\mu}$, $h_{\sigma}$.
Decoder side subnetworks are $g_{s}$, $h_{\mu}$, $h_{\sigma}$.

##  2 RELATED WORK

In [14, 15, 16] we see the quantization of weights and activations in entropy
part as a solution to the visible cross platform decoding error. In this paper
we extend the post training quantization method of 16-bit weights and
activations with no-overflow of 32-bit accumulator in [16]. While [16]
quantizes the entropy part only, this work applies quantization to the whole
decoder. We target a zero deviation and achieve exact reconstructed images at
cross platform tests while keeping the performance loss compared to the
floating point model minimal. Although the quantization of only the entropy
part as in [16] eliminates the broken images error at the decoder, there still
exists a tiny deviation of the quality of the reconstructed images due to the
remaining unquantized layers of the decoder, which is not visible visually but
can be measured numerically. This is not a critical problem for the image
compression task, but for some error-critical applications such as medical
image processing, or the video compression task, where the reconstructed image
typically becomes a reference for the prediction of the other frames, it is
desired to have no deviation. Also we show the results of quantizing only the
hyper decoder networks. This allows exact decoding of $\hat{y}$ and can be
interesting for computer vision tasks which can use decoded latent tensors
$\hat{y}$ directly as input, but do not need the reconstructed image.

In [10, 11, 12, 15], both weights and activations of the whole codec are
quantized. In [13] only weights (not activations) of the whole codec are
quantized. In [14] weights of the whole codec and activations of only the
entropy part are quantized. We quantize weights and activations of whole
decoder, i.e., decoder layers in main and entropy part. It is not necessary to
quantize all layers in the encoder to achieve the deterministic reconstructed
image. This way we allow more complexity at the calculations but the problem
of the bit-exact reconstruction is still simple to solve by a post-training
quantization method. In common use cases such as streaming, encoding is done
once on a device, and decoding is done on many devices. With proposed decoder
quantization, for the same input image, encoders on different devices can
generate bitstreams with small variation. However, we ensure that given the
same bitstream, decoders on different devices generate bit-exact reconstructed
images.

##  3 PROPOSED METHOD

###  3.1 Learned image codec

Fig. 2: A detailed architecture diagram of JPEG AI base operating point.
Quantized layers are marked with green colour.

As a baseline image codec, we use the base operating point of JPEG AI VM
software version 3.4.0 [17]. The JPEG AI VM has two different operating
points, high and base, with a different trade-off between complexity and
performance. The base operating point architecture consists of an entropy
model without context and it has simplified layers and activation functions
compared to the high operating point. The architecture of the base operating
point for one colour component is shown in Fig. 1. This codec processes colour
components separately. Each subnetwork consists of two separate components of
subnetworks, one processing the luma channel (Y) and one processing the two
chroma channels (U, V). The decoder consists of three main subnetworks, a
hyper scale decoder, $h_{\sigma}$, a hyper decoder, $h_{\mu}$, and a main
decoder, $g_{s}$; the subnetworks are highlighted in green in Fig. 1. There
are four models which are trained with different rate-distortion (RD) loss and
overall they produce five different quality points during inference. G-unit
and IG-unit are the trained vectors for gain and inverse gain unit, which
provide the variable rate functionality as in [18] and thus derive the highest
(fifth) rate point from the model of the fourth rate point. The JPEG AI VM
software has additional tools to improve the compression quality but all these
additional tools are turned off during our implementation, so the coding
pipeline is reduced to the neural network layers which are shown in Fig. 2.
The explicit block diagram of the light-weighted residual activation unit
(ResAU) and the light-weighted residual block (ResBlock) are shown on the
right-hand-side of Fig. 2.

###  3.2 Quantized part of the codec

We use the floating point trained models as the anchor, and apply the
quantization to the decoder subnetworks. The layers which are highlighted in
green in Fig. 2 are the convolutional layers to be quantized. The $h_{\sigma}$
is the subnetwork which is calculating the entropy parameters and is shared
between the encoder and decoder. From the previous work [15, 14, 16], we know
that it is necessary to quantize the entropy part of the subnetwork in order
to eliminate catastrophic decoded images. In this paper, we extend the partial
quantization of the codec to all the elements of the decoder, with the aim of
deterministic calculation of the reconstructed image $\hat{x}$ at the encoder
and decoder side. We replace the LeakyReLU activations in the hyper decoder
$h_{\mu}$ with an alternative implementation using bit shift. The subnetworks
which only exist at the encoder are the main encoder $g_{a}$ and the hyper
encoder $h_{a}$; these subnetworks are kept as floating point in our study.

###  3.3 Methodology for quantization of decoder subnetworks weights and
activations

Our work is based on the post training quantization method in [16]. This
method chooses the optimal per-channel quantization parameters for weights and
per-layer quantization parameters for activations while it takes care to avoid
an overflow of the accumulator register (guaranteed theoretically for any
potential input). The input clipping range and accumulator size are used to
calculate the maximal safe precision of the weights per channel.

We quantize the decoder subnetworks sequentially in three steps. The first
step is the quantization of the entropy subnetwork, $h_{\sigma}$, the second
step is the quantization of the $h_{\mu}$, and the third step is the
quantization of the main synthesis transform $g_{s}$. When going to the next
step, we use the model with the quantized networks of the previous step.

We always quantize the activations to 16-bit. The accumulator size is 32-bit,
and whenever there is a bias term it is quantized to 32-bit. We show two sets
of results, one with 8-bit quantized weights and one with 16-bit quantized
weights. We quantize the $h_{\sigma}$ weights (step one) to 8-bit only since
its loss is already minor. For simplicity, in this paper we say that all
decoder subnetworks are quantized with 16-bit weights, even when the
$h_{\sigma}$ weights are 8-bit. Also for both cases, we study the effect of
the different activation clipping ranges.

In [16] weights and activations are both 16-bit. There is one difference of
the weights quantization method from [16] if we apply 8-bit quantization to
weights. Instead of directly scaling the weights with the calculated factor
that eliminates the overflow $2^{-k_{j}}$ as in [16], we use this as an upper
bound and search the power of two of scaling factor in interval $[0,k_{j}]$
that results in the minimal quantization error for the weights. We observe
that this is necessary to minimize the clipping error. Because we clip the
8-bit weights to the interval $[-2^{7},2^{7}-1]$ instead of
$[-2^{15},2^{15}-1]$ as we do for the 16-bit weights case, scaling with the
maximum available scaling factor is not ideal for the smaller clipping range.

Activations precision and clipping range are chosen with a search which
optimizes the average BD-rate [19] compared to the anchor with unquantized
layers. We search for the optimal parameters layer by layer. The decision is
made based on the average BD-rate of a calibration data set calculated by two
distortion metrics as in (1), where combined YUV-PSNR has weights of 0.8 for
Y, and 0.1 for U and V components.

$\mathrm{BD}\text{-}\mathrm{rate}=\frac{\mathrm{BD}\text{-}\mathrm{rate(YUV}\text{-}\mathrm{PSNR)}+\mathrm{BD}\text{-}\mathrm{rate(MS}\text{-}\mathrm{SSIM)}}{2}$

(1)

Since the target is to achieve bit-exact reconstructed images at the cross
platform tests, we define an error measure to express the bit-exactness in a
quantitative manner. We run the encoder on one device and the decoder on
another device and measure the mean square error (MSE) between the
reconstructed images $\hat{x}$ at encoder and decoder side. The way that we
calculate cross-platform deviation is

$\mathrm{MSE_{enc,dec}}=\sum_{c\in\\{Y,U,V\\}}\mathrm{MSE}(\hat{x}_{c,\mathit{enc}},\hat{x}_{c,\mathit{dec}})$
(2)

where $\hat{x}_{c,\mathit{enc}}$ denotes the reconstructed image calculated at
the encoder, and $\hat{x}_{c,\mathit{dec}}$ denotes the reconstructed image
calculated at the decoder for colour component $c$.

##  4 EXPERIMENTAL RESULTS

Table 1: BD-rate (%) results of quantized sub-parts of decoder compared to the
anchor of floating point model

Quantized weights bit depth | BD-rate calculated based on the distortion metric
---|---
$h_{\sigma}$ | $h_{\mu}$ | $g_{s}$ | MS-SSIM | Y-PSNR | U-PSNR | V-PSNR | YUV-PSNR
int8 | - | - | 0.00 | 0.02 | 0.62 | 1.56 | 0.23
int8 | int16 | - | 0.01 | 0.06 | 0.50 | 1.45 | 0.24
int8 | int16 | int16 | 0.46 | 0.57 | 0.96 | 2.30 | 0.78
int8 | int8 | - | 0.85 | 0.96 | 1.76 | 3.06 | 1.25
int8 | int8 | int8 | 7.86 | 7.08 | 5.04 | 8.14 | 6.98

The trained models of the JPEG AI VM base operation point are the anchor of
the experiments. Then, we apply quantization to the weights and activations of
the subnetworks of these models. We use the training, validation and test data
which are provided by the JPEG AI common test conditions [20, 21]. For
quantization we use the calibration set as in [17]. It is a set of 16 images
of various resolutions and content picked from validation set. For the results
evaluation, we run the inference on the 50-image JPEG AI test set. We measure
the average BD-rate deviation from the floating point model as well as the
deviation between reconstructed images of encoder and decoder. We show how
much each decoder network component contributes to the reconstructed image
deviation.

In Table 1, we present the results of the BD-rate loss of quantization. If we
quantize all decoder subnetworks with 16-bit weights and 16-bit activations,
the performance loss is 0.46% and 0.78% of BD-rate based on MS-SSIM and YUV-
PSNR, respectively. If we quantize all decoder subnetworks with 8-bit weights
and 16-bit activations, the performance loss is 7.86% and 6.98% of BD-rate
based on MS-SSIM and YUV-PSNR, respectively. We also see the loss of the
intermediate steps (‘-’ means subnetwork is not quantized) and observe that
the larger loss is introduced by the synthesis transform quantization.

We show the reconstructed image error of cross platform encoding and decoding
in Table 2. If the model is not quantized at all, there is a huge deviation at
the reconstructed tensors which are calculated at the encoder and decoder
side. If we quantize only the entropy part, $h_{\sigma}$, we can decrease this
error significantly but it is still not zero. If we quantize additionally the
hyper decoder $h_{\sigma}$, the deviation decreases by a small amount. Only if
we quantize all three decoder networks, we can achieve zero error, and confirm
that the reconstructions are calculated exactly the same.

Table 2: MSE between reconstructed picture at encoder and decoder at cross
platform tests
GPU: NVIDIA GeForce RTX 4090
CPU: Intel(R) Core(TM) i9-10980XE CPU

Quant. subnetwork | Tested device
---|---
$h_{\sigma}$ | $h_{\mu}$ | $g_{s}$ |  | enc: GPU dec: CPU
---
| enc: CPU dec: GPU
---
- | - | - | 2.08E+04 | 2.10E+04
int8 | - | - | 2.15E-09 | 2.15E-09
int8 | int16 | - | 1.02E-09 | 1.02E-09
int8 | int8 | - | 1.04E-09 | 1.04E-09
int8 | int16 | int16 | 0 | 0
int8 | int8 | int8 | 0 | 0

Additionally, we study the effect of different activation clipping ranges
compared to a fixed clipping range. We test two variants, one with 8-bit
weights and one with 16-bit weights. Comparing the results shown in Table 3
with the flexible clipping results in Table 1, we observe that clipping to
different values can help the performance significantly when quantizing with
16-bit weights and activations, while it does not help much with 8-bit weights
and 16-bit activations case. This is because the risk of overflow of the
32-bit accumulator is much higher when the weights and input tensors both have
a bit depth of 16 bits.

Table 3: BD-rate (%) results compared to the of floating point model anchor
when activations are clipped to fixed range

Quant. subnetwork | BD-rate calc. based on the distortion metric
---|---
$h_{\sigma}$ | $h_{\mu}$ | $g_{s}$ | MS-SSIM | Y-PSNR | U-PSNR | V-PSNR | YUV-PSNR
int8 | int16 | int16 | 2.56 | 1.51 | 1.87 | 2.95 | 1.69
int8 | int8 | int8 | 7.85 | 7.07 | 5.07 | 8.17 | 6.98

##  5 DISCUSSION

In this paper, with the aim to achieve deterministic output pictures at
encoder and decoder at cross platform tests, we present a method which
quantizes the decoder subnetworks of a learned image codec JPEG AI base
operating point. We study a simple post training quantization with per layer
activation quantization and per channel weights quantization which eliminates
the overflow. With this approach, we can keep the original floating point
parameters of the encoder-only subnetworks of the codec, thereby not limit
encoder RD optimization algorithms.

In the case when all decoder subnetworks are quantized using 16-bit weights
and activations, we show that the loss from the floating point model is small
and we can achieve bit exact reconstructed images at the cross platform tests.
In the case of 8-bit weights and 16-bit activations, we still show the benefit
of deterministic calculation of reconstructed image but the loss relative to
the floating point models is higher. These two solutions at two different
settings can be interesting for different purposes. For research tasks such as
learning based or hybrid video compression, it might be beneficial to stop the
deviation of the decoded reconstructed picture while keeping the performance
as close as possible to floating point trained model since it can eliminate
the error accumulation to the predicted frame. On the other hand, for tasks
such as optimizing the complexity of the decoder there might be an interest to
use 8-bit weights since it decreases the storage load. The speed benefit of
our work is limited when activations are quantized to 16-bit since GPU
acceleration of tensor operations is only available for 8-bit, 4-bit or binary
input operands [22] today. However, smartphone NPUs support the inference with
8-bit weights and 16-bit activations [23].

## References

  * [1] Gregory K Wallace,  “The JPEG still picture compression standard,”  Communications of the ACM, vol. 34, no. 4, pp. 30–44, 1991.
  * [2] Athanassios Skodras, Charilaos Christopoulos, and Touradj Ebrahimi,  “The JPEG 2000 still image compression standard,”  IEEE Signal Processing Magazine, vol. 18, no. 5, pp. 36–58, 2001\.
  * [3] Gary J Sullivan, Jens-Rainer Ohm, Woo-Jin Han, and Thomas Wiegand,  “Overview of the high efficiency video coding (HEVC) standard,”  IEEE Trans. Circuits Syst. Video Technol., vol. 22, no. 12, pp. 1649–1668, 2012.
  * [4] Benjamin Bross, Ye-Kui Wang, Yan Ye, Shan Liu, Jianle Chen, Gary J Sullivan, and Jens-Rainer Ohm,  “Overview of the versatile video coding (VVC) standard and its applications,”  IEEE Trans. Circuits Syst. Video Technol., vol. 31, no. 10, pp. 3736–3764, 2021.
  * [5] Johannes Ballé, Valero Laparra, and Eero P Simoncelli,  “End-to-end optimized image compression,”  in 5th Int. Conf. on Learning Representations, ICLR 2017, 2017.
  * [6] Johannes Ballé, David Minnen, Saurabh Singh, Sung Jin Hwang, and Nick Johnston,  “Variational image compression with a scale hyperprior,”  in Proc. Int. Conf. on Learning Representations, 2018.
  * [7] David C. Minnen, Johannes Ballé, and George Toderici,  “Joint autoregressive and hierarchical priors for learned image compression,”  in Neural Information Processing Systems, 2018.
  * [8] Zhengxue Cheng, Heming Sun, Masaru Takeuchi, and Jiro Katto,  “Learned image compression with discretized Gaussian mixture likelihoods and attention modules,”  in Proceedings of the IEEE/CVF Conf. on Comput. Vis. Pattern Recog., 2020, pp. 7939–7948.
  * [9] Jinming Liu, Heming Sun, and Jiro Katto,  “Learned image compression with mixed transformer-CNN architectures,”  in Proceedings of the IEEE/CVF Conf. on Comput. Vis. Pattern Recog., 2023, pp. 14388–14397.
  * [10] Weixin Hong, Tong Chen, Ming Lu, Shiliang Pu, and Zhan Ma,  “Efficient Neural Image Decoding via Fixed-Point Inference,”  IEEE Trans. Circuits Syst. Video Technol., vol. 31, pp. 3618–3630, Sept. 2021.
  * [11] Heming Sun, Lu Yu, and Jiro Katto,  “Q-LIC: Quantizing Learned Image Compression with Channel Splitting,”  IEEE Trans. Circuits Syst. Video Technol., pp. 1–1, 2022.
  * [12] Hoang Le, Liang Zhang, Amir Said, Guillaume Sautiere, Yang Yang, Pranav Shrestha, Fei Yin, Reza Pourreza, and Auke Wiggers,  “MobileCodec: Neural inter-frame video compression on mobile devices,”  in Proceedings of the 13th ACM Multimedia Systems Conference, New York, NY, USA, Aug. 2022, MMSys ’22, pp. 324–330, Association for Computing Machinery.
  * [13] Heming Sun, Zhengxue Cheng, Masaru Takeuchi, and Jiro Katto,  “End-To-End Learned Image Compression With Fixed Point Weight Quantization,”  in 2020 IEEE Int. Conf. on Image Processing (ICIP), Abu Dhabi, United Arab Emirates, Oct. 2020, pp. 3359–3363.
  * [14] Heming Sun, Lu Yu, and Jiro Katto,  “Learned image compression with fixed-point arithmetic,”  in 2021 Picture Coding Symposium (PCS), Bristol, United Kingdom, June 2021, pp. 1–5.
  * [15] Johannes Ballé, Nick Johnston, and David Minnen,  “Integer networks for data compression with latent-variable models,”  in Proc. Int. Conf. on Learning Representations, 2018.
  * [16] Esin Koyuncu, Timofey Solovyev, Elena Alshina, and André Kaup,  “Device interoperability for learned image compression with weights and activations quantization,”  in 2022 Picture Coding Symposium (PCS), 2022, pp. 151–155.
  * [17] “JPEG AI verification model,” [Online]. Available ” https://jpeg-git.lx.it.pt/jpegai/vm”.
  * [18] Ze Cui, Jing Wang, Shangyin Gao, Tiansheng Guo, Yihui Feng, and Bo Bai,  “Asymmetric gained deep image compression with continuous rate adaptation,”  in Proceedings of the IEEE/CVF Conf. on Comput. Vis. Pattern Recog., 2021, pp. 10532–10541.
  * [19] Gisle Bjøntegaard,  “Calculation of average PSNR differences between RD-curves,”  VCEG-M33, 2001.
  * [20] “JPEG AI dataset,” 2022,  [Online]. Available ” https://jpeg.org/jpegai/dataset.html”.
  * [21] “JPEG AI common training and test conditions,”  Tech. Rep., ISO/IEC JTC 1/SC 29/WG 1 (& ITU-T SG16), 2023,  [Online]. Available ”https://ds.jpeg.org/documents/jpegai/wg1n100421-098-ICQ-JPEG_AI_Common_Training_%26_Test_Conditions.pdf”.
  * [22] “NVIDIA A100 tensor core GPU architecture,” [Online]. Available ”https://images.nvidia.com/aem-dam/en-zz/Solutions/data-center/nvidia-ampere-architecture-whitepaper.pdf”.
  * [23] “Snapdragon neural processing engine SDK reference guide,” [Online]. Available ”https://developer.qualcomm.com/sites/default/files/docs/snpe/quantized_models.html”.