I would like to draw a squiggly line with an arrow somewhere in the middle of it. TikZ has a pathmorphing decoration that draws a squiggly line and a markings decoration to place an arrow tip. So a solution would be to use them together:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations,decorations.pathmorphing,decorations.markings}
\begin{document}
\begin{tikzpicture}
\draw[
decoration={snake},
decorate,
postaction={decoration={markings,mark=at position 0.6 with {\arrow{>}}},decorate}
]
(0,0) -- (2,0);
\end{tikzpicture}
\end{document}
Unfortunately this does not work and results in
! Dimension too large.
<to be read again>
\relax
l.11 (0,0) -- (2,0);
I suspect there is an infinite recursion going on somewhere.
Is there a workaround? If not, is there a different simple solution to the problem?
(Note: This is probably related to my previous question “Applying a postaction to every path in TikZ”)
\tracingall
on, and I got a log-file of about 6MB, wow. Does indeed look like an infinite recursion.snake
withcoil
, things are still broken; but if I instead usezigzag
,lineto
, orbent
, your code works.