未定义控制序列 \tkzDrawArc

未定义控制序列 \tkzDrawArc

我正在尝试遵循一个弧线绘制的例子tex.stackexchange问题:

\begin{tikzpicture}
    \tkzDefPoint(0,0){O}
    \tkzDefPoint(2,-2){A}
    \tkzDefPoint(60:2){B}
    \tkzDrawLines[add = 0 and .5](O,A O,B)
    \tkzDrawArc[rotate,color=red](O,A)(180)
    \tkzDrawPoints(O,A,B)
    \tkzLabelPoints[below](O,A,B)
\end{tikzpicture}

我一直收到这个错误信息

Undefined control sequence.
\tkzDrawArc
[rotate,color=red](O,A)(180)
?

我正在使用以下软件包:

\usepackage{fullpage,amsfonts,amsmath,amssymb}
\usepackage{txfonts}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usepackage[margin=0.5in]{geometry}
\usepackage{yhmath}

我错过了什么?

答案1

你可能错过了

\usetkzobj{all}

例子:

\documentclass{article}

\usepackage{tikz}
\usepackage{tkz-euclide}
\usetkzobj{all}

\begin{document}
\begin{tikzpicture}
    \tkzDefPoint(0,0){O}
    \tkzDefPoint(2,-2){A}
    \tkzDefPoint(60:2){B}
    \tkzDrawLines[add = 0 and .5](O,A O,B)
    \tkzDrawArc[rotate,color=red](O,A)(180)
    \tkzDrawPoints(O,A,B)
    \tkzLabelPoints[below](O,A,B)
\end{tikzpicture}
\end{document}

结果

相关内容