11

I understand that the package stmaryrd has a shorter version of the \rightarrow, \shortrightarrow, I wonder if there's a short version of the diagonal arrows (e.g. \searrow) and if not, if there's an easy way to draw my own?

9

You can rotate the short right arrow; however, due to a quirk in the font, rotation needs to artificially increase the height of the symbol. The picture shows its bounding box; the black blob shows that the arrow stem is on the math axis, so to get symmetric placement one needs to double the height.

\documentclass{article}
\usepackage{amsmath,stmaryrd,graphicx}

\makeatletter
\newcommand{\fixed@sra}{$\vrule height 2\fontdimen22\textfont2 width 0pt\shortrightarrow$}
\newcommand{\shortarrow}[1]{%
  \mathrel{\text{\rotatebox[origin=c]{\numexpr#1*45}{\fixed@sra}}}
}
\makeatother
\begin{document}

$a\shortrightarrow a$ % the base symbol

% the following is just to show the bounding box
{\vrule width 4pt height \fontdimen22\textfont2 \fboxsep=0pt\fbox{$\shortrightarrow$}}

% The usage example
$
a\shortarrow{0}
a\shortarrow{1}
a\shortarrow{2}
a\shortarrow{3}
a\shortarrow{4}
a\shortarrow{5}
a\shortarrow{6}
a\shortarrow{7}
a
$
\end{document}

enter image description here

5

Using tikz (fingers crossed)

\documentclass{minimal}
\usepackage{tikz}
\usepackage{mathtools}
\newcommand{\myarrow}[1][-45]{%
  \mathrel{%
    \text{$
     \begin{tikzpicture}[baseline = -0.5ex]
       \node[inner sep=0pt,outer sep=0pt,rotate = #1] (a) at (0,0)  {$\xrightarrow{}$};
    \end{tikzpicture}
    $}%
  }%
}%

\begin{document}
\[
A \myarrow T_{A \myarrow T_{A \myarrow T}} 
\]
\[
A \myarrow[45] T_{A \myarrow[45] T_{A \myarrow[45] T}}
\]
\[
A \myarrow[135] T_{A \myarrow[135] T_{A \myarrow[135] T}}
\]
\[
A \myarrow[-135] T_{A \myarrow[-135] T_{A \myarrow[-135] T}}
\]

\end{document}

enter image description here

I am not sure about the vertical placement. For this [baseline = -0.5ex] may be adjusted.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.