You can create one with an assemblage of -
and \blacktriangleright
from the package amssymb, using \mathrel
and \joinrel
to handle the spacing
\newcommand*{\myrightarrow}{$\mathrel{-}\joinrel\mathrel{\blacktriangleright}$}
But the arrow head is too big. If you shrink it, a \vcenter
is needed to align the triangle on the math axis. So something like this should work
\makeatletter
\newcommand*{\myrightarrow}{%
$\mathrel{-}\joinrel\mathrel{%
\vcenter{\hbox{\fontsize{\fpeval{\f@size*0.35}}{0}$\blacktriangleright$}}
}$
}
\newcommand*{\myleftarrow}{%
$\mathrel{%
\vcenter{\hbox{\fontsize{\fpeval{\f@size*0.35}}{0}$\blacktriangleleft$}}
}\joinrel\mathrel{-}$
}
\makeatother
The current font size (given by \f@size
) is scaled by a factor 0.35
; the commands \makeatletter
and \makeatother
are needed to handle the char @
in macro names. Note that this produces warnings about not available font sizes. You can suppress them with unicode-math (LuaLaTex or XeLaTeX).
Full example:
\documentclass{article}
\usepackage{amssymb}
\usepackage{unicode-math}
\makeatletter
\newcommand*{\myarrow}{$\mathrel{-}\joinrel\mathrel{\blacktriangleright}$}
\newcommand*{\myrightarrow}{%
$\mathrel{-}\joinrel\mathrel{%
\vcenter{\hbox{\fontsize{\fpeval{\f@size*0.35}}{0}$\blacktriangleright$}}
}$
}
\newcommand*{\myleftarrow}{%
$\mathrel{%
\vcenter{\hbox{\fontsize{\fpeval{\f@size*0.35}}{0}$\blacktriangleleft$}}
}\joinrel\mathrel{-}$
}
\makeatother
\begin{document}
press "A" \myrightarrow{} "B" \myleftarrow{} "C"
{\Huge press "A" \myrightarrow{} "B" \myleftarrow{} "C"}
{\tiny press "A" \myrightarrow{} "B" \myleftarrow{} "C"}
\end{document}
By the way, TikZ also works inline:
\documentclass{article}
\usepackage{tikz}
\makeatletter
\newlength{\myarrowunit}
\newcommand{\tikzrightarrow}{%
\setlength{\myarrowunit}{\f@size pt}
\tikz[baseline, yshift={0.3\myarrowunit}]
\draw[-latex, line width={0.06\myarrowunit}]
(0,0) -- (1.5\myarrowunit,0) ;%
}
\makeatother
\begin{document}
press "A" \tikzrightarrow{} "B" \tikzrightarrow{} "C"
{\Huge press "A" \tikzrightarrow{} "B" \tikzrightarrow{} "C"}
{\tiny press "A" \tikzrightarrow{} "B" \tikzrightarrow{} "C"}
\end{document}
and also latex picture
environment:
\documentclass{article}
\usepackage{pict2e}
\makeatletter
\newcommand{\picrightarrow}{%
\setlength{\unitlength}{\f@size pt}
\begin{picture}(1.5,1)%
\linethickness{0.06\unitlength}%
\put(0,0.3){\vector(1,0){1.5}}
\end{picture}%
}
\makeatother
\begin{document}
press "A" \picrightarrow{} "B" \picrightarrow{} "C"
{\Huge press "A" \picrightarrow{} "B" \picrightarrow{} "C"}
{\tiny press "A" \picrightarrow{} "B" \picrightarrow{} "C"}
\end{document}