TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I find:

\draw [->,decorate,decoration=snake] (0,0) -- (2,0);

in TikZ manual, but dose not work! How can i draw snake edges in automata using tikz?

share|improve this question
Did you load the appropriate \tikzlibrary? – azetina Aug 26 '12 at 18:59
Can you please add your full document starting from \documentclass{..... \emd{document} into your question? – percusse Aug 26 '12 at 19:03
@percusse Well for some reason or the other, it does not compile on my computer if I do not load \usetikzlibrary{decorations.pathmorphing}. – azetina Aug 26 '12 at 19:08
@azetina You are right I was loading pgfplots and somehow it goes through. – percusse Aug 26 '12 at 19:17
up vote 11 down vote accepted

The following code compiles:

%\usepackage{pgfplots} %% Using pgfplots package alone works as well.


\draw [->,decorate,decoration=snake] (0,0) -- (2,0);


This yields the output in the manual.

enter image description here

But as the manual suggests,

\draw [->,decorate,decoration={snake,amplitude=.4mm,segment length=2mm,post length=1mm}]
(0,0) -- (3,0);

yields a better output as follows:

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.