如何将枚举标签左对齐到左边距?

如何将枚举标签左对齐到左边距?

我想将编号与左边距对齐,即与非缩进的普通段落文本对齐,而不是让它超出左边距。

以下是一个例子:

\documentclass{article}
\usepackage{enumitem}
\setlist{leftmargin=15pt,labelindent=15pt}
\setlist[enumerate]{align=left}

\begin{document}
\noindent Some text
\begin{enumerate}
\item Some more text
\item Some more text
\item Some more text
\item Some more text
\item Some more text
\item Some more text
\item Some more text
\item Some more text
\item Some more text
\item Some more text
\end{enumerate}
\end{document} 

enter image description here

编辑

这更接近:

\documentclass{article}
\setlength{\parindent}{15pt} % Default is 15pt.
\usepackage{enumitem}
\setlist{leftmargin=15pt,labelindent=15pt}
\setlist[enumerate]{wide=0pt, leftmargin=15pt, labelwidth=15pt, align=left}

\begin{document}
Some text\\
\noindent Some text
\begin{enumerate}
\item Some more text
\item Some more text
\item Some more text
\item Some more text
\item Some more text
\item Some more text
\item Some more text
\item Some more text
\item Some more text
\item Some more text
\end{enumerate}
\end{document}

enter image description here

但不幸的是,项目中的文本缩进大于15pt,通过与缩进的普通文本进行比较可以看出。

答案1

使用wide=选项:它会自动align=left设置labelindent

\setlist[enumerate]{wide=0pt, widest=99,leftmargin=\parindent, labelsep=*}

enter image description here

答案2

它在这里:但请注意,它labelsep是由嵌套列表继承的。

\documentclass{article}
\usepackage{enumitem,showframe}

\begin{document}
Some text
\begin{enumerate}[leftmargin=\parindent,align=left,labelwidth=\parindent,labelsep=0pt]
\item Some more text
\item Some more text
\item Some more text
\item Some more text
\item Some more text
\item Some more text
\item Some more text
\item Some more text
\item Some more text
\item Some more text
\end{enumerate}
\end{document}

enter image description here

相关内容