How do you vertically center text with an image in a LaTeX table?
21,558
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.
Author by
user
Updated on January 15, 2020Comments
-
user over 4 years
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 ofc
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...
-
user about 13 yearsAh, good thinking! I found that using minipage to wrap images within a tabular makes everything work fine!
-
Campa about 10 yearsThanks @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.