我不知道为什么,但是我在使用 tkz-euclide 包时总是遇到问题。以下是几个问题:
问题 1:
\documentclass[svgnames]{article}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usepackage{xcolor}
\usepackage{tkz-fct}
\usetkzobj{all}
\begin{document}
\tikzset{background rectangle/.style={fill=black}}
\begin{tikzpicture}[show background rectangle]
\tkzInit[ymin=-1.5,ymax=7,xmin=-1,xmax=+11]
\tkzClip
\tkzDefPoint(0,0){O}
\tkzDefPoint(1,0){I}
\tkzDefPoint(10,0){A}
\tkzDefPointWith[orthogonal](I,A) \tkzGetPoint{H}
\tkzDefMidPoint(O,A) \tkzGetPoint{M}
\tkzInterLC(I,H)(M,A)\tkzGetPoints{C}{B}
\tkzDrawSegments[color=white,line width=1pt](I,H O,A)
\tkzDrawPoints[color=white](O,I,A,B,M)
\tkzMarkRightAngle[color=white,line width=1pt](A,I,B)
\tkzDrawArc[color=white,line width=1pt,style=dashed](M,A)(O)
\tkzLabelSegment[white,right=1ex,pos=.5](I,B){$\sqrt{a}$}
\tkzLabelSegment[white,below=1ex,pos=.5](O,I){$1$}
\tkzLabelSegment[pos=.6,white,below=1ex](I,A){$a$}
\end{tikzpicture}
\end{document}
输出:
! Package pgfkeys Error: I do not know the key '/tikz/show background rectangle
' and I am going to ignore it. Perhaps you misspelled it.
See the pgfkeys package documentation for explanation.
Type H <return> for immediate help.
...
l.11 ...in{tikzpicture}[show background rectangle]
?
Process has been terminated ...
它看起来应该是这样的:
我还有一个问题:
如何安装 tkz-fct(用于绘制图形和函数),如何使用它,以及我可以使用哪些文章?
答案1
一旦我添加\usetikzlibrary{backgrounds}
,就没有错误了。
\documentclass[svgnames]{article}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usepackage{xcolor}
\usepackage{tkz-fct}
\usetkzobj{all}
\usetikzlibrary{backgrounds}
\begin{document}
\tikzset{background rectangle/.style={fill=black}}
\begin{tikzpicture}[show background rectangle]
\tkzInit[ymin=-1.5,ymax=7,xmin=-1,xmax=+11]
\tkzClip
\tkzDefPoint(0,0){O}
\tkzDefPoint(1,0){I}
\tkzDefPoint(10,0){A}
\tkzDefPointWith[orthogonal](I,A) \tkzGetPoint{H}
\tkzDefMidPoint(O,A) \tkzGetPoint{M}
\tkzInterLC(I,H)(M,A)\tkzGetPoints{C}{B}
\tkzDrawSegments[color=white,line width=1pt](I,H O,A)
\tkzDrawPoints[color=white](O,I,A,B,M)
\tkzMarkRightAngle[color=white,line width=1pt](A,I,B)
\tkzDrawArc[color=white,line width=1pt,style=dashed](M,A)(O)
\tkzLabelSegment[white,right=1ex,pos=.5](I,B){$\sqrt{a}$}
\tkzLabelSegment[white,below=1ex,pos=.5](O,I){$1$}
\tkzLabelSegment[pos=.6,white,below=1ex](I,A){$a$}
\end{tikzpicture}
\end{document}