1

So I have the following snippet from a project I'm working on. The first line of the second paragraph extends beyond the right hand margin rather than being flush with the right side.

Other answers suggest hyphenation to solve this, but I can't hyphenate it as it is a single syllable word. Is there anything I can do to sort this out?

\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 Answer 1

3

One option, given the relatively big font for the line width, you can use \sloppy for the paragraph:

...

{\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.
...

enter image description here

The line is effectively a bit sloppy, yes...

If you use microtype (add \usepackage{microtype} in your preamble), you still have an overfull line, but it's:

Overfull \hbox (1.02644pt too wide) in paragraph at lines 16--17

which maybe it's acceptable.

enter image description here

Finally, you can reduce the indentation at the start of the paragraphs; for example \parindent=14pt with microtype will fix the overfull line.

%! 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}

enter image description here

5
  • oh you'd already suggested microtype, I'll delete:-) Commented Oct 11, 2022 at 10:28
  • 1
    @DavidCarlisle no need to delete... and sloppypar it's better than {\sloppy \par}, really...
    – Rmano
    Commented Oct 11, 2022 at 10:29
  • mine doesn't add anything, it's gone:-) Commented Oct 11, 2022 at 10:30
  • Thanks. I'll probably use the \sloppy command. It doesn't look as bad as having a single line stand out, and reducing the indent may work for this, but the problem could still arise for another line.
    – JRCSalter
    Commented Oct 11, 2022 at 10:38
  • 1
    After researching the command a bit, I've also come across \emergencystretch, which I think is preferable. I've set it to 3em in my preamble, and it's fixed this issue throughout the document.
    – JRCSalter
    Commented Oct 11, 2022 at 10:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .