Skip to main content
โšก Calmops

Comprehensive Guide to Bibliography Management with BibTeX and Biber

Bibliography management is one of LaTeX’s most powerful features. This comprehensive guide covers BibTeX, Biber, natbib, and modern approaches to handling citations in academic documents.

Understanding the Bibliography System

LaTeX’s bibliography system consists of several components that work together:

% Main document structure with bibliography
\documentclass{article}
\usepackage[backend=biber, style=apa]{biblatex}
\addbibresource{references.bib}

\begin{document}

According to \cite{smith2023}, LaTeX is excellent for scientific writing.
\printbibliography

\end{document}

The bibliography workflow involves:

  1. Creating a .bib file with citation entries
  2. Compiling the LaTeX document
  3. Running BibTeX or Biber to process citations
  4. Re-compiling to generate the final bibliography

BibTeX File Structure

Entry Types

BibTeX supports multiple entry types for different source materials:

% Book entry
@book{knuth1984,
  author    = {Donald E. Knuth},
  title     = {The TeXbook},
  publisher = {Addison-Wesley},
  year      = {1984},
  isbn      = {0-201-13447-0}
}

% Article entry
@article{einstein1905,
  author  = {Albert Einstein},
  title   = {On the Electrodynamics of Moving Bodies},
  journal = {Annalen der Physik},
  year    = {1905},
  volume  = {17},
  pages   = {891--921}
}

% Inproceedings/Conference paper
@proceedings{icml2024,
  title    = {Proceedings of the 41st International Conference on Machine Learning},
  year     = {2024},
  editor   = {Maria L. Gary and David M. Blei},
  publisher = {JMLR}
}

% Incollection/Book chapter
@incollection{hopcroft2007,
  author    = {John E. Hopcroft and Rajeev Motwani},
  title     = {Introduction to Automata Theory, Languages, and Computation},
  booktitle = {Classical and Quantum Computation},
  publisher = {American Mathematical Society},
  year      = {2007},
  pages     = {57--68}
}

% Master's thesis
@mastersthesis{johnson2020,
  author = {Mary Johnson},
  title  = {Machine Learning Applications in Climate Modeling},
  school = {Massachusetts Institute of Technology},
  year   = {2020}
}

% Technical report
@techreport{nist2022,
  author    = {National Institute of Standards and Technology},
  title     = {Cybersecurity Framework Version 2.0},
  institution = {NIST},
  year      = {2022},
  number    = {CSWP 40}
}

