tkz_euclide:“我不知道密钥”错误

tkz_euclide:“我不知道密钥”错误

如果这是非常基础的,请原谅,但我是一个初学者。

我在 tkz-euclide 示例中收到错误:我不知道密钥/tikz/triangle和错误:我不知道密钥。/tikz/input我猜我缺少某个包或某些库,但我如何找出是哪些呢?

非常感谢

抱歉,这是代码和错误消息:

\documentclass{article}
\usepackage{tkz-euclide}

\newcommand{\comment}[1]{}  % Allows multiline comments

\begin{document}
% Does anything work?
\comment{
\begin{tikzpicture}[scale=.25] 
    \tkzDefPoints{0/0/A,12/0/B,6/12*sind(60)/C} 
    \foreach \density in {20,30,...,240}{%
        \tkzDrawPolygon[fill=teal!\density](A,B,C)
        \pgfnodealias{X}{A}
        \tkzDefPointWith[linear,K=.15](A,B) \tkzGetPoint{A}
        \tkzDefPointWith[linear,K=.15](B,C) \tkzGetPoint{B}
        \tkzDefPointWith[linear,K=.15](C,X) \tkzGetPoint{C}
    }
\end{tikzpicture}
} % Yes, it does!

% From tkz-euclide.pdf, pg17
\begin{tikzpicture}[scale=1.25,thick,help lines/.style={thin,draw=black!50}] 
    \tkzDefPoint(0,0){A}
    \tkzDefPoint(1.25+rand(),0.25+rand()){B}
    \tkzInterCC(A,B)(B,A) \tkzGetPoints{C}{X}
    \tkzFillPolygon[triangle,opacity=.5](A,B,C)
    \tkzDrawSegment[input](A,B)
    \tkzDrawSegments[red](A,C B,C)
    \tkzDrawCircles[help lines](A,B B,A)
    \tkzLabelPoints(A,B)
    \tkzLabelCircle[below=12pt](A,B)(180){$D$}
    \tkzLabelCircle[above=12pt](B,A)(180){$E$}
    \tkzLabelPoint[above,red](C){$C$}
    \tkzDrawPoints[fill=gray,opacity=.5](A,B,C)
\end{tikzpicture}
\end{document}```

And here are the errors:
Package pgfkeys Error: I do not know the key '/tikz/triangle' and I am going to ignore it. Perhaps you misspelled it. ...kzFillPolygon[triangle,opacity=.5](A,B,C)
Package pgfkeys Error: I do not know the key '/tikz/input' and I am going to ignore it. Perhaps you misspelled it. \tkzDrawSegment[input](A,B)
Package pgfkeys Error: I do not know the key '/tikz/input' and I am going to ignore it. Perhaps you misspelled it. \tkzDrawSegment[input](A,B)
Overfull \hbox (33.29065pt too wide) in paragraph

答案1

您需要定义三种样式(在 pgfmanual 中定义的颜色)并在我的源代码中。这是我的错,我应该对它们进行评论。这个想法是与 pgfmanual 示例的代码进行比较,供主要想做数学运算的用户使用。

.log 文件中指示的错误是: Package pgfkeys Error: I do not know the key '/tikz/triangle'。这是由于 管理不善而导致的错误pgfkeys。此处的tkz-euclidepgfkeys 用于管理选项和样式。我建议您查看 中如何使用样式,pgfmanual因为您可以在 中使用它们tkz-euclide

help lines不是 的选项\tkzDrawCircles。这里的选项是线条的粗细、颜色、样式(虚线或实线)(请参阅下面如何获取网格)

 \colorlet{input}{red!80!black}  
\colorlet{output}{red!70!black} 
\colorlet{triangle}{orange!40}

摘自第一卷命题 I 4.1.5 完整法典 p66

\documentclass{article}
\usepackage{tkz-euclide}

\newcommand{\comment}[1]{}  % Allows multiline comments

\colorlet{input}{red!80!black} 
\colorlet{output}{red!70!black}
\colorlet{triangle}{orange!40}  

\begin{document}

\begin{tikzpicture}[scale=1.25,thick] 
    \tkzDefPoint(0,0){A}
    \tkzDefPoint(1.25+rand(),0.25+rand()){B}
    \tkzInterCC(A,B)(B,A) \tkzGetPoints{C}{X}
    \tkzFillPolygon[triangle,opacity=.5](A,B,C)
    \tkzDrawSegment[input](A,B)
    \tkzDrawSegments[red](A,C B,C)
    \tkzDrawCircles(A,B B,A)
    \tkzLabelPoints(A,B)
    \tkzLabelCircle[below=12pt](A,B)(180){$D$}
    \tkzLabelCircle[above=12pt](B,A)(180){$E$}
    \tkzLabelPoint[above,red](C){$C$}
    \tkzDrawPoints[fill=gray,opacity=.5](A,B,C)
\end{tikzpicture}
\end{document}

在此处输入图片描述

网格:tkz-euclide

\tkzInit[xmin=-3,xmax=4,ymin=-3,ymax=3]
\tkzGrid

TikZ

   \draw[help lines/.style={thin,draw=black!50}] (-3,-3) grid (4,3);

代码 :

\documentclass{article}
\usepackage{tkz-euclide}

\colorlet{input}{red!80!black} 
\colorlet{output}{red!70!black}
\colorlet{triangle}{orange!40}  

\begin{document}

\begin{tikzpicture}[scale=1.25,thick] 
  % \tkzInit[xmin=-3,xmax=4,ymin=-3,ymax=3]
  % \tkzGrid
  % or
  \draw[help lines/.style={thin,draw=black!50}] (-3,-3) grid (4,3);
    \tkzDefPoint(0,0){A}
    \tkzDefPoint(1.25+rand(),0.25+rand()){B}
    \tkzInterCC(A,B)(B,A) \tkzGetPoints{C}{X}
    \tkzFillPolygon[triangle,opacity=.5](A,B,C)
    \tkzDrawSegment[input](A,B)
    \tkzDrawSegments[red](A,C B,C)
    \tkzDrawCircles(A,B B,A)
    \tkzLabelPoints(A,B)
    \tkzLabelCircle[below=12pt](A,B)(180){$D$}
    \tkzLabelCircle[above=12pt](B,A)(180){$E$}
    \tkzLabelPoint[above,red](C){$C$}
    \tkzDrawPoints[fill=gray,opacity=.5](A,B,C)
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容