summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-doc-en.tex
blob: 88e9abb16a79af15ab69c8c8e36b13788b515c9d (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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
% !TeX TXS-program:compile = txs:///arara
% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode}
% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)')

\documentclass[11pt,a4paper]{ltxdoc}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{tkz-grapheur}
\usepackage{amsmath}
\usepackage{fancyvrb}
\usepackage{fancyhdr}
\usepackage{hyperref}
\usepackage{nicefrac}
\usepackage{fontawesome5}
\usepackage{tcolorbox}
\tcbuselibrary{skins,minted}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\lfoot{\sffamily\small [tkz-grapheur]}
\rfoot{\sffamily\small - \thepage{} -}
\usepackage{hologo}
\providecommand\tikzlogo{Ti\textit{k}Z}
\providecommand\TeXLive{\TeX{}Live\xspace}
\providecommand\PSTricks{\textsf{PSTricks}\xspace}
\let\pstricks\PSTricks
\let\TikZ\tikzlogo

\urlstyle{same}
\hypersetup{pdfborder=0 0 0}
\usepackage[margin=2cm]{geometry}
\setlength{\parindent}{0pt}
\def\TPversion{0.1.5}
\def\TPdate{22/06/2024}
\usepackage{soul}
\usepackage{codehigh}
\usepackage{tabularray}
\sethlcolor{lightgray!25}
\NewDocumentCommand\MontreCode{ m }{%
	\hl{\vphantom{\texttt{pf}}\texttt{#1}}%
}
\usepackage[english]{babel}

\renewcommand{\footnoterule}{\vfill\kern -3pt \hrule width 0.4\columnwidth \kern 2.6pt}

\begin{document}

\pagestyle{fancy}

\thispagestyle{empty}

\begin{center}
	\begin{minipage}{0.88\linewidth}
	\begin{tcolorbox}[colframe=yellow,colback=yellow!15]
		\begin{center}
			\begin{tabular}{c}
				{\Huge \texttt{tkz-grapheur [en]}}\\
				\\
				{\LARGE A grapher, based}\\
				\\
				{\LARGE on \textsf{\TikZ} and \textsf{xint}.}\\
				\\
				{\small \texttt{Version \TPversion{} -- \TPdate}}
		\end{tabular}
		\end{center}
	\end{tcolorbox}
\end{minipage}
\end{center}

\begin{center}
	\begin{tabular}{c}
	\texttt{Cédric Pierquet}\\
	{\ttfamily c pierquet -- at -- outlook . fr}\\
	\texttt{\url{https://forge.apps.education.fr/pierquetcedric/package-latex-tkz-grapheur}} \\
\end{tabular}
\end{center}

\hrule

\vfill

\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5,halign=center]
\begin{GraphTikz}[x=0.85cm,y=0.35cm,Xmin=0,Xmax=10,Ymin=0,Ymax=16]
	%préparation de la fenêtre
	\DrawAxisGrids[Enlarge=2.5mm,Font=\small]{0,1,...,10}{0,2,...,16}
	%déf des fonctions avec nom courbe + nom fonction + expression
	\DefineCurve[Name=cf]<f>{3*x-6}
	\DefineCurve[Name=cg]<g>{-(x-6)^2+12}
	%antécédents et intersection
	\FindIntersections[Disp=false,Name=K]{cf}{cg}
	\FindCounterimage[DispLine,Color=orange,Name=I]{cg}{8}
	\FindCounterimage[Disp=false,Name=J]{cg}{0}
	%intégrale sous une courbe, avec intersection
	\DrawIntegral%
	[Colors=blue/purple,Bounds=nodes,Style=hatch,Hatch=bricks]%
		{g(x)}%
		{(I-2)}{(J-2)}
	%intégrale entre les deux courbes
	\DrawIntegral[Bounds=nodes,Type=fct/fct]{f(x)}[g(x)]{(K-1)}{(K-2)}
	%tracé des courbes et des points
	\DrawCurve[Color=red]{f(x)}
	\DrawCurve[Color=teal]{g(x)}
	\MarkPts<\small>{(K-1)/below right/L,(K-2)/above left/M}%
	\MarkPts[violet]<\small>{(I-1)/above left/D,(I-2)/above right/E}%
	%essai de tangente
	\DrawTangent[Colors=pink!75!black/yellow,OffsetL=2,OffsetR=2,DispPt]{g}{5}
	%essai d'image
	\DrawRanges[Colors=cyan]{g}{7,7.25,7.5}
	%surimpression des axes
	\DrawAxisGrids[Grads=false,Grid=false,Enlarge=2.5mm]{0,1,...,10}{0,2,...,16}
\end{GraphTikz}
\end{tcolorbox}

\vspace*{5mm}

\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5,halign=center]
\begin{GraphTikz}%
	[x=3.5cm,y=4cm,
	Xmin=0,Xmax=3.5,Xgrid=pi/12,Xgrids=pi/24,
	Ymin=-1.05,Ymax=1.05,Ygrid=0.2,Ygrids=0.05]
	%préparation de la fenêtre
	\DrawAxisGrids[Grads=false,Enlarge=2.5mm,Format=ntrig/nsqrt]%
	{pi/6,pi/4,pi/3,pi/2,2*pi/3,3*pi/4,5*pi/6,pi}
	{0,sqrt(2)/2,1/2,sqrt(3)/2,1,-1,-sqrt(3)/2,-1/2,-sqrt(2)/2}
	%rajouter des valeurs
	\AddXvalues{0.25,1.4,3.3}{\num{0.25},\num{1.4},\num{3.3}}
	%fonction trigo (déf + tracé)
	\DefineCurve[Name=ccos,Start=0,End=pi]<fcos>{cos(x)}
	\DefineCurve[Name=csin,Start=0,End=pi]<fsin>{sin(x)}
	%intégrale
	\FindIntersections[Disp=false,Name=JKL]{ccos}{csin}
	%\DefinirPts{FIN/pi/0}
	\DrawIntegral%
	[Bounds=node/abs,Type=fct/fct,Colors=cyan/cyan!50]%
		{fsin(x)}[fcos(x)]%
		{(JKL-1)}{pi}
	%tracé des courbes
	\DrawCurve[Color=red,Start=0,End=pi]{fcos(x)}
	\DrawCurve[Color=olive,Start=0,End=pi]{fsin(x)}
	%antécédent(s)
	\DrawCounterimage[Color=blue/teal!50!black,Lines]{ccos}{-0.25}
	\DrawCounterimage[Colors=red/magenta!50!black,Lines]{csin}{0.5}
	\DrawCounterimage[Colors=orange/orange!50!black,Lines]{csin}{sqrt(2)/2}
	\DrawCounterimage[Colors=green!50!black/green,Lines]{csin}{sqrt(3)/2}
	%surimpression axes
	\DrawAxisGrids[Grid=false,Enlarge=2.5mm,Format=ntrig/nsqrt]%
	{pi/6,pi/4,pi/3,pi/2,2*pi/3,3*pi/4,5*pi/6,pi}
	{0,sqrt(2)/2,1/2,sqrt(3)/2,1,-1,-sqrt(3)/2,-1/2,-sqrt(2)/2}
\end{GraphTikz}
\end{tcolorbox}

\vfill

\hfill{\footnotesize\textit{\ttfamily To my Dad.}}

\vspace*{5mm}

\pagebreak

\phantomsection

\hypertarget{matoc}{}

\tableofcontents

\vspace*{5mm}

\hrule

\vspace*{5mm}

\pagebreak

\section{Introduction}

\subsection{Description and general ideas}

With this modest package, far from the capabilities offered by the excellent packages \MontreCode{tkz-*}\footnote{for example tkz-base \url{https://ctan.org/pkg/tkz-base} and tkz- fct \url{https://ctan.org/pkg/tkz-fct}.} (by Alain Matthes) or \MontreCode{tzplot}\footnote{CTAN: \url{https://ctan.org/pkg/ tzplot}.} (by In-Sung Cho), it is possible to work on function graphs, in \TikZ\ language, in an \textit{intuitive} and \textit{explicit} way.

\smallskip

Concerning the overall operation:

\smallskip

\begin{itemize}
	\item particular styles for the objects used have been defined, but they can be modified locally;
	\item the name of the commands is in \textit{operational} form, so that the construction of the graphic elements has an almost \textit{algorithmic} form.
\end{itemize}

\subsection{Overall operation}

To schematize, it \textit{is enough}:

\smallskip

\begin{itemize}
	\item to declare the parameters of the graphics window (\textbf{units in cm !});
	\item to display grid/axes/graduations;
	\item to declare functions or interpolation curves;
	\item to possibly declare particular points;
	\item to place a point scatter.
\end{itemize}

\smallskip

It will then be possible:

\begin{itemize}
	\item to draw curves;
	\item to graphically determine images or backgrounds;
	\item to add elements of derivation (tangents) or integration (domain);
	\item to draw a linear fit line or the curve of another fit.
\end{itemize}

\subsection{Packages used, and package options}

The package uses:

\smallskip

\begin{itemize}
	\item \MontreCode{tikz}, with the libraries \MontreCode{calc,intersections,patterns,patterns.meta,bbox};
	\item \MontreCode{simplekv}, \MontreCode{xintexpr}, \MontreCode{xstring}, \MontreCode{listofitems};
	\item \MontreCode{xint-regression}\footnote{CTAN: \url{https://ctan.org/pkg/xint-regression}.} (for regressions, switchable via \MontreCode{[noxintreg]}).
\end{itemize}

\smallskip

The package also loads \MontreCode{siunitx} with the classic options, but it is possible not to load it using the \MontreCode{[nosiunitx]} option.

\smallskip

The package also loads the \TikZ\ \MontreCode{babel} library, but it is possible not to load it using the \MontreCode{[notikzbabel]} option.

\smallskip

The different options are obviously cumulative.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
%loading by default, with french setup of siunitx
\usepackage{tkz-grapheur}
%loading by default, with normal setup of siunitx
\usepackage[english]{tkz-grapheur}

%loading without sinuitx, to be loaded manually
\usepackage[nosiunitx]{tkz-grapheur}

%loading without tikz.babel
\usepackage[notikzbabel]{tkz-grapheur}
\end{tcblisting}

Also note that certain commands can use packages like \MontreCode{nicefrac}, which will therefore have to be loaded if necessary.

\smallskip

Concerning the \textit{calculations} and \textit{plots} part, the \MontreCode{xint} package takes care of it.

\subsection{Warnings}

It is possible, due to the (multiple) calculations carried out internally, that the compilation time may be a little \textit{long}.

\smallskip

The precision of the (determination) results seems to be around $10^{-4}$, which should normally guarantee \textit{satisfactory} plots and readings. It is still advisable to be cautious about the results obtained and those expected.

\subsection{Introductory example}

For example, we can start from the following example to \textit{illustrate} the flow of the commands for this package. The commands and syntax will be detailed in the following sections!

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
\begin{GraphTikz}%
	[x=7.5cm,y=7.5cm,Xmin=0,Xmax=1.001,Xgrid=0.1,Xgrids=0.02,
	Ymin=0,Ymax=1.001,Ygrid=0.1,Ygrids=0.02]
	\DrawAxisGrids[Enlarge=2.5mm,Font=\small]%
		{0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1}
		{0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1}
	\DefineCurve[Name=cf,Start=0,End=1]<f>{x*exp(x-1)}
	\DefineCurve[Name=delta,Start=0,End=1]<D>{x}
	\DrawIntegral[Type=fct/fct]{f(x)}[D(x)]{0}{1}
	\DrawCurve[Color=red]{f(x)}
	\DrawCurve[Color=teal]{D(x)}
	\DrawRanges[Colors=blue/cyan,Lines]{f}{0.8,0.9}
	\DrawCounterimage[Colors=green!50!black/olive,Lines]{cf}{0.5}
\end{GraphTikz}
\end{tcblisting}

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,text only}
	\begin{GraphTikz}%
		[x=7.5cm,y=7.5cm,Xmin=0,Xmax=1.001,Xgrid=0.1,Xgrids=0.02,
		Ymin=0,Ymax=1.001,Ygrid=0.1,Ygrids=0.02]
		\DrawAxisGrids[Enlarge=2.5mm,Font=\small]%
		{0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1}
		{0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1}
		\DefineCurve[Name=cf,Start=0,End=1]<f>{x*exp(x-1)}
		\DefineCurve[Name=delta,Start=0,End=1]<D>{x}
		\DrawIntegral[Type=fct/fct]{f(x)}[D(x)]{0}{1}
		\DrawCurve[Color=red]{f(x)}
		\DrawCurve[Color=teal]{D(x)}
		\DrawRanges[Colors=blue/cyan,Lines]{f}{0.8,0.9}
		\DrawCounterimage[Colors=green!50!black/olive,Lines]{cf}{0.5}
	\end{GraphTikz}
\end{tcblisting}

\newpage

\section{Basic Styles and Environment Creation}

\subsection{Basic Styles}

The styles used for plots are given below.

\smallskip

For \textit{simplicity} purposes, only the color of the elements can be configured, but if the user wishes, he can redefine the proposed styles.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
%parameters declared and stored (usable in the environment a posteriori)
\tikzset{
	Xmin/.store in=\pflxmin,Xmin/.default=-3,Xmin=-3,
	Xmax/.store in=\pflxmax,Xmax/.default=3,Xmax=3,
	Ymin/.store in=\pflymin,Ymin/.default=-3,Ymin=-3,
	Ymax/.store in=\pflymax,Ymax/.default=3,Ymax=3,
	Origx/.store in=\pflOx,Origx/.default=0,Origx=0,
	Origy/.store in=\pflOy,Origy/.default=0,Origy=0,
	Xgrid/.store in=\pflgrillex,Xgrid/.default=1,Xgrid=1,
	Xgrids/.store in=\pflgrillexs,Xgrids/.default=0.5,Xgrids=0.5,
	Ygrid/.store in=\pflgrilley,Ygrid/.default=1,Ygrid=1,
	Ygrids/.store in=\pflgrilleys,Ygrids/.default=0.5,Ygrids=0.5
}
\end{tcblisting}

We therefore find:

\smallskip

\begin{itemize}
	\item the origin of the mark (\MontreCode{Origx}/\MontreCode{Origy});
	\item the extreme values of the axes (\MontreCode{Xmin}/\MontreCode{Xmax}/\MontreCode{Ymin}/\MontreCode{Ymax});
	\item the parameters of the main and secondary grids (\MontreCode{Xgrid}/\MontreCode{Xgrids}/\MontreCode{Ygrid}/\MontreCode{Ygrids}).
\end{itemize}

\smallskip

Concerning the styles of \textit{objects}, they are given below.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
\tikzset{tkzgrphnode/.style={}}
\tikzset{tkzgrphpoint/.style={line width=0.95pt}}
\tikzset{tkzgrphpointc/.style={radius=1.75pt}}
\tikzset{tkzgrphscatter/.style={radius=1.75pt}}
\tikzset{tkzgrphframe/.style={line width=0.8pt,gray}}
\tikzset{tkzgrphcurve/.style={line width=1.05pt}}
\tikzset{tkzgrphline/.style={line width=0.8pt}}
\tikzset{tkzgrpharrowl/.style={<-,>=latex}}
\tikzset{tkzgrpharrowr/.style={->,>=latex}}
\tikzset{tkzgrpharrowlr/.style={<->,>=latex}}
\tikzset{tkzgrphcounterimage/.style={line width=0.9pt,densely dashed}}
\tikzset{tkzgrphrange/.style={line width=0.9pt,densely dashed,->,>=latex}}
\tikzset{tkzgrphgridp/.style={thin,lightgray}}
\tikzset{tkzgrphgrids/.style={very thin,lightgray}}
\tikzset{tkzgrphaxes/.style={line width=0.8pt,->,>=latex}}
\end{tcblisting}

The idea is therefore to be able to redefine styles globally or locally, and possibly add elements, using \mintinline{latex}|mystyle/.append style={...}|.

\subsection{Creating the environment}\label{creaenvt}

The proposed environment is based on \TikZ, so that any \textit{classic} command linked to \TikZ\ can be used alongside the package commands!

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
\begin{GraphTikz}[tikz options]<keys>
	%code(s)
\end{GraphTikz}
\end{tcblisting}

The \MontreCode{[tikz options]} are the \textit{classic} options that can be passed to a \TikZ\ environment, as well as the \textsf{axes/grids/window} keys presented previously.

\smallskip

The specific (and optional) \MontreCode{<keys>} are:

\smallskip

\begin{itemize}
	\item \MontreCode{ThickGrad}: size of the axis graduations (\MontreCode{3pt} for 3pt \textit{above} and 3pt \textit{below});
	\item \MontreCode{Frame}: boolean (\MontreCode{false} by default) to display a frame which delimits the graphic window (excluding possible graduations).
\end{itemize}

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}
	[x=0.075cm,y=0.03cm,Xmin=0,Xmax=160,Xgrid=20,Xgrids=10,
	Origy=250,Ymin=250,Ymax=400,Ygrid=25,Ygrids=5]
	<Frame>
\end{GraphTikz}
\end{tcblisting}

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}%
	[x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
	Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
	<Frame>
\end{GraphTikz}
\end{tcblisting}

It will obviously be more meaningful with the added graphic elements!

\pagebreak

\subsection{Grids and axes}\label{creaaxesgr}

The first command \textit{useful} will allow you to create the grids, axes and graduations.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
%in the GraphiqueTikz environment
\DrawAxisGrids[keys]{gradX}{gradY}
\end{tcblisting}

The optional \MontreCode{[keys]} available are:

\smallskip

\begin{itemize}
	\item \MontreCode{Grid}: boolean (\MontreCode{true} by default) to display the grids (for a single grid, simply set the identical parameters for \MontreCode{Xgrid}/\MontreCode{Xgrids} or \MontreCode {Ygrid}/\MontreCode{Ygrids});
	\item \MontreCode{Enlarge}: addition at the end of the axes (\MontreCode{0} by default);
	\item \MontreCode{Grads}: boolean (\MontreCode{true} by default) for graduations;
	\item \MontreCode{Font}: global font for graduations {\MontreCode{empty} by default};
	\item \MontreCode{Format}: special formatting (see below) of the axis values.
\end{itemize}

\smallskip

Concerning the \MontreCode{Format} key, it allows you to specify a specific setting for the axis values.

\smallskip

It can be given in the form \MontreCode{fmt} for combined formatting, or in the form \MontreCode{fmtX/fmtY} to differentiate the formatting.

\smallskip

The possible options are:

\smallskip

\begin{itemize}
	\item \MontreCode{num}: format with \textsf{siunitx};
	\item \MontreCode{year}: format in year;
	\item \MontreCode{frac}: format as fraction \textsf{frac};
	\item \MontreCode{dfrac}: format as fraction \textsf{dfrac};
	\item \MontreCode{nfrac}: format as fraction \textsf{nicefrac};\hfill (to load!)
	\item \MontreCode{trig}: format in trig with \textsf{frac};
	\item \MontreCode{dtrig}: format in trig with \textsf{dfrac};
	\item \MontreCode{ntrig}: format in trig with \textsf{nfrac};
	\item \MontreCode{sqrt}: format in root with \textsf{frac};
	\item \MontreCode{dsqrt}: format in root with \textsf{dfrac};
	\item \MontreCode{nsqrt}: format in root with \textsf{nicefrac}.
\end{itemize}

\smallskip

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}
	[x=0.075cm,y=0.03cm,Xmin=0,Xmax=160,Xgrid=20,Xgrids=10,
	Origy=250,Ymin=250,Ymax=400,Ygrid=25,Ygrids=5]
	\DrawAxisGrids[Enlarge=2.5mm,Font=\small]{0,10,...,160}{250,275,...,400}
\end{GraphTikz}
\end{tcblisting}

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}%
	[x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
	Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
	\DrawAxisGrids[Enlarge=2.5mm,Font=\small]{4,5,...,20}{40,42,...,56}
\end{GraphTikz}
\end{tcblisting}

Note that there are the Boolean keys \MontreCode{[Behind]} (without the graduations) and \MontreCode{[Above]} (without the grid) to display the axes in \textit{under/over}-printing mode in the case of integrals for example.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}%
	[x=2.75cm,y=3cm,
	Xmin=0,Xmax=3.5,Xgrid=pi/12,Xgrids=pi/24,
	Ymin=-1.05,Ymax=1.05,Ygrid=0.2,Ygrids=0.05]
	\DrawAxisGrids[Enlarge=2.5mm,Format=dtrig/nsqrt,Font=\footnotesize]%
	{pi/6,pi/4,pi/3,pi/2,2*pi/3,3*pi/4,5*pi/6,pi}
	{0,sqrt(2)/2,1/2,sqrt(3)/2,1,-1,-sqrt(3)/2,-1/2,-sqrt(2)/2}
\end{GraphTikz}
\end{tcblisting}

In the case where the formatting does not give satisfactory result(s), it is possible to use a generic command for placing the graduations.

\subsection{Adding values manually}\label{additionvals}

It is also possible to use a specific command to place values on the axes, independently of an \textit{automated} formatting system.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
in the environment
\AddXvalues[keys]{grads}{formatted values}
\AddYvalues[keys]{grads}{formatted values}
\end{tcblisting}

The optional \MontreCode{[keys]} available are:

\smallskip

\begin{itemize}
	\item \MontreCode{Font}: global font for graduations {\MontreCode{empty} by default};
	\item \MontreCode{Lines}: boolean to add the tick marks {\MontreCode{true} by default}.
\end{itemize}

\smallskip

The mandatory arguments correspond to the x-coordinates (in \TikZ\ language) and to the labels (in \LaTeX\ language) of the graduations.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}%
	[x=2.75cm,y=3cm,
	Xmin=0,Xmax=3.5,Xgrid=pi/12,Xgrids=pi/24,
	Ymin=-1.05,Ymax=1.05,Ygrid=0.2,Ygrids=0.05]
	\DrawAxisGrids[Grads=false,Enlarge=2.5mm]{}{}
	\AddXvalues
		{0.15,0.6,pi/2,2.8284}
		{\num{0.15},$\frac35$,$\displaystyle\frac{\pi}{2}$,$\sqrt{8}$}
	\AddYvalues
		{-1,0.175,0.3,sqrt(3)/2}
		{\num{-1},\num{0.175},$\nicefrac{3}{10}$,$\frac{\sqrt{3}}{2}$}
\end{GraphTikz}
\end{tcblisting}

\pagebreak

\section{Specific definition commands}

\subsection{Draw a line}\label{tracstraight}

The idea is to propose a command to draw a line, from:

\begin{itemize}
	\item of two points (or nodes);
	\item of a point (or node) and the slope.
\end{itemize}

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
%in the GraphiqueTikz environment
\DrawLine[keys]{point or node}{point or node or slope}
\end{tcblisting}

The optional \MontreCode{[keys]} available are:

\smallskip

\begin{itemize}
	\item \MontreCode{Name}: possible name of the plot (for reuse);
	\item \MontreCode{Slope}: boolean to specify that the slope is used (\MontreCode{false} by default);
	\item \MontreCode{Start}: start of the plot (\MontreCode{\textbackslash pflxmin} by default);
	\item \MontreCode{End}: end of the plot (\MontreCode{\textbackslash pflxmax} by default);
	\item \MontreCode{Color}: color of the trace (\MontreCode{black} by default).
\end{itemize}

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}%
	[x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
	\DrawAxisGrids[Enlarge=2.5mm]{auto}{auto}
	\DefinePts[Mark,Color=gray]{A/-4/3,B/2/0,C/0/-1}
	\DrawLine[Color=red]{(-2,-1)}{(2,4)}
	\DrawLine[Color=blue,Start=-5,End=3]{(A)}{(B)}
	\DrawLine[Color=olive,Slope]{(C)}{0.25}
\end{GraphTikz}
\end{tcblisting}

\pagebreak

\subsection{Define a function, draw the curve of a function}\label{deftracfct}

The idea is to define a function, for later reuse. This command \textit{creates} the function, without tracing it, because in certain cases elements will have to be traced beforehand.

\smallskip

There is also a command to plot the curve of a previously defined function.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
%in the GraphiqueTikz environment
\DefineCurve[keys]<fct name>{xint formula}
\DrawCurve[keys]{xint formula}
\end{tcblisting}

The optional \MontreCode{[keys]} for definition or tracing are:

\smallskip

\begin{itemize}
	\item \MontreCode{Start}: lower bound of the definition set (\MontreCode{\textbackslash pflxmin} by default);
	\item \MontreCode{End}: lower bound of the definition set (\MontreCode{\textbackslash pflxmax} by default);
	\item \MontreCode{Name}: name of the curve (important for the rest!);
	\item \MontreCode{Color}: color of the trace (\MontreCode{black} by default);
	\item \MontreCode{Step}: plot step (it is determined \textit{automatically} at the start but can be modified);
	\item \MontreCode{Trace}: boolean to also trace the curve (\MontreCode{false} by default).
\end{itemize}

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}%
	[x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
	Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
	\DrawAxisGrids[Enlarge=2.5mm,Font=\small]{4,5,...,20}{40,42,...,56}
	%definition of the function + drawing of the curve
	\DefineCurve[Name=cf,Start=5,End=19]<f>{-2*x+3+24*log(2*x)}
	\DrawCurve[Color=red,Start=5,End=19]{f(x)}
	%or in a single command if "sufficient"
	%\DefineCurve[Name=cf,Start=5,End=19,Trace]<f>{-2*x+3+24*log(2*x)}
\end{GraphTikz}
\end{tcblisting}

\pagebreak

\subsection{Define/draw an interpolation curve (simple)}\label{deftracinterpo}

It is also possible to define a curve via support points, therefore a simple interpolation curve.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
%in the GraphiqueTikz environment
\DefineInterpoCurve[keys]{list of support points}
\DrawInterpoCurve[keys]{list of support points}
\end{tcblisting}

The optional \MontreCode{[keys]} for definition or tracing are:

\smallskip

\begin{itemize}
	\item \MontreCode{Name}: name of the interpolation curve (important for the rest!);
	\item \MontreCode{Color}: color of the trace (\MontreCode{black} by default);
	\item \MontreCode{Tension}: setting the \textit{tension} of the interpolation plot (\MontreCode{0.5} by default);
	\item \MontreCode{Trace}: boolean to also trace the curve (\MontreCode{false} by default).
\end{itemize}

The mandatory argument allows you to specify the list of support points in the form \MontreCode{(x1,y1)(x2,y2)...}.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}%
	[x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
	\DrawAxisGrids[Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
	%simple interpolation curves (with diff tension)
	\DefineInterpoCurve[Name=interpotest,Color=blue,Trace]%
		{(-6,4)(-2,-2)(3,3.5)}
	\DefineInterpoCurve[Name=interpotest,Color=red,Trace,Tension=1]%
		{(-6,4)(-2,-2)(3,3.5)}
\end{GraphTikz}
\end{tcblisting}

\newpage

\subsection{Define/draw an interpolation curve (Hermite)}\label{deftracfctspline}

It is also possible to define a curve via support points, therefore an interpolation curve with derivative control.

\smallskip

Some operations require different techniques depending on the type of function used, a \textsf{Boolean} key \MontreCode{Spline} will allow the code to adapt its calculations depending on the object used.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
%in the GraphiqueTikz environment
\DefineSplineCurve[keys]{list of support points}[\macronomspline]
\DrawSplineCurve[keys]{list of support points}[\macronomspline]
\end{tcblisting}

The optional \MontreCode{[keys]} for definition or tracing are:

\smallskip

\begin{itemize}
	\item \MontreCode{Name}: name of the interpolation curve (important for the rest!);
	\item \MontreCode{Coeffs}: modify (see the \textsf{ProfLycee}\footnote{CTAN documentation: \url{https://ctan.org/pkg/proflycee}} the \textit{coefficients} of the spline;
	\item \MontreCode{Color}: color of the trace (\MontreCode{black} by default);
	\item \MontreCode{Trace}: boolean to also trace the curve (\MontreCode{false} by default).
\end{itemize}

The mandatory argument allows you to specify the list of support points in the form \MontreCode{x1/y1/f'1§x2/y2/f'2§...} with:

\begin{itemize}
	\item \MontreCode{xi/yi} the coordinates of the point;
	\item \MontreCode{f'i} the derivative at the support point.
\end{itemize}

\smallskip

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}%
	[x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
	\DrawAxisGrids[Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
	%definition of the list of spline support points
	\def\LISTETEST{-6/4/-2§-5/2/-2§-4/0/-2§-2/-2/0§1/2/2§3/3.5/0.5}
	%definition and plot of the cubic spline
	\DefineSplineCurve[Name=splinetest,Trace,Color=olive]{\LISTETEST}
\end{GraphTikz}
\end{tcblisting}

\pagebreak

\subsection{Define points as nodes}\label{defpts}

The second idea is to work with \TikZ nodes, which could be useful for tangent plots, representations of integrals$\ldots$

\smallskip

It is also possible to define nodes for \textit{image} points.

\smallskip

Certain commands (explained later) allow you to determine particular points of curves in the form of nodes, so it seems interesting to be able to define them directly.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
%by coordinates
\DefinePts[keys]{Name1/x1/y1,Name2/x2/y2,...}
\end{tcblisting}

The optional \MontreCode{[keys]} available are:

\smallskip

\begin{itemize}
	\item \MontreCode{Mark}: boolean to mark points (\MontreCode{false} by default);
	\item \MontreCode{Color}: color of the points, if \MontreCode{Mark=true} (\MontreCode{black} by default).
\end{itemize}

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
%as image
\DefineRange[keys]{object}{abscissa}
\end{tcblisting}

The optional \MontreCode{[keys]} available are:

\smallskip

\begin{itemize}
	\item \MontreCode{Name}: node name (\MontreCode{empty} by default);
	\item \MontreCode{Spline}: boolean to specify that a spline is used (\MontreCode{false} by default).
\end{itemize}

The first mandatory argument is the \textit{object} considered (name of the curve for the spline, function otherwise); the second is the abscissa of the point considered.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}%
	[x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
	Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
	\DrawAxisGrids[Enlarge=2.5mm,Font=\small]{4,5,...,20}{40,42,...,56}
	%definition of the function + drawing of the curve
	\DefineFunction[Name=cf,Start=5,End=19,Trace,Color=red]<f>{-2*x+3+24*log(2*x)}
	%manual nodes
	\DefinePts[Mark,Color=brown]{A/7/42,B/16/49}
	%imagenode
	\DefineRange[Name=IMGf]{f}{14}
	\MarkPts*[Style=x,Color=blue]{(IMGf)} %see next section ;-)
\end{GraphTikz}
\end{tcblisting}

\pagebreak

\subsection{Mark Points}\label{markpts}

The idea is to offer something to score points with a particular style.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
%in the GraphiqueTikz environment
\MarkPts(*)[keys]<font>{list}
\end{tcblisting}

The \textit{starred} version scores the points without the \textit{names}, while the \textit{unstarred} version displays them:

\begin{itemize}
	\item in the case of the \textit{starred} version, the list should be given in the form \MontreCode{(ptA),(ptB),...};
	\item otherwise, the list should be given in the form \MontreCode{(ptA)/poslabelA/labelA,...}.
\end{itemize}

\smallskip

The optional \MontreCode{[keys]} available are:

\smallskip

\begin{itemize}
	\item \MontreCode{Color}: color (\MontreCode{black} by default);
	\item \MontreCode{Style}: style of marks (\MontreCode{o} by default).
\end{itemize}

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}[x=1.5cm,y=1.5cm,Ymin=-2]
	\DrawAxisGrids[Enlarge=2.5mm]{auto}{auto}
	\DefinePts{A/1.75,-1.25}\MarkPts[Color=pink]{(A)/below/A} %round (default)
	\MarkPts[Color=teal]{(1,1)/below/M}
	\MarkPts[Color=red,Style=x]{(1.25,1)/below/$A$} %cross
	\MarkPts[Color=orange,Style=+]<\small\sffamily>{(1.5,1)/below/K} %plus
	\MarkPts[Color=blue,Style=c]{(1.75,1)/below/P} %square
	\MarkPts[Color=gray,Style=d]{(2,1)/below/P} %diamond
	\MarkPts*[Color=orange/yellow]{(2,2),(2.5,2.25)} %two-tone round
	\MarkPts*[Style=+,Color=red]{(1,2)}
	\MarkPts*[Style=x,Color=blue]{(2.25,1)}
	\MarkPts*[Style=c,Color=magenta]{(-2,-1)}
	\MarkPts[Color=red,Style=x]{(-1,1)/below/$A$,(-2,2)/below left/$B$}
\end{GraphTikz}
\end{tcblisting}

Note that it is also possible to modify the size of the \MontreCode{o/x/+/c} marks via the \MontreCode{[keys]}:

\begin{itemize}
	\item \MontreCode{Sizex=...} (\MontreCode{2pt} by default) for points \textit{cross};
	\item \MontreCode{Sizeo=...} (\MontreCode{1.75pt} by default) for the points \textit{circle};
	\item \MontreCode{Sizec=...} (\MontreCode{2pt} by default) for the \textit{square} points.
\end{itemize}

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}[x=1cm,y=1cm,Xmin=0,Ymin=0]
	\DrawAxisGrids[Enlarge=2.5mm]{auto}{auto}
	\MarkPts[Color=red,Style=x,Size=3.5pt]{(1.25,1.25)/below/$A$}
	\MarkPts[Color=teal,Size=2.5pt]{(2,2)/right/$A$}
	\MarkPts*[Color=orange,Style=c,Size=4pt]{(0.5,2.5)}
\end{GraphTikz}
\end{tcblisting}

\subsection{Retrieve node coordinates}\label{recupcoordo}

It is also possible, with a view to reusing coordinates, to recover the coordinates of a node (defined or determined).

\smallskip

The calculations are carried out by floating according to the (re)calculated units, the values are therefore approximated !

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
%in the GraphiqueTikz environment
\GetXcoord{node}[\macrox]
\GetYcoord{node}[\macroy]
\GetXYcoord{node}[\macrox][\macroy]
\end{tcblisting}

\subsection{Place text}\label{placetxt}

Note that a text placement command is available.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
%in the GraphiqueTikz environment
\DrawTxt[keys]{(node or coordinates)}{text}
\end{tcblisting}

The available \MontreCode{[keys]} are:

\begin{itemize}
	\item \MontreCode{Font=...} (\MontreCode{\textbackslash normalsize\textbackslash normalfont} by default) for the font;
	\item \MontreCode{Color=...} (\MontreCode{black} by default) for the color;
	\item \MontreCode{Position=...} (\MontreCode{empty} by default) for the position of the text relative to the coordinates.
\end{itemize}

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}[x=1cm,y=1cm,Xmin=0,Xmax=5,Ymin=0,Ymax=1]
	\DrawAxisGrids[Enlarge=2.5mm]{auto}{auto}
	\DrawTxt[Color=red,Font=\LARGE,Position=right]{(1.5,0.5)}{curve $C_1$}
\end{GraphTikz}
\end{tcblisting}

\section{Specific commands for using curves}

\subsection{Image placement}\label{images}

It is possible to place points (images) on a curve, with possible construction lines.

The function/curve used must have been declared previously for this command to work.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
%in the GraphiqueTikz environment
\DrawRanges[keys]{function or curve}{list of abscissa}
\end{tcblisting}

The optional \MontreCode{[keys]} available are:

\smallskip

\begin{itemize}
	\item \MontreCode{Lines}: boolean to display construction traits (\MontreCode{false} by default);
	\item \MontreCode{Colors}: color of the points/lines, in the form \MontreCode{Couleurs} or \MontreCode{ColPoint/ColLines};
	\item \MontreCode{Spline}: boolean to specify that the curve used is defined as a \textsf{spline} (\MontreCode{false} by default).
\end{itemize}

\smallskip

The first mandatory argument allows you to specify:

\smallskip

\begin{itemize}
	\item the name of the curve in the case \MontreCode{Spline=true};
	\item the name of the function otherwise.
\end{itemize}

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}%
	[x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
	Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
	\DrawAxisGrids[Enlarge=2.5mm,Font=\small]{4,5,...,20}{40,42,...,56}
	%definition of the function + drawing of the curve
	\DefineCurve[Name=cf,Start=5,End=19,Trace,Color=red]<f>{-2*x+3+24*log(2*x)}
	%images
	\DrawRanges[Lines,Colors=teal/blue]{f}{6,7,8,9,10}
\end{GraphTikz}
\end{tcblisting}

\pagebreak

\subsection{Antecedent determination}\label{defanteced}

It is possible to graphically determine the antecedents of a given reality.

The function/curve used must have been declared previously for this command to work.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
%in the GraphiqueTikz environment
\FindCounterimage[keys]{curve}{k}
\end{tcblisting}

The optional \MontreCode{[keys]} available are:

\smallskip

\begin{itemize}
	\item \MontreCode{Name}: base of the name of the \textbf{nodes} intersection (\MontreCode{S} by default, which will give \textsf{S-1}, \textsf{S-2}, etc);
	\item \MontreCode{Disp}: boolean to display the points (\MontreCode{true} by default);
	\item \MontreCode{Color}: color of the points (\MontreCode{black} by default);
	\item \MontreCode{DispLine}: boolean to display the horizontal line (\MontreCode{false} by default).
\end{itemize}

\smallskip

The first mandatory argument allows you to specify the \textbf{name} of the curve.

\smallskip

The second mandatory argument allows you to specify the value to reach.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}%
	[x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
	Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
	\DrawAxisGrids[Enlarge=2.5mm,Font=\small]{4,5,...,20}{40,42,...,56}
	%definition of the function + drawing of the curve
	\DefineCurve[Name=cf,Start=5,End=19,Trace,Color=red]<f>{-2*x+3+24*log(2*x)}
	%history
	\FindCounterimage[Color=teal,DispLine,Disp]{cf}{53}
	%the two antecedents are at nodes (S-1) and (S-2)
\end{GraphTikz}
\end{tcblisting}

\pagebreak

\subsection{Antecedent construction}\label{tracanteced}

It is possible to graphically construct the antecedents.

The function/curve used must have been declared previously for this command to work.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
%in the GraphiqueTikz environment
\DrawCounterimage[keys]{curve}{k}
\end{tcblisting}

The optional \MontreCode{[keys]} available are:

\smallskip

\begin{itemize}
	\item \MontreCode{Colors}: color of the points/lines, in the form \MontreCode{Color} or \MontreCode{ColPoint/ColLines};
	\item \MontreCode{Name}: name \textit{possible} for the intersection points linked to the antecedents (\MontreCode{empty} by default);
	\item \MontreCode{Lines}: boolean to display construction traits (\MontreCode{false} by default).
\end{itemize}

\smallskip

The first mandatory argument allows you to specify the \textbf{name} of the curve.

\smallskip

The second mandatory argument allows you to specify the value to reach.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}%
	[x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
	Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
	\DrawAxisGrids[Enlarge=2.5mm,Font=\small]{4,5,...,20}{40,42,...,56}
	%definition of the function + drawing of the curve
	\DefineCurve[Name=cf,Start=5,End=19,Trace,Color=red]<f>{-2*x+3+24*log(2*x)}
	%history
	\DrawCounterimage[Colors=teal/cyan,Lines,Name=PO]{cf}{53}
	\GetXcoord{(PO-1)}[\premsol]
	\GetXcoord{(PO-2)}[\deuxsol]
\end{GraphTikz}

Graphically, the antecedents of 53 are (approximately):

\begin{itemize}
	\item \num{\premsol}
	\item \num{\deuxsol}
\end{itemize}
\end{tcblisting}

\pagebreak

\subsection{Intersections of two curves}\label{intersect}

It is also possible to determine (in the form of nodes) the possible points of intersection of two previously defined curves.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
%in the GraphiqueTikz environment
\FindIntersections[keys]{curve1}{curve2}
\end{tcblisting}

The optional \MontreCode{[keys]} available are:

\smallskip

\begin{itemize}
	\item \MontreCode{Name}: base of the name of the \textbf{nodes} intersection (\MontreCode{S} by default, which will give \textsf{S-1}, \textsf{S-2}, etc);
	\item \MontreCode{Disp}: boolean to display the points (\MontreCode{true} by default);
	\item \MontreCode{Color}: color of the points (\MontreCode{black} by default).
\end{itemize}

\smallskip

The first mandatory argument allows you to specify the \textbf{name} of the first curve.

\smallskip

The first mandatory argument allows you to specify the \textbf{name} of the second curve.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}%
	[x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
	Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
	\DrawAxisGrids[Enlarge=2.5mm,Font=\small]{4,5,...,20}{40,42,...,56}
	\DefineCurve[Name=cf,Start=5,End=19,Trace,Color=red]<f>{-2*x+3+24*log(2*x)}
	\DefineCurve[Name=cg,Start=5,End=19,Trace,Color=blue]<g>{0.25*(x-12)^2+46}
	%intersections, named (TT-1) and (TT-2)
	\FindIntersections[Name=TT,Color=darkgray,Display,Lines]{cf}{cg}
	%recovery of intersection points
	\GetXYcoord{(TT-1)}[\alphaA][\betaA]
	\GetXYcoord{(TT-2)}[\alphaB][\betaB]
\end{GraphTikz}\\
The solutions of $f(x)=g(x)$ are $\alpha \approx \num{\alphaA}$ and
$\beta \approx \num{\alphaB}$.\\
The points of intersection of the curves of $f$ and $g$ are therefore
$(\RoundNb[2]{\alphaA};\RoundNb[2]{\betaA})$ and
$(\RoundNb[2]{\alphaB};\RoundNb[2]{\betaB})$.
\end{tcblisting}

\pagebreak

\subsection{Extrema}\label{maximum}\label{minimum}

The idea (still \textit{experimental}) is to offer commands to extract the extrema of a curve defined by the package.

The command creates the corresponding node, and it is therefore possible to retrieve its coordinates for later use.

\smallskip

It is possible, by specifying it, to work on the different curves managed by the package (function, interpolation, spline).

For singular curves, it is possible that the results are not quite those expected\ldots

\smallskip

{\small\faBomb} For the moment, the \textit{limitations} are:

\begin{itemize}
	\item no management of multiple extrema (only the first will be processed)\ldots
	\item no management of extrema at the boundaries of the route\ldots
	\item no automatic recovery of curve definition parameters\ldots
	\item compilation time may be longer\ldots
\end{itemize}

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
%in the GraphiqueTikz environment
\FindMax[keys]{object}[node created]
\FindMin[keys]{object}[node created]
\end{tcblisting}

The optional \MontreCode{[keys]} available are:

\smallskip

\begin{itemize}
	\item \MontreCode{Method}: method, among \MontreCode{function/interpo/spline} for calculations (\MontreCode{function} by default);
	\item \MontreCode{Start}: start of the plot (\MontreCode{\textbackslash pflxmin} by default);
	\item \MontreCode{End}: end of the plot (\MontreCode{\textbackslash pflxmax} by default);
	\item \MontreCode{Step}: not in the plot if \MontreCode{function} (it is determined \textit{automatically} at the start but can be modified);
	\item \MontreCode{Coeffs}: modify the \textit{coefficients} of the spline if \MontreCode{spline};
	\item \MontreCode{Tension}: setting the \textit{tension} of the interpolation plot if \MontreCode{interpo}(\MontreCode{0.5} by default).
\end{itemize}

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}[x=1cm,y=1cm,Xmin=-1,Xmax=5,Ymin=-1,Ymax=3]
	\DrawAxisGrids[Enlarge=2.5mm]{auto}{auto}
	\DefineCurve[Name=cf,Start=0.35,End=4.2,Trace]%
		<f>{0.6*cos(4.5*(x-4)+2.1)-1.2*sin(x-4)+0.1*x+0.2}
	\FindMax[Start=0.35,End=4.2]{f}[cf-max]
	\FindMax[Start=3,End=4]{f}[cf-maxlocal]
	\FindMin[Start=1,End=2]{f}[cf-minlocal]
	\MarkPts*[Color=red,Lines]{(cf-max)}
	\MarkPts*[Color=blue,Lines]{(cf-maxlocal)}
	\MarkPts*[Color=olive,Lines]{(cf-minlocal)}
	\GetXYcoord{(cf-max)}[\MyMaxX][\MyMaxY]
\end{GraphTikz}\\
The maximum is $M\approx\RoundNb{\MyMaxY}$, reached in $x\approx\RoundNb{\MyMaxX}$
\end{tcblisting}

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}[x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
	\DrawAxisGrids[Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
	\DefineInterpoCurve[Name=interpotest,Color=red,Trace,Tension=1]%
		{(-6,4)(-2,-2)(3,3.5)}
	\FindMin[Method=interpo,Tension=1]{(-6,4)(-2,-2)(3,3.5)}[interpo-min]
	\MarkPts*[Color=blue]{(interpo-min)}
	\GetXYcoord{(interpo-min)}[\MinInterpoX][\MinInterpoY]
\end{GraphTikz}\\
The minimum is $M\approx\RoundNb[3]{\MinInterpoY}$, reached at $x\approx\RoundNb[3]{\MinInterpoX}$
\end{tcblisting}

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}%
	[x=1.2cm,y=1.6cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=3,Ygrid=0.5,Ygrids=0.25]
	\DrawAxisGrids[Enlarge=2.5mm]{auto}{auto}
	\def\LISTETEST{-6/2/0§-1/-2/0§2/1/0§3.5/0/-1}
	\DefineSplineCurve[Name=splinetest,Trace]{\LISTETEST}
	\FindMin[Method=spline]{\LISTETEST}[spline-min]
	\MarkPts*[Color=red]{(spline-min)}
\end{GraphTikz}
\end{tcblisting}

\pagebreak

\subsection{Integrals (improved version)}\label{integr}

We can also work with integrals.

In this case it is preferable to highlight the domain \textbf{before} the plots, to avoid overprinting in relation to the curves/points.

\smallskip

It is possible to :

\begin{itemize}
	\item represent an integral \textbf{under} a defined curve;
	\item represent an integral \textbf{between} two curves;
	\item the integration limits can be x-coordinates and/or nodes.
\end{itemize}

\smallskip

{\small\faBomb} Given the differences in processing between formula curves, simple interpolation curves or cubic interpolation curves, the arguments and keys may differ depending on the configuration!

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
%in the GraphiqueTikz environment
\DrawIntegral[keys]<specific options>{object1}[object2]{A}{B}
\end{tcblisting}

The optional \MontreCode{[keys]} for definition or tracing are:

\begin{itemize}
	\item \MontreCode{Colors} =: colors of the filling, in the form \MontreCode{Col} or \MontreCode{ColBorder/ColBg} (\MontreCode{gray} by default);
	\item \MontreCode{Style}: type of filling, among \MontreCode{fill}/\MontreCode{hatch} (\MontreCode{fill} by default);
	\item \MontreCode{Opacity}: opacity (\MontreCode{0.5} by default) of the filling;
	\item \MontreCode{Hatch}: style (\MontreCode{north west lines} by default) of the hatch filling;
	\item \MontreCode{Type}: type of integral among
	\begin{itemize}
		\item \MontreCode{fct} (default) for an integral under a curve defined by a formula;
		\item \MontreCode{spl} for an integral under a curve defined by a cubic spline;
		\item \MontreCode{itp} for an integral under a curve defined by interpolation ;
		\item \MontreCode{fct/fct} for an integral between two curves defined by a formula;
		\item \MontreCode{fct/spl} for an integral between a curve (above) defined by a formula and a curve (below) defined by a spline cubic;
		\item etc.
	\end{itemize}
	\item \MontreCode{Step}: steps (calculated by default otherwise) for the plot;
	\item \MontreCode{Junction}: junction of segments (\MontreCode{bevel} by default);
	\item \MontreCode{Bounds}: type of terminals among:
	\begin{itemize}
		\item \MontreCode{abs} for the limits given by the abscissa;
		\item \MontreCode{nodes} for the limits given by the nodes;
		\item \MontreCode{abs/node} for the limits given by abscissa and node;
		\item \MontreCode{node/abs} for the limits given by node and abscissa;
	\end{itemize}
	\item \MontreCode{Border}: boolean (\MontreCode{true} by default) to display the side lines,%
	\item \MontreCode{SplineName}: macro (important!) of the spline generated previously for a higher version spline;
	\item \MontreCode{SplineNameB}: macro (important!) of the spline generated previously for a lower version spline;
	\item \MontreCode{InterpoName}: name (important!) of the interpolation curve generated previously, in higher version;
	\item \MontreCode{InterpoBName}: name (important!) of the interpolation curve generated previously, in lower version;
	\item \MontreCode{Tension}: Tension for the interpolation curve generated previously, in higher version;
	\item \MontreCode{TensionB}: Tension of the interpolation curve generated previously, in lower version.
\end{itemize}

\smallskip

The first required argument is the spline function or curve or list of interpolation points.

\smallskip

The next optional argument is the spline function or curve or list of interpolation points.

\smallskip

The last two mandatory arguments are the limits of the integral, given in a form consistent with the key \MontreCode{Bounds}.

\pagebreak

In the case of curves defined by \textit{points}, it is necessary to work on intervals on which the first curve is \textbf{above} the second.

It will undoubtedly be interesting to work with \textit{intersections} in this case.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}%
	[x=0.6cm,y=0.06cm,
	Xmin=0,Xmax=21,Xgrid=1,Xgrids=0.5,
	Ymin=0,Ymax=155,Ygrid=10,Ygrids=5]
	\DrawAxisGrids[Grads=false,Enlarge=2.5mm]{}{}
	\DefineCurve[Name=cf,Start=1,End=20,Color=red]<f>{80*x*exp(-0.2*x)}
	\DrawIntegral
		[Bounds=abs,Colors=blue/cyan!50]%
		{f(x)}{3}{12}
	\DrawCurve[Color=red,Start=1,End=20]{f(x)}
	\DrawAxisGrids%
		[Grid=false,Enlarge=2.5mm,Font=\small]{0,1,...,20}{0,10,...,150}
\end{GraphTikz}
\end{tcblisting}

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}%
	[x=1.2cm,y=1.6cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=3,Ygrid=0.5,Ygrids=0.25]
	\DrawAxisGrids[Grads=false,Enlarge=2.5mm]{}{}
	\def\LISTETEST{-6/2/0§-1/-2/0§2/1/0§3.5/0/-1}
	\DefineSplineCurve[Name=splinetest]{\LISTETEST}
	\DrawIntegral[Type=spl,Style=hatch,Colors=purple]{splinetest}{-5.75}{-4.75}
	\DrawIntegral[Type=spl,Colors=blue]{splinetest}{-2}{-1}
	\DrawIntegral[Type=spl,Colors=orange]{splinetest}{1}{3}
	\DrawSplineCurve[Color=olive]{\LISTETEST}
	\DrawAxisGrids[Grid=false,Enlarge=2.5mm]
		{-7,-6,...,4}%
		{-3,-2.5,...,3}
