tkzMarkAngle 带有中间箭头,显示错误

tkzMarkAngle 带有中间箭头,显示错误

我想用一个小箭头标记一个角度,以显示该角度的方向。我希望箭头位于弧的中间。

\documentclass[a4paper]{article} 


\usepackage{pgf,tikz,tkz-euclide,tkz-tab}
\usetikzlibrary{arrows,fit,arrows.meta,calc,intersections,through,backgrounds,snakes, decorations.text, decorations.pathmorphing,shapes.misc,positioning,shapes,shadows,tikzmark,arrows.meta,decorations.markings}
\usetkzobj{all} 

\tikzset{arrowMe/.style={postaction=decorate,decoration={markings, mark=at position .5 with {\arrow[thick]{#1}}}}}


\begin{document}
\begin{tikzpicture}
    \tkzDefPoints{4/2/O}
    \tkzDefShiftPoint[O](0:3){A}
    \tkzDefShiftPoint[O](60:3){B}
    \tkzDrawPoints[fill=black](O,A,B)
    \tkzDrawLines[add=0 and 0.2](O,A O,B)
    \tkzLabelPoints(O,A,B)
    \tkzMarkAngle[arrowMe=stealth,size=2](A,O,B)
\end{tikzpicture}
\end{document}

导致:

在此处输入图片描述

但也会给出这个错误: 在此处输入图片描述

有任何建议为什么会出现这个错误吗?

答案1

使用新版本的 tkz-euclide。您可以在此处找到新版本欧几里得 v3.01或者在 CTAN

\documentclass[a4paper]{article} 
\usepackage{tkz-euclide}
\usetikzlibrary{angles,decorations.markings}
\tikzset{arrowMe/.style={postaction=decorate,decoration={markings, mark=at position .5 with {\arrow[thick]{#1}}}}}
\begin{document}
\begin{tikzpicture}
\tkzDefPoints{4/2/O}
\tkzDefShiftPoint[O](0:3){A}
\tkzDefShiftPoint[O](60:3){B}
\tkzDrawPoints[fill=black](O,A,B)
\tkzDrawLines[add=0 and 0.2](O,A O,B)
\tkzLabelPoints(O,A,B)
 \tkzMarkAngle[mark=none,arrowMe=stealth,size=3](A,O,B)
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案2

我的法语水平不足以调试这个问题,但如果没有tkz-euclide它,就只能用一个\draw命令直接完成这个。

\documentclass[a4paper]{article} 
\usepackage{tikz}
\usetikzlibrary{angles,decorations.markings}
\tikzset{arrowMe/.style={postaction=decorate,decoration={markings, mark=at position .5 with {\arrow[thick]{#1}}}}}
\begin{document}
\begin{tikzpicture}[bullet/.style={circle,inner sep=1pt,fill}]
 \draw (4,0) -- node[pos=0.2,bullet,label=below right:$A$] (A){} (0,0)
 node[bullet,label=below left:$O$] (O) {}
 -- node[pos=0.8,bullet,label=left:$B$] (B) {} (2,4)
 pic[pic actions/.style={draw,arrowMe=stealth},angle radius=2cm] {angle=A--O--B};
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案3

感谢薛定谔的猫,我将两者结合起来得到了这个解决方案,但改变箭头的方向却没有成功。:-(

\documentclass[a4paper]{article} 
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetikzlibrary{angles,decorations.markings}
\tikzset{arrowMe/.style={postaction=decorate,decoration={markings, mark=at position .5 with {\arrow[thick]{#1}}}}}
\begin{document}
\begin{tikzpicture}
\tkzDefPoints{4/2/O}
\tkzDefShiftPoint[O](0:3){A}
\tkzDefShiftPoint[O](60:3){B}
\tkzDrawPoints[fill=black](O,A,B)
\tkzDrawLines[add=0 and 0.2](O,A O,B)
\tkzLabelPoints(O,A,B)
%\tkzMarkAngle(A,O,B)
\draw pic[pic actions/.style={draw,arrowMe=stealth},angle radius=3cm] {angle=A--O--B};
\end{tikzpicture}
\end{document}

相关内容