I have a figure in my document that has 10 subfigures, and overflows onto two pages. I have used two figure
environments and \ContinuedFloat
to get the correct lettering between subfloats. The problem now is that \caption
no longer works in table
environments. Here is an example of the problem.
\documentclass[12pt, a4paper]{article}
\usepackage{subfig}
\begin{document}
\begin{table}
\begin{center}
\caption{cat}
\begin{tabular}{|l|c|r|}
\hline
1 & 2 & 3 \\ \hline
4 & 5 & 6 \\ \hline
7 & 8 & 9 \\
\hline
\end{tabular}
\caption{cat}
\label{cat}
\end{center}
\end{table}
\ref{cat}
\begin{figure}
\end{figure}
\begin{figure}
\ContinuedFloat
\end{figure}
\end{document}
Any help would be greatly appreciated.
Best Answer
You have to put a caption for the figure too to get an anchor there. Otherwise, the anchor from previous
\caption
will be taken (here it is a table) and throw an error.to get things right.
Code:
Please note that
center
environment is not suitable for use withfigure
andtable
as it leaves extra (un-necessary) vertical space.