
答案1
如果您不記得adjustbox
,另一種解決方案可以將圖像放入表格中(tabular
僅包含單一單元格),或 a\parbox,
或 a minipage
。如果您想要精細控制垂直對齊(即不完全在垂直中心)可能值得使用\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}
答案2
使用adjustbox
它的valign=c
選項:
\documentclass{article}
\usepackage[export]{adjustbox}
\begin{document}
Left text
\includegraphics[height=50pt,valign=c]{example-image}
Right text
\end{document}