Take the 2-minute tour ×
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.

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?

share|improve this question

1 Answer 1

up vote 11 down vote accepted

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.

share|improve this answer
    
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

 
discard

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.