Take the 2-minute tour ×

Let's say I have a sentence like: "I will be at the beach from 4 to 7 this afternoon." and I want to add breakable spaces to prevent numbers from being isolated. So far, no problem, I could write something like: I will be at the beach from~4~to~7 this afternoon.

Now what if I'd like to say that I'd rather have a non-breakable space between 4 and to, but it's ok to remove it on emergency stretch if it doesn't fit then.

Is there a way to use "preferred" non-breakable spaces that will be honored only if there is no overfull lines?

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

It may not be exactly what you want, but try

\newcommand{\almostnonbreakablespace}{\leavevmode\penalty 9999 \space}

share|improve this answer
That works, thank you. –  ℝaphink Jul 18 '11 at 13:13
add comment

Your Answer


