Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.