3

Using the cleveref package for reference ranges, I'd like to change the standard \crefrangeconjunction from _to~ to _-_, where the underscores represent spaces. Issuing

\newcommand{\crefrangeconjunction}{~-~}

I find the spaces are much too large. Defining instead

\newcommand{\crefrangeconjunction}{\,-\,}

is more compact and looks much better in my eyes but has the disadvantage of breaking at line ends.

Is there an unbreakable space smaller than ~?

Janosh
  • 4,042

1 Answers1

5

It's - that's causing the break, not \,.

\documentclass{article}

\newcommand{\unbreakablethinspace}{\leavevmode\,}

\begin{document}

\parbox{0pt}{
  a\unbreakablethinspace-\unbreakablethinspace b

  a\unbreakablethinspace\mbox{-}\unbreakablethinspace b
}

\end{document}

Hiding - in a box disallows the possibility of breaking at it.

I defined \unbreakablethinspace because \, might give surprises if used at the beginning of a paragraph. You can simply use \, if you're sure it will always go after a word.

enter image description here

egreg
  • 1,121,712