I have been using TikZ with some success, but I can't figure out why the following code doesn't produce anything:


    \draw[decorate, decoration=snake, segment length=5mm, amplitude=15mm] (0,0) -- (10,10);


except the following error

Latex Error: ./untitled.tex:7 Package pgfkeys Error: I do not know the key '/tikz/amplitude' and I am going to ignore it. Perhaps you misspelled it.

Were I to remove the amplitude option, this would compile. I just tried installing the very latest pgf-TikZ package, but that didn't change anything (the update went well, other features are working correctly). This leads me to believe that this option is somehow outdated, but I can't find anything to remedy this.

Does anyone know how to control the 'snake' amplitude in the latest TikZ package?


You are missing a pair of braces. The line should be written as

\draw[decorate, decoration={snake, segment length=5mm, amplitude=15mm}] (0,0) -- (10,10);

amplitude is an option to decoration and not to \path, therefore the braces.

  • What do you know. It works! :) Do I feel silly. Those brackets don't seem to be needed until I add that third argument. Strange? – Jóhann Nov 12 '10 at 2:01
  • It is indeed strange that segment length can be given outside the grouping (amplitude can't even if it is the only argument). Maybe a bug for segment length. – Caramdir Nov 12 '10 at 2:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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