When invoking RefTeX to generate LaTeX code for a reference (to an equation, figure) I need a short unbreakable space (LaTeX: \,
) when the abbreviation is used (Eq.\,\ref{}, Fig.\,\ref{}
) and a long space (~
) when the full word is used (Equation~\ref{}, Figure~\ref{}
). I thought I understood the reftex-label-alist
and added to my init.el
:
(add-to-list 'reftex-label-alist '("equation" ?e "eq:" "~\\ref{%s}" t (regexp "equations?")))
(add-to-list 'reftex-label-alist '("eq" ?e "eq:" "\\,\\ref{%s}" t (regexp "eqs?\\." "eqn\\.")))
i.e. the first line matching "equation(s)" and the second matching "eq(s)", but this always results in a short space. Is there a way to do this, or am I asking for something impossible?