Consider the following document:
\documentclass{minimal}
\usepackage{biblatex}
\newsavebox{\foobox}
\newcommand{\doofoo}[1]{
\ifdefined\donewithfoo
\else
\begin{lrbox}{\foobox}
\begin{refcontext}
\begin{refsection}[#1]
foo
\end{refsection}
\end{refcontext}
\end{lrbox}
\fi
\usebox\foobox
\global\def\donewithfoo{}
}
\begin{filecontents}{bar.bib}
\end{filecontents}
\begin{document}
\doofoo{bar}
\doofoo{bar}
\end{document}
let's call it mydoc.tex
.
This is a sort-of-minimal example of a more complex document involving an "artificially"-embedded partial bibliography (an idea presented here and used in a document class I'm maintaining here, but hopefully that is immaterial to the question I think).
I compile this document with: xelatex mydoc
. This used to compile fine, but with recent TeXLive versions (2023 for sure, maybe 2022? 2021? I don't know), I get:
LaTeX Warning: Label `refsection:1' multiply defined.
the aux file has:
\relax
\abx@aux@refcontext{nty/global//global/global}
\abx@aux@refcontext{nty/global//global/global}
\abx@aux@refsection{1}{1}
\newlabel{refsection:1}{{}{1}{}{}{}}
\newlabel{refsection:1}{{}{1}{}{}{}}
\abx@aux@read@bbl@mdfivesum{nobblfile}
\gdef \@abspage@last{1}
Anyway, my questions:
- What changed in XeLaTeX, or perhaps biblatex, that now triggers the creation of two identical labels (when before, they were either not created, or only one was created, or they got distinct labels)?
- What can I do to keep basically the same document, but ensure the labels are distinct?
\savebox\foobox{abc\label{blub}}\usebox\foobox \usebox\foobox
. The only way to avoid that is to use \leaders, see tex.stackexchange.com/a/86546/2388\refcontext
not matching its definition