简体   繁体   中英

LaTeX \cite giving a [?]

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?

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

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 .

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.

Compile it for the second time, you're done. Otherwise, clear all the auxillary files bla.tex produces and recompile twice.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM