如何在列表中使用对齐?

如何在列表中使用对齐?

眼下:

在此处输入图片描述

我想要的是:

在此处输入图片描述

以下是代码:

\begin{enumerate}[(a)]
    \item $3,6,9,12, \dots$
    \item $3,5,7,9,11, \dots$
    \item $2,3,5,7,11,13, \dots$
    \item \includegraphics[scale=1]{pattern_1.pdf}
    \item \includegraphics[scale=1]{pattern_2.pdf}
    \item \includegraphics[scale=1]{pattern_3.pdf}
    \item \includegraphics[scale=1]{pattern_4.pdf}
\end{enumerate}

谢谢。

答案1

您的问题来自于图形位于基线上的事实。解决方案使用\raisebox

\documentclass{book}
\usepackage[demo]{graphicx}

 \usepackage[shortlabels]{enumitem}

\begin{document}

\begin{enumerate}[(a)]
    \item $3,6,9,12, \dots$
    \item $3,5,7,9,11, \dots$
    \item $2,3,5,7,11,13, \dots$
    \item \raisebox{\dimexpr\ht\strutbox-\height}{\includegraphics[scale=1]{pattern_1.pdf}}
    \item \raisebox{\dimexpr\ht\strutbox-\height}{\includegraphics[scale=1]{pattern_2.pdf}}
    \item \raisebox{\dimexpr\ht\strutbox-\height}{\includegraphics[scale=1]{pattern_3.pdf}}
    \item \raisebox{\dimexpr\ht\strutbox-\height}{\includegraphics[scale=1]{pattern_4.pdf}}
\end{enumerate}

\end{document} 

在此处输入图片描述

答案2

另一个选项是添加\usepackage[export]{adjustbox},然后添加valign=t到的选项中\includegraphics

\documentclass{book}
\usepackage[demo]{graphicx}
\usepackage[shortlabels]{enumitem}
\usepackage[export]{adjustbox}


\begin{document}

\begin{enumerate}[(a)]
    \item $3,6,9,12, \dots$
    \item $3,5,7,9,11, \dots$
    \item $2,3,5,7,11,13, \dots$
    \item \includegraphics[height=8mm,valign=t]{pattern_1.pdf}
    \item \includegraphics[height=10mm,valign=t]{pattern_2.pdf}
    \item \includegraphics[height=12mm,valign=t]{pattern_3.pdf}
    \item \includegraphics[height=15mm,valign=t]{pattern_4.pdf}
\end{enumerate}

\end{document} 

在此处输入图片描述

相关内容