BibTeX Architecture: Decoupling Bibliographic Data from Presentation in LaTeX
BibTeX separates bibliographic data (.bib) from formatting logic (.bst) through a four-pass compilation pipeline. This architecture note covers data boundaries, operational verification, failure modes, and when to migrate to biblatex/biber.
05 Jul 2026, 15:21 UTC

Requirements: Stable References Across Changing Formats
Technical documents require citations that remain correct while the surrounding text evolves. The core requirement is separation: authors manage a single source of bibliographic truth, while publishers, journals, or thesis templates impose distinct formatting rules. BibTeX satisfies this by treating the bibliography as a data pipeline rather than inline text.
Smallest Suitable Design: Three Files, Two Engines
The minimal working set consists of:
- A
.bibdatabase containing structured entries (key-value pairs) - A
.bststyle file implementing formatting logic - A
.texsource referencing citations by key
Two engines execute the pipeline: latex (or pdflatex, xelatex, lualatex) and bibtex. The .bib file never contains presentation markup—no italics, no punctuation, no author-order conventions. Those decisions live entirely in the .bst file.
Data Boundaries: Where Structure Ends and Policy Begins
A .bib entry declares typed fields:
@article{knuth1984texbook,
author = {Donald E. Knuth},
title = {The TeXbook},
journal = {Computers & Typesetting},
year = {1984},
volume = {A},
publisher = {Addison-Wesley}
}
The .bst file decides whether author appears as "Knuth, D. E." or "Donald E. Knuth", whether the title is italicized or quoted, and how multiple authors are joined. This boundary is strict: the .bib file is portable across IEEE, APA, ACM, and custom house styles without modification.
Trust flows one way: the .tex file trusts the .bbl output generated by bibtex. The .bbl file is a generated artifact—essentially a thebibliography environment with formatted entries. It should not be edited by hand; changes are lost on the next bibtex run.
Operational Checks: The Four-Pass Verification
Correct compilation requires a specific sequence. Run each command from the project root directory where main.tex resides. No elevated permissions are needed.
pdflatex main.tex— generatesmain.auxwith citation keysbibtex main— readsmain.aux, resolves keys against.bibfiles, writesmain.bblpdflatex main.tex— incorporatesmain.bbl, updates cross-referencespdflatex main.tex— stabilizes page numbers and reference links
Verification: open the resulting PDF and confirm no [?] markers appear where citations should be. Check the .bbl file directly—it should contain formatted \bibitem entries matching the chosen style.
To test style independence, change only the \bibliographystyle{plain} line to \bibliographystyle{alpha} or \bibliographystyle{ieeetr}, then re-run the four-pass sequence. The bibliography reformats automatically; the .bib file is untouched.
Failure Modes: The Citation Loop
Most failures manifest as unresolved citations ([?]) or duplicate label warnings. Common causes:
- Missing
.auxfile — firstpdflatexpass skipped or failed - Key mismatch —
\cite{knuth1984}in.texbut@article{knuth1984texbook}in.bib - Malformed
.bibentry — missing comma, unbalanced braces, or undefined entry type - Style file not found —
\bibliographystyle{custom}withoutcustom.bstin search path
Diagnostic: examine main.blg (BibTeX log) for parse errors. The log reports line numbers in the .bib file and undefined citation keys.
Non-ASCII characters (accents, non-Latin scripts) cause silent corruption or errors in traditional BibTeX. The workaround is switching engines: use xelatex or lualatex with bibtex, or migrate to biber + biblatex which natively supports UTF-8.
Conditions That Would Change the Design
BibTeX's architecture shows its age in three scenarios:
1. Complex Sorting or Multi-Script Bibliographies
The .bst language is a stack-based, postfix notation (similar to Forth) that few authors can modify. Implementing locale-aware sorting (e.g., Chinese stroke order, Arabic alphabetical) requires writing or finding a specialized .bst file. biblatex with biber handles this via Unicode Collation Algorithm configuration in the .tex preamble.
2. Rich Metadata Beyond Standard Fields
BibTeX's fixed field set (author, title, year, journal, etc.) cannot cleanly represent DOIs, ORCIDs, dataset identifiers, or custom taxonomy tags without abusing note or adding non-standard fields that styles ignore. biblatex defines extensible data models.
3. Single-Pass Build Requirements
Continuous integration pipelines that forbid multiple passes (or tools that only invoke latex once) cannot use BibTeX. biblatex with biber still requires multiple passes but integrates better with modern build tools like latexmk that automate the sequence.
Practical Verification Checklist
- Create
test.bibwith two entries of different types (@article,@book) - Create
test.texwith\citefor both,\bibliographystyle{plain},\bibliography{test} - Run the four-pass sequence
- Confirm PDF shows formatted references, no
[?] - Change
plaintoalpha, re-run passes 2–4 - Confirm citation labels change from numeric to alphabetic (e.g.,
[Knu84])
If all steps succeed, the decoupled architecture is functioning as designed. The .bib file remains the single source of truth; the style file remains the single point of presentation control.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.