\end{GraphTikz}
\end{tcblisting}

\pagebreak

\subsection{Tangents}\label{tgte}

The idea of this command is to draw the tangent to a previously defined curve, specifying:

\begin{itemize}
	\item the point (abscissa or node) at which we wish to work;
	\item possibly the direction (in the case of a discontinuity or a terminal);
	\item possibly the step ($h$) of the calculation;
	\item the \textit{lateral spacings} to draw the tangent.
\end{itemize}

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
%in the GraphiqueTikz environment
\DrawTangent[keys]{function or curve}{point}<line options>
\end{tcblisting}

The optional \MontreCode{[keys]} for definition or tracing are:

\begin{itemize}
	\item \MontreCode{Colors} =: colors of the plots, in the form \MontreCode{Col} or \MontreCode{ColLine/ColPoint} (\MontreCode{black} by default);
	\item \MontreCode{OffsetL} =: left horizontal spacing to start the trace (\MontreCode{1} by default);
	\item \MontreCode{OffsetR} =: left horizontal spacing to start the trace (\MontreCode{1} by default);
	\item \MontreCode{DispPt}: boolean to display the support point (\MontreCode{false} by default);
	\item \MontreCode{Spline}: boolean to specify that a spline is used (\MontreCode{false} by default);
	\item \MontreCode{h}: delta $h$ used for calculations (\MontreCode{0.01} by default);
	\item \MontreCode{Direction}: allows you to specify the \textit{direction} of the tangent, among \MontreCode{lr}/\MontreCode{l}/\MontreCode{r} (\MontreCode{lr} by default);
	\item \MontreCode{Node}: boolean to specify that a node is used (\MontreCode{false} by default).
