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...
We center text or images using \begin{center} and \end{center}. Just put \begin{center} when you want to start centering, and \end{center} when you want to stop centering.
Select the text that you want to center. in the Page Setup group, and then click the Layout tab. In the Vertical alignment box, click Center. In the Apply to box, click Selected text, and then click OK.
You can also use r to align the text to the right and l for left alignment. This will insert a horizontal line on top of the table and at the bottom too. There is no restriction on the number of times you can use \hline . Each & is a cell separator and the double-backslash \\ sets the end of this row.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With