summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-styles.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-styles.tex')
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-styles.tex333
1 files changed, 333 insertions, 0 deletions
diff --git a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-styles.tex b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-styles.tex
new file mode 100644
index 0000000000..d28226ee97
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-styles.tex
@@ -0,0 +1,333 @@
+\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.
+
+\subsubsection{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. Il sera possible d'utiliser un autre style locallement en utilisant cette commande au sein d'un environnement \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}
+
+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}
+
+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}
+
+\subsubsection{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)
+\tkzDrawCircles[R](A',{\rCD} B',\rEF)
+\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}
+
+\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}
+
+\begin{tkzexample}[latex=7cm,small]
+ \begin{tikzpicture}
+ \def\r{3} \def\angle{200}
+ \tkzSetUpArc[delta=5,color=purple,style=dashed]
+ \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)
+ \tkzDrawPoints[new](C,C',D,X)
+ \tkzLabelPoints[below left](O,A)
+ \tkzLabelPoints[below](C,C')
+ \tkzLabelPoints[below right](X)
+ \tkzLabelPoints[above](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.
+
+\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[radius,new](I,H)
+\tkzDrawSegments[new](I,H)
+\tkzDrawLines[add=0 and .2,new](A,I B,I)
+\end{tikzpicture}
+\end{tkzexample}
+
+
+
+
+
+\section{Label style}
+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}
+
+\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[XY]
+ \tkzDrawY[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){$(1,0)$}
+ \tkzLabelPoint[above right](B){$(0,1)$}
+ \tkzLabelPoint[above left](C){$(-1,0)$}
+ \tkzLabelPoint[below left](D){$(0,-1)$}
+\end{tikzpicture}
+\end{tkzexample}
+
+
+\section{Own style}
+You can set your own style with \tkzcname{tkzSetUpStyle}
+
+\begin{NewMacroBox}{tkzSetUpStyle}{\oarg{local options}}%
+ The options are the same as those of \TIKZ
+\end{NewMacroBox}
+
+\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}
+
+\endinput \ No newline at end of file