I'm writing a standard complex document (ie, thesis), in which chapters are separated into different files which are included. I am using biblatex, and I would like to have a separate bibliography per chapter, so I am using the refsection option to automatically separate bibliographical scopes per section (as explained here and on the biblatex documentation, in section 3.11.3: "Multiple bibliographies").
However, my existing document did not like this at all, and crashed with an error stating
! You can't use `\relax' after \advance.
<recently read> \blx@sectionciteorder@1
I use Kile as my IDE, and according to Kile, the file where the error occurred was the .lot file. After some strategic commenting, I managed to pinpoint the problem:
When a float (figure or table) inside a refsection has a caption with a citation, printing a list of tables or list of figures (as appropriate) causes the error.
Removing the refsection fixes the problem. Removing the citation from the caption (either using the optional argument in \caption or by removing the caption altogether) fixes the problem. Removing the LoT or LoF fixes the problem. But how can I fix the problem without removing any of these?
MWE follows:
\documentclass{book}
\usepackage[
backend=biber,
refsection=chapter,
]{biblatex}
\addbibresource{\jobname.bib}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{A,
title = {A title},
pages = {55--61},
journal = {{JoRS}},
author = {Author, A.N.},
date = {1990}
}
@article{B,
title = {Another title},
pages = {550--610},
journal = {{JoBS}},
author = {Other, A.N.},
date = {1995}
}
\end{filecontents}
\begin{document}
\tableofcontents
\listoftables
\chapter{One}
This is a test \textcite{A}.
\begin{table}
\centering
\caption{A table. From \textcite{A}}
\begin{tabular}{ccc}
A & B & C \\
1 & 2 & 3 \\
\end{tabular}
\end{table}
\printbibliography
\chapter{Two}
This is a test \textcite{B}.
\printbibliography
\end{document}
As common as this seems to me, I was not able to find anything online that referred to this specific circumstance. There is one more question on this site with a promising title, but the core problem is one of sorting, not a crash. (And it's marked as a duplicate of something unrelated to my question).
There is also an issue on the biblatex repository on GitHub, but it doesn't seem to deal with citations in captions and LoF/LoTs at all. In any case, I tried both the development and the experimental versions mentioned in that discussion, and the problem still exists on both.
\caption[]{...– Apr 12 '15 at 23:45biblatexbug tracker: issue #361 – moewe Dec 05 '15 at 17:43Bin the second chapter in a table caption as well you will get "[1]" for both of those in the the lot. (If your real document set-up is different and does not suffer from this problem, please ignore this comment.) – moewe Dec 05 '15 at 17:47biblatexbugtracker has been fixed. As far as I could tell the fix also resolves your issue here, would you be able to confirm that (note that thebiblatexversion on CTAN doesn't incorporate the fix yet, you will have to pull from github or download the dev version from sourceforge)? – moewe Dec 09 '15 at 10:29biblatexhas been on CTAN for over a week and should be available in MikTeX and TeX live. When I tried the MWE above with the new version the error was gone. – moewe Jan 04 '16 at 12:41biblatexthat has been resolved in a recent update. An update resolves the issue. – moewe Jan 20 '16 at 08:52