LaTeX & Bibliography Guide

How to Fix Undefined Citations and BibTeX Errors in Overleaf LaTeX

A systematic 6-step diagnostic workflow to eliminate 'Citation undefined' warnings, resolve inline [?] question marks, reconcile BibTeX vs. Biber engine conflicts, and fix syntax errors in Overleaf projects.

Direct answer

In Overleaf and LaTeX, 'Citation undefined' and inline [?] question marks occur because document compilation is a multi-pass process. If the auxiliary .bbl file fails to compile due to syntax breaks, cache corruption, or engine mismatches between BibTeX and Biber, LaTeX cannot link your in-text citations to your references.

To restore proper compilation: (1) Clear cached auxiliary files using the trash icon next to 'Recompile', (2) Verify engine alignment between your preamble package (natbib vs biblatex) and Overleaf Menu settings, (3) Ensure \bibliography{...} omits the '.bib' extension in legacy BibTeX, and (4) Escape reserved characters (&, %, _) in your .bib database entries.

Quick checklist

6 essential checks for flawless LaTeX bibliographies

  • 01

    Clear cached auxiliary files using the trash icon next to 'Recompile' in Overleaf

  • 02

    Verify compiler compatibility: backend=biber requires Biber; natbib requires standard BibTeX

  • 03

    Ensure \bibliography{file} omits the '.bib' extension in legacy BibTeX setups

  • 04

    Check that citation keys in \cite{key} match @article{key, with exact case sensitivity

  • 05

    Escape reserved LaTeX characters (&, %, _) with backslashes in .bib fields

  • 06

    Protect proper nouns and abbreviations in titles using {Braced} capitalization

STEP01

Clear compiler cache and resolve inline [?] question marks

LaTeX and Overleaf compilers do not generate bibliographies in a single pass. Standard document compilation requires a multi-pass cycle: during the initial run (pdflatex), in-text \cite{key} commands are parsed and written to the auxiliary .aux file; in the second step, the BibTeX or Biber processor reads this file to generate the formatted .bbl bibliography; on subsequent passes, LaTeX reads the .bbl file to replace temporary markers with correct citation callouts.

In Overleaf, persistent [?] question marks almost always indicate auxiliary file corruption or invalid filename syntax. In traditional BibTeX setups, the \bibliography{references} command must NEVER include the '.bib' file extension; adding the extension causes the compiler to fail silently to locate the database.

Step 01 verification points

  • Clicked the trash can icon next to 'Recompile' in Overleaf and selected 'Clear cached files'
  • Confirmed that \bibliography{references} omits the '.bib' file extension in standard BibTeX
  • Verified exact case-sensitive matching between \cite{key} in the text and @article{key, in the .bib database

When switching citation keys or modifying packages, Overleaf cache can lock onto stale .aux states. Always perform a clean recompile from scratch before troubleshooting deeper syntax.

STEP02

Reconcile engine conflicts: Classic BibTeX vs. Modern Biber (backend=biber)

Modern LaTeX bibliography management is divided into two distinct ecosystems: legacy natbib workflows that rely on the classic 8-bit BibTeX engine, and modern biblatex frameworks that require the Unicode/UTF-8 native Biber backend. If your preamble specifies \usepackage[backend=biber]{biblatex} while Overleaf project settings remain configured for standard BibTeX, the bibliography will render completely empty.

Inspect your preamble declarations: If using natbib, pair \bibliographystyle{...} with \bibliography{references} (extension-free). If using biblatex, use \addbibresource{references.bib} (extension mandatory) and \printbibliography in the document body.

Step 02 verification points

  • Checked Overleaf Menu -> Settings -> LaTeX Engine and Default Compiler for Biber vs. BibTeX compatibility
  • Verified command syntax: \bibliography{file} (no extension for natbib) vs \addbibresource{file.bib} (extension required for biblatex)
  • Ensured natbib and biblatex packages are never loaded simultaneously in the same document preamble
STEP03

Debug BibTeX syntax errors: missing commas, unmatched braces, and field keys

The BibTeX parser enforces rigid grammatical constraints. Missing a comma immediately following the citation key, or omitting a closing curly brace '}' for a field value, triggers the fatal error 'I was expecting a comma or a right brace', causing the compiler to discard all subsequent entries.

When Overleaf logs highlight a compilation error on a specific line, look immediately above that point or inspect the final field of the preceding entry. Syntax breaks frequently originate from an unclosed brace in the prior bibliographic record.

Step 03 verification points

  • Confirmed every @article, @book, or @inproceedings record includes a trailing comma right after the citation key
  • Counted opening and closing curly braces ({}) and quotation marks (") to guarantee balanced pairs
  • Ensured standard commas separate individual fields (author, title, journal, year)

To automatically identify unbalanced braces, unescaped characters, and missing fields in your bibliography, use our free Online BibTeX Validator tool (academicfix.com/en/tools/bibtex-validator).

STEP04

Escape LaTeX reserved special characters (&, %, _, #) and sanitize DOIs

BibTeX records copied directly from Google Scholar or publisher landing pages frequently contain unescaped characters such as '&', '%', '_', or '#'. In LaTeX, these are reserved system commands. An unescaped '&' in a journal name (e.g., IEEE Transactions on Antennas & Propagation) is parsed as a table column separator, resulting in 'Misplaced alignment tab character &'.

Prefix all reserved literal characters with a backslash: '\&', '\%', and '\_'. For digital object identifiers (DOIs) and URLs containing underscores or hash symbols, load \usepackage{url} or \usepackage{hyperref} in your preamble to sanitize verbatim strings automatically.

Step 04 verification points

  • Replaced unescaped ampersands ('&') in journal titles with '\&'
  • Escaped underscores ('_') in identifiers or ensured the hyperref/url package is loaded
  • Removed percentage signs ('%') from abstract fields to prevent accidental line commenting

Loading \usepackage{hyperref} or \usepackage{url} in your preamble protects digital identifiers and prevents underscores in DOI strings from breaking math-mode compilation.

STEP05

Preserve title capitalization for acronyms and proper nouns using curly braces

Many academic citation styles (including plain, unsrt, and IEEEtran) automatically convert article titles to sentence case in the final reference list. Consequently, critical acronyms and proper nouns—such as 'COVID-19', 'DNA', 'fMRI', 'United States', or 'Markov Chain'—are inadvertently downcased to 'covid-19', 'dna', and 'markov chain'.

To instruct BibTeX to preserve capitalization, enclose specific terms within curly braces: 'title = {{COVID-19} Outbreak in the {United States}}'. Avoid enclosing the entire title string in double braces, as this overrides journal-mandated sentence casing across normal words.

Step 05 verification points

  • Enclosed scientific acronyms ({DNA}, {CRISPR}, {fMRI}, {AI}) in protective curly braces
  • Wrapped geographic names, countries, and proper nouns ({Europe}, {Gaussian}, {Markov}) in braces
  • Targeted only specific capitalized tokens rather than double-bracing entire title strings
STEP06

Format institutional/corporate authors with double braces and separate co-authors with 'and'

BibTeX parses author fields assuming a 'Lastname, Firstname' convention. If an institutional author is declared as 'author = {World Health Organization}', BibTeX interprets 'Organization' as the surname and 'World Health' as given names, producing the garbled citation 'Organization, W. H.'.

Enclose corporate and institutional authors in double curly braces: 'author = {{World Health Organization}}'. Furthermore, multiple authors must always be delimited strictly by the English keyword 'and', never with commas or ampersands: 'author = {Smith, John and Doe, Jane and Miller, Alan}'.

Step 06 verification points

  • Wrapped government bodies, international organizations, and corporate authors in double braces: {{World Health Organization}}
  • Separated all co-authors strictly with 'and' rather than commas or '&' symbols
  • Audited multi-word surnames (van der Waals, de Saussure) to ensure proper indexing

Frequently asked questions

Authoritative answers on Overleaf and BibTeX

Why does my LaTeX citation show a question mark [?] instead of a number or author name?

A question mark [?] indicates that LaTeX cannot find the compiled citation key in the auxiliary (.aux or .bbl) files. This is typically caused by omitting the intermediate BibTeX compilation step, auxiliary cache corruption in Overleaf, a typographical discrepancy between \cite{key} and the .bib key, or adding a '.bib' extension inside \bibliography{...}.

What is the fundamental difference between BibTeX and Biber in Overleaf?

BibTeX is a legacy 8-bit program designed for traditional packages like natbib, supporting limited character sets and requiring external style files (.bst). Biber is a modern Unicode-native engine developed specifically for biblatex, offering full UTF-8 encoding support, advanced localization, and dynamic sorting.

How do I fix 'I was expecting a comma or a right brace' in BibTeX?

This fatal syntax error indicates an unclosed curly brace, an unclosed quotation mark, or a missing comma following the citation key. Check the bibliographic entry immediately preceding the error line, as unclosed fields in prior entries prevent the parser from recognizing subsequent records.

Why does my corporate or institutional author appear as 'Organization, W. H.'?

BibTeX treats unbraced strings as personal names, parsing the last word as a surname. Enclose the institutional name in double curly braces: author = {{World Health Organization}}. This forces BibTeX to treat the entire phrase as a single non-splittable entity.

How do I prevent BibTeX from converting acronyms in titles to lowercase?

Enclose the specific acronym or proper noun in curly braces within the title field: title = {Analysis of {fMRI} and {EEG} Patterns in {Parkinson} Patients}. BibTeX preserves the exact casing of any character sequence wrapped in internal braces.

Primary sources

Official standards and technical manuals

All technical recommendations in this guide are derived from official documentation published by Overleaf, CTAN, and the TeX Users Group (TUG).

  1. 01
    Overleaf Documentation — Bibliography Management with BibTeX

    Official reference manual on multi-pass compilation, .bib file configuration, natbib usage, and Overleaf cache clearing.

  2. 02
    CTAN — BibLaTeX Package Documentation & Biber Manual

    Comprehensive technical specifications for modern Unicode bibliography processing, backend engine configuration, and advanced sorting.

  3. 03
    TeX Users Group (TUG) — TeX and LaTeX Frequently Asked Questions

    Authoritative guide resolving syntax errors, character escaping rules, and case-preservation conventions in BibTeX databases.

  4. 04
    Overleaf Knowledge Base — Troubleshooting Undefined Citation Warnings

    Step-by-step diagnostic workflow for eliminating inline question marks, resolving multi-file bibliography paths, and debugging engine mismatches.