Featured Book

LaTeX Beginners Guide

Partner Sites

TeXwelt - Fragen und Antworten zu LaTeX
TeXblog
TeXample
A brief and concise description of RevTeX 4 package PDF Print E-mail
(894 votes, average: 3.97 out of 5)
LaTeX - Document Classes
Written by Thiago S. Mosqueiro   
Tuesday, 10 February 2009 05:15

In this article, we describe briefly the RevTex 4 package for those interested in Physical Review look and feel. As a non-trivial article, some features supported (and not supported) by RevTeX 4 are presented with screenshot examples. This article may help physicists in first touch with APS journals and manuscripts submittion.

Version: click here for update notes

Introduction

RevTeX 4 is a set of macro packages designed to be used with LaTeX 2e. These macros might be used in LaTeX articles by naming the document class as revtex4, wich is well-suited for preparing manuscripts for submission to American Physical Society (APS) journals. The full documentation of RevTeX 4 can be found here. Unfortunately important information are spread away in internet and we hope this article helps new users.

The first natural question one might ask before using any different document classes (or an entire macro package) would be close to what are the design principles of this new document class? Since, for pratical purposes, RevTeX 4 is a new document class and it is really different from ams or article document classes (see comparison section), let's cite some of the principles listed in RevTeX's Home Page. First of all, RevTeX 4 is fully compatible with LaTeX 2e and it relies on standard LaTeX 2e packages for common tasks (as examples, graphics/graphicx, color, hyperref and longtable). Also, RevTeX 4 provides better support for achieving the Physical Review look and feel, including the improved front matter macros for tagging authors, affiliations and references (see this section), promoting the use of BibTeX. This latest tagging is designed to aid the peer-review and publication process from the moment a RevTeX paper is submitted. For college works or internal group reports RevTeX 4 have all the features required and offers an well formatted look.

First of all in this article, the starting section deals with installation and first-time use of RevTeX 4 package, both in Windows and Linux/Unix systems. In the following section, we compare this new class to two other document classes. After the comparison, we construct the article's title and we show some of the specifications of RevTeX 4.

Starting with RevTeX 4

It is not common to find this package in a default LaTeX/TeX distribution installation (for example, MikTeX or teTeX), but it can be easily found and downloaded. In debian-like systems (linux), we can find this as a package in Synaptics software. These systems use as default teTeX distribution. Equivalently, one may use the following terminal command:

sudo apt-get install revtex4

Since this calls a superuser permission with sudo, a superuser password will be required by the system. Once the identification is complete, the revtex4 package in system repository will be installed together with its dependencies. When installation is finished, RevTeX 4 is ready to use.

