I'm trying typeset a table next to a figure using subfig
, but I cannot get them to align properly. I have found a similar(/identical) question here, but the solutions/suggestions do not seem to be applicable in my case as (a) I am using a fully-updated TeX Live 2013 distribution; and (b) I do not make use of the hyperref
package.
Since the journal I am preparing this document for kind of forces subfig
onto me, I would rather solve this without having to resort to using a different subfloat package.
The issue:
And a MWE:
\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}
\begin{document}
\begin{figure}
\centering
\subfloat[Figure]{\rule{4cm}{4cm}\label{subfig:black-hole}}%
\qquad
\subfloat[Table]{%
\begin{tabular}{cc}
\hline
C1 & C2 \\ \hline
A & A \\
B & B \\
C & C \\
D & D \\
E & E \\
F & F \\ \hline
\end{tabular}
\label{subtbl:the-table}
}
\caption{Figure and table.}
\label{fig:figure-and-table}
\end{figure}
\noindent Look at Figure~\ref{fig:figure-and-table}; it includes both a figure (Figure~\ref{subfig:black-hole}) and a table (Table~\ref{subtbl:the-table}).
\end{document}
Edit:
Just to elaborate on my own silliness: I had already tried [b]
but I didn't realise that it actually helped. On the top is what I got and on the bottom is what I thought I should get:
Figure Table
---------
| |
| |
y| |
| | C1 C2
| | -----
--------- A B
x -----
(a) (b) <- The subcaptions
---------
| |
| |
y| | C1 C2
| | -----
| | A B
--------- -----
x
(a) (b) <- The subcaptions
So I thought that the bottom of the table would be aligned with the x axis instead of the x label, which I assume is impossible without some manual work. I'll just keep looking for a way to do that and ask again if I'm lost. :-)
Best Answer
Use the option
[b]
to align the table.and the result is