1

I don't know why, but I keep getting issues using the tkz-euclide package. Here are several problems:

Problem 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} 

Output:

! 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 ...

What it's supposed to look like:

enter image description here

I also have one more question:

How do I install tkz-fct(for drawing graphs and functions), how to use it, and which articles I can use?

  • 2
    If you use MikTeX, there is a package manager to install new packages. – Sigur Oct 20 '18 at 18:36
  • 1
    In order to use show background rectangle, you need to say \usetikzlibrary{backgrounds}. – user121799 Oct 20 '18 at 19:25
  • 1
    I took the liberty of making the title more descriptive, hope you don't mind. – Torbjørn T. Oct 20 '18 at 21:16
  • Thank you for making the title more descriptive! It does actually make it easier to understand! – CuriousEinstein Oct 20 '18 at 23:01
3

Once I add \usetikzlibrary{backgrounds}, there is no error.

\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} 

enter image description here

| improve this answer | |
  • Thank you for mentioning the \usetikzlibrary{backgrounds}! – CuriousEinstein Jan 30 '19 at 1:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.