TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.