I stumbled upon a problem where I have only the citation key in the list of figures when using the packages biblatex and siunitx at the same time with ref sections.
If you compile the working MWE just below, you get this in the figures' captions
And you get a correct list of figures at the end:
But if you uncomment the \usepackage{siunitx} line, you get the same thing in the figures' captions, but in the list of figures, you only get the citation key..
Any idea on how to get the list of figures working like in the first example, while using the siunitx package?
Thank you.
Tex file : main.tex
\documentclass[12pt, a4paper]{book}
\usepackage{caption}
\usepackage{lipsum}
\usepackage{siunitx}
\usepackage{biblatex}
\addbibresource{biblatex-examples.bib}
\usepackage{hyperref}
\begin{document}
\begin{refsection}
\begin{figure}[htbp]
\centering
\rule{2cm}{2cm}
\caption{The is the first caption \protect{\autocite{bertram}}}
\end{figure}
\printbibliography
\end{refsection}
\begin{refsection}
\newpage
\lipsum[2] \autocite{doody}
\begin{figure}[htbp]
\centering
\rule{2cm}{2cm}
\caption{The is the second caption \protect{\autocite{aristotle:anima, doody}}}
\end{figure}
\printbibliography
\end{refsection}
\clearpage
\listoffigures
\end{document}
- PS : I'm not using siunitx in this MWE, but in my actual projet, i do need it.
- PS2: I'm compiling on Overleaf.
- Edit : I saw the question at biblatex combined with refsection and List of Tables but it is without answer, and it does not cover the
siunitxpackage part.. - Edit 2 : I adapted the MWE to not depend on images





.loflooks different whensiunitxis loaded: It is missing the\defcounter {refsection}{1}\relaxlines thatbiblatexpatches in. But I'm not sure why. Will have to investigate that later... – moewe Mar 22 '21 at 17:01filecontentsenv in the preamble. It takes the filename to be created as its mandatory argument. Additionally, please don't refer to files we do not have access to (the image), you can use\rule{5cm}{5cm}instead – daleif Mar 22 '21 at 17:07\addtocontentsat the end of the preamble, andsiunitxredefines it at begin document. – daleif Mar 22 '21 at 17:17biblatex-examples– clapsus Mar 25 '21 at 08:34