1

If I want to prevent a line break between two words, then I insert a ~ like this:

Lorem~impsum.

But what if I want to prevent a line break between the end of a sentence and the first word of the new sentence. If I do it like this

Lorem ipsum.~Dolor sit amet.

then the spacing is not correct after the full stop. I can think of

Lorem \mbox{ipsum. Dolor} sit amet.

but this would prevent Dolor from breaking into two lines if necessary. What other options do I have?

1
  • 3
    zzz.\nolinebreak\space This Aug 18, 2021 at 14:54

1 Answer 1

4

You can use \nolinebreak to add a penalty to prevent breaking at that point.

enter image description here

\documentclass{article}

\begin{document}

\setlength\xspaceskip{25pt}% for effect

1 Lorem ipsum.~Dolor sit amet.

2 Lorem ipsum. Dolor sit amet.

3 Lorem ipsum.\nolinebreak\space Dolor sit amet.


\vrule\parbox{2.7cm}{%
1 Lorem ipsum.~Dolor sit amet.

2 Lorem ipsum. Dolor sit amet.

3 Lorem ipsum.\nolinebreak\space Dolor sit amet.
}\vrule


\end{document}

You must log in to answer this question.

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