\end{itemize}

\smallskip

The first required argument is the spline function or curve (if applicable).

\smallskip

The last mandatory argument is the work point (abscissa version or node following the key \MontreCode{Node}).

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}%
	[x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
	Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
	\DrawAxisGrids[Enlarge=2.5mm,Font=\small]{4,5,...,20}{40,42,...,56}
	\DefineCurve[Name=cf,Start=5,End=19,Color=red,Trace]<f>{-2*x+3+24*log(2*x)}
	\FindCounterimage[Color=teal,Name=JKL,Disp=false]{cf}{53}
	%tangent
	\DrawTangent%
		[Colors=cyan/gray,OffsetL=2.5,OffsetR=2.5,Node,DispPt]{f}{(JKL-1)}
\end{GraphTikz}
\end{tcblisting}

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}%
	[x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
	\DrawAxisGrids[Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
	\def\LISTETEST{-6/4/-0.5§-5/2/-2§-4/0/-2§-2/-2/0§1/2/2§3/3.5/0.5}
	\DefineSplineCurve[Name=splinetest,Trace,Color=olive]{\LISTETEST}
	\DrawTangent[Colors=red,Spline,DispPt]{splinetest}{1}
	\DrawTangent%
	[Colors=blue,Spline,OffsetL=1.5,OffsetR=1.5,DispPt]{splinetest}{-3}%
		<tkzgrpharrowlr>
	\DrawTangent[Direction=l,Colors=orange,Spline,OffsetL=1.5,DispPt]{splinetest}{3}
	\DrawTangent[Direction=r,Colors=purple,Spline,OffsetR=1.5,DispPt]{splinetest}{-6}
\end{GraphTikz}
\end{tcblisting}

\pagebreak

%\section{Specific commands for density functions}
%
%\subsection{Normal distribution}\label{normal distribution}
%
%The idea is to provide something to work with standard deviation.
%
%\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
%	%in the GraphiqueTikz environment
%	\DefineNormalDistribution[keys]<fct name>{mu}{sigma}
%	\TraceNormalDistribution[keys]{fct(x)}
%\end{tcblisting}
%
%The optional \MontreCode{[keys]} available are:
%
%\smallskip
%
%\begin{itemize}
%	\item \MontreCode{Name}: name of the plot (\MontreCode{Gaussian} by default);
%	\item \MontreCode{Trace}: boolean to trace the curve (\MontreCode{false} by default);
%	\item \MontreCode{Couleur}: color of the trace, if requested (\MontreCode{black} by default);
%	\item \MontreCode{Debut}: lower bound of the definition set (\MontreCode{\textbackslash pflxmin} by default);
%	\item \MontreCode{End}: lower bound of the definition set (\MontreCode{\textbackslash pflxmax} by default);
%	\item \MontreCode{Pas}: plot step (it is determined \textit{automatically} at the start but can be modified).
%\end{itemize}
%
%Note that the vertical axis must be adapted according to the parameters of the normal law.
%
%\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
%	\begin{GraphTikz}%
%		[x=1.25cm,y=15cm,Origx=5,Xmin=5,Xmax=15,Ymin=0,Ymax=0.3,
%		Ygrid=0.1,Ygrids=0.05]
%		\DrawAxisGrids[Enlarge=2.5mm]{auto}{auto}
%		\DefineNormalDistribution[Name=Gaussian]<phi>{10}{1.5}
%		\TracerIntegral
%		[Terminals=abs, Colors=blue/cyan!50]%
%		{phi(x)}{7}{13}
%		\TraceNormalLaw[Color=purple,Start=5,End=15]{phi(x)}
%	\end{GraphTikz}
%\end{tcblisting}
%
%\pagebreak
%
%\subsection{Chi-square law}\label{loikhideux}
%
%The idea is to provide something to work with normal laws.
%
%\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
%	%in the GraphiqueTikz environment
%	\DefineKhiTwoLaw[keys]<fct name>{k}
%	\TraceLawKhiTwo[keys]{fct(x)}
%\end{tcblisting}
%
%The optional \MontreCode{[keys]} available are:
%
%\smallskip
%
%\begin{itemize}
%	\item \MontreCode{Name}: name of the plot (\MontreCode{Gaussian} by default);
%	\item \MontreCode{Trace}: boolean to trace the curve (\MontreCode{false} by default);
%	\item \MontreCode{Couleur}: color of the trace, if requested (\MontreCode{black} by default);
%	\item \MontreCode{Debut}: lower bound of the definition set (\MontreCode{\textbackslash pflxmin} by default);
%	\item \MontreCode{End}: lower bound of the definition set (\MontreCode{\textbackslash pflxmax} by default);
%	\item \MontreCode{Pas}: plot step (it is determined \textit{automatically} at the start but can be modified).
%\end{itemize}
%
%Note that the vertical axis must be adapted according to the parameter of the chi-square law.
%
%\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
%	\begin{GraphTikz}[
%		x=1.5cm,y=7.5cm,
%		Xmin=0,Xmax=8,Xgrid=1,Xgrids=0.5,
%		Ymin=0,Ymax=0.5,Ygrid=0.1,Ygrids=0.05
%		]
%		\DrawAxisGrids[Enlarge=2.5mm]{auto}{auto}
%		\DefineKhiTwoLaw[Color=red,Start=0.25,Trace]<phiA>{1}
%		\DefineKhiTwoLaw[Color=blue,Trace]<phiB>{2}
%		\DefineLawKhiDeux[Color=orange,Trace]<phiC>{3}
%		\DefineKhiTwoLaw[Color=purple,Trace]<phiD>{4}
%		\DefineKhiTwoLaw[Color=yellow,Trace]<phiE>{5}
%		\DefineKhiTwoLaw[Color=teal,Trace]<phiF>{6}
%	\end{GraphTikz}
%\end{tcblisting}

\pagebreak

\section{Commands specific to two-variable statistics}

\subsection{The point cloud}\label{scatter}

In addition to commands linked to functions, it is also possible to represent double statistical series.

\smallskip

The following paragraph shows that adding a key allows you to add the linear adjustment line.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
%in the GraphiqueTikz environment
\DrawScatter[keys]{ListX}{ListY}
\end{tcblisting}

The optional \MontreCode{[key]} is:

\smallskip

\begin{itemize}
	\item \MontreCode{ColorScatter}: color of the cloud points (\MontreCode{black} by default).
\end{itemize}

\smallskip

The mandatory arguments allow you to specify:

\smallskip

\begin{itemize}
	\item the list of x;
	\item the list of y.
\end{itemize}

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}%
	[x=0.075cm,y=0.03cm,Xmin=0,Xmax=160,Xgrid=20,Xgrids=10,
	Origy=250,Ymin=250,Ymax=400,Ygrid=25,Ygrids=5]
	%window preparation
	\DrawAxisGrids[Enlarge=2.5mm,Font=\small]{0,10,...,160}{250,275,...,400}
	%A cloud of dots
	\DrawScatter[Style=x,ColorScatter=red]{0,50,100,140}{275,290,315,350}
\end{GraphTikz}
\end{tcblisting}

\subsection{The regression line}\label{reglin}

The linear regression line (obtained by the least squares method) can easily be added, using the key \MontreCode{DrawLine}.

\smallskip

In this case, new keys are available:

\smallskip

\begin{itemize}
	\item \MontreCode{ColorLine}: color of the line (\MontreCode{black} by default);
	\item \MontreCode{Rounds}: precision of coefficients (\MontreCode{empty} by default);
	\item \MontreCode{Start}: initial abscissa of the plot (\MontreCode{\textbackslash pflxmin} by default);
	\item \MontreCode{End}: terminal abscissa of the plot (\MontreCode{\textbackslash pflxmax} by default);
	\item \MontreCode{Name}: name of the line, for later use (\MontreCode{reglin} by default).
\end{itemize}

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphTikz}%
	[x=0.075cm,y=0.03cm,Xmin=0,Xmax=160,Xgrid=20,Xgrids=10,
	Origy=250,Ymin=250,Ymax=400,Ygrid=25,Ygrids=5]
	\DrawAxisGrids[Enlarge=2.5mm,Font=\small]{0,10,...,160}{250,275,...,400}
	%cloud and right
	\DrawScatter%
		[ColorScatter=red,ColorLine=brown,DrawLine]%
	{0,50,100,140}{275,290,315,350}
	%picture
	\DrawRanges[Colors=cyan/magenta,Lines]{d}{120}
	%history
	\DrawCounterimage[Style=x,Colors=blue/green!50!black,Lines]{reglin}{300}
