B
BibTeXGenerator Free Academic Tools
LaTeX Tutorials • 9 min read • Updated: 2026-11-05

How to Use BibTeX in LaTeX and Overleaf: The Complete 2026 Guide

Master citing references in LaTeX and Overleaf with BibTeX. Step-by-step guide covering \cite{}, \bibliography{}, .bib file management, and troubleshooting.

Advertisement
Academic Sponsor / Ad Space (horizontal)

Introduction: Why BibTeX is the Standard for Scientific Writing

When writing academic papers, conference submissions, or doctoral dissertations in LaTeX or Overleaf, managing references manually with inline text or basic footnotes quickly becomes unmanageable. Bibliographies must adapt to different journal citation styles (such as APA, IEEE, or Chicago), author names must be consistently sorted, and citations must automatically re-number when text is reorganized.

BibTeX solves this by separating the citation data from the document presentation. Your citations live in an external plaintext file (typically named references.bib), while your .tex file cites sources using unique alphanumeric keys via the \cite{...} command.

In this comprehensive guide, you will learn:

  • The basic structure of a .bib file.
  • How to link your .bib file to your .tex document.
  • How to cite references in Overleaf and local LaTeX editors.
  • How to select and customize bibliography styles.
  • The 4-step compilation process behind LaTeX and BibTeX.
  • How to troubleshoot common errors like unresolved citations ([?]).
  • ---

    1. Anatomy of a .bib File

    A BibTeX database is a plain text file ending in the extension .bib. Each reference in this file begins with an entry type (prefixed by an @ symbol), followed by an opening curly brace {, a unique citation key, and comma-separated field-value pairs.

    Here is an example of an article entry citing the foundational Transformer architecture paper:

    @article{Vaswani2017,
      author    = {Vaswani, Ashish and Shazeer, Noam and Parmar, Niki and Uszkoreit, Jakob and Jones, Llion and Gomez, Aidan N and Kaiser, Lukasz and Polosukhin, Illia},
      title     = {Attention Is All You Need},
      journal   = {Advances in Neural Information Processing Systems},
      volume    = {30},
      pages     = {5998--6008},
      year      = {2017},
      doi       = {10.5555/3295222.3295349}
    }
    

    Critical Rules for .bib Syntax:

  • Unique Citation Key: The key (Vaswani2017 above) is the identifier you pass to \cite{Vaswani2017}. Every entry in your .bib file must have a unique key.
  • Multiple Authors: Always separate individual author names with the word and, never commas or semicolons. Example: author = {Knuth, Donald E. and Rivest, Ronald L.}.
  • Double En-Dash for Pages: Page ranges in traditional BibTeX should use two hyphens -- (e.g., pages = {101--115}), which compiles to a typographical en-dash in the generated PDF.
  • Case Preservation: BibTeX styles automatically convert paper titles to lowercase. To protect acronyms, proper nouns, or chemical elements, wrap them in curly braces: title = {Deep Learning for {DNA} Sequencing on {NVIDIA} {GPUs}}.
  • ---

    2. Linking BibTeX to Your .tex Document

    To connect your .bib file to your LaTeX manuscript, add two commands where you want the bibliography to appear (usually right before \end{document}):

    \documentclass[11pt,a4paper]{article}
    \usepackage[utf8]{inputenc}
    \usepackage{hyperref}

    \begin{document}

    \title{My Research Paper} \author{Jane Doe} \maketitle

    \section{Introduction} Transformers have revolutionized artificial intelligence and natural language processing \cite{Vaswani2017}.

    \bibliographystyle{plain} % Specifies the bibliography formatting style \bibliography{references} % Links references.bib (omit the .bib extension)

    \end{document}

    ---

    3. Standard Bibliography Styles

    The \bibliographystyle{...} command determines how citations look in the text and how references are formatted at the end:

    Style NameIn-Text AppearanceReference List OrderTypical Use Case

    plainNumbered ([1])Alphabetical by author surnameMathematics, general science ieeetrNumbered ([1])In order of appearance in textElectrical engineering, CS alphaAlphanumeric ([Vas17])Alphabetical by author keyComputer science, logic abbrvNumbered ([1])Alphabetical, abbreviated first names & journalsSpace-constrained papers natbibAuthor-Date (Vaswani et al. (2017))Alphabetical by author surnameSocial sciences, physics, biology

    ---

    4. Using BibTeX in Overleaf

    Overleaf makes BibTeX integration effortless because its cloud servers automatically run all intermediate compilation steps:

  • Upload your .bib file: In your Overleaf project pane on the left, click the New File icon and select Upload, or create a new file named references.bib.
  • Paste your entries: Copy entries generated on BibTeXGenerator.com directly into references.bib.
  • Cite in your document: In main.tex, type \cite{. Overleaf will show an auto-complete dropdown of all available citation keys in your project.
  • Click Recompile: Overleaf will automatically detect changes in your bibliography and compile the final PDF.
  • ---

    5. The 4-Step Local Compilation Workflow

    If you compile your LaTeX documents locally using command-line tools, VS Code (LaTeX Workshop), or TeXstudio, you must run the compiler four times in sequence to resolve all references:

  • pdflatex main.tex: Scans the document, notes where citations occur, and writes an auxiliary file (main.aux).
  • bibtex main.aux: Reads main.aux and references.bib, formats the cited references, and generates main.bbl.
  • pdflatex main.tex: Reads main.bbl and inserts the formatted bibliography into the PDF.
  • pdflatex main.tex: Re-checks cross-references and updates in-text citation numbers.
  • ---

    6. Common BibTeX Errors and How to Fix Them

    Error 1: Question marks [?] instead of citation numbers

  • Cause: The BibTeX compiler has not been run after adding a new citation, or the citation key in \cite{...} does not match the key in references.bib.
  • Fix: Re-run pdflatex, then bibtex, then pdflatex twice. Double-check for spelling and case sensitivity in the citation key.
  • Error 2: "I couldn't open file name 'references.bib'"

  • Cause: The \bibliography{references} command includes the .bib extension (e.g. \bibliography{references.bib}), or the file is in a different folder.
  • Fix: Write \bibliography{references} without the extension, or specify the relative path: \bibliography{chapters/references}.
  • Error 3: Acronyms losing capitalization in rendered PDF

  • Cause: BibTeX's default style converts titles to lowercase.
  • Fix: Enclose the uppercase term in curly braces inside your .bib file: title = {Accelerating {LLM} Inference on {FPGA} Systems}. Use our free BibTeX Case Preserver to automate this across your entire bibliography.
  • Advertisement
    Academic Sponsor / Ad Space (horizontal)

    Need to generate BibTeX citations right now?

    Use our free client-side converters for DOIs, ISBNs, arXiv, and PubMed.

    Explore 102 Tools →