Math Mode – How to Draw an Arrow with a Bullet on the Line

arrowsbulletsdecorationsmath-mode

Using tikzcd I can (roughly) produce what I want:

\begin{tikzcd} [column sep = small]
  a \ar[r, "\bullet" {description, inner sep=0, outer sep=0}] & b
\end{tikzcd})

yielding

arrow with bullet

However it is a) inconvenient having to open a tikzcd environment every time I want to draw this arrow, and b) for consistency reasons it would be nice if the "bullet arrow" behaves exactly like \to does. (The arrow above is slightly longer than \to for example).

It would also be nice if the solution generalizes to \xrightarrow.

Best Answer

You could also just stack a bullet over the arrows produced by \to and by \xrightarrow.

\documentclass{article}
\usepackage{amsmath}
\newcommand*{\bulletto}{\mathrel{\ooalign{\(\to\)\cr\>\(\bullet\)}}}
\newlength{\arrowlength}
\newcommand*{\xbulletto}[1]{%
    \settowidth{\arrowlength}{\(\xrightarrow{#1}\)}%
    \mathrel{\ooalign{\(\xrightarrow{#1}\)\cr\makebox[\arrowlength][c]{\(\bullet\)}}}%
}
\begin{document}
\(a \to b \quad a \xrightarrow{xyz} b\)

\(a \bulletto b \quad a \xbulletto{xyz} b\)
\end{document}