# Using Tikz arrow shapes in math mode of a article or book

I want to change the arrow in the math mode, \to, into the arrow shape drawn by the tikz package. In fact, when I want to use \to, I want to replace the following arrow

with

The arrows plotted by tikz, as all of you know, may be obtained from

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning,calc,arrows,matrix,shapes.multipart}

\begin{document}

\begin{tikzpicture}[node distance=1cm and 1.5cm,
arrow/.style={
-latex',
shorten >= 3pt,
shorten <= 3pt,
}
]

\draw[arrow]
(0,0) -- (1,0);
\end{tikzpicture}

\end{document}


It is obvious that the length of the arrow is not important and it may change.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows}

\let\oldto\to
\renewcommand\to[1][1.4em]{\tikz[baseline=-0.5ex,
shorten <=2pt, shorten >=2pt] \draw[-latex] (0,0) -- (#1,0);}
\begin{document}
$a\to b$

$a \oldto b$

\end{document}


I think it's not so simple. Try

$a \to b c_{x\to y_{z \to 0}}$


My proposal is to use the picture mode arrow as suggested by @LSGQ but using \matchoice to adapt the size, and using \mathop to obtain the correct spacing; clearly if you prefer TikZ arrows you can adapt @Zarko's solution as well.

\documentclass{article}
\usepackage{pict2e}
\usepackage{graphicx}
\let\originalto\to
\newcommand{\sizedarrow}[2]{\raisebox{#2ex}{\scalebox{#1}{\vector(1,0){1em}}}}
\newcommand{\arrowto}{\mathchoice
{\sizedarrow{1}{0.5}}%
{\sizedarrow{0.8}{0.4}}%
{\sizedarrow{0.6}{0.35}}%
{\sizedarrow{0.5}{0.3}}%
}
\renewcommand{\to}{\mathop{\arrowto}}
\begin{document}
$a \originalto b c_{x\originalto y_{z\originalto 0}}$
$a \to b c_{x\to y_{z \to 0}}$
\end{document}


If you only need horizontal arrows, you don't need to load any packages, base LaTeX is enough:

\renewcommand{\to}{\raisebox{.5ex}{\ \vector(1,0){.5cm}\ }}


(in fact, is good old pict package). You can adjust length and math spacing. Works in math mode.