# Aastex Bibliography Meaning

0 Comments / 1 / By

I’ve now got a winning strategy for citations:  BibDesk, AASTeX, and a python script to clean it all up.

Keeping track of citations is a pain, but there are lots of great tools out there for keeping them all straight and eventually importing them into your papers.  For a while I was a big fan of Papers for Macs. But when I put it into practice, exporting to a BibTeX database and importing into an AASTeX manuscript, I was disappointed. Mostly because Papers fetches data from ADS, but doesn’t use the AASTeX macros for the different journal names. And I couldn’t customize it. Annoying.

That’s when I tried another combination: BibDesk (part of the MacTeX package). It’s a lot like Papers, though with less bells and whistles. But you can’t beat the price (free) and it has this really nice feature:  highlight any citation string (like 2011AJ….141…19B), right-click, and choose “Add to BibDesk”. Voila! Citation is imported from ADS complete with AASTeX journal macros.

There’s just one little problem:  the resulting \bibitem entries have all the author names. The ApJ and AJ Journal styles like to have one, two, three, four, or two with “et al.”. So I wrote a python script to parse a .bbl file and output it with the author entries all fixed up. You might ask:  why not update the BibTeX database instead. Well, I thought about that, but decided I wanted to keep the database in tact, in case I ever want to find someone deep down in the author list (like, say, me). So here’s my magic recipe:

1. Use BibDesk to maintain your .bib database:
2. Add entries by copying BibTeX entries to the clipboard.
3. Merge previous BibTeX databases
2. Use bibtex command as usual to build your .bbl file from your .tex manuscript.
3. Run my python script:
fix_authors ms.bbl
(it will make a backup of the original file:  ms.bbl.backup)
4. Re-run latex again. Maybe do that a couple of times. Just to be sure.

### Related

This entry was posted in Uncategorized. Bookmark the permalink.

## Usage

This section describes how to use the software. First make sure you have the necessary files in the right place, or have environment variables set appropriately (see section Installation).

## Bibliography Files

Now we describe how to set up your BibTeX files. If you are familiar with BibTeX already you can probably skip this section.

### Bibliography database files

Using BibTeX, your references are stored in a file, for example (the suffix is important). These need not (indeed, should not) be limited to the articles you are citing in the document you are preparing; BibTeX picks out the ones you actually cite and only includes those in your bibliography.

A typical entry in a file looks like this:

@Book{Peebles:94, author = {P.~J.~E.~Peebles}, title = "Physical Cosmology", publisher = "Princeton University Press", year = 1994, address = "Princeton, NJ" }

or like this:

@Article{1997ApJ...485....1M, author = {Myers, S.~T. and Jonathan E.~Baker and Readhead, A.~C.~S. and Erik M.~Leitch and Herbig, T.}, title = "Measurements of the Sunyaev-Zeldovich Effect...", journal = apj, year = 1997, month = aug, volume = 485, pages = "1--8", }

Other types include , , , , , , , , , and . The type is a catch-all which allows you to do the formatting yourself if necessary. Most of these types should give correct results for the journals using the files included here for AAS and MNRAS.

The first thing after the { is the cite key, which you use to cite the reference in your document. Note that author names can have either first or last name first, and they are separated with . Very long lists can be truncated with . Natbib's automatic lettering will get confused if the author last names are not punctuated consistently (e.g., if some of them have extra braces as in ADS style and others don't).

Emacs (see section Useful Emacs modes) has a very nice set of commands for automatically generating a bibliographic entry in a file.

### Using String Abbreviations for Journals (optional)

BibTeX will complain if it does not know the definition of a string which is not enclosed in quotes, such as the strings and in the example above. References downloaded from ADS will have instead of ; this tells BibTeX to write in the bibliographic entry. This is fine for AASTeX macros, where the command is defined in the style file. But if you are using a style file which does not define this command, you will get errors from LaTeX unless you define it yourself.

One way to handle this is to use the journal abbreviation files such as the ones included here, or . These contain commands such as

@STRING{apj = "\apj"}

in and

@STRING{apj = "ApJ"}

in which define the strings if you use a command like or in your document (see section Preparing the LaTeX Document) to include the files. This way you don't have to change your database for different journals, and you don't have to define a lot of new journal commands in your LaTeX document. Look at the files to see all the defined abbreviations. The very short abbreviations such as "ApJ" for frequently cited journals are included, along with many others following the IAU convention.

The three-letter month abbreviation strings and strings for a few mathematics journals are defined in the bibliography style () files.

## Preparing the LaTeX Document

First include the natbib style file. For LaTeX 2e,

\documentclass{ ... } \usepackage{ ... ,natbib}

or for LaTeX 2.09 (required by the journals),

\documentstyle[ ... ,natbib209]{ ... }

Place the natbib package last in your list of packages to make sure it doesn't get over-written. It works with the AASTeX styles as well as the style, and with the style (mostly, but see section MNRAS style).

Second, somewhere in the preamble (before ), use the command

\citestyle{aa}

