summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.cfg
blob: 4d7415232e27849fc3b82021d77e612f2254fc4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
% tkz-euclide.cfg
% Copyright 2022  Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status “maintained”.
% 
% The Current Maintainer of this work is Alain Matthes.
% If you modify this original file, YOUR CHANGES WILL BE LOST when it is
% updated.  Instead, put your changes in the entire copy of tkz-base.cfg 
% and save the file in a directory  part of your TEXINPUTS environment 
% variable. 

\def\fileversion{4.25c}
\def\filedate{2022/09/23} 
\typeout{2022/09/23 4.25c tkz-euclide.cfg}
%<------   colors  ---------------------------------------–> 
\def\tkz@backgroundcolor{white}
\def\tkz@textcolor{black}  
%<---------------------------------------------------------
\def\tkz@fillcolor{\tkz@backgroundcolor}    
\def\tkz@mainlinecolor{\tkz@textcolor} 
\def\tkz@otherlinecolor{\tkz@mainlinecolor!50} 
%<--------------------------    points   -----------------------------------–>
\def\tkz@euc@pointshape{circle}
\def\tkz@euc@pointcolor{\tkz@mainlinecolor}
\def\tkz@euc@labelcolor{\tkz@mainlinecolor} 
\def\tkz@euc@pointsize{2}
\def\tkz@euc@pointpos{below right}
\def\tkz@euc@segmentcolor{\tkz@mainlinecolor}
\def\tkz@euc@circlecolor{\tkz@mainlinecolor}
\tikzset{point style/.style = {draw         = \tkz@euc@pointcolor,
                               inner sep    = 0pt,
                               shape        = \tkz@euc@pointshape,
                               minimum size = \tkz@euc@pointsize,
                               fill         = \tkz@euc@pointcolor
                               }
        }  
% label for the point 
\tikzset{label style/.style={ below, \tkz@euc@labelcolor,
                                font = \normalsize}
                                }
\tikzset{label angle style/.style={ \tkz@euc@labelcolor,
                                font = \normalsize}
                                }                                   
%<--------------------------   line  ---------------------------------------–>
\def\tkz@euc@linecolor{\tkz@mainlinecolor}
\def\tkz@euc@linewidth{0.2pt}
\def\tkz@euc@linestyle{solid}
\def\tkz@euc@lineleft{.2}
\def\tkz@euc@lineright{.2}
\tikzset{%
line style/.style = {%
    line width = \tkz@euc@linewidth,
    color      = \tkz@euc@linecolor,
    style      = \tkz@euc@linestyle,
    add        = {\tkz@euc@lineleft} and    {\tkz@euc@lineright},
    line cap   = round
    }
}
%<-------------------------    circle   -----------------------------------–>   
\def\tkz@euc@circlelw{\tkz@euc@linewidth}
\def\tkz@euc@circlecolor{\tkz@otherlinecolor}
\def\tkz@euc@circlestyle{solid}
\tikzset{%
circle style/.style         = {%
    color         = \tkz@euc@circlecolor,
    line width    = \tkz@euc@circlelw,
    style         = \tkz@euc@circlestyle}
}
\tikzset{label circle style/.style = {%
    color      = \tkz@mainlinecolor}
}
%<-------------------------    compass   -----------------------------------–> 
\def\tkz@euc@compasscolor{\tkz@otherlinecolor}
\def\tkz@euc@compasswidth{\tkz@euc@linewidth}
\def\tkz@euc@compassstyle{solid} 
\tikzset{%
compass style/.style         = {%
    color         = \tkz@euc@compasscolor,
    line width    = \tkz@euc@compasswidth,
    style         = \tkz@euc@compassstyle}
} 
%<-------------------------    arc   -----------------------------------–> 
\def\tkz@euc@arclw{\tkz@euc@linewidth}
\def\tkz@euc@arccolor{\tkz@mainlinecolor}
\def\tkz@euc@arcstyle{solid}
\tikzset{%
arc style/.style={%
    color     = \tkz@euc@arccolor,
    line width  = \tkz@euc@linewidth}
}               
%<------   axes cartesian system  ---------------------------------------–>   
\def\tkz@init@color{\tkz@textcolor}
\def\tkz@init@lw{0.4 pt}
\def\tkz@init@tickwd{0.8 pt}
\def\tkz@init@ticka{2 pt}  
\def\tkz@init@tickb{2 pt}
\def\tkz@init@xlabel{$x$}
\def\tkz@init@ylabel{$y$}
\def\tkz@init@tickb{2 pt}
\def\tkz@init@rightspace{.5} 
\def\tkz@init@leftspace{0}
\def\tkz@init@upspace{.5} 
\def\tkz@init@downspace{0}
\global\let\tkzmathstyle\displaystyle
\def\tkz@legend@line@len{1cm}
%<--------------------------   rep  ---------------------------------------–>
\def\tkz@sur@color{\tkz@mainlinecolor}
\def\tkz@sur@colorlabel{\tkz@mainlinecolor}
\def\tkz@sur@lw{0.8 pt}
\def\tkz@sur@posxlabel{below=2pt}
\def\tkz@sur@posylabel{left=2pt}
%<--------------------------   grid  ---------------------------------------–>
\def\tkz@grid@color{gray}
\def\tkz@grid@lw{0.4 pt}
\def\tkzCoeffSubColor{50} 
\def\tkzCoeffSubLw{0.8}
\def\tkz@grid@xstep{0.2}
\def\tkz@grid@ystep{0.2} 
\def\tkz@init@gradsize{\textstyle}
\def\tkzRatioLineGrid{0.75} 
\def\tkz@gd@sublw{0.4 pt}% size line sub grid
 