% Online resource
@online{latexproject2024,
  author    = {LaTeX Project},
  title     = {LaTeX3 Documentation},
  url       = {https://www.latex-project.org/help/documentation/},
  year      = {2024},
  urldate   = {2024-01-15}
}

Essential Fields

Understanding which fields are required versus optional helps create accurate citations:

% Minimum required fields for @article
@article{minimalarticle,
  author = {Author Name},
  title  = {Article Title},
  journal = {Journal Name},
  year   = {2024}
}

% Full article with all common fields
@article{fullarticle,
  author    = {First Author and Second Author},
  title     = {A Comprehensive Study on Topic Modeling},
  journal   = {Journal of Machine Learning Research},
  year      = {2024},
  volume    = {25},
  number    = {3},
  pages     = {1--42},
  doi       = {10.1234/jmlr.2024.12345},
  issn      = {1532-4435},
  abstract  = {This paper presents a novel approach to topic modeling...}
}

Modern Bibliography with Biblatex

Setting Up Biblatex

Biblatex is the modern, flexible alternative to traditional BibTeX:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

% Biblatex configuration
\usepackage[
  backend=biber,           % Use Biber for processing
  style=apa,               % APA 7th edition style
  sorting=nyt,             % Sort by name, year, title
  isbn=false,              % Hide ISBN in output
  url=false,               % Hide URLs unless needed
  doi=true                 % Show DOIs
]{biblatex}

\addbibresource{references.bib}

\begin{document}

% Citation commands
\cite{knuth1984}
\parencite{einstein1905}
\textcite{hopcroft2007}
\notecite{smith2023}

% Print bibliography
\printbibliography

\end{document}

Citation Styles

Biblatex provides multiple citation commands for different contexts:

% Standard citation
\cite{author2024}              % [1]

% Parenthetical citation
\parencite{author2024}         % (Author, 2024)

% Textual citation
\textcite{author2024}         % Author (2024) argues...

% Footnote citation
\footcite{author2024}          % Citation in footnote

% Short citation (for subsequent references)
\shortcite{author2024}        % [1]

% Citation with page numbers
\pagecite[45]{author2024}       % [1, p. 45]

% Multiple citations
\parencite{author2024, smith2023, jones2022}
% Output: (Author, 2024; Smith, 2023; Jones, 2022)

Bibliography Styles

Biblatex supports numerous citation styles:

% Author-date styles
\usepackage[style=apa]{biblatex}        % APA 7th
\usepackage[style=authoryear]{biblatex} % Author-Year
\usepackage[style=authortitle]{biblatex}% Author-Title

% Numbered styles
\usepackage[style=numeric]{biblatex}    % [1], [2], [3]
\usepackage[style=ieee]{biblatex}      % IEEE style
\usepackage[style=alphabetic]{biblatex}% [ABC94]

% Humanities styles
\usepackage[style=verbose]{biblatex}   % Full citation on first use
\usepackage[style=philosophy-academic]{biblatex}

% Custom style
\usepackage[style=mycustomstyle]{biblatex}

Biber: The Modern Backend

Why Biber?

Biber is the default backend for Biblatex and offers significant advantages over traditional BibTeX:

Feature BibTeX Biber
Unicode support Limited Full
Encoding ASCII UTF-8
Custom sorting Basic Advanced
Data sources .bib only Multiple
Regex filtering No Yes

Running Biber

# Standard compilation sequence
pdflatex document
biber document
pdflatex document
pdflatex document

# With makeindex (for glossary)
pdflatex document
makeindex document.glo -s doc-sup็ฟ”.ind
biber document
pdflatex document

# Clean compilation
rm document.aux document.bbl document.bcf
pdflatex document
biber document
pdflatex document

Biber Configuration

<!-- biber.conf for custom settings -->
<?xml version="1.0" encoding="UTF-8"?>
<config>
  <sourcemap>
    <maps datatype="bibtex" map_overwrite="1">
      <map>
        <map_step map_field_source="author"
                  map_field_target="author"/>
      </map>
    </maps>
  </sourcemap>
  <datamodel>
    <fields>
      <field fieldtype="field" datatype="literal"
             level="entry">custid</field>
    </fields>
  </datamodel>
</config>

natbib: Traditional Citation Commands

For documents using traditional BibTeX with natbib:

\documentclass{article}
\usepackage[numbers,square]{natbib}

\begin{document}

% Cite with numbers
\citep{knuth1984}      % [1]
\Citep{knuth1984}     % (Knuth, 1984)

% Cite as author-date
\citet{knuth1984}     % Knuth (1984)
\citealt{knuth1984}   % Knuth 1984 (no parentheses)

% Multiple authors
\citeauthor{knuth1984}    % Knuth
\citeyear{knuth1984}      % 1984

% Page numbers
\pagescite[45-67]{knuth1984}  % [1, pp. 45-67]

\bibliographystyle{plainnat}
\bibliography{references}

\end{document}

Common natbib Styles

% Author-year (default)
\usepackage{natbib}

% Numbered
\usepackage[numbers]{natbib}

% With square brackets
\usepackage[numbers,square]{natbib}

% Sorting by appearance
\bibliographystyle{plain}

% APA-like
\bibliographystyle{apacite}

% IEEE style
\bibliographystyle{IEEEtran}

Advanced Bibliography Features

Multiple Bibliographies

\usepackage[
  backend=biber,
  defernumbers=true
]{biblatex}

% Print separate bibliographies by type
\printbibliography[title={Articles}, type=article]
\printbibliography[title={Books}, type=book]
\printbibliography[title={Online Sources}, type=online]

% By keyword
\printbibliography[keyword={machine-learning}]
\printbibliography[keyword={statistics}]

Subdividing Bibliography

% By section/chapter
\printbibliography[heading=subbibintoc]

% By category
\defbibcategory{published}{Published Papers}
\defbibcategory{preprint}{Preprints}
\nocite{author2024a}\defbibentryset{author2024a}{author2024b}

\printbibliography[category=published]
\printbibliography[category=preprint]

Custom Entry Types

% Define custom field
\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \step[fieldsource=annotation,
            match=\regexp{\bimportant\b},
            fieldset=keywords,
            fieldvalue={,important},
            append]
    }
  }
}

