[Tex/LaTex] Tkz-euclide error “Undefined control sequence \tkzMarkAngle”

errorstkz-euclide

Note: While preparing the following question, I've spend about half an hour in trying to create a MWE. Then I solved the problem. So I rewrote the following to make it easy find this question with search engines / the internal search and easy to see if your problem is the same (So I removed any information that was only related to my problem).

I currently get the followin error when I try to compile my document:

(./figures/geometry-6.tex
! Undefined control sequence.
l.7     \tkzMarkAngle
                     [arc=l,size=1cm,color=green,fill=green!20](H1,Q,P)
? 
! Emergency stop.
l.7     \tkzMarkAngle
                     [arc=l,size=1cm,color=green,fill=green!20](H1,Q,P)
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on GeoTopo.log.

The document is

\documentclass[varwidth=true, border=2pt]{standalone}
\usepackage{tkz-euclide}

\begin{document}
\usetkzobj{all}
\begin{tikzpicture}
    \tkzSetUpPoint[shape=circle,size=10,color=black,fill=black]
    \tkzSetUpLine[line width=1]
    \tkzDefPoints{0/0/Q, 4/1/H1, 1/2/P}
    \tkzDefPoint(1.5,3){Phelper}
    \tkzMarkAngle[arc=l,size=1cm,color=green,fill=green!20](H1,Q,P)
    \tkzDrawLine(Q,H1)

    \tkzLabelPoint[above left](Q){$Q$}
    \tkzDefLine[parallel=through P](Q,H1) \tkzGetPoint{b}
    \tkzMarkAngle[arc=l,size=1cm,color=green,fill=green!20](b,P,Phelper)
    \tkzDrawLine[dashed](P,b)
    \tkzLabelLine[pos=0.8,below](P,b){$h$}
    \tkzLabelLine[pos=-0.6,left](P,Q){$f$}
    \tkzLabelLine[pos=0.8,below](Q,H1){$g$}
    \tkzLabelPoint[above left](P){$P$}
    \tkzDrawLine[add=0.2 and 0.7](Q,P)
    \tkzDrawPoints(P,Q)
    \tkzMarkSegments[mark=||](Q,H1 P,b)
\end{tikzpicture}
\end{document}

What causes this error?

Best Answer

Solution

The problem was that I had multiple \usetkzobj{all} in my document. After removing all but one (and having that directly after \usepackage{tkz-euclide} in the preamble), the problem was solved.

Why the problem occured (and was difficult to find)

The problem occured, because I usally make a new folder for a new image, work on the image until it looks fine and then I paste the .tex-file to the figures folder. I use images like this:

\begin{figure}[htp]
    \centering
    \input{figures/geometry-6.tex}
    \caption{Situation aus \cref{prop:14.7}}
    \label{fig:bild-6}
\end{figure}

Including one of these files was ok, but not two.

So I have to remove evering souronding \begin{document} ... \begin{document} including the document-tag.