\end{GraphTikz}
\end{tcblisting}

\subsection{Other regressions}\label{regressions}

In partnership with the \MontreCode{xint-regression} package, loaded by the package (but \textit{can be deactivated} via the \MontreCode{[noxintreg]} option), it is possible to work on other types of regression:

\begin{itemize}
	\item linear \fbox{$ax+b$};
	\item quadratic \fbox{$ax^2+bx+c$};
	\item cubic \fbox{$ax^3+bx^2+cx+d$};
	\item power \fbox{$ax^b$};
	\item exponential \fbox{$ab^x$} or \fbox{$e^{ax+b}$} or \fbox{$b e^{ax}$} or \fbox{$C + be^{ax} $};
	\item logarithmic \fbox{$a+b\ln(x)$};
	\item hyperbolic  \fbox{$a+\displaystyle\frac{b}{x}$}.
\end{itemize}

The command, similar to that of defining a curve, is:

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
\DrawRegression[keys]<no fct>{type}<rounded>{listex}{listey}
\end{tcblisting}

The \MontreCode{[keys]} available are, classically:

\begin{itemize}
	\item \MontreCode{Start}: lower bound of the definition set (\MontreCode{\textbackslash pflxmin} by default);
	\item \MontreCode{End}: lower bound of the definition set (\MontreCode{\textbackslash pflxmax} by default);
	\item \MontreCode{Name}: name of the curve (important for the rest!);
	\item \MontreCode{Color}: color of the trace (\MontreCode{black} by default);
	\item \MontreCode{Step}: plot step (it is determined \textit{automatically} at the start but can be modified).
