Совместить фигуру с маркером

Совместить фигуру с маркером

Я хочу выровнять по вертикали фигуру внутри среды 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}

Связанный контент