我正在尝试使用 \looseness=-1 修复最终布局中的一些孤立行(惩罚已经达到 9999)。但是,这不会导致文本布局发生任何变化。我尝试增加容差,但我不确定是否在正确的位置这样做:
\tolerance=1000 \looseness=-1 As can be seen in ...
我的段落相对较短。我是否对它期望过高,例如删除 11 行段落中的最后 4 个字母的单词?我是否需要以不同的方式指定 \tolerance?或者我使用的模板中是否有可能存在阻止它的情况?(https://www.latextemplates.com/template/masters-doctoral-thesis(我做了一些修改,但原始模板也存在这个问题)
编译是在 Windows 上进行的,如果有区别的话,使用 TexMaker 进行快速 F1 编译。
答案1
这一切都取决于文本:
(1)是默认设置,即 11 行段落,最后一行只有一个四个字母的单词。该设置相当宽松,并且有很多短词,因此词间有很多空间,而您建议的宽松设置会产生(2),将其压缩为 10 行,最后一行末尾仍然有一些空间。
(3)是类似的文本,但单词更长,默认设置更紧密,但仍然有 11 行,以四个字母的单词结尾。
您建议的设置会产生(4)其中段落实际上是宽松最后一行有更多空间和两个单词(或至少一个半单词)。这实际上是更改容差后连字符选择的效果,宽松本身在这里没有效果,正如 (5) 所示,它只更改了该设置。但是,如果您真的允许单词间空间缩小,则需要为 TeX 提供实现该设置的工具\looseness
,因此 (6) 再次将文本设置为 10 行(非常紧凑)。
\documentclass{article}
\parskip=5pt
\addtolength\textheight{12\baselineskip}
\pagestyle{empty}
\begin{document}
\vspace*{-11\baselineskip}
\def\test{One two three four red. Blue yellow apple orange elephant football,
tiger, penguin, cricket green. Five six seven nineteen twenty.
One two three four red. Blue yellow apple orange elephant football,
tiger, penguin, cricket green. Five six seven nineteen twenty.
One two three four red. Blue yellow apple orange elephant football,
tiger, penguin, cricket green. Five six seven nineteen twenty.
One two three four red. Blue yellow apple orange elephant football,
tiger, penguin, cricket green. Five six seven nineteen twenty.
One two three four red. Blue yellow apple orange elephant football,
tiger, penguin, cricket green. Five six seven nineteen twenty.
One two three four red. Blue yellow apple orange elephant football,
tiger, penguin, cricket green. Five six seven four.\par}
\def\testb{Onetwo threefour red.Blue yellowapple orangeelephant football,
tiger, penguin, cricketgreen. Fivesix sevennineteen twenty.
Onetwo threefour red.Blue yellowapple orangeelephant football,
tiger, penguin, cricketgreen. Fivesix sevennineteen twenty.
Onetwo threefour red.Blue yellowapple orangeelephant football,
tiger, penguin, cricketgreen. Fivesix sevennineteen twenty.
Onetwo threefour red.Blue yellowapple orangeelephant football,
tiger, penguin, cricketgreen. Fivesix sevennineteen twenty.
Onetwo threefour red.Blue yellowapple orangeelephant football,
tiger, penguin, cricketgreen. Fivesix sevennineteen twenty.
One\-two threefour red.Blue yellowapple orangeelephant football,
tiger, penguin, cricketgreen. Fivesix sevenfour.
some text to restore eleven lines: more complicated word.\par}
1 \test
{\tolerance=1000 \looseness=-1 2 \test }
3 \testb
{\tolerance=1000 \looseness=-1 4 \testb }
{\looseness=-1 5 \testb }
{\looseness=-1 6 \spaceskip= 2pt plus 1pt minus 1.5pt \spaceskip= 3pt plus 2pt minus 2pt \testb }
\end{document}