Bibliography¶
LaTeX documents that use \cite{} need a bibliography processor.
Modern documents almost always want
biblatex + biber, which handle
Unicode, sophisticated styles, and multi-bibliography workflows
correctly.
rules_latex ships a vendored biber binary alongside the tectonic
toolchain. To use it, set biber = True on your document.
Minimal example¶
% paper.tex
\documentclass{article}
\usepackage[backend=biber,style=numeric]{biblatex}
\addbibresource{references.bib}
\begin{document}
This sentence cites Knuth~\cite{knuth1984}.
\printbibliography
\end{document}
% references.bib
@book{knuth1984,
author = {Donald E. Knuth},
title = {The {{\TeX}}book},
publisher = {Addison-Wesley},
year = {1984},
}
# BUILD.bazel
load("@rules_latex//latex:defs.bzl", "latex_document")
latex_document(
name = "paper",
main = "paper.tex",
srcs = ["paper.tex", "references.bib"],
biber = True,
)
The build runs tectonic, biber, tectonic again — all sandboxed, all hermetic. The resulting PDF has resolved citations.
How it works¶
When biber = True:
- The platform-specific
biberbinary from the toolchain is staged into a per-action scratch directory. - That directory is prepended to PATH inside the sandbox.
- Tectonic's biblatex subprocess resolves
biberby basename and shells out to it as usual.
The biber binary is vendored from a GitHub release
mirror on the
rules_latex repo, content-addressed by SHA-256. See
DESIGN.md §4.9
for the full implementation details.
Version coupling¶
Biber is tightly coupled to biblatex's "control file format" version.
rules_latex pins biber 2.21 to match the biblatex 3.21 that ships in
the self-hosted TeX Live 2026 bundle. The pin and the bundle are
bumped together, so the pair can never drift — you don't manage it.
Citation styles not in the bundle¶
The bundle ships the standard biblatex styles (numeric,
alphabetic, authoryear, authortitle, verbose). Extension
styles — APA, Chicago, IEEE, Nature, Vancouver, etc. — live in
separate CTAN packages. Add them with the ctan_packages attribute;
no toolchain opt-in is needed, because the bundle's biblatex 3.21 is
new enough to process them.
Modern citation styles¶
Just list the style package in ctan_packages and turn on biber:
latex_document(
name = "thesis",
main = "thesis.tex",
srcs = ["thesis.tex", "references.bib"],
ctan_packages = ["biblatex-apa"], # APA 7th edition style
biber = True,
)
Modern extension styles (apa.bbx, chicago.bbx, …) need biblatex
3.18+ / biber 2.18+; the TeX Live 2026 bundle ships 3.21 / 2.21, so
they work with no extra configuration. See the
CTAN packages
page for the full version-coupling discussion.
Upgrading from ≤ v0.5? Earlier versions required a
tectonic.toolchain(modern_biblatex = True)opt-in for these styles. It was removed in v0.6.0 — the rebuilt bundle ships the modern stack natively. Delete that argument from yourMODULE.bazel.
Platform support¶
| Platform | Toolchain biber? | Note |
|---|---|---|
| Linux x86_64 | Upstream prebuilt | |
| Linux aarch64 | Prebuilt biber 2.21 (CTAN) | |
| macOS x86_64 | Universal binary | |
| macOS aarch64 | Universal binary | |
| Windows x86_64 |
Unsupported platforms¶
biber 2.21 is vendored for every platform above, including Linux
arm64 (a prebuilt binary from CTAN's biber-linux-aarch64 package,
new in v0.6.0). If you're on a platform without a vendored binary,
install biber via your distro (apt-get install biber) and fall back
to the system binary on PATH:
latex_document(
name = "thesis",
main = "thesis.tex",
srcs = [...],
biber = True,
biber_strategy = "system", # use system biber on PATH
)
This is less hermetic — your build depends on whatever biber is installed — so it's an escape hatch, not the recommended path.