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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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.


        decoration={random steps, segment length=0.4mm,amplitude=0.3mm},
                between positions 0 and 1 step 1mm
                {\fill (0,0) circle (0.7pt);}
        ] (0,0) -- (3,0);


share|improve this answer

Your Answer


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.