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}
\linespread{1.04}
\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}