我想以类似于这张照片的方式装饰一个角度的标记(取自这个问题):
从这个答案我可以构建这个:
\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}
这看起来是一个好的开始,但是:
我不知道如何将装饰标记增加一倍或三倍。
例如,如果我仅将“位置”数字从 0.5 更改为 0.6,那么,尽管我期望装饰的位置会发生变化,但我得到的却是双倍的装饰,但我不知道为什么(而且它不再居中,所以显然不可能控制加倍):
注意:我arrows.meta
也装了东西以便用这些箭头尝试一些东西,但没有得到任何令人满意的东西。
答案1
我认为你不需要任何箭。
\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}
编辑:添加了三条线。