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 simple example that works fine

\documentclass[a4paper,12pt,oneside,titlepage]{report}
\usepackage{tikz}
\usetikzlibrary{snakes}

\begin{document}
    \begin{figure}[H]   
        \begin{tikzpicture}[line width = 1pt]               
            \draw[fill = black!100] {[snake] (0, 0)circle[radius=2pt] -- (2, 0)circle[radius=2pt]} -- (7, 0)circle[radius=2pt] -- (9, 0)circle[radius=2pt];             
        \end{tikzpicture}
        \caption{time-line.}
        \label{fig:cus}
    \end{figure}
\end{document}

I noticed in output that :

Package tikz Warning: Snakes have been superseded by decorations. Please use th
e decoration libraries instead of the snakes library on input line 14.

If I change my code to

\documentclass[a4paper,12pt,oneside,titlepage]{report}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}

\begin{document}
    \begin{figure}[H]   
        \begin{tikzpicture}[line width = 1pt]               
            \draw[fill = black!100] {[decorate,decoration=snake] (0, 0)circle[radius=2pt] -- (2, 0)circle[radius=2pt]} -- (7, 0)circle[radius=2pt] -- (9, 0)circle[radius=2pt];             
        \end{tikzpicture}
        \caption{time-line.}
        \label{fig:cus}
    \end{figure}
\end{document}

it does not draw the "snake" as in the first example. How to replace snakes library for tikz package with decorations correctly?

share|improve this question
    
I'm sorry, i did not know about this feature –  Oleksandr Sep 2 '12 at 15:20
    
No problem; now you know about it. Thank you for accepting answers. –  Gonzalo Medina Sep 3 '12 at 4:01

1 Answer 1

up vote 4 down vote accepted
\documentclass{report}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}

\begin{document}

\begin{figure}[H]   
\begin{tikzpicture}[line width = 1pt]               
\draw[fill = black!100] circle[radius=2pt] decorate [decoration={snake}]
 {(0, 0) -- (2, 0)} circle[radius=2pt] -- (7, 0) circle[radius=2pt] -- (9, 0) circle[radius=2pt];             
\end{tikzpicture}
\caption{time-line.}
\label{fig:cus}
\end{figure}

\end{document}

enter image description here

share|improve this answer
    
A good answer. Just a detail: in this example the (0,0) coordinates (a moveto operation) are useless. –  Paul Gaborit Sep 2 '12 at 17:12

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.