Just for the record, I had the same problem, using memoir
and floatrow
together. Removing pdflatex
from the preamble did not solve it.
I compiled the document successfully by adding the following line before loading floatrow
:
\let\newfloat\undefined
\usepackage{floatrow}
Thanks to Joseph Wright.
\subfloat
is not a command implemented in the subcaption
package, so it won't be recognised by the package. If you want to use the subcaption
package, you can use the either the subtable
environment or the \subcaptionbox
command. If your subimages don't need a caption, you can simply use \includegraphics
.
In the following example I used the tabu package to buid the table with the six images. In the first case, the images won't have a caption: in the second case, each image will have its caption:
\documentclass[a4paper]{book}
\usepackage[demo]{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{tabu}
\begin{document}
\begin{table}
\centering
\caption{Sample Table}
\label{tbl:sample1}
\tabulinesep =_1em^1em
\everyrow{\tabucline[0.4pt]-}
\begin{tabu}{|c|c|c|}
\includegraphics[width=0.15\textwidth,height=0.15\textwidth]{image1} &
\includegraphics[width=0.15\textwidth,height=0.15\textwidth]{image1} &
\includegraphics[width=0.15\textwidth,height=0.15\textwidth]{image1}
\\
\includegraphics[width=0.15\linewidth,height=0.15\linewidth]{image2} &
\includegraphics[width=0.15\linewidth,height=0.15\linewidth]{image2} &
\includegraphics[width=0.15\linewidth,height=0.15\linewidth]{image2}
\end{tabu}
\end{table}
\begin{table}
\centering
\caption{Sample Table}
\label{tbl:sample2}
\tabulinesep =_1em^0.5em
\everyrow{\tabucline[0.4pt]-}
\begin{tabu}{|c|c|c|}
\subcaptionbox{text}{\includegraphics[width=0.15\textwidth,height=0.15\textwidth]{image1}} &
\subcaptionbox{text}{\includegraphics[width=0.15\textwidth,height=0.15\textwidth]{image1}} &
\subcaptionbox{text}{\includegraphics[width=0.15\textwidth,height=0.15\textwidth]{image1}}
\\
\subcaptionbox{text}{\includegraphics[width=0.15\linewidth,height=0.15\linewidth]{image2}} &
\subcaptionbox{text}{\includegraphics[width=0.15\linewidth,height=0.15\linewidth]{image2}} &
\subcaptionbox{text}{\includegraphics[width=0.15\linewidth,height=0.15\linewidth]{image2}}
\end{tabu}
\end{table}
\end{document}
Without the tabu
package, in order to achieve the same result, some manual adjustments will be needed:
\documentclass[a4paper]{book}
\usepackage[demo]{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\begin{document}
\begin{table}
\centering
\caption{Sample Table}
\label{tbl:sample1}
\renewcommand\arraystretch{2}
\begin{tabular}{|c|c|c|}
\hline\rule{0pt}{\dimexpr0.15\textwidth+1em\relax}
\includegraphics[width=0.15\textwidth,height=0.15\textwidth]{image1} &
\includegraphics[width=0.15\textwidth,height=0.15\textwidth]{image1} &
\includegraphics[width=0.15\textwidth,height=0.15\textwidth]{image1}
\\ \hline\rule{0pt}{\dimexpr0.15\textwidth+1em\relax}
\includegraphics[width=0.15\linewidth,height=0.15\linewidth]{image2} &
\includegraphics[width=0.15\linewidth,height=0.15\linewidth]{image2} &
\includegraphics[width=0.15\linewidth,height=0.15\linewidth]{image2}
\\ \hline
\end{tabular}
\end{table}
\begin{table}
\centering
\caption{Sample Table}
\label{tbl:sample2}
\begin{tabular}{|c|c|c|}
\hline\rule{0pt}{23pt}
\subcaptionbox{text}{\includegraphics[width=0.15\textwidth,height=0.15\textwidth]{image1}} &
\subcaptionbox{text}{\includegraphics[width=0.15\textwidth,height=0.15\textwidth]{image1}} &
\subcaptionbox{text}{\includegraphics[width=0.15\textwidth,height=0.15\textwidth]{image1}}
\\[5.5em] \hline\rule{0pt}{23pt}
\subcaptionbox{text}{\includegraphics[width=0.15\linewidth,height=0.15\linewidth]{image2}} &
\subcaptionbox{text}{\includegraphics[width=0.15\linewidth,height=0.15\linewidth]{image2}} &
\subcaptionbox{text}{\includegraphics[width=0.15\linewidth,height=0.15\linewidth]{image2}}
\\[5.5em] \hline
\end{tabular}
\end{table}
\end{document}
Best Answer
The
subfig
package replaces the oldersubfigure
package - don't use both of them at the same time: