# Incorrect figure numbering when using subfloats in a subfloatrow

I have a document with a lot of subfigures which are different heights and need to be placed side-by-side and centered vertically. It seems like the floatrow package is ideal for this.

After much trial and error, I finally made it through the documentation enough to get the subfloats to center correctly, but now every time there is a subfloat, the figure counter gets incremented, so I have figure 10 followed by figure 13, when figure 10 has two subfloats in it. In the minimal example, notice that the single figure in the document is labelled Figure 3!

There was a similar question floating around the web about 5 years ago, but I didn't see an answer.

Here's minimal code:

\documentclass[11pt]{article}
\usepackage{subfig}
\usepackage{tikz}

\usepackage[]{floatrow}
\usepackage{graphicx}

\begin{document}

\begin{figure}[htbp]
\centering
\ffigbox{
\begin{subfloatrow}[3]
\subfloat[First, we see an empty green circle]{
\begin{tikzpicture}[scale=1] \draw[green]  (0,0) circle (1.2cm);\end{tikzpicture}
}

\subfloat[A large orange circle is the middle picture]{
\begin{tikzpicture}[scale=1]\draw[orange] (0,0) circle (2cm);\end{tikzpicture}}

\subfloat[Finally, a beautiful red circle with a black border]{
\begin{tikzpicture}[scale=1]\draw[fill=red]  (0,0) circle (.75cm);\end{tikzpicture}}
\end{subfloatrow}
}
{\caption{Gadgets'' in reduced Levi graphs found as a consequence of using the construction in the configuration construction lemma.}
\label{CCLvolt}
}
\end{figure}
\end{document}

-
Ok, so clearly something's wrong with my code. The subfigures should be vertically centered---that's the whole point of using floatrow in the first place---and they're not. Sometimes, retypesetting will fix the centering, but it doesn't seem to in this case. –  Leah Wrenn Berman Apr 15 '12 at 21:51

It seems the starred environment version subfloatrow* produces the correct numbering. The floatrow manual isn't too verbose, though, about why is so -- quoting from section 6.2:

subfloatrow*

The starred form loads settings for creation captions of float parts, but in this environment the \caption command restores its meaning. Thus, you need the \subcaption command for typesetting sub-captions.

\documentclass[11pt]{article}
\usepackage{subfig}
\usepackage{tikz}

\usepackage[]{floatrow}
\usepackage{graphicx}

\begin{document}

\begin{figure}[htbp]
\centering
\ffigbox{
\begin{subfloatrow*}[3]
\subfloat[First, we see an empty green circle]{
\begin{tikzpicture}[scale=1] \draw[green]  (0,0) circle (1.2cm);\end{tikzpicture}
}

\subfloat[A large orange circle is the middle picture]{
\begin{tikzpicture}[scale=1]\draw[orange] (0,0) circle (2cm);\end{tikzpicture}}

\subfloat[Finally, a beautiful red circle with a black border]{
\begin{tikzpicture}[scale=1]\draw[fill=red]  (0,0) circle (.75cm);\end{tikzpicture}}
\end{subfloatrow*}
}
{\caption{Gadgets'' in reduced Levi graphs found as a consequence of using the construction in the configuration construction lemma.}
\label{CCLvolt}
}
\end{figure}
\end{document}


-
Thanks! Any idea why the subfloats are not centering vertically any more either? (which was the whole point of using floatrow in the first place...) –  Leah Wrenn Berman Apr 21 '12 at 19:21
@LeahWrennBerman Why "not [..] any more"? They look exactly like in your original example. (If you mean they should look different than in your example, please ask a new question, as it's not a numbering problem.) –  lockstep Apr 21 '12 at 19:24
The "not [...] any more" was that with the options I had set for floatrow, it should have been vertically centering, and had been before I introduced the floatrows. For what it's worth, I was missing an option for subfigure in floatrow: it needed \floatsetup[subfloat]{subfloatrowsep=qquad,valign=c, heightadjust=object} to actually make the vertical alignment work. –  Leah Wrenn Berman Apr 22 '12 at 5:13