[Tex/LaTex] Using BibTex with pdfLaTeX

bibtexcompilingmacpdftex

I was trying to follow an example of how to use BibTex, which gave the below files:

test.bib

@BOOK{DUMMY:1,
AUTHOR="John Doe",
TITLE="The Book without Title",
PUBLISHER="Dummy Publisher",
YEAR="2100",
}

and test.tex

\documentclass{article}

\begin{document}

Random citation \cite{DUMMY:1} embeddeed in text.

\newpage

\bibliography{lesson7a1} 
\bibliographystyle{ieeetr}

\end{document}

I use vim as an editor, with pdfLaTeX to compile from the command line and am wondering how to use BibTeX with my current system. This suggestion doesn't seem to work for me, though I didn't understand beyond the 4 steps listed.

Best Answer

If you use the command \bibliography{lesson7a1} in your LaTeX file, then your bibliography file must be named lesson7a1.bib (and not test.bib). The idea behind this is that some users have just one bibliography file that they use in many different LaTeX documents. Therefore, the filename of the .bib file is not always the same as that of the .tex file. (However, if you want your .bib file to be called test.bib, you could of course change the above command to \bibliography{test}).

The website you linked to has the correct information. In your case, you have to run:

 pdflatex test.tex
 bibtex test
 pdflatex test.tex
 pdflatex test.tex

Note that the second command to run is bibtex test and not bibtex lesson7a1; the bibtex command will read the file test.aux and then lesson7a1.bib, and generate the file test.bbl.

Related Question