如 MWE 所示,在环境中使用\tex_par:D
而不是会导致意外的副作用。这是预期的行为吗?如果是这样,它可能会破坏很多代码。我在尝试在KOMA-Script 环境中使用 的当前版本(使用 版本)时遇到了这个问题,在这种情况下,使用相同列表技巧的任何其他环境都会被破坏。\par
list
lipsum
expl3
addmargin
\documentclass{article}
\usepackage{xparse}
\ExplSyntaxOn
\NewDocumentCommand{\mypar} {} {\tex_par:D}
\ExplSyntaxOff
\begin{document}
\noindent\hrulefill
\begin{list}{}{
\setlength{\leftmargin}{2cm}
\setlength{\rightmargin}{2cm}
}
\item Here's a paragraph with enough text that we can see where the line wraps.
Here's another paragraph after a traditional paragraph break. This is fine.
Now we'll end this one with the expl3 version to see what happens next.\mypar
And here's a forth to see where we are. The left and right margins are now disregarded.\par
And they don't come back.
\end{list}
\end{document}
输出结果如下: