[Tex/LaTex] put a ~ before \ref or \cite


My question is in the title of this post, but extends to other referencing commands like \eqref, \citep, \citet (and the like) as well.

Best Answer

The ~ is a non-breaking space, (not really a symbol) so when you write in your text Table~\ref{mytable} it ensures that the Table part is kept together with the number. This is generally considered to be good for readability.

So that you don't forget, it's often helpful to make macros for references like these:


Then you use \tabref{mytable} and \figref{myfig} in your text.

The refstyle package provides a generalised interface to automatically construct macros like those above.

The cleveref package with its \cref command is even more powerful, since it figures out what type of object your reference refers to and generates the correct text automatically (so you don't need different \ref commands for different reference types.)

If you are independently using the hyperref package, it also provides an \autoref command that works like cleveref's \cref command (and also makes the hyperlink target larger.)

Related Question