This simply insures that natbib gives you citations which look like (Bester 1998) and not like (Bester, 1998). The stands for Astronomy & Astrophysics, but this citation style is appropriate for all the journals. (Actually, the code , which prepares files for electronic submission, produces citations like this regardless of the command, so this does not matter for the final output.)

Next, at the point where you want the bibliography to appear, use

\bibliographystyle{STYLE} \bibliography{REFS}

where is the name of the bibliography style you want to use (e.g., to use -- leave off the suffix). is a list of bibliography files to use (leave off the ). So if you wanted to use the ApJ journal abbreviations (see section Using String Abbreviations for Journals (optional)) and a database called ,

\bibliography{apj-jour,myrefs}

This loads the journal definitions from , so you can use things like in .

## Citation commands

The natbib package defines a number of very useful citation commands which replace the usual . These are really necessary in any author-year citation system, where you don't always cite a reference using the same format for the citation. These commands and their output are illustrated below. The most frequently used are (textual cite) and (parenthetical cite). is equivalent to , but this shouldn't be used because it is often defined by other style files.

Bester et al. (1998)
(Bester et al. 1998)

Multiple citations work within a single cite, for example

(Bester et al. 1998; Garibaldi et al. 1997, 1998a,b; ...)

The lettering of the citations and references is done automatically.

You can use optional arguments to get text before and after the citation(s):

(Bester et al. 1998, hereafter B98)
(e.g., Bester et al. 1998)
(see Bester et al. 1998, p. 68)

Any of these can have a affixed to make a full author list when "et al." would normally be used, e.g.,

Bester, Winters, & Alexander (1998)

Note that the script takes care of the bizarre practice of listing three names on the first citation and using "et al." thereafter, so you don't need to worry about that, although the intermediate file will come out "wrong".

Bester et al.
1998
(1998)

and are the sames as and , respectively, except that they do not produce any parentheses at all:

Bester et al. 1998

Finally, can be used to place arbitrary text around a citation. Look at the comments in the natbib style files for more information.

## Processing LaTeX/BibTeX files

When you process a document for the first time, or when you add citations to new references, you have to go through four steps. For a file called with a bibliography :

1.
Stores the citation keys in the file
2.
Creates a bibliography () file
3.
Incorporates the information
4.
Gets all the citations and cross-refs right

The file is a normal-looking LaTeX file containing the environment; it is inserted into the document at the point where the command is issued.

If you are producing an article for electronic submission, you can stop after step #2, run (see section Generating a Copy for Electronic Submission) and then run LaTeX (twice) on the output.

It's not too difficult to automate this process (see section Makefiles) and speed things up.

## Generating a Copy for Electronic Submission

Your article looks great now, but in the shape it's in as of the last section, you'll have to use a decidedly low-tech method of submitting it to the journal: print it out and snail-mail it in! This is because you cannot include complex style files like with your submission, and the journals don't provide bibliographic style files.

(As of AASTeX version 5.0, this is no longer true! You can stop here and simply submit your and files. But the `minor tweaks' mentioned below won't be performed, so you'll have to do them by hand. For instance, use the commands rather than commands the first time you cite a reference with three authors, to get all the names.)

Fortunately, there is a Perl script, , which comes to the rescue. It takes the and files you have made (see section Processing LaTeX/BibTeX files) and makes new ones which you can actually submit. This is accomplished by

• inlining all the citation commands properly
• removing all dependencies on natbib
• spitting out 's with the right format

A few other minor tweaks are also performed; you may notice some small style errors in the document before processing it. For input files and , invoke it by typing

(make sure it is executable and in your ). By default it will make new output files and , but you can name them something different by specifying a second argument.

The new files can be processed completely independently of the natbib files, the files, and your files. The bibliography is simply pasted in from the file, so all you need are the and , with the usual one or two passes with to process them.

The code has two options:

Inlines the bibliography so you end up with a single, stand-alone file. The default leaves the bibliography in a separate file.
Change the maximum number of authors before is used; default is 8. Set to zero for no limit.
Rather than generating the default environment with 's, generate a environment. This also leaves off the or commands. I found it was necessary for preparing a PASP conference proceeding.

The code looks for a containing "mn". If it finds it, it adds commands next to the inlined references; otherwise it adds the AASTeX command (unless the flag is set).

The code also ensures that three-author papers are cited as Bester, Winters, & Alexander (1998) on the first citation and as Bester et al. (1998) thereafter. This will not be the case in the input files because natbib does not do this. In addition, it truncates long author lists at the right point (8 authors, natbib doesn't do this).

Finally, the code may alter the appearance of the typeset bibliography, because natbib may redefine the environment in the input files. The output files will conform to the other style files (such as AASTeX) you are using.

Note that the script should work on files produced with any bibliography style, as long as it produces commands which exactly follow this format:

{ }

The may be omitted when it is the same as the (usually, <3 authors). This is the "extended natbib" format used by natbib versions 5.3 and later. The script will become confused in the unlikely event that there are square brackets in the author lists. The entries must be separated by blank lines.