1

I need to use the pointer symbol (like P->a) in math latex. If I use normal characters like hyphen and > it doesn't look good. I guess there should be a specific symbol for it in latex, but I didn't find it anywhere.

The hyphen should be connected to the edge of ">", like when you type --> in microsoft office and it changes it automatically.

Any idea?

migrated from stackoverflow.com Apr 17 '14 at 13:24

This question came from our site for professional and enthusiast programmers.

  • Welcome to TeX.sx! Your post was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. – Werner Apr 17 '14 at 14:13
3

You can create your own by joining two - and > in math mode:

enter image description here

\documentclass{article}
\makeatletter
\newcommand{\my@arrow}[1]{\ooalign{$#1-\mkern-5mu-$\cr\hidewidth$#1>$}}
\newcommand{\myarrow}{\mathrel{\mathpalette\my@arrow\relax}}
\makeatother
\begin{document}
$A \rightarrow B$ \par
$A \longrightarrow B$ \par
$A -> B$ \par
$A \myarrow B_{A \myarrow B_{A \myarrow B}}$
\end{document}

The use of \mathpalette is explained in The mysteries of \mathpalette. It's used as a helper function for \mathchoice to scale math content to the required style (size).

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.