\end{name} 环境之前的空间相关编译

\end{name} 环境之前的空间相关编译

今天我发现了一个奇怪的现象......根据以下乳胶代码第 11 行的开头,我遇到了编译问题!

\documentclass{article}

\RequirePackage{comment}
\usepackage{lipsum}

\excludecomment{test}

\begin{document}
    \begin{test}
        \lipsum[1][1]
    \end{test}
\end{document}

这里,第 11 行以制表符开头,编译没有问题。如果该行直接以 开头,也没有问题\end{test}。然而,如果第 11 行以两个空格开头,我得到了以下编译错误:

! File ended while scanning use of \next.
<inserted text>
\par
<*> test.tex
I suspect you have forgotten a `}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type `E' or `X' now and fix your file.
! Emergency stop.
<*> test.tex
*** (job aborted, no legal \end found)
Here is how much of TeX's memory you used:
639 strings out of 478994
13626 string characters out of 5858184
474122 words of memory out of 5000000
18189 multiletter control sequences out of 15000+600000
403430 words of font info for 27 fonts, out of 8000000 for 9000
1141 hyphenation exceptions out of 8191
71i,0n,75p,182b,46s stack positions out of 5000i,500n,10000p,200000b,80000s
! ==> Fatal error occurred, no output PDF file produced!

有人能解释一下这种现象吗?这与评论包的实施有关吗?

相关内容