How do you vertically center text with an image in a LaTeX table?

user picture user · Jan 3, 2011 · Viewed 17.9k times · Source

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...

Answer

Emilio Silva picture Emilio Silva · Jan 3, 2011

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.