Is there a way to avoid linebreaks before all numbers without explicitly using the tilde? It would be nice if it worked both for explicit numbers, as in Sample~1 as well as when a number is implied, as in Figure~\ref{fig:label}.
If not, I think I could write a macro in emacs that uses regex to find and fix all the instances of a number or \ref{} that should have a tilde.
cleverefpackage? it might be useful here (for the \ref part of your question)... – cmhughes Sep 23 '12 at 22:49cleverefseems to solve the problem, and more. As far as explicit numbers go, egreg makes some good points about cases where a linebreak before a number is fine. I think I'll use something likegrep ' [0-9]' doc.texto review these on a case by case basis, since they don't show up as often as references, at least in my writings. – Anthony Sep 24 '12 at 01:45