BibTeX is used to add citations to a LaTeX document. Using it along with a LaTeX document is a bit unconventional. It is illustrated below with a simple example.
Assume, the LaTeX document is
Main.tex and the bibliographic records have been placed in a file named
bibliographystyle command to
Main.tex to indicate the bibliography style to use. For example, to use the default
plain style use:
Main.texto indicate the file containing the bibliographic entries to be used. Multiple bibliography files can be specified (separated by commas) and the
.bibfile extension is dropped. For example, add this line to
Main.tex. For example:
It will compile, but will output warnings that there were undefined references. The compilation produces a
This is one of the confusing aspects of BibTeX: it is run on the LaTeX file and not on the bibliography file! 😁
BibTeX will look for the
Main.aux file, look at the undefined references in it and try to resolve them using the bibliography file(s) indicated in
BibTeX produces a file named
Main.bbl, which is a database of references.
Main.tex (just like in step 4). It will still complain about undefined references.
Main.tex again (you heard it right!). The output file now should have its citations correctly.
To summarize, here are the commands for
pdflatex Main bibtex Main pdflatex Main pdflatex Main
Tried with: MikTeX 2.9