对齐文本超出边距,我无法使用连字符

对齐文本超出边距,我无法使用连字符

我从我正在做的一个项目中得到了以下代码片段。第二段的第一行超出了右边距,而不是与右侧齐平。

其他答案建议使用连字符来解决这个问题,但我无法使用连字符,因为它是一个单音节词。我能做些什么来解决这个问题?

\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}

在此处输入图片描述

相关内容