为什么不自动插入 \leftskip 粘连?

为什么不自动插入 \leftskip 粘连?

TeXbook 说(第 100 页):

TeX 有两个参数称为\leftskip和,\rightskip它们指定在段落中每一行的左边和右边插入粘连...

考虑这个例子:

\hsize=1pt
\hfuzz=10000pt
\noindent
\leftskip=0pt
\hskip0pt
supercalifragilisticexpialidocious
\bye

我的问题是为什么“\leftskip”没有出现在跟踪中,而“\rightskip”却存在,即使它没有明确指定。

以下是该示例跟踪的一个片段:

..\tenrm o
..\tenrm -
..\glue(\rightskip) 0.0
.\penalty 250
.\glue(\baselineskip) 5.24405
.\hbox(6.75595+0.0)x1.0
..\tenrm c
..\tenrm i
..\tenrm o
..\tenrm u
..\tenrm s
..\penalty 10000
..\glue(\parfillskip) 0.0 plus 1.0fil
..\glue(\rightskip) 0.0
.\glue 0.0 plus 1.0fill
\glue(\baselineskip) 17.54861
\hbox(6.45139+0.0)x1.0, glue set - 2.00002fil
.\glue 0.0 plus 1.0fil minus 1.0fil
.\tenrm 1
.\glue 0.0 plus 1.0fil minus 1.0fil
prevdepth ignored

答案1

在这种情况下\leftskip,条件

if left_skip<>zero_glue then

在 中写为tex.web,而在 的情况下\rightskip,不存在这样的条件。因此,\leftskip如果 是 ,则不会显示和插入zero_glue,而\rightskip即使 是 ,也会显示和插入zero_glue。请参阅 egreg 的评论。

对于正负分量的影响,请参见下一个示例的结果:

\nopagenumbers
{%
\rightskip=4cm\leftskip=4cm\noindent
This is a test. This is a test. This is a test. This is a test.
This is a test. This is a test. This is a test. This is a test.
This is a test. This is a test. This is a test. This is a test.
This is a test. This is a test. This is a test. This is a test.
This is a test. This is a test. This is a test. This is a test.\par
}

{%
\rightskip=4cm plus 2cm minus 3cm\leftskip=4cm\noindent
This is a test. This is a test. This is a test. This is a test.
This is a test. This is a test. This is a test. This is a test.
This is a test. This is a test. This is a test. This is a test.
This is a test. This is a test. This is a test. This is a test.
This is a test. This is a test. This is a test. This is a test.\par
}

{%
\rightskip=4cm plus 2cm minus 3cm\leftskip=4cm plus 2cm minus 3cm
\parindent=0cm \parfillskip=0cm
This is a different test. This is a different test. This is a different test.
This is a different test. This is a different test. This is a different test.
This is a different test. This is a different test. This is a different test.
This is a different test. This is a different test. This is a different test.\par
}
\bye

编辑:第三段说明了 LaTeX 命令 的等效内容 \centering,左右两侧的拉伸和收缩分量相等。为了保持对称,这还要求段落的开头 ( \parindent) 和结尾 ( ) 处均无跳跃。\parfillskip

相关内容