How can I remove the space between this
\newcommand{\deref}{\ensuremath{\rightarrowtriangle}\xspace}
$b\deref\mathbf{r}_S$
such that the arrow is as closest to the two surounding characters as possible?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityPut one extra pair of braces around the arrow.
\documentclass{article}
\usepackage{stmaryrd,xspace}
\newcommand{\deref}{\ensuremath{{\rightarrowtriangle}}\xspace}
\begin{document}
$b\deref\mathbf{r}_S$
\end{document}
BTW, what is the intention of using ensuremath
and \xspace
here? It is better not to use them.
\mathrel
so adding space) in to ordinary symbol (\mathord
) which doesn't have spaces around.
\ensuremath
:). Added a note now.