![相同的错误会导致 TeX 中同一个句子中的空格不同吗?](https://linux22.com/image/470846/%E7%9B%B8%E5%90%8C%E7%9A%84%E9%94%99%E8%AF%AF%E4%BC%9A%E5%AF%BC%E8%87%B4%20TeX%20%E4%B8%AD%E5%90%8C%E4%B8%80%E4%B8%AA%E5%8F%A5%E5%AD%90%E4%B8%AD%E7%9A%84%E7%A9%BA%E6%A0%BC%E4%B8%8D%E5%90%8C%E5%90%97%EF%BC%9F.png)
答案1
它有助于查看源代码
\begindisplay \hbadness10000
\hbox spread-.666667em{The badness of this line is 100.}&
\quad(very tight)\cr
\hbox spread-.333333em{The badness of this line is 12.}&
\quad(somewhat tight)\cr
\hbox{The badness of this line is 0.}&
\quad(perfect)\cr
\hbox spread.5em{The badness of this line is 12.}&
\quad(somewhat loose)\cr
%\hbox spread 1em{The badness of this line is 100.}&
% \quad(loose)\cr % then "looser"
\hbox spread 1.259921em{The badness of this line is 200.}&
\quad(loose)\cr
%\hbox spread 1.713em{The badness of this line is 500.}&
% \quad(bad)\cr % then "worse"
\hbox spread 2.155em{The badness of this line is 1000.}&
\quad(bad)\cr
\hbox spread 3.684em{The badness of this line is 5000.}& % actually 4995!
\quad(awful)\cr
\enddisplay
Knuth 分别根据公式进行了计算,并手动计算了 badness。可以使用\badness
,它始终保留最后构建的框的 badness。
\hbadness10000
\leavevmode\hbox spread-.666667em{The badness of this line is 100.}\quad\the\badness
\leavevmode\hbox spread-.333333em{The badness of this line is 12.}\quad\the\badness
\leavevmode\hbox{The badness of this line is 0.}\quad\the\badness
\leavevmode\hbox spread.5em{The badness of this line is 12.}\quad\the\badness
\leavevmode\hbox spread 1.259921em{The badness of this line is 200.}\quad\the\badness
\leavevmode\hbox spread 2.155em{The badness of this line is 1000.}\quad\the\badness
\leavevmode\hbox spread 3.684em{The badness of this line is 5000.}\quad\the\badness % actually 4995!
\bye
实际上,第一行打印的是 1000000 而不是预测值 100,但原因不同:100000 是一个无法通过公式获得的特殊值,用于表示过满的盒子(您可以在第 12 章的最后读到它)。
坏度是衡量单词间空间需要拉伸或收缩多少的指标。它始终为非负值。
请注意如何通过指令实现拉伸或收缩spread
。