\documentclass[zihao=5,twoside]{ctexart}
% \usepackage[margin=1cm]{geometry}
\usepackage[]{zhlipsum}
\NewDocumentEnvironment{hangingindent}{}
{%
\par\begingroup%
\setlength\parindent{0bp}%
\AddToHook{para/begin}[myppkg]{\hangafter1\hangindent30bp\noindent}%
}%
{\RemoveFromHook{para/begin}[myppkg]\endgroup\par}%
\begin{document}
{\par
\setlength\parindent{0bp}
\AddToHook{para/begin}[mypkg]{\hangafter1\hangindent30bp\noindent}
\zhlipsum[1]
\RemoveFromHook{para/begin}[mypkg]\par
}
\begin{hangindent}
\zhlipsum[1]
\end{hangindent}
\end{document}
报错信息:
./env.tex:21: Missing number, treated as zero.
<to be read again>
\xparse function is not expandable
l.21 \zhlipsum
[1]
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
./env.tex:21: Illegal unit of measure (pt inserted).
<to be read again>
\xparse function is not expandable
l.21 \zhlipsum
[1]
Dimensions can be in units of em, ex, in, pt, pc,
cm, mm, dd, cc, bp, or sp; but yours is a new one!
I'll assume that you meant to say pt, for printer's points.
To recover gracefully from this error, it's best to
delete the erroneous units; e.g., type `2' to delete
two letters. (See Chapter 27 of The TeXbook.)
好奇一问,此处的
hangindent=30bp
是否有什么规范和特殊含义,个人感觉hangindent=2\ccwd
似乎更合适(?)