The Complete BibTeX Guide: From DOI to Clean Bibliographies
Master BibTeX syntax, entry types, citation keys, and DOI-to-bibtex conversion in LaTeX. Format clean bibliographies with zero compile errors.
In academic and scientific research, bibliography management is non-negotiable. Whether submitting to IEEE, ACM, Nature, or preparing a doctoral dissertation, every citation must be formatted with typographic consistency.
Yet for many researchers, BibTeX remains a frequent source of frustration: bold question marks [?] appear instead of citation numbers, title capitalization mysteriously vanishes, corporate author names get mangled, and missing fields trigger obscure compiler warnings.
In this comprehensive guide, we unpack the inner mechanics of BibTeX. You will learn the multi-pass compilation lifecycle, the core entry schemas, the four classic traps that break bibliographies, and how modern tooling turns a raw Digital Object Identifier (DOI) into clean, error-free LaTeX citations.
1. The Three-File Compilation Workflow
Unlike modern word processors that update references in real time, classical LaTeX decouples document content from citation databases. A typical bibliography involves three core files:
main.tex: Your primary document containing prose and citation keys (\cite{vaswani2017attention}).references.bib: The plain-text database storing structured bibliographic metadata entries.- Auxiliary Files (
.aux,.bbl,.blg): Intermediate files generated during compilation passes to link citation keys with formatted reference entries.
The 4-Step Compilation Pipeline
If you have ever compiled a LaTeX document and seen bold question marks [?] in your text, you encountered the multi-pass limitation.
To resolve cross-references, you must execute a four-step compilation cycle:
# 1. First pass: scans .tex, writes citation keys to main.aux
pdflatex main.tex
# 2. BibTeX pass: reads main.aux and references.bib, outputs formatted main.bbl
bibtex main.aux
# 3. Second pass: embeds main.bbl entries into document layout
pdflatex main.tex
# 4. Third pass: resolves all citation numbers and cross-reference hyperlinks
pdflatex main.tex
[ main.tex ] ----> (pdflatex) ----> [ main.aux ]
|
[ references.bib ] ----------------> (bibtex) ----> [ main.bbl ] & [ main.blg ]
|
[ main.tex ] <------------------------------------------+
|
+-----> (pdflatex 2x) ----> [ main.pdf ] (Complete references!)
main.aux: The catalog of citation keys requested by\cite{...}.main.bbl: The compiled, formatted bibliography environment generated by BibTeX.main.blg: The BibTeX log file. Always inspect this file when references fail to render—it lists missing fields, unescaped characters, and unmatched braces.
2. Anatomy of a BibTeX Entry
Every BibTeX entry shares a standard syntax:
@entrytype{citation_key,
field_name = {field_value},
another_field = {field_value}
}
@entrytype: Defines the source medium (@article,@inproceedings,@book,@misc).citation_key: The unique identifier passed to\cite{key}in your.texsource.field = {value}: Key-value pairs containing metadata. Field values should be enclosed in curly braces{...}or double quotes"...".
Best Practices for Designing Citation Keys
Never use arbitrary numbers or long copy-pasted strings like cite:1 or Vaswani_Ashish_Noam_Shazeer_2017_Attention_Is_All_You_Need. Instead, adopt a deterministic naming convention across your research group:
| Scheme | Format | Example |
|---|---|---|
| AuthorYear | [FirstAuthorSurname][Year] |
vaswani2017 |
| AuthorYearTitle | [Surname][Year][FirstMeaningfulWord] |
vaswani2017attention |
| AlphaShorthand | [FirstThreeLetters][Year] |
Vas17 |
Pro Tip: Keep citation keys strictly lowercase, alphanumeric, and hyphen/underscore safe. Avoid spaces, accents, and non-ASCII characters in citation keys.
3. The 4 Workhorse Entry Types & Required Fields
While BibTeX defines over 14 distinct entry types, over 95% of academic citations fall into four categories:
1. @article (Peer-Reviewed Journal Papers)
Used strictly for papers published in periodic scholarly journals:
@article{shannon1948mathematical,
author = {Shannon, Claude E.},
title = {A Mathematical Theory of Communication},
journal = {Bell System Technical Journal},
year = {1948},
volume = {27},
number = {3},
pages = {379--423},
doi = {10.1002/j.1538-7305.1948.tb01338.x}
}
Required fields: author, title, journal, year.
Highly recommended: volume, number, pages, doi.
2. @inproceedings (Conference Papers)
Used for conference proceedings, symposiums, and workshop papers:
@inproceedings{vaswani2017attention,
author = {Vaswani, Ashish and Shazeer, Noam and Parmar, Niki and Uszkoreit, Jakob and Jones, Llion and Gomez, Aidan N. and Kaiser, {\L}ukasz and Polosukhin, Illia},
title = {Attention Is All You Need},
booktitle = {Advances in Neural Information Processing Systems (NeurIPS)},
year = {2017},
volume = {30},
pages = {5998--6008},
publisher = {Curran Associates, Inc.}
}
Required fields: author, title, booktitle, year.
Highly recommended: pages, publisher, doi.
3. @book (Monographs & Textbooks)
Used for complete published textbooks, monographs, or reference volumes:
@book{knuth1984texbook,
author = {Knuth, Donald E.},
title = {The {\TeX}book},
publisher = {Addison-Wesley Professional},
year = {1984},
edition = {1st},
isbn = {978-0201134483}
}
Required fields: author (or editor), title, publisher, year.
Highly recommended: edition, isbn, address.
4. @misc / @online (Preprints, Software, URLs)
Used for arXiv preprints, GitHub repositories, technical specifications, and online documentation:
@misc{brown2020gpt3,
author = {Brown, Tom B. and Mann, Benjamin and Ryder, Nick and Subbiah, Melanie},
title = {Language Models are Few-Shot Learners},
year = {2020},
eprint = {2005.14165},
archivePrefix= {arXiv},
primaryClass = {cs.CL},
howpublished = {arXiv preprint arXiv:2005.14165}
}
Required fields: author or title, howpublished or url, year.
4. The 4 Classic BibTeX Traps (and How to Fix Them)
Trap 1: The Title Capitalization Trap
The Symptom: In your .bib file, you write:
title = {Deep Learning with Markov Decision Processes and BERT}
Yet in the compiled PDF bibliography, it renders as:
Deep learning with markov decision processes and bert
Why it happens: Standard bibliography styles (plain, abbrv, unsrt) enforce sentence-case capitalization to guarantee uniform presentation. BibTeX automatically lowercases every letter except the first character of the title.
The Fix: Wrap proper nouns, acronyms, and specialized terminology in protective curly braces {...}:
title = {Deep Learning with {Markov} Decision Processes and {BERT}}
BibTeX will preserve the exact casing of any character enclosed within internal braces.
Trap 2: The Multiple Authors Rule
The Symptom: Authors appear formatted as Smith, J., Bob Doe and Alice Ray.
Why it happens: BibTeX parses commas as name inversion operators (Surname, Firstname). It does NOT use commas to separate multiple co-authors.
The Rule: Co-authors must ALWAYS be separated by the literal keyword and:
% INCORRECT (breaks author parsing):
author = {Alex Chen, Elena Rostova, Julian Thorne}
% CORRECT:
author = {Chen, Alex and Rostova, Elena and Thorne, Julian}
Corporate & Institutional Authors
When an organization is the author, BibTeX assumes the last word is a person’s surname and preceding words are first names:
- Input:
author = {World Health Organization} - Output:
Organization, W. H.
The Fix: Double-brace institutional names:
author = {{World Health Organization}}
The outer braces denote the field boundary; the inner braces inform BibTeX that the entire string represents a single unbreakable entity.
Trap 3: The Page Range En-Dash
In professional academic typesetting, a single hyphen (-) denotes hyphenated compound words (e.g., state-of-the-art). A page span is a number range and must be typeset with an en-dash (--):
% TYPOGRAPHIC DEFECT:
pages = {145-152}
% CORRECT (renders as 145–152):
pages = {145--152}
Trap 4: Unescaped Special Characters
BibTeX fields are parsed directly by TeX. Unescaped TeX reserved characters in paper titles or abstracts will trigger fatal compilation errors:
% FATAL ERRORS:
title = {A 50% Speedup in Graph Search & Analysis}
% CORRECT:
title = {A 50\% Speedup in Graph Search \& Analysis}
Always escape:
%$\to$\%(otherwise BibTeX comments out the remainder of the entry!)&$\to$\&_$\to$\_#$\to$\#
5. Integrating Bibliographies into LaTeX Documents
To display your references, add two commands at the end of your .tex document:
\documentclass{article}
\usepackage{cite} % Groups and compresses citation ranges: [1-3]
\begin{document}
Recent breakthroughs in natural language processing rely heavily on transformer architectures~\cite{vaswani2017attention, brown2020gpt3}.
% Choose your bibliography style:
\bibliographystyle{plain}
% Specify your .bib file (without the .bib extension):
\bibliography{references}
\end{document}
Standard BibTeX Styles
| Style | Citation Format | Sort Order | Author Presentation |
|---|---|---|---|
plain |
Numeric [1] |
Alphabetical by author surname | Full names: Vaswani, Ashish |
unsrt |
Numeric [1] |
Order of citation in text | Full names: Vaswani, Ashish |
alpha |
Alphanumeric [Vas17] |
Alphabetical | Surname prefix + Year: [VSP+17] |
abbrv |
Numeric [1] |
Alphabetical by author surname | Abbreviated first name: A. Vaswani |
Non-Breaking Space (
~): Always place a non-breaking space~before\cite{...}(e.g.,algorithm~\cite{knuth1984texbook}). This prevents LaTeX from placing the citation marker alone at the beginning of a new line.
6. Automated Generation: From DOI to Clean BibTeX
Hand-crafting BibTeX entries from publisher web pages is slow and prone to formatting errors: missing volume numbers, unescaped ampersands, or forgotten page en-dashes.
Instead of writing entries manually, leverage automated digital object identifiers:
- Locate the publication’s DOI (e.g.,
10.1145/3359591.3359737) or arXiv ID (2005.14165). - Paste the identifier into our browser-native Universal BibTeX Generator or DOI to BibTeX Converter.
- The engine fetches verified metadata from CrossRef, automatically escapes reserved characters, normalizes page ranges with en-dashes (
--), and generates clean, verified citation blocks ready to paste directly into yourreferences.bibfile.
With structured BibTeX workflows and automated citation tooling, you can spend less time fixing compilation errors and more time focusing on your core research.