Chapter 5
Paper production

 5.1 TeX and LaTeX
 5.2 The LANL archive

5.1 TeX and LaTeX

Starlink supports LaTeX and TeX users by maintaining and packaging for release a TeX distribution. This is typically based on one of the standard TeX distributions, plus an effort to ensure that the distribution includes packages of interest to astronomers, particularly some of the relevant journal style files. See the Starlink LaTeX page for details.

LaTeX is nominally (though not actually) re-released every six months, in June and December, with each release incorporating bugfixes, but no significant development. New features are being incorporated into LaTeX3, which is a major upgrade, still being developed. Versions more than a year old (that is, more than two releases ago) are formally ‘obsolete’, and bug reports won’t be accepted for them.

The current version of LaTeX is also known as LaTeX2e, to distinguish it from the by now completely obsolete LaTeX2.09, which is the version of LaTeX described in the first edition of Lamport’s book. LaTeX2e has significant internal differences from LaTeX2.09, but was intended to appear much the same to the user. The most prominent difference is that LaTeX2e files start with the declaration \documentclass[options]{classname}, and invoke further packages using \usepackage{packagename}, whilst LaTeX2.09 files start \documentstyle[options]{stylename}, with the options list being a mixture of style file options and package names. LaTeX2e will attempt to go into a ‘compatibility mode’ if it sees a file start with \documentstyle, but this isn’t terribly reliable, and you certainly shouldn’t create new files like this, unless some primitive publisher (which used to include MNRAS until rather recently) absolutely insists on it.

Other LaTeX resources you might want to examine are the UK TeX FAQ (this is very good), CERN’s TeXpages, and the catalogue at CTAN (the ‘Comprehensive TeX Archive Network’, hosted on three peer machines in the UK, Germany and the US, and mirrored worldwide; all TeX is there).

All this, of course, assumes that you’re already a LaTeX user. If you’re just starting with LaTeX, then the canonical place to start is with Leslie Lamport’s “LaTeX: a Document Preparation System, 2nd edition” [?]. I think this is a good introduction, because it concentrates on the basics, and leaves the elaborate details to others. The bulk of the book is an accessible introduction to LaTeX (and note that you really ought to avoid asking LaTeX questions until you’ve read chapter 2); appendix C is a reference manual.

If it’s the elaborate details you want, then you’ll need to supplement Lamport. Victor Eijkhout’s TeX by Topic is well spoken-of, though I haven’t examined it myself (the book is now out of print, but the author has made it available for free, for a donation). Two other good books to examine are “A Guide to LaTeX” [?], and “LaTeX Line by Line” [?]. Both are substantially more advanced than Lamport, and cover a lot of material densely but reasonably clearly. If forced to choose, I would go for Kopka and Daly over Diller, partly because they have produced a second edition covering LaTeX2e, but also because Diller seems to try to pack in too much, including some material (such as the intricacies of maths typesetting) which, if you’re going to learn, you should probably learn from Knuth’s TeXbook. Having said that, the advantage is a narrow one, and you’d be well-advised to choose based on whose writing style you prefer, and which one happens to be in the bookshop on the right day1. Both of the last two should be kept away from anyone not already convinced of LaTeX’s virtues, since they both make LaTeX seem much more forbidding than it actually is. Finally, Goossens, Mittelback and Samarin’s “The LaTeX Companion” [?] is useful, but intended as a reference, not as an introduction. For other print books, and details of these ones, see the TeX FAQ’s bibliography at, and Adam Lewenberg’s collection of TeX and LaTeX print resources.

There are a number of online tutorials. Both the ‘Gentle Introduction’ and the ‘Not so Short Introduction’ are available at CTAN. Peter Flynn’s ‘Beginner’s LaTeX’ is well written and informative, and spends a good deal more time on the preliminary technicalities than others; but — since it grew out of a two-day introduction to LaTeX aimed primarily at humanities users — it does not cover maths.

If you prefer learning by example, take a look at the standard sample files, small2e.tex and sample2e.tex. These will be somewhere in your LaTeX distribution, typically with a path ending in .../tex/latex/base/small2e.tex (try echo $TEXINPUTS or kpsepath tex to help locate the TeX distribution on your local machine).

The book on TeX is Knuth’s original, “The TeXbook” [?]. As well as describing the underlying TeX engine, this also describes Knuth’s very basic macro package, plain. You need the TeXbook if you’re writing a LaTeX macro package, if you demand complete control over positioning (tricky in TeX, but an out-and-out hassle in LaTeX), or if you just don’t like the way LaTeX lays things out and want to do it all yourself. If you don’t fall into any of those categories, plain TeX is probably not where to start (and I speak as a lapsed TeXie who has spluttered furiously at Leslie Lamport’s failure to impose a satisfactorily rigourous line on even such fundamental doctrinal matters as how the word ‘LaTeX’ is to be pronounced).

You should be aware of pdflatex, which is a version of TeX which produces PDF files directly rather than DVI files (though note that versions before 1.0-prerelease produce bad PDF which breaks Windows Acroread 5 at least).

Starlink has produced several documents concerned with LaTeX. The LaTeX user’s guide, SUN/9, concentrates on the practical details of LaTeXing your document and ultimately transforming it into PostScript. You should also refer to SC/9, the LaTeX cookbook. However, SGP/28, “How to write good documents for Starlink”, SUN/199, Star2HTML and SGP/50, “Starlink Document Styles” are primarily intended for those writing Starlink documentation.

5.2 The LANL archive

The LANL preprint archive is based, in the UK, at which is a mirror of the master archive at LANL. The archive is easy to use as a reader but not, unfortunately, transparently easy to use as an author (not helped by the rather snide error messages that come back if you slip up...).

The full instructions are comprehensive, but boil down to the following:

1It’s unfortunate that neither book is much of an advert for TeX’s potentially beautiful typesetting — both seem to be produced using a practically unmodified LaTeX book style.