Could anybody help me I don't really know what I am doing with new environments. I have this:
%Diagram environment
\newenvironment{diagram}%
{\stepcounter{CountDiag}\vspace*{10pt}%
\begin{center}%
\begin{tikzpicture}}%
{\end{tikzpicture}\vspace*{-5pt}\par Diagram~\theCountDiag%
\end{center}}%
It works fine but I would like to add:
\tkzSetUpCompass[color=blue]
So I don't have to put it in every diagram I use.
\documentclass{article}
\usepackage{tkz-euclide}
%Diagram environment
\newenvironment{diagram}%
{\stepcounter{CountDiag}\vspace*{10pt}%
\begin{center}%
\begin{tikzpicture}}%
{\end{tikzpicture}\vspace*{-5pt}\par Diagram~\theCountDiag%
\end{center}}%
\newcounter{CountDiag}\counterwithin*{CountDiag}{section}%
\begin{document}
\begin{diagram}
\tkzDefPoint(0,0){A}
\tkzDefPoint(3,0){B}
\tkzDrawCircleblue
\tkzDrawPoints(A,B)
\tkzLabelPoints(A,B)
\tkzDrawSegment[red](A,B)
\end{diagram}
\end{document}

\tikzset{compass style/.style={...}. You can read : https://tex.stackexchange.com/questions/52372/should-tikzset-or-tikzstyle-be-used-to-define-tikz-styles – Alain Matthes Feb 01 '24 at 22:33