[Tex/LaTex] Table and figure side-by-side with independent captions

captionsfloatspositioning

Looking to put a table and a figure side by side so that the table and figure have their own captions. A crude sketch

 ------------              -----------------
    TABLE 
  | a |  b |                     FIGURE
  | c |  d |
 ------------             
Table 2: Caption           -----------------
                           Figure 7: Caption

The closest I've gotten is:

\begin{table}%
\centering
\parbox{0.4\textwidth}{
\begin{footnotesize}
\begin{tabular}{| l | r |} \hline
some & table\\
\end{tabular}
\end{footnotesize}
\caption{Table}
\label{tab:table}
}
\qquad
\begin{minipage}[c]{0.53\textwidth}%
\centering
    \includegraphics[width=1\textwidth]{awesome}
\caption{Figure}
\label{fig:figure}
\end{minipage}
\end{table}

But that gives two Table X: Caption captions. I didn't find anything in subfig.

Help?

Best Answer

Use a floatrow environment of the package of the same name.

\documentclass{article}

\usepackage{floatrow}
% Table float box with bottom caption, box width adjusted to content
\newfloatcommand{capbtabbox}{table}[][\FBwidth]

\usepackage{blindtext}

\begin{document}

\blindtext

\begin{figure}
\begin{floatrow}
\ffigbox{%
  \rule{3cm}{3cm}%
}{%
  \caption{A figure}%
}
\capbtabbox{%
  \begin{tabular}{cc} \hline
  Author & Title \\ \hline
  Knuth & The \TeX book \\
  Lamport & \LaTeX \\ \hline
  \end{tabular}
}{%
  \caption{A table}%
}
\end{floatrow}
\end{figure}

\end{document}

enter image description here