# Bug? ibidem in floats with the floatrow-package

When I use the floatrow-package with biblatex and a citation style that uses ibidem-tracking, usually, when I cite a publication twice, the second time the citation gets replaced with (ibid.) (or ebd. in Germany) indicating a reference to the same source as before.

Citing inside the caption of a floating object though, the full citation should show up always, instead of the (ibid.) short.

This behaviour seems to be broken when using the floatrow-package instead of float.

The MWE:

\documentclass[12pt,a4paper]{scrartcl}

% Bibliography entries:
\begin{filecontents}{literatur.bib}
@booklet{one,
author = {Author One and Author Three and Author Four and Author Five and Author Six and Author Seven and Author Eight and Author Nine},
title = {Testtitle 1.},
date = {2018},
}
@booklet{two,
author = {Author Two},
shortauthor = {AOne},
title = {Testtitle 2.},
date = {2018},

}
\end{filecontents}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[ngerman]{babel}

\usepackage{mwe} % Example figure
\usepackage{graphicx} % Includegraphics command

\usepackage[backend=biber,style=authoryear-ibid,sortlocale=de_DE]{biblatex}

\usepackage{floatrow} % Creates a bug when used instead of float
\begin{document}

Here, I cite the publication a first time: \parencite{one}. Now, I cite it a second time, where ebd. shows up correctly. \parencite{one}.
\begin{figure}[H]
\includegraphics[draft, width=0.3\textwidth]{example-image-a}
\caption{In this float caption, when I cite a third time, no ebd. should appear \parencite{one}.}
\end{figure}
\printbibliography
\end{document}


The output of this MWE:

Can you confirm this? I guess this is not intended? Is there a workaround for this? (I don't need a workaround ATM, but maybe someone else does)

And finally, if it is one, where should I report this as a bug? (since I have zero experience with bug reporting)

I am using MikTex on Windows 10, floatrow v0.3b, and biblatex v3.11.

Have a nice day! :)

• I can confirm this, but I would call it expected behavior because basically the [H] option removes the floating ability of the figure (so the figure stays always in the flow of the text and ibidem could be right). Do you really need the floatrow package? – TeXnician Sep 24 '18 at 8:18
• I just used [H] for the convenience of the screenshot. First, this also happens with [h] or [b], and second, with float and [H], it works just fine. – Pidrittel Sep 24 '18 at 8:23
• Yes, I know, I have tested it, hence I asked whether you really need the floatrow package. Most of the functionality may be achieved with other packages (which may be a bit more up-to-date). Concerning your question on bug-reporting: The package documentation contains an e-mail address, so you would use that. – TeXnician Sep 24 '18 at 8:27
• No, I currently don't need the floatrow package, luckily. I just found this bug while it still was included in my preamble from a previous document and suddenly noticed this bugged behaviour of ebd. Thanks for your hint concerning the email address. :) – Pidrittel Sep 24 '18 at 8:34

biblatex adds code to \@floatboxreset to disable citation tracking in floats. That happens in an \AtEndPreamble hook. The floatrow package effectively takes over \@floatboxreset and replaces it with \FR@flboxreset, the original definition of \@floatboxreset at the time of loading floatrow is retained saved and used as a basis for \FR@flboxreset later on. But that means that changes to \@floatboxreset that happen after floatrow have been loaded are ignored or discarded.

There are several possible work-arounds for this. You could initialise \FR@flboxreset in \AtEndPreamble as well, if the \AtEndPreamble call comes after biblatex's preamble definitions the modified \@floatboxreset will be picked up

\documentclass[12pt,a4paper]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[ngerman]{babel}

\usepackage{duckuments} % Example figure
\usepackage{graphicx} % Includegraphics command

\usepackage[backend=biber,style=authoryear-ibid]{biblatex}

\usepackage{floatrow} % Creates a bug when used instead of float

\makeatletter
\AtEndPreamble{\let\FR@flboxreset\@floatboxreset}
\makeatother
\begin{document}

Here, I cite the publication a first time: \parencite{sigfridsson}. Now, I cite it a second time, where ebd. shows up correctly. \parencite{sigfridsson}.
\begin{figure}[H]
\includegraphics[width=0.3\textwidth]{example-image-duck}
\caption{In this float caption, when I cite a third time, no ebd. should appear \parencite{sigfridsson}.}
\end{figure}
\printbibliography
\end{document}


Alternatively, one could execute

\makeatletter
\apptocmd\@floatboxreset
{\boolfalse{citetracker}%
\boolfalse{pagetracker}}
{}
{\blx@err@patch{floats}}
\makeatother


manually before loading floatrow.

### Is this a bug? Whose bug is this?

This is a tricky. The behaviour does not seem to match the description in the biblatex documentation, so you may call this a bug. (I could try and wiggle my way out of this particular case because a [H] figure is not really a float any more and so I could argue that §4.11.5 Trackers in Floats and TOC/LOT/LOF of the biblatex documentation does not apply. That does not hold a lot of water since the problem persists even with non-[H] floats as long as floatrow is loaded.)

To get things like this right biblatex needs to meddle with many things that normally do not fall within the scope of a bibliography/citation package. LaTeX being LaTeX there is almost no guarantee that the code biblatex needs to patch is going to behave as expected with all class and package combinations.

I am fairly confident that \@floatboxreset is not the completely wrong command to patch into and I also believe that the cautious approach of patching the macro as late as possible has its merits. So I'm not sure if there is something biblatex could do better in this case except of course for checking for floatrow or patching \FR@flboxreset.

At the same time I don't think floatrow is really in the wrong here either.

Given that floatrow has not been updated since 2009 I'm not sure if you well be able to contact the maintainer. Plus I'm not exactly sure what floatrow should do better (sure, it could initialise \FR@flboxreset later, ...).

You could also open an issue for biblatex at https://github.com/plk/biblatex/issues. It is possible to fix this on the biblatex side with relatively little effort. I personally don't find it that brilliant that biblatex has to have patches for so many different packages and classes, because maintaining these patches requires keeping an eye on possible changes in the code of the relevant packages and classes.