How to Create a Bibliography in LaTeX with BibTeX and biblatex

By Dr. Zubair Khalid, DVM, MS, PhD ·

How to Create a Bibliography in LaTeX with BibTeX and biblatex

Quick Answer

  • Use BibTeX for classic LaTeX documents and journal templates that require .bst style files, while biblatex with biber offers more citation commands and language support for complex projects.
  • Create a .bib database file with entries for each source, then cite with \cite{key} and compile with the correct sequence: pdflatex, bibtex or biber, then pdflatex twice.
  • The main limitation is that biblatex requires biber as its backend, so Overleaf and TeXstudio users must select the correct compiler in project settings before the bibliography will generate.

Understanding the Two Bibliography Systems

LaTeX offers two primary pathways for generating bibliographies: the traditional BibTeX system and the newer biblatex package. Both read the same .bib database files, but they process citations differently and produce different output formats. Choosing between them depends on your document type, publisher requirements, and the complexity of your citation needs.

BibTeX has been part of LaTeX distributions for decades. It works with a .bst file that defines the bibliography style, such as plain, unsrt, abbrv, or IEEEtran. When you run BibTeX, it reads your .aux file, finds which citations you used, and formats the bibliography according to the style file. This system is stable, widely supported, and required by many journal templates that ship with their own .bst files.

Biblatex is a more modern package that gives you greater control over citation formatting directly in your document preamble. Instead of relying on a separate .bst file, biblatex uses a backend program called biber to process the bibliography data. Biber reads the .bib file and passes the information to biblatex, which formats citations according to options you set with \usepackage[options]{biblatex}. This approach supports more entry types, multilingual bibliographies, and sophisticated citation styles like author-year or footnote citations.

The choice between BibTeX and biblatex affects your compilation workflow. With BibTeX, you run bibtex after the first LaTeX pass. With biblatex, you run biber instead. Many online LaTeX editors and desktop IDEs now support both, but you must configure the correct backend in your project settings.

At a Glance: BibTeX versus biblatex

FeatureBibTeXbiblatex
Backend programbibtexbiber
Style definitionSeparate .bst filePackage options in preamble
Citation commands\cite{}, \citep{}, \citet{}\cite{}, \parencite{}, \textcite{}
Entry typesStandard set (article, book, inproceedings)Extended set including online, patent, and report
Language supportLimited to style file definitionsFull multilingual support with language fields
Journal template compatibilityRequired by many publisher templatesMay require template modification
Compilation sequencepdflatex, bibtex, pdflatex, pdflatexpdflatex, biber, pdflatex, pdflatex

Setting Up Your .bib Database File

The .bib file is the foundation of any LaTeX bibliography. It stores bibliographic information in a plain text format that both BibTeX and biblatex can read. Each entry begins with an entry type, followed by a citation key, and then fields containing the author, title, year, journal, and other relevant information.

A basic article entry looks like this:

@article{smith2024,
  author  = {Smith, John and Doe, Jane},
  title   = {A Study of Citation Practices},
  journal = {Journal of Academic Writing},
  year    = {2024},
  volume  = {12},
  number  = {3},
  pages   = {45-67}
}

The citation key, here smith2024, is the identifier you use in your document with \cite{smith2024}. Choose keys that are memorable and consistent. A common convention is the first author's surname followed by the publication year. If you have multiple works by the same author in the same year, add a letter suffix such as smith2024a and smith2024b. You do not have to type journal article entries by hand: the Citation Generator returns a ready-to-paste BibTeX entry with a citation key for any DOI.

For books, the entry type changes to @book and includes fields like publisher and address:

@book{knuth1984,
  author    = {Knuth, Donald E.},
  title     = {The TeXbook},
  publisher = {Addison-Wesley},
  year      = {1984}
}

Conference papers use @inproceedings, which requires the booktitle field:

@inproceedings{lee2023,
  author    = {Lee, Kim},
  title     = {Advances in Laboratory Data Management},
  booktitle = {Proceedings of the International Conference on Scientific Computing},
  year      = {2023},
  pages     = {112-120}
}

When you need to cite a webpage or online resource, use the @online entry type if you are working with biblatex, or @misc if you are using BibTeX. Include the URL and the date you accessed the page:

