Bibliography and Citations¶
LaTeX makes referencing and formatting bibliographies powerful and automatic.
- BibTeX: The classic approach.
- BibLaTeX: The modern, feature-rich replacement.
1. BibTeX¶
Creating a Database (.bib file)¶
Create a file like references.bib and add entries:
@article{einstein1905,
author = "Albert Einstein",
title = "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
[{On} the electrodynamics of moving bodies]",
journal = "Annalen der Physik",
volume = "322",
number = "10",
pages = "891--921",
year = "1905",
doi = "http://dx.doi.org/10.1002/andp.19053221004"
}
@book{latexcompanion,
author = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
title = "The \LaTeX\ Companion",
year = "1993",
publisher = "Addison-Wesley",
address = "Reading, Massachusetts"
}
In Your Document¶
Linking the .bib file:
\documentclass{article}
\begin{document}
Einstein's theory of relativity \cite{einstein1905} revolutionized physics.
The \LaTeX\ Companion \cite{latexcompanion} is an essential book.
\bibliographystyle{plain} % plain, unsrt, alpha, abbrv
\bibliography{references} % filename without .bib
\end{document}
Compilation Order¶
pdflatex mydoc.tex(Creates.aux)bibtex mydoc(Creates.bbl)pdflatex mydoc.tex(Merges.bbl)pdflatex mydoc.tex(Updates references)
2. BibLaTeX (Recommended)¶
BibLaTeX is easier to customize and handles complex citations better.
Preamble setup¶
style=ieee,apa,mla,authoryear,numeric.backend=biber: Biber is the default engine for BibLaTeX (replacebibtexstep withbiber).
Printing the Bibliography¶
Place \printbibliography where you want the references to appear.
3. In-Text Citation Commands¶
Modern packages like biblatex and natbib provide specific commands for different citation styles.
BibLaTeX Citation Table¶
| Command | Description | Output (authoryear) | Output (numeric) |
|---|---|---|---|
\cite{key} |
Basic citation | Einstein 1905 | [1] |
\parencite{key} |
In parentheses | (Einstein, 1905) | [1] |
\textcite{key} |
Narrative (author in text) | Einstein (1905) | Einstein [1] |
\autocite{key} |
Context-sensitive | (Einstein, 1905) | [1] |
\footcite{key} |
Citation in footnote | Citation in footer | ยน |
\citeauthor{key} |
Author name only | Einstein | Einstein |
\citeyear{key} |
Year only | 1905 | 1905 |
\nocite{key} |
Add to bib without citing | (No output) | (No output) |
Natbib Equivalence Table¶
If you are using the natbib package, use these commands:
| Natbib Command | BibLaTeX Equivalent | Purpose | Example |
|---|---|---|---|
\citet{key} |
\textcite{key} |
Narrative citation | Einstein (1905) |
\citep{key} |
\parencite{key} |
Parenthetical citation | (Einstein, 1905) |
\citet*{key} |
N/A | Full author list | Einstein, Podolsky, & Rosen (1935) |
Practical Usage Example¶
Here is how you might use these commands in a research paper:
LaTeX Source:
In the field of physics, \textcite{einstein1905} introduced the revolutionary
concept of special relativity. This work remains a cornerstone of modern
science \parencite{einstein1905}. Later, developers like \citeauthor{knuth1984}
focused on the presentation of such ideas through software, specifically in
his work during \citeyear{knuth1984}. General guides such as \autocite{latexcompanion}
provide further technical depth. For more info, see the project docs \footcite{mkdocs}.
Rendered Output (Author-Year):
In the field of physics, Einstein (1905) introduced the revolutionary concept of special relativity. This work remains a cornerstone of modern science (Einstein, 1905). Later, developers like Knuth focused on the presentation of such ideas through software, specifically in his work during 1984. General guides such as (Goossens et al., 1993) provide further technical depth. For more info, see the project docs ยน.
Author Variations (Single, Two, 3+)¶
How citations look depends on the number of authors in the .bib entry:
| Author Count | Example author field |
\textcite Output |
\parencite Output |
|---|---|---|---|
| 1 Author | Albert Einstein |
Einstein (1905) | (Einstein, 1905) |
| 2 Authors | Jane Doe and John Smith |
Doe and Smith (2024) | (Doe and Smith, 2024) |
| 3+ Authors | Alice Alpha and Bob Beta and others |
Alpha et al. (2025) | (Alpha et al., 2025) |
๐ Note: The use of "et al." for 3 or more authors is automatic in styles like
authoryearorapa.
Natbib (Alternative)¶
Often used in sciences for author-year citations (\citep, \citet). Compatible with BibTeX styles.
4. Troubleshooting: "Not Reflecting"¶
If your citations or bibliography are not appearing:
- Check Compilation Order:
- For BibTeX:
pdflatexโbibtexโpdflatexโpdflatex. - For BibLaTeX:
pdflatexโbiberโpdflatex.
- For BibTeX:
- Verify File Names: Ensure
\bibliography{filename}or\addbibresource{filename.bib}exactly matches your.bibfile name. - Check Keys: Ensure the key in
\cite{key}exactly matches the key in the@entry{key, ...}in your.bibfile. - Auxiliary Files: Sometimes old
.auxor.bblfiles cause issues. Try deleting them and re-compiling.