TeX and LaTeX

TeX and LaTeX are free software professional typesetting packages which are, sadly, little known in the world of Windows computing but are almost ubiquitous in Unix environments and especially in scientific publishing.

I first started using LaTeX (the most common interface to the plain TeX rendering system) for project reports in my 3rd year undergraduate work and immediately wished I'd discovered it earlier. If you've ever experienced the pain of trying to maintain coherent header and paragraph formatting in MS Word for documents over ~30 pages long you'll know what I mean. I won't even attempt to describe how nasty Word is when it comes to equation typesetting or the numbering and positioning of tables and figures!

LaTeX is especially nice for typesetting mathematical work — it has beautiful maths fonts and extremely powerful tools for handling tables of contents/figures/etc, citations, bibliographies and indices. The interface is more like programming than the Word-like "WYSIWYG" approach but the initial learning curve isn't too steep and is worth the effort.

Here's some TeX-related links that might be of interest:

I'll chuck a link to the "Not So Short Guide to LaTeX" on here sometime — it's a good initial reference. For more advanced features, the standard books on LaTeX (as well as TeX and Metafont) are:

There's plenty of others but these are the ones I've used in the past and found to be useful. I'm told that the Kopka and Daly "A Guide to LaTeX" book is the best of the lot, though...

LaTeX / BibTeX style files

There wouldn't be any point in me having this page if I didn't supply anything other than TeX-sycophancy, so here's a few LaTeX style files and other random things that I've been using for recent bits of work. Writing your own packages is quite easy and very worthwhile. One not-so-obvious trick is to set the TEXINPUTS and BIBINPUTS environment variables to include both the current directory (.) and the location of these packages and BibTeX reference files. Both are standard Unix colon-delimited path set strings... i.e. something that looks like /path/to/number/1:/path/to/number/2:..

TEXINPUTS is the search path for the kpathsea library used to carry out the TeX/LaTeX path resolution. Personally, I just have a standard texmf/tex/latex/ directory tree with subdirectories containing each non-standard class and package and I tell kpathsea to recursively search this directory by putting a double-slash (//) on the end of the search path. The same goes for the BIBINPUTS and BSTINPUTS variables, where the tree paths are typically texmf/bibtex/bib/ and texmf/bibtex/bst/ for BibTeX "*.bib" database files and "*.bst" style files respectively. The variable names match up to file types precisely as you'd expect!

export TEXINPUTS=".:/path/to/texinputs//"; export LATEXINPUTS=$TEXINPUTS; export BIBINPUTS=".:/path/to/bibinputs//"; export BSTINPUTS=".:/path/to/bstinputs//";

Anyway, here's those packages:

agbpresent class

(click here to download)

agbstd package

(click here to download)

agbhep package

(click here to download)

agbmath package

(click here to download)

Useful TeX packages

Here's a list of the most useful standard LaTeX packages (in my experience) and what they do:

I've also written a bunch of LaTeX packages specifically for high-energy physics (though several are of more general use). I'll document them soon: you might want to take a look at http://hepforge.cedar.ac.uk/heptex/ in case I forget to update this page.

Writing LaTeX macros, packages and classes

One of the most powerful features of LaTeX is its customisability: you can write your own macros to enforce consistency through your documents and improve the source code readability (as well as the benefits of single-source macros definitions when it comes to redefinitions). These macros can then be stored in "style" packages for convenience and you can define entire document classes which automatically set the document appearance as required and provide appropriate macro definitions. Hiding all the mechanics of this makes for much more elegant LaTeX source.

Anyway, here's a few hints and tips on how this sort of thing can be done consistently and flexibly: