blob: c5bd7f2f91c7793fe5fccbc5b5bd17a35581d79c (
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
|
% tkz-tools-misc.tex
% Copyright 2020 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.
% utf8 encoding
\def\fileversion{3.05c}
\def\filedate{2020/03/03}
\typeout{2020/03/03 3.05c tkz-tools-misc.tex}
\makeatletter
%<--------------------------------------------------------------------------–>
% hline pb avec line
%<--------------------------------------------------------------------------–>
\def\tkzHLine{\pgfutil@ifnextchar[{\tkz@HLine}{\tkz@HLine[]}}
\def\tkz@HLine[#1]#2{%
\begingroup
\edef\tkz@ptya{\fpeval{(#2-\tkz@init@yorigine)/\tkz@init@ystep}}
\draw[#1] (\tkz@xa,\tkz@ptya)--(\tkz@xb,\tkz@ptya);%
\endgroup
}
%<--------------------------------------------------------------------------–>
% hlines pb avec line
%<--------------------------------------------------------------------------–>
\def\tkzHLines{\pgfutil@ifnextchar[{\tkz@HLines}{\tkz@HLines[]}}
\def\tkz@HLines[#1]#2{%
\begingroup
\foreach \tkz@vy in {#2}{%
\edef\my@tkz@vy{\fpeval{(\tkz@vy)}}
\tkz@HLine[#1]{\my@tkz@vy}}
\endgroup
}
%<--------------------------------------------------------------------------->
% vline
%<--------------------------------------------------------------------------->
\def\tkzVLine{\pgfutil@ifnextchar[{\tkz@VLine}{\tkz@VLine[]}}
\def\tkz@VLine[#1]#2{%
\begingroup
\edef\tkz@ptxa{\fpeval{(#2-\tkz@init@xorigine)/\tkz@init@xstep}}
\draw[#1](\tkz@ptxa,\tkz@ya)--(\tkz@ptxa,\tkz@yb);
\endgroup
}
%<--------------------------------------------------------------------------->
% vlines
%<--------------------------------------------------------------------------->
\def\tkzVLines{\pgfutil@ifnextchar[{\tkz@VLines}{\tkz@VLines[]}}
\def\tkz@VLines[#1]#2{%
\begingroup
\foreach \tkz@vx in {#2}{%
\edef\my@tkz@vx{\fpeval{(\tkz@vx)}}
\tkz@VLine[#1]{\my@tkz@vx}}
\endgroup
}
%<--------------------------------------------------------------------------–>
\def\tkzHTick{\pgfutil@ifnextchar[{\tkz@HTick}{\tkz@HTick[]}}
\def\tkz@HTick[#1]#2{%
\begingroup
\edef\tkz@ptxa{\fpeval{(round(#2,5)-\tkz@init@xorigine)/\tkz@init@xstep}}
\draw plot[mark style,#1] coordinates {(\tkz@ptxa,0)};
\endgroup
}
\def\tkzHTicks{\pgfutil@ifnextchar[{\tkz@HTicks}{\tkz@HTicks[]}}
\def\tkz@HTicks[#1]#2{%
\begingroup
\foreach \tkz@hy in {#2} {\tkz@HTick[#1]{\tkz@hy}}
\endgroup
}
%<--------------------------------------------------------------------------–>
\def\tkzVTick{\pgfutil@ifnextchar[{\tkz@VTick}{\tkz@VTick[]}}
\def\tkz@VTick[#1]#2{%
\begingroup
\edef\tkz@ptya{\fpeval{(round(#2,5)-\tkz@init@yorigine)/\tkz@init@ystep}}
\draw plot[mark style,#1] coordinates {(0,\tkz@ptya)};
\endgroup
}
%<--------------------------------------------------------------------------–>
\def\tkzVTicks{\pgfutil@ifnextchar[{\tkz@VTicks}{\tkz@VTicks[]}}
\def\tkz@VTicks[#1]#2{%
\begingroup
\foreach \tkz@hy in {#2} {\tkz@VTick[#1]{\tkz@hy}}
\endgroup
}
\makeatother
\endinput
|