16

I want to align text with the center of a large image in LaTeX. Unfortunately, the text some text is aligned with the bottom of the image:

\begin{tabular}{cc}
    some text & \includegraphics{image_name.eps}
\end{tabular}

I've found a website that recommends using m{width of the cell} instead of c for that column in the table, but it hasn't worked.

\begin{tabular}{m{1in}c}
    some text & \includegraphics{image_name.eps}
\end{tabular}

I'm sure a latex pro would look at this and know what to do! Which implies that I cannot be a LaTeX pro until you teach me...

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
user
  • 7,123
  • 7
  • 48
  • 90

1 Answers1

15

You can use minipages to align your text with the image:

\begin{minipage}[c]{0.25\textwidth}
Text comes here
\end{minipage}
\begin{minipage}[c]{0.25\textwidth}
\includegraphics{image_name.eps}
\end{minipage}

It´s not really a table, and you must specify the width of the minipages, but it may work for you.

Emilio Silva
  • 1,942
  • 14
  • 17
  • 1
    Ah, good thinking! I found that using minipage to wrap images within a tabular makes everything work fine! – user Mar 24 '11 at 07:54
  • 1
    Thanks @Emilio. Just a note: personally here I had to additionally specify `[width=\textwidth]` on the `\includegraphics` command to make it actually fit the size of the minipage. – Campa May 30 '14 at 10:08