| 1 |
% tkz-tools-misc.tex |
| 2 |
% Copyright 2024 Alain Matthes |
| 3 |
% This work may be distributed and/or modified under the |
| 4 |
% conditions of the LaTeX Project Public License, either version 1.3 |
| 5 |
% of this license or (at your option) any later version. |
| 6 |
% The latest version of this license is in |
| 7 |
% http://www.latex-project.org/lppl.txt |
| 8 |
% and version 1.3 or later is part of all distributions of LaTeX |
| 9 |
% version 2005/12/01 or later. |
| 10 |
% This work has the LPPL maintenance status “maintained”. |
| 11 |
% The Current Maintainer of this work is Alain Matthes. |
| 12 |
|
| 13 |
\def\fileversion{4.21c} |
| 14 |
\def\filedate{2024/01/16} |
| 15 |
\typeout{2024/01/16 4.21c tkz-tools-misc.tex} |
| 16 |
\makeatletter |
| 17 |
%<--------------------------------------------------------------------------–> |
| 18 |
% hline pb avec line |
| 19 |
%<--------------------------------------------------------------------------–> |
| 20 |
\def\tkzHLine{\pgfutil@ifnextchar[{\tkz@HLine}{\tkz@HLine[]}} |
| 21 |
\def\tkz@HLine[#1]#2{% |
| 22 |
\begingroup |
| 23 |
\edef\tkz@ptya{\fpeval{(#2-\tkz@init@yorigine)/\tkz@init@ystep}} |
| 24 |
\draw[#1] (\tkz@xa,\tkz@ptya)--(\tkz@xb,\tkz@ptya);% |
| 25 |
\endgroup |
| 26 |
} |
| 27 |
%<--------------------------------------------------------------------------–> |
| 28 |
% hlines pb avec line |
| 29 |
%<--------------------------------------------------------------------------–> |
| 30 |
\def\tkzHLines{\pgfutil@ifnextchar[{\tkz@HLines}{\tkz@HLines[]}} |
| 31 |
\def\tkz@HLines[#1]#2{% |
| 32 |
\begingroup |
| 33 |
\foreach \tkz@vy in {#2}{% |
| 34 |
\edef\my@tkz@vy{\fpeval{(\tkz@vy)}} |
| 35 |
\tkz@HLine[#1]{\my@tkz@vy}} |
| 36 |
\endgroup |
| 37 |
} |
| 38 |
%<---------------------------------------------------------------------------> |
| 39 |
% vline |
| 40 |
%<---------------------------------------------------------------------------> |
| 41 |
\def\tkzVLine{\pgfutil@ifnextchar[{\tkz@VLine}{\tkz@VLine[]}} |
| 42 |
\def\tkz@VLine[#1]#2{% |
| 43 |
\begingroup |
| 44 |
\edef\tkz@ptxa{\fpeval{(#2-\tkz@init@xorigine)/\tkz@init@xstep}} |
| 45 |
\draw[#1](\tkz@ptxa,\tkz@ya)--(\tkz@ptxa,\tkz@yb); |
| 46 |
\endgroup |
| 47 |
} |
| 48 |
%<---------------------------------------------------------------------------> |
| 49 |
% vlines |
| 50 |
%<---------------------------------------------------------------------------> |
| 51 |
\def\tkzVLines{\pgfutil@ifnextchar[{\tkz@VLines}{\tkz@VLines[]}} |
| 52 |
\def\tkz@VLines[#1]#2{% |
| 53 |
\begingroup |
| 54 |
\foreach \tkz@vx in {#2}{% |
| 55 |
\edef\my@tkz@vx{\fpeval{(\tkz@vx)}} |
| 56 |
\tkz@VLine[#1]{\my@tkz@vx}} |
| 57 |
\endgroup |
| 58 |
} |
| 59 |
%<--------------------------------------------------------------------------–> |
| 60 |
\def\tkzHTick{\pgfutil@ifnextchar[{\tkz@HTick}{\tkz@HTick[]}} |
| 61 |
\def\tkz@HTick[#1]#2{% |
| 62 |
\begingroup |
| 63 |
\edef\tkz@ptxa{\fpeval{(round(#2,5)-\tkz@init@xorigine)/\tkz@init@xstep}} |
| 64 |
\draw plot[mark style,#1] coordinates {(\tkz@ptxa,0)}; |
| 65 |
\endgroup |
| 66 |
} |
| 67 |
\def\tkzHTicks{\pgfutil@ifnextchar[{\tkz@HTicks}{\tkz@HTicks[]}} |
| 68 |
\def\tkz@HTicks[#1]#2{% |
| 69 |
\begingroup |
| 70 |
\foreach \tkz@hy in {#2} {\tkz@HTick[#1]{\tkz@hy}} |
| 71 |
\endgroup |
| 72 |
} |
| 73 |
%<--------------------------------------------------------------------------–> |
| 74 |
\def\tkzVTick{\pgfutil@ifnextchar[{\tkz@VTick}{\tkz@VTick[]}} |
| 75 |
\def\tkz@VTick[#1]#2{% |
| 76 |
\begingroup |
| 77 |
\edef\tkz@ptya{\fpeval{(round(#2,5)-\tkz@init@yorigine)/\tkz@init@ystep}} |
| 78 |
\draw plot[mark style,#1] coordinates {(0,\tkz@ptya)}; |
| 79 |
\endgroup |
| 80 |
} |
| 81 |
%<--------------------------------------------------------------------------–> |
| 82 |
\def\tkzVTicks{\pgfutil@ifnextchar[{\tkz@VTicks}{\tkz@VTicks[]}} |
| 83 |
\def\tkz@VTicks[#1]#2{% |
| 84 |
\begingroup |
| 85 |
\foreach \tkz@hy in {#2} {\tkz@VTick[#1]{\tkz@hy}} |
| 86 |
\endgroup |
| 87 |
} |
| 88 |
\makeatother |
| 89 |
\endinput |