\end{itemize}

\pagebreak

The second argument, optional and between \MontreCode{<...>}, allows you to name the regression function.

The third argument, mandatory and between \MontreCode{\{...\}} allows you to choose the type of regression, among:

\begin{itemize}
	\item \MontreCode{lin}: linear \fbox{$ax+b$};
	\item \MontreCode{quad}: quadratic \fbox{$ax^2+bx+c$};
	\item \MontreCode{cub}: cubic \fbox{$ax^3+bx^2+cx+d$};
	\item \MontreCode{pow}: power \fbox{$ax^b$};
	\item \MontreCode{expab}: exponential \fbox{$ab^x$}
	\item \MontreCode{hyp}: hyperbolic \fbox{$a+\displaystyle\frac{b}{x}$};
	\item \MontreCode{log}: logarithmic \fbox{$a+b\ln(x)$};
	\item \MontreCode{exp}: exponential \fbox{$e^{ax+b}$};
	\item \MontreCode{expalt}: exponential \fbox{$be^{ax}$};
	\item \MontreCode{expoff=C}: exponential \fbox{$C + be^{ax}$}.
\end{itemize}

The fourth argument, optional and between \MontreCode{<...>}, allows you to specify the rounding(s) for the coefficients of the regression function.

The last two arguments are the lists of values of X and Y.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\def\LISTEXX{0,50,100,140}\def\LISTEYY{275,290,315,350}%
ListX := \LISTEXX\\
ListY := \LISTEYY

