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.

2 Answers

I would draw the path multiple times with different styles and clip it to the rectangles of the current medium so everything outside is removed. This is easier than to calculate the points where the path is crossing the media. However, this might also be an option and can be done with the intersections library.

share|improve this answer
add comment

Here is a quick way to draw the dotted points, using decorations for randomizing and dotting (the dotted option doesn't seem to work well with random steps). Play around with the various values to see which yield the best effect.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing,decorations.markings}

\begin{document}
\begin{tikzpicture}
    \path[
        decoration={random steps, segment length=0.4mm,amplitude=0.3mm},
        decorate,
        postaction={
            decoration={
            markings,
            mark=
                between positions 0 and 1 step 1mm
                with
                {\fill (0,0) circle (0.7pt);}
            }
            ,decorate
        }
        ] (0,0) -- (3,0);
\end{tikzpicture}
\end{document}

result

share|improve this answer
add comment

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.