Is it possible to get a path in tikz that looks like \rightsquigarrow?
Asked
Active
Viewed 1.7k times
2 Answers
23
It is possible, indeed. You can use the decorations.pathmorphing library for this, which allows very fine control over how your paths look:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\usepackage{amssymb}
\begin{document}
$\rightsquigarrow$
\tikz \draw [->,
line join=round,
decorate, decoration={
zigzag,
segment length=4,
amplitude=.9,post=lineto,
post length=2pt
}] (0,0) -- (0.3,0);
\end{document}

1
Just to add to Jake's and Caramdir's solution, here is a bit of height-adjustment based on egreg's answer here.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\usepackage{amssymb}
\newlength{\LETTERheight}
\AtBeginDocument{\settoheight{\LETTERheight}{I}}
\newcommand*{\longleadsto}[1]{\ \raisebox{0.24\LETTERheight}{\tikz \draw [->,
line join=round,
decorate, decoration={
zigzag,
segment length=4,
amplitude=.9,
post=lineto,
post length=2pt
}] (0,0) -- (#1,0);}\ }
\begin{document}
$A\leadsto A$
$A\longleadsto{0.5} A$
$A\longleadsto{1} A$
\end{document}
Marius Hofert
- 4,754
\rightsquigarrow? Currently it sits too low if I use it inline with text around it. – John Wickerson Jun 05 '14 at 12:25