
Я хочу выровнять по вертикали фигуру внутри среды itemize. MWE:
\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\begin{document}
I want the bullet vertically aligned with the picture
\begin{itemize}
\item \includegraphics[scale=0.1]{paris.jpg}
\item \includegraphics[scale=0.1]{paris.jpg}
\end{itemize}
\end{document}
чей выход:
Но пуля находится внизу рисунка. Как мне центрировать слева от рисунка?
решение1
Ознакомьтесь с valign
вариантом из adjustbox
пакета:
\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\usepackage[export]{adjustbox}
\begin{document}
I want the bullet vertically aligned with the picture
\begin{itemize}
\item \includegraphics[valign=c]{example-image-duck}
\item \includegraphics[valign=c]{example-image-duck}
\end{itemize}
\end{document}
решение2
Вы можете использовать \hbox
внутри \vcenter
. Поместите его в макрос для удобства использования.
\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\newcommand{\igcenter}[2][1]{$\vcenter{\hbox{\includegraphics[scale=#1]{#2}}}$}
\begin{document}
I want the bullet vertically aligned with the picture
\begin{itemize}
\item \igcenter[0.1]{example-image-a}
\item \igcenter[0.1]{example-image-b}
\end{itemize}
\end{document}