# How to TeX an arrow with vertical stroke?

It is really strange, but LaTeX doesn't seem to include any tag for an arrow with vertical stroke (unicode character 21F8), used in mathematics to represent a partial function between sets (as reported in this article from Wiki.en). Do you know any workaround to this? I tried something like

\newcommand{\pto}{\to\hspace{-xyz cm}\shortmid \hspace{xyz cm}}


(for different values of xyz) but the outcome is not very satisfactory. Thank you in advance for any help.

P.S.: the symbol should fit in mathematical equations.

-

You may want to use \pfun in package oz as listed in the overview here.

-
Great! I didn't know that package before, thank you too. –  s.t. Mar 7 '12 at 16:20
Small warning to any users who use this approach. When I imported the oz package to use \pfun, for some reason it replaced some of my other math symbols. For example where I had an integral using \int it was rendered as the set intersection symbol instead! I used the other solution by egreg and redefined the \pfun command myself. –  jbx Nov 29 '13 at 0:51

Here's a possible way

\newcommand\pto{\mathrel{\ooalign{\hfil$\mapstochar$\hfil\cr$\to$\cr}}}


Note that the definition of oz.sty is equivalent to

\newcommand\pfun{\mathrel{\ooalign{\hfil$\mapstochar\mkern5mu$\hfil\cr$\to$\cr}}}


so it differs from the former only by a slight shift to the left of the bar.

-
Thank you much! –  s.t. Mar 7 '12 at 16:18

With unicode-math package (requires XeTeX or LuaTeX) and a proper Unicode math font, you can access that Unicode arrow (and a gazillion of other Unicode math symbols):

\documentclass{article}
\usepackage{unicode-math}
\setmathfont{XITS Math}

\begin{document}
$\nvrightarrow$
\end{document}

-