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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
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