[Tex/LaTex] Controlling the amplitude of the snake function in TikZ

decorationstikz-pgf

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

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\begin{document}

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

\end{document}

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?

Best Answer

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.

Related Question