Using Windows MikTeX, we can find revtex4 together with thousands of other packages in MikTeX Package Manager (suposing the MikTeX installation's version is 2.4 or newer). After waiting MikTeX downloads and installs revtex4 package, it is necessary to open MikTeX Options and click on Refresh Now button so MikTeX can update all your LaTeX/TeX system. Again, RevTeX 4 is ready to use just after the system is refreshed.

There are cases in wich one cannot download revtex4 package from any system's repository (like Synaptics or MikTeX Package Manager). The RevTeX 4 team recommends downloading the TeX Live package, since it has everything including revtex4. Actually, TeX Live includes all the major TeX-related programs, macro packages, and fonts that are free software, including support for many languages around the world. Most important, it's available for Windows, Mac and Linux/Unix.

Once these steps are done, all the RevTeX 4 macros are ready to be used. So, starting a new LaTeX file with your favorite editor (namely we can cite TeXnicCenter for Windows users and Kile or GNU Emacs for Linux/Unix users [0]), it is only necessary

\documentclass{revtex4}

in the LaTeX document and, after compiled, it will be fully formatted using all the RevTeX standards. This line is the first of a LaTeX file, in a region we call as preamble: all the code before \begin{document} macro. This \documentclass macro loads the RevTeX 4 class [1]. In a most general case, it is possible to include some class options,

\documentclass[ -- CLASS OPTIONS -- ]{revtex4}

These class options defines the document's layout. At this point, one only needs to choose a journal style and either preprint or twocolumn styles. The possible journal styles are pra, prb, prc, prd, pre, prl, prstab and rmp. So, for example,

\documentclass[preprint, prX]{revtex4}

gives 12 pt, one-column, double-spaced look used for the review process (not yet publicated in a journal). Trying

\documentclass[twocolumn, prX]{revtex4}

gives a 10 pt font size, double-sized final documents (as already publicated) look [2]. Both of the precedings examples use prX as a generic journal style. In the class options, we can also define paper size options. A full list of these class options can be found in RevTeX 4 Command and Options Summary.

Many of the LaTeX 2e macros work just fine. For example, if a user wants to change the page numbers, the LaTeX 2e original method should work perfectly:

\setcounter[page]{12}

Another example of a genuine LaTeX 2e method is hiding all the page numbers, wich can be achieved with

\pagestyle{empty}

RevTeX 4 comes with a template file called template.aps, and you can copy and study this file here. The easiast way to begin with RevTeX 4 is using this template file. After a few trials, one may create its own template file and things should go easy. The document presented in screenshots as example is available for downloads: here is the TeX and here is the PDF version.

Preprint vs Two-Column

It is important now to discuss these two document class options: the preprint and twocolumn options. When submitting a manuscript to APS, the preprint option must be used instead of twocolumn. Even when submittions are made using twocolumns, this options is changed to preprint automatically upon submission. From Wikipédia, we can read this about preprint style.

Publication of manuscripts in a peer-reviewed journal takes some time, because manuscripts must undergo extensive reviewer critique. The need to quickly circulate current results within a scientific community has led researchers to distribute documents known as preprints, which are manuscripts that have yet to undergo peer review. So, a preprint is a draft of a scientific paper that has not yet been published in a peer-reviewed scientific journal. The immediate distribution of pre-prints allows authors to receive early feedback from their peers, which may be helpful in revising and preparing articles for submission.

Therefore, the preprint only helps referees when reviewing submissions. The preprint increases font size to 12 pt, increases line spacing and formats the text in one-column scheme. When writing a work, it is common to use twocolumn option. But when switching between these two options, there can be some problems with the new spacing and font size. So tables and equations need to be reformated. Since this is the version a peer review from APS will read, it is important to pay attention to these details when using preprint style.

Comparisons between classes

Now it would be usefull to compare RevTeX 4 with other widely used document class: article. We are not going to compare in deeply details these classes, but how they look like. If you know what you want to achieve for your paper or report, so now you can verify if RevTeX 4 may help you.

Article documentclass RevTeX 4 documentclass

Click for real sized picture (thumbnails). In the following sections, we are going to pay more attention to details of this macro package, and other details wich one may not see in these pictures shall be explored.

Constructing the article's title

Perhaps, the most important macro changes in RevTeX 4 are those pertaining to the markup of the front matter, i.e., title, authors affiliations, abstract, PACS, etc. While the macros are quite similar to other classes, the usage is quite different. In this section, we pay attention to this important subject, since this is the basis of documentation and search engines.

When starting your paper, one might want write the paper's title or header. It is quite common in other classes to use \maketitle macro for printing the header informations. In RevTeX 4, there is one little difference: the \maketitle macro comes after the abstract environment. It is possible to determine author's name, email, home page and affiliation. For the paper, abstract and it's keywords. There are specific macros for each one. Let's examine the following example.

\title{A brief and concise description of RevTeX 4 package}

\author{T. S. Mosqueiro}
\email{thiago.schiavo@gmail.com}
\homepage{http://legauss.blogspot.com}
\affiliation{Instituto de Física de São Carlos, University of São Paulo, São Carlos, SP - Brazil}

\date{\today}

\begin{abstract}
In this article, we briefly describe the RevTex 4 package for users interested in scientific publication around APS journals.
\end{abstract}

\keywords{latex-community, revtex4, aps, papers}

\maketitle

With RevTeX 4 (but not only with) it is possible to use double backslash to force linebreaking in the title or affiliation. If there are more than just one author, just repeat the same author's properties for each one. But it is really important that each \author macro has uniquely one author's name. Simmetrically, each \affiliation macro has its own affiliation information, not more than one.

(...)

\author{Name of author 1}
\email{Author 1 email}
\homepage{url of author 1 home page}
\affiliation{Author 1 affiliation}

\author{Name of author 2}
\email{Author 2 email}
\homepage{url of author 2 home page}
\affiliation{Author 2 affiliation}

(...)

Sometimes, we have more than one author with same affiliation. In this case, group authors with same affiliation and define the authors affiliation propertie only after the last author of this group. See the example bellow.

(...)

\author{Name of author 1}
\email{Author 1 email}
\homepage{url of author 1 home page}

\author{Name of author 2}
\email{Author 2 email}
\homepage{url of author 2 home page}

\affiliation{Author 2 affiliation}

(...)

Title without keywords Let's take a look in a screen shot of this last example. The figure (click for real size image) is a screenshot of a compiled revtex4 document, using two column, with three authors: T. S. Mosqueiro, J Doe and mr W. Y. S. I. W. Y. Get (of course, the two last names are not real). The same procedure can be used for inumerous authors with their inumerous respectives affiliations. As we can see, the date comes just after the last affiliation's name (as default in LaTeX 2e); the \today macro gives as argument the actual date when the document is compiled [3]. Notice that the abstract starts without any title and, as default, it is centralized. Even when using two columns (as this case), the abstract is printed separated from the columns.

One may notice that no keywords were printed in preceding figure. For displaying the keywords, use explicitly the showkeys class options. When compiling the file, we used the following header (adding a showkeys class option).

\documentclass[a4paper,superscriptaddress,twocolumn,prb,showkeys]{revtex4}
(...)

\begin{document}

\title{A brief and concise description of RevTeX 4 package}

\author{T. S. Mosqueiro}
\email{thiago.schiavo@gmail.com}
\homepage{http://legauss.blogspot.com}
\author{J. Doe}
\email{johndoe@someserver.com}
\affiliation{Instituto de Física de São Carlos, Universidade de São \\
Paulo. Av. do Trabalhador São-carlense, 400 CEP 369, 13560.970, São \\
Carlos, SP, Brazil.}

\author{W. Y. S. I. W. Y. Get}
\email{wisiwig@duh.com}
\homepage{http://www.google.com}
\affiliation{National Other Institute of Other Country.}

\date{\today}

\begin{abstract}
In this article, we briefly describe the RevTex 4 package
for users interested in scientific publication around APS journals.
\end{abstract}

\keywords{latex-community, revtex4, aps, papers}

\maketitle

Title with keys and superscriptaddress The symbols after the names in this figure are actually links for author's respectives emails and home pages. These informations are printed together with footnoes, as shown in this picture at right (click for real size image).

Both the author electronic adress and home page are hyperlinks: the first calls any service for mailing; the second, calls the default reader's browser, visiting the selected home page. These are usefull tools for on-line paper versions. The little bar in the figure indicates the end of the text in this two column scheme.

Footnotes authors details A quite differente result can be achieved using the superscriptaddress option in document class. This appears to be way papers get published by Physical Review journals. In the figure at right (click for real size image) we can see the output. It's the same header, same options, just adding with superscriptaddress option.

There are also cases in wich some author may have no affiliation. In this case, noaffiliation must be used. It is also possible to specify collaborations for each author, by means of collaboration macro. The author macro should not be used for collaborations, since these macros are used for documentations.

Specifications

There are some specifications around the environments and macros used in a RevTeX 4 document, specially if the authors aim to send it for publication. Some of these specifications may cause headache while working, since there are some prohibitive rules.

Text formatting

When writing a manuscript aimed at a journal, all the specific formatting requirements must be followed. As seen, RevTeX 4 formats a manuscript like a APS publication. This doesn't means exactly that APS publications are simply RevTeX 4 files: they deal with a complex software interacting with the RevTeX 4 preprint manuscripts. Usually, manuscripted are submitted to APS formatted with letter size paper. Since referees receive manuscripts electronically and they might want to print them out, consider using letter size paper when submitting papers.

When using RevTeX 4, the text is formatted using 10 pt font size. It is preferable to avoid old macros such rm or it. Since RevTeX 4 is fully compatible with LaTeX 2e, other macros may substitute these old ones. Here is a table of text and math more convenient formating macros. This table was copied from APS Guide to RevTeX. Finally, it is not possible to creat margin notes using \marginpar macro.

Using BibTeX

Bibliographic references We usually cite other works (such as books, papers, internet addresses, etc) using a separated section, the bibliography section in general. BibTeX stands for a tool and a file format wich are used to describe and process lists of bibliographic references in conjunct with LaTeX. Any LaTeX user can write a file with all his relevant bibliographic references, defining labels for each reference, and cite in his papers these references by using their label. A file with all this bibliographic information may be seen as a data basis. In this file, all the reference details are separated so the TeX can use them separately.

Let's see how BibTeX work a little more. First of all, save a new blank file with .bib extension [4]. For every relevant reference, add to this file a new entry. Supose one might cite an article by Mr. Get named That's what you see!, published at 2009. The entry in the .bib file should be like the following lines.

@article{get05, 
author = "Mr. Get",
title = {That's what you see!},
publisher = "nob" # "ody"},
year = 2005,
}

When citing our coulegue Mr. Get in a LaTeX document, it's only necessary to use \cite macro with get05 as argument:

\cite{get05}

This generates that biobliographic section we mentioned before and add's automatically and entry with the get05 labeled reference present in .bib specified file. But... Specified where? To complete the correct use of BibTeX, it's necessary to add the following code where the bibliographic section should be.

\bibliographystyle{ -- STYlE -- }
\bibliography{ -- .bib file --}

Usually, this is the last macros before \end{document}. This defines your library file. In --.bib file-- only the name of the .bib file should be, without the .bib extension. It's also possible to use a .bib file not located in the same folder as the LaTeX document: instead of the .bib file's name, supply the full address. For example, in a linux system one might use

\bibliography{/home/thiago/bibtex/books}

Using a non local .bib file may be very usefull, since there will be only one file to update everytime a new reference must be cited. If there are more than one .bib file, you can specify them separating by comas.

\bibliography{/home/thiago/bibtex/books,/home/thiago/bibtex/articles,/home/thiago/bibtex/hqs}

By --style-- we mean a predefined style for displaying these references. For example, plain and unsrt are widely used. See this page for more styles and examples.

After writing a paper, LaTeX dedicated editors, like Kile and TexNicCenter (not Emacs, for example), already compile the bibliography. Without any of these dedicated editors, it's necessary to run this routine.

latex papername
bibtex papername
latex papername

First, we compile the paper principal file. Then we generate the bibliography entries. At the end, we re-compile paper principal file so TeX can put together paper and its bibliography.

Since BibTeX is trully usefull as a standard, it is common to see journals providing together with an article its BibTeX information, so an user interested in citing this article can just copy and paste the reference details in his .bib file. If one doesn't want to use BibTeX, but the standard references LaTeX environment, just replace this environment with thebibliography environment, as rommended by APS team.

About math macros

With a few exceptions, all the standard math environments and math markups defined with LaTeX 2e are allowed, including the equation, eqnarray and displaymath environments; also included are the shortcuts for math texts like $ and \[ and \]. When inserting the amsmath package into preamble, all the ams-LaTeX markup will be allowed. By inserting into preamble we mean using the following macro into preamble.

\usepackage{amssymb, amsmath}

Actually, the amssymb package might be omissible for documents whose math symbol usage is relatively modest. About how to decides if your text is modest around math symbols, try leting amssymb out of \usepackage macro and compile. An error should appear if you text is not modest. Since a non-modest symbol would be missing in the case of an error related to amssymb, the error message may be something like "Undefined control sequence".

One of the widely used macros in amsmath is the \eqref: this creates a cross reference to an numbered equation (generated, for example, in a equation environment). This cross reference does not looks like other cross references, like that generated by \ref macro. For the following figure, we compiled this code.

begin{equation}
label{eq:test}
sum vec{f} = m vec{a} .
end{equation}
Let's try the both of cross references: eqref{eq:test} and ref{eq:test}.

crossreference

Usually, \eqref macro is used for equations (as macro's name mays suggest) and the \ref are used for sections, figures and other labeled numbered LaTeX objects. With the both of the macros, the resulting cross reference is by default an internal link to the referenced object.

Environment for long texts and equations

RevTeX 4 also presents an envinronment for long equations (and text): widetext environment. For example, one may use it as follows.

\begin{widetext}
Here you put your text and equations,
\begin{equation}
long equation here
\end{equation}
And finalizes the environment.
\end{widetext}

Example with widetext environment Inside widetext environment, it is possible to add any usual element or macro. As an example, see the figure at right. While writing a internal report or a college project, this environment can be really usefull. One may ask about amsmath package, but for widetext envinronment it is not necessary to add amsmath package: it is a envinronment for revtex4 class. Also, it is not a math dedicated environment, you can use it for large figures or just breaking the twocolumn

Documents without top margin

When compiling a revtex4 document, it's not unusual to get a document with no top margin (pdf specially). It's a common problem related to the dvips (or dvipdfm or ps2pdf): the bounding box is cutting off the top (wich actually exists) of the page. The first thing to do is to verify if you system is configured to use letter as paper size, and not A4 Paper. The right one is the letter, of course.

In the case of Unix/Linux system (when using tetex), try

texconfig

in a terminal window so you can verify the current default option.

Tables and wide tables

The sandard LaTeX 2e macros and environments are supported by RevTeX 4, as is the longtable package, wich may get tables to break across pages. As discussed, the preprint is the style used by referees, wich means that authors must ensure their tables format correctly under preprint option.

RevTeX's team also suggest the use of \squeezetable macro, so the font size inside tables gets reduced. Here is an example on how to use properly this macro.

\begingroup
\squeezetables
\begin{table}
.
.
.
\end{table}
\endgroup

RevTeX also provides an environment for automatically insert double lines around around the table: ruledtabular. This environment also formats all enclosed tabular environments to the full width of table and improves intercolumn spacing.

Counter macros and boxes

Its not possible to create counters in RevTeX 4 and its standard counters cannot be modified. So if an exceptional label is needed for an equation, the \tag macro should be used. If one is interested in using this \tag, it is necessary to add amsmath as document class option.

Most of the boxes (and the macros for manipulating boxes) are not allowed in RevTeX 4. The not allowed macros specified in most of documentations are \raisebox, \parbox, \minipage, \rulebox, \framebox, \mbox, \fbox, \savebox, \usebox. Also, the \lrbox environment and rules produces with \rule are not allowed.

Author's own macros

For convenience, it is possible to save keystrokes in new user defined macros. By this, we mean that all context dependent and low-level macros, like \if and \def, cannot be used. The LaTeX 2e macros for new commands declarations are allowed \providecommand, \newcommand and \renewcommand.

Appendices

Just like in other document classes, the appendices are sections that come before a \appendix macro. For example, a section named Further calculations is inserted right after an \appendix macro. In the compiled document with prb style, it should looks like a new section, but its name is followed by Appendix A words.

Acknowledgement environment

There is a specific environment for displaying acknowledgements: it is a special environment without reference number, called acknowledgment. As example, the usage should be like this.

\begin{acknowledgements}
We thank the \LaTeX Community for this Know How section.
\end{acknowledgements}

The preceding code creates a new section named acknowledgements with the content insed the acknowledgements environment.

Summary

In the most RevTeX's documentations, we can find a lot about how to write a well-suited work for publishing in APS journals. In this article, we tried to let this behind and focus on what revtex4 as document class can offer to us. But, since RevTeX 4 is a package aimed at publications in APS journals, some of the reasons of the package's details lies on publications purposis. Some of information about text formatting or related stuff can be found in the documentation and other articles about RevTeX 4. Conisder downloading the TeX version (and its PDF version) of the document presented in screenshots: here is the TeX and here is the PDF version.

As seen in last section, almost every formatting tasks are already done with RevTeX 4. That is why there are so many not allowed LaTeX features when using this class. Using APS guide for RevTeX 4 words, authors should try to keep things as simples as possible and correctly use the proper RevTeX 4 or LaTeX 2e macros. Even with these prohibitive rules, RevTeX 4 can be used quite well for internal reports, since it is already formatted like APS journals. Also, every stable RevTeX's version is fully supported by arxiv since 2001.

If you are interested in bugs and workarounds, you can find a frequently updated page here. The developing group of RevTeX 4 offers revtex@aps.org for users to send their comments.

Acknowledgement

I would like to thank Dr. E. S. Bernardes, P. Loreno and T. M. Schlittler for usefull discussions. All the images were generated using GIMP, teTeX (installation on XFCE with Ubuntu) and Adobe Acrobat Reader. Specially, I thank LaTeX Community for creating the Know How section and all the work they are having.

Notes

  • [0] - Linux users are spread in two great groups: those who use KDE and those who use Gnome. These are the two most widely used Desktop Environments. Of course there are others environments, but for the others any of these two editors may be used without any restriction (XFCE, for example, may load KDE softwares without problems). Kile is a software designed for KDE, but Gnome users may also use it. Personally, I recommend using Kile even for Gnome users.
  • [1] - The \documentclass macro in LaTeX 2e actually replaces \documentstyle in LaTeX2.09.
  • [2] - The twocolumn style may look like the publicated paper, but it is not recommend to use a compiled document with this style for estimating paper's size.
  • [3] - One may use \date{\today} without worrying anymore.
  • [4] - It is possible to use the same editors cited before.

Update notes:

  1. 11/02/09. Formatting details; for authors, pay attention to "
    " tags that may come before formatting
    . I have also created a link to the TeX example file and its compiled version in PDF.
  2. 16/03/09. Top margin problems when using A4 Paper as default.

Comments

avatar Ama
0
 
 
Can you set up a Can you set up a macro to run through the items in the data toildavian and then copy paste value from C2 onto another page? I am building a model with several inputs based on a product. I want the model to run through all 200 products I have and spit out the profit number. I have everything built, now I just need the macro to run through my data toildavian and for each selection record the profit number on a summary page. Any help would be great! Thanks!
B
i
u
Quote
Code
List
List item
URL
Name *
Email (For verification & Replies)
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
Cancel
B
i
u
Quote
Code
List
List item
URL
Name *
Email (For verification & Replies)
Code   
ChronoComments by Joomla Professional Solutions
Submit Comment
 

Latest Forum Posts



Re: "1. Introduction" rather than "Chapter 1. Introduction"
01/09/2014 12:43, Johannes_B

Re: How to centering a table and set the caption under the T
01/09/2014 11:51, Johannes_B

Re: How to centering a table and set the caption under the T
01/09/2014 10:52, ohmp2007

Re: Trouble accessing classes after new LyX installation
01/09/2014 09:59, Tom-85

Re: "1. Introduction" rather than "Chapter 1. Introduction"
01/09/2014 07:32, tronetq

"1. Introduction" rather than "Chapter 1. Introduction"
01/09/2014 04:29, tronetq

Re: how i write align without parentheses?
31/08/2014 20:39, cgnieder

Re: how i write align without parentheses?
31/08/2014 14:57, Stefan_K

how i write align without parentheses?
30/08/2014 21:05, mshj

Re: One more Year in Research Proposal Timeline
30/08/2014 18:06, richrr