Is there a way to define a 90-degrees-angle pattern for (straight) lines in TikZ? a line with angles pattern

The pattern should follow the line direction.

2 Answers 2


If you don't mind white painted arrows then it is kind of easy but might need tweaking to get the spacing right.

\begin{tikzpicture}[arrow marks/.style={
    markings,pre length=2\pgflinewidth,post length=.5\pgflinewidth,
      between positions 0 and 1 step 0.2 with {
      \arrow[white,line width=1.1\pgflinewidth]{Fast Triangle}
\draw[line cap=round,line width=5mm,postaction=decorate,arrow marks] (0,0) -- (5,0);

enter image description here

Depending on your use case you can add more and more options where to start where to end what to do if there is a corner on the path etc. If you don't want it to be painted to white then you have to create the initial and the final parts of the path manually and place black parts instead.

  • Works great! But the distance between the ends of the line and the first (or last) angle is a bit too big. Is there a way to change it? Jul 9, 2015 at 12:15
  • 1
    @GeMir I was afraid that you would ask that :) We(I) need to take care of the length of the arrow and the decoration start/end distances. I'll do that in a finite time.
    – percusse
    Jul 9, 2015 at 15:25

Here's a simple Metapost approach for an arbitrary path.

curved path decorated with chevrons

You could make the decoration loop into a function if you wanted to use it often.

prologues := 3;
outputtemplate := "%j%c.eps";


z1 = origin;
z2 = (144,34);

path p; p = z1 {right} .. z2;
draw p withpen pencircle scaled 2;

% make the corners and ends squared
interim linecap := squared;
interim linejoin := mitered;
% n = number of chevrons, s=number to skip at start and end
% w = chevron width
n = 50; s=2; w=1;
for i=s upto n-s:
  undraw (left--origin--up) scaled 2 
                            rotated 45 
                            rotated angle direction i/n of p
                            shifted point i/n of p
                            withpen pencircle scaled w;


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .