如何更改enumerate
列表中每个元素的开头。我有一个包含 3 个元素的列表,它们都显示为1.
2.
等。
我该如何改变它
Example 1:
Example 2:
ETC ?
谢谢你的帮助!
答案1
如果左边距的悬垂没有问题,label={Example \arabic*:}
那么这也许就是您问题的答案。
如果您一次又一次需要此列表以外的内容,请克隆该enumerate
列表并使用特殊设置:
\documentclass{article}
\usepackage{enumitem}
\usepackage{blindtext}
\newlist{examplelist}{enumerate}{1}
\setlist[examplelist,1]{label={Example \arabic*:},labelwidth={40pt},leftmargin=*}
\begin{document}
\blindtext
\begin{enumerate}[label={Example \arabic*:},labelwidth={40pt}]
\item First
\item Second
\end{enumerate}
\begin{examplelist}
\item First
\item Second
\end{examplelist}
\end{document}
看一下屏幕截图——基本的区别是leftmargin=*
!
答案2
另外三种变体:
\documentclass{article}
\usepackage{enumitem}
\usepackage{blindtext}
\begin{document}
\blindtext
\begin{enumerate}[label={Example \arabic*. },wide = 0pt, font =\itshape]
\item A first example. A first example. A first example. A first example. A first example. A first example. A first example. A first example. A first example. A first example.
\item Another example. Another example. Another example. Another example. Another example. Another example. Another example. Another example. Another example.
\end{enumerate}
\begin{enumerate}[resume*,wide =\parindent]
\item A first example. A first example. A first example. A first example. A first example. A first example. A first example. A first example. A first example. A first example.
\item Another example. Another example. Another example. Another example. Another example. Another example. Another example. Another example. Another example.
\end{enumerate}
\begin{enumerate}[resume*, leftmargin = 1.5em, font =\itshape]
\item A first example. A first example. A first example. A first example. A first example. A first example. A first example. A first example. A first example. A first example.
\item Another example. Another example. Another example. Another example. Another example. Another example. Another example. Another example. Another example.
\end{enumerate}
\end{document}