在下面的代码中,我设置了 1 级描述列表
\documentclass{article}
\usepackage{enumitem}
\begin{document}
\setlist[description,1]{leftmargin=2.8cm,labelindent=-0.25cm,labelsep*=1cm,style=multiline}
\begin{description}
\item[tt] tttt \\
\item[ttttt]
\begin{enumerate}
\item this separation is too large
\item this separation is too large
\item this separation is too large
\item this separation is too large
\end{enumerate}
\end{description}
\end{document}
它给
您可以看到,对于枚举列表而言,标签和项目之间的间隔太大。为什么?我只设置了 1 级描述列表。如何保护内部列表不受外部列表设置的影响?
答案1
为了防止嵌套列表重叠,嵌套列表的所有参数都必须相对于left margin
上级列表的。您可以使用wide
enummitem 选项并固定的值来避免这种情况labelsep
:
\documentclass{article}
\usepackage{enumitem}
\usepackage[showframe]{geometry}
\begin{document}
\setlist[description,1]{leftmargin=2.8cm,labelindent=-0.25cm,labelsep*=1cm,style=multiline}
\begin{description}
\item[tt] tttt \\Blah blah blah
\item[ttttt]
\begin{enumerate}[wide=0pt, leftmargin=*, labelsep =0.5em] %
\item this separation is too large. this separation is too large. this separation is too large. this separation is too large. this separation is too large. this separation is too large. this separation is too large. this separation is too large.
\item this separation is too large
\item this separation is too large
\item this separation is too large
\end{enumerate}
\end{description}
\end{document} [![enter image description here][1]][1]