\begin{GraphTikz}
	[x=0.05cm,y=0.04cm,Xmin=0,Xmax=160,Xgrid=20,Xgrids=10,
	Origy=250,Ymin=250,Ymax=400,Ygrid=25,Ygrids=5]
	%window preparation
	\DrawAxisGrids[Enlarge=2.5mm,Font=\footnotesize]{auto}{auto}
	%A cloud of dots
	\DrawScatter[Style=o,ColorScatter=red]{\LISTEXX}{\LISTEYY}
	%adjustment expoffset
	\DrawRegression[Color=blue,Name=adjust]<adjust>{expoff=250}{\LISTEXX}{\LISTEYY}
	%holdings
	\DrawRanges[Colors=cyan/magenta,Lines]{adjust}{80}
	\DrawCounterimage[Style=x,Colors=blue/green!50!black,Lines]{adjust}{325}
\end{GraphTikz}

\xintexpoffreg[offset=250,round=3/1]{\LISTEXX}{\LISTEYY}%
We obtain $y=250+\num{\expregoffb}\text{e}^{\num{\expregoffa}x}$
\end{tcblisting}

\newpage

\section{Auxiliary commands}

\subsection{Intro}

In addition to purely \textit{graphic} commands, some auxiliary commands are available:

\begin{itemize}
	\item a to format a number with a given precision;
	\item one for working on random numbers, with constraints.
