Does anyone know how to draw a line which looks like \mapsto by using \draw[...]... in TikZ?
Asked
Active
Viewed 1,795 times
2
Stefan Kottwitz
- 231,401
SoftTimur
- 19,767
-
2-1: Doesn't show any effort. I don't know any TikZ, but I don't think this should be too hard. (If something about it were hard, the specific problem could've been articulated.) We don't want "please do this for me" questions. – doncherry Sep 03 '11 at 20:55
1 Answers
7
This uses the solution from How to make an arrow bigger and change its color in TikZ? to adjust the size of the arrow.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\begin{document}
\[a \mapsto b\]
\begin{tikzpicture}
\draw [red, |->, decoration={markings,mark=at position 1 with {\arrow[scale=1.7,red]{>}}},
postaction={decorate},
shorten >=0.4pt
] (0,0) node [black,left] {$a$} -- (0.4,0) node [black,right] {$b$};
\end{tikzpicture}
\end{document}

Peter Grill
- 223,288