Latex

Love it or hate it, LaTeX is the standard typesetting language of the astronomical world.

Symbols

You’ll go mad without a master list of LaTeX codes for symbols and letters (or the awesome drawing recognition webpage Detexify2). If you’re using microns (or other microunits), you’ll want a mu that isn’t italicized. For this you’ll need to usepackage{upgreek}. Then, an upright mu will be upmu. Primes and double primes (for arcminutes and arcseconds) are simply ‘ and ” in math mode.

Dashes

LaTeX has three dash lengths that you need care about:

– A hyphen, used for hyphenated words.

— An en-dash, which is the same width as a lowercase ‘n’. Used for numerical ranges.

— An em-dash, which is the same width as a lowercase ‘m’. Used for sidetracks in text.

Example:
On 16–24 Jun 2009 we obtained high-quality spectra from 450–860 nm of the Doomsday Asteroid. If our back-of-the-envelope calculations are correct—and they always are—then it would be best to avoid the Seattle-Tacoma area from October–December 2012. If you can’t get out of there—maybe the traffic is too rough or something—then you may be interested in Chapters 7–9 of \citet{apocalypse_guide}.

Bibliography

Using BibTeX to manage your references is a real time-saver. It allows you to keep a separate (occasionally massive) file of references rather than continually updating the bibliography section of your paper. When you compile your file, only references cited in the paper will be included in the bibliography. How does this work? A brief intro is given here, but you can check out the longer explanation with AstroNat.

Firstly, you will need to create a separate text file that will have all of your references in it, for instance redshift.bib. Perhaps you would like to cite Hubble’s lectures on his observations of the expanding universe. On the NASA-ADS page for the book of his lectures, below the abstract is a link “Bibtex entry for this abstract” that gives you the following information:

@BOOK{1936rene.book…..H,

author = {{Hubble}, E.~P.},
title = “{Realm of the Nebulae}”,
booktitle = {Realm of the Nebulae, by E.P.~Hubble.~ New Haven: Yale University Press, 1936.~ ISBN 9780300025002},
year = 1936,
editor = “{Hubble, E.~P.}”,
adsurl = {http://adsabs.harvard.edu/abs/1936rene.book…..H},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

The first line contains the shortcut you’ll use to include this reference, 1936rene.book…..H. Since that’s irritating to type, I tend to change them to something more recognizable, such as HubblesLaw. When you change the shortcut name, be careful not to delete the comma at the end. My altered shortcut line would now look like this:

@BOOK{HubblesLaw,

To include a citation to this article in your paper, you would type the following (or multiple shortcuts separated by commas):

  • \citet{HubblesLaw} for an in-text citation
  • \citep{HubblesLaw} for a parenthetical citation
  • \nocite{HubblesLaw} to include the reference only in your bibliography

To tell LaTeX that you’re using BibTex, you’ll need to include two more lines in your document:

  • specify your bibliography style before your \begin{document} tag, for instance with \bibliographystyle{apj} (and make sure you have the apj.bst file in the same directory)
  • instead of \begin{bibliography} … \end{bibliography}, indicate which .bib file to use for your bibliography with \bibliography{redshift}

To compile your file, you’ll have to run LaTeX (latex myawesomepaper) which generates a bunch of citation errors, then run BibTex (bibtex myawesomepaper), and then run LaTeX again (latex myawesomepaper). Actually, you may have to run LaTeX a few times at the end to ensure all the citations are managed properly. Anytime you change the Bibtex file or add a citation to your paper, you’ll have to go through these steps again. There are a few other caveats, such as quirks of conference proceedings or changing punctuation separating multiple entries, but it really is as simple as it looks.

James provides a solution for how to include a reference with an excessive number of authors without having it take up an entire page. This function solves a very specific problem when using the BibTex package with LaTex. Namely, it can help control the number of authors listed for a single paper in the references section. If you have a 400+ author paper, you probably don’t want all 400 of them listed. Depending on the style file you’re forced to use in order to get the in-text citations to look the way they need to, you may or may not have built-in options to manipulate the number of authors or the use of ‘et al.’ in the references section.

As long as the style file you’re using has a function ‘format.names’ like the one below (the one marked ‘original function’) you SHOULD (no promises) be able to comment it out and replace it with the modified version. You can then hard code in a limit (currently set to 12) after which BibTex will stop writing the author’s names and instead use ‘et al.’