LaTex enumitem - 按级别控制项目的对齐

LaTex enumitem - 按级别控制项目的对齐

我正在使用 enumitem 包来处理具有 6 个级别且已具有以下设置的文档:

\usepackage[shortlabels]{enumitem}
\setlistdepth{6}
\setlist[enumerate,1]{label=\Alph*.}
\setlist[enumerate,2]{label=\arabic*.}
\setlist[enumerate,3]{label=\alph*.}
\setlist[enumerate,4]{label=(\arabic*)}
\setlist[enumerate,5]{label=(\alph*)}
\setlist[enumerate,6]{label=(\roman*)}
\renewlist{enumerate}{enumerate}{6}
\setlist[enumerate]{align=left, itemsep=1pt, parsep=3pt, topsep=1pt}

这实际上是按预期工作的 - 直到我达到第 5 级。此时,项目缩进不足,因此项目标签将项目段落的第一行推到比段落缩进更靠右的位置,导致段落无法充分环绕,如下所示: 样本

请注意,间距对于 6. a. (1) 来说是没问题的,但是当它到达 (a)、(b) 以及 (i) 和 (ii) 时,(a) 的项目缩进不足。这导致换行不充分。在 (b) 中,您还可以看到这导致 (i) 标签错位,然后该项目级别也会出现与项目缩进相同的问题。

什么是适当的设置,以确保项目缩进对于(a)和(i)级别(在本例中为级别 5 和 6)具有适当的长度?

请注意,我在文档中看到了这一点: enumitem 文档

但是当我尝试将 itemindent=! 添加到 \setlist 中(我还在其中设置了对齐方式、topsep 等)时,它没有任何变化。我确认我拥有最新版本的 enumitem,因为文档说这个 itemindent=! 选项是版本 3.0 中的新选项。

这是一个完整的工作示例:

\documentclass[letterpaper]{article}
\usepackage[
      height=9in,      % height of the text block
      width=7in,       % width of the text block
      top=78pt,        % distance of the text block from the top of the page
      headheight=36pt, % height for the header block
      headsep=12pt,    % distance from the header block to the text block
      heightrounded   % ensure an integer number of lines
      %,showframe       % show the main blocks
      ]{geometry}
\usepackage{enumerate}
\usepackage[default,scale=.9]{opensans}

\usepackage[shortlabels]{enumitem}
\setlistdepth{6}
\setlist[enumerate,1]{label=\Alph*.}
\setlist[enumerate,2]{label=\arabic*.}
\setlist[enumerate,3]{label=\alph*.}
\setlist[enumerate,4]{label=(\arabic*)}
\setlist[enumerate,5]{label=(\alph*)}
\setlist[enumerate,6]{label=(\roman*)}
\renewlist{enumerate}{enumerate}{6}
\setlist[enumerate]{align=left, itemsep=1pt, parsep=3pt, topsep=1pt, itemindent=!}

\begin{document}

\begin{enumerate}
\item Terms and Conditions

    \begin{enumerate}
    \item Vacancy Condition

        \begin{enumerate}
        \item \textbf{Description of Terms}

              \begin{enumerate}
              \item As used in this Vacancy Condition, the term building and the
                term vacant have the meanings set forth in (1)(a) and (1)(b)
                below:

                    \begin{enumerate}
                    \item When this policy is issued to a tenant, and with respect to
                      that tenant's interest in Covered Property, building means the
                      unit or suite rented or leased to the tenant. Such building is
                      vacant when it does not contain enough business personal
                      property to conduct customary operations.

                    \item When this policy is issued to the owner or general lessee of a
                      building, building means the entire building. Such building is
                      vacant unless at least 31\% of its total square footage is:

                          \begin{enumerate}
                          \item Rented to a lessee or sub-lessee and used by the lessee or
                            sub-lessee to conduct its customary operations; and/or

                          \item Used by the building owner to conduct customary operations.
                          \end{enumerate}

                    \end{enumerate}

              \end{enumerate}

        \end{enumerate}

    \end{enumerate}

\end{enumerate}

\end{document}

答案1

我添加了规范leftmargin=*。这更符合您的要求吗?

\documentclass[letterpaper]{article}
\usepackage[
      height=9in, % height of the text block
      width=7in, % width of the text block
      top=78pt, % distance of the text block from the top of the page
      headheight=36pt, % height for the header block
      headsep=12pt, % distance from the header block to the text block
      heightrounded % ensure an integer number of lines
      %,showframe % show the main blocks
      ]{geometry}
\usepackage{enumerate}
%\usepackage[default,scale=.9]{opensans}

\usepackage[shortlabels]{enumitem}
\setlistdepth{6}
\setlist[enumerate,1]{label=\Alph*.}
\setlist[enumerate,2]{label=\arabic*.}
\setlist[enumerate,3]{label=\alph*.}
\setlist[enumerate,4]{label=(\arabic*)}
\setlist[enumerate,5]{label=(\alph*)}
\setlist[enumerate,6]{label=(\roman*)}
\renewlist{enumerate}{enumerate}{6}
\setlist[enumerate]{align=left, itemsep=1pt, parsep=3pt, topsep=1pt, itemindent=!, leftmargin=*}

\begin{document}
\sffamily
\begin{enumerate}
\item Terms and Conditions

    \begin{enumerate}
    \item Vacancy Condition

        \begin{enumerate}
        \item \textbf{Description of Terms}

              \begin{enumerate}
              \item As used in this Vacancy Condition, the term building and the
                term vacant have the meanings set forth in (1)(a) and (1)(b)
                below:

                    \begin{enumerate}
                    \item When this policy is issued to a tenant, and with respect to
                      that tenant's interest in Covered Property, building means the
                      unit or suite rented or leased to the tenant. Such building is
                      vacant when it does not contain enough business personal
                      property to conduct customary operations.

                    \item When this policy is issued to the owner or general lessee of a
                      building, building means the entire building. Such building is
                      vacant unless at least 31\% of its total square footage is:

                          \begin{enumerate}
                          \item Rented to a lessee or sub-lessee and used by the lessee or
                            sub-lessee to conduct its customary operations; and/or

                          \item Used by the building owner to conduct customary operations.
                          \end{enumerate}

                    \end{enumerate}

              \end{enumerate}

        \end{enumerate}

    \end{enumerate}

\end{enumerate}

\end{document} 

在此处输入图片描述

相关内容