\end{itemize}

\subsection{Formatted rounding}\label{round number}

The \MontreCode{\textbackslash RoundNb} command allows you to format, using the \MontreCode{siunitx} package, a number (or a calculation), with a given precision. This can be \textit{useful} for formatting results obtained using coordinate retrieval commands, for example.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
\RoundNb[precision]{xint calculation}
\end{tcblisting}

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\RoundNb{1/3}\\
\RoundNb{16.1}\\
\RoundNb[3]{log(10)}\\
\end{tcblisting}

\subsection{Random number under constraints}\label{nbalea}

The idea of this second command is to be able to determine a random number:

\begin{itemize}
	\item integer or decimal;
	\item under constraints (between two fixed values).
\end{itemize}

This can allow, for example, to work on curves with \textit{random} points, but respecting certain constraints.

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
\PickRandomNb(*)[precision (def 0)]{lower limit}{upper limit}[\macro]
\end{tcblisting}

The star version takes the constraints in strict form ($\text{lower bound} < \text{macro} < \text{upper bound}$) while the normal version takes the constraints in broad form ($\text{lower bound) } \leq \text{macro} \leq \text{upper bound}$).

\smallskip

Note that the \textit{terminals} can be existing \textit{macros}!

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
%a number (2 digits after the decimal point) between 0.75 and 0.95
%a number (2 digits after the decimal point) between 0.05 and 0.25
%a number (2 decimal places) between 0.55 and \YrandMax
%a number (2 decimal places) between \YrandMin and 0.45
\PickRandomNb[2]{0.75}{0.95}[\YrandMax]%
\PickRandomNb[2]{0.05}{0.25}[\YrandMin]%
\PickRandomNb*[2]{0.55}{\YrandMax}[\YrandA]%
\PickRandomNb*[2]{\YrandMin}{0.45}[\YrandB]%
%verification
\num{\YrandMax} \& \num{\YrandMin} \& \num{\YrandA} \& \num{\YrandB}
\end{tcblisting}

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
%a number (2 digits after the decimal point) between 0.75 and 0.95
%a number (2 digits after the decimal point) between 0.05 and 0.25
%a number (2 decimal places) between 0.55 and \YrandMax
%a number (2 decimal places) between \YrandMin and 0.45
\PickRandomNb[2]{0.75}{0.95}[\YrandMax]%
\PickRandomNb[2]{0.05}{0.25}[\YrandMin]%
\PickRandomNb*[2]{0.55}{\YrandMax}[\YrandA]%
\PickRandomNb*[2]{\YrandMin}{0.45}[\YrandB]%
%verification
\num{\YrandMax} \& \num{\YrandMin} \& \num{\YrandA} \& \num{\YrandB}
\end{tcblisting}

