在TeXbook第14章的末尾,有一个宏叫做\signed
:
\def\signed #1 (#2){{\unskip\nobreak\hfil\penalty50
\hskip2em\hbox{}\nobreak\hfil\sl#1\/ \rm(#2)
\parfillskip=0pt \finalhyphendemerits=0 \par}}
用于在审稿结尾添加审稿人的姓名和地址。 用于\finalhyphendemerits=0
防止 TeX 偏向于使用两个结尾行而不是一个结尾行。
我对这里的功能仍然感到困惑\finalhyphendemerits
。设置\finalhyphendemerits
是否总是有助于在最后一行留出更多空白?
有人可以提供更多解释吗(最好举例说明)?
答案1
其实就是这么简单:如果倒数第二行以连字符结尾,则会增加额外的惩罚。
左边是\finalhyphendemerits=0
,右边是默认的5000
。
\hsize=2.9in
\finalhyphendemerits=0
But I must explain to you how all this mistaken idea of denouncing
pleasure and praising pain was born and I will give you a complete
account of the system.
\bye
按主题引用 TeX
\finalhyphendemerits
当段落倒数第二行以连字符结尾时,将增加惩罚。Plain TEX 默认值:5000。
请注意,TeXbook 中写道:
如果可行的话,通常会优先选择单线解决方案。
设置\finalhyphendemerits=0
使得倒数第二行更加紧凑,给最后一行留出更多空间,从而使单行版本更容易出现。
答案2
在普通段落中,如果最后一行较短,倒数第二行的连字符会作为右边距的最后一个字符出现,而其下方只有空白。 通常会阻止这种情况发生\finalhyphendemerits
。
此处,最后一行的空白不适用,因为最后一行始终与页边距齐平,如所添加的额外示例所示。更糟糕的是,如果您强制换行以避免连字符出现在倒数第二行,则可能会产生与预期效果相反的效果,并强制在连字符下方留有空白,如这里所示(如果重复示例而不将其设置\finalhyphendemerits
为零)。
\def\signed #1 (#2){{\unskip\nobreak\hfil\penalty50\hskip2em
\hbox{}\nobreak\hfil\sl#1\/ \rm(#2)
\parfillskip=0pt \finalhyphendemerits=0 \endgraf}}
\hbox{\vrule
\vbox{\hsize 3.6in \parindent0pt
This is a case where the name and address fit in nicely with the review.
\signed A. Reviewer (Ann Arbor, Mich.)
\medskip
But sometimes an extra line must be added. \signed N. Bourbaki (Paris)
\medskip
This is a case where the name and address fit most excellently with the review.
\signed A. Reviewer (Ann Arbor, Mich.)
}\vrule}
\bigskip
\def\signed #1 (#2){{\unskip\nobreak\hfil\penalty50\hskip2em
\hbox{}\nobreak\hfil\sl#1\/ \rm(#2)
\parfillskip=0pt \endgraf}}
\hbox{\vrule
\vbox{\hsize 3.6in \parindent0pt
This is a case where the name and address fit in nicely with the review.
\signed A. Reviewer (Ann Arbor, Mich.)
\medskip
But sometimes an extra line must be added. \signed N. Bourbaki (Paris)
\medskip
This is a case where the name and address fit most excellently with the review.
\signed A. Reviewer (Ann Arbor, Mich.)
}\vrule}
\bye