biber
biber copied to clipboard
Formulas including \hbox break in some cases.
Biber rewrites Formulas in titles in some cases, especially when it is called with --decodecharsset=null and you have something like \macro<space>{X} where X is a single letter. This is rewritten to \macro X. This is OK in most cases (like \frac or \text) but creates invalid TeX code when \macro is \box, because \hbox requires braces.
A fix is to avoid the space: \macro{X} is not rewritten.
My assumption from reading the man page was that title = "{ ..... }" are never rewritten if called with --decodecharsset=null, but the reverse seems to be true. I don't know if this the intended behaviour or a bug.
MWE:
\documentclass{article}
\usepackage{biblatex}
% this yields an error:
%
% pdflatex mwe && biber --decodecharsset=null mwe && pdflatex mwe
%
%
% This is OK:
%
% pdflatex mwe && biber mwe && pdflatex mwe
%
%
\begin{filecontents*}[overwrite]{\jobname.bib}
@article{one,
title = "{$\hbox {N}^3$}",
author = "One, Eins",
year = 2025,
journal = "Heft",
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\begin{document}
Eins: \cite{one}.
\printbibliography
\end{document}