Topic 3

BibTeX

In LaTeX, it is convenient to organize references in a .bib file. Sources that are not cited in the .tex file do not appear in the compiled PDF, so one .bib file can be shared across multiple papers.

What citations need

A BibTeX workflow uses two files together.

  • The .bib file stores reference entries.
  • The .tex file cites selected entries with citation keys.

Only the entries cited in the .tex file appear in the compiled PDF. This lets you keep many references in one bibliography file while printing only the sources used in the current manuscript.

Create a .bib file

Create a new file in the project root folder.

VS Code explorer menu for creating a new file

Name the file reference.bib.

VS Code explorer showing a new reference.bib file

Keeping the .bib file beside the manuscript makes it easy to track the reference file in Git and reuse it across related papers.

Find a BibTeX entry

Open a bibliographic database such as MathSciNet, Google Scholar, a journal website, or a publisher page.

MathSciNet
MathSciNet publication search page

Search for the book, article, or paper you want to cite.

MathSciNet search results for a reference

Open the record and choose the citation tool.

MathSciNet record page with the Cite button highlighted

Select BibTeX, then copy the citation entry.

MathSciNet citation formatting dialog with BibTeX selected

Add the entry

Paste the copied BibTeX entry into reference.bib.

@book {MR737190,
    AUTHOR = {Gilbarg, David and Trudinger, Neil S.},
     TITLE = {Elliptic partial differential equations of second order},
    SERIES = {Grundlehren der mathematischen Wissenschaften [Fundamental
              Principles of Mathematical Sciences]},
    VOLUME = {224},
   EDITION = {Second},
 PUBLISHER = {Springer-Verlag, Berlin},
      YEAR = {1983},
     PAGES = {xiii+513},
      ISBN = {3-540-13025-X},
   MRCLASS = {35Jxx (35-01)},
  MRNUMBER = {737190},
MRREVIEWER = {O.\ John},
       DOI = {10.1007/978-3-642-61798-0},
       URL = {https://doi-org.proxy1.cl.msu.edu/10.1007/978-3-642-61798-0},
}
VS Code editor showing a BibTeX entry inside reference.bib

The part after { is the citation key. In this example, the key is MR737190.

Cite the source

In the manuscript, cite the source with the citation key.

\cite{MR737190}

Then tell LaTeX which bibliography file to use.

\bibliographystyle{plain}
\bibliography{reference}
VS Code editor showing a citation command and bibliography commands in a tex file

The file name is written without .bib, so reference.bib becomes reference.

Compile the manuscript and check the PDF.

Compiled PDF showing an in-text citation and references section

The citation appears in the manuscript, and the cited entry appears in the references section. If a reference exists in reference.bib but is never cited in the .tex file, it will not appear in the PDF.

Some templates use biblatex instead of BibTeX. In that case, the project may use commands such as \addbibresource{reference.bib} near the top and \printbibliography near the end. Use the system your template expects.

After adding or changing citations, compile the manuscript again and check the PDF.

If the bibliography does not update immediately, run the build again. Bibliography tools often need more than one build pass before citations and reference lists are fully updated.