%<----------------------------    mark   -----------------------------------–> 
\def\tkz@mk@color{\tkz@mainlinecolor}
\def\tkz@mk@mark{*}
\def\tkz@mk@size{3pt}
\def\tkz@mk@fill{\tkz@otherlinecolor} 
%<--------------------------------------------------------------------------–>
%<------------------------------  styles   ---------------------------------–>
\def\tkzSetUpStyle[#1]#2{\tikzset{#2/.style={#1}}}% add 2022

\tikzset{xlabel style/.style                =   {below      =   3 pt,
                                                inner sep   =   1pt,
                                                outer sep   =   0pt}
                                                }                                       
\tikzset{ylabel style/.style                =   {left       =   3 pt,
                                                inner sep   =   1pt,
                                                outer sep   =   0pt}}
\tikzset{xaxe style/.style                  =   {>          =   latex,  ->}
}  
\tikzset{yaxe style/.style                  =   {>          =   latex,  ->}
}    
        
\tikzset{rep style/.style       = { ->,
                                    >=latex}
                                }                             

\tikzset{mark style/.style            =  {mark         =    \tkz@mk@mark,
                                          mark size    =    \tkz@mk@size,
                                          mark options = {color= \tkz@mk@color,
                                          fill         = \tkz@mk@fill
                                                 }
                                }
}

%<------------------------- Cartesian system   -----------------------------–>
% Default unity cm
% Geometry Euclidean  with unity for x and y = 1cm ---> step = 1
% 0 ≤ x ≤ 10
% 0 ≤ y ≤ 10
\def\tkz@init@xorigine{0}
\def\tkz@init@yorigine{0}
\def\tkz@init@xstep{1}
\def\tkz@init@ystep{1}
\def\tkz@init@xmin{0}
\def\tkz@init@ymin{0}
\def\tkz@init@xmax{10}
\def\tkz@init@ymax{10}
\def\tkz@init@xdec{1}
\def\tkz@init@ydec{1}  
%<----------------------    show coord   -----------------------------------–> 
\tikzset{arrow coord style/.style   =   {dashed,
                                        \tkz@euc@linecolor,
                                        >   =   latex',
                                        ->}
                                        }
\tikzset{xcoord style/.style        =   {\tkz@euc@labelcolor,
                                        font        =   \normalsize,
                                        text height =   1ex,
                                        inner sep   =   0pt,
                                        outer sep   =   0pt,
                                        fill        =   \tkz@fillcolor,
                                        below       =   3pt}
                                        } 
\tikzset{ycoord style/.style        =   {\tkz@euc@labelcolor,
                                        font        =   \normalsize,
                                        text height =   1ex, 
                                        inner sep   =   0pt,
                                        outer sep   =   0pt, 
                                        fill        =   \tkz@fillcolor,
                                        left        =   3pt}
                                        }  
%
\tikzset{help lines/.style=teal!30,ultra thin}
%<---------------------------  arrow --------------------------------------–>
% Syntax:
%
%  - tkz arrow=<arrow end tip>`
%  - tkz arrow=<arrow end tip> at <pos> (<pos> = .5 by default)
%  - tkz arrow={<arrow end tip>[<arrow options>] at <pos>}
%
%
% Example usages:
%
% \draw[tkz arrow=Stealth] (A) -- (B);
% \draw[tkz arrow={To[scale=3] at .3}] (A)-- (B);
% \draw[tkz arrow={Latex[scale=5,blue] at .8}] (A)-- (B);

\tikzset{
tkz arrow/.default=Latex,
  tkz arrow/.code=%
  {%
    \pgfutil@in@{ at }{#1}%
    \ifpgfutil@in@
      \mytikz@parsearrow#1\mytikz@stop
    \else
      \mytikz@parsearrow#1 at .5\mytikz@stop
    \fi
  }
}
\def\mytikz@parsearrow#1 at #2\mytikz@stop{%
  \pgfutil@in@{[}{#1}%
  \ifpgfutil@in@
    \mytikz@parsearrow@opt{#2}#1\mytikz@stop
  \else
    \mytikz@parsearrow@opt{#2}#1[]\mytikz@stop
  \fi
}

% #1 = pos, #2 = arrow end tip, #3 = arrow options
\def\mytikz@parsearrow@opt#1#2[#3]\mytikz@stop{%
  \pgfkeysalso{decoration={
      markings,
      mark=at position #1 with {\arrow[#3]{#2}}
    },
    postaction={decorate}
  }%
}
%<------------------------------------------------------------------------->
\tikzset{
   on each path/.style={
    decorate,
    decoration={
      show path construction,
      moveto code={},
      lineto code={
        \path [#1]
        (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast);
      },
      curveto code={
        \path [#1] (\tikzinputsegmentfirst)
        .. controls
        (\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb)
        ..
        (\tikzinputsegmentlast);
      },
      closepath code={
        \path [#1]
        (\tikzinputsegmentfirst) -- (\tikzinputsegmentlast);
      }}}}
 %<---------------------------  arrows --------------------------------------–>          
\tikzset{tkz arrows/.style=%
{postaction={on each path={tkz arrow={Latex[scale=2,color=black]}}}}}   
%<---------------------------  vector --------------------------------------–>
\tikzset{vector style/.style={>=Latex,->}}
%<---------------------------  tkzdotted --------------------------------------–>
\tikzset{tkzdotted/.style={%
    dash pattern=on 0.4\pgflinewidth off #1\pgflinewidth,line cap=round, shorten >=#1\pgflinewidth/2,shorten <=#1\pgflinewidth/2,
    tkzdotted/.default=8}}
    
% \tikzset{tkzreverseclip/.style={insert path={%
%   (\tkz@xa,\tkz@ya) rectangle (\tkz@xb,\tkz@yb)}}}
  
\tikzset{tkzreverseclip/.style={insert path={
  (current bounding box.south west) --(current bounding box.north west)
   --(current bounding box.north east) --  (current bounding box.south east)
   -- cycle} }}
   

\def\tkzPhi{1.618034}
\def\tkzInvPhi{0.618034}
\def\tkzSqrtPhi{1.27202}
\def\tkzSqrTwo{1.414213}
\def\tkzSqrThree{1.7320508}
\def\tkzSqrFive{2.2360679}
\def\tkzSqrTwobyTwo{0.7071065}
\def\tkzPi{3.1415926}
\def\tkzEuler{2.71828182}

\endinput