| 1 |
% Author : C. Pierquet (with help of JF.Burnol) |
| 2 |
% licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt |
| 3 |
|
| 4 |
\NeedsTeXFormat{LaTeX2e} |
| 5 |
\ProvidesPackage{tkz-grapheur}[2026/04/29 0.31a Des outils en TikZ pour travailler comme avec un grapheur] |
| 6 |
\def\tkzgrapheurversion{0.31a} |
| 7 |
\def\tkzgrapheurdateversion{29/04/2026} |
| 8 |
\def\tkzgrapheurdatefrversion{29 avril 2026} |
| 9 |
|
| 10 |
%====HISTORIQUE |
| 11 |
% v 0.31a Environnement alternatif pour des valeurs non normalisées + bugfixes InegaliteLin + Labels pour axes |
| 12 |
% v 0.30f Correction d'un bug avec les courbes implicites + représentations stats |
| 13 |
% v 0.30e Possibilité de paramétrer la fenêtre via Hauteur ou Largeur + XYratio |
| 14 |
% ------- Améliorations dans les valeurs interdites |
| 15 |
% ------- Courbe de niveaux (expérimental) |
| 16 |
% v 0.30d Ajout de commandes pour gérer les listes de solutions/antécédents |
| 17 |
% ------- Modification mineure des styles de Theme (choix des épaisseurs) |
| 18 |
% ------- Famille de courbes (expérimental) |
| 19 |
% ------- Tableau de valeurs (expérimental) |
| 20 |
% ------- Graphiques en semi-log ou log-log (expérimental) |
| 21 |
% ------- Définition globales de fonctions (hors environnement ou via clé [DefGlobale]) |
| 22 |
% ------- Nuage de points via lecture CSV (expérimental) |
| 23 |
% ------- Courbe implicite (lua) (très expérimental) |
| 24 |
% v 0.30c Refonte du fonctionnement avec séparation commandes [en/fr] |
| 25 |
% ------- Transformations, Taylor (expérimental) |
| 26 |
% ------- Ajout de lois de probabilités (continues + discrètes) |
| 27 |
% ------- Outils numériques |
| 28 |
% v 0.30b Nouvelle commande pour dérivée/primitive (expérimental) |
| 29 |
% ------- Nuage suites |
| 30 |
% ------- Courbes paramétrées, polaires |
| 31 |
% ------- Voisinages (expérimental) |
| 32 |
% ------- Valeurs interdites (expérimental) |
| 33 |
% ------- Coniques (expérimental) |
| 34 |
% v 0.30a Création des nœuds (fenêtre + axes) |
| 35 |
% v 0.2.9 Clés [Theme/Milli] pour des couleurs prédéfinies de grilles (à définir dans l'environnement) |
| 36 |
% v 0.2.8 Clé [Fleche] pour les axes |
| 37 |
% v 0.2.7 Gestion de la taille du graphique |
| 38 |
% v 0.2.6 Inégalité linéraire (test) |
| 39 |
% v 0.2.5 Interpolation de Lagrange + améliorations |
| 40 |
% v 0.2.4 Clé [StyleTrace] pour dotted/dashed par exemple |
| 41 |
% v 0.2.3 Bug with length |
| 42 |
% v 0.2.2 Bugfix |
| 43 |
% v 0.2.1 Option pour compat mode et pgfplots |
| 44 |
% v 0.2.0 Petites commandes en lien avec pgfplots + modification mineure splinecubique (calculs Alt) |
| 45 |
% v 0.1.9 Correction d'un bug avec la détermination des unités... |
| 46 |
% v 0.1.8 Ajout des courbes d'ECC/FCC + Toile récurrence + Points discontinuité + Histobinom |
| 47 |
% v 0.1.7 Méthodes intégrales avec des splines |
| 48 |
% v 0.1.6 Asymptote verticale + Monte Carlo + Méthode intégrales (rectangles, etc) |
| 49 |
% v 0.1.5 Correction d'un bug avec les valeurs manuelles + Nœud pour une image + [en] version ! |
| 50 |
% v 0.1.4 Ajout des placements de textes |
| 51 |
% v 0.1.3 Régressions, avec xintreg (désactivable) |
| 52 |
% v 0.1.2 Max/Min + Droites |
| 53 |
% v 0.1.1 Densité loi normale + khi deux + Améliorations diverses |
| 54 |
% v 0.1.0 Version initiale [fr] |
| 55 |
|
| 56 |
%====OPTIONS |
| 57 |
\newif\if@loadsiunitx \@loadsiunitxtrue |
| 58 |
\DeclareOption{nonsiunitx}{\@loadsiunitxfalse}% |
| 59 |
\DeclareOption{nosiunitx}{\@loadsiunitxfalse}% |
| 60 |
|
| 61 |
\newif\if@loadtikzbabel \@loadtikzbabeltrue |
| 62 |
\DeclareOption{nontikzbabel}{\@loadtikzbabelfalse}% |
| 63 |
\DeclareOption{notikzbabel}{\@loadtikzbabelfalse}% |
| 64 |
|
| 65 |
\newif\if@loadxintreg \@loadxintregtrue |
| 66 |
\DeclareOption{nonxintreg}{\@loadxintregfalse}% |
| 67 |
\DeclareOption{noxintreg}{\@loadxintregfalse}% |
| 68 |
|
| 69 |
\newif\if@loadpgfplots \@loadpgfplotstrue |
| 70 |
\DeclareOption{nonpgfplots}{\@loadpgfplotsfalse}% |
| 71 |
\DeclareOption{nopgfplots}{\@loadpgfplotsfalse}% |
| 72 |
|
| 73 |
\newif\if@loadcompatgfplots \@loadcompatgfplotsfalse |
| 74 |
\DeclareOption{compatgfplots}{\@loadcompatgfplotstrue}% |
| 75 |
|
| 76 |
\newif\if@lngenglish \@lngenglishfalse |
| 77 |
\DeclareOption{english}{\@lngenglishtrue}% |
| 78 |
|
| 79 |
\DeclareOption*{} |
| 80 |
\ProcessOptions\relax |
| 81 |
|
| 82 |
%====BASE |
| 83 |
\RequirePackage{tikz} |
| 84 |
\RequirePackage{ifthen} |
| 85 |
\if@loadpgfplots |
| 86 |
\RequirePackage{pgfplots} |
| 87 |
\usepgfplotslibrary{fillbetween} |
| 88 |
\if@loadcompatgfplots |
| 89 |
\pgfplotsset{compat=1.18} |
| 90 |
\fi |
| 91 |
\fi |
| 92 |
\usetikzlibrary{calc,intersections,patterns,patterns.meta,bbox} |
| 93 |
\RequirePackage{simplekv} |
| 94 |
\RequirePackage{xintexpr} |
| 95 |
\RequirePackage{xstring} |
| 96 |
\RequirePackage{listofitems} |
| 97 |
\if@loadxintreg |
| 98 |
\RequirePackage{xint-regression} |
| 99 |
\fi |
| 100 |
|
| 101 |
%====SIUNITX + [en] |
| 102 |
\if@loadsiunitx |
| 103 |
\RequirePackage{siunitx} |
| 104 |
\if@lngenglish |
| 105 |
\sisetup{mode=match,propagate-math-font=true,reset-math-version=false,reset-text-family=false,reset-text-series=false,reset-text-shape=false,text-family-to-math=true,text-series-to-math=true} |
| 106 |
\else |
| 107 |
\sisetup{locale=FR,output-decimal-marker={,},mode=match,propagate-math-font=true,reset-math-version=false,reset-text-family=false,reset-text-series=false,reset-text-shape=false,text-family-to-math=true,text-series-to-math=true}% |
| 108 |
\fi |
| 109 |
\fi |
| 110 |
|
| 111 |
%====TIKZ.BABEL |
| 112 |
\if@loadtikzbabel |
| 113 |
\usetikzlibrary{babel} |
| 114 |
\fi |
| 115 |
|
| 116 |
%====EPAISSEURS GRILLE <THEME> |
| 117 |
\newlength\pflthickgridp |
| 118 |
\newlength\pflthickgridi |
| 119 |
\newlength\pflthickgrids |
| 120 |
\setlength\pflthickgridp{0.65pt} |
| 121 |
\setlength\pflthickgridi{0.5pt} |
| 122 |
\setlength\pflthickgrids{0.35pt} |
| 123 |
|
| 124 |
%====STYLES DE BASE (PARTAGÉS - FR) |
| 125 |
\tikzset{pflnoeud/.style={}} |
| 126 |
\tikzset{pflpoint/.style={line width=0.95pt}} |
| 127 |
\tikzset{pflpointmc/.style={radius=0.875pt}} |
| 128 |
\tikzset{pflpointc/.style={radius=1.75pt}} |
| 129 |
\tikzset{pflpointnuage/.style={radius=1.75pt}} |
| 130 |
\tikzset{pflcadre/.style={line width=0.8pt,gray}} |
| 131 |
\tikzset{pflcourbe/.style={line width=1.05pt}} |
| 132 |
\tikzset{pflcourbediscont/.style={line width=1.1pt}} |
| 133 |
\tikzset{pflpointggb/.style={line width=0.4pt}} |
| 134 |
\tikzset{pfltrait/.style={line width=0.8pt}} |
| 135 |
\tikzset{pfltraitpointille/.style={pfltrait,dashed}} |
| 136 |
\tikzset{pfltraitcamembert/.style={line width=0.7pt}} |
| 137 |
\tikzset{pfllegendetitre/.style={above}} |
| 138 |
\tikzset{pfllegendelabels/.style={font=\small}} |
| 139 |
\tikzset{pflbarresprobas/.style={line width=1.5pt}} |
| 140 |
\tikzset{pfllabeleffectifs/.style={font=\small,inner sep=1mm}} |
| 141 |
\tikzset{pfllegendelabelsqualix/.style={font=\small,below}} |
| 142 |
\tikzset{pfllegendelabelsqualiy/.style={font=\small,left}} |
| 143 |
\tikzset{pflflecheg/.style={<-,>=latex}} |
| 144 |
\tikzset{pflfleched/.style={->,>=latex}} |
| 145 |
\tikzset{pflflechegd/.style={<->,>=latex}} |
| 146 |
\tikzset{pfltraitvoisinage/.style={line width=0.75pt}} |
| 147 |
\tikzset{pfltraitvoisinageasympt/.style={densely dashed,line width=0.75pt}} |
| 148 |
\tikzset{pfltraitantec/.style={line width=0.9pt,densely dashed}} |
| 149 |
\tikzset{pfltraitimg/.style={line width=0.9pt,densely dashed,->,>=latex}} |
| 150 |
\tikzset{pflgrillep/.style={thin,lightgray}} |
| 151 |
\tikzset{pflgrillei/.style={line width=0.3pt,lightgray}} |
| 152 |
\tikzset{pflgrilles/.style={very thin,lightgray}} |
| 153 |
\tikzset{pflaxes/.style={line width=0.8pt,->,>=latex}} |
| 154 |
\tikzset{pflaxessansfleche/.style={line width=0.8pt}} |
| 155 |
\tikzset{pfltraitsparamecc/.style={line width=0.9pt,densely dashed}} |
| 156 |
\tikzset{pflcourbeecc/.style={line width=1.05pt}} |
| 157 |
\tikzset{pfltraitrec/.style={line width=0.8pt}} |
| 158 |
\tikzset{pfltraitrecpointill/.style={pfltraitrec,densely dashed}} |
| 159 |
\tikzset{ |
| 160 |
Xmin/.store in=\pflxmin,Xmin/.default=-3,Xmin=-3, |
| 161 |
Xmax/.store in=\pflxmax,Xmax/.default=3,Xmax=3, |
| 162 |
Ymin/.store in=\pflymin,Ymin/.default=-3,Ymin=-3, |
| 163 |
Ymax/.store in=\pflymax,Ymax/.default=3,Ymax=3, |
| 164 |
Origx/.store in=\pflOx,Origx/.default=0,Origx=0, |
| 165 |
Origy/.store in=\pflOy,Origy/.default=0,Origy=0, |
| 166 |
Xgrille/.store in=\pflgrillex,Xgrille/.default=1,Xgrille=1, |
| 167 |
Xgrillei/.store in=\pflgrillexi,Xgrillei/.default=1,Xgrillei=1, |
| 168 |
Xgrilles/.store in=\pflgrillexs,Xgrilles/.default=0.5,Xgrilles=0.5, |
| 169 |
Ygrille/.store in=\pflgrilley,Ygrille/.default=1,Ygrille=1, |
| 170 |
Ygrillei/.store in=\pflgrilleyi,Ygrillei/.default=1,Ygrillei=1, |
| 171 |
Ygrilles/.store in=\pflgrilleys,Ygrilles/.default=0.5,Ygrilles=0.5, |
| 172 |
Rmax/.store in=\pflpolrayonmax,Rmax/.default=3,Rmax=3, |
| 173 |
Rgrille/.store in=\pflpolgrid,Rgrille/.default=1,Rgrille=1, |
| 174 |
Rgrilles/.store in=\pflpolgrids,Rgrilles/.default=0.5,Rgrilles=0.5, |
| 175 |
Tgrille/.store in=\pflgrillet,Tgrille/.default=45,Tgrille=45, |
| 176 |
Tgrilles/.store in=\pflgrillets,Tgrilles/.default=15,Tgrilles=15, |
| 177 |
} |
| 178 |
\tikzset{% |
| 179 |
pics/pflptcroix/.style args={#1/#2}{ |
| 180 |
code={ |
| 181 |
\draw[pflpoint,rotate=#2] (-#1,0) -- (#1,0); |
| 182 |
\draw[pflpoint,rotate=#2] (0,-#1) -- (0, #1); |
| 183 |
} |
| 184 |
}, |
| 185 |
pics/pflptcroix/.default={2pt/45} |
| 186 |
} |
| 187 |
\tikzset{% |
| 188 |
pics/pflptcarre/.style args={#1/#2}{ |
| 189 |
code={ |
| 190 |
\filldraw[draw=none,pflpoint,rotate=#2] (-#1,-#1) rectangle (#1,#1) ; |
| 191 |
} |
| 192 |
}, |
| 193 |
pics/pflptcarre/.default={2pt/0} |
| 194 |
} |
| 195 |
|
| 196 |
%====STYLES DE BASE (EN) |
| 197 |
\tikzset{tkzgrphnode/.style={}} |
| 198 |
\tikzset{tkzgrphpoint/.style={line width=0.95pt}} |
| 199 |
\tikzset{tkzgrphpointc/.style={radius=1.75pt}} |
| 200 |
\tikzset{tkzgrphpointmc/.style={radius=0.875pt}} |
| 201 |
\tikzset{tkzgrphscatter/.style={radius=1.75pt}} |
| 202 |
\tikzset{tkzgrphframe/.style={line width=0.8pt,gray}} |
| 203 |
\tikzset{tkzgrphcurve/.style={line width=1.05pt}} |
| 204 |
\tikzset{tkzgrphline/.style={line width=0.8pt}} |
| 205 |
\tikzset{tkzgrphlinedashed/.style={tkzgrphline,dashed}} |
| 206 |
\tikzset{tkzgrpharrowl/.style={<-,>=latex}} |
| 207 |
\tikzset{tkzgrpharrowr/.style={->,>=latex}} |
| 208 |
\tikzset{tkzgrpharrowlr/.style={<->,>=latex}} |
| 209 |
\tikzset{tkzgrphcounterimage/.style={line width=0.9pt,densely dashed}} |
| 210 |
\tikzset{tkzgrphrange/.style={line width=0.9pt,densely dashed,->,>=latex}} |
| 211 |
\tikzset{tkzgrphgridp/.style={thin,lightgray}} |
| 212 |
\tikzset{tkzgrphgrids/.style={very thin,lightgray}} |
| 213 |
\tikzset{tkzgrphgridi/.style={line width=0.3pt,lightgray}} |
| 214 |
\tikzset{tkzgrphaxes/.style={line width=0.8pt,->,>=latex}} |
| 215 |
\tikzset{tkzgrphaxeswoarrows/.style={line width=0.8pt}} |
| 216 |
\tikzset{ |
| 217 |
Xgrid/.store in=\pflgrillex,Xgrid/.default=1,Xgrid=1, |
| 218 |
Xgrids/.store in=\pflgrillexs,Xgrids/.default=0.5,Xgrids=0.5, |
| 219 |
Ygrid/.store in=\pflgrilley,Ygrid/.default=1,Ygrid=1, |
| 220 |
Ygrids/.store in=\pflgrilleys,Ygrids/.default=0.5,Ygrids=0.5, |
| 221 |
Rgrid/.store in=\pflpolgrid,Rgrid/.default=1,Rgrid=1, |
| 222 |
Rgrids/.store in=\pflpolgrids,Rgrids/.default=0.5,Rgrids=0.5, |
| 223 |
Tgrid/.store in=\pflgrillet,Tgrid/.default=45,Tgrid=45, |
| 224 |
Tgrids/.store in=\pflgrillets,Tgrids/.default=15,Tgrids=15, |
| 225 |
} |
| 226 |
\tikzset{% |
| 227 |
pics/tkzgraphcross/.style args={#1/#2}{ |
| 228 |
code={ |
| 229 |
\draw[tkzgrphpoint,rotate=#2] (-#1,0) -- (#1,0); |
| 230 |
\draw[tkzgrphpoint,rotate=#2] (0,-#1) -- (0, #1); |
| 231 |
} |
| 232 |
}, |
| 233 |
pics/tkzgraphcross/.default={2pt/45} |
| 234 |
} |
| 235 |
\tikzset{% |
| 236 |
pics/tkzgraphsquare/.style args={#1/#2}{ |
| 237 |
code={ |
| 238 |
\filldraw[draw=none,tkzgrphpoint,rotate=#2] (-#1,-#1) rectangle (#1,#1) ; |
| 239 |
} |
| 240 |
}, |
| 241 |
pics/tkzgraphsquare/.default={2pt/0} |
| 242 |
} |
| 243 |
|
| 244 |
%====COULEURS |
| 245 |
\definecolor{pflgrillepdefault}{HTML}{f39c12} |
| 246 |
\definecolor{pflgrilleidefault}{HTML}{bdc3c7} |
| 247 |
\definecolor{pflgrillesdefault}{HTML}{e0e0e0} |
| 248 |
\definecolor{pflgrillepgray}{HTML}{707070} |
| 249 |
\definecolor{pflgrilleigray}{HTML}{bdc3c7} |
| 250 |
\definecolor{pflgrillesgray}{HTML}{f0f0f0} |
| 251 |
\definecolor{pflgrillepblue}{HTML}{1565c0} |
| 252 |
\definecolor{pflgrilleiblue}{HTML}{90caf9} |
| 253 |
\definecolor{pflgrillesblue}{HTML}{e3f2fd} |
| 254 |
\definecolor{pflgrillepwarm}{HTML}{d84315} |
| 255 |
\definecolor{pflgrilleiwarm}{HTML}{ffab91} |
| 256 |
\definecolor{pflgrilleswarm}{HTML}{fbe9e7} |
| 257 |
\definecolor{pflgrillepgreen}{HTML}{2e7d32} |
| 258 |
\definecolor{pflgrilleigreen}{HTML}{a5d6a7} |
| 259 |
\definecolor{pflgrillesgreen}{HTML}{e8f5e9} |
| 260 |
\definecolor{pflgrillepcontrast}{HTML}{000000} |
| 261 |
\definecolor{pflgrilleicontrast}{HTML}{999999} |
| 262 |
\definecolor{pflgrillescontrast}{HTML}{cccccc} |
| 263 |
\definecolor{pflgrillepseyes}{HTML}{E6B8E6} |
| 264 |
\definecolor{pflgrilleiseyes}{HTML}{D7E2EE} |
| 265 |
\definecolor{pflgrillesseyes}{HTML}{D7E2EE} |
| 266 |
|
| 267 |
%====Longueurs utiles |
| 268 |
\newlength\pflglobalwidth |
| 269 |
\newlength\pflglobalheight |
| 270 |
\newlength\pflthickgrad |
| 271 |
\setlength\pflthickgrad{3pt} |
| 272 |
|
| 273 |
\newlength\pflthickgradu |
| 274 |
\setlength\pflthickgradu{3pt} |
| 275 |
\newlength\pflthickgradd |
| 276 |
\setlength\pflthickgradd{3pt} |
| 277 |
|
| 278 |
%====INPUT macros |
| 279 |
\input{tkz-grapheur-macros.tex} |
| 280 |
|
| 281 |
%====INPUT fr |
| 282 |
\input{tkz-grapheur-fr.tex} |
| 283 |
|
| 284 |
%====INPUT en |
| 285 |
\input{tkz-grapheur-en.tex} |
| 286 |
|
| 287 |
%====INPUT calculs |
| 288 |
\input{tkz-grapheur-calc.tex} |
| 289 |
|
| 290 |
%====INPUT stats |
| 291 |
\input{tkz-grapheur-altversion.tex} |
| 292 |
|
| 293 |
%====INPUT lua |
| 294 |
\input{tkz-grapheur-lua.tex} |
| 295 |
|
| 296 |
\endinput |