3

I would like to decorate an angle's mark in a similar way as in this picture (taken from this question):

enter image description here

From this answer I could build this:

enter image description here

\documentclass[a4paper,12pt]{article}

\usepackage{tikz}
\usetikzlibrary{arrows,angles,decorations.markings,arrows.meta}

\tikzset{mydeco/.style={pic actions/.append code=\tikzset{postaction=decorate}}}

\begin{document}

\begin{tikzpicture}[>=latex, decoration={ markings, mark= at position 0.5 with {\arrow{|}} } ]

% Declare Points
\coordinate (A) at (0,0);
\coordinate (X) at (6,1);
\coordinate (Y) at (3,5);

\draw[thick] (X) -- (A) -- (Y)
pic [mydeco, draw, thick, angle radius = 0.5 cm] {angle = X--A--Y};

% Label Points
\draw (A) node[below left] {$A$};
\draw (X) node[below right] {$x$};
\draw (Y) node[above left] {$y$};

\end{tikzpicture}

\end{document}

It looks like a good start, but:

  • I cannot figure out how to double, or triple the decoration mark.

  • If I change only the "at position" number from 0.5 to 0.6, for instance, then, although I would expect the position of the decoration to change, I do get, instead, a doubled decoration but I have no idea why (plus it is not centered anymore, so it's apparently not possible to control this doubling):

enter image description here

Note: I loaded arrows.meta too in order to try things with these arrows tips, but could not get anything satisfying.

1
  • 1
    You can try \arrow{Bar[sep]Bar[sep]Bar[]} instead of \arrow{|}... Jan 18, 2018 at 15:57

1 Answer 1

3

I think you don't need any arrows.

\documentclass[a4paper,12pt]{article}

\usepackage{tikz}
\usetikzlibrary{angles,decorations.markings}

\tikzset{mydecotwo/.style={decoration={ markings, %
mark= at position 0.5 with
      with{
        \draw (-1pt,-2pt) -- (-1pt,2pt);
        \draw (1pt,-2pt) -- (1pt,2pt);
      } },
      pic actions/.append code=\tikzset{postaction=decorate}}}
\tikzset{mydecothree/.style={decoration={ markings, %
mark= at position 0.5 with
      with{
        \draw (-2pt,-2pt) -- (-2pt,2pt);
        \draw (0pt,-2pt) -- (0pt,2pt);
        \draw (2pt,-2pt) -- (2pt,2pt);
      } },
      pic actions/.append code=\tikzset{postaction=decorate}}}
\begin{document}

\begin{tikzpicture}[>=latex]

% Declare Points
\coordinate (A) at (0,0);
\coordinate (X) at (6,1);
\coordinate (Y) at (3,5);

\draw[thick] (X) -- (A) -- (Y)
pic [mydecotwo, draw, thick, angle radius = 0.5 cm] {angle = X--A--Y};

% Label Points
\draw (A) node[below left] {$A$};
\draw (X) node[below right] {$x$};
\draw (Y) node[above left] {$y$};


\coordinate (B) at (7,0);
\coordinate (U) at (9,-1);
\coordinate (V) at (10,5);

\draw[thick] (U) -- (B) -- (V)
pic [mydecothree, draw, thick, angle radius = 0.5 cm] {angle = U--B--V};

\end{tikzpicture}

\end{document}

enter image description here

EDIT: added triple line.

You must log in to answer this question.

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