# How move tikz arrow down?

To create a "better" version of \to with Lucida Bright fonts — one with a more visible arrow tip that also will harmonize with arrows in tikzcd diagrams, I'm starting with a tikz arrow, as in the source below.

Close inspection of the greatly enlarged output will show that my \myto arrow is slightly higher than the built-in Lucida \originalto arrow.

Question: How can I lower the shaft of the \myto arrow so that its shaft will be at the same height as the original?

Related: I asked a similar question in Lower arrow within subscript. The accepted answer there defines and uses a \fix@height function that also uses a \mathchoice construction. What I don't see is how to combine the construction there with the \mathchoice construction I'm already using here, which takes account of the actual current point size.

(Everything I've tried so far manages somehow to change dimensions of the arrow.)

\documentclass{article}

\usepackage{tikz-cd}
\usetikzlibrary{arrows.meta}
\tikzcdset{every arrow/.append style = -{Stealth[scale=1]}}
\tikzcdset{arrows={line width=0.4pt}}

\usepackage{graphicx}

\usepackage[lucidasmallscale]{lucidabr}

\mathchardef\originalrightarrowchar=\numexpr\rightarrow-"3000\relax
\newcommand{\originalto}{\mathrel{\originalrightarrowchar}}

\newcommand{\basicrightarrow}{\tikz[baseline,line width=0.3pt]\draw[arrows=-{Stealth[scale=0.55]},yshift=0.625ex] (0,0) -- (0.625em,0);}
\newbox\basicrightarrowbox
\sbox\basicrightarrowbox{\mbox{\basicrightarrow}}

\newcommand{\myto}{\mathrel{%
\mathchoice
{\resizebox{!}{\the\fontdimen5\textfont2}{\usebox\basicrightarrowbox}}%
{\resizebox{!}{\the\fontdimen5\textfont2}{\usebox\basicrightarrowbox}}%
{\resizebox{!}{\the\fontdimen5\scriptfont2}{\usebox\basicrightarrowbox}}%
{\resizebox{!}{\the\fontdimen5\scriptscriptfont2}{\usebox\basicrightarrowbox}}%
}}

\newcommand{\from}{\protect\colon}

\newcommand*{\test}[1]{%
\noindent $f \from X \csname#1\endcsname Y$ \quad \texttt{\textbackslash#1}
}

\begin{document}

\test{myto}\\[2pt]\test{originalto}\\
\mbox{}\hspace{-0.425em}$% \begin{tikzcd} f\from X \arrow{r}{} & Y \end{tikzcd}$ \quad tikzcd

\end{document}


You are already using yshift so you can chaneg it to whatever value you prefer, as that changes the height you can adjust the resizebox to scale to a fraction of 1ex again choose whatever looks right. I didn't have the fonts you used but changed the values a bit to get

\documentclass{article}

\usepackage{tikz-cd}
\usetikzlibrary{arrows.meta}
\tikzcdset{every arrow/.append style = -{Stealth[scale=1]}}
\tikzcdset{arrows={line width=0.4pt}}

\usepackage{graphicx}

%\usepackage[lucidasmallscale]{lucidabr}

\mathchardef\originalrightarrowchar=\numexpr\rightarrow-"3000\relax
\newcommand{\originalto}{\mathrel{\originalrightarrowchar}}

\newcommand{\basicrightarrow}{\tikz[baseline,line width=0.3pt]\draw[arrows=-{Stealth[scale=0.55]},yshift=0.5ex] (0,0) -- (0.625em,0);}
\newbox\basicrightarrowbox
\sbox\basicrightarrowbox{\mbox{\basicrightarrow}}

\newcommand{\myto}{\mathrel{%
\mathchoice
{\resizebox{!}{.9\fontdimen5\textfont2}{\usebox\basicrightarrowbox}}%
{\resizebox{!}{.9\fontdimen5\textfont2}{\usebox\basicrightarrowbox}}%
{\resizebox{!}{.9\fontdimen5\scriptfont2}{\usebox\basicrightarrowbox}}%
{\resizebox{!}{.9\fontdimen5\scriptscriptfont2}{\usebox\basicrightarrowbox}}%
}}

\newcommand{\from}{\protect\colon}

\newcommand*{\test}[1]{%
\noindent $f \from X \csname#1\endcsname Y$ \quad \texttt{\textbackslash#1}
}

\begin{document}

\test{myto}\\[2pt]\test{originalto}\\
\mbox{}\hspace{-0.425em}$% \begin{tikzcd} f\from X \arrow{r}{} & Y \end{tikzcd}$ \quad tikzcd

\end{document}

• For the record, a factor of .8 rather than .9 with the Lucida Bright fonts lowers the tikz arrow to match the built-in one. I didn't try your method because the scale factor will apply to the width as well as the height, but the result overall looks OK to me. – murray Jul 7 '19 at 0:39