@online{nihpolicy,
  author       = {National Institutes of Health},
  title        = {Data Management and Sharing Policy},
  url          = {https://sharing.nih.gov/data-management-and-sharing-policy},
  urldate      = {2024-01-15}
}

Citing Sources in Your Document

Once your .bib file is ready, you reference it in your LaTeX document with the \bibliography{} command for BibTeX or \addbibresource{} for biblatex. Place this command in your preamble or at the end of your document depending on the system you use.

For BibTeX, add the following to your document:

\bibliographystyle{plain}
\bibliography{references}

The \bibliographystyle command selects the formatting style, and \bibliography{references} tells LaTeX to use the file references.bib. Place these commands where you want the bibliography to appear, typically at the end of the document before the \end{document} command.

For biblatex, load the package in your preamble:

\usepackage[style=apa, backend=biber]{biblatex}
\addbibresource{references.bib}

Then print the bibliography at the end of your document with:

\printbibliography

In your text, cite sources with \cite{key}. For example, writing The NIH data sharing policy applies to all funded research \cite{nihpolicy}. will generate an in-text citation and include the full reference in your bibliography.

Biblatex offers additional citation commands for different formatting needs. Use \parencite{key} for parenthetical citations, \textcite{key} for narrative citations where the author name appears in the sentence, and \footcite{key} for footnote citations. These commands give you finer control over how citations appear in your document.

Compiling Your Document with BibTeX

The compilation sequence for BibTeX requires multiple passes. The first LaTeX run generates an .aux file that records which citations appear in your document. BibTeX then reads this file, looks up the cited entries in your .bib file, and creates a .bbl file containing the formatted bibliography. The final LaTeX runs incorporate this bibliography into your document.

The complete sequence is:

  1. Run pdflatex on your main .tex file
  2. Run bibtex on your main file (without the .tex extension)
  3. Run pdflatex again
  4. Run pdflatex a second time to resolve all cross-references

In TeXstudio, you can automate this process by selecting Tools, then Build, and choosing the appropriate build command. Many distributions include a "BibTeX" option in the build menu. In Overleaf, the platform automatically runs the correct sequence when you click Recompile, provided your project settings are configured correctly.

If you are using biblatex, replace step 2 with running biber instead of bibtex. The rest of the sequence remains the same.

Compiling Your Document with biblatex and biber

Biblatex requires biber as its backend program. This distinction matters because biber reads the .bib file directly and can handle more complex data structures than BibTeX. Biber also supports UTF-8 encoding fully, which is important if your references contain accented characters or non-Latin scripts.

The compilation sequence for biblatex is:

  1. Run pdflatex on your main .tex file
  2. Run biber on your main file
  3. Run pdflatex again
  4. Run pdflatex a second time

In Overleaf, you must ensure that the compiler is set to biber. Go to Menu, then Compiler settings, and select Biber as the bibliography backend. If you leave the default setting, Overleaf may run BibTeX instead, which will produce an error because biblatex expects biber.

In TeXstudio, configure the build process by going to Options, then Configure TeXstudio, and selecting the appropriate bibliography tool in the Build section. You can also define a custom build command that runs biber automatically.

A common error when switching from BibTeX to biblatex is the message "Package biblatex Error: Please (re)run Biber on the file." This indicates that the document was compiled with BibTeX instead of biber. Check your editor settings and ensure the correct backend is selected.

Using Reference Management Software with LaTeX

Reference managers such as Zotero, Mendeley, and EndNote can export your library as a .bib file, which you can then use directly in your LaTeX document. This workflow saves time and reduces typing errors, especially when you have many references.

Zotero is a free and open-source reference manager that integrates well with LaTeX workflows. You can install the Better BibTeX plugin, which gives you more control over citation keys and exports. To export your library, select the references you need, right-click, and choose Export. Select BibTeX as the format and save the file with a .bib extension.

When you export from a reference manager, check the resulting .bib file for consistency. Some managers export fields that BibTeX does not recognize, which can cause warnings or errors. Review the file and remove any fields that are not standard entry types or fields.

The ORCID for Researchers page explains how maintaining a persistent researcher identifier can help you keep your publication record accurate. When you export references from databases, the metadata may include ORCID identifiers for authors. Including these identifiers in your .bib file can help with disambiguation, though standard BibTeX styles do not display them.

Organizing Your References for Long Documents

For theses, dissertations, and book-length projects, a single large .bib file can become unwieldy. Consider splitting your references into multiple .bib files organized by chapter or topic. Both BibTeX and biblatex support multiple bibliography files.

With BibTeX, list multiple files in the \bibliography{} command:

\bibliography{references, methods, results}

With biblatex, add multiple resources:

\addbibresource{references.bib}
\addbibresource{methods.bib}
\addbibresource{results.bib}

Biblatex also supports per-chapter bibliographies using the refsection feature. This is useful for theses where each chapter has its own reference list. Add \newrefsection at the start of each chapter, and biblatex will create separate bibliographies for each section.

For journal articles, keep your .bib file focused on the sources you actually cite. Unused entries do not appear in the bibliography, but they can slow down compilation and make the file harder to maintain. Periodically review your .bib file and remove entries you no longer need.

Common Failure Patterns and How to Fix Them

Several recurring problems occur when working with LaTeX bibliographies. Recognizing these patterns helps you diagnose issues quickly.

Undefined citation warnings: If LaTeX reports "Citation 'key' undefined," the citation key in your document does not match any entry in your .bib file. Check for typos in both the \cite{} command and the entry key. Also verify that the .bib file is in the same directory as your .tex file or that the path in \bibliography{} or \addbibresource{} is correct.

Empty bibliography: If your bibliography section is blank, the compilation sequence may be incomplete. Run the full sequence again, ensuring that bibtex or biber runs between the first and second LaTeX passes. In Overleaf, check that the project is set to use the correct backend.

Biber not found: This error occurs when biblatex is configured to use biber but the program is not installed or not in your system path. Most LaTeX distributions include biber, but you may need to install it separately or update your distribution.

Encoding errors: If your .bib file contains accented characters and you see garbled output, ensure the file is saved in UTF-8 encoding. Most modern editors default to UTF-8, but older files may be in a different encoding. Add \usepackage[utf8]{inputenc} to your preamble if you are using an older LaTeX distribution.

Duplicate keys: If two entries in your .bib file have the same citation key, LaTeX will use the first one and issue a warning. Search your file for duplicate keys and rename one of the entries.

Missing fields: Some bibliography styles require specific fields. For example, the IEEE style requires the journal name for article entries. If a required field is missing, the bibliography may have blank entries or the style may produce an error. Review the documentation for your chosen style to understand which fields are required.

Choosing a Citation Style

The citation style determines how references appear in your text and in the bibliography. Journal templates often specify a particular style, and you should follow the publisher's requirements.

For BibTeX, the style is set with \bibliographystyle{}. Common styles include:

  • plain: Sorted alphabetically, numbered
  • unsrt: Ordered by first citation, numbered
  • abbrv: Abbreviated first names and journal names
  • alpha: Author-year labels like [Smi24]
  • ieeetran: IEEE format for engineering and computer science

For biblatex, the style is set as a package option. You can use built-in styles like numeric, authoryear, apa, ieee, or chicago. You can also customize the style by modifying the formatting commands in your preamble.

The EQUATOR Network provides reporting guidelines for health research, and many journals require authors to follow these guidelines. When you prepare a manuscript for submission, check the journal's instructions for authors to see which citation style they require. Using the correct style from the start avoids reformatting later.

Integrating Bibliographies with Research Integrity Practices

Proper citation is a core component of research integrity. The Committee on Publication Ethics Core Practices outline expectations for authorship, data handling, and peer review. Accurate citations ensure that you give proper credit to prior work and allow readers to verify your sources.

When you compile your bibliography, verify that every citation in your text appears in the bibliography and that every bibliography entry is cited in the text. LaTeX does this automatically, but you should still review the final output for accuracy. Check that author names are spelled correctly, years match the actual publication dates, and page numbers are correct.

For research funded by agencies like the National Institutes of Health, accurate citation of prior work is part of responsible conduct of research. The NIH expects grantees to maintain accurate records of their publications and to cite relevant literature appropriately.

The National Library of Medicine provides access to biomedical books and research methodology resources that can help you understand citation standards in the health sciences. If you are writing for a biomedical journal, consult the journal's instructions for the specific citation format they require.

Managing Your Researcher Profile and Publications

Maintaining an accurate record of your publications is important for your professional development and for funding applications. The ORCID for Researchers page explains how an ORCID identifier provides a persistent link between you and your research outputs.

When you create your .bib file, consider including your ORCID identifier in the entry for your own publications. Some bibliography styles can display ORCID identifiers, and including them helps with author disambiguation. This is particularly useful if you have a common name or if your name appears in different forms across publications.

For grant applications, the NIH Grants and Funding pages describe how applicants list their publications and how reviewers evaluate the significance of prior work. Accurate and complete bibliographies in your application materials demonstrate careful scholarship.

Data Management and Citation of Datasets

Research data sharing policies increasingly require authors to cite datasets in addition to traditional publications. The NIH Data Management and Sharing Policy describes expectations for sharing and managing research data.

When you cite a dataset in your LaTeX document, use the appropriate entry type. Biblatex supports @dataset as an entry type, while BibTeX users can use @misc with a note indicating the dataset nature. Include the repository name, the dataset identifier, and the access date.

A dataset entry in biblatex looks like:

@dataset{climate2024,
  author       = {Climate Research Group},
  title        = {Global Temperature Records 1950-2023},
  year         = {2024},
  publisher    = {National Climate Data Repository},
  doi          = {10.1234/climate.2024.001},
  urldate      = {2024-06-01}
}

Including DOIs in your references helps readers locate the exact version of a dataset or publication they need. Many bibliography styles display DOIs automatically when the field is present.

Practical Workflow for Overleaf Users

Overleaf is a popular online LaTeX editor that handles bibliography compilation automatically. To set up your project correctly:

  1. Create a new project or upload your existing .tex and .bib files
  2. In the Menu, check the Compiler setting and select the appropriate LaTeX engine
  3. In the Menu, check the Bibliography setting and select BibTeX or Biber depending on your document
  4. Add your .bib file to the project
  5. Include the \bibliography{} or \addbibresource{} command in your document
  6. Click Recompile and review the output

Overleaf shows compilation logs that help you diagnose errors. If the bibliography does not appear, check the log for messages about undefined citations or missing bibliography files.

For collaborative projects, Overleaf allows multiple users to edit the same document. This is useful when co-authors need to add references. Establish a convention for citation keys to avoid conflicts, such as using the first author's surname and year.

Practical Workflow for TeXstudio Users

TeXstudio is a desktop LaTeX editor that gives you more control over the compilation process. To configure bibliography support:

  1. Open your project in TeXstudio
  2. Go to Options, then Configure TeXstudio
  3. Select Build from the left menu
  4. Choose the appropriate build command that includes bibtex or biber
  5. Set the default bibliography tool in the Commands section

TeXstudio provides a one-click build option that runs the full compilation sequence. You can also run individual steps from the Tools menu if you need to debug a specific stage.

When you add new citations to your document, you must rerun the full compilation sequence for them to appear in the bibliography. TeXstudio's build command handles this automatically, but if you run individual commands manually, remember to run bibtex or biber after the first LaTeX pass.

Records and Measurements for Bibliography Management

Keeping records of your bibliography workflow helps you maintain consistency across projects. Document the following information for each project:

  • The bibliography system used (BibTeX or biblatex)
  • The backend program (bibtex or biber)
  • The citation style
  • The location of the .bib file
  • Any custom style modifications

This information is especially important when you return to a project after a long absence or when you share a project with collaborators. Include a comment at the top of your .tex file noting the compilation sequence and any special settings.

For large projects, track the number of references and the date of the last bibliography update. This helps you verify that all citations are included before submission.

Limitations and When to Seek Professional Help

LaTeX bibliography systems have limitations that you should understand. BibTeX cannot handle some complex entry types, and its style files are difficult to customize. Biblatex is more flexible but requires biber, which some older systems do not support.

If you encounter persistent errors that you cannot resolve, consider these escalation steps:

  1. Review the LaTeX log file for specific error messages
  2. Search the documentation for your bibliography style
  3. Consult the National Library of Medicine resources for citation standards in biomedical writing
  4. Ask a colleague or supervisor who has experience with LaTeX
  5. Contact your institution's library or writing center for assistance

For publication ethics questions, such as disputes about authorship or citation practices, consult the Committee on Publication Ethics Core Practices for guidance on expected standards.

Frequently Asked Questions

What is the difference between BibTeX and biblatex?

BibTeX is the traditional bibliography tool that uses separate .bst style files and the bibtex program. Biblatex is a modern package that gives you more control over citation formatting and uses biber as its backend. Biblatex supports more entry types and languages, but BibTeX is required by many journal templates.

How do I create a .bib file?

Create a plain text file with a .bib extension. Each entry starts with an entry type like @article or @book, followed by a citation key and fields for author, title, year, and other information. You can write the file manually or export it from reference management software like Zotero.

Why is my bibliography not showing up in LaTeX?

The most common cause is an incomplete compilation sequence. You must run pdflatex, then bibtex or biber, then pdflatex twice more. Check that your .bib file is in the correct directory and that your citation keys match the entries in the file.

How do I switch from BibTeX to biblatex?

Replace \bibliographystyle{} and \bibliography{} with \usepackage[backend=biber]{biblatex} and \addbibresource{} in your preamble. Use \printbibliography at the end of your document. Change your compilation sequence to run biber instead of bibtex.

Can I use Zotero with LaTeX?

Yes, Zotero can export your references as a .bib file. Install the Better BibTeX plugin for more control over citation keys and export options. Export the references you need and add the resulting file to your LaTeX project.

What citation style should I use for my journal submission?

Check the journal's instructions for authors to see which citation style they require. Many journals provide a LaTeX template that includes the correct bibliography style. The EQUATOR Network provides reporting guidelines that may specify citation requirements for health research.

How do I cite a dataset in LaTeX?

Use the @dataset entry type if you are using biblatex, or @misc with a note if you are using BibTeX. Include the repository name, dataset identifier, DOI, and access date. The NIH Data Management and Sharing Policy describes expectations for data citation.

###

Using the Evidence

SourceBest use in this topicImportant limitation
Research Methods Resourcesofficial guidanceCheck the linked page for current local requirements
EQUATOR Networkofficial guidanceCheck the linked page for current local requirements
Core Practicesofficial guidanceCheck the linked page for current local requirements

Related Articles

References and Further Reading

This article is educational and does not replace institutional policy, professional advice, or applicable safety and regulatory requirements.