請考慮以下這段在完全對齊(justified)文字中相當糟糕的換行:

你可以看到它被截斷了,或者至少右側有多餘的空間。這是因為我在這個範例中關閉了字距調整(letter spacing)。沒有更好的換行位置(就本討論而言),因此沒有地方可以插入額外空間,結果我們得到了一個未滿盒(under full box)。但誰會這樣做呢?他們肯定會開啟字距調整。所以讓我們開啟一點點:0.5%:

噁心。這遠超過 0.5% 的最大拉伸。發生了什麼事?嗯,XeTeX 需要決定如何處理像這樣非常糟糕的換行。事實上,它有一個特殊的處理過程,相當於對換行器說:你每行有多餘的 1in(預設透過 \emergencystretch=1in 設定),所以如果你能基於此進行對齊,就儘管去做。而 0.5% 恰好增加了足夠的字間距,使我們不需要多餘的 1in 空間。現在這行文字被展開,所有那些緊急拉伸(emergency stretch)都分佈在所有那些拉伸中,無論我們可能設定的任何最大值為何,字間距看起來超級寬且分散。
這是我們能做到的最好結果嗎?那些處理較短「詞」且不必應對缺乏詞間換行的人有福了。感謝的是,這段文字標記了換行點(wordbreaks),這些換行點會被轉換為 ZWSP。ZWSP 被定義為佔用字間距,所以我們可以耍點小聰明,在保持 ZWSP 的字間距的同時關閉字距調整。我們透過添加以下行來做到這一點:
```
\def\intercharspace{\leavevmode\nobreak\hskip\intercharskip}
```
到我們的 ptxprint-mods.tex(因為關閉字距調整會將 job .tex 檔案中的該行註解掉)。現在,如果我們再次關閉字距調整,我們會得到什麼?

嗯,沒好多少,但至少文字是按詞而非字素叢(grapheme clusters)斷開的。這可能好也可能不好。但沒有完美的解決方案。這取決於如何將壞事做到最好。
歡迎留言,只要別說:那就別在那裡換行!(這當然是正確的解決方案,但考慮到我們擁有的時間,並不總是可行的)
Consider this rather ghastly line in some fully justified text:

You can see how it has been truncated, or at least there is extra space to the right. This is because I have turned off letter spacing for this example. There is no better line break (for the purposes of this discussion) and so there is nowhere to insert extra space and so we get an under full box. But who would do this. Surely they would turn on letter spacing. So let's turn on a tiny amount: 0.5%:

Yuk. That's way more than 0.5% maximum stretch. What's going on? Well XeTeX needs to decide what to do about spacing a really bad break like this. In fact it has a special pass that in effect says to the line breaker: you have an extra 1in per line (set via \emergencystretch=1in by default) so if you can justify based on that, go for it. And 0.5% adds just enough intercharacter space to get us under needing 1in extra space. Now the line is spread out and all that emergency stretch is distributed among all those stretches, regardless of any maximum we might have set on the stretch, and the intercharacter space looks super wide and spread out.
Is this the best we can do? Consider yourselves blessed all those who work with shorter 'words' and don't have to deal with lack of interword breaks. Thankfully this text is marked with wordbreaks which are turned into ZWSP. ZWSP is defined as taking the intercharacter spacing, so we can be sneaky and turn of letter spacing while still keeping the intercharacter space for ZWSP. We do this by adding the line:
```
\def\intercharspace{\leavevmode\nobreak\hskip\intercharskip}
```
to our ptxprint-mods.tex (since turning off letter spaces comments it out from the job .tex file). Now what do we get if we turn off letter spacing again?

Hmm not much better but at least the text is broken on words rather than grapheme clusters. This may or may not be preferable. But there is no nice solution. This is about making the best of a bad job.
Comments welcome so long as you don't say: don't break there then! (Which of course is the right solution, but may not always be available given the time we have)
機器翻譯自 English