I'd like to create something similar to what is give below: text on either side of a vertically centred image:
2 Answers
If you do not remember adjustbox
, another solutions could be put the image in a table (tabular
with a singe cell only), or a \parbox,
or a minipage
. If you want a fine control of the vertical align (i.e, not exactly in the vertical center) may be worth use a \vbox
:
\documentclass{article}
\usepackage{graphicx}
\parskip2em
\begin{document}
Left text%
\begin{tabular}{c}
\includegraphics[width=2cm]{example-image}\\
\end{tabular}%
Right text\par
Left text
\parbox{2cm}{\includegraphics[width=\linewidth]{example-image}}
Right text\par
Left text \vbox to .83cm{\hbox{\includegraphics[width=2cm]{example-image}}}
Right text\par
Left text \vbox to 1.2cm{\hbox{\includegraphics[width=2cm]{example-image}}}
Right text
\end{document}
Use adjustbox
and it's valign=c
option:
\documentclass{article}
\usepackage[export]{adjustbox}
\begin{document}
Left text
\includegraphics[height=50pt,valign=c]{example-image}
Right text
\end{document}
-
Thank you LaTeX is very interesting and automated by coding. @Werner. Commented Apr 29, 2017 at 5:10