0

How I can define a point in tkz-euclide for later use? Obviously the below code does not work. I know I can save the x-y coordinates using something like \def\x1{1} \def\y1{1} \def\x2{2} \def\y2{0} then defining the point in each tikzpicture but I prefer then define the entire point and use it in all tikzpictues. Is it possible?

\documentclass{article}
\usepackage{tkz-euclide}
\tkzDefPoint(1,1){A}
\tkzDefPoint(2,0){B}

\begin{document}

\begin{tikzpicture}
\tkzDrawSegment(A,B)
\end{tikzpicture}

\end{document}
2

You can use coordinate to save the points. The coordinates can be used global afterwards.

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

\begin{document}

\begin{tikzpicture}
    \coordinate (A) at (1,1);
    \coordinate (B) at (2,0);
    \tkzDrawSegment(A,B)
\end{tikzpicture}

\begin{tikzpicture}
    \tkzDrawSegment(A,B)
\end{tikzpicture}

\end{document}

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.