I have two scenarios where I use arrows with a super-scripted asterisk: math mode and tikz-cd
diagrams. I would like to be able to show such an arrow in both scenarios such that the arrows look the same, i.e., with respect to positioning of the asterisk.
Consider the below MWE. This is how I would like the arrow to look.
MWE
\documentclass{article}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz-cd}
\newcommand*\dirinfsymname{Rightarrow}
\newcommand*\directdatacolourname{PineGreen}
\newcommand*\directdatacolour{\textcolor{\directdatacolourname}}
\newcommand*\dirinfsym{\mathbin{\directdatacolour{\Rightarrow}}}
\newcommand{\pathdirinfsym}[1][]{\mathrel{
\vphantom{\dirinfsym{#1}}
\smash{\dirinfsym{#1}}
\vphantom{\to}^{\textcolor{PineGreen}{*}}}
}
\begin{document}
$a \pathdirinfsym b$
\end{document}
This outputs:
Now, consider this MWE.
MWE
\documentclass{article}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz,tikz-cd}
\usetikzlibrary{shapes,fit}
\usetikzlibrary{positioning}
\usetikzlibrary{decorations.pathmorphing}
\newcommand*\dirinfsymname{Rightarrow}
\newcommand*\directdatacolourname{PineGreen}
\newcommand*\directdatacolour{\textcolor{\directdatacolourname}}
\newcommand*\dirinfsym{\mathbin{\directdatacolour{\Rightarrow}}}
\begin{document}
\begin{tikzcd}[
column sep=small,
cells={nodes={draw=black, ellipse, anchor=center, minimum height=2em}}
]
a \arrow[\dirinfsymname, \directdatacolourname, bend left]{rrrrr}{*} & a \arrow[\dirinfsymname, \directdatacolourname]{r}{*} & a & |[draw=none]|a\vphantom{1} & a & a
\end{tikzcd}
\end{document}
This outputs:
Notice how the two arrows have the asterisk positioned in the middle of the stem. I would like the asterisk positioned in the same position as in the first diagram.
Furthermore, I would like this to work for more than just \Rightarrow
. I would like like to be able to do the same for \rightarrow
.