Latex joys

I’ve been struggling to debug my Latex and bibtex source, trying to get it to produce some decent references. I had look everywhere for some pointers, but to no avail. So I emailed a LaTeX mailing list (MacOSX-TeX@email.esm.psu.edu) and got a very straight, very helpful answer. The way to go, it seems, is to forget Kyle, Lyx or TexShop, go back to basics and compile from the command line, as follows:

  • You have the files yourtext.tex and yourbiblio.bib.
  • In yourtext.tex, you have the command

\bibliography{yourbiblio}

You run (note that you don’t need the .tex extension in any of these commands)

1. latex yourtext
2. bibtex yourtext
3. latex yourtext
4. latex yourtext

In 1., the \cite keys and the name of yourbiblio are written to
yourtext.aux.
In 2., bibtex takes yourtext.aux and yourtext.bib and creates yourtext.bbl.
In 3., yourtext.bbl is read in, the \cite keys are completed with the
information from yourtext.bbl and written as \bibcite to yourtext.aux.
At this point, you still get the undefined reference warnings.
In 4., the information from yourtext.aux and yourtext.bbl is finally
used in the typeset and no warnings should appearany more, unless your
cite keys are really undefined.

If you trash yourtext.aux, you have to repeat steps 3. and 4.

Some of these steps must have gone wrong in your case. You can always
see the current state of affairs from the *.aux, *.bbl and *.log files.
They are ordinary text files and tell you everything there is to know.

This advice comes from Martin on the Mac OS X Tex list.