I came from here where this issue was raised but could not find a straightforward solution. I have now side-by-side tables and I want to avoid the errors thrown once floatrow
package is added to the preamble. Is there any solution to this issue or, in case not, any alternative to do side-by-side tables without sacrificing the floatrow
package?
MWE code:
\documentclass{scrartcl}
%\usepackage{floatrow} % commented out otherwise throws errors (see below)
\usepackage{booktabs}
\begin{document}
\begin{table}
\centering
\makebox[0pt][c]{\parbox{1\textwidth}{%
\begin{minipage}[b]{0.5\hsize}\centering
\begin{tabular}{r|rrrr}
\toprule
& \multicolumn{4}{c}{\textbf{Reference}} \\
\midrule
\textbf{Predicted} & H & P & R & Q \\
\midrule
H & 3 & 0 & 0 & 0 \\
P & 0 & 5 & 0 & 0 \\
R & 0 & 0 & 19 & 1 \\
Q & 0 & 0 & 0 & 25 \\
\bottomrule
\end{tabular}
\caption{SVMr confusion matrix.}
\label{tab:cmsvm}
\vskip 1cm
\begin{tabular}{r|rrrr}
\toprule
& \multicolumn{4}{c}{\textbf{Reference}} \\
\midrule
\textbf{Predicted} & H & P & R & Q \\
\midrule
H & 2 & 0 & 0 & 0 \\
P & 0 & 5 & 0 & 0 \\
R & 1 & 0 & 19 & 0 \\
Q & 0 & 0 & 0 & 26 \\
\bottomrule
\end{tabular}
\caption{RDA confusion matrix.}
\label{tab:cmrda}
\vskip 1cm
\begin{tabular}{r|rrrr}
\toprule
& \multicolumn{4}{c}{\textbf{Reference}} \\
\midrule
\textbf{Predicted} & H & P & R & Q \\
\midrule
H & 3 & 0 & 0 & 0 \\
P & 0 & 4 & 0 & 0 \\
R & 0 & 0 & 19 & 0 \\
Q & 0 & 1 & 0 & 26 \\
\bottomrule
\end{tabular}
\caption{PAM confusion matrix.}
\label{tab:cmpam}
\end{minipage}
\hfil
\begin{minipage}[b]{0.5\hsize}\centering
\begin{tabular}{r|rrrr}
\toprule
& \multicolumn{4}{c}{\textbf{Reference}} \\
\midrule
\textbf{Predicted} & H & P & R & Q \\
\midrule
H & 2 & 0 & 0 & 0 \\
P & 0 & 4 & 0 & 0 \\
R & 1 & 0 & 19 & 0 \\
Q & 0 & 1 & 0 & 26 \\
\bottomrule
\end{tabular}
\caption{PLS-LDA confusion matrix.}
\label{tab:cmplslda}
\vskip 1cm
\begin{tabular}{r|rrrr}
\toprule
& \multicolumn{4}{c}{\textbf{Reference}} \\
\midrule
\textbf{Predicted} & H & P & R & Q \\
\midrule
H & 2 & 0 & 0 & 0 \\
P & 0 & 4 & 0 & 0 \\
R & 1 & 0 & 18 & 1 \\
Q & 0 & 1 & 1 & 25 \\
\bottomrule
\end{tabular}
\caption{LDA confusion matrix.}
\label{tab:cmlda}
\vskip 1cm
\begin{tabular}{r|rrrr}
\toprule
& \multicolumn{4}{c}{\textbf{Reference}} \\
\midrule
\textbf{Predicted} & H & P & R & Q \\
\midrule
H & 2 & 0 & 0 & 0 \\
P & 0 & 3 & 0 & 0 \\
R & 1 & 0 & 12 & 3 \\
Q & 0 & 2 & 7 & 23 \\
\bottomrule
\end{tabular}
\caption{PLS confusion matrix.}
\label{tab:cmpls}
\end{minipage}
\hfil
}}
\end{table}
\end{document}
Output:
Error:
Package floatrow Error: Caption(s) lost
Best Answer
The quickest solution is to use the
\RawFloats
command (or therawfloats
package option); for other possible solution, see the quote below:The phenomenon is explained, and solutions are provided, on page 14 of the
floatrow
package documentation: