我从我正在做的一个项目中得到了以下代码片段。第二段的第一行超出了右边距,而不是与右侧齐平。
其他答案建议使用连字符来解决这个问题,但我无法使用连字符,因为它是一个单音节词。我能做些什么来解决这个问题?
\documentclass[12pt]{book}
\usepackage[paperwidth=5.5in,
paperheight=8.5in,
inner=0.25in,
outer=0.5in,
bindingoffset=0.25in
]{geometry}
\usepackage{fontspec}
\setmainfont[Numbers=OldStyle]{Linux Libertine O}
\begin{document}
Now the merchant-farmer understood what all this meant, because he had overheard the talk between the Bull and the Ass, so quoth he, ``Take that rascal donkey, and set the yoke on his neck, and bind him to the plough and make him do Bull’s work.''
Thereupon the ploughman took the Ass, and worked him through the livelong day at the Bull’s task; and, when he failed for weakness, he made him eat stick till his ribs were sore and his sides were sunken and his neck was flayed by the yoke; and when he came home in the evening he could hardly drag his limbs along, either
\end{document}
答案1
一个选项是,考虑到行宽相对较大的字体,您可以将其用于\sloppy
段落:
...
{\sloppy
Thereupon the ploughman took the Ass, and worked him through the livelong day at the Bull’s task; and, when he failed for weakness, he made him eat stick till his ribs were sore and his sides were sunken and his neck was flayed by the yoke; and when he came home in the evening he could hardly drag his limbs along, either
}
% notice the white line above, \sloppy is applied when \par is found.
...
是的,这条线确实有点混乱……
如果您使用microtype
(在您的序言中添加\usepackage{microtype}
),您仍然会有一个过满的行,但它是:
Overfull \hbox (1.02644pt too wide) in paragraph at lines 16--17
这也许是可以接受的。
最后,您可以减少段落开头的缩进;例如,\parindent=14pt
使用微缩字体将修复过满的行。
%! TeX program = lualatex
\documentclass[12pt]{book}
\usepackage[paperwidth=5.5in,
paperheight=8.5in,
inner=0.25in,
outer=0.5in,
bindingoffset=0.25in
]{geometry}
\usepackage{fontspec}
\usepackage{microtype}
\parindent=14pt
\setmainfont[Numbers=OldStyle]{Linux Libertine O}
\begin{document}
Now the merchant-farmer understood what all this meant, because he had overheard the talk between the Bull and the Ass, so quoth he, ``Take that rascal donkey, and set the yoke on his neck, and bind him to the plough and make him do Bull’s work.''
Thereupon the ploughman took the Ass, and worked him through the livelong day at the Bull’s task; and, when he failed for weakness, he made him eat stick till his ribs were sore and his sides were sunken and his neck was flayed by the yoke; and when he came home in the evening he could hardly drag his limbs along, either
\end{document}