Graphics, Figures & TablesVertical centering of: Figure - Text - Figure

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
steenreem
Posts: 6
Joined: Tue Apr 05, 2011 1:28 pm

Vertical centering of: Figure - Text - Figure

Post by steenreem »

Hi,

After trying solutions from other posts, I'm getting a bit desperate.

I simply want three items horizontaly next to each other but vertically centered. There are two images on the sides that have a large height, while there is an arrow in the middle that should be vertically centered.

I've tried this:

Code: Select all

\begin{figure}[H]
\centering
\includegraphics[height=2cm]{AntiSequence.eps}
\begin{minipage}[t]{2cm}
$\Longleftrightarrow$
\vspace{1cm}
\end{minipage}
\includegraphics[height=2cm]{StartEnd.eps}
\caption{Annihilation \& Production}
\label{fig:annihilation}
\end{figure}
I also tried using a tabular environment with m,p,t columns. And I tried a parbox.

Could you give me a working example? Thanks.


EDIT:
Nevermind I got this working using:

Code: Select all

\begin{figure}[H]
\centering
\begin{tabular}{m{0.5\linewidth} c m{0.3\linewidth}}
\includegraphics[height=2cm]{AntiSequence.eps} &
$\Longleftrightarrow$ &
\includegraphics[height=2cm]{StartEnd.eps}
\end{tabular}
\caption{Annihilation \& Production}
\label{fig:annihilation}
\end{figure}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Vertical centering of: Figure - Text - Figure

Post by Stefan Kottwitz »

Hi steenreem!

It's very good that you posted the solution you found yourself.

There's another approch: using \vcenter for vertical centering, such as

Code: Select all

\vcenter{\hbox{\includegraphics{filename}}}}


A remark: for posting code please use the forum code tags. I did this for you and edited your post, further I marked it as solved. Kindly do so next time, thanks.

Stefan
LaTeX.org admin
Post Reply