I'm trying to decently put a figure right next to a table. I tried all the approaches suggested here and here. None of them worked.
The closest was the first one, but I get an error
Package floatrow Error: Caption(s) lost
at the \captionof{figure} line.
Code:
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{floatrow}
\usepackage{caption}
\begin{document}
\begin{table}
\begin{minipage}{0.45\textwidth}
% \setlength{\tabcolsep}{4pt}
% \scriptsize
\caption{Wind turbulence characteristic values.}
\begin{tabular}{| c | c | c | c | c |}
\hline
{} & $\overline{U}$ & $u(t)$ & $v(t)$ & $w(t)$ \
\hline
$\mu$ [m/s] & 49.7 & 0 & 0 & 0 \
\hline
$\sigma$ [m/s] & - & 6.34 & 4.76 & 3.17 \
\hline
L${x}$ [m] & - & 120 & 30 & 10 \
\hline
L${y}$ [m] & - & 40 & 30 & 7.5 \
\hline
L${z}$ [m] & - & 30 & 7.5 & 7.5 \
\hline
C${x}$ & - & 12 & 12 & 12 \
\hline
C${y}$ & - & 6 & 6 & 6 \
\hline
C${z}$ & - & 9 & 9 & 9 \
\hline
\end{tabular}
\end{minipage}
\hfill
\begin{minipage}{0.45\textwidth}
\includegraphics{graphs/dataset17b.pdf}
\captionof{figure}{Caption figure}
\label{fig:ravine_coeffs}
\end{minipage}
\end{table}
\end{document}
Current result:
EDIT: I'd also need to make references to both, so I'd need to put \labels.


mwe. – cabohah Mar 22 '24 at 08:40tablecannot be inside aminipageis already explained in the first sentence of the answer to the question in your first link:tableis a float. The specification of floats is to float outside the environments. Floats cannot be used inside boxes. Aminipageis a special kind of box. – cabohah Mar 22 '24 at 08:46floatrow, you should read the manual. The package provides it own environmentfloatrowand commands\ttabboxand\ffigboxto place tables and figures side by side – cabohah Mar 22 '24 at 08:50\documentclass. – mEm Mar 22 '24 at 08:53floatrowpackage and now the problem shows. Thanks for being patient! – mEm Mar 22 '24 at 09:02