\newlist{clause}{enumerate}{2}
\setlist[clause]{
label*=\arabic*.,
wide, labelwidth=2em, leftmargin=!
}
该wide
选项允许我删除子列表的缩进。该leftmargin
选项使我的项目主体保持左侧齐平。但该leftmargin
选项似乎否定了该wide
选项。
我想要这种效果:
1. Top-level items should be the same indentation as sub-level ones.
1.1 Sub-level item labels are not indented.
1.2 I also want all item bodies to hang properly. Like long-content-in-between
this.
梅威瑟:
\documentclass[a4paper, oneside, 12pt, parskip=half]{scrartcl}
\usepackage{enumitem, lipsum}
\newlist{clause}{enumerate}{2}
\setlist[clause]{
label*=\arabic*.,
wide, labelwidth=2em
%, leftmargin=!
}
\begin{document}
\begin{clause}
\item Top-level
\begin{clause}
\item \lipsum[1]
\item \lipsum[2]
\end{clause}
\end{clause}
\end{document}
接受@Bernard 的答案:
% No indents for clauses. Save space.
\newlist{clause}{enumerate}{2}
\setlist[clause] {
label*=\arabic*.,
wide, labelwidth=2em,
leftmargin=!
}
\setlist[clause, 2]{
align = left, leftmargin=0pt
}
答案1
您必须对 1 级和 2 级列表使用不同的配置:
\documentclass[a4paper, oneside, 12pt, parskip=half]{scrartcl}
\usepackage[showframe]{geometry}
\usepackage{enumitem, lipsum}
\newlist{clause}{enumerate}{2}
\setlist[clause, 1]{
label*=\arabic*.,
wide, labelwidth=2em,
leftmargin=!
}
\setlist[clause, 2]{
label*=\arabic*.,
labelwidth=2em, align = left,
leftmargin=0pt
}
\begin{document}
\begin{clause}
\item Top-level
\begin{clause}
\item \lipsum[1]
\item \lipsum[2]
\end{clause}
\end{clause}
\end{document}