% Custom driver for software
\DeclareBibliographyDriver{software}{%
  \usebibmacro{bibentry}%
  \newunit\newblock
  \printfield{version}%
  \newunit\newblock
  \printfield{url}%
}

Managing Large Bibliographies

Sorting and Filtering

\usepackage[
  backend=biber,
  sorting=nyt,        % Name-Year-Title
  sorting=ynt,        % Year-Name-Title
  sorting=ydnt,       % Year descending-Name-Title
  sorting=none,       % Order of citation
]{biblatex}

Excluding Entries

% Exclude certain types from bibliography
\printbibliography[nottype=online]

% Exclude entries with specific keyword
\printbibliography[notkeyword=draft]

% Exclude certain entries by key
\exclusion{author2023a, author2023b}

BibTeX Best Practices

Organization Strategies

% Group by topic in comments
% --- Machine Learning ---
@article{ml1,
  author = {Author One},
  title  = {Deep Learning Advances},
  year   = {2024}
}

% --- Statistics ---
@article{stat1,
  author = {Author Two},
  title  = {Bayesian Methods},
  year   = {2024}
}

Key Naming Conventions

% Author-year format (recommended)
@book{knuth1984,
  ...
}

% Descriptive format
@book{texbook-knuth,
  ...
}

% Multiple works same year
@book{knuth1984a,
  ...
}
@book{knutch1984b,
  ...
}

Cross-Referencing Entries

% Referring to another entry
@collection{editor2024,
  editor = {John Editor},
  title  = {Conference Proceedings},
  year   = {2024}
}

@incollection{chapter2024,
  author    = {Jane Author},
  title     = {My Chapter},
  booktitle = {Conference Proceedings},
  crossref  = {editor2024},
  pages     = {45--67}
}

Integration with Reference Managers

Export Formats

Most reference managers can export to BibTeX format:

% From Zotero
% Select items โ†’ Right-click โ†’ Export โ†’ BibTeX

% From Mendeley
% File โ†’ Export โ†’ BibTeX

% From EndNote
% File โ†’ Export โ†’ BibTeX

Cleaning BibTeX Entries

% Use bibclean or biber --tool
biber --tool --validate_datamodel --output_format=bibtex myfile.bib

Complete Working Example

% document.tex
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[
  backend=biber,
  style=authoryear,
  dashed=false,
  maxcitenames=2,
  mincitenames=1,
  maxbibnames=10
]{biblatex}

\addbibresource{references.bib}

\begin{document}

\section{Introduction}

Machine learning has revolutionized various fields \parencite{deeplearning2020}.
Recent advances include transformer architectures \parencite{transformer2017}
and diffusion models \parencite{diffusion2022}.

As noted by \textcite{goodfellow2016}, deep learning enables computers
to learn from experience.

\section{Related Work}

Multiple studies have explored this topic \postcite{smith2021, jones2022, doe2023}.
See also \volcite{2}{smith2021} for additional context.

\printbibliography

\end{document}

With corresponding references.bib:

@article{deeplearning2020,
  author  = {Yann LeCun and Yoshua Bengio and Geoffrey Hinton},
  title   = {Deep learning},
  journal = {Nature},
  year    = {2020},
  volume  = {521},
  pages   = {436--444}
}

@article{transformer2017,
  author  = {Ashish Vaswani and others},
  title   = {Attention Is All You Need},
  journal = {NIPS},
  year    = {2017}
}

@article{diffusion2022,
  author  = {Robin Rombach and others},
  title   = {High-Resolution Image Synthesis with Latent Diffusion Models},
  journal = {CVPR},
  year    = {2022}
}

@book{goodfellow2016,
  author    = {Ian Goodfellow and Yoshua Bengio and Aaron Courville},
  title     = {Deep Learning},
  publisher = {MIT Press},
  year       = {2016}
}

External Resources

Comments