In a recent latex template I have been working I saw two file names in the bibliography command

\bibliography{biblio, chapter1}

What does this mean?

  • This means, that bibliography base is to be found in the files bibilio.bib and chapter1.bib – sztruks Nov 9 '15 at 18:57
  • @sztruks - Umm, that should have been bibilio.bib and chapter1.bib, right? – Mico Nov 9 '15 at 19:08
  • Can we have two bib files for bibliography – user87834 Nov 9 '15 at 19:12
  • @user 87834 sure you can – sztruks Nov 9 '15 at 19:13
  • Absolutely -- in fact, BibTeX can handle a very large number of .bib files. – Mico Nov 9 '15 at 19:13

The instruction

\bibliography{<list of one or more files with extension "bib">}

serves two rather distinct -- but not unrelated -- purposes:

  1. For BibTeX, it provides the listing of all bib files that may (should, actually!) contain bibliographic entries referred to via various \cite commands. BibTeX searches the listed .bib file(s) and -- assuming it can find the \cited entries -- formats them according to the instructions contained in the file pointed to by the \bibliographystyle directive. BibTeX places its output in a file called \jobname.bbl, where "\jobname" is the name of your main tex file -- the file that contains the \documentclass instruction.

  2. For LaTeX, the instruction \bibliography means, "go open the file \jobname.bbl and include its contents in the input stream you're processing, and print out the contents of the bbl file right here". LaTeX also writes the names of any bib files specified in the argument of \bibliography to the file \jobname.aux.

The very first time LaTeX is run on \jobname.tex, i.e., before BibTeX is ever run, the file \jobname.bbl is, by definition, still empty. LaTeX thus prints an empty bibliography and issues a warning that no bibliographic items were found. As mentioned above, it also writes the list of bib files to the aux file. Futhermore, until a BibTeX run is performed, all \cite commands are printed as ? since no bibliographic items have yet been processed and formatted. LaTeX also writes the keys of all bibliographic entries referred to via \cite instructions to the aux file.

When BibTeX is run, it reads the file \jobname.aux and finds out (a) which bibliography style is to be used, which files (with extension .bib) may contain the bib entries, and which entries are to be looked up in the bib file; recall that each \cite instruction produces a line item in the file \jobname.aux. BibTeX uses these pieces of information to create the file \jobname.bbl.

The next time LaTeX is run, the file \jobname.bbl is no longer empty; LaTeX therefore includes its contents in the input stream and generates the printed bibliography. By consulting the file \jobname.aux, LaTeX also performs a match between the \cite commands and their corresponding entries; at the end of the run, LaTeX writes to the .aux file what the output of each \cite command is supposed to be. (As I'm sure you know, some bibliography styles call for numeric citation call-outs, while others call for authoryear-style call-outs.)

The second time LaTeX is run after a BibTeX pass, it re-reads the aux file and can now match up the citation commands with what they're supposed to produce (variously formatted call-outs). Assuming no typos or other errors have occurred, all citation call-outs should now be properly resolved.

This is why you'll often see the admonition to run LaTeX, then BibTeX, and then BibTeX twice more to fully propagate all changes that may have been generated while the tex files were edited.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.