在下面的例子中,空间因子处处都是 1000,因此\spaceskip
绝不能使用。但是为什么如果我们将其更改为0pt
(在调用之后\raggedright
),结果会有所不同?
\hsize=2in
\raggedright
%\spaceskip0pt
once upon a time in a distant galaxy there lived\end
答案1
正如您可能怀疑的那样,空间因素在这里根本不起作用。
\spaceskip
什么时候非零这是总是用于单词间间距,除非间距因子≥2000,否则\xspaceskip
使用(如果非零也是如此)。
如果你看一下\raggedright
% plain.tex, line 647
\def\raggedright{\rightskip\z@ plus2em \spaceskip.3333em \xspaceskip.5em\relax}
因此,当你将输出重新设置为零时,输出可能会发生变化\spaceskip
。最大的区别在于,标准单词间空间具有灵活性,而\raggedright
带有\spaceskip
不灵活性。
测试文件
\hsize=2in
\raggedright
%\spaceskip0pt
\tracingoutput=1 \tracingonline=1
\showboxbreadth=\maxdimen \showboxdepth=\maxdimen
\nopagenumbers
\hrule\bigskip
once upon a time in a distant galaxy there lived\end
没有\spaceskip=0pt
Completed box being shipped out [1]
\vbox(667.20255+0.0)x144.54
.\vbox(0.0+0.0)x144.54, glue set 14.0fil
..\glue -22.5
..\hbox(8.5+0.0)x144.54, glue set 144.54fil
...\vbox(8.5+0.0)x0.0
...\glue 0.0 plus 1.0fil
..\glue 0.0 plus 1.0fil minus 1.0fil
.\vbox(643.20255+0.0)x144.54, glue set 600.31366fill
..\glue(\topskip) 9.6
..\rule(0.4+0.0)x*
..\glue 12.0 plus 4.0 minus 4.0
..\glue(\parskip) 0.0 plus 1.0
..\hbox(6.94444+1.94444)x144.54, glue set 0.4882
...\hbox(0.0+0.0)x20.0
...\tenrm o
...\tenrm n
...\tenrm c
...\tenrm e
...\glue(\spaceskip) 3.33298
...\tenrm u
...\tenrm p
...\kern0.27779
...\tenrm o
...\tenrm n
...\glue(\spaceskip) 3.33298
...\tenrm a
...\glue(\spaceskip) 3.33298
...\tenrm t
...\tenrm i
...\tenrm m
...\tenrm e
...\glue(\spaceskip) 3.33298
...\tenrm i
...\tenrm n
...\glue(\spaceskip) 3.33298
...\tenrm a
...\glue(\spaceskip) 3.33298
...\tenrm d
...\tenrm i
...\tenrm s
...\discretionary
...\tenrm -
...\glue(\rightskip) 0.0 plus 20.00003
..\penalty 400
..\glue(\baselineskip) 3.11111
..\hbox(6.94444+1.94444)x144.54, glue set 45.34639fil
...\tenrm t
...\tenrm a
...\tenrm n
...\kern-0.27779
...\tenrm t
...\glue(\spaceskip) 3.33298
...\tenrm g
...\tenrm a
...\tenrm l
...\tenrm a
...\tenrm x
...\tenrm y
...\glue(\spaceskip) 3.33298
...\tenrm t
...\tenrm h
...\tenrm e
...\tenrm r
...\tenrm e
...\glue(\spaceskip) 3.33298
...\tenrm l
...\tenrm i
...\tenrm v
...\kern-0.27779
...\tenrm e
...\tenrm d
...\penalty 10000
...\glue(\parfillskip) 0.0 plus 1.0fil
...\glue(\rightskip) 0.0 plus 20.00003
..\hbox(0.0+0.0)x144.54
..\glue 0.0 plus 1.0fill
.\glue(\baselineskip) 24.0
.\hbox(0.0+0.0)x144.54, glue set 144.54fil
..\glue 0.0 plus 1.0fil
和\spaceskip=0pt
Completed box being shipped out [1]
\vbox(667.20255+0.0)x144.54
.\vbox(0.0+0.0)x144.54, glue set 14.0fil
..\glue -22.5
..\hbox(8.5+0.0)x144.54, glue set 144.54fil
...\vbox(8.5+0.0)x0.0
...\glue 0.0 plus 1.0fil
..\glue 0.0 plus 1.0fil minus 1.0fil
.\vbox(643.20255+0.0)x144.54, glue set 600.31366fill
..\glue(\topskip) 9.6
..\rule(0.4+0.0)x*
..\glue 12.0 plus 4.0 minus 4.0
..\glue(\parskip) 0.0 plus 1.0
..\hbox(6.94444+1.94444)x144.54, glue set - 0.74403
...\hbox(0.0+0.0)x20.0
...\tenrm o
...\tenrm n
...\tenrm c
...\tenrm e
...\glue 3.33333 plus 1.66666 minus 1.11111
...\tenrm u
...\tenrm p
...\kern0.27779
...\tenrm o
...\tenrm n
...\glue 3.33333 plus 1.66666 minus 1.11111
...\tenrm a
...\glue 3.33333 plus 1.66666 minus 1.11111
...\tenrm t
...\tenrm i
...\tenrm m
...\tenrm e
...\glue 3.33333 plus 1.66666 minus 1.11111
...\tenrm i
...\tenrm n
...\glue 3.33333 plus 1.66666 minus 1.11111
...\tenrm a
...\glue 3.33333 plus 1.66666 minus 1.11111
...\tenrm d
...\tenrm i
...\tenrm s
...\tenrm t
...\tenrm a
...\tenrm n
...\kern-0.27779
...\tenrm t
...\glue(\rightskip) 0.0 plus 20.00003
..\penalty 300
..\glue(\baselineskip) 3.11111
..\hbox(6.94444+1.94444)x144.54, glue set 66.73427fil
...\tenrm g
...\tenrm a
...\tenrm l
...\tenrm a
...\tenrm x
...\tenrm y
...\glue 3.33333 plus 1.66666 minus 1.11111
...\tenrm t
...\tenrm h
...\tenrm e
...\tenrm r
...\tenrm e
...\glue 3.33333 plus 1.66666 minus 1.11111
...\tenrm l
...\tenrm i
...\tenrm v
...\kern-0.27779
...\tenrm e
...\tenrm d
...\penalty 10000
...\glue(\parfillskip) 0.0 plus 1.0fil
...\glue(\rightskip) 0.0 plus 20.00003
..\hbox(0.0+0.0)x144.54
..\glue 0.0 plus 1.0fill
.\glue(\baselineskip) 24.0
.\hbox(0.0+0.0)x144.54, glue set 144.54fil
..\glue 0.0 plus 1.0fil