
答え1
を覚えていない場合はadjustbox
、別の解決策として、画像をテーブル(tabular
セルが 1 つだけ)に配置するか、\parbox,
または を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}