views:

149

answers:

3

in blah.tex , I have a

\cite{blah}

I have a 'blah' entry in blah.bib

I run my file with :

latex blah.tex && blah.tex && dvipdf blah.dvi

The blah.pdf results in [?]

How do I fix this?

Thanks!

+3  A: 

You are missing a second latex:

latex blah.tex && latex blah.tex && dvipdf blah.dvi
------------------^

If you use BibTex (which you obviously do), you'll probably have to issue the command a third time (two times after applying bibtex blah):

latex blah.tex && \ # that's for preparing for bibtex
bibtex blah && \
latex blah.tex && \ # that's for resolving the crossrefs
latex blah.tex && \ # and that for putting them in the right place
dvipdf blah.dvi
Boldewyn
This is ridiculous but true.
Tom Smith
LaTeX has all the hassle but also all the power of non-GUI applications. You pay this price for good typography, and after all, you can put together a small Bash script or Makefile for this.
Boldewyn
Oh, I think LaTeX is wonderful. But in this specific instance I can't think of any reason why you might want to run it without resolving the references - so the double/triple pass should surely be built-in.
Tom Smith
Resolved. Thanks.
anon
@Tom: You might not be using Bibtex to generate the .bbl file. Inconvenience is Freedom!
Charles Stewart
+1  A: 

Latex does not look in your .bib file - it looks in your .bbl file. Have you run bibtex on your .bib file to generate your .bbl file? Is your 'blah' entry in your .bbl file? If not, run bibtex again.

Charles Stewart
+1  A: 

You could also adopt latexmk and not have to think about all this process anymore :) Just do latexmk blah and it will take care of compiling everything the correct number of times. It's bundled with any good TeX distribution, and you can get the manual with texdoc latexmk.

Damien Pollet
usage for myfile.tex (omit -pdf for dvi output) `latexmk -pdf myfile.tex` also latexmk has the -pvc option which is 'continuous preview mode' which will recompile as the source file changes (when saved). Great addition to your LaTeX toolbox!
Joel