我正在使用 enumitem 包来自定义我的列表。这很好用,但是我想以一种简单的方式将图像和每个项目的计数器组合起来。我尝试了:
\begin{enumerate}[label=\thechapter.\arabic*, font=\normalfont, wide= 4pt, leftmargin=*]
\item[{\includegraphics{Bluestar.eps} \value{enumi}}] \refstepcounter{enumi} first is blue
\item[{\includegraphics{Redstar.eps} \value{enumi}}] \refstepcounter{enumi} second is red
\item[{\includegraphics{Greenstar.eps} \value{enumi}}] \refstepcounter{enumi} third is green
\end{enumerate}
但无法编译。有什么想法吗?
提前致谢,
伊利亚斯
答案1
您可以在此处选择插入图像,如下所示
\begin{enumerate}
\Item(first-image) first is blue
\Item(second-image) second is red
\Item(third-image) third is green
\end{enumerate}
插入图像的宽度为,您可以在包含项目标签的命令1cm
内进行修改。\labelenumi
\documentclass{article}
\usepackage{graphicx}
\renewcommand{\labelenumi}{\includegraphics[width=1cm]\ima~\arabic{enumi}}
\def\Item(#1){\def\ima{#1}\item}
\begin{document}
\begin{enumerate}
\Item(example-image) first is blue
\Item(example-image-a) second is red
\Item(example-image-b) third is green
\end{enumerate}
\end{document}