9

In a paper, I need to use the abbreviated form of Figure as in "see Fig. 2". To avoid line breaks between Fig. and the number itself, I place a ~ in between. However in that case, the inserted space is way too much and a \, looks a lot better.

So the question is, how can I protect the Figure expressions from line breaks but also reduce the space to \,?

2
  • It all depends on how you realize the construction. A MWE is needed.
    – egreg
    Sep 16, 2013 at 7:27
  • My previous comment was wrong, sorry. Sep 16, 2013 at 8:39

1 Answer 1

17

\, is defined as

\DeclareRobustCommand{\,}{%
   \relax\ifmmode\mskip\thinmuskip\else\thinspace\fi
}
\def\thinspace{\kern .16667em }

Thus it is basically a \kern. It is not followed by glue, therefore there is no line break caused by \, in:

see~Fig.\,2

A fast test:

\documentclass{article}
\begin{document}
  \parbox{0pt}{%
    \hspace{0pt}% allow hyphenation for the first word
    see~Fig.\,2
  }
\end{document}

As expected, there is an overfull \hbox warning:

Overfull \hbox (38.80566pt too wide) in paragraph at lines 9--9
\OT1/cmr/m/n/10 see Fig.2 

And the line is unbroken:

Result

7
  • 1
    Note that \, can bite: a user wanted to add it in front of words (I don't really know why); if that word was at the beginning of a paragraph, the kern was added as a vertical space, because of how \kern works. In this case it's safe, though, because it will always be preceded by a character.
    – egreg
    Sep 16, 2013 at 9:17
  • Wow, thanks for the detailed explanation clearing my foggy understanding of TeX's internals.
    – matthias
    Sep 16, 2013 at 9:37
  • @egreg -- the \kern at the beginning of a paragraph detects that it's in vertical mode, and that's how the kern is applied. like \hbox in that location, it doesn't switch into horizontal, but remains in vertical mode, usually causing the user to scratch his/her head in (at least momentary) confusion. Sep 16, 2013 at 12:24
  • @barbarabeeton Yes, that's the problem. I thought it worthy mentioning. The definition of \thinspace should include \leavevmode, as it's documented as a text command.
    – egreg
    Sep 16, 2013 at 12:30
  • @egreg: I am afraid that is one of the many issues that will never been fixed in frozen LaTeX2e. Sep 16, 2013 at 12:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .