Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm not a LaTeX expert, and I want to align a table and a figure side by side, with a common caption; the table and the figure should be aligned to the bottom, too.

I tried this:

\begin{figure}
  \begin{minipage}[b]{0.60\linewidth}
    \centering
    \rule{6cm}{6cm} %to simulate an actual figure
  \end{minipage}
  \begin{minipage}[b]{0.30\linewidth}
    \centering
\begin{tabular}{ |l|l|l| }
  \hline
  \multicolumn{3}{|c|}{Zzzzzz} \\
  \hline \hline
  A & B &  C \\ \hline
  0 & 0 &  0\\ \hline
  0 & 1 &  0\\ \hline
  1 & 0 &  0\\ \hline
  1 & 1 &  1\\ \hline%
\end{tabular}
\end{minipage}
\caption{Bla bla}
\label{fig:test}
\end{figure}

But the result is:

*********
*********
*********
*********   Zzzzz
*********   0 0 0
*********   0 0 1
            0 1 0
            0 1 1
            1 1 1

 Figure 1: Bla bla

The table and the figure are not bottom-aligned. I read other answers on tex.stackexchange, but I didn't find a way to fix it.

share|improve this question
    
What should the caption common to the two environments look like? E.g., do you want it to like Figure and Table x: <Saption text>, where x is the current value of the counter associated with the figureandtable environment? –  Mico Mar 26 '13 at 10:35
    
@Mico: no, I need only to reference the figure ( Figure X: bla bla) –  Marzio De Biasi Mar 26 '13 at 11:29
    
Nobody has given you the formal welcome yet. So Welcome to TeX.sx! –  hpesoj626 Mar 26 '13 at 12:57
    
@hpesoj626: thanks! :) –  Marzio De Biasi Mar 26 '13 at 13:19
add comment

2 Answers 2

up vote 2 down vote accepted

enter image description here

Pass the b option to your tabular environment, too. BTW, Please consider always adding a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. I have converted your code snippet into a MWE here.

\documentclass[10pt]{article}

\begin{document}
\begin{figure}
  \begin{minipage}[b]{0.60\linewidth}
    \centering
    %\includegraphics[width=\linewidth]{example-image}
    \rule{6cm}{6cm} %to simulate an actual figure
  \end{minipage}%
  \begin{minipage}[b]{0.30\linewidth}
    \centering
\begin{tabular}[b]{ |l|l|l| }
  \hline
  \multicolumn{3}{|c|}{Zzzzzz} \\
  \hline \hline
  A & B &  C \\ \hline
  0 & 0 &  0\\ \hline
  0 & 1 &  0\\ \hline
  1 & 0 &  0\\ \hline
  1 & 1 &  1\\ \hline%
\end{tabular}
\end{minipage}
\caption{Bla bla}
\label{fig:test}
\end{figure}
\end{document}
share|improve this answer
add comment

Similarly to Aligning a figure and table side by side where the alignment is on top, you need a little trick here:

\documentclass[a4paper,10pt]{article}

\begin{document}
\begin{figure}
  \begin{minipage}[b]{0.60\linewidth}
    \centering
    \rule{6cm}{6cm} %to simulate an actual figure
    \par\vspace{0pt}
  \end{minipage}%
  \begin{minipage}[b]{0.30\linewidth}
    \centering%
    \begin{tabular}{ |l|l|l| }%
      \hline%
      \multicolumn{3}{|c|}{Zzzzzz} \\%
      \hline \hline
      A & B &  C \\ \hline%
      0 & 0 &  0\\ \hline%
      0 & 1 &  0\\ \hline%
      1 & 0 &  0\\ \hline%
      1 & 1 &  1\\ \hline%
    \end{tabular}%
    \par\vspace{0pt}
  \end{minipage}
\caption{Bla bla}
\label{fig:test}
\end{figure}
\end{document}

Notice the \par\vspace{0pt} at the end of the minipages. The trick is taken from epslatex.pdf, Section 11.4.1, where the misinterpretation of the [b] parameter of minipages is explained.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.