为什么不遵守 enumitem 的 setlist 设置?

为什么不遵守 enumitem 的 setlist 设置?

在测试文件中,当我包含命令时,项目编号的缩进量大于默认值,并且项目文本出现在换行符上的同一列中,与第一行相同

\setlist[enumerate,1] {labelindent=\parindent, leftmargin=3\parindent}

在包含相同集合列表的较大文件中,项目编号未缩进,项目文本的第二行未与第一行的文本对齐。如果没有集合列表,项目中的换行行会与第一行正确对齐,但标签缩进不够。问题似乎是 \abstract 和 \setlist 之间的干扰。

\usepackage{enumitem}

\setlist[enumerate,1] {labelindent=\parindent, leftmargin=3\parindent}

\begin{enumerate}
\item ordinal used as the limit of a sequence of consecutive ordinals,
e.g., $x_\alpha, \alpha \preceq Alpha$
\item ordinal used as the order type of a sequence of consecutive ordinals,
e.g., $x_\alpha, \alpha \prec Alpha$
\end{enumerate}

答案1

也许这就是你想要的?顺便说一句,数学字母表中没有“0”,\Alpha因为它与“。”相同A

\documentclass[12pt]{article}
\usepackage[showframe]{geometry}
\usepackage{enumitem}
\usepackage{amssymb}
\setlist[enumerate,1] {wide=\parindent, leftmargin=3\parindent, itemindent=0pt, labelsep=*}

\begin{document}

In a larger file, the item number is not indented and the second line of the item text is not aligned with the text of the first line.

\begin{enumerate}
  \item ordinal used as the limit of a sequence of consecutive ordinals,
        e.g., $x_\alpha, α\preceq A$ blah blah blah.
  \item ordinal used as the order type of a sequence of consecutive ordinals,
        e.g., $x_\alpha, α ≺ A$ blah blah blah.
\end{enumerate}

\end{document} 

在此处输入图片描述

答案2

这只是部分答案,但有一个可行的解决方法。经过一些实验,我将问题缩小到 \abstract 和 \parindent 之间的交互。如果 \setlist 位于 \abstract 之前,则使用 \parindent 的 \setlist 可以正常工作,而使用显式长度而不是 n\parlist 的 \setlist 即使在 \abstract 之后也可以正常工作。以下代码显示了错误和解决方法。

\documentclass[12pt]{article}
\usepackage[showframe]{geometry}
\usepackage{enumitem}
\usepackage{amssymb}

\begin{document}
\setlist[enumerate,1] {wide=\parindent, leftmargin=3\parindent, itemindent=0pt, labelsep=*}
Test with setlist before abstract

\begin{enumerate}
  \item ordinal used as the limit of a sequence of consecutive ordiinals,
        e.g., $x_\alpha, \alpha \preceq A$ blah blah blah.
  \item ordinal used as the order type of a sequence of consecutive ordinals,
        e.g., $x_\alpha, \alpha \prec A$ blah blah blah.
\end{enumerate}
\abstract{Test abstract interaction with setlist}
\section{Test abstract interaction with setlist}
\setlist[enumerate,1] { leftmargin=3\parindent, itemindent=0pt, labelindent=!, labelsep=*}

In a file with abstract, the item number is not indented and the second
line of the item text is not aligned with the text of the first line.
Test with setlist after abstract

Dummy paragraph, to show pararagraph indent.

\begin{enumerate}
  \item ordinal used as the limit of a sequence of consecutive ordiinals,
        e.g., $x_\alpha, \alpha \preceq A$ blah blah blah.
  \item ordinal used as the order type of a sequence of consecutive ordiinals,
        e.g., $x_\alpha, \alpha \prec A$ blah blah blah.
\end{enumerate}

Test without reference to parindent

\setlist[enumerate,1] { leftmargin=5em,        itemindent=0pt, labelindent=3em , labelsep=*}
\begin{enumerate}
  \item ordinal used as the limit of a sequence of consecutive ordiinals,
        e.g., $x_\alpha, \alpha \preceq A$ blah blah blah.
  \item ordinal used as the order type of a sequence of consecutive ordiinals,
        e.g., $x_\alpha, \alpha \prec A$ blah blah blah.
\end{enumerate}

\end{document}

答案3

我的印象是 \abstract{foo} 相当于

\begin{abstract}
foo
\end{foo}

显然不是。如果我将文档更改为使用 begin/end 对而不是 \abstract,则 enumitem 会按预期工作。

相关内容