\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
%the curve is designed so that there are 3 antecedents
\PickRandomNb[2]{0.75}{0.95}[\YrandMax]%
\PickRandomNb[2]{0.05}{0.25}[\YrandMin]%
\PickRandomNb*[2]{0.55}{\YrandMax}[\YrandA]%
\PickRandomNb*[2]{\YrandMin}{0.45}[\YrandB]%

\begin{GraphTikz}
	[x=0.075cm,y=7.5cm,Xmin=0,Xmax=150,Xgrid=10,Xgrids=5,
	Ymin=0,Ymax=1,Ygrid=0.1,Ygrids=0.05]
	\DrawAxisGrids[Last,Enlarge=2.5mm]{auto}{auto}
	\DefineInterpoCurve[Color=red,Trace,Name=functiontest,Tension=0.75]
		{(0,\YrandA)(40,\YrandMin)(90,\YrandMax)(140,\YrandB)}
	\FindCounterimage[Disp=false,Name=ANTECED]{functiontest}{0.5}
	\DrawCounterimage[Colors=blue/teal,Lines]{functiontest}{0.5}
	\GetXcoord{(ANTECED-1)}[\Aalpha]
	\GetXcoord{(ANTECED-2)}[\Bbeta]
	\GetXcoord
	{(ANTECED-3)}[\Cgamma]
\end{GraphTikz}

The solutions of $f(x)=\num{0.5}$ are, by graphic reading:
$\begin{cases}
	\alpha \approx \RoundNb[0]{\Aalpha} \\
	\beta \approx \RoundNb[0]{\Bbeta} \\
	\gamma \approx \RoundNb[0]{\Cgamma}
\end{cases}$.
\end{tcblisting}
%
%\newpage
%
%\section{Liste des commandes}
%
%Les commandes disponibles sont :
%
%\NewDocumentCommand\lstcmd{ m m m }{%
%	\item[\texttt{#1}] : \mintinline{latex}|#2|\hfill{}page \pageref{#3}
%}
%
%\begin{description}
%	\lstcmd{environnement~~}{\begin{GraphiqueTikz}...\end{GraphiqueTikz}}{creaenvt}
%	\lstcmd{axes et grilles}{\TracerAxesGrille}{creaaxesgr}
%	\lstcmd{aj val axes X~~}{\RajouterValeursAxeX}{ajoutvals}
%	\lstcmd{aj val axes Y~~}{\RajouterValeursAxeY}{ajoutvals}
%	\lstcmd{def fonction~~~}{\DefineCurve}{deftracfct}
%	\lstcmd{tracé courbe~~~}{\DrawCurve}{deftracfct}
%	\lstcmd{def interpo~~~~}{\DefineCurveInterpo}{deftracinterpo}
%	\lstcmd{tracé interpo~~}{\DrawCurveInterpo}{deftracinterpo}
%	\lstcmd{def spline~~~~~}{\DefineSplineCurve}{deftracfctspline}
%	\lstcmd{tracé spline~~~}{\DrawSplineCurve}{deftracfctspline}
%	\lstcmd{tracé droite~~~}{\TracerDroite}{tracdroite}
%	\lstcmd{def points~~~~~}{\DefinirPts}{defpts}
%	\lstcmd{def image~~~~~~}{\DefinirImage}{defpts}
%	\lstcmd{marq pts~~~~~~~}{\MarquerPts}{markpts}
%	\lstcmd{placer txt~~~~~}{\PlacerTexte}{placetxt}
%	\lstcmd{récup absc~~~~~}{\RecupererAbscisse}{recupcoordo}
%	\lstcmd{récup ordo~~~~~}{\RecupererOrdonnee}{recupcoordo}
%	\lstcmd{récup coordos~~}{\RecupererCoordonnees}{recupcoordo}
%	\lstcmd{images~~~~~~~~~}{\PlacerImages}{images}
%	\lstcmd{antécédents~~~~}{\TrouverAntecedents}{defanteced}
%	\lstcmd{antécédents~~~~}{\PlacerAntecedents}{tracanteced}
%	\lstcmd{intersection~~~}{\TrouverIntersections}{intersect}
%	\lstcmd{maximum~~~~~~~~}{\TrouverMaximum}{maximum}
%	\lstcmd{minimum~~~~~~~~}{\TrouverMinimum}{minimum}
%	\lstcmd{intégrale~~~~~~}{\DrawIntegral}{integr}
%	\lstcmd{tangente~~~~~~~}{\DrawTangente}{tgte}
%	\lstcmd{loi normale~~~~}{\DefinirLoiNormale}{loinormale}
%	\lstcmd{loi normale~~~~}{\TracerLoiNormale}{loinormale}
%	\lstcmd{loi khideux~~~~}{\DefinirLoiKhiDeux}{loikhideux}
%	\lstcmd{loi khideux~~~~}{\TracerLoiKhiDeux}{loikhideux}
%	\lstcmd{stats 2 var~~~~}{\TracerNuage}{nuage}
%	\lstcmd{regressions~~~~}{\TracerAjustement}{regressions}
%	\lstcmd{arrondi~~~~~~~~}{\RoundNb}{numarrond}
%	\lstcmd{nb aléat~~~~~~~}{\ChoisirNbAlea}{nbalea}
%\end{description}

\pagebreak

\section{History}

\begin{quote}
\begin{verbatim}
0.1.5 : Initial version [en]
\end{verbatim}
\end{quote}

\end{document}