Very short arrow symbol

If you like the arrow in stmaryrd, you can clip it.

\documentclass{article}
\usepackage{stmaryrd}
\usepackage{trimclip}

\makeatletter
\DeclareRobustCommand{\shortto}{%
  \mathrel{\mathpalette\short@to\relax}%
}

\newcommand{\short@to}[2]{%
  \mkern2mu
  \clipbox{{.5\width} 0 0 0}{$\m@th#1\vphantom{+}{\shortrightarrow}$}%
  }
\makeatother

\begin{document}

$a\shortto b_{c\shortto d}$

\end{document}

enter image description here


Here is a more light-weight approach. Two macros are defined, one for normal style, the other one for script style. In the latter case the \mathrel is dropped as it would have no effect. In the former case the \mathrel causes the thing to look a bit smallish compared to surrounding whitespace.

For the script thing, the optional parameter is the desired length before the ratio to normal size is taken into account, i.e. it should be normally the same as the one used for the normal size thing.

\documentclass{article}

\newcommand{\veryshortarrow}[1][3pt]{\mathrel{%
   \hbox{\rule[\dimexpr\fontdimen22\textfont2-.2pt\relax]{#1}{.4pt}}%
   \mkern-4mu\hbox{\usefont{U}{lasy}{m}{n}\symbol{41}}}}

\makeatletter

\setbox0\hbox{$\xdef\scriptratio{\strip@pt\dimexpr
    \numexpr(\sf@size*65536)/\f@size sp}$}

\newcommand{\scriptveryshortarrow}[1][3pt]{{%
    \hbox{\rule[\scriptratio\dimexpr\fontdimen22\textfont2-.2pt\relax]
               {\scriptratio\dimexpr#1\relax}{\scriptratio\dimexpr.4pt\relax}}%
   \mkern-4mu\hbox{\let\f@size\sf@size\usefont{U}{lasy}{m}{n}\symbol{41}}}}

\makeatother

\begin{document}

\[x-a\veryshortarrow b_{c\scriptveryshortarrow d-e}-f\]
\end{document}

enter image description here

The \mkern-4mu was obtained by trial and error.

Equivalent result is obtained via this little bit shorter code which employs \vcenter:

\documentclass{article}

\newcommand{\veryshortarrow}[1][3pt]{\mathrel{%
   \vcenter{\hbox{\rule[-.2pt]{#1}{.4pt}}}%
   \mkern-4mu\hbox{\usefont{U}{lasy}{m}{n}\symbol{41}}}}

\makeatletter

\setbox0\hbox{$\xdef\scriptratio{\strip@pt\dimexpr
    \numexpr(\sf@size*65536)/\f@size sp}$}

\newcommand{\scriptveryshortarrow}[1][3pt]{{%
    \vcenter{\hbox{\rule[\scriptratio\dimexpr-.2pt\relax]
               {\scriptratio\dimexpr#1\relax}{\scriptratio\dimexpr.4pt\relax}}}%
   \mkern-4mu\hbox{\let\f@size\sf@size\usefont{U}{lasy}{m}{n}\symbol{41}}}}

\makeatother

\begin{document}

\[x-a\veryshortarrow b_{c\scriptveryshortarrow d-e}-f\]
\end{document}

The \scriptveryshortarrow could use \mathrel. The sole effect (in script style for which it is destined) would be to suppress the small space separating from alarge symbol (\sum, \prod, ...) either immediately preceding or following.

The code for \scriptveryshortarrow can be simplified if one removes the two \scriptratio which scale the rule thickness and vertical shift for centering (the one scaling the width must stay).


A perhaps better choice for the thickness of the rule (rather than .4pt as above) is to use \fontdimen8 of the extension font.

\documentclass{article}

\newcommand{\veryshortarrow}[1][3pt]{\mathrel{%
   \vcenter{\hbox{\rule[-.5\fontdimen8\textfont3]{#1}{\fontdimen8\textfont3}}}%
   \mkern-4mu\hbox{\usefont{U}{lasy}{m}{n}\symbol{41}}}}

\makeatletter

\setbox0\hbox{$\xdef\scriptratio{\strip@pt\dimexpr
    \numexpr(\sf@size*65536)/\f@size sp}$}

\newcommand{\scriptveryshortarrow}[1][3pt]{\mathrel{%
    \vcenter{\hbox{\rule[-.5\fontdimen8\scriptfont3]
               {\scriptratio\dimexpr#1\relax}{\fontdimen8\scriptfont3}}}%
   \mkern-4mu\hbox{\let\f@size\sf@size\usefont{U}{lasy}{m}{n}\symbol{41}}}}

\makeatother

\begin{document}

\[x-a\veryshortarrow b_{c\scriptveryshortarrow\frac xy}-f\]
\end{document}

enter image description here

Tags:

Scale

Arrows