\section{Predefined styles}\label{custom} The way to proceed will depend on your use of the package. A method that seems to me to be correct is to use as much as possible predefined styles in order to separate the content from the form. This method will be the right one if you plan to create a document (like this documentation) with many figures. We will see how to define a global style for a document. We will see how to use a style locally. The file \tkzname{tkz-euclide.cfg} contains the predefined styles of the main objects. Among these the most important are points, lines, segments, circles, arcs and compass traces. If you always use the same styles and if you create many figures then it is interesting to create your own styles . To do this you need to know what features you can modify. It will be necessary to know some notions of \TIKZ. The predefined styles are global styles. They exist before the creation of the figures. It is better to avoid changing them between two figures. On the other hand these styles can be modified in a figure temporarily. There the styles are defined locally and do not influence the other figures. For the document you are reading here is how I defined the different styles. \begin{tkzltxexample}[] \tkzSetUpColors[background=white,text=black] \tkzSetUpPoint[size=2,color=teal] \tkzSetUpLine[line width=.4pt,color=teal] \tkzSetUpCompass[color=orange, line width=.4pt,delta=10] \tkzSetUpArc[color=gray,line width=.4pt] \tkzSetUpStyle[orange]{new} \end{tkzltxexample} The macro \tkzcname{tkzSetUpColors} allows you to set the background color as well as the text color. If you don't use it, the colors of your document will be used as well as the fonts. Let's see how to define the styles of the main objects. \section{Points style} This is how the points are defined : \begin{tkzltxexample}[] \tikzset{point style/.style = {% draw = \tkz@euc@pointcolor, inner sep = 0pt, shape = \tkz@euc@pointshape, minimum size = \tkz@euc@pointsize, fill = \tkz@euc@pointcolor}} \end{tkzltxexample} It is of course possible to use \tkzcname{tikzset} but you can use a macro provided by the package. You can use the macro \tkzcname{tkzSetUpPoint} globally or locally, \\ Let's look at this possibility. \subsection{Use of \tkzcname{tkzSetUpPoint}} \begin{NewMacroBox}{tkzSetUpPoint}{\oarg{local options}}% \begin{tabular}{lll}% options & default & definition \\ \midrule \TOline{color}{black}{point color} \TOline{size}{3}{point size} \TOline{fill}{black!50}{inside point color} \TOline{shape}{circle}{point shape circle, cross or cross out} \end{tabular} \end{NewMacroBox} \subsubsection{Global style or local style} First of all here is a figure created with the styles of my documentation, then the style of the points is modified within the environment \tkzNameEnv{tikzspicture}. You can use the macro \tkzcname{tkzSetUpPoint} globally or locally, If you place this macro in your preamble or before your first figure then the point style will be valid for all figures in your document. It will be possible to use another style locally by using this command within an environment \tkzNameEnv{tikzpicture}.\\ Let's look at this possibility. \begin{tkzexample}[latex=7cm,small] \begin{tikzpicture} \tkzDefPoints{0/0/A,5/0/B,3/2/C,3/1/D} \tkzDrawPolygon(A,B,C) \tkzDrawPoints(A,B,C) \tkzLabelPoints(A,B) \tkzLabelPoints[above right](C) \end{tikzpicture} \end{tkzexample} \subsubsection{Local style} The style of the points is modified locally in the second figure \begin{tkzexample}[latex=7cm,small] \begin{tikzpicture} \tkzSetUpPoint[size=4,color=red,fill=red!20] \tkzDefPoints{0/0/A,5/0/B,3/2/C,3/1/D} \tkzDrawPolygon(A,B,C) \tkzDrawPoints(A,B,C) \tkzDrawPoint[shape=cross out,thick](D) \tkzLabelPoints(A,B) \tkzLabelPoints[above right](C) \end{tikzpicture} \end{tkzexample} \subsubsection{\tkzname{Style} and \tkzname{scope}} The points get back the initial style. Point D has a new style limited by the environment \tkzNameEnv{scope}. It is also possible to use |{...}| orThe points get back the initial style. Point $D$ has a new style limited by the environment \tkzNameEnv{scope}. It is also possible to use |{...}| or |\begingoup ... \endgroup|. \begin{tkzexample}[latex=7cm,small] \begin{tikzpicture} \tkzDefPoints{0/0/A,5/0/B,3/2/C,3/1/D} \tkzDrawPolygon(A,B,C) \tkzDrawPoints(A,B,C) \begin{scope} \tkzSetUpPoint[size=4,color=red,fill=red!20] \tkzDrawPoint(D) \end{scope} \tkzLabelPoints(A,B) \tkzLabelPoints[above right](C) \end{tikzpicture} \end{tkzexample} \subsubsection{Simple example with \tkzcname{tkzSetUpPoint}} \begin{tkzexample}[latex=5cm,small] \begin{tikzpicture} \tkzSetUpPoint[shape = cross out,color=blue] \tkzDefPoint(2,1){A} \tkzDefPoint(4,0){B} \tkzDrawLine(A,B) \tkzDrawPoints(A,B) \end{tikzpicture} \end{tkzexample} \subsubsection{Use of \tkzcname{tkzSetUpPoint} inside a group} \begin{tkzexample}[latex=8cm,small] \begin{tikzpicture} \tkzDefPoints{0/0/A,2/4/B,4/0/C,3/2/D} \tkzDrawSegments(A,B A,C A,D) {\tkzSetUpPoint[shape=cross out, fill= teal!50, size=4,color=teal] \tkzDrawPoints(A,B)} \tkzSetUpPoint[fill= teal!50,size=4, color=teal] \tkzDrawPoints(C,D) \tkzLabelPoints(A,B,C,D) \end{tikzpicture} \end{tkzexample} \section{Lines style} You have several possibilities to change the style of a line. You can modify the style of a line with \tkzcname{tkzSetUpLine} or directly modify the style of the lines with |\tikzset{line style/.style = ... }| Reminder about \tkzname{line width} : There are a number of predefined styles that provide more “natural” ways of setting the line width. You can also redefine these styles. \medskip \begin{tabular}{cc} predefined style & value of \tkzname{line width} \cr \midrule ultra thin & 0.1 pt \cr very thin & 0.2 pt \cr thin & 0.4 pt \cr semithick & 0.6 pt \cr thick & 0.8 pt \cr very thick & 1.2 pt \cr ultra thick & 1.6 pt \cr \midrule \end{tabular} \subsection{Use of \tkzcname{tkzSetUpLine}} \label{tkzsetupline} It is a macro that allows you to define the style of all the lines. \begin{NewMacroBox}{tkzSetUpLine}{\oarg{local options}}% \begin{tabular}{lll}% options & default & definition \\ \midrule \TOline{color}{black}{colour of the construction lines} \TOline{line width}{0.4pt}{thickness of the construction lines} \TOline{style}{solid}{style of construction lines} \TOline{add}{.2 and .2}{changing the length of a line segment} \end{tabular} \end{NewMacroBox} \subsubsection{Change line width} \begin{tkzexample}[latex=8cm,small] \begin{tikzpicture}[scale=.75] \tkzSetUpLine[line width=1pt] \begin{scope}[rotate=-90] \tkzDefPoints{0/6/A,10/0/B,10/6/C} \tkzDefPointBy[projection = onto B--A](C) \tkzGetPoint{H} \tkzMarkRightAngle[size=.4, fill=teal!20](B,C,A) \tkzMarkRightAngle[size=.4, fill=orange!20](B,H,C) \tkzDrawPolygon(A,B,C) \tkzDrawSegment[new](C,H) \end{scope} \tkzLabelSegment[below](C,B){$a$} \tkzLabelSegment[right](A,C){$b$} \tkzLabelSegment[left](A,B){$c$} \tkzLabelSegment[color=red](C,H){$h$} \tkzDrawPoints(A,B,C) \tkzLabelPoints[above left](H) \tkzLabelPoints(B,C) \tkzLabelPoints[above](A) \end{tikzpicture} \end{tkzexample} \subsubsection{Change style of line} \begin{tkzexample}[latex=7cm,small] \begin{tikzpicture}[scale=.5] \tikzset{line style/.style = {color = gray, style=dashed}} \tkzDefPoints{1/0/A,4/0/B,1/1/C,5/1/D} \tkzDefPoints{1/2/E,6/2/F,0/4/A',3/4/B'} \tkzCalcLength(C,D) \tkzGetLength{rCD} \tkzCalcLength(E,F) \tkzGetLength{rEF} \tkzInterCC[R](A',\rCD)(B',\rEF) \tkzGetPoints{I}{J} \tkzDrawLine(A',B') \tkzCompass(A',B') \tkzDrawSegments(A,B C,D E,F) \tkzDefCircle[R](A',\rCD) \tkzGetPoint{a'} \tkzDefCircle[R](B',\rEF)\tkzGetPoint{b'} \tkzDrawCircles(A',a' B',b') \begin{scope} \tkzSetUpLine[color=red] \tkzDrawSegments(A',I B',I) \end{scope} \tkzDrawPoints(A,B,C,D,E,F,A',B',I,J) \tkzLabelPoints(A,B,C,D,E,F,A',B',I,J) \end{tikzpicture} \end{tkzexample} \subsubsection{Example 3: extend lines} \begin{tkzexample}[latex=7cm,small] \begin{tikzpicture}[scale=.75] \tkzSetUpLine[add=.5 and .5] \tkzDefPoints{0/0/A,4/0/B,1/3/C} \tkzDrawLines(A,B B,C A,C) \tkzDrawPolygon[red,thick](A,B,C) \tkzSetUpPoint[size=4,circle,color=red,fill=red!20] \tkzDrawPoints(A,B,C) \end{tikzpicture} \end{tkzexample} \section{Arc style} \subsection{The macro \tkzcname{tkzSetUpArc}} \begin{NewMacroBox}{tkzSetUpArc}{\oarg{local options}}% \begin{tabular}{lll}% options & default & definition \\ \midrule \TOline{color}{black}{colour of the lines} \TOline{line width}{0.4pt}{thickness of the lines} \TOline{style}{solid}{style of construction lines} \end{tabular} \end{NewMacroBox} \subsubsection{Use of \tkzcname{tkzSetUpArc}} \begin{tkzexample}[latex=7cm,small] \begin{tikzpicture} \def\r{3} \def\angle{200} \tkzSetUpArc[delta=10,color=purple,line width=.2pt] \tkzSetUpLabel[font=\scriptsize,red] \tkzDefPoint(0,0){O} \tkzDefPoint(\angle:\r){A} \tkzInterCC(O,A)(A,O) \tkzGetPoints{C'}{C} \tkzInterCC(O,A)(C,O) \tkzGetPoints{D'}{D} \tkzInterCC(O,A)(D,O) \tkzGetPoints{X'}{X} \tkzDrawCircle(O,A) \tkzDrawArc(A,C')(C) \tkzDrawArc(C,O)(D) \tkzDrawArc(D,O)(X) \tkzDrawLine[add=.1 and .1](A,X) \tkzDrawPoints(O,A) \tkzSetUpPoint[size=3,color=purple,fill=purple!10] \tkzDrawPoints(C,C',D,X) \tkzLabelPoints[below left](O,A) \tkzLabelPoints[below](C') \tkzLabelPoints[below right](X) \tkzLabelPoints[above](C,D) \end{tikzpicture} \end{tkzexample} \section{Compass style, configuration macro \tkzcname{tkzSetUpCompass}} The following macro will help to understand the construction of a figure by showing the compass traces necessary to obtain certain points. \subsection{The macro \tkzcname{tkzSetUpCompass} } \begin{NewMacroBox}{tkzSetUpCompass}{\oarg{local options}}% \begin{tabular}{lll}% options & default & definition \\ \midrule \TOline{color}{black}{colour of the construction lines} \TOline{line width}{0.4pt}{thickness of the construction lines} \TOline{style}{solid}{style of lines : solid, dashed,dotted,...} \TOline{delta}{0}{changes the length of the arc } \end{tabular} \end{NewMacroBox} \subsubsection{Use of \tkzcname{tkzSetUpCompass}} \begin{tkzexample}[latex=7cm,small] \begin{tikzpicture} \tkzSetUpCompass[color=red,delta=15] \tkzDefPoint(1,1){A} \tkzDefPoint(6,1){B} \tkzInterCC[R](A,4)(B,4) \tkzGetPoints{C}{D} \tkzCompass(A,C) \tkzCompass(B,C) \tkzDrawPolygon(A,B,C) \tkzDrawPoints(A,B,C) \end{tikzpicture} \end{tkzexample} \subsubsection{Use of \tkzcname{tkzSetUpCompass} with \tkzcname{tkzShowLine}} \begin{tkzexample}[latex=7cm,small] \begin{tikzpicture}[scale=.75] \tkzSetUpStyle[bisector,size=2,gap=3]{showbi} \tkzSetUpCompass[color=teal,line width=.3 pt] \tkzDefPoints{0/1/A, 8/3/B, 3/6/C} \tkzDrawPolygon(A,B,C) \tkzDefLine[bisector](B,A,C) \tkzGetPoint{a} \tkzDefLine[bisector](C,B,A) \tkzGetPoint{b} \tkzShowLine[showbi](B,A,C) \tkzShowLine[showbi](C,B,A) \tkzInterLL(A,a)(B,b) \tkzGetPoint{I} \tkzDefPointBy[projection= onto A--B](I) \tkzGetPoint{H} \tkzDrawCircle[new](I,H) \tkzDrawSegments[new](I,H) \tkzDrawLines[add=0 and .2,new](A,I B,I) \end{tikzpicture} \end{tkzexample} \section{Label style} \subsection{The macro \tkzcname{tkzSetUpLabel} } The macro \tkzcname{tkzSetUpLabel} is used to define the style of the point labels. \begin{NewMacroBox}{tkzSetUpStyle}{\oarg{local options}}% The options are the same as those of \TIKZ \end{NewMacroBox} \subsubsection{Use of \tkzcname{tkzSetUpLabel}} \begin{tkzexample}[latex=6cm,small] \begin{tikzpicture}[scale=.75] \tkzSetUpLabel[font=\scriptsize,red] \tkzSetUpStyle[line width=1pt,teal]{XY} \tkzInit[xmin=-3,xmax=3,ymin=-3,ymax=3] \tkzDrawX[noticks,XY] \tkzDrawY[noticks,XY] \tkzDefPoints{1/0/A,0/1/B,-1/0/C,0/-1/D} \tkzDrawPoints[teal,fill=teal!30,size=6](A,...,D) \tkzLabelPoint[above right](A){$A(1,0)$} \tkzLabelPoint[above right](B){$B(0,1)$} \tkzLabelPoint[above left](C){$C(-1,0)$} \tkzLabelPoint[below left](D){$D(0,-1)$} \end{tikzpicture} \end{tkzexample} \section{Own style} You can set your own style with \tkzcname{tkzSetUpStyle} \subsection{The macro \tkzcname{tkzSetUpStyle} } \begin{NewMacroBox}{tkzSetUpStyle}{\oarg{local options}}% The options are the same as those of \TIKZ \end{NewMacroBox} \subsubsection{Use of \tkzcname{tkzSetUpStyle}} \begin{tkzexample}[latex=2cm,small] \begin{tikzpicture} \tkzSetUpStyle[color=blue!20!black,fill=blue!20]{mystyle} \tkzDefPoint(0,0){O} \tkzDefPoint(0,1){A} \tkzDrawPoints(O) % general style \tkzDrawPoints[mystyle,size=4](A) % my style \tkzLabelPoints(O,A) \end{tikzpicture} \end{tkzexample} \section{How to use \tkzname{arrows}} In some countries, arrows are used to indicate the parallelism of lines, to represent half-lines or the sides of an angle (rays). Here are some examples of how to place these arrows. \tkzname{ tkz-euclide} loads a library called \tkzname{arrows.meta}. |\usetikzlibrary{arrows.meta}| This library is used to produce different styles of arrow heads. The next examples use some of them. \subsection{Arrows at endpoints on segment, ray or line} \tkzname{Stealth}, \tkzname{Triangle}, \tkzname{To}, \tkzname{Latex} and \dots which can be combined with \tkzname{reversed}. That's easy to place an arrow at one or two endpoints. \begin{enumerate} \item \tkzname{Triangle} and \tkzname{Ray} \begin{tkzexample}[latex=6cm,small] \begin{tikzpicture} \tkzDefPoints{0/0/A,4/0/B} \tkzDrawSegment[-Triangle](A,B) \end{tikzpicture} \end{tkzexample} \item \tkzname{Stealth} and \tkzname{Segment} \begin{tkzexample}[latex=6cm,small] \begin{tikzpicture} \tkzDefPoints{0/0/A,4/0/B} \tkzDrawSegment[Stealth-Stealth](A,B) \end{tikzpicture} \end{tkzexample} \item \tkzname{Latex} and \tkzname{Line} \begin{tkzexample}[latex=6cm,small] \begin{tikzpicture} \tkzDefPoints{0/0/A,4/0/B} \tkzDrawLine[red,Latex-Latex](A,B) \tkzDrawPoints(A,B) \end{tikzpicture} \end{tkzexample} \item \tkzname{To} and \tkzname{Segment} \begin{tkzexample}[latex=6cm,small] \begin{tikzpicture} \tkzDefPoints{0/0/A,4/0/B} \tkzDrawSegment[To-To](A,B) \end{tikzpicture} \end{tkzexample} \item \tkzname{Latex} and \tkzname{Segment} \begin{tkzexample}[latex=6cm,small] \begin{tikzpicture} \tkzDefPoints{0/0/A,4/0/B} \tkzDrawSegment[Latex-Latex](A,B) \end{tikzpicture} \end{tkzexample} \item \tkzname{Latex} and \tkzname{Ray} \begin{tkzexample}[latex=6cm,small] \begin{tikzpicture} \tkzDefPoints{0/0/A,4/0/B} \tkzDrawSegment[Latex-](A,B) \end{tikzpicture} \end{tkzexample} \item \tkzname{Latex} and \tkzname{Several rays} \begin{tkzexample}[latex=6cm,small] \begin{tikzpicture} \tkzDefPoints{0/0/A,4/0/B,5/-2/C} \tkzDrawSegments[-Latex](A,B A,C) \end{tikzpicture} \end{tkzexample} \end{enumerate} \subsubsection{Scaling an arrow head} \begin{tkzexample}[latex=6cm,small] \begin{tikzpicture} \tkzDefPoints{0/0/A,4/0/B} \tkzDrawSegment[{Latex[scale=2]}-{Latex[scale=2]}](A,B) \end{tikzpicture} \end{tkzexample} \subsubsection{Using vector style} |\tikzset{vector style/.style={>=Latex,->}}| You can redefine this style. \begin{tkzexample}[latex=6cm,small] \begin{tikzpicture} \tkzDefPoints{0/0/A,4/0/B} \tkzDrawSegment[vector style](A,B) \end{tikzpicture} \end{tkzexample} \subsection{Arrows on middle point of a line segment} Arrows on lines are used to indicate that those lines are parallel. It depends on the country, in France we prefer to indicate outside the figure that $(A,B) \parallel (D,C)$. The code is an adaptation of an answer by \tkzname{muzimuzhi Z} on the site \href{https://tex.stackexchange.com/questions/632596/how-to-manage-argument-pattern-keys-and-subways}{tex.stackexchange.com}. \medskip Syntax: \\ \begin{itemize} \item |tkz arrow| (\tkzname{Latex} by default) \item |tkz arrow=| \item |tkz arrow= at ( = .5 by default)| \item |tkz arrow={[] at }| option possible \tkzname{scale} \end{itemize} Example usages: \\ |\tkzDrawSegment[tkz arrow=Stealth] (A,B)|\\ |\tkzDrawSegment[tkz arrow={To[scale=3] at .4}](A,B)|\\ |\tkzDrawSegment[tkz arrow={Latex[scale=5,blue] at .6}](A,B)| \subsubsection{In a parallelogram} \begin{tkzexample}[latex=7cm,small] \begin{tikzpicture} \tkzDefPoints{0/0/A,3/0/B,4/2/C} \tkzDefParallelogram(A,B,C) \tkzGetPoint{D} \tkzDrawSegments[tkz arrow](A,B D,C) \tkzDrawSegments(B,C D,A) \tkzLabelPoints(A,B) \tkzLabelPoints[above right](C,D) \tkzDrawPoints(A,...,D) \end{tikzpicture} \end{tkzexample} \subsubsection{A line parallel to another one} \begin{tkzexample}[latex=7cm,small] \begin{tikzpicture} \tkzDefPoints{0/0/A,3/0/B,1/2/C} \tkzDefPointWith[colinear= at C](A,B) \tkzGetPoint{D} \tkzDrawSegments[tkz arrow=Triangle](A,B C,D) \tkzLabelPoints(A,B,C) \tkzDrawPoints(A,...,C) \end{tikzpicture} \end{tkzexample} \subsubsection{Arrow on a circle} It is possible to place an arrow on the first quarter of a circle. A rotation allows you to move the arrow. \begin{tkzexample}[latex=7cm,small] \begin{tikzpicture} \tkzDefPoints{0/0/A,3/0/B} \begin{scope}[rotate=150] \tkzDrawCircle[tkz arrow={Latex[scale=2,red]}](A,B) \end{scope} \end{tikzpicture} \end{tkzexample} \subsection{Arrows on all segments of a polygon} Some users of my package have asked me to be able to place an arrow on each side of a polygon. I used a style proposed by Paul Gaborit on the site \href{https://tex.stackexchange.com/questions/3161/tikz-how-to-draw-an-arrow-in-the-middle-of-the-line}{tex.stackexchange.com}. |\tikzset{tkz arrows/.style=|\\ |{postaction={on each path={tkz arrow={Latex[scale=2,color=black]}}}}}| You can change this style. With \tkzname{tkz arrows} you can an arrow on each segment of a polygon \subsubsection{Arrow on each segment with \tkzname{tkz arrows} } \begin{tkzexample}[latex=7cm,small] \begin{tikzpicture} \tkzDefPoints{0/0/A,3/0/B} \tkzDefSquare(A,B) \tkzGetPoints{C}{D} \tkzDrawPolygon[tkz arrows](A,...,D) \end{tikzpicture} \end{tkzexample} \subsubsection{Using \tkzname{tkz arrows} with a circle} \begin{tkzexample}[latex=7cm,small] \begin{tikzpicture} \tkzDefPoints{0/0/A,3/0/B} \tkzDrawCircle[tkz arrows](A,B) \end{tikzpicture} \end{tkzexample} \endinput