summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pgf/contrib')
-rw-r--r--graphics/pgf/contrib/circuitikz/README.md4
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/changelog.tex62
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdfbin13460 -> 13867 bytes
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdfbin1761778 -> 2431321 bytes
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex189
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/circuitikz.sty4
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex318
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex226
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex4
-rw-r--r--graphics/pgf/contrib/liftarm/README.md12
-rw-r--r--graphics/pgf/contrib/liftarm/liftarm.pdfbin2004786 -> 2192283 bytes
-rw-r--r--graphics/pgf/contrib/liftarm/liftarm.sty1208
-rw-r--r--graphics/pgf/contrib/liftarm/liftarm.tex689
-rw-r--r--graphics/pgf/contrib/profsio/doc/ProfSio-doc-annexe71.pdfbin0 -> 17705 bytes
-rw-r--r--graphics/pgf/contrib/profsio/doc/ProfSio-doc-annexe71.tex18
-rw-r--r--graphics/pgf/contrib/profsio/doc/ProfSio-doc-annexe72.pdfbin0 -> 25368 bytes
-rw-r--r--graphics/pgf/contrib/profsio/doc/ProfSio-doc-annexe72.tex19
-rw-r--r--graphics/pgf/contrib/profsio/doc/ProfSio-doc-annexe73.pdfbin0 -> 23829 bytes
-rw-r--r--graphics/pgf/contrib/profsio/doc/ProfSio-doc-annexe73.tex19
-rw-r--r--graphics/pgf/contrib/profsio/doc/ProfSio-doc-fr.pdfbin498503 -> 570243 bytes
-rw-r--r--graphics/pgf/contrib/profsio/doc/ProfSio-doc-fr.tex102
-rw-r--r--graphics/pgf/contrib/profsio/tex/ProfSio.sty321
-rw-r--r--graphics/pgf/contrib/tikzducks/DEPENDS.txt3
-rw-r--r--graphics/pgf/contrib/tikzducks/README.md29
-rw-r--r--graphics/pgf/contrib/tikzducks/t-tikzducks.mkiv2
-rw-r--r--graphics/pgf/contrib/tikzducks/tikzducks-doc-settings.sty26
-rw-r--r--graphics/pgf/contrib/tikzducks/tikzducks-doc.pdfbin416529 -> 412000 bytes
-rw-r--r--graphics/pgf/contrib/tikzducks/tikzducks-doc.tex314
-rw-r--r--graphics/pgf/contrib/tikzducks/tikzducks.sty2
-rw-r--r--graphics/pgf/contrib/tkz-grapheur/README.md7
-rw-r--r--graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-fr.pdfbin0 -> 724065 bytes
-rw-r--r--graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-fr.tex1535
-rw-r--r--graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-exemples-integrales.pdfbin0 -> 141384 bytes
-rw-r--r--graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-exemples-integrales.tex251
-rw-r--r--graphics/pgf/contrib/tkz-grapheur/tex/tkz-grapheur.sty1679
35 files changed, 6082 insertions, 961 deletions
diff --git a/graphics/pgf/contrib/circuitikz/README.md b/graphics/pgf/contrib/circuitikz/README.md
index 584e271042..30e3589b74 100644
--- a/graphics/pgf/contrib/circuitikz/README.md
+++ b/graphics/pgf/contrib/circuitikz/README.md
@@ -37,6 +37,8 @@ in the preamble and compile away, both with PS and PDF target output.
It is higly recommended to go through the [tutorials in the manual](https://circuitikz.github.io/circuitikz/circuitikzmanualgit.pdf#c) and to learn a bit of Ti*k*Z before for example, go through at least the [basic Ti*k*Z one](https://tikz.dev/tutorial), but there are more suggestions in the documentation.
+*Notice* that for the time being, due to [this bug](https://bugs.launchpad.net/ubuntu/+source/context/+bug/2058409), automatic (CI) checks for ConTeXt compatibility is disabled. I (Romano) am still checking it at home, but I am not able to have it integrated in the CI.
+
### Development or newer version
If you want to use the git version, go to the [GitHub page for the project](https://circuitikz.github.io/circuitikz/), download the last version (or the one you want to use) — it's the links called "download the latest version in a single file". You will have a file called `circuitikzgit.sty` that you should put somewhere in your LaTeX input path; the best place is in the same directory where your main file live. Then, just use it instead of the normal one:
@@ -53,7 +55,7 @@ Be aware that options and style files can (and do) change between versions, so y
### Older version
-There is a roll-back mechanism in the package, that let you use older versions if you need them; the details are in the manual, look at the section named *"Incompabilities between versions"* for details.
+There is a roll-back mechanism in the package, that let you use older versions if you need them; the details are in the manual, look at the section named *"Incompatibilities between versions"* for details.
You have all the code and the corresponding manual available in the [in the github page](http://circuitikz.github.io/circuitikz/) of the project, since version 0.6 onward.
diff --git a/graphics/pgf/contrib/circuitikz/doc/changelog.tex b/graphics/pgf/contrib/circuitikz/doc/changelog.tex
index c79304aa16..0806a20b78 100644
--- a/graphics/pgf/contrib/circuitikz/doc/changelog.tex
+++ b/graphics/pgf/contrib/circuitikz/doc/changelog.tex
@@ -5,6 +5,62 @@ full list of changes.
\begin{itemize}
\item
+ Version 1.6.9 (2024-05-25)
+
+ Several new components and a bug fix for a nasty long-standing bug
+ about switching diode types.
+
+ \begin{itemize}
+ \tightlist
+ \item
+ Added a Relais-Shape (contributed by
+ \href{https://github.com/circuitikz/circuitikz/pull/795}{Jakob
+ ``DraUX'' on GitHub}
+ \item
+ Added a center tap anchor for tube filament (suggested by
+ \href{https://github.com/circuitikz/circuitikz/issues/792}{user
+ bogger33 on GitHub})
+ \item
+ Added neon lamps (two versions, suggested by
+ \href{https://github.com/circuitikz/circuitikz/issues/793}{user
+ bogger33 on GitHub})
+ \item
+ Added a configurable spark gap (suggested by
+ \href{https://github.com/circuitikz/circuitikz/issues/800}{user
+ bogger33 on GitHub})
+ \item
+ Fix a long-standing problem when
+ \href{https://github.com/circuitikz/circuitikz/issues/794}{(locally)
+ switching diode type}
+ \end{itemize}
+\item
+ Version 1.6.8 (2024-05-05)
+
+ Several new components, more anchors, a bit of documentation
+ enhancement; maybe the biggest change is the new ``flexible'' tube.
+
+ \begin{itemize}
+ \tightlist
+ \item
+ Added \texttt{mid} anchor to all traditional switches
+ \item
+ Added a slashed generic European-style resistor (thanks to
+ \href{https://tex.stackexchange.com/q/711702/38080}{Jana})
+ \item
+ Added a multi-anode tube for implementing nixies and vfd (thanks to
+ \href{https://github.com/circuitikz/circuitikz/issues/785}{GitHub
+ user nogger33})
+ \item
+ Switch the default compiler to pdflatex (see
+ https://tex.stackexchange.com/q/709273/38080)
+ \item
+ Added a warning about color and engine in the documentation
+ \item
+ Enhanced the documentation for instruments (thanks to
+ \href{https://github.com/circuitikz/circuitikz/issues/787}{Github
+ user mxxmxm})
+ \end{itemize}
+\item
Version 1.6.7 (2024-02-09)
Several new blocks, more flexible generic anchors for blocks, and a
@@ -325,7 +381,7 @@ full list of changes.
B. Cameron, user \texttt{@cameroncb1} on GitHub)
\item
Added Shockley diode (suggested by
- {[}@dauph{]}(https://tex.stackexchange.com/questions/646039/creating-a-shockley-diode-in-circuitikz))
+ \href{https://tex.stackexchange.com/questions/646039/creating-a-shockley-diode-in-circuitikz}{@dauph})
\end{itemize}
\item
Version 1.5.2 (2022-05-08)
@@ -439,7 +495,7 @@ full list of changes.
Robustify some shapes: do not let arrows option pass to the inner
drawing (see
\href{https://tex.stackexchange.com/a/632084/38080}{here} and
- \href{https://matrix.to/\#/!NuxCISwYQJuyWwNsEI:matrix.org/$vQO6luq1F66LJ79dERmaqKI46qMBcjStqYCPi725uZE?via=matrix.org\&via=2krueger.de\&via=im.f3l.de}{here})
+ \href{https://matrix.to/\#/!NuxCISwYQJuyWwNsEI:matrix.org/$vQO6luq1F66LJ79dERmaqKI46qMBcjStqYCPi725uZE?via=matrix.org&via=2krueger.de&via=im.f3l.de}{here})
\item
Add warning about global draw options in the manual
\item
@@ -1503,7 +1559,7 @@ A detailed list of changes can be seen below.
\item
Fixed varcap symbol at small scalings
\item
- New packet-option "straightvoltages, to draw straight(no curved)
+ New packet-option ``straightvoltages, to draw straight(no curved)
voltage arrows
\item
New option ``invert'' to revert the node direction at paths
diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf b/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf
index add5ceae2a..cc6865c72f 100644
--- a/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf
+++ b/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf
index c21540a9be..9f3d2b57e0 100644
--- a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf
+++ b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
index c775d7f9fc..ac116af09e 100644
--- a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
+++ b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
@@ -193,6 +193,13 @@ Finally, the \TikZ{} library \texttt{bending} is loaded by the package, and its
\subsection{Related and extension packages}
+\subsubsection{Related packages}
+
+At the Friedrich-Alexander-Universität, a group of developers are implementing a graphical interface to draw circuits with \Circuitikz{}.
+You can find more information \href{https://github.com/circuitikz/circuitikz/issues/782}{in this GitHub issue} or, better, in their \href{https://ussi.e-technik.uni-erlangen.de/}{main site}.
+
+\subsubsection{Extension packages}
+
\Circuitikz{} is meant to be, as much as possible, format-agnostic (which means that it can be used from \LaTeX{}, plain \TeX{} and~\ConTeXt). It is growing in functionality and components, but not everything can be added to the package. In this section, there is a list of packages, available at CTAN, that extend or enhance \Circuitikz{} but are distributed separately.\footnote{If you have a package or know a package that should be listed here, please contact the \Circuitikz{} authors, or, better, send a pull request to the project and it will be added.}
\begin{description}
@@ -212,6 +219,7 @@ This same issue creates a lot of problems with compatibility between \Circuitikz
Also, notice that several components will interact in a funny way with global path options. Depending on the specific component, some parameters are inherited by the internal shape, and some others are reset. This is not easy to fix in general. We want some options to go through --- fill color, dashed pattern for example --- and some others to stay only in the outer path; and if the background shape needs some option for drawing the internal shape, like for example a rounded corner, it \emph{must} reset the external option. So there is no perfect solution, although since \texttt{v1.5.0} the shapes have been ``robustified'', so that by default arced corners and arrows parameters will \emph{not} be propagated into the shape.
Arrows with \texttt{to[]} components don't work, anyway, so basically avoid this situation.
+In some cases, also the engine you are using (as \texttt{pdflatex}, \texttt{xelatex}, and so on) can impact coloring in corner cases (or even not so in the corner, like in \href{https://tex.stackexchange.com/q/709273/38080}{american-style voltage source signs}).
\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
\begin{circuitikz}[]
@@ -2049,6 +2057,7 @@ If you want the arrows to behave like the legacy symbols (which are shapes), \em
\circuitdescbip{open}{Open circuit}{}
\circuitdescbip*{generic}{Generic (symmetric) bipole}{}
\circuitdescbip*{xgeneric}{Crossed generic (symmetric) bipole}{}
+ \circuitdescbip*{sgeneric}{Slashed generic bipole}{}
\circuitdescbip*{tgeneric}{Tunable generic bipole}{}
\circuitdescbip*{ageneric}{Generic asymmetric bipole}{}
\circuitdescbip*{memristor}{Memristor}{Mr}
@@ -2961,16 +2970,50 @@ A similar approach can be used for dependent sources. Just remember that the anc
\subsection{Instruments}
+\subsubsection{Basic round instruments}
+
\begin{groupdesc}
- \circuitdescbip*{ammeter}{Ammeter}{}
- \circuitdescbip*{voltmeter}{Voltmeter}{}
- \circuitdescbip*{ohmmeter}{Ohmmeter}{}
\circuitdescbip*{rmeter}{Round meter (use \texttt{t=...} for the symbol)}{}(left/135/0.2, right/45/0.2, center/-90/0.3)
\circuitdescbip*{rmeterwa}{Round meter with arrow (use \texttt{t=...} for the symbol)}{}(left/135/0.2, right/45/0.2, center/-90/0.3)
+ \circuitdescbip*{ammeter}{Legacy ammeter}{}
+ \circuitdescbip*{voltmeter}{Legacy voltmeter}{}
+ \circuitdescbip*{ohmmeter}{Legacy ohmmeter}{}
+\end{groupdesc}
+
+You can define styles if you want to use the new shapes for round instrument similarly to the legacy ones:%
+\footnote{Suggested by \href{https://github.com/circuitikz/circuitikz/issues/787}{user mxxmxn on GitHub}.}
+
+\begin{LTXexample}[varwidth=true]
+\tikzset{vmeter/.style={rmeterwa, t=V}}
+\tikzset{ameter/.style={rmeterwa, t=A}}
+\tikzset{ometer/.style={rmeterwa, t=$\Omega$}}
+
+\begin{tikzpicture}
+ % Old meter style
+ \draw (0,2) to[voltmeter] ++(2,0)
+ to[ammeter] ++(2,0)
+ to[ohmmeter] ++(2,0);
+ % New meter style
+ \draw (0,0) to[vmeter] ++(2,0)
+ to[ameter] ++(2,0)
+ to[ometer] ++(2,0);
+\end{tikzpicture}
+\end{LTXexample}
+
+\subsubsection{Square instruments}
+
+Sometimes it is better to use a shape for instruments which is very different from the round symbols used for sources.
+
+\begin{groupdesc}
\circuitdescbip*{smeter}{Square meter (use \texttt{t=...} for the symbol)}{}(left/135/0.2, right/45/0.2, center/-90/0.3, in 1/-135/.5, in 2/-45/.5)
\circuitdescbip*{qiprobe}{QUCS-style current probe}{}(left/135/0.2, right/45/0.2, center/-90/0.3)
\circuitdescbip*{qvprobe}{QUCS-style voltage probe}{}(left/135/0.2, right/45/0.2, center/-90/0.3)
\circuitdescbip*{qpprobe}{QUCS-style power probe}{}(left/135/0.2, right/45/0.2, center/-90/0.3, v+/-135/.5, v-/-45/.5)
+\end{groupdesc}
+
+\subsubsection{Oscilloscopes and current probes}
+
+\begin{groupdesc}
\circuitdescbip*[oscope]{oscope}{Oscilloscope\footnotemark}{}(left/135/0.2, right/45/0.2,
in 1/-135/0.4, in 2/-45/0.4)
\footnotetext{Suggested by \texttt{@nobrl} on GitHub}
@@ -3223,6 +3266,8 @@ Here you'll find bipoles that are not easily grouped in the categories above.
\circuitdescbip*{fuse}{Fuse}{}
\circuitdescbip*{afuse}{Asymmetric fuse}{asymmetric fuse}
\circuitdescbip{wfuse}{``wiggly'' fuse}{wiggly fuse}()[left/110/0.2, right/70/0.2]
+ \circuitdescbip*{relais}{Relais\footnotemark}{}
+ \footnotetext{Contributed by \href{https://github.com/circuitikz/circuitikz/pull/795}{Jakob «DraUX»}}
\circuitdescbip{squid}{Squid}{}
\circuitdescbip{barrier}{Barrier}{}
\circuitdescbip{openbarrier}{Open barrier}{}
@@ -3244,6 +3289,13 @@ If otherwise \texttt{americangfsurgearrester} option is active (or the style \te
\begin{groupdesc}
\circuitdescbip*{lamp}{Lamp}{}
\circuitdescbip*{bulb}{Bulb}{}
+ \circuitdescbip*{neonlampcc}{Neon lamp\footnotemark\ (double cathode style)}{}
+ \footnotetext{The neon lamps have been added in \texttt{v1.6.9} thanks to a suggestion by \href{https://github.com/circuitikz/circuitikz/issues/793}{user bogger33 on GitHub}.}
+ \circuitdescbip*{neonlampac}{Neon lamp (anode and cathode style)}{}
+ \circuitdescbip*{sparkgap}{Spark gap\footnotemark (unenclosed)}{}
+ \footnotetext{The spark gap has been added in \texttt{v1.6.9} thanks to a suggestion by \href{https://github.com/circuitikz/circuitikz/issues/800}{user bogger33 on GitHub}.}
+ \circuitdescbip*[sparkgap]{sparkgap, sparkgap/circle}{Spark gap}{}
+ \circuitdescbip*[sparkgap]{sparkgap, sparkgap/dot, sparkgap/circle}{Spark gap (gas filled)}{}
\circuitdescbip*{loudspeaker}{loudspeaker}{}( north/90/0.4, ne/45/0.4, east/0/0.4, se/-45/0.4, south/-90/0.4, sw/-135/0.4, west/180/0.4, nw/135/0.4, left/135/0.2, right/45/0.2, center/-135/0.2)
\circuitdescbip*{mic}{mic}{}( north/90/0.4, east/0/0.4, south/-90/0.4, west/180/0.4, left/135/0.2, right/45/0.2, center/-135/0.2)
\circuitdescbip*{tlmic}{tail-less mic\footnotemark}{}( north/90/0.4, east/0/0.4, south/-90/0.4, west/180/0.4, left/135/0.2, right/45/0.2, center/-135/0.2)
@@ -3281,9 +3333,9 @@ You have two types of microphones; \texttt{mic} has protruding connection and \t
\subsubsection{Miscellaneous element customization}\label{sec:tweak-misc}
-You can change the scale of all the miscellaneous elements by setting the key \texttt{misc/scale} to something different from the default \texttt{1.0}.
+You can change the scale of all the miscellaneous elements by setting the key \texttt{misc/scale} to something different from the default \texttt{1.0}; relative thickness can be controlled with \texttt{misc/thickness}.
-\paragraph{Wiggly fuses} can have (or not have) poles; you can switch between the two forms by setting to \texttt{true} or \texttt{false} (default \texttt{true}) the key \texttt{bipoles/wfuse/dots}; if they have poles, you can choose any of the pole shapes with the key \texttt{bipoles/wfuse/shape}.
+\paragraph{Wiggly fuses.} Wiggly fuses can have (or not have) poles; you can switch between the two forms by setting to \texttt{true} or \texttt{false} (default \texttt{true}) the key \texttt{bipoles/wfuse/dots}; if they have poles, you can choose any of the pole shapes with the key \texttt{bipoles/wfuse/shape}.
The pole nodes are named \texttt{-left} and \texttt{-right} so that you can access their borders.
\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
@@ -3299,6 +3351,30 @@ The pole nodes are named \texttt{-left} and \texttt{-right} so that you can acce
\end{circuitikz}
\end{LTXexample}
+\paragraph{Neon lamps.} Neon lamp ``dot'' size is the same as the size of poles (\texttt{circ} and \texttt{ocirc}), and they can be changed locally:
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\begin{tikzpicture}
+ \draw (0,0) to[neonlampcc, nodes width=0.03] ++(2,0)
+ to[neonlampac, misc/thickness=3] ++(2,0);
+\end{tikzpicture}
+\end{LTXexample}
+
+\paragraph{Spark gap.} The \texttt{sparkgap} component is similar to the (American) surge arrester, but it's more configurable; it will render bare (unenclosed) by default, but you can add a (fillable) enclosure with the key \texttt{sparkgap/circle} and a dot with \texttt{sparkgap/dot} (they are boolean keys, false by default).
+Moreover, the arrows are configurable like other arrows in the package (see~\ref{sec:tunablearrows}) using the \texttt{sparkgap end arrow} key (default \texttt{Triangle[scale=2]}). The gap is tunable with \texttt{sparkgap/gap} (default \texttt{0.05}).
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\begin{tikzpicture}
+ \draw (0,2) to[sparkgap, l=gap\textsubscript{1}] ++(2,0)
+ to[sparkgap, sparkgap/circle,
+ sparkgap/dot, l=S2] ++(2,0);
+ \ctikzset{sparkgap end arrow={Kite[scale=1.5]}}
+ \draw (0,0) to[sparkgap, l=S3] ++(2,0)
+ to[sparkgap, l=S4, sparkgap/circle,
+ sparkgap/gap=0.15] ++(2,0);
+\end{tikzpicture}
+\end{LTXexample}
+As in neon lamps, the dot (if activated by the key \texttt{sparkgap/dot}) follows the size of poles and can be changed locally.
+
+
\subsection{Multiple wires (buses)}
These are simple drawings to indicate multiple wires.
@@ -4784,7 +4860,8 @@ Note that the \verb|diodetube| is used as component name to avoid clashes with t
Normally, the filament is not drawn. If you want a filament, put the \verb|filament| option in the node description:
\begin{groupdesc}
- \circuitdesc*{diodetube,filament}{Tube Diode}{}(anode/90/0.2, filament 1/-135/0.2, filament 2/-45/0.2 )
+ \circuitdesc*{diodetube,filament}{Tube Diode\footnotemark}{}(anode/90/0.2, filament 1/-90/0.4, filament 2/-45/0.2, filament center/0/0.5 )
+ \footnotetext{The \texttt{filament center} anchor has been added in \texttt{v1.6.9} thanks to a suggestion by \href{https://github.com/circuitikz/circuitikz/issues/792}{user bogger33 on GitHub}.}
\end{groupdesc}
Sometimes, you don't want the cathode to be drawn (but you do want the filament). Use the \verb|nocathode| option in the node description:
@@ -4826,18 +4903,27 @@ fully configurable, and the attributes are described below:
\verb|tubes/filament angle| & \verb|15| & angle from the centerpoint \\
\end{tabular}
-Conventionally, the model of the tube is indicated at the \verb|east| anchor:
+Conventionally, the model of the tube is indicated at the \verb|east| anchor, and you can access filament anchors if you need them:
-\begin{LTXexample}[varwidth]
-\ctikzset{tubes/width=1.4}
-\ctikzset{tubes/height=1}
-\begin{circuitikz}
-\draw (0,0) node[triode] (Tri) {};
-\draw (Tri.east) node[right] {12AX7};
-\end{circuitikz}
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\ctikzset{tubes/width=1.4, tubes/height=1}
+\begin{circuitikz}
+ \draw (0,2) node[triode, filament] (Tri) {};
+ \draw (Tri.east) node[right] {12AX7};
+ \ctikzset{tubes/filament angle=40,
+ tubes/filament distance=0.2}
+ \draw (0,0) node[triode, filament] (Pent) {};
+ \draw (Pent.east) node[right] {BOH};
+ \path (Tri.filament 1) node[red,ocirc]{};
+ \path (Pent.filament 1) node[red,ocirc]{};
+ \path (Tri.filament center) node[blue,ocirc]{};
+ \draw (Pent.filament center) -- ++(0,-1) node[tlground]{};
+ \end{circuitikz}
\end{LTXexample}
+
+
Example triode amplifier:
\begin{lstlisting}
@@ -4947,6 +5033,60 @@ The dashed line pattern can be changed by setting the key \texttt{tubes/partial
\end{LTXexample}
+\subsubsection{Multi-anode tube}
+
+The multi-anode tube (\texttt{matube}) is a component thought to be tailored for several different usages,\footnote{It was added in \texttt{v1.6.8} after suggestions by user \texttt{bogger33} on GitHub \href{https://github.com/circuitikz/circuitikz/issues/781}{here} and \href{https://github.com/circuitikz/circuitikz/issues/785}{here}.} as shown in the examples below.
+
+The anchors for the multiple anodes have also alias names to ease the use in the case of implementing nixie tubes, because in that case the anode/cathode roles are swapped.
+
+\begin{groupdesc}
+ \circuitdesc*{matube}{Multi-anode tube}{}(anode 1/110/0.2, anode 2/60/0.2, anode 3/-30/0.2, cathode/-90/0.2, control/180/0.2 )
+ \circuitdesc*{matube, nixieanode, anodedot, nogrid}{Multi-anode tube used for nixie tubes}{}(nixie k1/110/0.2, nixie k2/60/0.2, nixie k3/-30/0.2, nixie a/-90/0.2)
+\end{groupdesc}
+
+Basically all the parameters available for triodes are available. The main difference is that the \texttt{anode width} parameter define the length of \emph{all} the anodes; those tubes are normally used with a \texttt{width} parameter bigger than \texttt{height}, to have an elongated device.
+
+The additional parameters/flags available only for \texttt{matube}s are the following.
+
+\begin{tabular}{l | l | l}
+ Key/Flag & Default value & Description\\
+ \hline
+ \texttt{anodes} & 3 & number of anodes \\
+ \texttt{anodedot} & false & substitute anodes bar for dots \\
+ \texttt{nixieanode} & false & substitute the cathode for the nixie-style anode \\
+ \texttt{nogrid} & false & suppresses the drawing of the grid \\
+\end{tabular}
+
+In the next example, we define a 10-anodes VFD tube:
+
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\tikzset{vfd 10/.style={matube, filament, nocathode,
+ circuitikz/tubes/.cd,
+ width=3.6, height=1, anodes=10, anode width=0.6,
+ cathode width=0.1,
+}}
+\begin{circuitikz}[european]
+ \draw (0,0) node[vfd 10](A){};
+ \foreach \i in {1,...,10} \path (A.anode \i)
+ node[red, ocirc]{} node[above]{\tiny \i};
+\end{circuitikz}
+\end{LTXexample}
+
+And a 10-cathodes nixie tube:
+
+
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\tikzset{nixie/.style={matube, nogrid, nixieanode,
+ anodedot, circuitikz/tubes/.cd, cathode width=0.6,
+ width=3.6, height=1, anodes=10, anode width=0.6,
+}}
+\begin{circuitikz}[european]
+\draw (0,0) node[nixie](A){};
+\foreach \i in {1,...,10} \path (A.nixie k\i)
+ node[red, ocirc]{} node[above]{\tiny \i};
+ \path (A.nixie a) node[red, ocirc]{};
+\end{circuitikz}
+\end{LTXexample}
\subsubsection{Other tubes-like components}
@@ -5831,28 +5971,28 @@ The switches can be scaled with the key \texttt{switches/scale} (default \texttt
These are all of the to-style type:
\begin{groupdesc}
- \circuitdescbip[cspst]{switch}{Switch}{spst}
+ \circuitdescbip[cspst]{switch}{Switch}{spst}(left/135/0.1, right/45/0.1, mid/90/0.3)
\circuitdescbip[cspst]{closing switch}{Closing switch}{cspst}
\circuitdescbip[ospst]{opening switch}{Opening switch}{ospst}
- \circuitdescbip[nos]{normal open switch}{Normally open switch}{nos}
+ \circuitdescbip[nos]{normal open switch}{Normally open switch}{nos}(left/135/0.1, right/45/0.1, mid/90/0.3)
\circuitdescbip[ncs]{normal closed switch}{Normally closed switch}{ncs}
\circuitdescbip[oncs]{opening normal closed switch}{Opening normally closed switch}{oncs}
\circuitdescbip[cncs]{closing normal closed switch}{Closing normally closed switch}{cncs}
\circuitdescbip[onos]{opening normal open switch}{Opening normally open switch}{onos}
\circuitdescbip[cnos]{closing normal open switch}{Closing normally open switch\footnotemark}{cnos}
\footnotetext{These last four were contributed by \href{https://tex.stackexchange.com/questions/693446/new-switch-components-for-circuitikz}{Jakob «DraUX»}}
- \circuitdescbip[pushbutton]{push button}{Normally open push button}{normally open push button, nopb}(tip/0/0.2)
- \circuitdescbip[ncpushbutton]{normally closed push button}{Normally closed push button}{ncpb}(tip/0/0.2)
- \circuitdescbip[pushbuttonc]{normally open push button closed}{Normally open push button (in closed position)}{nopbc}(tip/0/0.2)
- \circuitdescbip[ncpushbuttono]{normally closed push button open}{Normally closed push button (in open position)}{ncpbo}(tip/0/0.2)
- \circuitdescbip[toggleswitch]{toggle switch}{Toggle switch}{}
- \circuitdescbip*{reed}{Reed switch}{}
+ \circuitdescbip[pushbutton]{push button}{Normally open push button}{normally open push button, nopb}(tip/0/0.2, mid/-90/0.2)
+ \circuitdescbip[ncpushbutton]{normally closed push button}{Normally closed push button}{ncpb}(tip/0/0.2, mid/-90/0.2)
+ \circuitdescbip[pushbuttonc]{normally open push button closed}{Normally open push button (in closed position)}{nopbc}(tip/0/0.2, mid/-90/0.2)
+ \circuitdescbip[ncpushbuttono]{normally closed push button open}{Normally closed push button (in open position)}{ncpbo}(tip/0/0.2, mid/-90/0.2)
+ \circuitdescbip[toggleswitch]{toggle switch}{Toggle switch}{}(out 1/0/0.2, out 2/0/0.2, in/135/0.1, mid/-90/0.2)
+ \circuitdescbip*{reed}{Reed switch}{}(left/135/0.1, right/45/0.1, mid/90/0.3)
\end{groupdesc}
while this is a node-style component:
\begin{groupdesc}
- \circuitdesc{spdt}{spdt}{}( in/180/0.2, out 1/0/0.2, out 2/0/0.2 )
+ \circuitdesc{spdt}{spdt}{}(in/180/0.2, out 1/0/0.2, out 2/0/0.2, mid/90/0.2)
\end{groupdesc}
\begin{LTXexample}[varwidth=true]
@@ -9610,6 +9750,7 @@ after loading \Circuitikz, and it will try to patch the default commands to keep
Before 1.5.0, \Circuitikz{} used black as the default color. Now it tries to follow the current color, as \TikZ{} does normally; but notice that there is a difference with the fill strategy:
+
\begin{LTXexample}[pos=t]
\color{red}
Red text
@@ -9639,6 +9780,8 @@ Basically, you should have no problem if:
Nevertheless, if you really need to do strange things with colors you can read on; you can do almost everything but there are several glitches to take into account.
+Moreover, in some cases, also the engine you are using (as \texttt{pdflatex}, \texttt{xelatex}, and so on) can impact corner cases (or even not so corner, like in \href{https://tex.stackexchange.com/q/709273/38080}{american-style voltage source signs}).
+
\subsection{Shape colors}
The color of the components is stored in the key \verb!\circuitikzbasekey/color!. Circui\TikZ\ tries to follow the color set in \TikZ, although sometimes it fails. The following circuit will fail to draw the circuit in red if the patching of the inner commands of \TikZ{} fails, like for example in \ConTeXt{}.
diff --git a/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty b/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty
index fa00218f0f..afa91d4b2b 100644
--- a/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty
+++ b/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty
@@ -16,8 +16,8 @@
\providecommand\DeclareRelease[3]{}
\providecommand\DeclareCurrentRelease[2]{}
-\def\pgfcircversion{1.6.7}
-\def\pgfcircversiondate{2024/02/09}
+\def\pgfcircversion{1.6.9}
+\def\pgfcircversiondate{2024/05/25}
\DeclareRelease{0.4}{2012/12/20}{circuitikz-0.4-body.tex}
\DeclareRelease{v0.4}{2012/12/20}{circuitikz-0.4-body.tex}
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
index 5be686bdff..626ed28812 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
@@ -282,6 +282,26 @@
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
\pgfusepath{draw}
}
+%
+% generic slashed, suggested by Jana on TeX.stackexchange.com
+% https://tex.stackexchange.com/questions/711702/european-relay-with-circuitikz
+% inherit "generic" properties
+%
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/generic/height}}
+{sgeneric}
+{\ctikzvalof{bipoles/generic/height}}
+{\ctikzvalof{bipoles/generic/width}}
+{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+ % slash it
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
%% Generic empty tunable
\pgfcircdeclarebipolescaled{resistors}
{
@@ -805,6 +825,7 @@
\pgfcirc@activate@bipole@simple{l}{ageneric}
\pgfcirc@activate@bipole@simple{l}{tgeneric}
\pgfcirc@activate@bipole@simple{l}{xgeneric}
+\pgfcirc@activate@bipole@simple{l}{sgeneric}
\pgfcirc@activate@bipole@simple{l}{fullgeneric}
\pgfcirc@activate@bipole@simple{l}{tfullgeneric}
\pgfcirc@activate@bipole@simple{l}{short}
@@ -3675,9 +3696,9 @@
\pgf@circuit@fulldiodefalse
\ctikzset{diode/.is choice}
-\ctikzset{diode/empty/.code = \pgf@circuit@fulldiodefalse\pgf@circuit@strokediodefalse}%default
-\ctikzset{diode/full/.code = \pgf@circuit@fulldiodetrue }
-\ctikzset{diode/stroke/.code = \pgf@circuit@strokediodetrue}
+\ctikzset{diode/empty/.code = \pgf@circuit@fulldiodefalse\pgf@circuit@strokediodefalse}%default
+\ctikzset{diode/full/.code = \pgf@circuit@fulldiodetrue\pgf@circuit@strokediodefalse}
+\ctikzset{diode/stroke/.code = \pgf@circuit@fulldiodefalse\pgf@circuit@strokediodetrue}
\tikzset{full diodes/.style = { \circuitikzbasekey/diode = full}}
\tikzset{empty diodes/.style = { \circuitikzbasekey/diode = empty}}
@@ -4809,12 +4830,22 @@
\pgf@circ@subset@color@dash{switch arrows}
\pgfcirc@set@arrows{switch}{}{latexslim}
}
+\def\pgf@circ@savedanchor@trad@midlever#1#2{% #1 -> name #2 -> relative height
+ \savedanchor\midlever{% this is the full height of the "handle" of switch
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@y=\ctikzvalof{bipoles/#1/height}\pgf@circ@scaled@Rlen
+ \pgf@x=0pt\pgf@y=0.5\pgf@y
+ }
+ \anchor{mid}{\midlever\pgf@y=#2\pgf@y}
+}
%%>>>
%% Shapes Node for bipoles switches and similar things%<<<
%% (Closing) SPST
\pgfcircdeclarebipolescaled{switches}
-{}
+{
+ \pgf@circ@savedanchor@trad@midlever{spst}{0.6}
+}
{\ctikzvalof{bipoles/spst/depth}}
{cspst}
{\ctikzvalof{bipoles/spst/height}}
@@ -4836,7 +4867,9 @@
%% Opening SPST
\pgfcircdeclarebipolescaled{switches}
-{}
+{
+ \pgf@circ@savedanchor@trad@midlever{spst}{0.6}
+}
{\ctikzvalof{bipoles/spst/depth}}
{ospst}
{\ctikzvalof{bipoles/spst/height}}
@@ -4858,7 +4891,9 @@
%% Normal open Switch
\pgfcircdeclarebipolescaled{switches}
-{}
+{
+ \pgf@circ@savedanchor@trad@midlever{nos}{0.5}
+}
{\ctikzvalof{bipoles/nos/depth}}
{nos}
{\ctikzvalof{bipoles/nos/height}}
@@ -4873,7 +4908,9 @@
%% Normal closed Switch
\pgfcircdeclarebipolescaled{switches}
-{}
+{
+ \pgf@circ@savedanchor@trad@midlever{ncs}{0.5}
+}
{\ctikzvalof{bipoles/ncs/depth}}
{ncs}
{\ctikzvalof{bipoles/ncs/height}}
@@ -4892,7 +4929,9 @@
% Opening normal closed Switch
\pgfcircdeclarebipolescaled{switches}
-{}
+{
+ \pgf@circ@savedanchor@trad@midlever{ncs}{0.5}
+}
{\ctikzvalof{bipoles/ncs/depth}}
{oncs}
{\ctikzvalof{bipoles/ncs/height}}
@@ -4920,7 +4959,9 @@
%% Closing normal closed Switch
\pgfcircdeclarebipolescaled{switches}
-{}
+{
+ \pgf@circ@savedanchor@trad@midlever{ncs}{0.5}
+}
{\ctikzvalof{bipoles/ncs/depth}}
{cncs}
{\ctikzvalof{bipoles/ncs/height}}
@@ -4948,7 +4989,9 @@
%% Opening normal open Switch
\pgfcircdeclarebipolescaled{switches}
-{}
+{
+ \pgf@circ@savedanchor@trad@midlever{ncs}{0.5}
+}
{\ctikzvalof{bipoles/ncs/depth}}
{onos}
{\ctikzvalof{bipoles/ncs/height}}
@@ -4976,7 +5019,9 @@
%% Closing normal open Switch
\pgfcircdeclarebipolescaled{switches}
-{}
+{
+ \pgf@circ@savedanchor@trad@midlever{ncs}{0.5}
+}
{\ctikzvalof{bipoles/ncs/depth}}
{cnos}
{\ctikzvalof{bipoles/ncs/height}}
@@ -5006,6 +5051,8 @@
\pgfcircdeclarebipolescaled{switches}
{
\anchor{tip}{\northeast\pgf@x=0pt\relax}
+ % we can use the generic here, the "bar" is related to bipoles/*/height
+ \pgf@circ@savedanchor@trad@midlever{pushbutton}{0.5}
}
{\ctikzvalof{bipoles/pushbutton/height 2}}
{pushbutton}
@@ -5029,6 +5076,11 @@
\pgfcircdeclarebipolescaled{switches}
{
\anchor{tip}{\northeast\pgf@x=0pt\relax}
+ \savedanchor{\nodeheight}{
+ \pgf@x=0pt\pgf@y=\ctikzvalof{nodes width}\pgf@circ@Rlen
+ }
+ \anchor{mid}{\nodeheight\pgf@y=-\pgf@y}
+ % \pgf@circ@savedanchor@trad@midlever{pushbutton}{0.5}
}
{\ctikzvalof{bipoles/pushbutton/height 2}}
{ncpushbutton}
@@ -5054,11 +5106,15 @@
%% https://github.com/circuitikz/circuitikz/issues/128#issuecomment-731771299
\pgfcircdeclarebipolescaled{switches}
{
+ \savedanchor{\nodeheight}{
+ \pgf@x=0pt\pgf@y=\ctikzvalof{nodes width}\pgf@circ@Rlen
+ }
\anchor{tip}{
- \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@Rlen
+ \nodeheight\pgf@circ@res@temp=\pgf@y
\northeast\divide\pgf@y by 2\advance\pgf@y by \pgf@circ@res@temp
\pgf@x=0pt\relax
}
+ \anchor{mid}{\nodeheight}
}
{\ctikzvalof{bipoles/pushbutton/height 2}}
{pushbuttonc}
@@ -5082,11 +5138,15 @@
%% Normally closed Push Button now open
\pgfcircdeclarebipolescaled{switches}
{
+ \savedanchor{\nodeheight}{
+ \pgf@x=0pt\pgf@y=\ctikzvalof{nodes width}\pgf@circ@Rlen
+ }
\anchor{tip}{
- \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@Rlen
+ \nodeheight\pgf@circ@res@temp=\pgf@y
\northeast\divide\pgf@y by 2\advance\pgf@y by \pgf@circ@res@temp
\pgf@x=0pt\relax
}
+ \anchor{mid}{\northeast\pgf@x=0pt\pgf@y=-0.5\pgf@y}
}
{\ctikzvalof{bipoles/pushbutton/height 2}}
{ncpushbuttono}
@@ -5110,7 +5170,9 @@
}
%%% reed switches
\pgfcircdeclarebipolescaled{switches}
-{}
+{
+ \pgf@circ@savedanchor@trad@midlever{nos}{0.5}
+}
{\ctikzvalof{bipoles/reed/depth}}
{reed}
{\ctikzvalof{bipoles/reed/height}}
@@ -5237,14 +5299,10 @@
}
\pgfcircdeclarebipole{
- \anchor{out 1}{
- \northeast
- \pgf@y=0cm
- }
- \anchor{out 2}{
- \northeast
- \pgf@y=.8\pgf@y
- }
+ \anchor{out 1}{\northeast\pgf@y=0pt\relax}
+ \anchor{out 2}{\northeast\pgf@y=.8\pgf@y}
+ \anchor{in}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
+ \anchor{mid}{\northeast\pgf@x=0.2\pgf@x\pgf@y=0.25\pgf@y}
}
{\ctikzvalof{tripoles/toggleswitch/height 2}}
{toggleswitch}
@@ -5304,82 +5362,30 @@
\pgf@x=-\ctikzvalof{tripoles/spdt/width}\pgf@circ@scaled@Rlen
\pgf@x=.5\pgf@x
}
- \anchor{left}{%
- \northwest
- \pgf@y=0pt
- }
- \anchor{in}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{out 1}{
- \northwest
- \pgf@x=-\pgf@x
- }
- \anchor{out 2}{
- \northwest
- \pgf@x=-\pgf@x
- \pgf@y=-\pgf@y
- }
- \anchor{center}{
- \pgf@y=0pt
- \pgf@x=0pt
- }
- \anchor{east}{
- \northwest
- \pgf@y=0pt
- \pgf@x=-\pgf@x
- }
- \anchor{west}{
- \northwest
- \pgf@y=0pt
- }
- \anchor{south}{
- \northwest
- \pgf@x=0pt
- \pgf@y=-\pgf@y
- }
- \anchor{north}{
- \northwest
- \pgf@x=0pt
- }
- \anchor{south west}{
- \northwest
- \pgf@y=-\pgf@y
- }
- \anchor{north east}{
- \northwest
- \pgf@x=-\pgf@x
- }
- \anchor{north west}{
- \northwest
- }
- \anchor{south east}{
- \northwest
- \pgf@x=-\pgf@x
- \pgf@y=-\pgf@y
- }
+ \pgfcirc@northwest@symmetric@geoanchors
+ \anchor{in}{\northwest\pgf@y=0pt}
+ \anchor{out 1}{\northwest\pgf@x=-\pgf@x}
+ % this is "by eye", it'll be wrong with non-standard ocirc
+ \anchor{mid}{\northwest\pgf@x=0pt\pgf@y=0.37\pgf@y}
+ \anchor{out 2}{\northwest\pgf@x=-\pgf@x \pgf@y=-\pgf@y}
+ \anchor{center}{\pgf@y=0pt\pgf@x=0pt}
\pgf@circ@draw@component{
\pgf@circ@setcolor
-
\northwest
\pgf@circ@res@up = \pgf@y
\pgf@circ@res@down = -\pgf@y
\pgf@circ@res@right = -\pgf@x
\pgf@circ@res@left = \pgf@x
\pgf@circ@res@other = \ctikzvalof{tripoles/spdt/margin}\pgf@circ@res@left
-
-
+ %
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
\pgfpathlineto{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@down}}
-
+ %
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{0pt}}
-
\pgfusepath{draw}
-
\pgfscope
\pgftransformshift{\pgfpoint{-\pgf@circ@res@other}{\pgf@circ@res@up}}
\pgfnode{ocirc}{center}{}{spdt1}{\pgfusepath{stroke}}
@@ -5392,7 +5398,6 @@
\pgftransformshift{\pgfpoint{\pgf@circ@res@other}{0pt}}
\pgfnode{ocirc}{center}{}{spdt2}{\pgfusepath{stroke}}
\endpgfscope
-
\pgfscope
\pgfpathmoveto{\pgfpointshapeborder{spdt2}{\pgfpointorigin}}
\pgfpathlineto{
@@ -6972,7 +6977,7 @@
\ctikzset{bipoles/tlmic/width/.initial=.5}% it MUST be mic width *5/8
\ctikzset{bipoles/mic/bar thickness/.initial=1}
-% arresters, fuses, lamps, etc
+% arresters, fuses, relais, lamps, etc
\ctikzset{bipoles/european gas filled surge arrester/height/.initial=.30}
\ctikzset{bipoles/european gas filled surge arrester/width/.initial=.80}
@@ -6989,6 +6994,7 @@
\ctikzset{bipoles/afuse/height/.initial=.20}
\ctikzset{bipoles/afuse/width/.initial=.50}
\ctikzset{bipoles/lamp/height/.initial=.60}
+\ctikzset{bipoles/lamp/width/.initial=.60}
\ctikzset{bipoles/wfuse/height/.initial=.20}
\ctikzset{bipoles/wfuse/width/.initial=.50}
\ctikzset{bipoles/wfuse/shape/.initial=ocirc}
@@ -6996,9 +7002,22 @@
\ctikzset{bipoles/wfuse/dots/.is choice}
\ctikzset{bipoles/wfuse/dots/.is if=pgf@circ@wfuse@dots}
%
-\ctikzset{bipoles/lamp/width/.initial=.60}
+\ctikzset{bipoles/relais/height/.initial=.8}
+\ctikzset{bipoles/relais/width/.initial=.3}
+%
\ctikzset{bipoles/bulb/height/.initial=.8}
\ctikzset{bipoles/bulb/width/.initial=.8}
+% suggested by @bogger33, see https://github.com/circuitikz/circuitikz/issues/793
+\ctikzset{bipoles/neonlampcc/height/.initial=.60}
+\ctikzset{bipoles/neonlampac/height/.initial=.60}
+\pgf@circ@declare@family@arrows{sparkgap}
+\newif\ifpgf@sparkgap@dot
+\newif\ifpgf@sparkgap@circle
+\ctikzset{sparkgap/circle/.is if=pgf@sparkgap@circle}
+\ctikzset{sparkgap/dot/.is if=pgf@sparkgap@dot}
+\ctikzset{sparkgap/gap/.initial=.05}
+\ctikzset{bipoles/sparkgap/height/.initial=.60}
+%
\ctikzset{bipoles/squid/height/.initial=.60}
\ctikzset{bipoles/squid/width/.initial=.60}
\ctikzset{bipoles/barrier/height/.initial=.60}
@@ -7228,6 +7247,25 @@
\pgfnode{\cshape}{center}{}{\thisshape-right}{\pgfusepath{draw}}
\fi
}
+
+%% Relais
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/relais/height}}
+{relais}
+{\ctikzvalof{bipoles/relais/height}}
+{\ctikzvalof{bipoles/relais/width}}
+{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@draworfill
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
%% SQUID added by Cor Molenaar 5 March 2010
\pgfcircdeclarebipolescaled{misc}
{}
@@ -7335,11 +7373,116 @@
\pgfsetbeveljoin
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}}
\pgfusepath{draw}
-}% %>>>
+}%
+% neon lamps, suggested by @bogger33 https://github.com/circuitikz/circuitikz/issues/793
+% implemented by Romano
+% double-cathode (capacitor) style
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/neonlampcc/height}}
+{neonlampcc}
+{\ctikzvalof{bipoles/neonlampcc/height}}
+{\ctikzvalof{bipoles/neonlampcc/height}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ %% leads in
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \def\@@w{0.2}\def\@@h{0.6}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\@@w\pgf@circ@res@left}{0pt}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\@@w\pgf@circ@res@right}{0pt}}
+ %% "capacitor style" symbol
+ \pgfusepath{draw}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\@@w\pgf@circ@res@right}{\@@h\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\@@w\pgf@circ@res@right}{\@@h\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{\@@w\pgf@circ@res@left}{\@@h\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\@@w\pgf@circ@res@left}{\@@h\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ %% dot
+ \pgftransformshift{\pgfpoint{\@@w\pgf@circ@res@left-3*\ctikzvalof{nodes width}\pgf@circ@Rlen}
+ {\@@h\pgf@circ@res@down + 2*\ctikzvalof{nodes width}\pgf@circ@Rlen}}
+ \pgfnode{circ}{center}{}{}{\pgfusepath{draw,fill}}
+}
+% anode-cathode style
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/neonlampac/height}}
+{neonlampac}
+{\ctikzvalof{bipoles/neonlampac/height}}
+{\ctikzvalof{bipoles/neonlampac/height}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgf@circ@draworfill
+ %% leads in
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \def\@@w{0.5}\def\@@h{0.5}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\@@w\pgf@circ@res@left}{0pt}}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\@@w\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+ %% one terminal is a straight plate
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\@@w\pgf@circ@res@left}{\@@h\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{\@@w\pgf@circ@res@left}{\@@h\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ %% the other is an "ocirc" shape
+ \pgftransformshift{\pgfpoint{\@@w\pgf@circ@res@right}{0pt}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw,fill}}
+ %% dot
+ \pgftransformshift{\pgfpoint{-\@@w\pgf@circ@res@right}{\@@h\pgf@circ@res@down}}
+ \pgfnode{circ}{center}{}{}{\pgfusepath{draw,fill}}
+}
+% spark gap, suggested by @bogger33 https://github.com/circuitikz/circuitikz/issues/800
+\pgfcircdeclarebipolescaled{misc}
+{
+ \savedmacro{\changeh}{\edef\changeh{\ifpgf@sparkgap@circle 1 \else 0.5 \fi}}
+ \pgfcirc@border@extend@updown{\changeh}{\changeh}
+}
+{\ctikzvalof{bipoles/sparkgap/height}}
+{sparkgap}
+{\ctikzvalof{bipoles/sparkgap/height}}
+{\ctikzvalof{bipoles/sparkgap/height}}{
+ % circle (if requested)
+ \pgfscope
+ \ifpgf@sparkgap@circle
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpointorigin}{\pgf@circ@res@up}
+ \pgf@circ@draworfill
+ \fi
+ \endpgfscope
+ % arrows
+ \pgfscope
+ \pgfcirc@set@arrows{sparkgap}{}{Triangle[scale=2]}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{sparkgap/gap}\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{sparkgap/gap}\pgf@circ@res@left}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope{}
+ % dot (if requested)
+ \ifpgf@sparkgap@dot
+ \pgftransformshift{\pgfpoint
+ {\ctikzvalof{sparkgap/gap}\pgf@circ@res@left-1*\ctikzvalof{nodes width}\pgf@circ@Rlen}
+ {-4*\ctikzvalof{nodes width}\pgf@circ@Rlen}}
+ \pgfnode{circ}{center}{}{}{\pgfusepath{draw,fill}}
+ \fi
+}
+
+%>>>
%% Path definitions for Miscellaneous%<<<
\pgfcirc@activate@bipole@simple{l}{lamp}
+\pgfcirc@activate@bipole@simple{l}{neonlampcc}
+\pgfcirc@activate@bipole@simple{l}{neonlampac}
+\pgfcirc@activate@bipole@simple{l}{sparkgap}
\pgfcirc@activate@bipole@simple{l}{bulb}
\pgfcirc@activate@bipole@simple{l}{squid}
\pgfcirc@activate@bipole@simple{l}{barrier}
@@ -7350,6 +7493,7 @@
\pgfcirc@style@to@style{asymmetric fuse}{afuse}
\pgfcirc@activate@bipole@simple{l}{wfuse}
\pgfcirc@activate@bipole{l}{wfuse}{wfuse}{wiggly fuse}
+\pgfcirc@activate@bipole@simple{l}{relais}
\def\pgf@circ@gfsurgearrester@path#1{\ifpgf@circuit@europeangfsurgearrester\pgf@circ@europeangfsurgearrester@path{#1}\else\pgf@circ@americangfsurgearrester@path{#1}\fi}
\pgfcirc@activate@bipole{l}{europeangfsurgearrester}{european gas filled surge arrester}{european gas filled surge arrester}
\pgfcirc@activate@bipole{l}{americangfsurgearrester}{american gas filled surge arrester}{american gas filled surge arrester}
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex
index 9c72001919..d8d089dd92 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex
@@ -4025,6 +4025,8 @@
\pgfmathsetmacro{\@@BDscale}{\ctikzvalof{tripoles/#1/bodydiode scale}* \ctikzvalof{\ctikzclass/scale}/\ctikzvalof{diodes/scale}}
\pgftransformscale{\@@BDscale}
\ifpgf@circuit@fulldiode
+ % I'm not sure why this is needed, but...
+ \pgf@circ@maybe@color{transistor bodydiode/color}
\pgfnode{fulldiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}}
\else
\pgfnode{emptydiodeshape}{center}{}{pgf@bodydiode}{\pgfusepath{fill}}
@@ -8547,11 +8549,34 @@
\fi
}
-%% The diode (tube), triode, tetrode and pentode only differ in the
-%% number of grids. So we construct a generic declare function in
-%% which we can put code for the grid anchors and grid drawing code
-%% \pgfcircdeclaretube{tube name}{grid anchors}{grid drawing code}
-\long\def\pgfcircdeclaretube#1#2#3{%
+\long\def\pgfcirctubedrawanodestd{% Standard anode code (one anode)
+ % Anode (or plate)
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}} % north
+ \pgfpathlineto{\pgfpoint{0pt}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tubes/anode width}\pgf@circ@res@right}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/anode width}\pgf@circ@res@right}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
+}
+\long\def\pgfcirctubedrawcathodestd{% Standard cathode code (one cathode)
+ % Cathode
+ \ifpgf@circuit@tubes@nocathode
+ \pgf@circuit@tubes@nocathodefalse
+ \else
+ \pgfsetcornersarced{\pgfpoint{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{-\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}}
+ \ifpgf@circuit@tubes@fullcathode
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\pgf@circ@res@up}}
+ \pgf@circuit@tubes@fullcathodefalse
+ \else
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up-\ctikzvalof{tubes/cathode right extend}\pgf@circ@res@up}}
+ \fi
+ \fi
+}
+
+%% generic macro to create a tube. Most of them will use the standard macro for
+%% anode and cathode (see above)
+\long\def\pgfcircdeclaretubegeneric#1#2#3#4#5#6{% name, anchors, grid, anode, cathode variable anchors
\pgfdeclareshape{#1}{
\savedmacro{\ctikzclass}{\edef\ctikzclass{tubes}}
\saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
@@ -8590,6 +8615,11 @@
\pgf@y=\pgf@circ@res@up\advance\pgf@y by -\pgf@circ@res@right
\fi
}
+ \savedmacro{\tubes@filament@angle}{\edef\tubes@filament@angle{\ctikzvalof{tubes/filament angle}}}
+ \savedmacro{\tubes@filament@distance}{\edef\tubes@filament@distance{\ctikzvalof{tubes/filament distance}}}
+ \savedmacro{\tubes@tube@radius}{\edef\tubes@tube@radius{\ctikzvalof{tubes/tube radius}}}
+ \savedmacro{\tubes@cathode@width}{\edef\tubes@cathode@width{\ctikzvalof{tubes/cathode width}}}
+ \savedmacro{\tubes@cathode@distance}{\edef\tubes@cathode@distance{\ctikzvalof{tubes/cathode distance}}}
\anchor{tube ne}{\tubene}
\anchor{tubesq ne}{\tubesquarene}
% tube shape anchors: geo
@@ -8624,30 +8654,37 @@
\anchor{cathode}{%
\northwest
\pgf@y=-\pgf@y
- \pgf@x=\ctikzvalof{tubes/cathode width}\pgf@x
+ \pgf@x=\tubes@cathode@width\pgf@x
}
\anchor{cathode 1}{%
\northwest
\pgf@y=-\pgf@y
- \pgf@x=\ctikzvalof{tubes/cathode width}\pgf@x
+ \pgf@x=\tubes@cathode@width\pgf@x
}
\anchor{cathode 2}{%
\northwest
\pgf@y=-\pgf@y
- \pgf@x=-\ctikzvalof{tubes/cathode width}\pgf@x
+ \pgf@x=-\tubes@cathode@width\pgf@x
}
\anchor{filament 1}{%
\northwest
- \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
+ \pgfmathparse{(\tubes@tube@radius*sin(\tubes@filament@angle)}
\pgf@x=\pgfmathresult\pgf@x
\pgf@y=-\pgf@y
}
\anchor{filament 2}{%
\northwest
- \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})}
+ \pgfmathparse{(\tubes@tube@radius*sin(\tubes@filament@angle)}
\pgf@x=-\pgfmathresult\pgf@x
\pgf@y=-\pgf@y
}
+ \anchor{filament center}{%
+ \northwest
+ \pgf@ya=0.5\pgf@y
+ \pgf@ya=-\tubes@cathode@distance\pgf@y
+ \advance\pgf@ya by -\tubes@filament@distance\pgf@y
+ \pgf@x=0pt\pgf@y=\pgf@ya
+ }
% Extra anchors
#2%
@@ -8693,33 +8730,24 @@
\fi
% Anode (or plate)
- \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}} % north
- \pgfpathlineto{\pgfpoint{0pt}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
- \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tubes/anode width}\pgf@circ@res@right}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/anode width}\pgf@circ@res@right}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
-
+ #4
% Cathode
- \ifpgf@circuit@tubes@nocathode
- \pgf@circuit@tubes@nocathodefalse
- \else
- \pgfsetcornersarced{\pgfpoint{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}}
- \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{-\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}}
- \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}}
- \ifpgf@circuit@tubes@fullcathode
- \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\pgf@circ@res@up}}
- \pgf@circuit@tubes@fullcathodefalse
- \else
- \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up-\ctikzvalof{tubes/cathode right extend}\pgf@circ@res@up}}
- \fi
- \fi
-
+ #5
% Draw the background
\pgfusepath{draw}
}
+ #6
}
}
+%% The diode (tube), triode, tetrode and pentode only differ in the
+%% number of grids. So we construct a generic declare function in
+%% which we can put code for the grid anchors and grid drawing code
+%% \pgfcircdeclaretube{tube name}{grid anchors}{grid drawing code}
+\long\def\pgfcircdeclaretube#1#2#3{% name, anchors, grid
+ \pgfcircdeclaretubegeneric{#1}{#2}{#3}{\pgfcirctubedrawanodestd}{\pgfcirctubedrawcathodestd}{}
+}
+
\pgfcircdeclaretube{diodetube}{}{} % shape diode already exists
\pgfcircdeclaretube{triode}
@@ -8951,7 +8979,143 @@
\pgfpathlineto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima-2*\ctikzvalof{tubes/grid separation}\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right-0.4142136*\ctikzvalof{tubes/cathode corners}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up-0.4142136*\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}}
-}% %>>>
+}%
+%
+% multi-anode tube, added by Romano for version 1.6.8, suggested by @bogger33 on GitHub
+% see https://github.com/circuitikz/circuitikz/issues/785
+%
+\ctikzset{tubes/anodes/.initial=3} % number of anodes. Ignored in most tubes.
+\newif\ifpgf@circuit@tubes@anodedot\pgf@circuit@tubes@anodedotfalse
+\pgfkeys{/tikz/anodedot/.add code={}{\pgf@circuit@tubes@anodedottrue}}
+\ctikzset{tubes/anodedot/.add code={}{\pgf@circuit@tubes@anodedottrue}}
+\newif\ifpgf@circuit@tubes@nogrid\pgf@circuit@tubes@nogridfalse
+\pgfkeys{/tikz/nogrid/.add code={}{\pgf@circuit@tubes@nogridtrue}}
+\ctikzset{tubes/nogrid/.add code={}{\pgf@circuit@tubes@nogridtrue}}
+\newif\ifpgf@circuit@tubes@nixieanode\pgf@circuit@tubes@nixieanodefalse
+\pgfkeys{/tikz/nixieanode/.add code={}{\pgf@circuit@tubes@nixieanodetrue}}
+\ctikzset{tubes/nixieanode/.add code={}{\pgf@circuit@tubes@nixieanodetrue}}
+\long\def\pgfcirctubedraw@multi@anode{% Separate to override in matubes
+ % Anodes (or plates)
+ % Use saved len/anchors to find the first drawn position.
+ \pgf@circ@res@temp=\anodelen\divide\pgf@circ@res@temp by 2 % half the anode length
+ \firstanodepos\pgf@circ@res@other=\pgf@x
+ \advance\pgf@circ@res@other by \pgf@circ@res@temp
+ \pgf@circ@count@a=0
+ \loop
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}} % north
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
+ \ifpgf@circuit@tubes@anodedot
+ \pgfpathcircle{\pgfpoint{\pgf@circ@res@other}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up-0.5*\circlelen}}{\circlelen}
+ \else
+ % this is the horizontal line of the anode
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@temp}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other+\pgf@circ@res@temp}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}}
+ \fi
+ \advance\pgf@circ@res@other by 4\pgf@circ@res@temp
+ \advance\pgf@circ@count@a by 1
+ \ifnum\pgf@circ@count@a<\Nanodes\relax
+ \repeat
+}
+\long\def\pgfcirctubedraw@cathode@or@nixie{%
+ \ifpgf@circuit@tubes@nixieanode
+ \pgfpathmoveto{\pgfpoint{0pt}{-\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}}
+ \else
+ \pgfcirctubedrawcathodestd
+ \fi
+}
+\pgfcircdeclaretubegeneric{matube}
+{% anchors
+ \savedmacro{\Nanodes}{\edef\Nanodes{\ctikzvalof{tubes/anodes}}}
+ \savedanchor\firstanodepos{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@scaled@Rlen
+ \pgf@circ@res@right=\ctikzvalof{tubes/anode width}\pgf@circ@res@right
+ % x and y are one half
+ \pgf@y=\pgf@circ@res@up
+ \pgf@y=.5\pgf@y
+ \pgf@x=-\pgf@circ@res@right
+ \pgf@x=.5\pgf@x
+ }
+ \saveddimen\anodelen{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@scaled@Rlen % full width, left to right
+ % the length of one of the N anodes is the full width divided by 2*N+1
+ \pgfmathsetlength\pgf@x{\ctikzvalof{tubes/anode width}*\pgf@circ@res@right/(2*\Nanodes-1)}
+ }
+ \saveddimen\circlelen{%
+ \pgf@x=\ctikzvalof{nodes width}\pgf@circ@Rlen
+ }
+ \anchor{grid} {% should not be used
+ \northwest
+ \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
+ }
+ \anchor{control} {%
+ \northwest
+ \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y
+ }
+ \anchor{nixie a}{%
+ \northwest\pgf@x=0pt\pgf@y=-\pgf@y
+ }
+}
+{% grid
+ \ifpgf@circuit@tubes@nogrid\else
+ % Grid protrusion
+ \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right
+ \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
+ % Grid dashes: calculations
+ \pgf@xb=2\pgf@circ@res@right
+ \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb
+ \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1
+ \multiply\pgf@circ@count@a by 2\relax
+ \advance\pgf@circ@count@a by 1\relax
+ \advance\pgf@circ@res@step by -\pgf@xa
+ \divide\pgf@circ@res@step by \pgf@circ@count@a
+ % Grid dashes: draw
+ \pgf@circ@res@temp=\pgf@xa
+ \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes}
+ \loop
+ \advance\pgf@circ@res@temp by\pgf@circ@res@step
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
+ \advance\pgf@circ@res@temp by\pgf@circ@res@step
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}}
+ \advance\pgf@circ@count@a by-1
+ \ifnum\pgf@circ@count@a>0\relax
+ \repeat
+ \fi
+}
+{\pgfcirctubedraw@multi@anode}% anodes
+{\pgfcirctubedraw@cathode@or@nixie}% cathode
+{% extra dynamics anchors
+ \pgfutil@g@addto@macro\pgf@sh@s@matube{%
+ % Start with the maximum pin number and go backwards.
+ \pgf@circ@count@a=\Nanodes\relax
+ \pgfmathloop%
+ \ifnum\pgf@circ@count@a>0
+ \expandafter\xdef\csname pgf@anchor@matube@anode\space\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@ma@anode@anchor{\the\pgf@circ@count@a}%
+ }
+ \expandafter\xdef\csname pgf@anchor@matube@nixie\space k\the\pgf@circ@count@a\endcsname{%
+ \noexpand\pgf@circ@ma@anode@anchor{\the\pgf@circ@count@a}%
+ }
+ \advance\pgf@circ@count@a by -1\relax%
+ \repeatpgfmathloop%
+ }%
+}
+\def\pgf@circ@ma@anode@anchor#1{
+ \firstanodepos
+ \pgf@circ@res@temp=\pgf@x
+ \pgfmathsetlength\pgf@x{\pgf@circ@res@temp + (0.5 + 2*(#1 -1))*\anodelen}
+}
+
+
+
+%>>>
\endinput
% vim: set fdm=marker fmr=%<<<,%>>>:
diff --git a/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex b/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex
index 92299ca649..4e4861071f 100644
--- a/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex
@@ -16,8 +16,8 @@
\startmodule[circuitikz]
\usemodule[tikz]
-\def\pgfcircversion{1.6.7}
-\def\pgfcircversiondate{2024/02/09}
+\def\pgfcircversion{1.6.9}
+\def\pgfcircversiondate{2024/05/25}
\writestatus{loading}{\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion}
diff --git a/graphics/pgf/contrib/liftarm/README.md b/graphics/pgf/contrib/liftarm/README.md
index 2759458717..af687942b7 100644
--- a/graphics/pgf/contrib/liftarm/README.md
+++ b/graphics/pgf/contrib/liftarm/README.md
@@ -1,20 +1,20 @@
-# liftarm
+# `liftarm`
-Draw liftarms with TikZ
+## Geometric constructions with liftarms using Ti*k*Z and LaTeX3
-Version 2.0 (2022/04/07)
+Version 3.0 (2024/05/20)
-This package is based on the package TikZ and can be used to draw liftarms with TikZ. It provides several options for the appearance of the liftarms, a command which connects two liftarms, an environment to describe a construction and a method to animate a construction with one or more traces.
+This package is based on the package [Ti*k*Z](https://ctan.org/pkg/pgf) and can be used to draw geometric constructions with liftarms using Ti*k*Z. There are several options for the appearance of the liftarms. It provides an environment to connect multiple liftarms using the Newton-Raphson method and LU decomposition. It also provides an environment to describe a construction and a method to animate a construction with one or more traces.
%% README.md
%% Copyright 2022 Matthias Floré
%
% This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
+% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
-% and version 1.3 or later is part of all distributions of LaTeX
+% and version 1.3c or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
diff --git a/graphics/pgf/contrib/liftarm/liftarm.pdf b/graphics/pgf/contrib/liftarm/liftarm.pdf
index d428d1f7af..eddb6d4f1d 100644
--- a/graphics/pgf/contrib/liftarm/liftarm.pdf
+++ b/graphics/pgf/contrib/liftarm/liftarm.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/liftarm/liftarm.sty b/graphics/pgf/contrib/liftarm/liftarm.sty
index b850c8f16a..63d6b51f44 100644
--- a/graphics/pgf/contrib/liftarm/liftarm.sty
+++ b/graphics/pgf/contrib/liftarm/liftarm.sty
@@ -1,12 +1,12 @@
%% liftarm.sty
-%% Copyright 2022 Matthias Floré
+%% Copyright 2022-2024 Matthias Floré
%
% This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
+% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
-% and version 1.3 or later is part of all distributions of LaTeX
+% and version 1.3c or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
@@ -16,321 +16,897 @@
% This work consists of the files liftarm.pdf, liftarm.sty,
% liftarm.tex and README.md.
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{liftarm}[2022/04/07 v2.0 Draw liftarms with TikZ]
-\RequirePackage{etoolbox}
\RequirePackage[dvipsnames]{xcolor}
\RequirePackage{tikz}
\usetikzlibrary{calc}
-\newif\ifliftarm@animate
-\newif\ifliftarm@brick
-\newif\ifliftarm@connectreverse
-\newif\ifliftarm@contour
-\pgfkeys{
-/liftarm/.is family,
-/liftarm/.unknown/.code={\edef\liftarm@colorkey{\pgfkeyscurrentname}},
-/liftarm,
-axle holes/.store in=\liftarm@axleholes,
-brick/.is if=liftarm@brick,
-color/.store in=\liftarm@colorkey,
-color 0/.initial=Gray,
-color 1/.initial=darkgray,
-color 2/.initial=Yellow,
-color 3/.initial=Orange,
-color 4/.initial=Red,
-color 5/.initial=Green,
-color 6/.initial=Blue,
-color 7/.initial=Brown,
-color modulo/.initial=8,
-connect/.store in=\liftarm@connect,
-connect coordinate/.store in=\liftarm@connectcoordinate,
-connect reverse/.is if=liftarm@connectreverse,
-contour/.is if=liftarm@contour,
-coordinate/.store in=\liftarm@coordinate,
-globalize/.code n args={2}{\xdef#1{#2}},
-hole radius/.initial=0.3,
-liftarm 1/.style={liftarm 1 options/.style={#1}},
-liftarm 1 options/.style={},
-liftarm 2/.style={liftarm 2 options/.style={#1}},
-liftarm 2 options/.style={},
-liftarm thickness/.initial=0.92,
-mark color/.initial=Black,
-mark holes/.store in=\liftarm@markholes,
-origin/.initial=0,
-scalefactor/.initial=0.5,
-screw color/.initial=Black,
-screw holes/.store in=\liftarm@screwholes,
-screw holes angle/.initial=45,
-trace/.store in=\liftarm@trace,
-}
-\pgfmathsetmacro{\liftarm@axleholeangle}{14}%2*\liftarm@axleholeradius*sin(\liftarm@axleholeangle)=1.78/8
-\pgfmathsetmacro{\liftarm@screwholestartangle}{10}
-\newcommand{\liftarm}[4][]{
-\pgfmathsetmacro{\liftarm@length}{#3}
-\ifdim \liftarm@length pt<0 pt
-\PackageWarning{liftarm}{The length (\liftarm@length) of the liftarm is smaller than 0.}
-\else
-\pgfmathsetmacro{\liftarm@ang}{#4}
-\begin{scope}[shift={(#2)},rotate=\liftarm@ang]
-\pgfkeys{/liftarm,#1}
-\pgfmathsetmacro{\liftarm@origin}{\pgfkeysvalueof{/liftarm/origin}}
-\begin{scope}[shift={(-\liftarm@origin,0)}]
-\pgfmathsetmacro{\liftarm@halfthickness}{0.5*\pgfkeysvalueof{/liftarm/scalefactor}*\pgfkeysvalueof{/liftarm/liftarm thickness}}
-\pgfmathsetmacro{\liftarm@holeradius}{\pgfkeysvalueof{/liftarm/scalefactor}*\pgfkeysvalueof{/liftarm/hole radius}}
-\pgfmathsetmacro{\liftarm@halfstudwidth}{\pgfkeysvalueof{/liftarm/scalefactor}*0.3}
-\pgfmathsetmacro{\liftarm@studheight}{\pgfkeysvalueof{/liftarm/scalefactor}*0.2}
-\pgfmathsetmacro{\liftarm@halfplateheight}{\pgfkeysvalueof{/liftarm/scalefactor}*0.2}
-\pgfmathsetmacro{\liftarm@halfplatewidth}{\pgfkeysvalueof{/liftarm/scalefactor}*0.5}
-\pgfmathsetmacro{\liftarm@axleholeradius}{\liftarm@halfthickness}
-\pgfmathsetmacro{\liftarm@screwholeradius}{0.8*\liftarm@holeradius}
-\colorlet{liftarm@markcolor}{\pgfkeysvalueof{/liftarm/mark color}}
-\colorlet{liftarm@screwcolor}{\pgfkeysvalueof{/liftarm/screw color}}
-\pgfmathsetmacro{\liftarm@screwholesangle}{\pgfkeysvalueof{/liftarm/screw holes angle}}
-\ifcsname liftarm@colorkey\endcsname
-\colorlet{liftarm@color}{\liftarm@colorkey}
-\else
-\pgfmathsetmacro{\liftarm@colornumber}{int(mod(\liftarm@length,\pgfkeysvalueof{/liftarm/color modulo}))}
-\colorlet{liftarm@color}{\pgfkeysvalueof{/liftarm/color \liftarm@colornumber}}
-\fi
-\ifliftarm@brick
-\def\liftarm@shape{(-1,{-\liftarm@halfplatewidth-\liftarm@halfplateheight})--(-1,\liftarm@halfplatewidth)
-\foreach\liftarm@n in {-1,...,\liftarm@length}{
---({\liftarm@n+0.5-\liftarm@halfstudwidth},\liftarm@halfplatewidth)--({\liftarm@n+0.5-\liftarm@halfstudwidth},{\liftarm@halfplatewidth+\liftarm@studheight})--({\liftarm@n+0.5+\liftarm@halfstudwidth},{\liftarm@halfplatewidth+\liftarm@studheight})--({\liftarm@n+0.5+\liftarm@halfstudwidth},\liftarm@halfplatewidth)--({\liftarm@n+1},\liftarm@halfplatewidth)
-}
---({\liftarm@length+1},{-\liftarm@halfplatewidth-\liftarm@halfplateheight})--cycle}
-\else
-\def\liftarm@shape{(0,\liftarm@halfthickness) arc (90:270:\liftarm@halfthickness)--(\liftarm@length,-\liftarm@halfthickness) arc (-90:90:\liftarm@halfthickness)--cycle}
-\fi
-\fill[liftarm@color,even odd rule] \liftarm@shape
-\foreach\liftarm@n in {0,...,\liftarm@length}{
-(\liftarm@n,0) circle[radius=\liftarm@holeradius]
-};
-\ifliftarm@contour
-%\ifliftarm@brick
-%\else
-\draw[liftarm@color!75!Black,ultra thick] \liftarm@shape;
-%\fi
-\fi
-\ifcsname liftarm@axleholes\endcsname
-\foreach\liftarm@n in \liftarm@axleholes{
-\pgfmathsetmacro{\liftarm@axlehole}{\liftarm@n}
-\ifdim \liftarm@axlehole pt<0 pt
-\else
-\ifdim \liftarm@axlehole pt>\liftarm@length pt
-\else
-\foreach\liftarm@angle in {0,90,180,270}{
-\begin{scope}[shift={(\liftarm@axlehole,0)},rotate=\liftarm@angle]
-\fill[liftarm@color] (\liftarm@axleholeangle:\liftarm@axleholeradius) arc (\liftarm@axleholeangle:{90-\liftarm@axleholeangle}:\liftarm@axleholeradius)--({\liftarm@axleholeradius*sin(\liftarm@axleholeangle)},{\liftarm@axleholeradius*sin(\liftarm@axleholeangle)})--cycle;
-\end{scope}
-}
-\fi
-\fi
-}
-\fi
-\ifcsname liftarm@markholes\endcsname
-\foreach\liftarm@n in \liftarm@markholes{
-\pgfmathsetmacro{\liftarm@markhole}{\liftarm@n}
-\ifdim \liftarm@markhole pt<0 pt
-\else
-\ifdim \liftarm@markhole pt>\liftarm@length pt
-\else
-\fill[liftarm@markcolor] (\liftarm@markhole,0) circle[radius=\liftarm@holeradius];
-\fi
-\fi
-}
-\fi
-\ifcsname liftarm@screwholes\endcsname
-\foreach\liftarm@n in \liftarm@screwholes{
-\pgfmathsetmacro{\liftarm@screwhole}{\liftarm@n}
-\ifdim \liftarm@screwhole pt<0 pt
-\else
-\ifdim \liftarm@screwhole pt>\liftarm@length pt
-\else
-\begin{scope}[shift={(\liftarm@screwhole,0)},rotate=\liftarm@screwholesangle]
-\foreach\liftarm@n in {-1,1}{
-\fill[liftarm@screwcolor] ({\liftarm@screwholeradius*cos(\liftarm@screwholestartangle)},{\liftarm@n*\liftarm@screwholeradius*sin(\liftarm@screwholestartangle)}) arc ({\liftarm@n*\liftarm@screwholestartangle}:{\liftarm@n*(180-\liftarm@screwholestartangle)}:\liftarm@screwholeradius);
-}
-\end{scope}
-\fi
-\fi
-}
-\fi
-\ifcsname liftarm@coordinate\endcsname
-\foreach\liftarm@n/\liftarm@name in \liftarm@coordinate{
-\pgfmathsetmacro{\liftarm@value}{\liftarm@n}
-\coordinate (\liftarm@name) at (\liftarm@value,0);
-}
-\fi
-\ifcsname liftarm@trace\endcsname
-\ifliftarm@animate
-\foreach\liftarm@n/\liftarm@numberofframes/\liftarm@tracefigure in \liftarm@trace{
-\pgfmathsetmacro{\liftarm@value}{\liftarm@n}
-\gappto\liftarm@animateframestrace{\newframe\begin{scope}}
-\addtocounter{liftarm@animateframenumber}{1}
-\xappto\liftarm@animateframestrace{[shift={(#2)},rotate=\liftarm@ang]}
-\gappto\liftarm@animateframestrace{\begin{scope}}
-\xappto\liftarm@animateframestrace{[shift={(\liftarm@value-\liftarm@origin,0)}]}
-\ifdefempty{\liftarm@tracefigure}{
-\gappto\liftarm@animateframestrace{\fill[Black] (0,0) circle}
-\xappto\liftarm@animateframestrace{[radius=0.66*\liftarm@holeradius];}
-}
-{
-\xappto\liftarm@animateframestrace{\expandonce\liftarm@tracefigure}
-}
-\gappto\liftarm@animateframestrace{\end{scope}\end{scope}}
-\ifdefempty{\liftarm@numberofframes}{
-\csxappto{liftarm@animatetimeline0}{\theliftarm@animateframenumber x0,}
-}
-{
-\csxappto{liftarm@animatetimeline\theliftarm@animatestepnumber}{\theliftarm@animateframenumber x\liftarm@numberofframes,}
-}
-}
-\fi
-\fi
-\end{scope}
-\end{scope}
-\fi
-}
-\newcommand{\liftarmconnect}[5][]{
-\begin{scope}
-\pgfkeys{/liftarm,#1}
-\coordinate (liftarm@A) at (#2);
-\coordinate (liftarm@B) at (#4);
-\begin{scope}
-\pgfkeys{/liftarm,liftarm 1 options}
-\ifcsname liftarm@connect\endcsname
-\pgfmathsetmacro{\liftarm@connectlengthAtemp}{\liftarm@connect-\pgfkeysvalueof{/liftarm/origin}}
-\else
-\pgfmathsetmacro{\liftarm@connectlengthAtemp}{#3-\pgfkeysvalueof{/liftarm/origin}}
-\fi
-\xdef\liftarm@connectlengthA{\liftarm@connectlengthAtemp}
-\ifdim \liftarm@connectlengthA pt=0 pt
-\PackageWarning{liftarm}{The length of the first liftarm is 0.}
-\fi
-\end{scope}
-\begin{scope}
-\pgfkeys{/liftarm,liftarm 2 options}
-\ifcsname liftarm@connect\endcsname
-\pgfmathsetmacro{\liftarm@connectlengthBtemp}{\liftarm@connect-\pgfkeysvalueof{/liftarm/origin}}
-\else
-\pgfmathsetmacro{\liftarm@connectlengthBtemp}{#5-\pgfkeysvalueof{/liftarm/origin}}
-\fi
-\xdef\liftarm@connectlengthB{\liftarm@connectlengthBtemp}
-\ifdim \liftarm@connectlengthB pt=0 pt
-\PackageWarning{liftarm}{The length of the second liftarm is 0.}
-\fi
-\end{scope}
-\path
-let
-\p1=(liftarm@A),
-\p2=(liftarm@B),
-\n1={\x1/\pgf@xx},
-\n2={\y1/\pgf@yy},
-\n3={\x2/\pgf@xx},
-\n4={\y2/\pgf@yy}
-in
-[
-/liftarm/globalize={\liftarm@connectxalet}{\n3},
-/liftarm/globalize={\liftarm@connectyalet}{\n4},
-/liftarm/globalize={\liftarm@connectxblet}{\n1},
-/liftarm/globalize={\liftarm@connectyblet}{\n2}
-]
-;
-\pgfmathsetmacro{\liftarm@connectxa}{\liftarm@connectxalet}
-\pgfmathsetmacro{\liftarm@connectya}{\liftarm@connectyalet}
-\pgfmathsetmacro{\liftarm@connectxb}{\liftarm@connectxblet}
-\pgfmathsetmacro{\liftarm@connectyb}{\liftarm@connectyblet}
-\pgfmathsetmacro{\liftarm@absdiff}{abs(\liftarm@connectxa-\liftarm@connectxb)}
-\ifdim \liftarm@absdiff pt<0.001 pt
-\pgfmathsetmacro{\liftarm@connectanglegamma}{90}
-\ifdim \liftarm@connectya pt<\liftarm@connectyb pt
-\pgfmathsetmacro{\liftarm@connectangleshift}{0}
-\else
-\pgfmathsetmacro{\liftarm@connectangleshift}{180}
-\fi
-\else
-\pgfmathsetmacro{\liftarm@connectanglegamma}{atan((\liftarm@connectyb-\liftarm@connectya)/(\liftarm@connectxb-\liftarm@connectxa))}
-\ifdim \liftarm@connectxa pt<\liftarm@connectxb pt
-\pgfmathsetmacro{\liftarm@connectangleshift}{0}
-\else
-\pgfmathsetmacro{\liftarm@connectangleshift}{180}
-\fi
-\fi
-\pgfmathsetmacro{\liftarm@connectlength}{sqrt((\liftarm@connectyb-\liftarm@connectya)^2+(\liftarm@connectxb-\liftarm@connectxa)^2)}
-\ifdim \liftarm@connectlength pt=0 pt
-\PackageWarning{liftarm}{The length between the origins of the liftarms is 0.}
-\fi
-\pgfmathsetmacro{\liftarm@connectabsconnectlengthAminusconnectlengthB}{abs(\liftarm@connectlengthA-\liftarm@connectlengthB)}
-\ifdim \liftarm@connectabsconnectlengthAminusconnectlengthB pt>\liftarm@connectlength pt
-\PackageWarning{liftarm}{The liftarms can not be connected.}
-\fi
-\pgfmathsetmacro{\liftarm@connectconnectlengthAplusconnectlengthB}{\liftarm@connectlengthA+\liftarm@connectlengthB}
-\ifdim \liftarm@connectconnectlengthAplusconnectlengthB pt<\liftarm@connectlength pt
-\PackageWarning{liftarm}{The liftarms can not be connected.}
-\fi
-\pgfmathsetmacro{\liftarm@connectanglealpha}{acos(((\liftarm@connectlengthB)^2+(\liftarm@connectlength)^2-(\liftarm@connectlengthA)^2)/(2*(\liftarm@connectlength)*(\liftarm@connectlengthB)))}
-\pgfmathsetmacro{\liftarm@connectanglebeta}{acos(((\liftarm@connectlength)^2+(\liftarm@connectlengthA)^2-(\liftarm@connectlengthB)^2)/(2*\liftarm@connectlength*(\liftarm@connectlengthA)))}
-\pgfmathsetmacro{\liftarm@connectangledelta}{\liftarm@connectangleshift+180+\liftarm@connectanglegamma-\liftarm@connectanglebeta}
-\def\liftarm@liftarmA{\liftarm[liftarm 1 options]{#2}{#3}{\liftarm@connectangledelta}}
-\def\liftarm@liftarmB{\liftarm[liftarm 2 options]{#4}{#5}{\liftarm@connectangleshift+\liftarm@connectanglegamma+\liftarm@connectanglealpha}}
-\ifliftarm@connectreverse
-\liftarm@liftarmB
-\liftarm@liftarmA
-\else
-\liftarm@liftarmA
-\liftarm@liftarmB
-\fi
-\ifcsname liftarm@connectcoordinate\endcsname
-\coordinate (\liftarm@connectcoordinate) at ($(#2)+(\liftarm@connectangledelta:\liftarm@connectlengthA)$);
-\fi
-\end{scope}
-}
-\newcommand{\liftarm@construction}[2][]{\begin{tikzpicture}[#1]
-\liftarm@constructfigure
-#2
-\end{tikzpicture}}
-\newcommand{\liftarmconstruct}[3][]{\item #2\nopagebreak
+\ProvidesExplPackage{liftarm}{2024/05/20}{3.0}{Geometric constructions with liftarms using TikZ and LaTeX3}
+
+%%> \subsection{Variables}
+
+\newcounter { g__liftarm_animate_frame_number_counter }
+\newcounter { g__liftarm_animate_number_of_animation_counter }
+\newcounter { g__liftarm_animate_number_of_steps_counter }
+\newcounter { g__liftarm_animate_step_number_counter }
+
+\bool_new:N \l__liftarm_animate_bool
+\bool_new:N \l__liftarm_brick_bool
+\bool_new:N \l__liftarm_contour_bool
+\bool_new:N \l__liftarm_LU_bool
+
+\clist_new:N \l__liftarm_trace_clist
+
+\fp_new:N \l__liftarm_angle_fp
+\fp_const:Nn \c__liftarm_axle_hole_angle_fp { 21.76702028497987 }%asind ( 1.78 / ( 16 * 0.3 ) )
+\fp_new:N \l__liftarm_connect_det_fp
+\fp_new:N \l__liftarm_connect_norm_fp
+\fp_new:N \l__liftarm_connect_start_constant_x_fp
+\fp_new:N \l__liftarm_connect_start_constant_y_fp
+\fp_new:N \l__liftarm_connect_stop_value_fp
+\fp_new:c { l__liftarm_connect_two_1_option_0_angle_fp }
+\fp_new:c { l__liftarm_connect_two_1_option_1_angle_fp }
+\fp_new:c { l__liftarm_connect_two_2_option_0_angle_fp }
+\fp_new:c { l__liftarm_connect_two_2_option_1_angle_fp }
+\fp_new:N \l__liftarm_connect_two_angle_fp
+\fp_new:N \l__liftarm_connect_two_A_angle_fp
+\fp_new:N \l__liftarm_connect_two_A_length_fp
+\fp_new:N \l__liftarm_connect_two_A_x_fp
+\fp_new:N \l__liftarm_connect_two_A_y_fp
+\fp_new:N \l__liftarm_connect_two_B_angle_fp
+\fp_new:N \l__liftarm_connect_two_B_length_fp
+\fp_new:N \l__liftarm_connect_two_B_x_fp
+\fp_new:N \l__liftarm_connect_two_B_y_fp
+\fp_new:N \l__liftarm_connect_two_length_fp
+\fp_new:N \g__liftarm_coord_x_fp
+\fp_new:N \g__liftarm_coord_y_fp
+\fp_new:N \l__liftarm_half_thickness_fp
+\fp_new:N \l__liftarm_hole_radius_fp
+\fp_new:N \l__liftarm_length_fp
+\fp_new:N \l__liftarm_LU_maxA_fp
+\fp_new:N \l__liftarm_LU_tmp_fp
+\fp_new:N \l__liftarm_mark_radius_fp
+\fp_new:N \l__liftarm_origin_fp
+\fp_new:N \l__liftarm_origin_connect_initial_fp
+\fp_new:N \l__liftarm_scalefactor_fp
+\fp_new:N \l__liftarm_screw_angle_fp
+\fp_new:N \l__liftarm_screw_radius_fp
+
+\int_new:N \l__liftarm_connect_count_int
+\int_new:N \l__liftarm_connect_equation_int
+\int_new:N \l__liftarm_LU_count_int
+\int_new:N \l__liftarm_LU_imax_int
+\int_new:N \l__liftarm_LU_j_int
+\int_new:N \l__liftarm_LU_N_int
+
+\iow_new:N \g__liftarm_animate_write_timeline_iow
+
+\seq_new:N \l__liftarm_connect_coordinate_seq
+\seq_new:N \l__liftarm_connect_start_arg_seq
+\seq_new:N \l__liftarm_connect_start_coeff_seq
+\seq_new:N \l__liftarm_coordinate_seq
+\seq_new:N \l__liftarm_trace_item_seq
+
+\str_new:N \l__liftarm_connect_stop_type_str
+\str_new:N \l__liftarm_type_str
+
+\tl_new:N \g__liftarm_animate_frames_tl
+\tl_new:N \g__liftarm_animate_frames_trace_tl
+\tl_new:N \l__liftarm_animate_value_tl
+\tl_new:N \l__liftarm_color_tl
+\tl_new:N \g__liftarm_construct_tl
+\tl_const:Nn \c__liftarm_cos_sin_diff_x_tl { - sin }
+\tl_const:Nn \c__liftarm_cos_sin_diff_y_tl { cos }
+\tl_const:Nn \c__liftarm_cos_sin_x_tl { cos }
+\tl_const:Nn \c__liftarm_cos_sin_y_tl { sin }
+\tl_new:N \l__liftarm_holes_tl
+\tl_new:N \l__liftarm_shape_tl
+\tl_new:N \l__liftarm_tmp_tl
+
+%%> \subsection{Pgfkeys}
+
+\pgfkeys
+ {
+ / liftarm /. is~family ,
+ / liftarm ,
+ axle~holes /. initial = {} ,
+ brick /. code = { \bool_set:Nn \l__liftarm_brick_bool { \cs:w c_#1_bool\cs_end: } } ,
+ brick /. default = true ,
+ brick = false ,
+ color /. code~2~args =
+ {
+ \tl_clear_new:c { l__liftarm_color_\int_eval:n {#1}_tl }
+ \tl_set:cn { l__liftarm_color_\int_eval:n {#1}_tl } {#2}
+ } ,
+ color = { 0 } { Gray } ,
+ color = { 1 } { darkgray } ,
+ color = { 2 } { Yellow } ,
+ color = { 3 } { Orange } ,
+ color = { 4 } { Red } ,
+ color = { 5 } { Green } ,
+ color = { 6 } { Blue } ,
+ color = { 7 } { Brown } ,
+ color~modulo /. initial = 8 ,
+ connect~stop /. is~choice ,
+ connect~stop / 1-norm /. code =
+ {
+ \str_set:Nn \l__liftarm_connect_stop_type_str { 1-norm }
+ \fp_set:Nn \l__liftarm_connect_stop_value_fp {#1}
+ } ,
+ connect~stop / 1-norm /. default = 0.001 ,
+ connect~stop / 2-norm /. code =
+ {
+ \str_set:Nn \l__liftarm_connect_stop_type_str { 2-norm }
+ \fp_set:Nn \l__liftarm_connect_stop_value_fp {#1}
+ } ,
+ connect~stop / 2-norm /. default = 0.001 ,
+ connect~stop / iterations /. code =
+ {
+ \str_set:Nn \l__liftarm_connect_stop_type_str { iterations }
+ \fp_set:Nn \l__liftarm_connect_stop_value_fp {#1}
+ } ,
+ connect~stop / iterations /. default = 10 ,
+ connect~stop = 1-norm ,
+ contour /. code = { \bool_set:Nn \l__liftarm_contour_bool { \cs:w c_#1_bool\cs_end: } } ,
+ contour /. default = true ,
+ contour = false ,
+ contour~style /. style = { contour_style /. style = {#1} } ,
+ contour_style /. style = {} ,
+ coordinate /. initial = {} ,
+ hole~radius /. initial = 0.3 ,
+ liftarm~style /. style = { liftarm_style /. style = {#1} } ,
+ liftarm_style /. style = {} ,
+ liftarm~thickness /. initial = 0.92 ,
+ mark~holes /. initial = {} ,
+ mark~radius /. code =
+ {
+ \pgfmathparse {#1}
+ \fp_set:Nn \l__liftarm_mark_radius_fp { \pgfmathresult }
+ } ,
+ mark~radius = 1 ,
+ mark~style /. style = { mark_style /. style = {#1} } ,
+ mark_style /. style = {} ,
+ origin /. code =
+ {
+ \pgfmathparse {#1}
+ \fp_set:Nn \l__liftarm_origin_fp { \pgfmathresult }
+ } ,
+ origin = 0 ,
+ scalefactor /. code =
+ {
+ \pgfmathparse {#1}
+ \fp_set:Nn \l__liftarm_scalefactor_fp { \pgfmathresult }
+ } ,
+ scalefactor = 0.5 ,
+ screw~angle /. code =
+ {
+ \pgfmathparse {#1}
+ \fp_set:Nn \l__liftarm_screw_angle_fp { \pgfmathresult }
+ } ,
+ screw~angle = 10 ,
+ screw~holes /. initial = {} ,
+ screw~radius /. code =
+ {
+ \pgfmathparse {#1}
+ \fp_set:Nn \l__liftarm_screw_radius_fp { \pgfmathresult }
+ } ,
+ screw~radius = 0.8 ,
+ screw~style /. style = { screw_style /. style = {#1} } ,
+ screw_style /. style = {} ,
+ trace /. code = { \clist_set:Nn \l__liftarm_trace_clist {#1} } ,
+ type /. is~choice ,
+ type / liftarm /. code = { \str_set:Nn \l__liftarm_type_str { liftarm } } ,
+ type / liftarm /. value~forbidden ,
+ type / line~segment /. code = { \str_set:Nn \l__liftarm_type_str { line~segment } } ,
+ type / line~segment /. value~forbidden ,
+ type = liftarm ,
+ }
+
+\pgfkeys
+ {
+ / liftarm / connect_algorithm /. is~family ,
+ / liftarm / connect_algorithm /. unknown /. code = {} ,
+ / liftarm / connect_algorithm ,
+ coordinate /. initial = {} ,
+ origin /. code =
+ {
+ \pgfmathparse {#1}
+ \fp_set:Nn \l__liftarm_origin_fp { \pgfmathresult }
+ } ,
+ }
+
+%%> \subsection{Functions}
+
+\cs_generate_variant:Nn \clist_if_in:nnTF { enTF }
+\cs_generate_variant:Nn \clist_map_inline:nn { en }
+\cs_generate_variant:Nn \seq_map_indexed_inline:Nn { cn }
+\cs_generate_variant:Nn \tl_build_begin:N { c }
+\cs_generate_variant:Nn \tl_build_gbegin:N { c }
+\cs_generate_variant:Nn \tl_build_end:N { c }
+\cs_generate_variant:Nn \tl_build_gend:N { c }
+\cs_generate_variant:Nn \tl_build_put_right:Nn { ce , cn }
+\cs_generate_variant:Nn \tl_build_gput_right:Nn { ce , cn }
+
+\cs_new_protected:Npn \__liftarm_connect:nnnn #1#2#3#4
+ {
+ \int_incr:N \l__liftarm_connect_count_int
+ \fp_zero_new:c { l__liftarm_connect_angle_\int_use:N \l__liftarm_connect_count_int _fp }
+ \pgfmathparse {#4}
+ \fp_set:cn { l__liftarm_connect_angle_\int_use:N \l__liftarm_connect_count_int _fp } { \pgfmathresult * deg }
+ \fp_set_eq:NN \l__liftarm_origin_fp \l__liftarm_origin_connect_initial_fp
+ \pgfkeys
+ {
+ / liftarm / connect_algorithm ,
+ coordinate = \pgfkeysvalueof { / liftarm / coordinate } ,
+ #1
+ }
+ \seq_if_in:NnTF \l__liftarm_connect_coordinate_seq {#2}
+ {
+ \fp_set_eq:Nc \l__liftarm_connect_start_constant_x_fp { l__liftarm_connect_constant_x_coord_#2_fp }
+ \fp_set_eq:Nc \l__liftarm_connect_start_constant_y_fp { l__liftarm_connect_constant_y_coord_#2_fp }
+ \seq_set_eq:Nc \l__liftarm_connect_start_arg_seq { l__liftarm_connect_arg_coord_#2_seq }
+ \seq_set_eq:Nc \l__liftarm_connect_start_coeff_seq { l__liftarm_connect_coeff_coord_#2_seq }
+ }
+ {
+ \__liftarm_def_coord:n {#2}
+ \fp_set_eq:NN \l__liftarm_connect_start_constant_x_fp \g__liftarm_coord_x_fp
+ \fp_set_eq:NN \l__liftarm_connect_start_constant_y_fp \g__liftarm_coord_y_fp
+ \seq_clear:N \l__liftarm_connect_start_arg_seq
+ \seq_clear:N \l__liftarm_connect_start_coeff_seq
+ }
+ \clist_map_inline:en { \pgfkeysvalueof { / liftarm / connect_algorithm / coordinate } }
+ {
+ \seq_set_split:Nnn \l__liftarm_coordinate_seq { / } {##1}
+ \pgfmathparse { \seq_item:Nn \l__liftarm_coordinate_seq { 1 } }
+ \fp_set:Nn \l__liftarm_length_fp { \pgfmathresult - \l__liftarm_origin_fp }
+ \seq_if_in:NeTF \l__liftarm_connect_coordinate_seq { \seq_item:Nn \l__liftarm_coordinate_seq { 2 } }
+ {
+ \clist_map_inline:nn { x , y }
+ {
+ \int_incr:N \l__liftarm_connect_equation_int
+ \tl_clear_new:c { l__liftarm_connect_F_\int_use:N \l__liftarm_connect_equation_int _tl }
+ \tl_build_begin:c { l__liftarm_connect_F_\int_use:N \l__liftarm_connect_equation_int _tl }
+ \int_step_inline:nn { \l__liftarm_LU_N_int }
+ {
+ \tl_clear_new:c { l__liftarm_connect_Jacobian_\int_use:N \l__liftarm_connect_equation_int _########1_tl }
+ \tl_build_begin:c { l__liftarm_connect_Jacobian_\int_use:N \l__liftarm_connect_equation_int _########1_tl }
+ \tl_build_put_right:cn { l__liftarm_connect_Jacobian_\int_use:N \l__liftarm_connect_equation_int _########1_tl }
+ { 0 }
+ \fp_zero_new:c { l__liftarm_LU_A_\int_use:N \l__liftarm_connect_equation_int _########1_fp }
+ }
+ \tl_build_put_right:ce { l__liftarm_connect_F_\int_use:N \l__liftarm_connect_equation_int _tl }
+ {
+ \fp_use:c { l__liftarm_connect_constant_####1_coord_\seq_item:Nn \l__liftarm_coordinate_seq { 2 }_fp }
+ - \fp_use:c { l__liftarm_connect_start_constant_####1_fp }
+ - \fp_use:N \l__liftarm_length_fp * \cs:w c__liftarm_cos_sin_####1_tl\cs_end:
+ ( \exp_not:N \cs:w l__liftarm_connect_angle_\int_use:N \l__liftarm_connect_count_int _fp \exp_not:N \cs_end: )
+ }
+ \tl_build_put_right:ce
+ {
+ l__liftarm_connect_Jacobian_\int_use:N \l__liftarm_connect_equation_int _
+ \int_use:N \l__liftarm_connect_count_int _tl
+ }
+ {
+ - \fp_use:N \l__liftarm_length_fp * \cs:w c__liftarm_cos_sin_diff_####1_tl\cs_end:
+ ( \exp_not:N \cs:w l__liftarm_connect_angle_\int_use:N \l__liftarm_connect_count_int _fp \exp_not:N \cs_end: )
+ }
+ \seq_map_indexed_inline:cn { l__liftarm_connect_arg_coord_\seq_item:Nn \l__liftarm_coordinate_seq { 2 }_seq }
+ {
+ \tl_build_put_right:ce { l__liftarm_connect_F_\int_use:N \l__liftarm_connect_equation_int _tl }
+ {
+ + \seq_item:cn { l__liftarm_connect_coeff_coord_\seq_item:Nn \l__liftarm_coordinate_seq { 2 }_seq } {########1}
+ * \cs:w c__liftarm_cos_sin_####1_tl\cs_end:
+ ( \exp_not:N \cs:w l__liftarm_connect_angle_########2_fp \exp_not:N \cs_end: )
+ }
+ \tl_build_put_right:ce { l__liftarm_connect_Jacobian_\int_use:N \l__liftarm_connect_equation_int _########2_tl }
+ {
+ + \seq_item:cn { l__liftarm_connect_coeff_coord_\seq_item:Nn \l__liftarm_coordinate_seq { 2 }_seq } {########1}
+ * \cs:w c__liftarm_cos_sin_diff_####1_tl\cs_end:
+ ( \exp_not:N \cs:w l__liftarm_connect_angle_########2_fp \exp_not:N \cs_end: )
+ }
+ }
+ \seq_map_indexed_inline:Nn \l__liftarm_connect_start_arg_seq
+ {
+ \tl_build_put_right:ce { l__liftarm_connect_F_\int_use:N \l__liftarm_connect_equation_int _tl }
+ {
+ - \seq_item:Nn \l__liftarm_connect_start_coeff_seq {########1} * \cs:w c__liftarm_cos_sin_####1_tl\cs_end:
+ ( \exp_not:N \cs:w l__liftarm_connect_angle_########2_fp \exp_not:N \cs_end: )
+ }
+ \tl_build_put_right:ce { l__liftarm_connect_Jacobian_\int_use:N \l__liftarm_connect_equation_int _########2_tl }
+ {
+ - \seq_item:Nn \l__liftarm_connect_start_coeff_seq {########1} * \cs:w c__liftarm_cos_sin_diff_####1_tl\cs_end:
+ ( \exp_not:N \cs:w l__liftarm_connect_angle_########2_fp \exp_not:N \cs_end: )
+ }
+ }
+ \tl_build_end:c { l__liftarm_connect_F_\int_use:N \l__liftarm_connect_equation_int _tl }
+ \int_step_inline:nn { \l__liftarm_LU_N_int }
+ { \tl_build_end:c { l__liftarm_connect_Jacobian_\int_use:N \l__liftarm_connect_equation_int _########1_tl } }
+ }
+ }
+ {
+ \clist_map_inline:nn { x , y }
+ {
+ \fp_zero_new:c { l__liftarm_connect_constant_####1_coord_\seq_item:Nn \l__liftarm_coordinate_seq { 2 }_fp }
+ \fp_set_eq:cc { l__liftarm_connect_constant_####1_coord_\seq_item:Nn \l__liftarm_coordinate_seq { 2 }_fp }
+ { l__liftarm_connect_start_constant_####1_fp }
+ }
+ \clist_map_inline:nn { arg , coeff }
+ {
+ \seq_clear_new:c { l__liftarm_connect_####1_coord_\seq_item:Nn \l__liftarm_coordinate_seq { 2 }_seq }
+ \seq_set_eq:cc { l__liftarm_connect_####1_coord_\seq_item:Nn \l__liftarm_coordinate_seq { 2 }_seq }
+ { l__liftarm_connect_start_####1_seq }
+ }
+ \seq_put_right:ce { l__liftarm_connect_arg_coord_\seq_item:Nn \l__liftarm_coordinate_seq { 2 }_seq }
+ { \int_use:N \l__liftarm_connect_count_int }
+ \seq_put_right:ce { l__liftarm_connect_coeff_coord_\seq_item:Nn \l__liftarm_coordinate_seq { 2 }_seq }
+ { \fp_use:N \l__liftarm_length_fp }
+ \seq_put_right:Ne \l__liftarm_connect_coordinate_seq { \seq_item:Nn \l__liftarm_coordinate_seq { 2 } }
+ }
+ }
+ }
+
+\cs_new_protected:Npn \__liftarm_connect_stop_criterion:
+ {
+ \int_step_inline:nn { \l__liftarm_LU_N_int }
+ { \fp_set:cn { l__liftarm_LU_b_##1_fp } { \cs:w l__liftarm_connect_F_##1_tl\cs_end: } }
+ \str_case:Vn \l__liftarm_connect_stop_type_str
+ {
+ { 1-norm }
+ {
+ \fp_zero:N \l__liftarm_connect_norm_fp
+ \int_step_inline:nn { \l__liftarm_LU_N_int }
+ { \fp_add:Nn \l__liftarm_connect_norm_fp { abs ( \cs:w l__liftarm_LU_b_##1_fp\cs_end: ) } }
+ \bool_set:Nn \l__liftarm_LU_bool
+ { \fp_compare_p:nNn { \l__liftarm_connect_norm_fp } > { \l__liftarm_connect_stop_value_fp } }
+ }
+ { 2-norm }
+ {
+ \fp_zero:N \l__liftarm_connect_norm_fp
+ \int_step_inline:nn { \l__liftarm_LU_N_int }
+ { \fp_add:Nn \l__liftarm_connect_norm_fp { ( \cs:w l__liftarm_LU_b_##1_fp\cs_end: ) ^ 2 } }
+ \bool_set:Nn \l__liftarm_LU_bool
+ { \fp_compare_p:nNn { sqrt ( \l__liftarm_connect_norm_fp ) } > { \l__liftarm_connect_stop_value_fp } }
+ }
+ { iterations }
+ {
+ \bool_set:Nn \l__liftarm_LU_bool
+ { \fp_compare_p:nNn { \l__liftarm_LU_count_int } < { \l__liftarm_connect_stop_value_fp } }
+ }
+ }
+ }
+
+\cs_new_protected:Npn \__liftarm_def_coord:n #1
+ {
+ \path let \p { l__liftarm_coord } = (#1) in
+ [
+ / utils / exec =
+ {
+ \fp_gset:Nn \g__liftarm_coord_x_fp
+ { ( \pgf@yy * \x { l__liftarm_coord } - \pgf@yx * \y { l__liftarm_coord } ) / \l__liftarm_connect_det_fp }
+ \fp_gset:Nn \g__liftarm_coord_y_fp
+ { ( \pgf@xx * \y { l__liftarm_coord } - \pgf@xy * \x { l__liftarm_coord } ) / \l__liftarm_connect_det_fp }
+ }
+ ] ;
+ }
+
+\cs_new_protected:Npn \__liftarm_default:nnnn #1#2#3#4
+ {
+ \pgfmathparse {#3}
+ \fp_set:Nn \l__liftarm_length_fp { \pgfmathresult }
+ \fp_compare:nNnTF { \l__liftarm_length_fp } < { 0 }
+ { \PackageWarning { liftarm } { The~length~( \fp_use:N \l__liftarm_length_fp )~of~the~liftarm~is~smaller~than~0. } }
+ {
+ \pgfmathparse {#4}
+ \fp_set:Nn \l__liftarm_angle_fp { \pgfmathresult }
+ \begin { scope }
+ [
+ shift = { (#2) } ,
+ rotate = \fp_use:N \l__liftarm_angle_fp
+ ]
+ \pgfkeys { / liftarm , #1 }
+ \tl_set:Ne \l__liftarm_color_tl
+ {
+ \cs:w
+ l__liftarm_color_
+ \int_mod:nn { \fp_eval:n { trunc ( \l__liftarm_length_fp , 0 ) } } { \pgfkeysvalueof { / liftarm / color~modulo } }_tl
+ \cs_end:
+ }
+ \begin { scope } [ shift = { ( - \fp_use:N \l__liftarm_origin_fp , 0 ) } ]
+ \str_case:Vn \l__liftarm_type_str
+ {
+ { liftarm }
+ {
+ \pgfmathparse { \pgfkeysvalueof { / liftarm / liftarm~thickness } }
+ \fp_set:Nn \l__liftarm_half_thickness_fp { 0.5 * \l__liftarm_scalefactor_fp * \pgfmathresult }
+ \pgfmathparse { \pgfkeysvalueof { / liftarm / hole~radius } }
+ \fp_set:Nn \l__liftarm_hole_radius_fp { \l__liftarm_scalefactor_fp * \pgfmathresult }
+ \bool_if:NTF \l__liftarm_brick_bool
+ {
+ \tl_build_begin:N \l__liftarm_shape_tl
+ \tl_build_put_right:Ne \l__liftarm_shape_tl
+ {
+ ( -1 , \fp_eval:n { - \l__liftarm_scalefactor_fp * 0.7 } )
+ -- ( -1 , \fp_eval:n { \l__liftarm_scalefactor_fp * 0.5 } )
+ }
+ \int_step_inline:nnn { -1 } { \fp_eval:n { trunc ( \l__liftarm_length_fp , 0 ) } }
+ {
+ \tl_build_put_right:Ne \l__liftarm_shape_tl
+ {
+ -- (
+ \fp_eval:n { ##1 + 0.5 - \l__liftarm_scalefactor_fp * 0.3 } ,
+ \fp_eval:n { \l__liftarm_scalefactor_fp * 0.5 }
+ )
+ --++ ( 0 , \fp_eval:n { \l__liftarm_scalefactor_fp * 0.2 } )
+ --++ ( \fp_eval:n { \l__liftarm_scalefactor_fp * 0.6 } , 0 )
+ --++ ( 0 , \fp_eval:n { - \l__liftarm_scalefactor_fp * 0.2 } )
+ }
+ }
+ \tl_build_put_right:Ne \l__liftarm_shape_tl
+ {
+ -- ( \fp_eval:n { \l__liftarm_length_fp + 1 } , \fp_eval:n { \l__liftarm_scalefactor_fp * 0.5 } )
+ --++ ( 0 , \fp_eval:n { - \l__liftarm_scalefactor_fp * 1.2 } )
+ -- cycle
+ }
+ \tl_build_end:N \l__liftarm_shape_tl
+ }
+ {
+ \tl_set:Ne \l__liftarm_shape_tl
+ {
+ ( 0 , \fp_use:N \l__liftarm_half_thickness_fp )
+ arc
+ [
+ start~angle = 90 ,
+ end~angle = 270 ,
+ radius = \fp_use:N \l__liftarm_half_thickness_fp
+ ]
+ -- ( \fp_use:N \l__liftarm_length_fp , - \fp_use:N \l__liftarm_half_thickness_fp )
+ arc
+ [
+ start~angle = -90 ,
+ end~angle = 90 ,
+ radius = \fp_use:N \l__liftarm_half_thickness_fp
+ ]
+ -- cycle
+ }
+ }
+ \tl_build_begin:N \l__liftarm_holes_tl
+ \int_step_inline:nnn { 0 } { \fp_eval:n { trunc ( \l__liftarm_length_fp , 0 ) } }
+ {
+ \clist_if_in:enTF { \pgfkeysvalueof { / liftarm / axle~holes } } {##1}
+ {
+ \int_step_inline:nn { 4 }
+ {
+ \tl_build_put_right:Ne \l__liftarm_holes_tl
+ {
+ (
+ \fp_eval:n
+ {
+ ##1 + sqrt ( 2 ) * \l__liftarm_hole_radius_fp * sind ( \c__liftarm_axle_hole_angle_fp )
+ * cosd ( ####1 * 90 - 45 )
+ } ,
+ \fp_eval:n { sqrt ( 2 ) * \l__liftarm_hole_radius_fp * sind ( \c__liftarm_axle_hole_angle_fp )
+ * sind ( ####1 * 90 - 45 ) }
+ )
+ -- (
+ \fp_eval:n
+ {
+ ##1
+ + \l__liftarm_hole_radius_fp * cosd ( ####1 * 90 - \c__liftarm_axle_hole_angle_fp )
+ } ,
+ \fp_eval:n { \l__liftarm_hole_radius_fp * sind ( ####1 * 90 - \c__liftarm_axle_hole_angle_fp ) }
+ )
+ arc
+ [
+ start~angle = \fp_eval:n { ####1 * 90 - \c__liftarm_axle_hole_angle_fp } ,
+ end~angle = \fp_eval:n { ####1 * 90 + \c__liftarm_axle_hole_angle_fp } ,
+ radius = \fp_use:N \l__liftarm_hole_radius_fp
+ ]
+ --
+ }
+ }
+ \tl_build_put_right:Nn \l__liftarm_holes_tl { cycle }
+ }
+ {
+ \tl_build_put_right:Ne \l__liftarm_holes_tl
+ { ( ##1 , 0 ) circle [ radius = \fp_use:N \l__liftarm_hole_radius_fp ] }
+ }
+ }
+ \tl_build_end:N \l__liftarm_holes_tl
+ \fill [ \l__liftarm_color_tl , even~odd~rule , / liftarm / liftarm_style ]
+ \l__liftarm_shape_tl \l__liftarm_holes_tl ;
+ \bool_if:NT \l__liftarm_contour_bool
+ { \draw [ \l__liftarm_color_tl ! 75 ! black , ultra~thick , / liftarm / contour_style ] \l__liftarm_shape_tl ; }
+ \clist_map_inline:en { \pgfkeysvalueof { / liftarm / mark~holes } }
+ {
+ \fill [ black , / liftarm / mark_style ]
+ ( {##1} , 0 ) circle [ radius = \fp_eval:n { \l__liftarm_mark_radius_fp * \l__liftarm_hole_radius_fp } ] ;
+ }
+ \clist_map_inline:en { \pgfkeysvalueof { / liftarm / screw~holes } }
+ {
+ \clist_map_inline:nn { -1 , 1 }
+ {
+ \fill [ black , shift = { ( {##1} , 0 ) } , rotate = 45 , / liftarm / screw_style ]
+ (
+ \fp_eval:n { ####1 * \l__liftarm_screw_angle_fp }
+ \c_colon_str
+ \fp_eval:n { \l__liftarm_screw_radius_fp * \l__liftarm_hole_radius_fp }
+ )
+ arc
+ [
+ start~angle = \fp_eval:n { ####1 * \l__liftarm_screw_angle_fp } ,
+ end~angle = \fp_eval:n { ####1 * ( 180 - \l__liftarm_screw_angle_fp ) } ,
+ radius = \fp_eval:n { \l__liftarm_screw_radius_fp * \l__liftarm_hole_radius_fp }
+ ]
+ ;
+ }
+ }
+ }
+ { line~segment }
+ {
+ \draw [ \l__liftarm_color_tl , / liftarm / liftarm_style ] ( 0 , 0 ) -- ( \fp_use:N \l__liftarm_length_fp , 0 ) ;
+ }
+ }
+ \clist_map_inline:en { \pgfkeysvalueof { / liftarm / coordinate } }
+ {
+ \seq_set_split:Nnn \l__liftarm_coordinate_seq { / } {##1}
+ \coordinate ( \seq_item:Nn \l__liftarm_coordinate_seq { 2 } )
+ at ( { \seq_item:Nn \l__liftarm_coordinate_seq { 1 } } , 0 ) ;
+ }
+ \bool_if:NT \l__liftarm_animate_bool
+ {
+ \clist_map_inline:Nn \l__liftarm_trace_clist
+ {
+ \seq_set_split:Nnn \l__liftarm_trace_item_seq { / } {##1}
+ \stepcounter { g__liftarm_animate_frame_number_counter }
+ \tl_build_gput_right:Ne \g__liftarm_animate_frames_trace_tl
+ {
+ \exp_not:n { \newframe \begin } { scope }
+ [ shift = { (#2) } , rotate = \fp_use:N \l__liftarm_angle_fp ]
+ \exp_not:N \begin { scope }
+ [ shift = { ( \fp_eval:n { \seq_item:Nn \l__liftarm_trace_item_seq { 1 } - \l__liftarm_origin_fp } , 0 ) } ]
+ \tl_if_empty:eTF { \seq_item:Nn \l__liftarm_trace_item_seq { 3 } }
+ {
+ \exp_not:N \fill
+ [ black ] ( 0 , 0 ) circle [ radius = \fp_eval:n { \l__liftarm_hole_radius_fp * 2 / 3 } ] ;
+ }
+ { \seq_item:Nn \l__liftarm_trace_item_seq { 3 } }
+ \exp_not:n { \end { scope } \end { scope } }
+ }
+ \tl_if_empty:eTF { \seq_item:Nn \l__liftarm_trace_item_seq { 2 } }
+ {
+ \tl_build_gput_right:ce { g__liftarm_animate_timeline_0_tl }
+ { \theg__liftarm_animate_frame_number_counter x 0 , }
+ }
+ {
+ \pgfmathparse { \use:e { \seq_item:Nn \l__liftarm_trace_item_seq { 2 } } }
+ \tl_build_gput_right:ce { g__liftarm_animate_timeline_\theg__liftarm_animate_step_number_counter _tl }
+ { \theg__liftarm_animate_frame_number_counter x \fp_eval:n { \pgfmathresult } , }
+ }
+ }
+ }
+ \end { scope }
+ \end { scope }
+ }
+ }
+
+\cs_new_protected:Npn \__liftarm_LU_decomposition:
+ {
+ \int_step_inline:nn { \l__liftarm_LU_N_int }
+ {
+ \int_zero_new:c { l__liftarm_LU_P_##1_int }
+ \int_set:cn { l__liftarm_LU_P_##1_int } {##1}
+ }
+ \int_step_inline:nn { \l__liftarm_LU_N_int }
+ {
+ \fp_zero:N \l__liftarm_LU_maxA_fp
+ \int_set:Nn \l__liftarm_LU_imax_int {##1}
+ \int_step_inline:nnn {##1} { \l__liftarm_LU_N_int }
+ {
+ \fp_set:Nn \l__liftarm_LU_tmp_fp { abs ( \cs:w l__liftarm_LU_A_####1_##1_fp\cs_end: ) }
+ \fp_compare:nNnT { \l__liftarm_LU_tmp_fp } > { \l__liftarm_LU_maxA_fp }
+ {
+ \fp_set_eq:NN \l__liftarm_LU_maxA_fp \l__liftarm_LU_tmp_fp
+ \int_set:Nn \l__liftarm_LU_imax_int {####1}
+ }
+ }
+ \int_compare:nNnF { \l__liftarm_LU_imax_int } = {##1}
+ {
+ \int_set_eq:Nc \l__liftarm_LU_j_int { l__liftarm_LU_P_##1_int }
+ \int_set_eq:cc { l__liftarm_LU_P_##1_int } { l__liftarm_LU_P_\int_use:N \l__liftarm_LU_imax_int _int }
+ \int_set_eq:cN { l__liftarm_LU_P_\int_use:N \l__liftarm_LU_imax_int _int } \l__liftarm_LU_j_int
+ \int_step_inline:nn { \l__liftarm_LU_N_int }
+ {
+ \fp_set_eq:Nc \l__liftarm_LU_tmp_fp { l__liftarm_LU_A_##1_####1_fp }
+ \fp_set_eq:cc { l__liftarm_LU_A_##1_####1_fp } { l__liftarm_LU_A_\int_use:N \l__liftarm_LU_imax_int _####1_fp }
+ \fp_set_eq:cN { l__liftarm_LU_A_\int_use:N \l__liftarm_LU_imax_int _####1_fp } \l__liftarm_LU_tmp_fp
+ }
+ }
+ \int_step_inline:nnn { ##1 + 1 } { \l__liftarm_LU_N_int }
+ {
+ \fp_set:cn { l__liftarm_LU_A_####1_##1_fp }
+ { \cs:w l__liftarm_LU_A_####1_##1_fp\cs_end: / \cs:w l__liftarm_LU_A_##1_##1_fp\cs_end: }
+ \int_step_inline:nnn { ##1 + 1 } { \l__liftarm_LU_N_int }
+ {
+ \fp_sub:cn { l__liftarm_LU_A_####1_########1_fp }
+ { \cs:w l__liftarm_LU_A_####1_##1_fp\cs_end: * \cs:w l__liftarm_LU_A_##1_########1_fp\cs_end: }
+ }
+ }
+ }
+ }
+
+\cs_new_protected:Npn \__liftarm_LU_solve:
+ {
+ \int_step_inline:nn { \l__liftarm_LU_N_int }
+ {
+ \fp_zero_new:c { l__liftarm_LU_x_##1_fp }
+ \fp_set_eq:cc { l__liftarm_LU_x_##1_fp } { l__liftarm_LU_b_\int_use:c { l__liftarm_LU_P_##1_int }_fp }
+ \int_step_inline:nn { ##1 - 1 }
+ {
+ \fp_sub:cn { l__liftarm_LU_x_##1_fp }
+ { \cs:w l__liftarm_LU_A_##1_####1_fp\cs_end: * \cs:w l__liftarm_LU_x_####1_fp\cs_end: }
+ }
+ }
+ \int_step_inline:nnnn { \l__liftarm_LU_N_int } { -1 } { 1 }
+ {
+ \int_step_inline:nnn { ##1 + 1 } { \l__liftarm_LU_N_int }
+ {
+ \fp_sub:cn { l__liftarm_LU_x_##1_fp }
+ { \cs:w l__liftarm_LU_A_##1_####1_fp\cs_end: * \cs:w l__liftarm_LU_x_####1_fp\cs_end: }
+ }
+ \fp_set:cn { l__liftarm_LU_x_##1_fp } { \cs:w l__liftarm_LU_x_##1_fp\cs_end: / \cs:w l__liftarm_LU_A_##1_##1_fp\cs_end: }
+ }
+ }
+
+\cs_new:Npn \__liftarm_Mod:nn #1#2
+ {
+ min
+ (
+ Mod
+ (
+ \fp_eval:n { \cs:w l__liftarm_connect_two_#1_option_#2_angle_fp\cs_end: - \cs:w l__liftarm_connect_angle_#1_fp\cs_end: } ,
+ 360
+ ) ,
+ Mod
+ (
+ \fp_eval:n { \cs:w l__liftarm_connect_angle_#1_fp\cs_end: - \cs:w l__liftarm_connect_two_#1_option_#2_angle_fp\cs_end: } ,
+ 360
+ )
+ )
+ }
+
+%%> \subsection{Document commands and environment}
+
+\NewDocumentCommand \liftarm { O {} m m m }
+ { \__liftarm_default:nnnn {#1} {#2} {#3} {#4} }
+
+\NewDocumentCommand \liftarmanimate { O {} m m m }
+ {
+ \bool_set_true:N \l__liftarm_animate_bool
+ \stepcounter { g__liftarm_animate_number_of_animation_counter }
+ \setcounter { g__liftarm_animate_number_of_steps_counter } { -1 }
+ \tl_build_gbegin:N \g__liftarm_animate_frames_tl
+ \tl_build_gbegin:N \g__liftarm_animate_frames_trace_tl
+ \setcounter { g__liftarm_animate_step_number_counter } { -1 }
+ \foreach \l__liftarm_animate_value_tl in {#3}
+ {
+ \stepcounter { g__liftarm_animate_number_of_steps_counter }
+ \tl_build_gput_right:Ne \g__liftarm_animate_frames_tl
+ {
+ \exp_not:n { \newframe \stepcounter { g__liftarm_animate_step_number_counter } #4 }
+ { \l__liftarm_animate_value_tl }
+ }
+ }
+ \tl_build_gend:N \g__liftarm_animate_frames_tl
+ \int_step_inline:nnn { 0 } { \theg__liftarm_animate_number_of_steps_counter }
+ {
+ \tl_clear_new:c { g__liftarm_animate_timeline_##1_tl }
+ \tl_build_gbegin:c { g__liftarm_animate_timeline_##1_tl }
+ }
+ \tl_build_gput_right:cn { g__liftarm_animate_timeline_0_tl } { c , }
+ \setcounter { g__liftarm_animate_frame_number_counter } { \theg__liftarm_animate_number_of_steps_counter }
+ \file_if_exist:nF { \c_sys_jobname_str \theg__liftarm_animate_number_of_animation_counter . tln }
+ {
+ \iow_open:Nn \g__liftarm_animate_write_timeline_iow
+ { \c_sys_jobname_str \theg__liftarm_animate_number_of_animation_counter . tln }
+ \iow_now:Ne \g__liftarm_animate_write_timeline_iow { \c_colon_str \c_colon_str c , 0 }
+ \iow_close:N \g__liftarm_animate_write_timeline_iow
+ }
+ \begin { animateinline } [ #1 , timeline = \c_sys_jobname_str \theg__liftarm_animate_number_of_animation_counter . tln ] {#2}
+ \tl_tail:N \g__liftarm_animate_frames_tl%remove the first \newframe
+ \tl_build_gend:N \g__liftarm_animate_frames_trace_tl
+ \g__liftarm_animate_frames_trace_tl
+ \end { animateinline }
+ \iow_open:Nn \g__liftarm_animate_write_timeline_iow { \c_sys_jobname_str \theg__liftarm_animate_number_of_animation_counter . tln }
+ \int_step_inline:nnn { 0 } { \theg__liftarm_animate_number_of_steps_counter }
+ {
+ \tl_build_gend:c { g__liftarm_animate_timeline_##1_tl }
+ \iow_now:Ne \g__liftarm_animate_write_timeline_iow
+ { \c_colon_str \c_colon_str \cs:w g__liftarm_animate_timeline_##1_tl\cs_end: ##1 }
+ }
+ \iow_close:N \g__liftarm_animate_write_timeline_iow
+ \bool_set_false:N \l__liftarm_animate_bool
+ }
+
+\NewDocumentCommand \liftarmconstruct { m }
+ {
+ \tl_gput_right:Nn \g__liftarm_construct_tl {#1}
+ \g__liftarm_construct_tl
+ }
+
+\NewDocumentCommand \liftarmconstructclear {}
+ { \tl_gclear:N \g__liftarm_construct_tl }
+
+\NewDocumentEnvironment { liftarmconnect } { O {} +b }
+ {
+ \pgfkeys { / liftarm , #1 }
+ %verify that the contents consists only of commands \liftarm because the contents of this environment are processed several times
+ \DeclareExpandableDocumentCommand \liftarm { O {} m m m } {}%expandable for usage in \tl_set:Ne
+ \tl_set:Ne \l__liftarm_tmp_tl {#2}
+ \tl_remove_all:Nn \l__liftarm_tmp_tl { \par }
+ \tl_if_blank:VF \l__liftarm_tmp_tl
+ { \PackageError { liftarm } { The~environment~liftarmconnect~should~only~consist~of~commands~\protect \liftarm } {} }
+ \int_zero:N \l__liftarm_LU_N_int
+ \RenewDocumentCommand \liftarm { O {} m m m } { \int_incr:N \l__liftarm_LU_N_int }
+ #2
+ \fp_set:Nn \l__liftarm_connect_det_fp { \pgf@yy * \pgf@xx - \pgf@yx * \pgf@xy }
+ \int_case:nnF { \l__liftarm_LU_N_int }
+ {
+ { 0 }
+ {}
+ { 1 }
+ {
+ \RenewDocumentCommand \liftarm { O {} m m m }
+ { \__liftarm_default:nnnn {##1} {##2} {##3} {##4} }
+ }
+ { 2 }
+ {
+ \int_zero:N \l__liftarm_connect_count_int
+ \int_zero:N \l__liftarm_connect_equation_int
+ \seq_clear:N \l__liftarm_connect_coordinate_seq
+ \fp_set_eq:NN \l__liftarm_origin_connect_initial_fp \l__liftarm_origin_fp
+ \RenewDocumentCommand \liftarm { O {} m m m }
+ {
+ \int_incr:N \l__liftarm_connect_count_int
+ \fp_zero_new:c { l__liftarm_connect_angle_\int_use:N \l__liftarm_connect_count_int _fp }
+ \pgfmathparse {##4}
+ \fp_set:cn { l__liftarm_connect_angle_\int_use:N \l__liftarm_connect_count_int _fp } { \pgfmathresult }
+ \fp_set_eq:NN \l__liftarm_origin_fp \l__liftarm_origin_connect_initial_fp
+ \pgfkeys
+ {
+ / liftarm / connect_algorithm ,
+ coordinate = \pgfkeysvalueof { / liftarm / coordinate } ,
+ ##1
+ }
+ \__liftarm_def_coord:n {##2}
+ \fp_set_eq:cN { l__liftarm_connect_two_\int_to_Alph:n { \l__liftarm_connect_count_int }_x_fp } \g__liftarm_coord_x_fp
+ \fp_set_eq:cN { l__liftarm_connect_two_\int_to_Alph:n { \l__liftarm_connect_count_int }_y_fp } \g__liftarm_coord_y_fp
+ \int_compare:nNnTF { \l__liftarm_connect_count_int } = { 1 }
+ {
+ \clist_map_inline:en { \pgfkeysvalueof { / liftarm / connect_algorithm / coordinate } }
+ {
+ \seq_set_split:Nnn \l__liftarm_coordinate_seq { / } {####1}
+ \tl_clear_new:c { l__liftarm_connect_two_A_length_coord_\seq_item:Nn \l__liftarm_coordinate_seq { 2 }_tl }
+ \tl_set:ce { l__liftarm_connect_two_A_length_coord_\seq_item:Nn \l__liftarm_coordinate_seq { 2 }_tl }
+ { \seq_item:Nn \l__liftarm_coordinate_seq { 1 } - \fp_use:N \l__liftarm_origin_fp }
+ \seq_put_right:Ne \l__liftarm_connect_coordinate_seq { \seq_item:Nn \l__liftarm_coordinate_seq { 2 } }
+ }
+ }
+ {
+ \clist_map_inline:en { \pgfkeysvalueof { / liftarm / connect_algorithm / coordinate } }
+ {
+ \seq_set_split:Nnn \l__liftarm_coordinate_seq { / } {####1}
+ \seq_if_in:NeT \l__liftarm_connect_coordinate_seq { \seq_item:Nn \l__liftarm_coordinate_seq { 2 } }
+ {
+ \int_incr:N \l__liftarm_connect_equation_int
+ \int_compare:nNnT { \l__liftarm_connect_equation_int } > { 1 }
+ { \PackageError { liftarm } { There~are~too~many~conditions~for~2~liftarms } {} }
+ \pgfmathparse
+ { \cs:w l__liftarm_connect_two_A_length_coord_\seq_item:Nn \l__liftarm_coordinate_seq { 2 }_tl\cs_end: }
+ \fp_set:Nn \l__liftarm_connect_two_A_length_fp { \pgfmathresult }
+ \pgfmathparse { \seq_item:Nn \l__liftarm_coordinate_seq { 1 } }
+ \fp_set:Nn \l__liftarm_connect_two_B_length_fp { \pgfmathresult - \l__liftarm_origin_fp }
+ }
+ }
+ }
+ }
+ #2
+ \fp_set:Nn \l__liftarm_connect_two_length_fp
+ {
+ sqrt (
+ ( \l__liftarm_connect_two_A_x_fp - \l__liftarm_connect_two_B_x_fp ) ^ 2
+ + ( \l__liftarm_connect_two_A_y_fp - \l__liftarm_connect_two_B_y_fp ) ^ 2
+ )
+ }
+ \fp_set:Nn \l__liftarm_connect_two_angle_fp
+ {
+ atand (
+ \l__liftarm_connect_two_B_y_fp - \l__liftarm_connect_two_A_y_fp ,
+ \l__liftarm_connect_two_B_x_fp - \l__liftarm_connect_two_A_x_fp
+ )
+ }
+ \fp_set:Nn \l__liftarm_connect_two_A_angle_fp
+ {
+ acosd (
+ (
+ ( \l__liftarm_connect_two_A_length_fp ) ^ 2 + ( \l__liftarm_connect_two_length_fp ) ^ 2
+ - ( \l__liftarm_connect_two_B_length_fp ) ^ 2
+ ) / ( 2 * \l__liftarm_connect_two_A_length_fp * \l__liftarm_connect_two_length_fp )
+ )
+ }
+ \fp_set:Nn \l__liftarm_connect_two_B_angle_fp
+ {
+ acosd (
+ (
+ ( \l__liftarm_connect_two_B_length_fp ) ^ 2 + ( \l__liftarm_connect_two_length_fp ) ^ 2
+ - ( \l__liftarm_connect_two_A_length_fp ) ^ 2
+ ) / ( 2 * \l__liftarm_connect_two_B_length_fp * \l__liftarm_connect_two_length_fp )
+ )
+ }
+ \fp_set:cn { l__liftarm_connect_two_1_option_0_angle_fp }
+ { \l__liftarm_connect_two_angle_fp + \l__liftarm_connect_two_A_angle_fp }
+ \fp_set:cn { l__liftarm_connect_two_1_option_1_angle_fp }
+ { \l__liftarm_connect_two_angle_fp - \l__liftarm_connect_two_A_angle_fp }
+ \fp_set:cn { l__liftarm_connect_two_2_option_0_angle_fp }
+ { 180 + \l__liftarm_connect_two_angle_fp - \l__liftarm_connect_two_B_angle_fp }
+ \fp_set:cn { l__liftarm_connect_two_2_option_1_angle_fp }
+ { 180 + \l__liftarm_connect_two_angle_fp + \l__liftarm_connect_two_B_angle_fp }
+ \pgfmathparse
+ {
+ \__liftarm_Mod:nn { 1 } { 0 } + \__liftarm_Mod:nn { 2 } { 0 }
+ >
+ \__liftarm_Mod:nn { 1 } { 1 } + \__liftarm_Mod:nn { 2 } { 1 }
+ }
+ \tl_set:Ne \l__liftarm_tmp_tl { \pgfmathresult }
+ \int_zero:N \l__liftarm_connect_count_int
+ \RenewDocumentCommand \liftarm { O {} m m m }
+ {
+ \int_incr:N \l__liftarm_connect_count_int
+ \__liftarm_default:nnnn {##1} {##2} {##3}
+ { \fp_use:c { l__liftarm_connect_two_\int_use:N \l__liftarm_connect_count_int _option_\l__liftarm_tmp_tl _angle_fp } }
+ }
+ }
+ }
+ {
+ \int_zero:N \l__liftarm_connect_count_int
+ \int_zero:N \l__liftarm_connect_equation_int
+ \seq_clear:N \l__liftarm_connect_coordinate_seq
+ \fp_set_eq:NN \l__liftarm_origin_connect_initial_fp \l__liftarm_origin_fp
+ \RenewDocumentCommand \liftarm { O {} m m m } { \__liftarm_connect:nnnn {##1} {##2} {##3} {##4} }
+ #2
+ \int_compare:nNnF { \l__liftarm_connect_equation_int } = { \l__liftarm_LU_N_int }
+ {
+ \PackageError { liftarm }
+ {
+ The~Jacobian~matrix~is~not~square~
+ (the~size~is~\int_use:N \l__liftarm_connect_equation_int \space by~\int_use:N \l__liftarm_LU_N_int )
+ } {}
+ }
+ \int_zero:N \l__liftarm_LU_count_int
+ \int_step_inline:nn { \l__liftarm_LU_N_int }
+ { \fp_zero_new:c { l__liftarm_LU_b_##1_fp } }
+ \__liftarm_connect_stop_criterion:
+ \bool_while_do:Nn \l__liftarm_LU_bool
+ {
+ \int_step_inline:nn { \l__liftarm_LU_N_int }
+ {
+ \int_step_inline:nn { \l__liftarm_LU_N_int }
+ { \fp_set:cn { l__liftarm_LU_A_##1_####1_fp } { \cs:w l__liftarm_connect_Jacobian_##1_####1_tl\cs_end: } }
+ }
+ \__liftarm_LU_decomposition:
+ \__liftarm_LU_solve:
+ \int_step_inline:nn { \l__liftarm_LU_N_int }
+ { \fp_sub:cn { l__liftarm_connect_angle_##1_fp } { \cs:w l__liftarm_LU_x_##1_fp\cs_end: } }
+ \int_incr:N \l__liftarm_LU_count_int
+ \__liftarm_connect_stop_criterion:
+ }
+ \int_zero:N \l__liftarm_connect_count_int
+ \RenewDocumentCommand \liftarm { O {} m m m }
+ {
+ \int_incr:N \l__liftarm_connect_count_int
+ \__liftarm_default:nnnn {##1} {##2} {##3}
+ { \fp_eval:n { \cs:w l__liftarm_connect_angle_\int_use:N \l__liftarm_connect_count_int _fp\cs_end: / deg } }
+ }
+ }
+ #2
+ }
+ {}
-\gappto\liftarm@constructfigure{#3}
-\expandafter\liftarm@construction\expandafter[\liftarm@constructoptions]{#1}
-}
-\newenvironment{liftarmconstruction}[1][]{\def\liftarm@constructoptions{#1}\def\liftarm@constructfigure{}\begin{enumerate}}{\end{enumerate}}
-\newcounter{liftarm@animatenumberofsteps}
-\newcounter{liftarm@animateframenumber}
-\newcounter{liftarm@animatestepnumber}
-\newwrite\liftarm@animatewritetimeline
-\newcounter{liftarm@animatenumberofanimation}
-\newcommand{\liftarmanimate}[4][]{%
-\liftarm@animatetrue%
-\addtocounter{liftarm@animatenumberofanimation}{1}%
-\setcounter{liftarm@animatenumberofsteps}{-1}%
-\gdef\liftarm@animateframes{}%
-\gdef\liftarm@animateframestrace{}%
-\setcounter{liftarm@animatestepnumber}{-1}%
-\foreach\liftarm@n in {#3}{%
-\addtocounter{liftarm@animatenumberofsteps}{1}%
-\gappto\liftarm@animateframes{\newframe\addtocounter{liftarm@animatestepnumber}{1}#4}%
-\xappto\liftarm@animateframes{{\liftarm@n}}%
-}%
-\patchcmd{\liftarm@animateframes}{\newframe}{}{}{}%
-\csgdef{liftarm@animatetimeline0}{c,}%
-\foreach\liftarm@n in {1,...,\theliftarm@animatenumberofsteps}{%
-\csgdef{liftarm@animatetimeline\liftarm@n}{}%
-}%
-\setcounter{liftarm@animateframenumber}{\theliftarm@animatenumberofsteps}%
-\IfFileExists{\jobname\theliftarm@animatenumberofanimation.tln}{}{%
-\immediate\openout\liftarm@animatewritetimeline=\jobname\theliftarm@animatenumberofanimation.tln%
-\immediate\write\liftarm@animatewritetimeline{::c,0}%
-\immediate\closeout\liftarm@animatewritetimeline%
-}%
-\begin{animateinline}[#1,timeline=\jobname\theliftarm@animatenumberofanimation.tln]{#2}%
-\liftarm@animateframes%
-\liftarm@animateframestrace%
-\end{animateinline}%
-\immediate\openout\liftarm@animatewritetimeline=\jobname\theliftarm@animatenumberofanimation.tln%
-\foreach\liftarm@n in {0,...,\theliftarm@animatenumberofsteps}{%
-\immediate\write\liftarm@animatewritetimeline{::\csname liftarm@animatetimeline\liftarm@n\endcsname\liftarm@n}%
-}%
-\immediate\closeout\liftarm@animatewritetimeline%
-\liftarm@animatefalse%
-}
\endinput \ No newline at end of file
diff --git a/graphics/pgf/contrib/liftarm/liftarm.tex b/graphics/pgf/contrib/liftarm/liftarm.tex
index b45bb85793..a7719fc926 100644
--- a/graphics/pgf/contrib/liftarm/liftarm.tex
+++ b/graphics/pgf/contrib/liftarm/liftarm.tex
@@ -1,12 +1,12 @@
%% liftarm.tex
-%% Copyright 2022 Matthias Floré
+%% Copyright 2022-2024 Matthias Floré
%
% This work may be distributed and/or modified under the
-% conditions of the LaTeX Project Public License, either version 1.3
+% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
-% and version 1.3 or later is part of all distributions of LaTeX
+% and version 1.3c or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
@@ -20,37 +20,42 @@
\usepackage{graphicx}
\usepackage[a4paper,left=2.25cm,right=2.25cm,top=2.5cm,bottom=2.5cm,nohead]{geometry}
\usepackage{parskip}
+\usepackage{iftex}
+\ifluatex
+\else
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
+\fi
\usepackage{mathtools}
\usepackage{amssymb}
\allowdisplaybreaks
-\usepackage{multicol}
+\usepackage{pdflscape}
\usepackage{animate}
\usepackage{liftarm}
\input{pgfmanual-en-macros.tex}
-\usepackage[page]{totalcount}
+\usepackage{codehigh}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
-\cfoot{\iftotalpages\begin{tikzpicture}\liftarm[mark holes=\thepage-1]{0,0}{\totalpages-2}{0}\end{tikzpicture}\fi}%\liftarm{0,0}{\thepage}{0}
\fancyhead{}
+\fancyfoot[C]{\IfRefUndefinedExpandable{Thesourcecode}{}{\begin{tikzpicture}\liftarm[mark holes=\thepage -1]{0,0}{\getpagerefnumber{Thesourcecode}-2}{0}\end{tikzpicture}}}%\liftarm{0,0}{\thepage}{0}
+\usepackage[nottoc]{tocbibind}
\usepackage{imakeidx}
\makeindex[program=makeindex,columns=2,intoc=true]
\indexsetup{othercode={\thispagestyle{fancy}}}
\usepackage[linktoc=all,pdfstartview=FitH,colorlinks=true,linkcolor=Mahogany,citecolor=ForestGreen,urlcolor=MidnightBlue,bookmarksnumbered=true]{hyperref}
-\hypersetup{pdftitle={The liftarm package},pdfauthor={Matthias Flor\'e},pdfsubject={Manual},pdfkeywords={liftarm}}
+\hypersetup{pdftitle={The liftarm package},pdfauthor={Matthias Floré},pdfsubject={Manual},pdfkeywords={liftarm}}
\setcounter{tocdepth}{2}
\setcounter{secnumdepth}{2}
\DeclareMathOperator{\atan}{atan}
-\title{The \texttt{liftarm} package\\[12pt]\large Draw liftarms with \tikzname}
-\author{Matthias Flor\'e}
-\date{Version 2.0 (2022/04/07)}%\\[12pt]
+\title{The \texttt{liftarm} package\\[12pt]\large Geometric constructions with liftarms using \tikzname{} and \LaTeX3}
+\author{Matthias Floré}
+\date{Version 3.0 (2024/05/20)}%\\[12pt]
\begin{document}
\maketitle
\thispagestyle{fancy}
\begin{abstract}
-\noindent This package is based on the package |tikz| (see \cite{TtTaPGFp}) and can be used to draw liftarms with \tikzname. It provides several options for the appearance of the liftarms, a command which connects two liftarms, an environment to describe a construction and a method to animate a construction with one or more traces.% This is the manual for version .
+\noindent This package is based on the package |tikz| (see \cite{TtTaPGFp}) and can be used to draw geometric constructions with liftarms using \tikzname. There are several options for the appearance of the liftarms. It provides an environment to connect multiple liftarms using the Newton-Raphson method and LU decomposition. It also provides an environment to describe a construction and a method to animate a construction with one or more traces.% This is the manual for version .
\end{abstract}
\tableofcontents
\section{Usage}
@@ -58,7 +63,7 @@ The package |liftarm| can be used by putting the following in the preamble.
\begin{codeexample}[code only]
\usepackage{liftarm}
\end{codeexample}
-The package |liftarm| loads the packages |etoolbox|, |xcolor| with the option |dvipsnames|, |tikz| and the \tikzname{} library |calc|. Since |xcolor| is loaded with the option |dvipsnames|, packages such as |pgfplots| and |tcolorbox| must be loaded \emph{after} |liftarm|.
+The package |liftarm| loads the package |xcolor| with the option |dvipsnames|, the package |tikz| and the \tikzname{} library |calc|. Since |xcolor| is loaded with the option |dvipsnames|, packages such as |pgfplots| and |tcolorbox| must be loaded \emph{after} |liftarm|.
\section{Drawing liftarms}
\begin{command}{\liftarm\opt{\oarg{options}}\marg{point}\marg{length}\marg{angle}}
This command can be placed inside a |tikzpicture| environment. It draws a liftarm of \meta{length} starting at \meta{point}. The angle between the liftarm and the $x$-axis can be specified by \meta{angle} in degrees. The distance between the holes is $1$.
@@ -84,53 +89,25 @@ If true, a brick will be drawn instead of a liftarm.
\end{tikzpicture}
\end{codeexample}
\end{key}
-\begin{key}{/liftarm/color=\marg{name}}
-This key defines the color of the liftarm. The color can also be specified without key.
-\begin{codeexample}[width=10cm]
-\begin{tikzpicture}
-\liftarm[color=Green]{0,1}{4}{0}
-\liftarm[Blue]{0,2}{3}{0}
-\end{tikzpicture}
-\end{codeexample}
-\end{key}
-\begin{key}{/liftarm/color 0=\marg{name} (initially Gray)}
-\end{key}
-\begin{key}{/liftarm/color 1=\marg{name} (initially darkgray)}
-\end{key}
-\begin{key}{/liftarm/color 2=\marg{name} (initially Yellow)}
-\end{key}
-\begin{key}{/liftarm/color 3=\marg{name} (initially Orange)}
-\end{key}
-\begin{key}{/liftarm/color 4=\marg{name} (initially Red)}
-\end{key}
-\begin{key}{/liftarm/color 5=\marg{name} (initially Green)}
-\end{key}
-\begin{key}{/liftarm/color 6=\marg{name} (initially Blue)}
-\end{key}
-\begin{key}{/liftarm/color 7=\marg{name} (initially Brown)}
-These keys define the colors of the liftarms which have as their length the number following |color|.
+\begin{key}{/liftarm/color=\marg{number}\marg{color}}
+This key defines the color of liftarms of length \meta{number}.
+
+Initially, the colors |Gray|, |darkgray|, |Yellow|, |Orange|, |Red|, |Green|, |Blue| and |Brown| are defined for respectively the lengths |0| till |7|.
\end{key}
\begin{key}{/liftarm/color modulo=\marg{number} (initially 8)}
-The default colors of the liftarms are determined by computing the length of the liftarm modulo the value of this key and selecting the color from the previous keys.
-\begin{codeexample}[width=10cm]
-\begin{tikzpicture}[scale=0.5]
-\foreach\n in {0,...,16}{
- \liftarm{0,-\n}{\n}{0}
-}
-\end{tikzpicture}
-\end{codeexample}
+The default colors of the liftarms are determined by computing the length of the liftarm modulo the value of this key and selecting the color defined by the key |color|.
\begin{codeexample}[width=10cm]
\begin{tikzpicture}[scale=0.5]
\pgfkeys{
- /liftarm,
- color 0=Yellow,
- color 1=Red,
- color 2=Green,
- color 3=Blue,
- color modulo=4
+ /liftarm,
+ color={0}{Yellow},
+ color={1}{Red},
+ color={2}{Green},
+ color={3}{Blue},
+ color modulo=4
}
\foreach\n in {0,...,8}{
- \liftarm{0,-\n}{\n}{0}
+ \liftarm{0,-\n}{\n}{0}
}
\end{tikzpicture}
\end{codeexample}
@@ -144,12 +121,28 @@ If true, a contour will be drawn around the liftarm.
\end{tikzpicture}
\end{codeexample}
\end{key}
-\begin{key}{/liftarm/coordinate=\marg{number 1/name 1}\dots}
+\begin{stylekey}{/liftarm/contour style=\marg{options} (initially \normalfont empty)}
+The style of the contour is determined as follows. First, the color is defined as \meta{initial color of the liftarm}|!75!black|. Then the option |ultra thick| is added. Thereafter, the style of the key |contour style| is added.
+
+The style |contour style| only applies to the border of the liftarm. The style |liftarm style| also applies to the holes of the liftarm.
+\begin{codeexample}[width=10cm]
+\begin{tikzpicture}
+\liftarm[
+ contour,
+ contour style={dashed,black}
+]{0,1}{4}{0}
+\liftarm[
+ liftarm style={draw=black,thick}
+]{0,2}{4}{0}
+\end{tikzpicture}
+\end{codeexample}
+\end{stylekey}
+\begin{key}{/liftarm/coordinate=\marg{number 1/name 1,\dots}}
This key defines coordinates with name \meta{name i} at hole \meta{number i} of the liftarm.
\begin{codeexample}[width=10cm]
\begin{tikzpicture}
\liftarm[
- coordinate={1/A,3/B}
+ coordinate={1/A,3/B}
]{0,1}{6}{40}
\liftarm{A}{3}{0}
\liftarm{B}{2}{180}
@@ -164,40 +157,46 @@ The \meta{value} of this key, multiplied with the \meta{value} of the key |scale
\end{tikzpicture}
\end{codeexample}
\end{key}
+\begin{stylekey}{/liftarm/liftarm style=\marg{options} (initially \normalfont empty)}
+The style of the liftarm is determined as follows. First, the color is defined by the keys |color| and |color modulo|. Thereafter, the style of the key |liftarm style| is added.
+\end{stylekey}
\begin{key}{/liftarm/liftarm thickness=\marg{value} (initially 0.92)}
The \meta{value} of this key, multiplied with the \meta{value} of the key |scalefactor| defines the thickness of the liftarm.
\begin{codeexample}[width=10cm]
\begin{tikzpicture}
\liftarm[
- hole radius=0.1,
- liftarm thickness=0.3
+ hole radius=0.1,
+ liftarm thickness=0.3
]{0,0}{5}{0}
\end{tikzpicture}
\end{codeexample}
\end{key}
-\begin{key}{/liftarm/mark color=\marg{name} (initially Black)}
-\end{key}
\begin{key}{/liftarm/mark holes=\marg{values}}
-The key |mark holes| defines the holes in the liftarm which will be marked. The key |mark color| defines the color of these marks.
+\end{key}
+\begin{key}{/liftarm/mark radius=\marg{factor} (initially 1)}
+\end{key}
+\begin{stylekey}{/liftarm/mark style=\marg{options} (initially \normalfont empty)}
+The key |mark holes| defines the holes in the liftarm which will be marked. The radius is the product of the \meta{factor} given to the key |mark radius| and the value of the key |hole radius|. The style of these marks is determined as follows. First, the color is set to |black|. Thereafter, the style of the key |mark style| is added.
\begin{codeexample}[width=10cm]
\begin{tikzpicture}
\liftarm[
- mark holes={0,1,3}
+ mark holes={0,1,3}
]{0,0}{5}{0}
\liftarm[
- mark holes={1,2,4},
- mark color=Blue
+ mark holes={1,2,4},
+ mark radius=2/3,
+ mark style=Blue
]{0,1}{4}{0}
\end{tikzpicture}
\end{codeexample}
-\end{key}
+\end{stylekey}
\begin{key}{/liftarm/origin=\marg{number} (initially 0)}
This key defines the number of the hole which will be placed at the coordinate given as argument to the liftarm.
\begin{codeexample}[width=10cm]
\begin{tikzpicture}
\liftarm{-2,0}{4}{0}
-\liftarm[origin=1]{0,0}{6}{30}
-\liftarm[origin=2]{0,0}{5}{60}
+\liftarm[origin=1]{0,0}{3}{30}
+\liftarm[origin=2]{0,0}{5}{-20}
\end{tikzpicture}
\end{codeexample}
\end{key}
@@ -210,216 +209,254 @@ The \meta{value} of this key defines the factor which scales the thickness of th
\end{tikzpicture}
\end{codeexample}
\end{key}
-\begin{key}{/liftarm/screw color=\marg{name} (initially Black)}
+\begin{key}{/liftarm/screw angle=\marg{angle} (initially 10)}
\end{key}
\begin{key}{/liftarm/screw holes=\marg{values}}
\end{key}
-\begin{key}{/liftarm/screw holes angle=\marg{angle} (initially 45)}
-The key |screw holes| defines the holes in the liftarm where a screw will be drawn. The key |screw color| defines the color of these screws. The key |screw holes angle| defines the angle in degrees around which the screws are drawn.
+\begin{key}{/liftarm/screw radius=\marg{factor} (initially 0.8)}
+\end{key}
+\begin{stylekey}{/liftarm/screw style=\marg{options} (initially \normalfont empty)}
+The key |screw holes| defines the holes in the liftarm where a screw will be drawn. The angle of these screws is determined by the key |screw angle| which is an angle in degrees. The radius is the product of the \meta{factor} given to the key |screw radius| and the value of the key |hole radius|. The style of these screws is determined as follows. First, the color is set to |black|. Then the option |rotate=45| is added. Thereafter, the style of the key |screw style| is added.
\begin{codeexample}[width=10cm]
\begin{tikzpicture}
\liftarm[
- screw holes={0,1,3}
+ screw holes={0,1,3}
]{0,0}{5}{0}
\liftarm[
- screw holes={1,2,4},
- screw color=Blue,
- screw holes angle=0
+ screw angle=15,
+ screw holes={1,2,4},
+ screw radius=0.7,
+ screw style={Blue,rotate=-45}
]{0,1}{4}{0}
\end{tikzpicture}
\end{codeexample}
+\end{stylekey}
+\begin{key}{/liftarm/type=\mchoice{liftarm,line segment} (initially liftarm)}
+\begin{description}
+\item[\texttt{liftarm}] In this case, the command |\liftarm| draws a liftarm.
+\item[\texttt{line segment}] In this case, the command |\liftarm| draws a line segment.
+\end{description}
\end{key}
\end{command}
\section{Connecting liftarms}
-\begin{command}{\liftarmconnect\opt{\oarg{options}}\marg{point1}\marg{length1}\marg{point2}\marg{length2}}
-This command can be placed inside a |tikzpicture| environment. It draws a liftarm of \meta{length1} starting at \meta{point1} and a liftarm of \meta{length2} starting at \meta{point2} in such a way that their last holes have the same coordinate in case that such a point exists. If such a point does not exist then nothing is drawn. In case that there exist 2 such points then this point is chosen counterclockwise. In that case, the other configuration of the 2 liftarms can be obtained by simply swapping \marg{point1}\marg{length1} and \marg{point2}\marg{length2}. The keys for the command |\liftarm| can be given to the \meta{options}. In this case these keys will be passed to both liftarms.
-\begin{codeexample}[width=9cm]
+\begin{environment}{{liftarmconnect}\opt{\oarg{options}}}
+This environment can be placed inside a |tikzpicture| environment. It can be used to connect liftarms where the angles are computed automatically. The \meta{options} can be a list of keys from the liftarm key family.
+
+The contents should consist only of commands |\liftarm| and spaces.
+
+The conditions to connect the liftarms are specified by the key |coordinate|. The resulting equations are determined automatically by the environment |liftarmconnect|. The number of liftarms needs to be equal to the number of equations. In the example below, there are 2 liftarms and 1 condition specified with the coordinate |A| resulting in 2 equations.
+\begin{codeexample}[width=10cm]
\begin{tikzpicture}
-\coordinate (A) at (0,0);
-\coordinate (B) at (4,2);
-\coordinate (C) at (1,-3);
-\coordinate (D) at (5,-1);
-\liftarmconnect[Yellow]{A}{2}{B}{3}
-\liftarmconnect[Red]{B}{3}{A}{2}
-\liftarmconnect[Green]{C}{3}{D}{2}
-\liftarmconnect[Blue]{D}{2}{C}{3}
-\foreach\coord in {A,B,C,D}{
- \node at (\coord) {{\small $\coord$}};
-}
+\coordinate (X) at (5,0);
+\begin{liftarmconnect}
+ \liftarm[coordinate=4/A]{0,0}{4}{60}
+ \liftarm[coordinate=4/A]{X}{4}{120}
+\end{liftarmconnect}
\end{tikzpicture}
\end{codeexample}
-Additionally, the \meta{options} can be given with the following keys.
-\begin{key}{/liftarm/connect coordinate=\marg{name}}
-This key defines a coordinate with name \meta{name} at the connection point of both liftarms.
-\begin{codeexample}[width=10cm]
+The similar code below does not work because the coordinate |A| is used as the starting point of the second liftarm but is unknown since it is used in a condition for the first liftarm and furthermore, there is no liftarm to complement the condition involving |A| in the first liftarm.
+\begin{codeexample}[code only]
\begin{tikzpicture}
-\liftarm{-3,0}{5}{0}
-\liftarmconnect[
- connect coordinate=A
-]{2,0}{2}{-2,0}{3}
-\liftarm{A}{4}{180}
+\coordinate (X) at (5,0);
+\begin{liftarmconnect}
+ \liftarm[coordinate=4/A]{0,0}{4}{60}
+ \liftarm[coordinate=4/X]{A}{4}{-60}
+\end{liftarmconnect}
\end{tikzpicture}
\end{codeexample}
+If the environment |liftarmconnect| consists of 2 liftarms then the law of cosines is used to compute the angles.
+
+If there are more than 2 liftarms then the set of equations is solved with the Newton-Raphson method. The initial values for the angles are given by the last arguments of the commands |\liftarm|. The Jacobian matrix is defined by the environment |liftarmconnect|. The resulting set of linear equations is solved with LU decomposition. The iteration stops if the condition determined by the key |connect stop| is satisfied.
+
+Since the \emph{let operation} from the \tikzname{} library |calc| is used, it is not possible to use the variable names |\n|, |\p|, |\x| and |\y| inside the starting point of a command |\liftarm| which is used in the environment |liftarmconnect|.
+\begin{key}{/liftarm/connect stop=\mchoice{1-norm,2-norm,iterations} (initially 1-norm)}
+\begin{description}
+\item[\texttt{1-norm}] In this case, the iteration stops if the 1-norm is smaller than the value given to this key. Its default value is $0.001$.
+\item[\texttt{2-norm}] In this case, the iteration stops if the 2-norm is smaller than the value given to this key. Its default value is $0.001$.
+\item[\texttt{iterations}] In this case, a number of iterations is executed where the number is the one given to this key. Its default value is $10$.
+\end{description}
\end{key}
-\begin{key}{/liftarm/connect reverse=\opt{\meta{boolean}} (default true, initially false)}
-If true, the first liftarm of |\liftarmconnect| will be drawn second and the second liftarm will be drawn first. This option can be used to change the appearance at the connection point of both liftarms.
\begin{codeexample}[width=10cm]
\begin{tikzpicture}
-\liftarmconnect{2,0}{1}{0,0}{2}
-\liftarmconnect[
- connect reverse
-]{5,0}{1}{3,0}{2}
+\begin{liftarmconnect}
+ \liftarm[coordinate=2/A]{0,0}{2}{70}
+ \liftarm[coordinate=3/A]{4,0}{3}{120}
+\end{liftarmconnect}
+\begin{liftarmconnect}
+ \liftarm[coordinate=4/B]{4,0}{4}{200}
+ \liftarm[coordinate=1/B]{0,0}{1}{-90}
+\end{liftarmconnect}
+\node at (A) {\small $A$};
+\node at (B) {\small $B$};
\end{tikzpicture}
\end{codeexample}
-\end{key}
-\begin{stylekey}{/liftarm/liftarm 1=\marg{options} (initially \normalfont empty)}
-\end{stylekey}
-\begin{stylekey}{/liftarm/liftarm 2=\marg{options} (initially \normalfont empty)}
-These keys accept a list of keys which will be applied to the first respectively second liftarm. These lists of keys accept the same options as the command |\liftarm|. Additionally, the key |connect| below can be given.
-\begin{key}{/liftarm/connect=\marg{number}}
-This key defines the number of the hole which will be connected to the matching liftarm. If this key is not given then the last hole of the liftarm is taken as the connecting point.
-\begin{codeexample}[width=10cm]
+The example below shows the regular pentagon from \cite{Tmm1}. In the first environment |liftarmconnect| there are $4$ liftarms and $2$ conditions resulting in $4$ equations. Hence the Jacobian matrix has size $4\times 4$.
+\begin{codeexample}[width=7cm]
+\begin{tikzpicture}[scale=0.5]
+\pgfkeys{/liftarm,liftarm style={draw=black},scalefactor=1}
+\liftarm{0,0}{3}{0}
+\begin{liftarmconnect}
+ \liftarm[coordinate={3/A,4/B,12/C}]{0,0}{12}{100}
+ \liftarm[coordinate={3/D,4/E,12/F}]{3,0}{12}{80}
+ \liftarm[coordinate=11/F]{B}{11}{60}
+ \liftarm[coordinate=11/C]{E}{11}{120}
+\end{liftarmconnect}
+\begin{liftarmconnect}
+ \liftarm[coordinate=3/G]{A}{3}{30}
+ \liftarm[coordinate=3/G]{D}{3}{150}
+\end{liftarmconnect}
+\end{tikzpicture}
+\end{codeexample}
+The example below shows iterations $0$ till $3$ of a construction with $6$ liftarms and $3$ conditions resulting in $6$ equations. Hence the Jacobian matrix has size $6\times 6$.
+\begin{codeexample}[]
\begin{tikzpicture}
-\liftarm{0,-7}{10}{90}
-\liftarmconnect[
- connect coordinate=A,
- liftarm 1={
- origin=1,
- connect=5
- },
- liftarm 2={
- origin=2,
- connect=6
- }
-]{0,2}{6}{0,0}{7}
-\liftarmconnect[
- liftarm 1={
- origin=2,
- connect=8
- },
- liftarm 2={
- origin=1,
- connect=5,
- coordinate=4/B
- }
-]{A}{9}{0,-6}{6}
-\liftarm[origin=1]{B}{4}{70}
+\liftarm{0,0}{15}{0}
+\liftarm{0,5}{15}{0}
+\foreach\k in {0,...,3}{
+ \begin{scope}[shift={(\k*4,0)}]
+ \begin{liftarmconnect}[connect stop={iterations=\k},liftarm style=ultra thick,type=line segment]
+ \liftarm[coordinate=3/A]{1,0}{3}{90}
+ \liftarm[coordinate=3/B]{3,0}{3}{90}
+ \liftarm[coordinate=1/B]{A}{1}{0}
+ \liftarm[coordinate=1/C]{A}{1}{70}
+ \liftarm[coordinate=1/C]{B}{1}{110}
+ \liftarm[coordinate=2/C]{0,5}{2}{0}
+ \end{liftarmconnect}
+ \node at (1.5,-1) {\texttt{iterations=\k}};
+ \end{scope}
+}
\end{tikzpicture}
\end{codeexample}
-\end{key}
-\end{stylekey}
-\end{command}
+The example below shows the regular heptagon from \cite{Tmm1}. In the first environment |liftarmconnect| there are $8$ liftarms and $4$ conditions resulting in $8$ equations. Hence the Jacobian matrix has size $8\times 8$.
+\begin{codeexample}[width=8cm]
+\begin{tikzpicture}[scale=0.4]
+\pgfkeys{/liftarm,scalefactor=1}
+\liftarm{-4,0}{8}{0}
+\begin{liftarmconnect}
+ \liftarm[coordinate={1/A,7/B,8/G}]{-4,0}{8}{135}
+ \liftarm[coordinate=11/F]{A}{11}{50}
+ \liftarm[coordinate=11/F]{B}{11}{20}
+ \liftarm[coordinate={1/C,7/D,8/H}]{4,0}{8}{45}
+ \liftarm[coordinate=11/E]{C}{11}{130}
+ \liftarm[coordinate=11/E]{D}{11}{160}
+ \liftarm[coordinate=8/E]{G}{8}{30}
+ \liftarm[coordinate=8/F]{H}{8}{150}
+\end{liftarmconnect}
+\begin{liftarmconnect}
+ \liftarm[coordinate=8/I]{E}{8}{70}
+ \liftarm[coordinate=8/I]{F}{8}{110}
+\end{liftarmconnect}
+\begin{liftarmconnect}
+ \liftarm[coordinate=8/J]{G}{8}{70}
+ \liftarm[coordinate=8/J]{I}{8}{210}
+\end{liftarmconnect}
+\begin{liftarmconnect}
+ \liftarm[coordinate=8/K]{H}{8}{110}
+ \liftarm[coordinate=8/K]{I}{8}{-30}
+\end{liftarmconnect}
+\end{tikzpicture}
+\end{codeexample}
+\end{environment}
\section{Describing a construction}
-If a construction involves many liftarms then it is convenient to describe this construction in separate steps and |tikzpicture|s. Then the content of previous |tikzpicture|s would need to be copied in each new |tikzpicture|. This process can be automated by using the |liftarmconstruction| environment and the command |\liftarmconstruct| below.
-\begin{environment}{{liftarmconstruction}\opt{\oarg{options}}}
-This environment is in fact an |enumerate| environment with the addition that it resets the content of the |tikzpicture| which is displayed by the command |\liftarmconstruct| below. Thus in particular, |\item| can be used inside the |liftarmconstruction| environment. The \meta{options} will be passed to each |tikzpicture| drawn by the command |\liftarmconstruct| inside this environment. The following command can be used inside this environment.
-\begin{command}{\liftarmconstruct\opt{\oarg{options}}\marg{text}\marg{commands}}
-This command starts an |\item| and shows \meta{text}. Then it displays a |tikzpicture| containing \meta{commands} and also the \meta{commands} of previous |\liftarmconstruct| commands inside the same |liftarmconstruction| environment. The \meta{options} will be added to this |tikzpicture| but \emph{only} in the current step.
+If a construction involves many liftarms then it is convenient to describe this construction in separate steps. Then the content of previous steps would need to be copied in each new step. This process can be automated by using the command |\liftarmconstruct| below.
+\begin{command}{\liftarmconstruct\marg{commands}}
+This command appends \meta{commands} to an internal token list. Then it uses this token list.
+\end{command}
+\begin{command}{\liftarmconstructclear}
+This command clears the token list which is used by the command |\liftarmconstruct|.
As an example, we describe below the construction of a regular pentagon from \cite{Tmm1}.
-\begin{codeexample}[width=10cm]
-\begin{minipage}{0.5\linewidth}%only for
-%usage in this manual%\linewidth-6pt
-%\begin{multicols}{2}%only for
-%usage in this manual
-\begin{liftarmconstruction}[scale=0.75]
-\liftarmconstruct[
- {\node[left,align=left]
- at (-0.5,-1.3)
- {Rectangular triangle.\\
- This text is only\\
- visible in this step.};}
-]{
- We start with 3 liftarms to form
- a rectangular triangle.
-}{
-\liftarm{-3,0}{4}{0}
-\liftarmconnect[
- liftarm 1={
- origin=2,
- mark holes={2,6}
- },
- liftarm 2={
- mark holes=0
- }
-]{0,0}{6}{-3,0}{5}}
-\item An |\item| can be added since this
- is an |enumerate| environment.
+\begin{codeexample}[width=7cm]
+\begin{minipage}{5.5cm}%only for usage in this manual
+\liftarmconstructclear
+\begin{enumerate}
+\item First we form a rectangular triangle with 3 liftarms.
+\begin{center}
+\begin{tikzpicture}[scale=0.7]
\liftarmconstruct{
- Now we add 2 liftarms of length $3$.
-}{\liftarmconnect[
- connect coordinate=A,
- liftarm 1={
- mark holes={0,3}
- },
- liftarm 2={
- mark holes=0
- }
-]{0,-2}{3}{0,2}{3}}
+ \liftarm[mark holes=3]{-3,0}{4}{0}
+ \begin{liftarmconnect}
+ \liftarm[coordinate=6/A,origin=2]{0,0}{6}{90}
+ \liftarm[coordinate=5/A,mark holes={0,5}]{-3,0}{5}{60}
+ \end{liftarmconnect}
+}
+\end{tikzpicture}
+\end{center}
+\item Then we add 2 liftarms of length $3$.
+\begin{center}
+\begin{tikzpicture}[scale=0.7]
\liftarmconstruct{
- In this step we construct the first
- side of the regular pentagon.
-}{\liftarmconnect[
- connect coordinate=B,
- liftarm 2={
- mark holes={0,2}
- }
-]{A}{2}{1,0}{2}}
+ \begin{liftarmconnect}
+ \liftarm[coordinate=3/B,mark holes={0,3}]{0,-2}{3}{45}
+ \liftarm[coordinate=3/B,mark holes=0]{0,2}{3}{-45}
+ \end{liftarmconnect}
+}
+\end{tikzpicture}
+\end{center}
+\item Here appears the first side of the regular pentagon.
+\begin{center}
+\begin{tikzpicture}[scale=0.7]
\liftarmconstruct{
- Now we finish the construction
- of the regular pentagon.
-}{\liftarmconnect[
- liftarm 2={
- mark holes={0,2}
- }
-]{B}{2}{-1,0}{2}
-\liftarmconnect[
- liftarm 1={
- mark holes=2
- }
-]{-1,0}{2}{A}{2}}
-\end{liftarmconstruction}
-%\end{multicols}
+ \begin{liftarmconnect}
+ \liftarm[coordinate=2/C]{B}{2}{100}
+ \liftarm[coordinate=2/C,mark holes={0,2}]{1,0}{2}{80}
+ \end{liftarmconnect}
+}
+\end{tikzpicture}
+\end{center}
+\item Now we end the construction of the regular pentagon.
+\begin{center}
+\begin{tikzpicture}[scale=0.7]
+\liftarmconstruct{
+ \begin{liftarmconnect}
+ \liftarm[coordinate=2/D]{C}{2}{180}
+ \liftarm[coordinate=2/D,mark holes={0,2}]{-1,0}{2}{80}
+ \end{liftarmconnect}
+ \begin{liftarmconnect}
+ \liftarm[coordinate=2/E,mark holes=2]{-1,0}{2}{-80}
+ \liftarm[coordinate=2/E]{B}{2}{210}
+ \end{liftarmconnect}
+}
+\end{tikzpicture}
+\end{center}
+\end{enumerate}
\end{minipage}
\end{codeexample}
\end{command}
-\end{environment}
\section{Animations}
\begin{command}{\liftarmanimate\opt{\oarg{options}}\marg{frame rate}\marg{list}\marg{command}}
-This command shows an animation using the |animateinline| environment of the package |animate|. The package |animate| is \emph{not} loaded by default and needs to be loaded to use the command |\liftarmanimate|. The \meta{options} are passed to the |animateinline| environment. The \meta{frame rate} of the animation is described in the documentation of the package |animate|. The \meta{command} must be a previously defined command with one mandatory argument. The \meta{list} is passed to a |\foreach| loop. The frames of the animation consist of the \meta{command} evaluated one by one in the result of the |\foreach| loop. The command |\liftarmanimate| creates a timeline which is used in the |animateinline| environment. This timeline is stored in the file |liftarm|\meta{number of the animation in the document}|.tln|. It requires two compiler runs to create and use this timeline correctly.
+This command shows an animation using the |animateinline| environment of the package |animate|. The package |animate| is \emph{not} loaded by default and needs to be loaded to use the command |\liftarmanimate|. The \meta{options} are passed to the |animateinline| environment. The \meta{frame rate} of the animation is described in the documentation of the package |animate|. The \meta{command} must be a previously defined command with one mandatory argument. The \meta{list} is passed to a |\foreach| loop. The frames of the animation consist of the \meta{command} evaluated one by one in the result of the |\foreach| loop. The command |\liftarmanimate| creates a timeline which is used in the |animateinline| environment. This timeline is stored in the file \meta{job name}\meta{number of the animation in the document}|.tln|. It requires two compiler runs to create and use this timeline correctly.
\begin{key}{/liftarm/trace=\marg{number/number of frames/code}\dots}
This key draws \meta{code} at hole \meta{number} of the liftarm on the frames of the animation determined by \meta{number of frames}.
If \meta{number of frames} is 0 then the \meta{code} is drawn starting at the current frame until the end of the animation. If \meta{number of frames} is an integer greater than or equal to 1 then the \meta{code} is drawn starting at the current frame and remaining during the next frames determined by \meta{number of frames}. If \meta{number of frames} is left empty then the \meta{code} is drawn starting at the beginning of the animation until the end of the animation.
-The \meta{code} can be some \tikzname{} code. In this \meta{code}, $(0,0)$ is positioned at hole \meta{number} of the liftarm. If \meta{code} is left empty then the following code is used.
-\begin{codeexample}[code only]
-\fill[Black] (0,0) circle[radius=0.66*\liftarm@holeradius];
-\end{codeexample}
+The \meta{code} can be some \tikzname{} code. In this \meta{code}, $(0,0)$ is positioned at hole \meta{number} of the liftarm. If \meta{code} is left empty then a black circle with radius $\frac{2}{3}$ times the |hole radius| is used.
+
A list of multiple triples \meta{number/number of frames/code} can be given to the key |trace|.
\begin{codeexample}[width=10cm,preamble={\usepackage{animate}}]
\newcommand{\exampleliftarmanimate}[1]{
- \liftarm[
- origin=1,
- mark holes=1,
- trace={
- 2/0/,
- 3//,
- 4/3/{\fill[Blue] (0,0)
- circle[radius=0.15];}
- }
- ]{0,0}{4}{#1}
+ \liftarm[
+ origin=1,
+ mark holes=1,
+ trace={
+ 2/0/,
+ 3//,
+ 4/3/{\fill[Blue] (0,0)
+ circle[radius=0.15];}
+ }
+ ]{0,0}{4}{#1}
}
\liftarmanimate[
- autoplay,
- controls,
- loop,
- begin={
- \begin{tikzpicture}
- \useasboundingbox (-4,-4)
- rectangle (4,4);
- },
- end={\end{tikzpicture}}
+ autoplay,
+ controls,
+ loop,
+ begin={
+ \begin{tikzpicture}
+ \useasboundingbox (-4,-4)
+ rectangle (4,4);
+ },
+ end={\end{tikzpicture}}
]
{5}
{0,30,...,330}
@@ -429,11 +466,14 @@ A list of multiple triples \meta{number/number of frames/code} can be given to t
\end{command}
\section{Additional examples}
The following example shows a regular hexagon.
-\begin{codeexample}[width=9cm]
+\begin{codeexample}[width=8cm]
\begin{tikzpicture}
\def\r{3}
-\foreach\n in {1,...,6}{
- \liftarmconnect{0,0}{\r}{\n*60:\r}{\r}
+\foreach\m in {1,...,6}{
+ \begin{liftarmconnect}
+ \liftarm[coordinate=\r/A]{0,0}{\r}{(\m+1)*60}
+ \liftarm[coordinate=\r/A]{\m*60:\r}{\r}{(\m+2)*60}
+ \end{liftarmconnect}
}
\end{tikzpicture}
\end{codeexample}
@@ -448,18 +488,6 @@ The following example illustrates that $2\atan(\frac{1}{2})=\atan(\frac{4}{3})$.
\liftarm{2,1}{1}{90+atan(4/3)}
\end{tikzpicture}
\end{codeexample}
-Below is an example of an angled liftarm.
-\begin{codeexample}[width=9cm]
-\begin{tikzpicture}
-\pgfkeys{
- /liftarm,
- scalefactor=1,
- Blue
-}
-\liftarm[axle holes=0]{0,0}{3}{0}
-\liftarm[axle holes=5]{3,0}{5}{atan(4/3)}
-\end{tikzpicture}
-\end{codeexample}
The following example illustrates an angle bisection.
\begin{codeexample}[width=9cm]
\begin{tikzpicture}
@@ -468,26 +496,45 @@ The following example illustrates an angle bisection.
\liftarm[mark holes={0,\r}]{0,0}{2*\r}{0}
\liftarm[mark holes=\r]{0,0}{2*\r}{\ang}
\liftarm[
- mark holes=\r,
- mark color=Red
+ mark holes=\r,
+ mark style=Red
]{\r,0}{\r}{\ang}
\liftarm{\ang:\r}{\r}{0}
\end{tikzpicture}
\end{codeexample}
+The following example illustrates that $7^{2}=3^{2}+8^{2}-2\cdot 3\cdot 8\cos(\frac{\pi}{3})$.
+\begin{codeexample}[width=9cm]
+\begin{tikzpicture}
+\begin{liftarmconnect}
+ \liftarm[coordinate=3/A]{0,0}{3}{80}
+ \liftarm[coordinate=3/A]{3,0}{3}{100}
+\end{liftarmconnect}
+\begin{liftarmconnect}
+ \liftarm[coordinate=8/B]{0,0}{8}{0}
+ \liftarm[coordinate=7/B]{A}{7}{0}
+\end{liftarmconnect}
+\end{tikzpicture}
+\end{codeexample}
The following example illustrates that $7^{2}+4^{2}=8^{2}+1^{2}$.
\begin{codeexample}[width=9cm]
-\begin{tikzpicture}[scale=0.75]
+\begin{tikzpicture}
\def\a{4}
\def\b{7}
\def\c{1}
\def\d{8}
%\liftarm{0,0}{\b}{0}
%\liftarm{\b,0}{\a}{90}
-\liftarmconnect{0,0}{\b}{\b,\a}{\a}
+\begin{liftarmconnect}
+ \liftarm[coordinate=\b/A]{0,0}{\b}{0}
+ \liftarm[coordinate=\a/A]{\b,\a}{\a}{-90}
+\end{liftarmconnect}
\liftarm{4,0}{3}{90}
%\liftarm{\b,\a}{1}{atan(\a/\b)+atan(\c/\d)+90}
%\liftarm{0,0}{\d}{atan(\a/\b)+atan(\c/\d)}
-\liftarmconnect{\b,\a}{\c}{0,0}{\d}
+\begin{liftarmconnect}
+ \liftarm[coordinate=\d/B]{0,0}{\d}{45}
+ \liftarm[coordinate=\c/B]{\b,\a}{\c}{135}
+\end{liftarmconnect}
\end{tikzpicture}
\end{codeexample}
Below is an animation of the Peaucellier-Lipkin linkage, see e.g.~\cite{Koagmopermbl}.
@@ -497,31 +544,35 @@ Below is an animation of the Peaucellier-Lipkin linkage, see e.g.~\cite{Koagmope
\def\a{3}
\def\b{4}
\def\c{9}
-\pgfmathsetmacro{\x}{
- 2*\a+((\c^2-\b^2-(2*\a)^2)/(2*\a))
+\edef\l{
+ \fpeval{2*\a+(\c^2-\b^2-(2*\a)^2)/(2*\a)}
}
\useasboundingbox (-0.23,-6) rectangle
- ({\x+0.23},6);
-\draw (\x,-5)--(\x,5);
+ (\l+0.23,6);
+\draw (\l,-5)--(\l,5);
\liftarm{0,0}{\a}{0}
\liftarm[coordinate=\a/A]{\a,0}{\a}{#1}
-\liftarmconnect[
- connect coordinate=B,
- connect reverse
-]{A}{\b}{0,0}{\c}
-\liftarmconnect[
- connect coordinate=C
-]{0,0}{\c}{A}{\b}
-\liftarmconnect{C}{\b}{B}{\b}
+\begin{liftarmconnect}
+ \liftarm[coordinate=\c/B]{0,0}{\c}{0}
+ \liftarm[coordinate=\b/B]{A}{\b}{90}
+\end{liftarmconnect}
+\begin{liftarmconnect}
+ \liftarm[coordinate=\c/C]{0,0}{\c}{0}
+ \liftarm[coordinate=\b/C]{A}{\b}{-90}
+\end{liftarmconnect}
+\begin{liftarmconnect}
+ \liftarm[coordinate=\b/D]{C}{\b}{0}
+ \liftarm[coordinate=\b/D]{B}{\b}{0}
+\end{liftarmconnect}
\end{tikzpicture}
}
\begin{animateinline}[
- autoplay,
- controls,
- palindrome
+ autoplay,
+ controls,
+ palindrome
]{30}
\multiframe{80}{rAng=-40+1}{
- \PLlinkage{\rAng}
+ \PLlinkage{\rAng}
}
\end{animateinline}
\end{codeexample}
@@ -534,13 +585,19 @@ Below is an animation of Kempe's trisector, as shown in \cite{Tmm3}.
\liftarm[coordinate=12/B]{0,0}{27}{180-(#1)}
\liftarm[coordinate=18/C]{0,0}{27}{180-2*(#1)}
\liftarm[coordinate=27/D]{0,0}{27}{180-3*(#1)}
-\liftarmconnect{C}{27}{D}{18}
-\liftarmconnect[liftarm 2={connect=8}]{A}{12}{B}{18}
+\begin{liftarmconnect}
+ \liftarm[coordinate=27/E]{C}{27}{0}
+ \liftarm[coordinate=18/E]{D}{18}{0}
+\end{liftarmconnect}
+\begin{liftarmconnect}
+ \liftarm[coordinate=12/F]{A}{12}{0}
+ \liftarm[coordinate=8/F]{B}{18}{0}
+\end{liftarmconnect}
\end{tikzpicture}
}
\begin{animateinline}[autoplay,controls,palindrome]{5}
\multiframe{20}{rAng=15+1}{
-\trisector{\rAng}
+ \trisector{\rAng}
}
\end{animateinline}
\end{codeexample}
@@ -549,40 +606,85 @@ Below is an animation of Chebyshev's Lambda Mechanism.
\newcommand{\CL}[1]{
\liftarm{0,0}{4*\r}{0}
\liftarm[
- mark holes={0,2*\r}
+ mark holes={0,2*\r}
]{0,0}{2*\r}{#1}
-\liftarmconnect[
- liftarm 1={mark holes={0,5*\r}},
- liftarm 2={
- connect=5*\r,
- mark holes=10*\r,
- mark color=Red,
- trace={6*\r/0/,10*\r//}
- }
-]{4*\r,0}{5*\r}{#1:2*\r}{10*\r}
+\begin{liftarmconnect}
+ \liftarm[
+ coordinate=5*\r/A,
+ mark holes={0,5*\r}
+ ]{4*\r,0}{5*\r}{90}
+ \liftarm[
+ coordinate=5*\r/A,
+ mark holes=10*\r,
+ mark style=Red,
+ trace={6*\r/0/,10*\r//}
+ ]{#1:2*\r}{10*\r}{90}
+\end{liftarmconnect}
}
\liftarmanimate[
- autoplay,
- controls,
- loop,
- begin={
- \begin{tikzpicture}[scale=0.8]
- \def\r{1}
- \useasboundingbox
- (-2*\r-0.5,-2*\r-0.5)
- rectangle
- (10*\r-0.5,10*\r+0.5);
- },
- end={\end{tikzpicture}}
+ autoplay,
+ controls,
+ loop,
+ begin={
+ \begin{tikzpicture}[scale=0.8]
+ \def\r{1}
+ \useasboundingbox
+ (-2*\r-0.5,-2*\r-0.5)
+ rectangle
+ (10*\r-0.5,10*\r+0.5);
+ },
+ end={\end{tikzpicture}}
]
{20}
{0,5,...,355}
{\CL}
\end{codeexample}
+Below is an animation of a multilink steering mechanism.
+\begin{codeexample}[preamble={\usepackage{animate}}]
+\newcommand{\multilink}[1]{
+\begin{tikzpicture}[scale=0.9]
+\useasboundingbox (-8.5,-0.5) rectangle (8.5,5.7);
+\liftarm[brick,screw holes={0,6}]{-3,0}{6}{0}
+\liftarm[brick,screw holes={0,6}]{-3,3}{6}{0}
+\liftarm[coordinate={0/X,6/Y},screw holes={0,6}]{{-3+(#1)*0.1},4}{6}{0}
+\begin{liftarmconnect}
+ \liftarm[coordinate=3/A]{-3,0}{3}{160}
+ \liftarm[coordinate=3/B]{-3,3}{3}{200}
+ \liftarm[coordinate={1/B,4/C},screw holes={0,1,4}]{A}{4}{90}
+ \liftarm[coordinate=3/C]{X}{3}{180}
+\end{liftarmconnect}
+\begin{liftarmconnect}
+ \liftarm[coordinate=3/D]{3,0}{3}{20}
+ \liftarm[coordinate=3/E]{3,3}{3}{-20}
+ \liftarm[coordinate={1/E,4/F},screw holes={0,1,4}]{D}{4}{90}
+ \liftarm[coordinate=3/F]{Y}{3}{0}
+\end{liftarmconnect}
+\end{tikzpicture}
+}
+\begin{animateinline}[autoplay,controls,palindrome]{10}
+\multiframe{41}{rAng=-20+1}{
+ \multilink{\rAng}
+}
+\end{animateinline}
+\end{codeexample}
\section{Version history}
\begin{itemize}
\item[] \textbf{Version 1.0 (2022/03/08)} First version.
-\item[] \textbf{Version 2.0 (2022/04/07)} Removed some redundant |;| in the code.\footnote{Thanks to Denis Bitouz\'e for pointing this out.} Added the command |\liftarmanimate| and the key |trace|.
+\item[] \textbf{Version 2.0 (2022/04/07)} Removed some redundant |;| in the code.\footnote{Thanks to Denis Bitouzé for pointing this out.} Added the command |\liftarmanimate| and the key |trace|.
+\item[] \textbf{Version 3.0 (2024/05/20)}
+\begin{itemize}
+\item The package now mainly uses \LaTeX3 syntax. The package |etoolbox| is not loaded anymore.
+\item Improved the code for the key |axle holes|. In particular, the combinations with the keys |contour| and |hole radius| are fixed.
+\item Improved the path for the shape of a liftarm if the key |brick| is used.
+\item Changed the key |color| to accept two arguments. The color can no longer be specified without a key.
+\item Removed the keys |color 0|, |color 1|, |color 2|, |color 3|, |color 4|, |color 5|, |color 6| and |color 7|.
+\item In v2.0, the colors could only be defined up to length $7$. In v3.0, this is not a restriction anymore.
+\item Changed some initial colors from |Black| to |black|.
+\item Added the keys |contour style| and |liftarm style|.
+\item Removed the keys |mark color|, |screw color| and |screw holes angle|. Added the keys |mark radius|, |mark style|, |screw angle|, |screw radius| and |screw style|.
+\item Improved the algorithm to connect liftarms in multiple ways. In v2.0, transformations such as |x={(0.8,0.5)},y={(-0.6,1.2)}| were not taken into account correctly. This is fixed in v3.0. In v2.0, only 2 liftarms could be connected automatically. In v3.0, this is not a restriction anymore. Therefore the command |\liftarmconnect| and the keys |connect|, |connect coordinate|, |connect reverse|, |liftarm 1| and |liftarm 2| are removed. Instead, the environment |liftarmconnect| and the key |connect stop| were added in v3.0.
+\item Changed the command |\liftarmconstruct| to allow more customization. Removed the environment |liftarmconstruction| and added the command |\liftarmconstructclear|.
+\end{itemize}
\end{itemize}
\begin{thebibliography}{9}
\bibitem{Tmm1}
@@ -607,9 +709,16 @@ Alfred Bray Kempe,
\bibitem{TtTaPGFp}
Till Tantau,
\emph{The \tikzname{} and {\upshape\pgfname} Packages},
-Manual for version 3.1.9a,
+Manual for version 3.1.10,
\url{https://ctan.org/pkg/pgf},
-2021.
+2023.
\end{thebibliography}
\printindex
+\newgeometry{left=2.25cm,right=2.25cm,top=2.25cm,bottom=2.25cm}
+\pagestyle{plain}
+\appendix
+\begin{landscape}
+\section{The source code}\label{Thesourcecode}
+\dochighinput[language=latex/latex3]{liftarm.sty}
+\end{landscape}
\end{document} \ No newline at end of file
diff --git a/graphics/pgf/contrib/profsio/doc/ProfSio-doc-annexe71.pdf b/graphics/pgf/contrib/profsio/doc/ProfSio-doc-annexe71.pdf
new file mode 100644
index 0000000000..a95ad30ad7
--- /dev/null
+++ b/graphics/pgf/contrib/profsio/doc/ProfSio-doc-annexe71.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/profsio/doc/ProfSio-doc-annexe71.tex b/graphics/pgf/contrib/profsio/doc/ProfSio-doc-annexe71.tex
new file mode 100644
index 0000000000..f29587bab9
--- /dev/null
+++ b/graphics/pgf/contrib/profsio/doc/ProfSio-doc-annexe71.tex
@@ -0,0 +1,18 @@
+% !TeX TXS-program:compile = txs:///arara
+% arara: lualatex: {shell: no, synctex: no, interaction: batchmode}
+
+\documentclass[a4paper,french,12pt]{article}
+\usepackage[margin=1.5cm]{geometry}
+\usepackage{fontspec}
+\usepackage{ProfSio}
+\setsansfont{Fira Sans}[Scale=MatchLowercase]
+\newfontfamily\poltuto{QTSanDiego}
+\usepackage{babel}
+
+\begin{document}
+
+\pagestyle{empty}
+
+\GrilleCCFSIO[Session=2025,Type={7-1},PoliceManuscrite={\poltuto}]{LOVELACE Ada}{21 mai 2024}{Quelques propriétés de la suite de Syracuse}
+
+\end{document}
diff --git a/graphics/pgf/contrib/profsio/doc/ProfSio-doc-annexe72.pdf b/graphics/pgf/contrib/profsio/doc/ProfSio-doc-annexe72.pdf
new file mode 100644
index 0000000000..7e7ca969ea
--- /dev/null
+++ b/graphics/pgf/contrib/profsio/doc/ProfSio-doc-annexe72.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/profsio/doc/ProfSio-doc-annexe72.tex b/graphics/pgf/contrib/profsio/doc/ProfSio-doc-annexe72.tex
new file mode 100644
index 0000000000..00af2e5e36
--- /dev/null
+++ b/graphics/pgf/contrib/profsio/doc/ProfSio-doc-annexe72.tex
@@ -0,0 +1,19 @@
+% !TeX TXS-program:compile = txs:///arara
+% arara: lualatex: {shell: no, synctex: no, interaction: batchmode}
+
+\documentclass[a4paper,french,12pt]{article}
+\usepackage[margin=1.5cm]{geometry}
+\usepackage{fontspec}
+\usepackage{ProfSio}
+\setsansfont{Fira Sans}[Scale=MatchLowercase]
+\newfontfamily\poltuto{QTSanDiego}
+\usepackage{babel}
+
+\begin{document}
+
+\pagestyle{empty}
+
+\def\grccfcompetsyr{variables et types/listes et tableaux/tests et boucles/fonctions}
+\GrilleCCFSIO[Session=2025,Type={7-2},PoliceManuscrite={\poltuto}]{LOVELACE Ada}{21 mai 2024}{Quelques propriétés de la suite de Syracuse}<\grccfcompetsyr>
+
+\end{document}
diff --git a/graphics/pgf/contrib/profsio/doc/ProfSio-doc-annexe73.pdf b/graphics/pgf/contrib/profsio/doc/ProfSio-doc-annexe73.pdf
new file mode 100644
index 0000000000..b9c6d73803
--- /dev/null
+++ b/graphics/pgf/contrib/profsio/doc/ProfSio-doc-annexe73.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/profsio/doc/ProfSio-doc-annexe73.tex b/graphics/pgf/contrib/profsio/doc/ProfSio-doc-annexe73.tex
new file mode 100644
index 0000000000..24747750c8
--- /dev/null
+++ b/graphics/pgf/contrib/profsio/doc/ProfSio-doc-annexe73.tex
@@ -0,0 +1,19 @@
+% !TeX TXS-program:compile = txs:///arara
+% arara: lualatex: {shell: no, synctex: no, interaction: batchmode}
+
+\documentclass[a4paper,french,12pt]{article}
+\usepackage[margin=1.5cm]{geometry}
+\usepackage{fontspec}
+\usepackage{ProfSio}
+\setsansfont{Fira Sans}[Scale=MatchLowercase]
+\newfontfamily\poltuto{QTSanDiego}
+\usepackage{babel}
+
+\begin{document}
+
+\pagestyle{empty}
+
+\def\grccfcompetsyr{variables et types/listes et tableaux/tests et boucles/fonctions}
+\GrilleCCFSIO[Session=2024,Type={7-3},PoliceManuscrite={\poltuto}]{LOVELACE Ada}{14 mai 2024}{Calculs booléens + Graphes + Chiffrements}
+
+\end{document}
diff --git a/graphics/pgf/contrib/profsio/doc/ProfSio-doc-fr.pdf b/graphics/pgf/contrib/profsio/doc/ProfSio-doc-fr.pdf
index 7481152d91..265dc41596 100644
--- a/graphics/pgf/contrib/profsio/doc/ProfSio-doc-fr.pdf
+++ b/graphics/pgf/contrib/profsio/doc/ProfSio-doc-fr.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/profsio/doc/ProfSio-doc-fr.tex b/graphics/pgf/contrib/profsio/doc/ProfSio-doc-fr.tex
index a8212b8c56..59ae3cd132 100644
--- a/graphics/pgf/contrib/profsio/doc/ProfSio-doc-fr.tex
+++ b/graphics/pgf/contrib/profsio/doc/ProfSio-doc-fr.tex
@@ -5,8 +5,8 @@
\documentclass[french,a4paper,11pt]{article}
\usepackage[margin=2cm,includefoot]{geometry}
-\def\TPversion{0.2.6}
-\def\TPdate{20 avril 2024}
+\def\TPversion{0.2.8}
+\def\TPdate{18 mai 2024}
%\usepackage[utf8]{inputenc}
%\usepackage[T1]{fontenc}
\usepackage{amsmath,amssymb}
@@ -21,6 +21,7 @@
\UseTblrLibrary{booktabs}
\usepackage{fancyvrb}
\usepackage{fancyhdr}
+\usepackage{pdfpages}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\lfoot{\sffamily\small [ProfSio]}
@@ -81,10 +82,10 @@
keywordstyle={\color{violet}},%
classoffset=2,%
alsoletter={-},%
- morekeywords={\MPMPlaceTache,\MPMPlaceNotice,\MPMPlaceDuree,GrapheMPM,TableKarnaugh,\KarnaughCasesResult,\KarnaughBlocRegroup,\KarnaughBlocRegroupAuto,\MPMPlaceTaches,\MPMPlaceDurees,GrapheTikz,\GrphPlaceSommets,\GrphTraceAretes,\tikzset,\DiagrammeSagittal,\draw,\DiagrammeSagittalCompo,\TableVerite,\SimplificationKarnaugh,\SimplificationBooleenne,\KarnaughCasesAuto,\MatriceAdjacence,\PuissanceMatrice,\NbCheminsLongueur,\FermetureTransitive,\ResolSystemeMatrices,\PresentProdMat,\OpeBinDecHex,\ExprBool},%
+ morekeywords={\MPMPlaceTache,\MPMPlaceNotice,\MPMPlaceDuree,GrapheMPM,TableKarnaugh,\KarnaughCasesResult,\KarnaughBlocRegroup,\KarnaughBlocRegroupAuto,\MPMPlaceTaches,\MPMPlaceDurees,GrapheTikz,\GrphPlaceSommets,\GrphTraceAretes,\tikzset,\DiagrammeSagittal,\draw,\DiagrammeSagittalCompo,\TableVerite,\SimplificationKarnaugh,\SimplificationBooleenne,\KarnaughCasesAuto,\MatriceAdjacence,\PuissanceMatrice,\NbCheminsLongueur,\FermetureTransitive,\ResolSystemeMatrices,\PresentProdMat,\OpeBinDecHex,\ExprBool,\GrilleCCFSIO},%
keywordstyle={\color{green!50!black}},%
classoffset=3,%
- morekeywords={CouleurDurees,CouleurFleches,LargeurCases,Epaisseur,Police,CouleurDates,CouleurBords,NoirBlanc,Grille,DecalHorizDeb,DecalVertDeb,DecalHorizFin,DecalVertFin,Coude,SensCoude,Unite,Variables,Swap,Aide,CouleurCases,Decalage,Couleur,Type,Legende,PosVarLaterale,CouleurLegende,CouleurSommets,TypeSommets,Unite,CouleurFT,DimensionSommets,PositionFleches,EchelleFleches,TypeFleche,Droit,Milieu,AngleGauche,AngleDroite,Boucle,GrphStyleArc,GrphStyleSommet,Poids,GrphStylepoids,DistElem,DistEns,LargEns,NomAppli,CouleurE,CouleurAppli,CouleurF,CouleursFleches,TypeFleche,Epaisseur,Labels,Ensembles,PosLabels,PoliceLabels,Offset,NomApplis,CouleursAppli,VF,LargeursColonnes,CouleurEnonce,CodeAvant,CodeApres,StyleAlternatif,PoliceTT,Espace,Couleurs,Contraire,Enonce,Bordure,Sommets,Num,PoliceBordure,De,Vers,Formule,Brut,NomMatrice,Longueur,Complet,NomsMatrices,NomInverse,NomSysteme,Inconnues,OptionNiceMatrix,Base,AffRetenues,AffEgal,SymbDecal,LimiteCapac,CouleurRetenue,Interm,Enonce,Decalages,Couleurs,Dense,Dernier,MathE,MathF,MathG,CouleurPlus,Vide,HauteurVide},%
+ morekeywords={CouleurDurees,CouleurFleches,LargeurCases,Epaisseur,Police,CouleurDates,CouleurBords,NoirBlanc,Grille,DecalHorizDeb,DecalVertDeb,DecalHorizFin,DecalVertFin,Coude,SensCoude,Unite,Variables,Swap,Aide,CouleurCases,Decalage,Couleur,Type,Legende,PosVarLaterale,CouleurLegende,CouleurSommets,TypeSommets,Unite,CouleurFT,DimensionSommets,PositionFleches,EchelleFleches,TypeFleche,Droit,Milieu,AngleGauche,AngleDroite,Boucle,GrphStyleArc,GrphStyleSommet,Poids,GrphStylepoids,DistElem,DistEns,LargEns,NomAppli,CouleurE,CouleurAppli,CouleurF,CouleursFleches,TypeFleche,Epaisseur,Labels,Ensembles,PosLabels,PoliceLabels,Offset,NomApplis,CouleursAppli,VF,LargeursColonnes,CouleurEnonce,CodeAvant,CodeApres,StyleAlternatif,PoliceTT,Espace,Couleurs,Contraire,Enonce,Bordure,Sommets,Num,PoliceBordure,De,Vers,Formule,Brut,NomMatrice,Longueur,Complet,NomsMatrices,NomInverse,NomSysteme,Inconnues,OptionNiceMatrix,Base,AffRetenues,AffEgal,SymbDecal,LimiteCapac,CouleurRetenue,Interm,Enonce,Decalages,Couleurs,Dense,Dernier,MathE,MathF,MathG,CouleurPlus,Vide,HauteurVide,Session,PoliceManuscrite},%
keywordstyle={\color{orange}}
},%
#1
@@ -255,7 +256,11 @@
\section{Historique}
-\verb|v0.2.6|~:~~~~Correction dans des simplifications de Karnaugh
+\verb|v0.2.8|~:~~~~Grilles d'évaluation des CCF
+
+\verb|v0.2.7|~:~~~~Correction d'un bug dans les simplifications de Karnaugh
+
+\verb|v0.2.6|~:~~~~Corrections dans des simplifications de Karnaugh
\verb|v0.2.5|~:~~~~Clé \textsf{[Vide]} pour les tables vérité, pour ne pas remplir
@@ -1163,9 +1168,9 @@ Par exemple :
\vspace*{-\baselineskip}\leavevmode
\end{cautionblock}
-%\begin{importantblock}
-%En interne, la commande utilise la simplification par table de Karnaugh, et la commande peut également se charger de formater le résultat brut de l'expression.
-%\end{importantblock}
+\begin{noteblock}
+La plupart des clés de la commande de simplification par Karnaugh sont utilisables avec cette commande, notamment celles de formatage des couleurs.
+\end{noteblock}
\subsection{Arguments et clés }
@@ -1184,6 +1189,7 @@ Les clés disponibles sont :
\item \Cle{Enonce} := booléen pour afficher l'expression booléenne brute ; \hfill~défaut : \Cle{true}
\item \Cle{Variables} := variables utilisées ; \hfill~défaut : \Cle{a/b/c}
\item \Cle{Contraire} := booléen pour travailler sur le contraire ; \hfill~défaut : \Cle{false}
+ \item \Cle{Couleurs} et \Cle{CouleurPlus} := couleurs(s) de la sortie ; \hfill~défaut : \Cle{black}
\item \Cle{Espace} := booléen pour rajouter un petit espace (1.5~mu) dans les produits.
\hfill~défaut : \Cle{true}
@@ -1216,7 +1222,9 @@ $\overline{E} = \SimplificationBooleenne[Contraire,Variables=g/b/n]{(g)+(gb)+(gb
\end{DemoCode}
\begin{DemoCode}
-On a $F = \SimplificationBooleenne{(a)+(abc*)+(a*b*c)+(abc)+(a*bc)}$.
+On a $F = \SimplificationBooleenne%
+ [Couleurs={blue/red/violet},CouleurPlus=orange]%
+ {(a)+(abc*)+(a*b*c)+(abc)+(a*bc)}$.
\end{DemoCode}
\pagebreak
@@ -2263,4 +2271,80 @@ On a, par produit matriciel le calcul
<cell-space-limits=3pt>
\end{DemoCode}
+\pagebreak
+
+\section{Fiches annexes pour les CCF de mathématiques}
+
+\subsection{Introduction}
+
+L'idée est de proposer des commandes pour générer \textit{facilement} les fiches d'évaluation pour les deux situations de CCF de mathématiques en SIO.
+
+\smallskip
+
+Il s'agit des annexes 7-1 (recto), 7-2 (recto verso) et 7-3 (recto verso).
+
+\smallskip
+
+Un exemple de rendu est donné en marge de la présente documentation (avec code source).
+
+\smallskip
+
+Le code source de base des exemples est donné ci-dessous.
+
+\begin{DemoCode}[listing only]
+\documentclass[a4paper,french,12pt]{article}
+\usepackage[margin=1.5cm]{geometry}
+\usepackage{fontspec}
+\usepackage{ProfSio}
+\setsansfont{Fira Sans}[Scale=MatchLowercase]
+\newfontfamily\poltuto{QTSanDiego}
+\usepackage{babel}
+\end{DemoCode}
+
+\subsection{Annexe 7-1}
+
+\begin{DemoCode}[listing only]
+\GrilleCCFSIO[Type={7-1},Session=...,PoliceManuscrite=...]
+ {NOM Prénom}
+ {date}
+ {intitulé court}
+\end{DemoCode}
+
+\subsection{Annexe 7-2}
+
+\begin{DemoCode}[listing only]
+\GrilleCCFSIO[Type={7-2},Session=...,PoliceManuscrite=...]
+ {NOM Prénom}
+ {date}
+ {intitulé court}
+ <compétenceA / compétenceB / compétence C / compétence D>
+\end{DemoCode}
+
+\subsection{Annexe 7-3}
+
+\begin{DemoCode}[listing only]
+\GrilleCCFSIO[Type={7-3},Session=...,PoliceManuscrite=...]
+ {NOM Prénom}
+ {date}
+ {identification du sujet proposé}
+\end{DemoCode}
+
+\newpage
+
+\thispagestyle{empty}
+
+\includepdf[frame,pages=-,width=\textwidth]{ProfSio-doc-annexe71.pdf}
+
+\newpage
+
+\thispagestyle{empty}
+
+\includepdf[frame,pages=-,width=\textwidth]{ProfSio-doc-annexe72.pdf}
+
+\newpage
+
+\thispagestyle{empty}
+
+\includepdf[frame,pages=-,width=\textwidth]{ProfSio-doc-annexe73.pdf}
+
\end{document} \ No newline at end of file
diff --git a/graphics/pgf/contrib/profsio/tex/ProfSio.sty b/graphics/pgf/contrib/profsio/tex/ProfSio.sty
index 2d3b5d6a17..3b70f9a1e3 100644
--- a/graphics/pgf/contrib/profsio/tex/ProfSio.sty
+++ b/graphics/pgf/contrib/profsio/tex/ProfSio.sty
@@ -3,8 +3,10 @@
% : Luatruthtable from Chetan Shirore and Dr. Ajit Kumar https://ctan.org/pkg/luatruthtable
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ProfSio}[2024/04/20 0.2.6 Pour les enseignants de Maths en BTS SIO]
-%0.2.6 Correction dans les simplifications de Karnaugh
+\ProvidesPackage{ProfSio}[2024/05/18 0.2.8 Pour les enseignants de Maths en BTS SIO]
+%0.2.8 Ajout des grilles de CCF (E2)
+%0.2.7 Correction d'un bug dans les simplifications de Karnaugh
+%0.2.6 Corrections dans les simplifications de Karnaugh
%0.2.5 Ajout de clés pour les tables de vérité, [Vide], pour ne pas le remplir
%0.2.4 Ajout d'une commande pour afficher (sans simplifier) une expression booléenne + tables en base donnée + Possibilité math dans diag sagitt
%0.2.3 Ajout d'une clé [Dense] pour condenser la résolution matricielle de système + commande \KarnaughBlocRegroupAuto pour créer les blocs automatiquement
@@ -1920,14 +1922,18 @@ end
\ExplSyntaxOff
\defKV[simplifbool]{%
- Variables=\def\simplifboolvars{#1}
+ Variables=\def\simplifboolvars{#1},
+ Couleurs=\def\simplifboolcoul{#1},%
+ CouleurPlus=\def\simplifboolcoulplus{#1},%
}
\setKVdefault[simplifbool]{%
Variables={a/b/c},%
Enonce=true,%
Espace=true,%
- Contraire=false
+ Contraire=false,%
+ Couleurs={black/black/black},%
+ CouleurPlus=black,%
}
\NewDocumentCommand\ExprBool{ O{} m D<>{} }{%semble ok
@@ -2075,11 +2081,11 @@ end
\StrSubstitute{\knghbinres}{2}{1}[\knghbinres]%
}%
{}%
- \ensuremath{%
+ \ensuremath{%\knghbinres=%
\ifboolKV[simplifbool]{Enonce}{\ifboolKV[simplifbool]{Contraire}{\overline{\knghenoncetransf}}{\knghenoncetransf}=}{}%
\ifboolKV[simplifbool]{Espace}%
- {\SimplificationKarnaugh[Variables={\simplifboolvars},Espace=true,#3]{\knghbinres}}%
- {\SimplificationKarnaugh[Variables={\simplifboolvars},Espace=false,#3]{\knghbinres}}%
+ {\SimplificationKarnaugh[Variables={\simplifboolvars},Espace=true,Swap,#3,Couleurs={\simplifboolcoul},CouleurPlus={\simplifboolcoulplus}]{\knghbinres}}%
+ {\SimplificationKarnaugh[Variables={\simplifboolvars},Espace=false,Swap,#3,Couleurs={\simplifboolcoul},CouleurPlus={\simplifboolcoulplus}]{\knghbinres}}%
}
}
@@ -2832,4 +2838,305 @@ end
\StrSubstitute{#2}{/}{#1}\relax%
}
+%===GRILLES CCF
+\newcommand\tkzsquarebox{{\tikz\draw (0,0) rectangle++(0.9em,0.9em);}}
+
+\defKV[GrillesCCFSIO]{%
+ Session=\def\grccfsioannee{#1},%
+ PoliceManuscrite=\def\grpoliceccf{#1},%
+ Type=\def\grtypeccf{#1}
+}
+
+\setKVdefault[GrillesCCFSIO]{%
+ Session={\year},%
+ PoliceManuscrite={},%
+ Type={7-1}
+}
+
+\NewDocumentCommand\GrilleCCFSIO{ O{} m m m D<>{default} }{%
+ %1=clés
+ %2=candidat
+ %3=date
+ %4=résumé
+ %5=compétences
+ \restoreKV[GrillesCCFSIO]%
+ \setKV[GrillesCCFSIO]{#1}%
+ \IfStrEq{\grtypeccf}{7-1}%
+ {%
+ \noindent\begin{tblr}{vlines,width=\linewidth,colspec={X[m]},row{1}={l},row{2-3}={c},cells={font=\sffamily\bfseries}}
+ \hline
+ BTS SERVICES INFORMATIQUES AUX ORGANISATIONS\hfill{}SESSION {\grccfsioannee}\hspace*{1cm} \\
+ ANNEXE 7-1 : Document de préparation au déroulement de la situation 1 \\
+ Épreuve E2 – Mathématiques pour l’informatique (CCF) \\
+ \hline
+ \end{tblr}
+
+ \vspace*{5mm}
+
+ \noindent\begin{tblr}{
+ vline{1,Z}={solid},%
+ vline{2}={3-4}{solid},%
+ width=\linewidth,
+ colspec={X[m]Q[7cm,m]},
+ hlines,stretch=1.25,
+ cells={font=\bfseries\sffamily},
+ rows={1cm},%
+ row{2}={t},%
+ row{4}={t}
+ }
+ \SetCell[c=2]{c}{SITUATION PROBLÈME} & \\
+ NOM et prénom : \textmd{\grpoliceccf #2} & \SetCell{l}{\phantom{BLABLA}OPTION SLAM\phantom{ISR}\raisebox{-0.1em}{\tkzsquarebox} \\ \phantom{BLABLA}OPTION SISR\phantom{LAM}\raisebox{-0.1em}{\tkzsquarebox}} \\
+ N° candidat : & N° commission \\
+ {Intitulé court de la situation proposée : \\~\\ \textmd{\grpoliceccf #4} \\} & {\\ Date : \textmd{\grpoliceccf #3}} \\
+ {Consignes\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\} & \\
+ {Documents ou composants fournis\\ \\ \textmd{\grpoliceccf Notice + Aide-mémoire + Clé USB}\\ \\ \\} & \\
+ \end{tblr}
+
+ \vspace*{5mm}
+
+ \noindent\textsf{\textit{Au cours de l’épreuve, la personne candidate est autorisée à utiliser les ressources électroniques disponibles dans le centre d’examen à l’exception de tout service d’échanges synchrones ou asynchrones avec un tiers. Elle est informée que l’ensemble des connexions réalisées peuvent faire l’objet d’un contrôle par la commission d’interrogation.}}
+
+ \pagebreak
+ }%
+ {}%
+ \IfStrEq{\grtypeccf}{7-2}%
+ {%
+ \IfStrEq{#5}{default}%
+ {%
+ \def\compteccfA{}%
+ \def\compteccfB{}%
+ \def\compteccfC{}%
+ \def\compteccfD{}%
+ }%
+ {%
+ \setsepchar[.]{/}%
+ \readlist*\lstcompetccf{#5}%
+ \itemtomacro\lstcompetccf[1]\compteccfA%
+ \itemtomacro\lstcompetccf[2]\compteccfB%
+ \itemtomacro\lstcompetccf[3]\compteccfC%
+ \itemtomacro\lstcompetccf[4]\compteccfD%
+
+ }%
+ \noindent\begin{tblr}{vlines,width=\linewidth,colspec={X[m]},row{1}={l},row{2-3}={c},cells={font=\sffamily\bfseries}}
+ \hline
+ BTS SERVICES INFORMATIQUES AUX ORGANISATIONS\hfill{}SESSION {\grccfsioannee}\hspace*{1cm} \\
+ ANNEXE 7-2 : Grille d’aide à l’évaluation de la situation 1 (recto) \\
+ Épreuve E2 – Mathématiques pour l’informatique (CCF) \\
+ \hline
+ \end{tblr}
+
+ \vspace*{5mm}
+
+ \noindent\begin{tblr}{vlines,width=\linewidth,colspec={X[m]Q[3.5cm,m]},cells={font=\sffamily\bfseries},stretch=1.25}
+ \hline
+ NOM et prénom : \textmd{\grpoliceccf #2} & N° commission\textsuperscript{\scriptsize 1} : \\
+ N° candidat : & \\
+ \hline
+ \end{tblr}
+
+ \vspace*{0.75cm}
+
+ \noindent\begin{tblr}{
+ hlines,vlines,
+ width=\linewidth,colspec={X[0.625,m]X[0.375,m]},
+ cells={font=\sffamily},%
+ row{2}={1.25cm},%
+ row{X}={0.75cm}
+ }
+ \SetCell[c=2]{l}{\bfseries Intitulé court de la situation problème proposée :} & \\
+ \SetCell[c=2]{l}{\grpoliceccf #4} & \\
+ \textbf{Évaluation\textsuperscript{\footnotesize 2}} & \textbf{Critères d'évaluation} \\
+ \textbf{Maîtrise des connaissances (sur 8)} & \\
+ \textmd{-- \grpoliceccf \compteccfA} & \\
+ \textmd{-- \grpoliceccf \compteccfB} & \\
+ \textmd{-- \grpoliceccf \compteccfC} & \\
+ \textmd{-- \grpoliceccf \compteccfD} & \\
+ \textbf{Production commentée (sur 6)} & \\
+ \textmd{Efficacité et pertinence de la solution proposée} & \\
+ \textmd{Pertinence de la solution proposée} & \\
+ \textmd{Correction et cohérence de l’utilisation du formalisme retenu} & \\
+ \textmd{Cohérence de l’utilisation du formalisme retenu} & \\
+ \textmd{Lisibilité de la solution proposée} & \\
+ \textbf{Mise en \oe{}uvre commentée (sur 6)} & \\
+ \textmd{Qualité de la mise en \oe{}uvre} & \\
+ \textmd{Efficacité de l’implémentation} & \\
+ \textmd{Pertinence de l’utilisation des composants logiciels fournis} & \\
+ \textmd{Adéquation des tests de validation effectués} & \\
+ \textmd{Capacité à proposer des corrections pertinentes} & \\
+ \textbf{Note globale} & \SetCell{r}{\textbf{Note ~~~~/\,20}} \\
+ \SetCell[c=2]{l}{\textbf{Date :} {\grpoliceccf #3} \\ ~ \\ \textbf{Nom et signature de la commission d’évaluation :} \\ ~} & \\
+ \SetCell[c=2]{l}{\textbf{\textit{Joindre le document descriptif de la situation problème proposée.}}} & \\
+ \end{tblr}
+
+ \vspace*{5mm}
+
+ \noindent\textsf{\textbf{\textit{Cette partie est à l’usage exclusif de la commission d’interrogation et ne peut être communiquée à la personne candidate.}}}
+
+ \vfill
+
+ \par\noindent\rule{0.33\linewidth}{0.4pt}
+
+ \noindent\textsf{\textsuperscript{\footnotesize 1}{\footnotesize Indiquer le nom du professeur responsable de l’évaluation.}}
+
+ \noindent\textsf{\textsuperscript{\footnotesize 2}{\footnotesize Des appels (2 au maximum) permettent de s’assurer de la compréhension du problème et d’évaluer la communication orale et les capacités liées à l’usage des outils numériques.}}
+
+ \vspace*{5mm}
+
+ \pagebreak
+
+ \noindent\begin{tblr}{vlines,width=\linewidth,colspec={X[m]},row{1}={l},row{2-3}={c},cells={font=\sffamily\bfseries}}
+ \hline
+ BTS SERVICES INFORMATIQUES AUX ORGANISATIONS\hfill{}SESSION {\grccfsioannee}\hspace*{1cm} \\
+ ANNEXE 7-2 : Grille d’aide à l’évaluation de la situation 1 (verso) \\
+ Épreuve E2 – Mathématiques pour l’informatique (CCF) \\
+ \hline
+ \end{tblr}
+
+ \vspace*{5mm}
+
+ \noindent\begin{tblr}{vlines,width=\linewidth,colspec={X[m]Q[6cm,m]},cells={font=\sffamily\bfseries},stretch=1.25}
+ \hline
+ NOM et prénom : \textmd{\grpoliceccf #2} & Date de l'interrogation : \\
+ N° candidat : & \textmd{\grpoliceccf #3} \\ \hline
+ \end{tblr}
+
+ \vspace*{0.75cm}
+
+ \noindent\begin{tblr}{%
+ width=\linewidth,colspec={XQ[7cm]},cells={font=\bfseries\sffamily},
+ row{1}={m,j,1cm},
+ row{2}={m,7cm},
+ row{3}={m,j,1cm},
+ row{4}={m,4cm},
+ vline{1,Z}={solid},
+ vline{2}={Z}{solid},
+ stretch=1.25}
+ \hline
+ Appréciation globale & \\ \hline
+ ~
+ \\ \hline
+ Questionnement complémentaire éventuel & \\ \hline
+ ~
+ \\ \hline
+ {\underline{Note sur 20 :}\\ \\ \\} & {Visa de la commission \\ \\ \\} \\
+ \hline
+ \end{tblr}
+
+ \vspace*{5mm}
+
+ \noindent\textsf{\textbf{Ce document d’évaluation peut être communiqué à la personne candidate, à sa demande, après délibération du jury.}}
+
+ \pagebreak
+ }%
+ {}%
+ \IfStrEq{\grtypeccf}{7-3}%
+ {%
+ \noindent\begin{tblr}{vlines,width=\linewidth,colspec={X[m]},row{1}={l},row{2-3}={c},cells={font=\sffamily\bfseries}}
+ \hline
+ BTS SERVICES INFORMATIQUES AUX ORGANISATIONS\hfill{}SESSION {\grccfsioannee}\hspace*{1cm} \\
+ ANNEXE 7-3 : Grille d’aide à l’évaluation de la situation 2 (recto) \\
+ Épreuve E2 – Mathématiques pour l’informatique (CCF) \\
+ \hline
+ \end{tblr}
+
+ \vspace*{5mm}
+
+ \noindent\begin{tblr}{vlines,width=\linewidth,colspec={X[m]Q[3.5cm,m]},cells={font=\sffamily\bfseries},stretch=1.25}
+ \hline
+ NOM et prénom : \textmd{\grpoliceccf #2} & N° commission\textsuperscript{\scriptsize 3} : \\
+ N° candidat : & \\
+ \hline
+ \end{tblr}
+
+ \vspace*{0.75cm}
+
+ \noindent\begin{tblr}{%
+ hline{1}={solid},%
+ hline{3-Y}={solid},
+ hline{Z}={2-Z}{solid},
+ vline{1}={1-Y}{solid},
+ vline{2}={3-Z}{solid},
+ vline{Z}={solid},
+ width=\linewidth,colspec={X[0.525]X[0.475]},
+ cells={font=\sffamily},
+ row{1}={m,j},
+ row{2}={m,j,1.5cm},
+ row{3-Z}={m,j,1cm},stretch=1.25}
+ \textbf{Identification du sujet proposé :} & \\
+ \textmd{\grpoliceccf #4} & \\
+ \SetCell{c}{\textbf{Compétences}} & \SetCell{c}{\textbf{Appréciation du niveau d’acquisition\textsuperscript{\scriptsize 4}}} \\
+ Maîtrise des connaissances figurant au programme & \\
+ Pertinence des sources d’information mobilisées & \\
+ Adaptation de la stratégie choisie au problème à résoudre & \\
+ Efficacité dans la mise en \oe{}uvre de cette stratégie & \\
+ Rigueur et pertinence dans l’utilisation des savoir-faire figurant au programme de mathématiques & \\
+ Cohérence de l’argumentation employée & \\
+ Aptitude à analyser un résultat avec pertinence & \\
+ Qualité d’expression écrite ou orale & \\
+ & \SetCell{r}{\textbf{/\,20}} \\
+ \end{tblr}
+
+ \vspace*{5mm}
+
+ \noindent\textsf{\textbf{\textit{Cette partie est à l’usage exclusif de la commission d’interrogation et ne peut être communiquée à la personne candidate.}}}
+
+ \vfill
+
+ \par\noindent\rule{0.33\linewidth}{0.4pt}
+
+ \noindent\textsf{\textsuperscript{\footnotesize 3}{\footnotesize Indiquer le nom du professeur responsable de l’évaluation.}}
+
+ \noindent\textsf{\textsuperscript{\footnotesize 4}{\footnotesize Le professeur peut utiliser toute forme d’annotation lui permettant d’évaluer par compétences.}}
+
+ \vspace*{5mm}
+
+ \pagebreak
+
+ \noindent\begin{tblr}{vlines,width=\linewidth,colspec={X[m]},row{1}={l},row{2-3}={c},cells={font=\sffamily\bfseries}}
+ \hline
+ BTS SERVICES INFORMATIQUES AUX ORGANISATIONS\hfill{}SESSION {\grccfsioannee}\hspace*{1cm} \\
+ ANNEXE 7-3 : Grille d’aide à l’évaluation de la situation 2 (verso) \\
+ Épreuve E2 – Mathématiques pour l’informatique (CCF) \\
+ \hline
+ \end{tblr}
+
+ \vspace*{5mm}
+
+ \noindent\begin{tblr}{vlines,width=\linewidth,colspec={X[m]Q[6cm,m]},cells={font=\sffamily\bfseries},stretch=1.25}
+ \hline
+ NOM et prénom : \textmd{\grpoliceccf #2} & Date de l'interrogation : \\
+ N° candidat : & \textmd{\grpoliceccf #3} \\ \hline
+ \end{tblr}
+
+ \vspace*{0.75cm}
+
+ \noindent\begin{tblr}{%
+ width=\linewidth,colspec={XQ[7cm]},cells={font=\bfseries\sffamily},
+ row{1}={m,j,1cm},
+ row{2}={m,7cm},
+ row{3}={m,j,1cm},
+ row{4}={m,4cm},
+ vline{1,Z}={solid},
+ vline{2}={Z}{solid},
+ stretch=1.25}
+ \hline
+ Appréciation globale & \\ \hline
+ ~
+ \\ \hline
+ Questionnement complémentaire éventuel & \\ \hline
+ ~
+ \\ \hline
+ {\underline{Note sur 20 :}\\ \\ \\} & {Visa de la commission \\ \\ \\} \\
+ \hline
+ \end{tblr}
+
+ \vspace*{5mm}
+
+ \noindent\textsf{\textbf{Ce document d’évaluation peut être communiqué à la personne candidate, à sa demande, après délibération du jury.}}
+
+ \pagebreak
+ }%
+ {}%
+}
+
\endinput \ No newline at end of file
diff --git a/graphics/pgf/contrib/tikzducks/DEPENDS.txt b/graphics/pgf/contrib/tikzducks/DEPENDS.txt
new file mode 100644
index 0000000000..4a5b9136d9
--- /dev/null
+++ b/graphics/pgf/contrib/tikzducks/DEPENDS.txt
@@ -0,0 +1,3 @@
+hard pgf
+hard iftex
+hard epstopdf-pkg
diff --git a/graphics/pgf/contrib/tikzducks/README.md b/graphics/pgf/contrib/tikzducks/README.md
index 248ed49d42..8298baafa7 100644
--- a/graphics/pgf/contrib/tikzducks/README.md
+++ b/graphics/pgf/contrib/tikzducks/README.md
@@ -1,11 +1,30 @@
+![](https://raw.githubusercontent.com/samcarter/tikzducks/main/ICON.png)
+
# TikZducks
-This is a little LaTeX package for ducks to be used in TikZ pictures. The project is a continuation of the TeX.Stackexchange.com answer [How can we draw a duck](https://tex.stackexchange.com/a/347458/36296)
+[![GitHub](https://img.shields.io/github/license/samcarter/tikzducks.svg?color=blue)](http://www.latex-project.org/lppl.txt)
+[![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/samcarter/tikzducks.svg?label=current%20version)](https://github.com/samcarter/tikzducks/releases/latest)
+[![CTAN](https://img.shields.io/ctan/v/tikzducks.svg)](https://ctan.org/pkg/tikzducks)
+
+This is a little LaTeX package for ducks to be used in TikZ pictures.
+
+This project is licensed under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt .
+
+The project repository, including a bug tracker, can be found at https://github.com/samcarter/tikzducks .
+
+### Usage
+
+```latex
+\documentclass{standalone}
+\usepackage{tikzducks}
-This project is licensed under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt
+\begin{document}
-## A few examples:
+\begin{tikzpicture}
+ \duck
+\end{tikzpicture}
-![tikz ducks](https://user-images.githubusercontent.com/43832342/71718547-d160d400-2e1b-11ea-8bae-39cc4b648771.png)
+\end{document}
+```
-More examples of TikZducks can be seen at https://github.com/samcarter/tikzducks/ \ No newline at end of file
+For more details, please consult the [package documentation](https://github.com/samcarter/tikzducks/blob/main/DOCUMENTATION.pdf).
diff --git a/graphics/pgf/contrib/tikzducks/t-tikzducks.mkiv b/graphics/pgf/contrib/tikzducks/t-tikzducks.mkiv
index efaaab5c6e..19af36180b 100644
--- a/graphics/pgf/contrib/tikzducks/t-tikzducks.mkiv
+++ b/graphics/pgf/contrib/tikzducks/t-tikzducks.mkiv
@@ -14,7 +14,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Code for this ConTeXt User Module kindly provided by @JairoAdelRio https://github.com/samcarter/tikzducks/pull/25
-\writestatus{loading}{ConTeXt User Module / TikZDucks 2024/04/19 version v1.7 Draw rubber ducks in TikZ}
+\writestatus{loading}{ConTeXt User Module / TikZDucks 2024/04/27 version v1.8 Draw rubber ducks in TikZ}
\setupcolors[state=start]
\usemodule[tikz]
diff --git a/graphics/pgf/contrib/tikzducks/tikzducks-doc-settings.sty b/graphics/pgf/contrib/tikzducks/tikzducks-doc-settings.sty
index 710f370f0c..777cedba6e 100644
--- a/graphics/pgf/contrib/tikzducks/tikzducks-doc-settings.sty
+++ b/graphics/pgf/contrib/tikzducks/tikzducks-doc-settings.sty
@@ -58,13 +58,17 @@
\RequirePackage[bitstream-charter]{mathdesign}
\let\hrulefill\hrulefillx
\RequirePackage[hang,flushmargin,bottom]{footmisc}
- \RequirePackage[colorlinks=true,breaklinks=true,allcolors=themecolor]{hyperref}
+ \RequirePackage{footnotehyper}
+ \makesavenoteenv{tcolorbox}
+ \RequirePackage[all]{nowidow}
+ \RequirePackage[colorlinks=true,breaklinks=true,allcolors=themecolor,hyperfootnotes=false]{hyperref}
}
\RequirePackage[T1]{fontenc}
\RequirePackage{xspace}
\RequirePackage{inconsolata}% mono font with bold, but italic is missing
% \RequirePackage[scale=0.85]{cascadia-code}
% \AddToHook{cmd/ttfamily/before}{\fontseries{sl}}
+\RequirePackage{iexec}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
@@ -72,12 +76,12 @@
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage[
- cachedir=./build/
+ cachedir=$TMPDIR/minted/
]{minted}
% smuggling custom pygmentize style in cache folder
% (a real pygmentise style would need installtion in some python folder)
-\begin{filecontents*}[noheader]{./build/sam.pygstyle}
+\begin{filecontents*}[noheader]{./sam.pygstyle}
\makeatletter
\def\PYG@reset{\let\PYG@it=\relax \let\PYG@bf=\relax%
\let\PYG@ul=\relax \let\PYG@tc=\relax%
@@ -122,6 +126,8 @@
\makeatother
\end{filecontents*}
+\iexec{mkdir -p $TMPDIR/minted && mv sam.pygstyle $TMPDIR/minted/.}
+
\usemintedstyle{sam}
\setminted{
breaksymbolleft={},
@@ -140,18 +146,28 @@
\tcbuselibrary{minted}
\tcbset{%
colframe=themecolor,
- arc=2mm,
fonttitle=\bfseries,
sidebyside,
center lower,
righthand width=5.7cm,
bottom=2pt,
top=2pt,
+ left=3pt,
+ right=3pt,
sidebyside gap=10pt,
lower separated=false,
listing engine=minted,
minted language=latex,
- colback=themecolor!10
+ colback=themecolor!10,
+ sharp corners,
+ boxrule=0pt,
+ before title={\strut}
+}
+
+% avoid page breaks right in front of the tcolorbox
+\@ifclassloaded{beamer}{}{
+ \tcbuselibrary{hooks}
+ \tcbset{before pre={\nopagebreak[4]}}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/graphics/pgf/contrib/tikzducks/tikzducks-doc.pdf b/graphics/pgf/contrib/tikzducks/tikzducks-doc.pdf
index c46d0fc44b..7cc5d36576 100644
--- a/graphics/pgf/contrib/tikzducks/tikzducks-doc.pdf
+++ b/graphics/pgf/contrib/tikzducks/tikzducks-doc.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/tikzducks/tikzducks-doc.tex b/graphics/pgf/contrib/tikzducks/tikzducks-doc.tex
index 39532183aa..5cc8af0781 100644
--- a/graphics/pgf/contrib/tikzducks/tikzducks-doc.tex
+++ b/graphics/pgf/contrib/tikzducks/tikzducks-doc.tex
@@ -34,7 +34,7 @@
\url{https://github.com/samcarter/tikzducks}\\
\url{https://www.ctan.org/pkg/tikzducks}
}{samcarter}}
-\date{Version v1.7 \textendash{} 2024/04/19}
+\date{Version v1.8 \textendash{} 2024/04/27}
\usepackage[
themecolor=samlblue
@@ -56,10 +56,10 @@
\cfoot{%
\shuffleducks
- \begin{tikzpicture}[scale=0.5]
+ \begin{tikzpicture}[scale=0.5]
\duck[signpost=\scalebox{0.6}{\thepage},\randomhead]
\end{tikzpicture}
-}
+}
\pagestyle{scrheadings}
\begin{document}
@@ -69,17 +69,17 @@
\section{Introduc(k)tion}
\label{intro}
-Rubber ducks can be made of latex, but can they also be made with \LaTeX? Yes! The \tikzducks package is a \LaTeX{} package for rubber ducks to be used in \TikZ pictures.
+Rubber ducks can be made of latex, but can they also be made with \LaTeX? Yes! The \tikzducks package is a \LaTeX{} package for rubber ducks to be used in \TikZ pictures.
This project is a continuation of \href{https://tex.stackexchange.com/a/347458/36296}{How can we draw a duck?}.
-This package is work in progress (and will probably never be really finished as there is an infinite amount of things which could be added), therefore I would be happy to hear your feedback and ideas how to improve the package.
+This package is work in progress (and will probably never be really finished as there is an infinite amount of things which could be added), therefore I would be happy to hear your feedback and ideas how to improve the package.
The head version of the source code can be found on \url{https://github.com/samcarter/tikzducks}, including a bug tracker -- please make constructive use of it! A more stable package version can be found on \CTAN (\url{https://www.ctan.org/pkg/tikzducks}) and is included in both \miktex and \texlive as \tikzducks. If you seek any other assistance (not bug reports/feature requests), I suggest asking a question at \url{https://topanswers.xyz/tex}.
\subsection{Acknowledgements}
Without the friendly and helpful community of \TeX{} users this package would not exist. I would like to thank a few fellow users in particular:
-First of all
+First of all
%
Carla Maggi for pointing out the overwhelming need of having a \tikzducks package and valuable contribution to the package code, in particular the \hyperref[sec:footballducks]{football ducks},
%
@@ -90,7 +90,7 @@ Ulrike Fischer for her useful \TikZ advices and contributions to the package and
Many other users contributed to this package (in random order):
%
Enrico Gregorio helped to implement the \saminline|\tikzset{}| interface which makes it much easier to adjust the properties of the ducks to fit the user needs,
-%
+%
Andrew Stacey contributed the \TikZ Library ``ducks'',
%
Symbol~1 solved a few problems with default key values,
@@ -99,7 +99,7 @@ Mihikma created the duck's beard,
%
Yudai Nakata helped with problems of \saminline|\pdfrandomseed|,
%
-@marmot for his seemingly infinite knowledge of \TikZ which he shared with the world,
+@marmot for his seemingly infinite knowledge of \TikZ which he shared with the world,
%
@JairoAdelRio for contributing the \ConTeXt{} User Module
%
@@ -130,7 +130,7 @@ To customise this basic duck, the package uses \saminline|pgf| keys. For almost
\end{tikzpicture}
\end{tcblisting}
-If the keyword consists of multiples words, it works both with and without spaces. In the following usually the version without spaces is given.
+If the keyword consists of multiples words, it works both with and without spaces. In the following usually the version without spaces is given.
In addition to the keys defined in this package, all usual \TikZ and \saminline|pgf| keys can also be used. For example if the size of the ducks should be changed or shifted:
@@ -166,7 +166,7 @@ To make the usage easier for the \TikZ-savvy users, Andrew Stacey contributed a
\end{tikzpicture}
\end{document}
-\end{samcode}
+\end{samcode}
\tcblower
\begin{tikzpicture}
@@ -180,7 +180,7 @@ To make the usage easier for the \TikZ-savvy users, Andrew Stacey contributed a
\end{tikzpicture}
\end{tcolorbox}
-For everybody suffering from anatidaephobia, there is also a special option to not draw the duck:
+For everybody suffering from anatidaephobia, there is also a special option to not draw the duck:
\begin{tcblisting}{title={Invisible duck}}
\begin{tikzpicture}
\duck[invisible]
@@ -189,9 +189,7 @@ For everybody suffering from anatidaephobia, there is also a special option to n
This can also be useful to recycle some of the accessories presented in \ref{sec:accessories}.
-\clearpage
For the \TeX{} purists, there is also a picture mode variant:
-
{
\setlength{\unitlength}{0.6mm}
\begin{tcblisting}{title={\texttt{picture} mode duck}}
@@ -201,7 +199,7 @@ For the \TeX{} purists, there is also a picture mode variant:
\end{tcblisting}
}
-And thanks to @JairoAdelRio there is even a \ConTeXt{} User Module available. Some of the colours might look different and not being a \ConTeXt{} user myself, I can't guarantee maintenance of this module.
+And thanks to @JairoAdelRio there is even a \ConTeXt{} User Module available. Some of the colours might look different and not being a \ConTeXt{} user myself, I can't guarantee maintenance of this module.
\begin{tcolorbox}[title={\ConTeXt{} User Module}]
\begin{samcode}
@@ -214,7 +212,7 @@ And thanks to @JairoAdelRio there is even a \ConTeXt{} User Module available. So
\stoptikzpicture
\stoptext
-\end{samcode}
+\end{samcode}
\tcblower
\begin{tikzpicture}
@@ -248,7 +246,7 @@ The various parts of the duck can also be coloured independently, i.e.\ \saminli
\begin{tcblisting}{title={Harlequin duck}}
\begin{tikzpicture}
\duck[body=yellow,
- head=yellow!50!orange,
+ head=yellow!50!orange,
bill=red,
eye=green]
\end{tikzpicture}
@@ -352,8 +350,7 @@ Eyebrows and a beard are also part of the package. The colour choice is more tri
\end{tikzpicture}
\end{tcblisting}
-\addtocounter{footnote}{1}
-\begin{tcblisting}{title={Beard duck$^{\thefootnote}$}}
+\begin{tcblisting}{title={Beard duck\footnote{The beard is based on an answer by Mihikma, see \url{https://tex.stackexchange.com/a/401777/36296}}}}
\begin{tikzpicture}
\duck[beard=white!80!brown]
\end{tikzpicture}
@@ -361,7 +358,6 @@ Eyebrows and a beard are also part of the package. The colour choice is more tri
\duck[recedinghair=white,beard]
\end{tikzpicture}
\end{tcblisting}
-\footnotetext[\thefootnote]{The beard is based on an answer by Mihikma, see \url{https://tex.stackexchange.com/a/401777/36296}}
Please note that not all of the accessories, especially hats, shown in the following sections, will suite every hairstyle. In case the desired combination of hair style and hat does not work well, there is always the possibility to look up the original definition of the hat in the \saminline|tikzducks| source code and recreate it with a more suitable position or size.
@@ -443,7 +439,7 @@ There is a multitude of things a duck might need. The following examples all als
\begin{tcblisting}{title={Strawhat duck}}
\begin{tikzpicture}
- \duck[strawhat=brown!50!white,
+ \duck[strawhat=brown!50!white,
ribbon=gray]
\end{tikzpicture}
\end{tcblisting}
@@ -462,7 +458,7 @@ There is a multitude of things a duck might need. The following examples all als
\begin{tcblisting}{title={Santa Duck}}
\begin{tikzpicture}
- \duck[santa=red!80!black,
+ \duck[santa=red!80!black,
beard=white!80!brown]
\end{tikzpicture}
\end{tcblisting}
@@ -471,38 +467,38 @@ There is a multitude of things a duck might need. The following examples all als
\begin{tikzpicture}
\duck[graduate=gray!20!black,
tassel=red!70!black]
-\end{tikzpicture}
+\end{tikzpicture}
\end{tcblisting}
\begin{tcblisting}{title={Beret duck}}
\begin{tikzpicture}
\duck[beret=red!70!black]
-\end{tikzpicture}
+\end{tikzpicture}
\end{tcblisting}
\begin{tcblisting}{title={Peaked cap duck}}
\begin{tikzpicture}
\duck[peakedcap=blue!50!black]
-\end{tikzpicture}
+\end{tikzpicture}
\end{tcblisting}
\begin{tcblisting}{title={Harlequin duck}}
\begin{tikzpicture}
\duck[harlequin=blue,
niuqelrah=red]
-\end{tikzpicture}
+\end{tikzpicture}
\end{tcblisting}
\begin{tcblisting}{title={Sailor duck}}
\begin{tikzpicture}
\duck[sailor=white]
-\end{tikzpicture}
+\end{tikzpicture}
\end{tcblisting}
\begin{tcblisting}{title={Bobble hat duck}}
\begin{tikzpicture}
\duck[bobblehat=red!70!red]
-\end{tikzpicture}
+\end{tikzpicture}
\end{tcblisting}
\begin{tcblisting}{title={Crown duck}}
@@ -545,38 +541,32 @@ There is a multitude of things a duck might need. The following examples all als
\end{tikzpicture}
\end{tcblisting}
-\addtocounter{footnote}{1}
-\begin{tcblisting}{title={Bunny duck$^{\thefootnote}$}}
+\begin{tcblisting}{title={Bunny duck\footnote{Unless an explicit colour is specified, the bunny ears will take the body colour as default colour, the inner parts will be drawn in a lighter shade.}}}
\begin{tikzpicture}
- \duck[body=white!80!brown,
- bill=white!60!brown,
+ \duck[body=white!80!brown,
+ bill=white!60!brown,
bunny]
\end{tikzpicture}
\begin{tikzpicture}
\duck[bunny=red,inear=blue]
\end{tikzpicture}
\end{tcblisting}
-\footnotetext[\thefootnote]{Unless an explicit colour is specified, the bunny ears will take the body colour as default colour, the inner parts will be drawn in a lighter shade.}
-\addtocounter{footnote}{1}
-\begin{tcblisting}{title={Sheep duck$^{\thefootnote}$}}
+\begin{tcblisting}{title={Sheep duck\footnote{The in-ear colour of the sheep is chosen to be the same as the bill}}}
\begin{tikzpicture}
- \duck[body=white!80!brown,
- bill=white!60!brown,
+ \duck[body=white!80!brown,
+ bill=white!60!brown,
sheep]
\end{tikzpicture}
\end{tcblisting}
-\footnotetext[\thefootnote]{The in-ear colour of the sheep chosen to be the same as the bill}
-\addtocounter{footnote}{1}
-\begin{tcblisting}{title={Horse duck$^{\thefootnote}$}}
+\begin{tcblisting}{title={Horse duck\footnote{If no colour is specified, the horse tail will have the same colour as the hair}}}
\begin{tikzpicture}
- \duck[body=brown!80!white,
- longhair=brown!50!black,
+ \duck[body=brown!80!white,
+ longhair=brown!50!black,
horsetail]
\end{tikzpicture}
\end{tcblisting}
-\footnotetext[\thefootnote]{If no colour is specified, the horse tail will have the same colour as the hair}
\begin{tcblisting}{title={Witch duck}}
\begin{tikzpicture}
@@ -620,10 +610,10 @@ There is a multitude of things a duck might need. The following examples all als
\end{tcblisting}
\begin{tcblisting}{title={Signpost duck}}
-\begin{tikzpicture}
+\begin{tikzpicture}
\duck[signpost=42]
\end{tikzpicture}
-\begin{tikzpicture}
+\begin{tikzpicture}
\duck[signpost=\scalebox{0.4}{
\parbox{2cm}{\color{black}
\centering Science\\ first}},
@@ -632,8 +622,7 @@ There is a multitude of things a duck might need. The following examples all als
\end{tikzpicture}
\end{tcblisting}
-\addtocounter{footnote}{1}
-\begin{tcblisting}{title={Speaking duck$^{\thefootnote}$}}
+\begin{tcblisting}{title={Speaking duck\footnote{Both the speech and thought bubble are inspired by the wonderful \href{https://www.ctan.org/pkg/ducksay}{ducksay package}}}}
\begin{tikzpicture}
\duck[speech={Bla},
bubblecolour=cyan!20!white,
@@ -641,30 +630,27 @@ There is a multitude of things a duck might need. The following examples all als
\end{tikzpicture}
\end{tcblisting}
-\begin{tcblisting}{title={Thinking duck$^{\thefootnote}$}}
+\begin{tcblisting}{title={Thinking duck\footnotemark[\thefootnote]}}
\begin{tikzpicture}
\duck[think={Blub},
bubblecolour=white!95!yellow]
\end{tikzpicture}
\end{tcblisting}
-\footnotetext[\thefootnote]{Both the speech and thought bubble are inspired by the wonderful \href{https://www.ctan.org/pkg/ducksay}{ducksay package}}
-\addtocounter{footnote}{1}
-\begin{tcblisting}{title={Buttons duck$^{\thefootnote}$}}
+\begin{tcblisting}{title={Buttons duck\footnote{In case the duck is wearing a jacket, the buttons are positioned a bit lower}}}
\begin{tikzpicture}
\duck[buttons=brown!50!black]
-\end{tikzpicture}
+\end{tikzpicture}
\begin{tikzpicture}
\duck[jacket=red,buttons]
-\end{tikzpicture}
+\end{tikzpicture}
\end{tcblisting}
-\footnotetext[\thefootnote]{In case the duck is wearing a jacket, the buttons are positioned a bit lower}
\begin{tcblisting}{title={Dinner jacket duck}}
\begin{tikzpicture}
\duck[jacket=gray,
lapel=black,buttons]
-\end{tikzpicture}
+\end{tikzpicture}
\end{tcblisting}
\begin{tcblisting}{title={Book duck}}
@@ -672,7 +658,7 @@ There is a multitude of things a duck might need. The following examples all als
\duck[book=\scalebox{0.5}{\TeX}]
\end{tikzpicture}
\begin{tikzpicture}
- \duck[book=\scalebox{0.6}{$\pi$},
+ \duck[book=\scalebox{0.6}{$\pi$},
bookcolour=blue!50!black]
\end{tikzpicture}
\end{tcblisting}
@@ -683,28 +669,24 @@ There is a multitude of things a duck might need. The following examples all als
\end{tikzpicture}
\end{tcblisting}
-\begin{tcblisting}{title={Hockey duck}}
+\begin{tcblisting}{title={Football duck\footnote{The football duck is simplified version from an answer by Carla Maggi, \url{https://tex.stackexchange.com/a/387126/36296}}}}
\begin{tikzpicture}
- \duck[hockey=brown!70!black]
+ \duck[football=white!85!yellow]
\end{tikzpicture}
\end{tcblisting}
-\addtocounter{footnote}{1}
-\begin{tcblisting}{title={Football duck$^{\thefootnote}$}}
+\begin{tcblisting}{title={Hockey duck}}
\begin{tikzpicture}
- \duck[football=white!85!yellow]
+ \duck[hockey=brown!70!black]
\end{tikzpicture}
\end{tcblisting}
-\footnotetext[\thefootnote]{The football duck is simplified version from an answer by Carla Maggi, \url{https://tex.stackexchange.com/a/387126/36296}}
-\addtocounter{footnote}{1}
-\begin{tcblisting}{title={Lightsaber duck$^{\thefootnote}$}}
+\begin{tcblisting}{title={Lightsaber duck\footnote{Dedicated to the Counter Wizard (aka Christian Hupfer)}}}
\begin{tikzpicture}
\duck[lightsaber=red,
darthvader=black!30!gray]
\end{tikzpicture}
\end{tcblisting}
-\footnotetext[\thefootnote]{Dedicated to the Counter Wizard (aka Christian Hupfer)}
\begin{tcblisting}{title={Torch duck}}
\begin{tikzpicture}
@@ -727,7 +709,7 @@ There is a multitude of things a duck might need. The following examples all als
\begin{tcblisting}{title={Necklace duck}}
\begin{tikzpicture}
\duck[necklace=gray!20!white]
-\end{tikzpicture}
+\end{tikzpicture}
\end{tcblisting}
\begin{tcblisting}{title={Icecream duck}}
@@ -735,88 +717,81 @@ There is a multitude of things a duck might need. The following examples all als
\duck[icecream]
\end{tikzpicture}
\begin{tikzpicture}
- \duck[icecream=brown,
- flavoura=green!50!brown,
- flavourb=white,
+ \duck[icecream=brown,
+ flavoura=green!50!brown,
+ flavourb=white,
flavourc=red]
\end{tikzpicture}
\end{tcblisting}
-\addtocounter{footnote}{1}
-\begin{tcblisting}{title={Chef duck$^{\thefootnote}$}}
+\begin{tcblisting}{title={Chef duck\footnote{The chef duck is based on an idea by Carla Maggi, please see the following link for a more sophisticated version of the toque and the rolling pin: \url{https://tex.stackexchange.com/a/387126/36296}}}}
\begin{tikzpicture}
\duck[chef=white!95!yellow,
rollingpin=brown!80!black]
\end{tikzpicture}
\end{tcblisting}
-\footnotetext[\thefootnote]{The chef duck is based on an idea by Carla Maggi, please see the following link for a more sophisticated version of the toque and the rolling pin: \url{https://tex.stackexchange.com/a/387126/36296}}
\begin{tcblisting}{title={Cake duck}}
\begin{tikzpicture}
\duck[cake=red!50!violet!80!black]
-\end{tikzpicture}
+\end{tikzpicture}
\end{tcblisting}
\begin{tcblisting}{title={Pizza duck}}
\begin{tikzpicture}
\duck[pizza]
-\end{tikzpicture}
+\end{tikzpicture}
\end{tcblisting}
\begin{tcblisting}{title={Baguette duck}}
\begin{tikzpicture}
\duck[baguette=brown]
-\end{tikzpicture}
+\end{tikzpicture}
\end{tcblisting}
\begin{tcblisting}{title={Cheese duck}}
\begin{tikzpicture}
\duck[cheese=orange]
-\end{tikzpicture}
+\end{tikzpicture}
\end{tcblisting}
\begin{tcblisting}{title={Milkshake duck}}
\begin{tikzpicture}
\duck[milkshake=red!20!white]
-\end{tikzpicture}
+\end{tikzpicture}
\end{tcblisting}
-\addtocounter{footnote}{1}
-\begin{tcblisting}{title={Wine duck$^{\thefootnote}$}}
+\begin{tcblisting}{title={Wine duck\footnote{According to the resident Italian wine expert of the \href{https://chat.stackexchange.com/transcript/message/40103109}{ TeX.SE chatroom}, the duck is drinking a fine Brunello di Montalcino}}}
\begin{tikzpicture}
\duck[wine=red!70!black]
\end{tikzpicture}
\end{tcblisting}
-\footnotetext[\thefootnote]{According to the resident Italian wine expert of the \href{https://chat.stackexchange.com/transcript/message/40103109}{ TeX.SE chatroom}, the duck is drinking a fine Brunello di Montalcino}
\begin{tcblisting}{title={Cocktail duck}}
\begin{tikzpicture}
\duck[cocktail]
-\end{tikzpicture}
+\end{tikzpicture}
\end{tcblisting}
-\addtocounter{footnote}{1}
-\begin{tcblisting}{title={Banana duck$^{\thefootnote}$}}
+\begin{tcblisting}{title={Banana duck\footnote{The banana and the stick were kindly contributed by @NuzzleTOO}}}
\begin{tikzpicture}
\duck[banana=yellow!80!orange]
\end{tikzpicture}
\end{tcblisting}
-\begin{tcblisting}{title={Stick duck$^{\thefootnote}$}}
+\begin{tcblisting}{title={Stick duck\footnotemark[\thefootnote]}}
\begin{tikzpicture}
\duck[stick=red!60!green,leaf=green!70!red]
\end{tikzpicture}
\end{tcblisting}
-\footnotetext[\thefootnote]{The banana and the stick were kindly contributed by @NuzzleTOO}
-\addtocounter{footnote}{1}
-\begin{tcblisting}{title={Basket duck$^{\thefootnote}$}}
+\begin{tcblisting}{title={Basket duck\footnote{The basket and Easter basket was kindly contributed by Benito van der Zander}}}
\begin{tikzpicture}
\duck[basket=brown]
\end{tikzpicture}
\end{tcblisting}
-\begin{tcblisting}{title={Easter duck$^{\thefootnote}$}}
+\begin{tcblisting}{title={Easter duck\footnotemark[\thefootnote]}}
\begin{tikzpicture}
\duck[bunny,easter]
\end{tikzpicture}
@@ -825,7 +800,6 @@ There is a multitude of things a duck might need. The following examples all als
eggb=orange,eggc=teal]
\end{tikzpicture}
\end{tcblisting}
-\footnotetext[\thefootnote]{The basket and Easter basket was kindly contributed by Benito van der Zander}
\begin{tcblisting}{title={Wing duck}}
\begin{tikzpicture}
@@ -853,38 +827,19 @@ There is a multitude of things a duck might need. The following examples all als
\end{tikzpicture}
\end{tcblisting}
-\addtocounter{footnote}{1}
-\begin{tcblisting}{title={Snow Duck$^{\thefootnote}$}}
+\begin{tcblisting}{title={Snow Duck\footnote{The snowduck is dedicated to all Japanese \TeX\ users}}}
\begin{tikzpicture}
\duck[snowduck=white]
-\end{tikzpicture}
-\end{tcblisting}
-\footnotetext[\thefootnote]{The snowduck is dedicated to all Japanese \TeX\ users}
-
-\begin{tcblisting}{title={Vampire Duck}}
-\begin{tikzpicture}
- \duck[vampire=white]
-\end{tikzpicture}
-\begin{tikzpicture}
- \duck[laughing, vampire=white]
-\end{tikzpicture}
-\end{tcblisting}
-
-\addtocounter{footnote}{1}
-\begin{tcblisting}{title={Fortune Quacker$^{\thefootnote}$}}
-\begin{tikzpicture}
- \duck[crystalball=cyan]
-\end{tikzpicture}
+\end{tikzpicture}
\end{tcblisting}
-\footnotetext[\thefootnote]{The crystal ball is kindly contributed by @marmot}
\begin{tcblisting}{title={Shovelling Duck}}
\begin{tikzpicture}
\duck[shovel=gray]
-\end{tikzpicture}
+\end{tikzpicture}
\begin{tikzpicture}
\duck[pickaxe=gray]
-\end{tikzpicture}
+\end{tikzpicture}
\end{tcblisting}
\begin{tcblisting}{title={Sweeping Duck}}
@@ -892,34 +847,46 @@ There is a multitude of things a duck might need. The following examples all als
\duck[strawbroom=brown!50!white,
strawbroomstick=brown,
strawbroomribbon=red!50!black]
-\end{tikzpicture}
+\end{tikzpicture}
\begin{tikzpicture}
- \duck[broom=brown,
- broomstick=gray!50!black]
-\end{tikzpicture}
+ \duck[broom=brown, broomstick=gray!50!black]
+\end{tikzpicture}
\end{tcblisting}
\begin{tcblisting}{title={Umbrella Duck}}
\begin{tikzpicture}
\duck[umbrella=cyan]
-\end{tikzpicture}
+\end{tikzpicture}
\begin{tikzpicture}
\duck[umbrellaclosed=cyan]
-\end{tikzpicture}
+\end{tikzpicture}
\end{tcblisting}
-\addtocounter{footnote}{1}
-\begin{tcblisting}{title={Overleaf Duck$^{\thefootnote}$}}
+\begin{tcblisting}{title={Fortune Quacker\footnote{The crystal ball is kindly contributed by @marmot}}}
\begin{tikzpicture}
- \duck[overleaf]
-\end{tikzpicture}
+ \duck[crystalball=cyan]
+\end{tikzpicture}
\end{tcblisting}
-\footnotetext[\thefootnote]{added to celebrate that \tikzducks are now also available on overleaf, see \url{https://www.overleaf.com/blog/tex-live-upgrade-september-2019}}
\begin{tcblisting}{title={Handbag Duck}}
\begin{tikzpicture}
\duck[handbag=red!70!black]
-\end{tikzpicture}
+\end{tikzpicture}
+\end{tcblisting}
+
+\begin{tcblisting}{title={Vampire Duck}}
+\begin{tikzpicture}
+ \duck[vampire=white]
+\end{tikzpicture}
+\begin{tikzpicture}
+ \duck[laughing, vampire=white]
+\end{tikzpicture}
+\end{tcblisting}
+
+\begin{tcblisting}{title={Overleaf Duck\footnote{added to celebrate that \tikzducks are now also available on overleaf, see \url{https://www.overleaf.com/blog/tex-live-upgrade-september-2019}}}}
+\begin{tikzpicture}
+ \duck[overleaf]
+\end{tikzpicture}
\end{tcblisting}
\section{Random ducks}
@@ -932,7 +899,7 @@ With all these available accessories it might be hard to decide which one to cho
\end{tikzpicture}
\end{tcblisting}
-In case the duck should not be completely random, but only some of the random elements are desired, these can be accessed independently by using \saminline|\randomhead| and \saminline|\randomaccessories| for a random headpiece and a random accessories, respectively. Small caveat: Before using \saminline|\randomhead| or \saminline|\randomaccessories|, \saminline|\shuffleducks| has to be used to provide the random items (for \saminline|\randuck| this is done automatically).
+In case the duck should not be completely random, but only some of the random elements are desired, these can be accessed independently by using \saminline|\randomhead| and \saminline|\randomaccessories| for a random headpiece and a random accessories, respectively. Small caveat: Before using \saminline|\randomhead| or \saminline|\randomaccessories|, \saminline|\shuffleducks| has to be used to provide the random items (for \saminline|\randuck| this is done automatically).
\begin{tcblisting}{title={Random head gear and accessories}}
\begin{tikzpicture}
@@ -965,8 +932,8 @@ For convenience the more complex paths of this package are stored in macros, whi
\begin{tikzpicture}
\duck
\path[preaction={fill, red!50!black},
- pattern=fivepointed stars,
- pattern color=yellow]
+ pattern=fivepointed stars,
+ pattern color=yellow]
\duckpathlonghair;
\end{tikzpicture}
\end{tcblisting}
@@ -975,15 +942,15 @@ In detail, the following paths are available:
\begin{samcode}
\duckpathbody, \duckpathgrumpybill, \duckpathbill, \duckpathtshirt,
-\duckpathjacket,\duckpathcape, \duckpathshorthair, \duckpathlonghair,
-\duckpathcrazyhair, \duckpathrecedinghair, \duckpathcrown,
-\duckpathmohican, \duckpathmullet, \duckpathqueencrown,
+\duckpathjacket,\duckpathcape, \duckpathshorthair, \duckpathlonghair,
+\duckpathcrazyhair, \duckpathrecedinghair, \duckpathcrown,
+\duckpathmohican, \duckpathmullet, \duckpathqueencrown,
\duckpathkingcrown, \duckpathdarthvader, \duckpathhorsetail
\end{samcode}
In case one of the other shapes is needed, please have a look at the package source code, which can be found in \saminline|tikzducks.sty|.
-To ease the placement of further accessories, some particular spots of the duck are marked with \TikZ coordinates, namely the \saminline|wing|, \saminline|head|, \saminline|bill| and \saminline|tail|.
+To ease the placement of further accessories, some particular spots of the duck are marked with \TikZ coordinates, namely the \saminline|wing|, \saminline|head|, \saminline|bill| and \saminline|tail|.
{
\footnotesize\ttfamily
@@ -1010,18 +977,22 @@ To distinguish coordinates from multiple ducks in the same \saminline|tikzpictur
\duck[name=bar,xshift=90pt,
scale=.3,yshift=150pt]
\draw (foo-wing) -- (bar-wing);
-\end{tikzpicture}
+\end{tikzpicture}
\end{tcblisting}
-Sometimes it might desirable to add things at a specific z-position, for example re-draw a t-shirt with some pattern that should be below the duck's hair and accessories. To facilitate this the \tikzducks provide a couple of hooks: \saminline|\duckhookbackground|, \saminline|\duckhookbody|, \saminline|\duckhookclothing|, \saminline|\duckhookhair|, \saminline|\duckhookhat| and \saminline|\duckhookforeground|.
+Sometimes it might desirable to add things at a specific z-position, for example re-draw a t-shirt with some pattern that should be below the duck's hair and accessories. To facilitate this the \tikzducks provide a couple of hooks:
+
+\begin{samcode}
+\duckhookbackground, \duckhookbody, \duckhookclothing, \duckhookhair, \duckhookhat, \duckhookforeground
+\end{samcode}
\begin{center}
-\footnotesize\ttfamily \textbackslash duckhook\dots
+\texttt{\textbackslash duckhook}\dots
- \begin{tikzpicture}
+ \begin{tikzpicture}[scale=1.59]
\newcommand{\planes}{\fill[gray!20!white,opacity=0.9] (-0.1,-0.1) rectangle (2.4,2.4);}
\newcommand{\hooks}{\draw[themecolor, rounded corners=3pt, line width=1pt] (-0.1,-0.1) rectangle (2.4,2.4);}
- \node[font=\footnotesize\ttfamily] at (-0.8,-1.4) {\strut background};
+ \node[font=\ttfamily] at (-0.8,-1.4) {\strut background};
\begin{scope}[canvas is zy plane at x=0]
\hooks
\end{scope}
@@ -1029,15 +1000,15 @@ Sometimes it might desirable to add things at a specific z-position, for example
\planes
\duck
\end{scope}
- \node[font=\footnotesize\ttfamily] at (0.8,-1.4) {\strut body};
+ \node[font=\ttfamily] at (0.8,-1.4) {\strut body};
\begin{scope}[canvas is zy plane at x=1.6]
\hooks
\end{scope}
\begin{scope}[canvas is zy plane at x=2.4]
\planes
- \duck[invisible,jacket=black!50!gray]
+ \duck[invisible,jacket=black!50!gray]
\end{scope}
- \node[font=\footnotesize\ttfamily] at (2.4,-1.4) {\strut clothing};
+ \node[font=\ttfamily] at (2.4,-1.4) {\strut clothing};
\begin{scope}[canvas is zy plane at x=3.2]
\hooks
\end{scope}
@@ -1045,7 +1016,7 @@ Sometimes it might desirable to add things at a specific z-position, for example
\planes
\duck[invisible,longhair=red!80!black]
\end{scope}
- \node[font=\footnotesize\ttfamily] at (4.0,-1.4) {\strut hair};
+ \node[font=\ttfamily] at (4.0,-1.4) {\strut hair};
\begin{scope}[canvas is zy plane at x=4.8]
\hooks
\end{scope}
@@ -1053,7 +1024,7 @@ Sometimes it might desirable to add things at a specific z-position, for example
\planes
\duck[invisible,witch=black!50!gray];
\end{scope}
- \node[font=\footnotesize\ttfamily] at (5.6,-1.4) {\strut hat};
+ \node[font=\ttfamily] at (5.6,-1.4) {\strut hat};
\begin{scope}[canvas is zy plane at x=6.4]
\hooks
\end{scope}
@@ -1061,7 +1032,7 @@ Sometimes it might desirable to add things at a specific z-position, for example
\planes
\duck[invisible,magicwand]
\end{scope}
- \node[font=\footnotesize\ttfamily] at (7.2,-1.4) {\strut foreground};
+ \node[font=\ttfamily] at (7.2,-1.4) {\strut foreground};
\begin{scope}[canvas is zy plane at x=8.0]
\hooks
\end{scope}
@@ -1074,8 +1045,8 @@ These hooks can be defined by the user as needed:
\begin{tikzpicture}
\begingroup
\newcommand{\duckhookclothing}{
- \path[pattern=fivepointed stars,
- pattern color=yellow]
+ \path[pattern=fivepointed stars,
+ pattern color=yellow]
\duckpathjacket;
}
\duck[witch=black!50!gray,
@@ -1083,17 +1054,15 @@ These hooks can be defined by the user as needed:
jacket=black!50!gray,
magicwand]
\endgroup
-\end{tikzpicture}
+\end{tikzpicture}
\end{tcblisting}
-\clearpage
\section{Football ducks -- contributed by Carla Maggi}
\label{sec:footballducks}
\tikzducks are huge sports fans! They do a lot of different sports themselves (see all the piece of sports equipment amongst the accessories), but to cheer their favourite teams, they need suitable fan clothing. In \href{https://tex.stackexchange.com/a/387126/36296}{The Duck Pond} Carla Maggi was so kind to contribute the necessary code to dress the ducks in their team's colours.
-\addtocounter{footnote}{1}
-A (non-representative) survey$^{\thefootnote}$\footnotetext[\thefootnote]{see the selection of jerseys in \url{https://tex.stackexchange.com/a/387126/36296}} showed that most sports jerseys can be emulated by drawing stripes of various colours, sizes and orientations -- and this is exactly what the \saminline|stripes| macro does, drawing stripes across the shape of the duck's jacket. In order to preserve the whole flexibility of this powerful macro, it was integrated as an independent command into the \tikzducks package, this means it can simply be used on top of a drawn duck:
+A (non-representative) survey\footnote{see the selection of jerseys in \url{https://tex.stackexchange.com/a/387126/36296}} showed that most sports jerseys can be emulated by drawing stripes of various colours, sizes and orientations -- and this is exactly what the \saminline|stripes| macro does, drawing stripes across the shape of the duck's jacket. In order to preserve the whole flexibility of this powerful macro, it was integrated as an independent command into the \tikzducks package, this means it can simply be used on top of a drawn duck:
\begin{tcblisting}{title={\texttt{stripes} macro}}
\begin{tikzpicture}
@@ -1112,17 +1081,18 @@ This may be impractical as the stripes are drawn on top of any accessories or ha
Not all teams wear vertically stripped jerseys, therefore many parameters can be adjusted to best emulate your favourite teams jerseys. The available options are:
+\nopagebreak[4]
\begin{tabular}{@{}ll@{}}
- \saminline|color| & colour of the stripes, default:
+ \saminline|color| & colour of the stripes, default:
\saminline|black| \\
- \saminline|distance| & periodicity length of the stripes, default:
+ \saminline|distance| & periodicity length of the stripes, default:
\saminline|0.3| \\
- \saminline|width| & stripe width, default: \saminline|0.15| \\
- \saminline|height| & length of the stripes, default:
+ \saminline|width| & stripe width, default: \saminline|0.15| \\
+ \saminline|height| & length of the stripes, default:
\saminline|2.7| \\
- \saminline|initialx| & x coordinate of staring point, default:
+ \saminline|initialx| & x coordinate of staring point, default:
\saminline|0.1| \\
- \saminline|initialy| & y coordinate of staring point, default:
+ \saminline|initialy| & y coordinate of staring point, default:
\saminline|-0.3| \\
\saminline|rotate| & rotation angle in degree, default:
\saminline|-10|\\
@@ -1146,7 +1116,7 @@ Please note that the colour of the stripes only affects the stripes themselves,
\duck[stripes={\stripes[width=0.03]}]
\end{tikzpicture}
-\begin{tikzpicture}
+\begin{tikzpicture}
\duck[stripes={\stripes[emblem={
\includegraphics[width=.3cm]{example-image-a}
}]}]
@@ -1172,10 +1142,10 @@ Please note that the colour of the stripes only affects the stripes themselves,
For more complex or multicoloured designs the stripes can easily be stacked on top of each other:
\begin{tcblisting}{title={multicoloured \texttt{stripes}}}
-\begin{tikzpicture}
+\begin{tikzpicture}
\duck[tshirt=red, stripes={
\stripes[color=yellow, width=0.1]
- \stripes[color=orange, width=0.1,
+ \stripes[color=orange, width=0.1,
initialx=0.0]}]
\end{tikzpicture}
\end{tcblisting}
@@ -1191,7 +1161,7 @@ A few examples to see \saminline|stripes| in action:
\end{tcblisting}
\begin{tcblisting}{title={Juve duck}}
-\begin{tikzpicture}
+\begin{tikzpicture}
\duck[tshirt=black,
stripes={\stripes[color=white]},
football]
@@ -1208,7 +1178,7 @@ A few examples to see \saminline|stripes| in action:
\begin{tcblisting}{title={M\"{o}nchengladbach duck}}
\definecolor{mggreen}{RGB}{37,166,89}%
-\begin{tikzpicture}
+\begin{tikzpicture}
\duck[tshirt=mggreen,
stripes={\stripes},football]
\end{tikzpicture}
@@ -1216,31 +1186,31 @@ A few examples to see \saminline|stripes| in action:
\begin{tcblisting}{title={Palmeiras duck}}
\definecolor{verdep}{RGB}{0,100,55}%
-\begin{tikzpicture}
- \duck[tshirt=green,jacket=verdep,football]
+\begin{tikzpicture}
+ \duck[tshirt=green,jacket=verdep,football]
\end{tikzpicture}
\end{tcblisting}
\begin{tcblisting}{title={Cagliari duck}}
\definecolor{rossocagliari}{RGB}{149,20,38}%
\definecolor{blucagliari}{RGB}{23,52,84}%
-\begin{tikzpicture}
- \duck[tshirt=white,
+\begin{tikzpicture}
+ \duck[tshirt=white,
jacket=blucagliari,
stripes={
- \stripes[color=rossocagliari,
+ \stripes[color=rossocagliari,
width=0.46, distance=3]},
football]
\end{tikzpicture}
\end{tcblisting}
\begin{tcblisting}{title={Sampdoria duck}}
-\begin{tikzpicture}
+\begin{tikzpicture}
\duck[tshirt=blue, jacket=blue,stripes={
\stripes[color=white,rotate=-90,
- width=0.6,distance=1]
+ width=0.6,distance=1]
\stripes[color=red,rotate=-90,
- width=0.2,distance=1.2]
+ width=0.2,distance=1.2]
\stripes[color=black,rotate=-90,
width=0.1,distance=1.3]
},football]
@@ -1248,13 +1218,13 @@ A few examples to see \saminline|stripes| in action:
\end{tcblisting}
\begin{tcblisting}{title={Brescia duck}}
-\begin{tikzpicture}
+\begin{tikzpicture}
\duck[tshirt=blue, jacket=blue,stripes={
- \stripes[color=white, rotate=-70,
- width=0.22,distance=1.1,
+ \stripes[color=white, rotate=-70,
+ width=0.22,distance=1.1,
initialy=0.01]
- \stripes[color=white, rotate=40,
- width=0.2, distance=1.8,
+ \stripes[color=white, rotate=40,
+ width=0.2, distance=1.8,
initialy=1.0,initialx=0.285]
},football]
\end{tikzpicture}
@@ -1262,7 +1232,7 @@ A few examples to see \saminline|stripes| in action:
\section{Examples}
-To see more examples of what can be done with the \tikzducks, you are invited to visit \url{https://github.com/samcarter/tikzducks}.
+To see more examples of what can be done with the \tikzducks, you are invited to visit \url{https://github.com/samcarter/tikzducks}.
If you have created a duck you would like to share with the community, I would be happy to add it to this collection, just make a pull request or open an issue in the bug tracking system.
diff --git a/graphics/pgf/contrib/tikzducks/tikzducks.sty b/graphics/pgf/contrib/tikzducks/tikzducks.sty
index 3a6f5b584e..786b0e269a 100644
--- a/graphics/pgf/contrib/tikzducks/tikzducks.sty
+++ b/graphics/pgf/contrib/tikzducks/tikzducks.sty
@@ -12,7 +12,7 @@
% See http://www.latex-project.org/lppl.txt
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\ProvidesPackage{tikzducks}[2024/04/19 version v1.7 Draw rubber ducks in TikZ]
+\ProvidesPackage{tikzducks}[2024/04/27 version v1.8 Draw rubber ducks in TikZ]
\RequirePackage{expl3}
\RequirePackage{tikz}
diff --git a/graphics/pgf/contrib/tkz-grapheur/README.md b/graphics/pgf/contrib/tkz-grapheur/README.md
new file mode 100644
index 0000000000..2a9d4e1e95
--- /dev/null
+++ b/graphics/pgf/contrib/tkz-grapheur/README.md
@@ -0,0 +1,7 @@
+tkz-grapheur is a package to work with curves, with TikZ.
+--------------------------------------------------------------------------------
+tkz-grapheur un package spécifique pour travailler avec des courbes, en TikZ.
+--------------------------------------------------------------------------------
+Author : Cédric Pierquet
+email : cpierquet@outlook.fr
+Licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt \ No newline at end of file
diff --git a/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-fr.pdf b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-fr.pdf
new file mode 100644
index 0000000000..ea4b8ad3fb
--- /dev/null
+++ b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-fr.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-fr.tex b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-fr.tex
new file mode 100644
index 0000000000..750dbc16bd
--- /dev/null
+++ b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-fr.tex
@@ -0,0 +1,1535 @@
+% !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{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.1}
+\def\TPdate{28/05/2024}
+\usepackage{soul}
+\usepackage{codehigh}
+\usepackage{tabularray}
+\sethlcolor{lightgray!25}
+\NewDocumentCommand\MontreCode{ m }{%
+ \hl{\vphantom{\texttt{pf}}\texttt{#1}}%
+}
+\usepackage[french]{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 [fr]}}\\
+ \\
+ {\LARGE Un système de grapheur, basé sur \TikZ.}\\
+ \\
+ {\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{GraphiqueTikz}[x=0.85cm,y=0.35cm,Xmin=0,Xmax=10,Ymin=0,Ymax=16]
+ %préparation de la fenêtre
+ \TracerAxesGrilles[Elargir=2.5mm,Police=\small]{0,1,...,10}{0,2,...,16}
+ %déf des fonctions avec nom courbe + nom fonction + expression
+ \DefinirCourbe[Nom=cf]<f>{3*x-6}
+ \DefinirCourbe[Nom=cg]<g>{-(x-6)^2+12}
+ %antécédents et intersection
+ \TrouverIntersections[Aff=false,Nom=K]{cf}{cg}
+ \TrouverAntecedents[AffDroite,Couleur=orange,Nom=I]{cg}{8}
+ \TrouverAntecedents[Aff=false,Nom=J]{cg}{0}
+ %intégrale sous une courbe, avec intersection
+ \TracerIntegrale%
+ [Couleurs=blue/purple,Bornes=noeuds,Style=hachures,Hachures=bricks]%
+ {g(x)}%
+ {(I-2)}{(J-2)}
+ %intégrale entre les deux courbes
+ \TracerIntegrale[Bornes=noeuds,Type=fct/fct]{f(x)}[g(x)]{(K-1)}{(K-2)}
+ %tracé des courbes et des points
+ \TracerCourbe[Couleur=red]{f(x)}
+ \TracerCourbe[Couleur=teal]{g(x)}
+ \PlacerPoints<\small>{(K-1)/below right/L,(K-2)/above left/M}%
+ \PlacerPoints[violet]<\small>{(I-1)/above left/D,(I-2)/above right/E}%
+ %essai de tangente
+ \TracerTangente[Couleurs=pink!75!black/yellow,kl=2,kr=2,AffPoint]{g}{5}
+ %essai d'image
+ \PlacerImages[Couleurs=cyan]{g}{7,7.25,7.5}
+ %surimpression des axes
+ \TracerAxesGrilles[Grads=false,Grille=false,Elargir=2.5mm]{0,1,...,10}{0,2,...,16}
+\end{GraphiqueTikz}
+\end{tcolorbox}
+
+\vspace*{5mm}
+
+\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5,halign=center]
+\begin{GraphiqueTikz}%
+ [x=3.5cm,y=4cm,
+ Xmin=0,Xmax=3.5,Xgrille=pi/12,Xgrilles=pi/24,
+ Ymin=-1.05,Ymax=1.05,Ygrille=0.2,Ygrilles=0.05]
+ %préparation de la fenêtre
+ \TracerAxesGrilles[Grads=false,Elargir=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
+ \RajouterValeursAxeX{0.25,1.4,3.3}{\num{0.25},\num{1.4},\num{3.3}}
+ %fonction trigo (déf + tracé)
+ \DefinirCourbe[Nom=ccos,Debut=0,Fin=pi]<fcos>{cos(x)}
+ \DefinirCourbe[Nom=csin,Debut=0,Fin=pi]<fsin>{sin(x)}
+ %intégrale
+ \TrouverIntersections[Aff=false,Nom=JKL]{ccos}{csin}
+ %\DefinirPts{FIN/pi/0}
+ \TracerIntegrale%
+ [Bornes=noeud/abs,Type=fct/fct,Couleurs=cyan/cyan!50]%
+ {fsin(x)}[fcos(x)]%
+ {(JKL-1)}{pi}
+ %tracé des courbes
+ \TracerCourbe[Couleur=red,Debut=0,Fin=pi]{fcos(x)}
+ \TracerCourbe[Couleur=olive,Debut=0,Fin=pi]{fsin(x)}
+ %antécédent(s)
+ \PlacerAntecedents[Couleurs=blue/teal!50!black,Traits]{ccos}{-0.25}
+ \PlacerAntecedents[Couleurs=red/magenta!50!black,Traits]{csin}{0.5}
+ \PlacerAntecedents[Couleurs=orange/orange!50!black,Traits]{csin}{sqrt(2)/2}
+ \PlacerAntecedents[Couleurs=green!50!black/green,Traits]{csin}{sqrt(3)/2}
+ %surimpression axes
+ \TracerAxesGrilles[Grille=false,Elargir=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{GraphiqueTikz}
+\end{tcolorbox}
+
+\vfill
+
+
+\vspace*{5mm}
+
+\pagebreak
+
+\phantomsection
+
+\hypertarget{matoc}{}
+
+\tableofcontents
+
+\vspace*{5mm}
+
+\hrule
+
+\vspace*{5mm}
+
+\pagebreak
+
+\section{Introduction}
+
+\subsection{Description et idées générales}
+
+Avec ce modeste package, loin des capacités offertes par exemple par les excellents packages \MontreCode{tkz-*}\footnote{par exemple tkz-base \url{https://ctan.org/pkg/tkz-base} et tkz-fct \url{https://ctan.org/pkg/tkz-fct}.} (d'Alain Matthes) ou \MontreCode{tzplot}\footnote{CTAN : \url{https://ctan.org/pkg/tzplot}.} (de In-Sung Cho), il est possible de travailler sur des graphiques de fonctions, en langage \TikZ, de manière \textit{intuitive} et \textit{explicite}.
+
+\smallskip
+
+Concernant le fonctionnement global :
+
+\smallskip
+
+\begin{itemize}
+ \item des styles particuliers pour les objets utilisés ont été définis, mais ils peuvent localement être modifiés ;
+ \item le nom des commandes est sous forme \textit{opérationnelle}, de sorte que la construction des éléments graphiques a une forme quasi \textit{algorithmique}.
+\end{itemize}
+
+\subsection{Fonctionnement global}
+
+Pour schématiser, il \textit{suffit} :
+
+\smallskip
+
+\begin{itemize}
+ \item de déclarer les paramètres de la fenêtre graphique ;
+ \item d'afficher grille/axes/graduations ;
+ \item de déclarer les fonctions ou les courbes d'interpolation ;
+ \item de déclarer éventuellement des points particuliers ;
+ \item de placer un nuage de points.
+\end{itemize}
+
+\smallskip
+
+Il sera ensuite possible :
+
+\begin{itemize}
+ \item de tracer des courbes ;
+ \item de déterminer graphiquement des images ou des antécédents ;
+ \item de rajouter des éléments de dérivation (tangentes) ou d'intégration (domaine) ;
+ \item de tracer une droite d'ajustement linéaire.
+\end{itemize}
+
+\subsection{Packages utilisés, et options du package}
+
+Le package utilise :
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{tikz}, avec les librairies \MontreCode{calc,intersections,patterns,patterns.meta} ;
+ \item \MontreCode{simplekv} ;
+ \item \MontreCode{xintexpr} ;
+ \item \MontreCode{xstring} ;
+ \item \MontreCode{listofitems}.
+\end{itemize}
+
+\smallskip
+
+Le package charge également \MontreCode{siunitx} avec les options classiques \texttt{[fr]}, mais il est possible de ne pas le charger en utilisant l'option \MontreCode{[nonsiunitx]}.
+
+\smallskip
+
+Le package charge également la librairie \TikZ\ \MontreCode{babel}, mais il est possible de ne pas le charger en utilisant l'option \MontreCode{[nontikzbabel]}.
+
+\smallskip
+
+Les différentes options sont bien évidemment cumulables.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%chargement par défaut
+\usepackage{tkz-grapheur}
+
+%chargement sans sinuitx, à charger manuellement
+\usepackage[nonsiunitx]{tkz-grapheur}
+
+%chargement sans tikz.babel
+\usepackage[nontikzbabel]{tkz-grapheur}
+\end{tcblisting}
+
+\pagebreak
+
+À noter également que certaines commandes peuvent utiliser des packages comme \MontreCode{nicefrac}, qui sera donc à charger le cas échéant.
+
+\smallskip
+
+Concernant la partie \textit{calculs} et \textit{tracés}, c'est le package \MontreCode{xint} qui s'en occupe.
+
+\subsection{Avertissements}
+
+Il est possible, dû aux calculs (multiples) effectués en interne, que le temps de compilation soir un peu \textit{allongé}.
+
+\smallskip
+
+La précision des résultats (de détermination) semble être aux environs de $10^{-4}$, ce qui devrait normalement garantir des tracés et lectures \textit{satisfaisantes}. Il est quand même conseillé d'être prudent quant aux résultats obtenus et ceux attendus.
+
+\subsection{Exemple introductif}
+
+On peut par exemple partir de l'exemple suivant, pour \textit{illustrer} le cheminement des commandes de ce package. Les commandes et la syntaxe seront détaillées dans les sections suivantes !
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=7.5cm,y=7.5cm,Xmin=0,Xmax=1.001,Xgrille=0.1,Xgrilles=0.02,
+ Ymin=0,Ymax=1.001,Ygrille=0.1,Ygrilles=0.02]
+ \TracerAxesGrilles[Elargir=2.5mm,Police=\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}
+ \DefinirCourbe[Nom=cf,Debut=0,Fin=1]<f>{x*exp(x-1)}
+ \DefinirCourbe[Nom=delta,Debut=0,Fin=1]<D>{x}
+ \TracerIntegrale[Type=fct/fct]{f(x)}[D(x)]{0}{1}
+ \TracerCourbe[Couleur=red]{f(x)}
+ \TracerCourbe[Couleur=teal]{D(x)}
+ \PlacerImages[Couleurs=blue/cyan,Traits]{f}{0.8,0.9}
+ \PlacerAntecedents[Couleurs=green!50!black/olive,Traits]{cf}{0.5}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\newpage
+
+\section{Styles de base et création de l'environnement}
+
+\subsection{Styles de base}
+
+Les styles utilisés pour les tracés sont donnés ci-dessous.
+
+\smallskip
+
+Dans une optique de \textit{simplicité}, seule la couleur des éléments peut être paramétrée, mais si l'utilisateur le souhaite, il peut redéfinir les styles proposés.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%paramètres déclarés et stockés (utilisables dans l'environnement 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,
+ Xgrille/.store in=\pflgrillex,Xgrille/.default=1,Xgrille=1,
+ Xgrilles/.store in=\pflgrillexs,Xgrilles/.default=0.5,Xgrilles=0.5,
+ Ygrille/.store in=\pflgrilley,Ygrille/.default=1,Ygrille=1,
+ Ygrilles/.store in=\pflgrilleys,Ygrilles/.default=0.5,Ygrilles=0.5
+}
+\end{tcblisting}
+
+On retrouve donc :
+
+\smallskip
+
+\begin{itemize}
+ \item l'origine du repère (\MontreCode{Origx}/\MontreCode{Origy}) ;
+ \item les valeurs extrêmes des axes (\MontreCode{Xmin}/\MontreCode{Xmax}/\MontreCode{Ymin}/\MontreCode{Ymax}) ;
+ \item les paramètres des grilles principales et secondaires (\MontreCode{Xgrille}/\MontreCode{Xgrilles}/\MontreCode{Ygrille}/\MontreCode{Ygrilles}).
+\end{itemize}
+
+\smallskip
+
+Concernant les styles des \textit{objets}, ils sont donnés ci-dessous.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%styles grilles/axes
+\tikzset{pflgrillep/.style={thin,lightgray}}
+\tikzset{pflgrilles/.style={very thin,lightgray}}
+\tikzset{pflaxes/.style={line width=0.8pt,->,>=latex}}
+
+%style des points (courbe / nuage)
+\tikzset{pflpoint/.style={line width=0.95pt}}
+\tikzset{pflpointc/.style={radius=1.75pt}}
+\tikzset{pflpointnuage/.style={radius=1.75pt}}
+
+%style des courbes
+\tikzset{pflcourbe/.style={line width=1.05pt}}
+
+%style des traits (normaux, antécédents, images)
+\tikzset{pfltrait/.style={line width=0.8pt}}
+\tikzset{pfltraitantec/.style={line width=0.95pt,densely dashed}}
+\tikzset{pfltraitimg/.style={line width=0.95pt,densely dashed,->,>=latex}}
+
+%style des flèches
+\tikzset{pflflecheg/.style={<-,>=latex}}
+\tikzset{pflfleched/.style={->,>=latex}}
+\tikzset{pflflechegd/.style={<->,>=latex}}
+\end{tcblisting}
+
+L'idée est donc de pouvoir redéfinir globalement ou localement les styles, et éventuellement de rajouter des éléments, en utilisant \mintinline{latex}|monstyle/.append style={...}|.
+
+\subsection{Création de l'environnement}\label{creaenvt}
+
+L'environnement proposé est basé sur \TikZ, de sorte que toute commande \textit{classique} liée à \TikZ\ peut être utilisée en marge des commandes du package !
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+\begin{GraphiqueTikz}[options tikz]<clés>
+ %code(s)
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+Les \MontreCode{[options tikz]} sont les options \textit{classiques} qui peuvent être passées à un environnement \TikZ, ainsi que les clés des \textsf{axes/grilles/fenêtre} présentées précédemment.
+
+\smallskip
+
+Les \MontreCode{<clés>} spécifiques (et optionnelles) sont :
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{TailleGrad} : taille des graduations des axes (\MontreCode{3pt} pour 3pt \textit{dessus} et 3pt \textit{dessous}) ;
+ \item \MontreCode{AffCadre} : booléen (\MontreCode{false} par défaut) pour afficher un cadre qui délimite la fenêtre graphique (hors graduations éventuelles).
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}
+ [x=0.075cm,y=0.03cm,Xmin=0,Xmax=160,Xgrille=20,Xgrilles=10,
+ Origy=250,Ymin=250,Ymax=400,Ygrille=25,Ygrilles=5]
+ <AffCadre>
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrille=2,Ygrilles=1,Origy=40]
+ <AffCadre>
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+Ce sera bien évidemment plus parlant avec les éléments graphiques rajoutés !
+
+\pagebreak
+
+\subsection{Grilles et axes}\label{creaaxesgr}
+
+La première commande \textit{utile} va permettre de créer les grilles, les axes et les graduations.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%dans l'environnement GraphiqueTikz
+\TracerAxesGrille[clés]{gradX}{gradY}
+\end{tcblisting}
+
+Les \MontreCode{[clés]}, optionnelles, disponibles sont :
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Grille} : booléen (\MontreCode{true} par défaut) pour afficher les grilles (pour une grille unique, il suffit de mettre les paramètres identiques pour \MontreCode{Xgrille}/\MontreCode{Xgrilles} ou \MontreCode{Ygrille}/\MontreCode{Ygrilles}) ;
+ \item \MontreCode{Elargir} : rajout à la fin des axes (\MontreCode{0} par défaut) ;
+ \item \MontreCode{Grads} : booléen (\MontreCode{true} par défaut) pour les graduations ;
+ \item \MontreCode{Police} : police globale des graduations {\MontreCode{vide} par défaut} ;
+ \item \MontreCode{Format} : formatage particulier (voir en dessous) des valeurs des axes.
+\end{itemize}
+
+\smallskip
+
+Concernant la clé \MontreCode{Format}, elle permet de spécifier un paramétrage spécifique pour les valeurs des axes.
+
+\smallskip
+
+Elle peut être donnée sous la forme \MontreCode{fmt} pour un formatage combiné, ou sous la forme \MontreCode{fmtX/fmtY} pour différencier le formatage.
+
+\smallskip
+
+Les options possible sont :
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{num} : formater avec \textsf{siunitx} ;
+ \item \MontreCode{annee} : formater en année ;
+ \item \MontreCode{frac} : formater en fraction \textsf{frac} ;
+ \item \MontreCode{dfrac} : formater en fraction \textsf{dfrac} ;
+ \item \MontreCode{nfrac} : formater en fraction \textsf{nicefrac} ;\hfill(à charger !)
+ \item \MontreCode{trig} : formater en trigo avec \textsf{frac} ;
+ \item \MontreCode{dtrig} : formater en trigo avec \textsf{dfrac} ;
+ \item \MontreCode{ntrig} : formater en trigo avec \textsf{nfrac} ;
+ \item \MontreCode{sqrt} : formater en racine avec \textsf{frac} ;
+ \item \MontreCode{dsqrt} : formater en racine avec \textsf{dfrac} ;
+ \item \MontreCode{nsqrt} : formater en racine avec \textsf{nicefrac}.
+\end{itemize}
+
+\smallskip
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}
+ [x=0.075cm,y=0.03cm,Xmin=0,Xmax=160,Xgrille=20,Xgrilles=10,
+ Origy=250,Ymin=250,Ymax=400,Ygrille=25,Ygrilles=5]
+ \TracerAxesGrilles[Elargir=2.5mm,Police=\small]{0,10,...,160}{250,275,...,400}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrille=2,Ygrilles=1,Origy=40]
+ \TracerAxesGrilles[Elargir=2.5mm,Police=\small]{4,5,...,20}{40,42,...,56}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+À noter qu'il existe les clés booléennes \MontreCode{[Derriere]} (sans les graduations) et \MontreCode{[Devant]} (sans la grille) pour afficher les axes en mode \textit{sous/sur}-impression dans le cas d'intégrales par exemple.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=2.75cm,y=3cm,
+ Xmin=0,Xmax=3.5,Xgrille=pi/12,Xgrilles=pi/24,
+ Ymin=-1.05,Ymax=1.05,Ygrille=0.2,Ygrilles=0.05]
+ \TracerAxesGrilles[Elargir=2.5mm,Format=dtrig/nsqrt,Police=\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{GraphiqueTikz}
+\end{tcblisting}
+
+Dans le cas où le formatage ne donne pas de résultat(s) satisfaisant(s), il est possible d'utiliser une commande générique de placement des graduations.
+
+\pagebreak
+
+Dans le cas où les graduations sont \textit{naturellement} définies par les données de la fenêtre et de la grille (principale), il est possible de préciser \MontreCode{auto} dans les arguments obligatoires (dans ce cas le formatage ne sera pas possible, et \MontreCode{Format=num} sera obligatoirement utilisé).
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=1.5cm,y=6cm,Xmin=0,Xmax=7,Xgrille=0.5,Xgrilles=0.25,
+ Ymin=0,Ymax=1,Ygrille=0.1,Ygrilles=0.05]
+ \TracerAxesGrilles[Elargir=2.5mm,Dernier]{auto}{auto}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Ajout de valeurs manuellement}\label{ajoutvals}
+
+Il est également possible d'utiliser une commande spécifique pour placer des valeurs sur les axes, indépendamment d'un système \textit{automatisé} de formatage.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%dans l'environnement GraphiqueTikz
+\RajouterValeursAxeX[clés]{positions}{valeurs formatées}
+\RajouterValeursAxeY[clés]{positions}{valeurs formatées}
+\end{tcblisting}
+
+Les \MontreCode{[clés]}, optionnelles, disponibles sont :
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Police} : police globale des graduations {\MontreCode{vide} par défaut} ;
+ \item \MontreCode{Traits} : booléen pour ajouter les traits des graduations {\MontreCode{true} par défaut}.
+\end{itemize}
+
+\smallskip
+
+Les arguments obligatoires correspondent aux abscisses (en langage\TikZ) et aux labels (en langage \LaTeX) des graduations.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=2.75cm,y=3cm,
+ Xmin=0,Xmax=3.5,Xgrille=pi/12,Xgrilles=pi/24,
+ Ymin=-1.05,Ymax=1.05,Ygrille=0.2,Ygrilles=0.05]
+ \TracerAxesGrilles[Grad=false,Elargir=2.5mm,]{}{}
+ \RajouterValeursAxeX
+ {0.15,0.6,pi/2,2.8284}
+ {\num{0.15},$\frac35$,$\displaystyle\frac{\pi}{2}$,$\sqrt{8}$}
+ \RajouterValeursAxeY
+ {-1,0.175,0.3,sqrt(3)/2}
+ {\num{-1},\num{0.175},$\nicefrac{3}{10}$,$\frac{\sqrt{3}}{2}$}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\section{Commandes spécifiques de définitions}
+
+\subsection{Définir une fonction, tracer la courbe d'une fonction}\label{deftracfct}
+
+La première idée est de définir une fonction, pour réutilisation ultérieure. Cette commande \textit{crée} la fonction, sans la tracer, car dans certains cas des éléments devront être tracés au préalable.
+
+\smallskip
+
+Il existe également une commande pour tracer la courbe d'une fonction précédemment définie.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%dans l'environnement GraphiqueTikz
+\DefinirCourbe[clés]<nom fct>{formule xint}
+\TracerCourbe[clés]{formule xint}
+\end{tcblisting}
+
+Les \MontreCode{[clés]} pour la définition ou le tracé, optionnelles, disponibles sont :
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Debut} : borne inférieure de l'ensemble de définition (\MontreCode{\textbackslash pflxmin} par défaut) ;
+ \item \MontreCode{Fin} : borne inférieure de l'ensemble de définition (\MontreCode{\textbackslash pflxmax} par défaut) ;
+ \item \MontreCode{Nom} : = nom de la courbe (important pour la suite !) ;
+ \item \MontreCode{Couleur} : = couleur du tracé (\MontreCode{black} par défaut) ;
+ \item \MontreCode{Pas} : = pas du tracé (il est déterminé \textit{automatiquement} au départ mais peut être modifié) ;
+ \item \MontreCode{Trace} : booléen pour tracer également la courbe (\MontreCode{false} par défaut).
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrille=2,Ygrilles=1,Origy=40]
+ \TracerAxesGrilles[Elargir=2.5mm,Police=\small]{4,5,...,20}{40,42,...,56}
+ %définition de la fonction + tracé de la courbe
+ \DefinirCourbe[Nom=cf,Debut=5,Fin=19]<f>{-2*x+3+24*log(2*x)}
+ \TracerCourbe[Couleur=red,Debut=5,Fin=19]{f(x)}
+ %ou en une seule commande si "suffisant"
+ %\DefinirCourbe[Nom=cf,Debut=5,Fin=19,Trace]<f>{-2*x+3+24*log(2*x)}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Définir/tracer une courbe d'interpolation (simple)}\label{deftracinterpo}
+
+Il est également possible de définir une courbe via des points supports, donc une courbe d'interpolation simple.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%dans l'environnement GraphiqueTikz
+\DefinirCourbeInterpo[clés]{liste des points support}
+\TracerCourbeInterpo[clés]{liste des points support}
+\end{tcblisting}
+
+Les \MontreCode{[clés]} pour la définition ou le tracé, optionnelles, disponibles sont :
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Nom} : nom de la courbe d'interpolation (important pour la suite !) ;
+ \item \MontreCode{Couleur} : couleur du tracé (\MontreCode{black} par défaut) ;
+ \item \MontreCode{Tension} : paramétrage de la \textit{tension} du tracé d'interpolation (\MontreCode{0.5} par défaut) ;
+ \item \MontreCode{Trace} : booléen pour tracer également la courbe (\MontreCode{false} par défaut).
+\end{itemize}
+
+L'argument obligatoire permet quant à lui de spécifier la liste des points supports sous la forme \MontreCode{(x1,y1)(x2,y2)...}.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \TracerAxesGrilles[Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ %courbes d'interpolation simples (avec tension diff)
+ \DefinirCourbeInterpo[Nom=interpotest,Couleur=blue,Trace]%
+ {(-6,4)(-2,-2)(3,3.5)}
+ \DefinirCourbeInterpo[Nom=interpotest,Couleur=red,Trace,Tension=1]%
+ {(-6,4)(-2,-2)(3,3.5)}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\newpage
+
+\subsection{Définir/tracer une courbe d'interpolation (Hermite)}\label{deftracfctspline}
+
+Il est également possible de définir une courbe via des points supports, donc une courbe d'interpolation avec contrôle de la dérivée.
+
+\smallskip
+
+Certaines exploitations demandant des techniques différentes suivant le type de fonction utilisée, une clé booléenne \MontreCode{Spline} permettra au code d'adapter ses calculs suivant l'objet utilisé.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%dans l'environnement GraphiqueTikz
+\DefinirCourbeSpline[clés]{liste des points support}[\macronomspline]
+\TracerCourbeSpline[clés]{liste des points support}[\macronomspline]
+\end{tcblisting}
+
+Les \MontreCode{[clés]} pour la définition ou le tracé, optionnelles, disponibles sont :
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Nom} : = nom de la courbe d'interpolation (important pour la suite !) ;
+ \item \MontreCode{Coeffs} : modifier (voir la documentation de \textsf{ProfLycee}\footnote{CTAN : \url{https://ctan.org/pkg/proflycee}} les \textit{coefficients} du spline ;
+ \item \MontreCode{Couleur} : = couleur du tracé (\MontreCode{black} par défaut) ;
+ \item \MontreCode{Trace} : booléen pour tracer également la courbe (\MontreCode{false} par défaut).
+\end{itemize}
+
+L'argument obligatoire permet quant à lui de spécifier la liste des points supports sous la forme \MontreCode{x1/y1/f'1§x2/y2/f'2§...} avec :
+
+\begin{itemize}
+ \item \MontreCode{xi/yi} les coordonnées du point ;
+ \item \MontreCode{f'i} la dérivé au point support.
+\end{itemize}
+
+\smallskip
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \TracerAxesGrilles[Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ %définition de la liste des points support du spline
+ \def\LISTETEST{-6/4/-2§-5/2/-2§-4/0/-2§-2/-2/0§1/2/2§3/3.5/0.5}
+ %définition et tracé du spline cubique
+ \DefinirCourbeSpline[Nom=splinetest,Trace,Couleur=olive]{\LISTETEST}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Définir des points sous forme de nœuds}\label{defpts}
+
+La seconde idée est de travailler avec des nœuds \TikZ, qui pourront être utiles pour des tracés de tangentes, des représentations d'intégrales$\ldots$
+
+\smallskip
+
+Certaines commandes (explicités ultérieurement) permettent de déterminer des points particuliers des courbes sous forme de nœuds, donc il semble intéressant de pouvoir en définir directement.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%dans l'environnement GraphiqueTikz
+\DefinirPts[clés]{Nom1/x1/y1,Nom2/x2/y2,...}
+\end{tcblisting}
+
+Les \MontreCode{[clés]}, optionnelles, disponibles sont :
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Aff} : booléen pour marquer les points (\MontreCode{false} par défaut) ;
+ \item \MontreCode{Couleur} : couleur des points, si \MontreCode{Aff=true} (\MontreCode{black} par défaut).
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrille=2,Ygrilles=1,Origy=40]
+ \TracerAxesGrilles[Elargir=2.5mm,Police=\small]{4,5,...,20}{40,42,...,56}
+ %définition de la fonction + tracé de la courbe
+ \DefinirFonction[Nom=cf,Debut=5,Fin=19,Trace,Couleur=red]<f>{-2*x+3+24*log(2*x)}
+ %nœuds manuels
+ \DefinirPts[Aff,Couleur=brown]{A/7/42,B/16/49}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Marquage de points}\label{markpts}
+
+L'idée est de proposer de quoi marquer des points avec un style particulier.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%dans l'environnement GraphiqueTikz
+\MarquerPts(*)[clés]<police>{liste}
+\end{tcblisting}
+
+La version \textit{étoilée} marque les points sans les \og noms \fg, alors que la version \textit{non étoilée} les affiche :
+
+\begin{itemize}
+ \item dans le cas de la version \textit{étoilée}, la liste est à donner sous la forme \MontreCode{(ptA),(ptB),...} ;
+ \item sinon, la liste est à donner sous la forme \MontreCode{(ptA)/labelA/poslabelA,...}.
+\end{itemize}
+
+\smallskip
+
+Les \MontreCode{[clés]}, optionnelles, disponibles sont :
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Couleur} : couleur (\MontreCode{black} par défaut) ;
+ \item \MontreCode{Style} : style des marques (\MontreCode{o} par défaut).
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}[x=1.5cm,y=1.5cm]
+ \TracerAxesGrilles[Agrandir=2.5mm]{auto}{auto}
+ \DefinirPts{A/1.75,-1.25}\MarquerPts[Couleur=pink]{(A)/A/below} %rond (par défaut)
+ \MarquerPts[Couleur=teal]{(1,1)/M/below}
+ \MarquerPts[Couleur=red,Style=x]{(1.25,1)/$A$/below} %croix
+ \MarquerPts[Couleur=orange,Style=+]<\small\sffamily>{(1.5,1)/K/below} %plus
+ \MarquerPts[Couleur=blue,Style=c]{(1.75,1)/P/below} %carré
+ \MarquerPts[Couleur=gray,Style=d]{(2,1)/P/below} %diamant
+ \MarquerPts*[Couleur=orange/yellow]{(2,2),(2.5,2.25)} %rond bicolore
+ \MarquerPts*[Style=+,Couleur=red]{(1,2)}
+ \MarquerPts*[Style=x,Couleur=blue]{(2.25,1)}
+ \MarquerPts*[Style=c,Couleur=magenta]{(-2,-1)}
+ \MarquerPts[Couleur=red,Style=x]{(-1,1)/$A$/below,(-2,2)/$B$/below left}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Récupérer les coordonnées de nœuds}\label{recupcoordo}
+
+Il est également possible, dans l'optique d'une réutilisation de coordonnées, de récupérer les coordonnées d'un nœud (défini ou déterminé).
+
+\smallskip
+
+Les calculs étant effectués en flottant en fonction des unités (re)calculées, les valeurs sont donc approchées !
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%dans l'environnement GraphiqueTikz
+\RecupererAbscisse{nœud}[\macrox]
+\RecupererOrdonnee{nœud}[\macroy]
+\RecupererCoordonnees{nœud}[\macrox][\macroy]
+\end{tcblisting}
+
+\pagebreak
+
+\section{Commandes spécifiques d'exploitation des courbes}
+
+\subsection{Placement d'images}\label{images}
+
+Il est possible de la placer des points (images) sur une courbe, avec traits de construction éventuels.
+
+La fonction/courbe utilisée doit avoir été déclarée précédemment pour que cette commande fonctionne.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%dans l'environnement GraphiqueTikz
+\PlacerImages[clés]{fonction ou courbe}{liste d'abscisses}
+\end{tcblisting}
+
+Les \MontreCode{[clés]}, optionnelles, disponibles sont :
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Traits} : booléen pour afficher les traits de construction (\MontreCode{false} par défaut) ;
+ \item \MontreCode{Couleurs} : couleur des points/traits, sous la forme \MontreCode{Couleurs} ou \MontreCode{CouleurPoint/CouleurTraits} ;
+ \item \MontreCode{Spline} : booléen pour préciser que la courbe utilisée est définie comme un \textsf{spline} (\MontreCode{false} par défaut).
+\end{itemize}
+
+\smallskip
+
+Le premier argument obligatoire, permet de spécifier :
+
+\smallskip
+
+\begin{itemize}
+ \item le nom de la courbe dans la cas \MontreCode{Spline=true} ;
+ \item le nom de la fonction sinon.
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrille=2,Ygrilles=1,Origy=40]
+ \TracerAxesGrilles[Elargir=2.5mm,Police=\small]{4,5,...,20}{40,42,...,56}
+ %définition de la fonction + tracé de la courbe
+ \DefinirCourbe[Nom=cf,Debut=5,Fin=19,Trace,Couleur=red]<f>{-2*x+3+24*log(2*x)}
+ %images
+ \PlacerImages[Traits,Couleurs=teal/blue]{f}{6,7,8,9,10}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Détermination d'antécédents}\label{defanteced}
+
+Il est possible de déterminer graphiquement les antécédents d'un réel donné.
+
+La fonction/courbe utilisée doit avoir été déclarée précédemment pour que cette commande fonctionne.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%dans l'environnement GraphiqueTikz
+\TrouverAntecedents[clés]{courbe}{k}
+\end{tcblisting}
+
+Les \MontreCode{[clés]}, optionnelles, disponibles sont :
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Nom} : base du nom des \textbf{nœuds} intersection (\MontreCode{S} par défaut, ce qui donnera \textsf{S-1}, \textsf{S-2}, etc) ;
+ \item \MontreCode{Aff} : booleen pour afficher les points (\MontreCode{true} par défaut) ;
+ \item \MontreCode{Couleur} : couleur des points (\MontreCode{black} par défaut) ;
+ \item \MontreCode{AffDroite} : booleen pour afficher la droite horizontale (\MontreCode{false} par défaut).
+\end{itemize}
+
+\smallskip
+
+Le premier argument obligatoire, permet de spécifier le \textbf{nom} de la courbe.
+
+\smallskip
+
+Le second argument obligatoire, permet de spécifier la valeur à atteindre.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrille=2,Ygrilles=1,Origy=40]
+ \TracerAxesGrilles[Elargir=2.5mm,Police=\small]{4,5,...,20}{40,42,...,56}
+ %définition de la fonction + tracé de la courbe
+ \DefinirCourbe[Nom=cf,Debut=5,Fin=19,Trace,Couleur=red]<f>{-2*x+3+24*log(2*x)}
+ %antécédents
+ \TrouverAntecedents[Couleur=teal,AffDroite,Aff]{cf}{53}
+ %les deux antécédents sont aux nœuds (S-1) et (S-2)
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+%Les \MontreCode{[clés]}, optionnelles, disponibles sont :
+%
+%\smallskip
+%
+%\begin{itemize}
+% \item \MontreCode{Nom} : base du nom des \textbf{nœuds} intersection (\MontreCode{S} par défaut, ce qui donnera \textsf{S-1}, \textsf{S-2}, etc) ;
+% \item \MontreCode{Aff} : booleen pour afficher les points (\MontreCode{true} par défaut) ;
+% \item \MontreCode{Couleur} : couleur des points (\MontreCode{black} par défaut) ;
+% \item \MontreCode{AffDroite} : booleen pour afficher la droite horizontale (\MontreCode{false} par défaut).
+%\end{itemize}
+
+\pagebreak
+
+\subsection{Construction d'antécédents}\label{tracanteced}
+
+Il est possible de construire graphiquement les antécédents d'un réel donné.
+
+La fonction/courbe utilisée doit avoir été déclarée précédemment pour que cette commande fonctionne.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%dans l'environnement GraphiqueTikz
+\PlacerAntecedents[clés]{courbe}{k}
+\end{tcblisting}
+
+Les \MontreCode{[clés]}, optionnelles, disponibles sont :
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Couleurs} : couleur des points/traits, sous la forme \MontreCode{Couleurs} ou \MontreCode{CouleurPoint/CouleurTraits} ;
+ \item \MontreCode{Nom} : nom \textit{éventuel} pour les points d'intersection liés aux antécédents (\MontreCode{vide} par défaut) ;
+ \item \MontreCode{Traits} : booleen pour afficher les traits de construction (\MontreCode{false} par défaut).
+\end{itemize}
+
+\smallskip
+
+Le premier argument obligatoire, permet de spécifier le \textbf{nom} de la courbe.
+
+\smallskip
+
+Le second argument obligatoire, permet de spécifier la valeur à atteindre.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrille=2,Ygrilles=1,Origy=40]
+ \TracerAxesGrilles[Elargir=2.5mm,Police=\small]{4,5,...,20}{40,42,...,56}
+ %définition de la fonction + tracé de la courbe
+ \DefinirCourbe[Nom=cf,Debut=5,Fin=19,Trace,Couleur=red]<f>{-2*x+3+24*log(2*x)}
+ %antécédents
+ \PlacerAntecedents[Couleurs=teal/cyan,Traits,Nom=PO]{cf}{53}
+ \RecupererAbscisse{(PO-1)}[\premsol]
+ \RecupererAbscisse{(PO-2)}[\deuxsol]
+\end{GraphiqueTikz}
+
+Graphiquement, les antécédents de 53 sont (environ) :
+
+\begin{itemize}
+ \item \num{\premsol}
+ \item \num{\deuxsol}
+\end{itemize}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Intersections de deux courbes}\label{intersect}
+
+Il est également possible de déterminer (sous forme de nœuds) les éventuels points d'intersection de deux courbes préalablement définies.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%dans l'environnement GraphiqueTikz
+\TrouverIntersections[clés]{courbe1}{courbe2}
+\end{tcblisting}
+
+Les \MontreCode{[clés]}, optionnelles, disponibles sont :
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Nom} : base du nom des \textbf{nœuds} intersection (\MontreCode{S} par défaut, ce qui donnera \textsf{S-1}, \textsf{S-2}, etc) ;
+ \item \MontreCode{Aff} : booléen pour afficher les points (\MontreCode{true} par défaut) ;
+ \item \MontreCode{Couleur} : couleur des points (\MontreCode{black} par défaut).
+\end{itemize}
+
+\smallskip
+
+Le premier argument obligatoire, permet de spécifier le \textbf{nom} de la première courbe.
+
+\smallskip
+
+Le premier argument obligatoire, permet de spécifier le \textbf{nom} de la seconde courbe.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrille=2,Ygrilles=1,Origy=40]
+ \TracerAxesGrilles[Elargir=2.5mm,Police=\small]{4,5,...,20}{40,42,...,56}
+ \DefinirCourbe[Nom=cf,Debut=5,Fin=19,Trace,Couleur=red]<f>{-2*x+3+24*log(2*x)}
+ \DefinirCourbe[Nom=cg,Debut=5,Fin=19,Trace,Couleur=blue]<g>{0.25*(x-12)^2+46}
+ %intersections, nommées (TT-1) et (TT-2)
+ \TrouverIntersections[Nom=TT,Couleur=darkgray,Aff,Traits]{cf}{cg}
+ %récupération des points d'intersection
+ \RecupererCoordonnees{(TT-1)}[\alphaA][\betaA]
+ \RecupererCoordonnees{(TT-2)}[\alphaB][\betaB]
+\end{GraphiqueTikz}\\
+Les solutions de $f(x)=g(x)$ sont $\alpha \approx \num{\alphaA}$ et
+$\beta \approx \num{\alphaB}$.\\
+Les points d'intersection des courbes de $f$ et de $g$ sont donc
+$(\ArrondirNum[2]{\alphaA};\ArrondirNum[2]{\betaA})$ et
+$(\ArrondirNum[2]{\alphaB};\ArrondirNum[2]{\betaB})$.
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Intégrales (version améliorée)}\label{integr}
+
+On peut également travailler avec des intégrales.
+
+Dans ce cas il est préférable de mettre en évidence le domaine \textbf{avant} les tracés, pour éviter la surimpression par rapport aux courbes/points.
+
+\smallskip
+
+Il est possible de :
+
+\begin{itemize}
+ \item représenter une intégrale \textbf{sous} une courbe définie ;
+ \item représenter une intégrale \textbf{entre} deux courbes ;
+ \item les bornes d'intégration peuvent être des abscisses et/ou des nœuds.
+\end{itemize}
+
+\smallskip
+
+{\small\faBomb} Compte-tenu des différences de traitement entre les courbes par formule, les courbes par interpolation simple ou les courbes par interpolation cubique, les arguments et clés peuvent différer suivant la configuration !
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%dans l'environnement GraphiqueTikz
+\TracerIntegrale[clés]<options spécifiques>{objet1}[objet2]{A}{B}
+\end{tcblisting}
+
+Les \MontreCode{[clés]} pour la définition ou le tracé, optionnelles, disponibles sont :
+
+\begin{itemize}
+ \item \MontreCode{Couleurs} =: couleurs du remplissage, sous la forme \MontreCode{Couleur} ou \MontreCode{CouleurBord/CouleurFond} (\MontreCode{gray} par défaut) ;
+ \item \MontreCode{Style} : type de remplissage, parmi \MontreCode{remplissage}/\MontreCode{hachures} (\MontreCode{remplissage} par défaut) ;
+ \item \MontreCode{Opacite} : opacité (\MontreCode{0.5} par défaut) du remplissage ;
+ \item \MontreCode{Hachures} : style (\MontreCode{north west lines} par défaut) du remplissage hachures ;
+ \item \MontreCode{Type} : type d'intégrale parmi
+ \begin{itemize}
+ \item \MontreCode{fct} (défaut) pour une intégrale sous une courbe définie par une formule ;
+ \item \MontreCode{spl} pour une intégrale sous une courbe définie par un spline cublique ;
+ \item \MontreCode{fct/fct} pour une intégrale entre deux courbes définie par une formule ;
+ \item \MontreCode{fct/spl} pour une intégrale entre une courbe (dessus) définie par une formule et une courbe (dessous) définie par un spline cubique ;
+ \item etc
+ \end{itemize}
+ \item \MontreCode{Pas} : pas (calculé par défaut sinon) pour le tracé ;
+ \item \MontreCode{Jonction} : jonction des segments (\MontreCode{bevel} par défaut) ;
+ \item \MontreCode{Bornes} : type des bornes parmi :
+ \begin{itemize}
+ \item \MontreCode{abs} pour les bornes données par les abscisses ;
+ \item \MontreCode{noeuds} pour les bornes données par les nœuds ;
+ \item \MontreCode{abs/noeud} pour les bornes données par abscisse et nœud ;
+ \item \MontreCode{noeud/abs} pour les bornes données par nœud et abscisse ;
+ \end{itemize}
+ \item \MontreCode{Bord} : booléen (\MontreCode{true} par défaut) pour afficher les traits latéraux,%
+ \item \MontreCode{NomSpline} : macro (important !) du spline généré précédemment pour un spline en version supérieure ;
+ \item \MontreCode{NomSplineB} : macro (important !) du spline généré précédemment pour un spline en version inférieure ;
+ \item \MontreCode{NomInterpo} : nom (important !) de la courbe d'interpolation générée précédemment, en version supérieure ;
+ \item \MontreCode{NomInterpoB} : nom (important !) de la courbe d'interpolation générée précédemment, en version inférieure ;
+ \item \MontreCode{Tension} : tension pour la courbe d'interpolation générée précédemment, en version supérieure ;
+ \item \MontreCode{TensionB} : tension de la courbe d'interpolation générée précédemment, en version inférieure.
+\end{itemize}
+
+\smallskip
+
+Le premier argument obligatoire est la fonction ou la courbe du spline ou la liste de points d'interpolation.
+
+\smallskip
+
+L'argument suivant, optionnel, est la fonction ou la courbe du spline ou la liste de points d'interpolation.
+
+\smallskip
+
+Les deux derniers arguments obligatoires sont les bornes de l'intégrale, données sous une forme en adéquation avec la clé \MontreCode{Bornes}.
+
+\pagebreak
+
+Dans le cas de courbes définies par des \textit{points}, il est nécessaire de travailler sur des intervalles sur lesquels la première courbe est \textbf{au-dessus} de la deuxième.
+
+Il sera sans doute intéressant de travailler avec les \textit{intersections} dans ce cas.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.6cm,y=0.06cm,
+ Xmin=0,Xmax=21,Xgrille=1,Xgrilles=0.5,
+ Ymin=0,Ymax=155,Ygrille=10,Ygrilles=5]
+ \TracerAxesGrilles%
+ [Grads=false,Elargir=2.5mm]{}{}
+ \DefinirCourbe[Nom=cf,Debut=1,Fin=20,Couleur=red]<f>{80*x*exp(-0.2*x)}
+ \TracerIntegrale
+ [Bornes=abs,Couleurs=blue/cyan!50]%
+ {f(x)}{3}{12}
+ \TracerCourbe[Couleur=red,Debut=1,Fin=20]{f(x)}
+ \TracerAxesGrilles%
+ [Grille=false,Elargir=2.5mm,Police=\small]{0,1,...,20}{0,10,...,150}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=1.2cm,y=1.6cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=3,Ygrille=0.5,Ygrilles=0.25]
+ \TracerAxesGrilles[Grads=false,Elargir=2.5mm]{}{}
+ \def\LISTETEST{-6/2/0§-1/-2/0§2/1/0§3.5/0/-1}
+ \DefinirCourbeSpline[Nom=splinetest]{\LISTETEST}
+ \TracerIntegrale[Type=spl,Style=hachures,Couleurs=purple]{splinetest}{-5.75}{-4.75}
+ \TracerIntegrale[Type=spl,Couleurs=blue]{splinetest}{-2}{-1}
+ \TracerIntegrale[Type=spl,Couleurs=orange]{splinetest}{1}{3}
+ \TracerCourbeSpline[Couleur=olive]{\LISTETEST}
+ \TracerAxesGrilles[Grille=false,Elargir=2.5mm]
+ {-7,-6,...,4}%
+ {-3,-2.5,...,3}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Tangentes}\label{tgte}
+
+L'idée de cette commande est de tracer la tangente à une courbe précédemment définie, en spécifiant :
+
+\begin{itemize}
+ \item le point (abscisse ou nœud) en lequel on souhaite travailler ;
+ \item éventuellement le direction (dans le cas d'une discontinuité ou d'une borne) ;
+ \item éventuellement le pas ($h$) du calcul ;
+ \item les \textit{écartements latéraux} pour tracer la tangente.
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%dans l'environnement GraphiqueTikz
+\TracerTangente[clés]{fonction ou courbe}{point}<options traits>
+\end{tcblisting}
+
+Les \MontreCode{[clés]} pour la définition ou le tracé, optionnelles, disponibles sont :
+
+\begin{itemize}
+ \item \MontreCode{Couleurs} =: couleurs des tracés, sous la forme \MontreCode{Couleur} ou \MontreCode{CouleurLigne/CouleurPoint} (\MontreCode{black} par défaut) ;
+ \item \MontreCode{DecG} =: écartement horizontal gauche pour débuter le tracé (\MontreCode{1} par défaut) ;
+ \item \MontreCode{DecD} =: écartement horizontal gauche pour débuter le tracé (\MontreCode{1} par défaut) ;
+ \item \MontreCode{AffPoint} : booléen pour afficher le point support (\MontreCode{false} par défaut) ;
+ \item \MontreCode{Spline} : booléen pour préciser qu'un spline est utilisé (\MontreCode{false} par défaut) ;
+ \item \MontreCode{h} : pas $h$ utilisé pour les calculs (\MontreCode{0.01} par défaut) ;
+ \item \MontreCode{Sens} : permet de sprécifier le \textit{sens} de la tangente, parmi \MontreCode{gd}/\MontreCode{g}/\MontreCode{d} (\MontreCode{gd} par défaut) ;
+ \item \MontreCode{Noeud} : booléen pour préciser qu'un nœud est utilisé (\MontreCode{false} par défaut).
+\end{itemize}
+
+\smallskip
+
+Le premier argument obligatoire est la fonction ou la courbe du spline (le cas échéant).
+
+\smallskip
+
+Le dernier argument obligatoire est le point de travail (version abscisse ou nœud suivant la clé \MontreCode{Noeud}).
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrille=2,Ygrilles=1,Origy=40]
+ \TracerAxesGrilles[Elargir=2.5mm,Police=\small]{4,5,...,20}{40,42,...,56}
+ \DefinirCourbe[Nom=cf,Debut=5,Fin=19,Couleur=red,Trace]<f>{-2*x+3+24*log(2*x)}
+ \TrouverAntecedents[Couleur=teal,Nom=JKL,Aff=false]{cf}{53}
+ %tangente
+ \TracerTangente%
+ [Couleurs=cyan/gray,DecG=2.5,DecD=2.5,Noeud,AffPoint]{f}{(JKL-1)}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \TracerAxesGrilles[Elargir=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}
+ \DefinirCourbeSpline[Nom=splinetest,Trace,Couleur=olive]{\LISTETEST}
+ \TracerTangente[Couleurs=red,Spline,AffPoint]{splinetest}{1}
+ \TracerTangente%
+ [Couleurs=blue,Spline,DecG=1.5,DecD=1.5,AffPoint]{splinetest}{-3}%
+ <pflflechegd>
+ \TracerTangente[Sens=g,Couleurs=orange,Spline,DecG=1.5,AffPoint]{splinetest}{3}
+ \TracerTangente[Sens=d,Couleurs=violet,Spline,DecD=1.5,AffPoint]{splinetest}{-6}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\section{Commandes spécifiques des fonctions de densité}
+
+\subsection{Loi normale}\label{loinormale}
+
+L'idée est de proposer de quoi travailler avec des lois normales.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%dans l'environnement GraphiqueTikz
+\DefinirLoiNormale[clés]<nom fct>{mu}{sigma}
+\TracerLoiNormale[clés]{fct(x)}
+\end{tcblisting}
+
+Les \MontreCode{[clés]}, optionnelles, disponibles sont :
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Nom} : nom du tracé (\MontreCode{gaussienne} par défaut) ;
+ \item \MontreCode{Trace} : booléen pour tracer la courbe(\MontreCode{false} par défaut) ;
+ \item \MontreCode{Couleur} : couleur du tracé, si demandé (\MontreCode{black} par défaut) ;
+ \item \MontreCode{Debut} : borne inférieure de l'ensemble de définition (\MontreCode{\textbackslash pflxmin} par défaut) ;
+ \item \MontreCode{Fin} : borne inférieure de l'ensemble de définition (\MontreCode{\textbackslash pflxmax} par défaut) ;
+ \item \MontreCode{Pas} : = pas du tracé (il est déterminé \textit{automatiquement} au départ mais peut être modifié).
+\end{itemize}
+
+À noter que l'axe vertical est à adapter en fonction des paramètres de la loi normale.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=1.25cm,y=15cm,Origx=5,Xmin=5,Xmax=15,Ymin=0,Ymax=0.3,
+ Ygrille=0.1,Ygrilles=0.05]
+ \TracerAxesGrilles[Elargir=2.5mm]{auto}{auto}
+ \DefinirLoiNormale[Nom=gaussienne]<phi>{10}{1.5}
+ \TracerIntegrale
+ [Bornes=abs,Couleurs=blue/cyan!50]%
+ {phi(x)}{7}{13}
+ \TracerLoiNormale[Couleur=violet,Debut=5,Fin=15]{phi(x)}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Loi du khi deux}\label{loikhideux}
+
+L'idée est de proposer de quoi travailler avec des lois normales.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%dans l'environnement GraphiqueTikz
+\DefinirLoiKhiDeux[clés]<nom fct>{k}
+\TracerLoiKhiDeux[clés]{fct(x)}
+\end{tcblisting}
+
+Les \MontreCode{[clés]}, optionnelles, disponibles sont :
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Nom} : nom du tracé (\MontreCode{gaussienne} par défaut) ;
+ \item \MontreCode{Trace} : booléen pour tracer la courbe(\MontreCode{false} par défaut) ;
+ \item \MontreCode{Couleur} : couleur du tracé, si demandé (\MontreCode{black} par défaut) ;
+ \item \MontreCode{Debut} : borne inférieure de l'ensemble de définition (\MontreCode{\textbackslash pflxmin} par défaut) ;
+ \item \MontreCode{Fin} : borne inférieure de l'ensemble de définition (\MontreCode{\textbackslash pflxmax} par défaut) ;
+ \item \MontreCode{Pas} : = pas du tracé (il est déterminé \textit{automatiquement} au départ mais peut être modifié).
+\end{itemize}
+
+À noter que l'axe vertical est à adapter en fonction du paramètre de la loi du khi deux.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}[
+ x=1.5cm,y=7.5cm,
+ Xmin=0,Xmax=8,Xgrille=1,Xgrilles=0.5,
+ Ymin=0,Ymax=0.5,Ygrille=0.1,Ygrilles=0.05
+ ]
+ \TracerAxesGrilles[Elargir=2.5mm]{auto}{auto}
+ \DefinirLoiKhiDeux[Couleur=red,Debut=0.25,Trace]<phiA>{1}
+ \DefinirLoiKhiDeux[Couleur=blue,Trace]<phiB>{2}
+ \DefinirLoiKhiDeux[Couleur=orange,Trace]<phiC>{3}
+ \DefinirLoiKhiDeux[Couleur=violet,Trace]<phiD>{4}
+ \DefinirLoiKhiDeux[Couleur=yellow,Trace]<phiE>{5}
+ \DefinirLoiKhiDeux[Couleur=teal,Trace]<phiF>{6}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\section{Commandes spécifiques des statistiques à deux variables}
+
+\subsection{Le nuage de points}\label{nuage}
+
+En marge des commandes liées aux fonctions, il est également possible de représenter des séries statistiques doubles.
+
+\smallskip
+
+Le paragraphe suivant montre que l'ajout d'une clé permet de rajouter la droite d'ajustement linéaire.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%dans l'environnement GraphiqueTikz
+\TracerNuage[clés]{ListeX}{ListeY}
+\end{tcblisting}
+
+La \MontreCode{[clé]} optionnelle est :
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{CouleurNuage} : couleur des points du nuage (\MontreCode{black} par défaut).
+\end{itemize}
+
+\smallskip
+
+Les arguments, obligatoires, permettent de spécifier :
+
+\smallskip
+
+\begin{itemize}
+ \item la liste des abscisses ;
+ \item la liste des ordonnées.
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.075cm,y=0.03cm,Xmin=0,Xmax=160,Xgrille=20,Xgrilles=10,
+ Origy=250,Ymin=250,Ymax=400,Ygrille=25,Ygrilles=5]
+ %préparation de la fenêtre
+ \TracerAxesGrilles[Elargir=2.5mm,Police=\small]{0,10,...,160}{250,275,...,400}
+ %nuage de points
+ \TracerNuage[Style=x,CouleurNuage=red]{0,50,100,140}{275,290,315,350}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\subsection{La droite de régression}\label{reglin}
+
+La droite de régression linéaire (obtenue par la méthode des moindres carrés) peut facilement être rajoutée, en utilisant la clé \MontreCode{TracerDroite}.
+
+\smallskip
+
+Dans ce cas, de nouvelles clés sont disponibles :
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{CouleurDroite} : couleur de la droite (\MontreCode{black} par défaut) ;
+ \item \MontreCode{Arrondis} : précision des coefficients (\MontreCode{vide} par défaut) ;
+ \item \MontreCode{Debut} : abscisse initiale du tracé (\MontreCode{\textbackslash pflxmin} par défaut) ;
+ \item \MontreCode{Fin} : abscisse terminale du tracé (\MontreCode{\textbackslash pflxmax} par défaut) ;
+ \item \MontreCode{Nom} : nom du tracé, pour exploitation ultérieure (\MontreCode{reglin} par défaut).
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.075cm,y=0.03cm,Xmin=0,Xmax=160,Xgrille=20,Xgrilles=10,
+ Origy=250,Ymin=250,Ymax=400,Ygrille=25,Ygrilles=5]
+ \TracerAxesGrilles[Elargir=2.5mm,Police=\small]{0,10,...,160}{250,275,...,400}
+ %nuage et droite
+ \TracerNuage%
+ [CouleurNuage=red,CouleurDroite=brown,TracerDroite]%
+ {0,50,100,140}{275,290,315,350}
+ %image
+ \PlacerImages[Couleurs=cyan/magenta,Traits]{d}{120}
+ %antécédents
+ \PlacerAntecedents[Style=x,Couleurs=blue/green!50!black,Traits]{reglin}{300}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\section{Codes source des exemples de la page d'accueil}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}[x=0.85cm,y=0.35cm,Xmin=0,Xmax=10,Ymin=0,Ymax=16]
+ %préparation de la fenêtre
+ \TracerAxesGrilles[Derriere,Elargir=2.5mm,Police=\small]{0,1,...,10}{0,2,...,16}
+ %déf des fonctions avec nom courbe + nom fonction + expression (tracés à la fin !)
+ \DefinirCourbe[Nom=cf]<f>{3*x-6}
+ \DefinirCourbe[Nom=cg]<g>{-(x-6)^2+12}
+ %antécédents et intersection
+ \TrouverIntersections[Aff=false,Nom=K]{cf}{cg}
+ \TrouverAntecedents[AffDroite,Couleur=orange,Nom=I]{cg}{8}
+ \TrouverAntecedents[Aff=false,Nom=J]{cg}{0}
+ %intégrale sous une courbe, avec intersection
+ \TracerIntegrale%
+ [Couleurs=blue/purple,Bornes=noeuds,Style=hachures,Hachures=bricks]%
+ {g(x)}%
+ {(I-2)}{(J-2)}
+ %intégrale entre les deux courbes
+ \TracerIntegrale[Bornes=noeuds,Type=fct/fct]%
+ {f(x)}[g(x)]%
+ {(K-1)}{(K-2)}
+ %tracé des courbes et des points
+ \TracerCourbe[Couleur=red]{f(x)}
+ \TracerCourbe[Couleur=teal]{g(x)}
+ \PlacerPoints<\small>{(K-1)/below right/L,(K-2)/above left/M}%
+ \PlacerPoints[violet]<\small>{(I-1)/above left/D,(I-2)/above right/E}%
+ %tangente
+ \TracerTangente[Couleurs=pink!75!black/yellow,kl=2,kr=2,AffPoint]{g}{5}
+ %images
+ \PlacerImages[Couleurs=cyan]{g}{7,7.25,7.5}
+ %surimpression des axes
+ \TracerAxesGrilles[Devant,Elargir=2.5mm]{0,1,...,10}{0,2,...,16}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=3.5cm,y=4cm,
+ Xmin=0,Xmax=3.5,Xgrille=pi/12,Xgrilles=pi/24,
+ Ymin=-1.05,Ymax=1.05,Ygrille=0.2,Ygrilles=0.05]
+ %préparation de la fenêtre
+ \TracerAxesGrilles[Derriere,Elargir=2.5mm,Format=ntrig/nsqrt]{}{}
+ %rajouter des valeurs
+ \RajouterValeursAxeX{0.25,1.4,3.3}{\num{0.25},\num{1.4},\num{3.3}}
+ %fonction trigo (déf + tracé)
+ \DefinirCourbe[Nom=ccos,Debut=0,Fin=pi]<fcos>{cos(x)}
+ \DefinirCourbe[Nom=csin,Debut=0,Fin=pi]<fsin>{sin(x)}
+ %intégrale
+ \TrouverIntersections[Aff=false,Nom=JKL]{ccos}{csin}
+ \TracerIntegrale%
+ [Bornes=noeud/abs,Type=fct/fct,Couleurs=cyan/cyan!50]%
+ {fsin(x)}[fcos(x)]%
+ {(JKL-1)}{pi}
+ %tracé des courbes
+ \TracerCourbe[Couleur=red,Debut=0,Fin=pi]{fcos(x)}
+ \TracerCourbe[Couleur=olive,Debut=0,Fin=pi]{fsin(x)}
+ %antécédent(s)
+ \PlacerAntecedents[Couleurs=blue/teal!50!black,Traits]{ccos}{-0.25}
+ \PlacerAntecedents[Couleurs=red/magenta!50!black,Traits]{csin}{0.5}
+ \PlacerAntecedents[Couleurs=orange/orange!50!black,Traits]{csin}{sqrt(2)/2}
+ \PlacerAntecedents[Couleurs=green!50!black/green,Traits]{csin}{sqrt(3)/2}
+ %surimpression axes
+ \TracerAxesGrilles[Devant,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{GraphiqueTikz}
+\end{tcblisting}
+
+\newpage
+
+\section{Commandes auxiliaires}
+
+\subsection{Intro}
+
+En marge des commandes purement \textit{graphiques}, quelques commandes auxiliaires sont disponibles :
+
+\begin{itemize}
+ \item une pour formater un nombre avec une précision donnée ;
+ \item une pour travailler sur des nombres aléatoires, avec contraintes.
+\end{itemize}
+
+\subsection{Arrondi formaté}\label{numarrond}
+
+La commande \MontreCode{\textbackslash ArrondirNum} permet de formater, grâce au package \MontreCode{siunitx}, un nombre (ou un calcul), avec une précision donnée. Cela peut être \textit{utile} pour formater des résultats obtenus grâce aux commandes de récupération des coordonnées, par exemple.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+\ArrondirNum[précision]{calcul xint}
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\ArrondirNum{1/3}\\
+\ArrondirNum{16.1}\\
+\ArrondirNum[3]{log(10)}\\
+\end{tcblisting}
+
+\subsection{Nombre aléatoire sous contraintes}\label{nbalea}
+
+L'idée de cette deuxième commande est de pouvoir déterminer un nombre aléatoire :
+
+\begin{itemize}
+ \item entier ou décimal ;
+ \item sous contraintes (entre deux valeurs fixées).
+\end{itemize}
+
+Cela peut permettre, par exemple, de travailler sur des courbes avec points \textit{aléatoires}, mais respectant certaines contraintes.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+\ChoisirNbAlea(*)[precision (déf 0)]{borne inf}{borne sup}[\macro]
+\end{tcblisting}
+
+La version étoilée prend les contraintes sous forme stricte ($\text{borne inf} < \text{macro} < \text{borne sup}$) alors que la version normale prend les contraintes sous forme large ($\text{borne inf} \leq \text{macro} \leq \text{borne sup}$).
+
+\smallskip
+
+À noter que les \textit{bornes} peuvent être des \textit{macros} existantes !
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+%un nombre (2 chiffres après la virgule) entre 0.75 et 0.95
+%un nombre (2 chiffres après la virgule) entre 0.05 et 0.25
+%un nombre (2 chiffres après la virgule) entre 0.55 et \YrandMax
+%un nombre (2 chiffres après la virgule) entre \YrandMin et 0.45
+\ChoisirNbAlea[2]{0.75}{0.95}[\YrandMax]%
+\ChoisirNbAlea[2]{0.05}{0.25}[\YrandMin]%
+\ChoisirNbAlea*[2]{0.55}{\YrandMax}[\YrandA]%
+\ChoisirNbAlea*[2]{\YrandMin}{0.45}[\YrandB]%
+%vérification
+\num{\YrandMax} \& \num{\YrandMin} \& \num{\YrandA} \& \num{\YrandB}
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+%un nombre (2 chiffres après la virgule) entre 0.75 et 0.95
+%un nombre (2 chiffres après la virgule) entre 0.05 et 0.25
+%un nombre (2 chiffres après la virgule) entre 0.55 et \YrandMax
+%un nombre (2 chiffres après la virgule) entre \YrandMin et 0.45
+\ChoisirNbAlea[2]{0.75}{0.95}[\YrandMax]%
+\ChoisirNbAlea[2]{0.05}{0.25}[\YrandMin]%
+\ChoisirNbAlea*[2]{0.55}{\YrandMax}[\YrandA]%
+\ChoisirNbAlea*[2]{\YrandMin}{0.45}[\YrandB]%
+%vérification
+\num{\YrandMax} \& \num{\YrandMin} \& \num{\YrandA} \& \num{\YrandB}
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+%la courbe est prévue pour qu'il y ait 3 antécédents
+\ChoisirNbAlea[2]{0.75}{0.95}[\YrandMax]%
+\ChoisirNbAlea[2]{0.05}{0.25}[\YrandMin]%
+\ChoisirNbAlea*[2]{0.55}{\YrandMax}[\YrandA]%
+\ChoisirNbAlea*[2]{\YrandMin}{0.45}[\YrandB]%
+
+\begin{GraphiqueTikz}
+ [x=0.075cm,y=7.5cm,Xmin=0,Xmax=150,Xgrille=10,Xgrilles=5,
+ Ymin=0,Ymax=1,Ygrille=0.1,Ygrilles=0.05]
+ \TracerAxesGrilles[Dernier,Elargir=2.5mm]{auto}{auto}
+ \DefinirCourbeInterpo[Couleur=red,Trace,Nom=fonctiontest,Tension=0.75]
+ {(0,\YrandA)(40,\YrandMin)(90,\YrandMax)(140,\YrandB)}
+ \TrouverAntecedents[Aff=false,Nom=ANTECED]{fonctiontest}{0.5}
+ \PlacerAntecedents[Couleurs=blue/teal,Traits]{fonctiontest}{0.5}
+ \RecupererAbscisse{(ANTECED-1)}[\Aalpha]
+ \RecupererAbscisse{(ANTECED-2)}[\Bbeta]
+ \RecupererAbscisse{(ANTECED-3)}[\Cgamma]
+\end{GraphiqueTikz}
+
+Les solutions de $f(x)=\num{0.5}$ sont, par lecture graphique :
+$\begin{cases}
+ \alpha \approx \ArrondirNum[0]{\Aalpha} \\
+ \beta \approx \ArrondirNum[0]{\Bbeta} \\
+ \gamma \approx \ArrondirNum[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~~~}{\DefinirCourbe}{deftracfct}
+ \lstcmd{tracé courbe~~~}{\TracerCourbe}{deftracfct}
+ \lstcmd{def interpo~~~~}{\DefinirCourbeInterpo}{deftracinterpo}
+ \lstcmd{tracé interpo~~}{\TracerCourbeInterpo}{deftracinterpo}
+ \lstcmd{def spline~~~~~}{\DefinirCourbeSpline}{deftracfctspline}
+ \lstcmd{tracé spline~~~}{\TracerCourbeSpline}{deftracfctspline}
+ \lstcmd{def points~~~~~}{\DefinirPts}{defpts}
+ \lstcmd{marq pts~~~~~~~}{\MarquerPts}{markpts}
+ \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{intégrale~~~~~~}{\TracerIntegrale}{integr}
+ \lstcmd{tangente~~~~~~~}{\TracerTangente}{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{arrondi~~~~~~~~}{\ArrondirNum}{numarrond}
+ \lstcmd{nb aléat~~~~~~~}{\ChoisirNbAlea}{nbalea}
+\end{description}
+
+\pagebreak
+
+\section{Historique}
+
+\begin{quote}
+\begin{verbatim}
+0.1.1 : Densité loi normale et khi deux + Marquage points + Améliorations
+0.1.0 : Version initiale
+\end{verbatim}
+\end{quote}
+
+\end{document} \ No newline at end of file
diff --git a/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-exemples-integrales.pdf b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-exemples-integrales.pdf
new file mode 100644
index 0000000000..5e0354c490
--- /dev/null
+++ b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-exemples-integrales.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-exemples-integrales.tex b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-exemples-integrales.tex
new file mode 100644
index 0000000000..58fc6473f8
--- /dev/null
+++ b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-exemples-integrales.tex
@@ -0,0 +1,251 @@
+% !TeX TXS-program:compile = txs:///arara
+% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode}
+
+\documentclass[a4paper,french,11pt]{article}
+\usepackage[margin=1cm,includefoot]{geometry}
+\usepackage{tkz-grapheur}
+\usepackage{tcolorbox}
+\tcbuselibrary{skins,minted}
+\usepackage{babel}
+
+\begin{document}
+
+\part*{Exemples des différents cas d'intégrales}
+
+\section{Sous courbe, par défaut}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \TracerAxesGrilles[Derriere,Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefinirCourbe[Nom=ch]<h>{0.25*(x+2)^2+1}
+ \TracerIntegrale%
+ [Couleurs=blue/cyan,Style=remplissage]%
+ {h(x)} %formule
+ {-5.25}{1.5}
+ \TracerCourbe[Couleur=red]{h(x)}
+ \TracerAxesGrilles[Devant,Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\section{Sous courbe d'interpolation}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \TracerAxesGrilles[Grads=false,Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefinirListeInterpo{(-6,4)(-2,-2)(3,3.5)}[\interpoA]
+ \DefinirCourbeInterpo[Nom=interpotest,Tension=1.05]{\interpoA}
+ \TracerIntegrale%
+ [NomInterpo=interpotest,Couleurs=blue/cyan,Style=remplissage,Type=itp,Tension=1.05]%
+ {\interpoA} %pointsinterpo
+ {-5.25}{1.5}
+ \TracerCourbeInterpo[Couleur=red,Tension=1.05]{\interpoA}
+ \TracerAxesGrilles[Grille=false,Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\section{Sous spline cubique}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \TracerAxesGrilles[Grads=false,Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefinirListeSpline{-6/4/-2§-5/2/-2§-4/0/-2§-2/-2/0§1/2/2§3/3.5/0.5}[\lstsplineA]
+ \DefinirCourbeSpline[Nom=splinetest]{\lstsplineA}<\SplineTeal>
+ \TracerIntegrale%
+ [NomSpline=\SplineTeal,Type=spl,Couleurs=blue/purple,Style=hachures]%
+ {splinetest} %nomcourbespline
+ {-5}{2}
+ \TracerCourbeSpline[Couleur=teal]{\lstsplineA}
+ \TracerAxesGrilles[Grille=false,Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\section{Entre courbes}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \TracerAxesGrilles[Grads=false,Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefinirCourbe[Nom=ch]<h>{0.25*(x+2)^2-1}
+ \DefinirCourbe[Nom=ck]<k>{-0.25*x+1}
+ \TrouverIntersections[Nom=ITSC,Aff=false]{ch}{ck}
+ \TracerIntegrale%
+ [Couleurs=olive/pink,Style=remplissage,Type=fct/fct,Bornes=noeud/abs]%
+ {h(x)}[k(x)] %formules
+ {(ITSC-1)}{1.5}
+ \TracerCourbe[Couleur=red]{h(x)}
+ \TracerCourbe[Couleur=blue]{k(x)}
+ \TracerAxesGrilles[Grille=false,Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\section{Entre splines}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \TracerAxesGrilles[Grads=false,Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefinirListeSpline{-6/4/-2§-5/2/-2§-4/0/-2§-2/-2/0§1/2/2§3/3.5/0.5}[\lstsplineA]
+ \DefinirListeSpline{-6/-2/3§-2/4/0§3/-1/0}[\lstsplineB]
+ \DefinirCourbeSpline[Nom=splinetestolive]{\lstsplineA}<\SplineOlive>
+ \DefinirCourbeSpline[Nom=splinetestteal]{\lstsplineB}<\SplineTeal>
+ \TrouverIntersections[Nom=ITT,Aff=false]{splinetestteal}{splinetestolive}
+ \TracerIntegrale%
+ [NomSpline=\SplineTeal,NomSplineB=\SplineOlive,Type=spl/spl,Couleurs=blue/purple,Bornes=noeuds]%
+ {splinetestolive} %nomcourbespline
+ [splinetestteal] %nomcourbespline
+ {(ITT-1)}{(ITT-2)}
+ \TracerCourbeSpline[Couleur=teal]{\lstsplineA}
+ \TracerCourbeSpline[Couleur=olive]{\lstsplineB}
+ \TracerAxesGrilles[Grille=false,Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\section{Entre interpolations}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \TracerAxesGrilles[Grads=false,Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefinirListeInterpo{(-6,4)(-2,-2)(3,3.5)}[\interpoA]
+ \DefinirCourbeInterpo[Nom=interpotest]{\interpoA}
+ \DefinirListeInterpo{(-6,-2)(-1,4)(3,0)}[\interpoB]
+ \DefinirCourbeInterpo[Nom=interpotesta]{\interpoB}
+ \TracerIntegrale%
+ [NomInterpo=interpotesta,NomInterpoB=interpotest,Type=itp/itp,Couleurs=olive/pink]%
+ {\interpoB} %pointsinterpo
+ [\interpoA] %pointsinterpo
+ {-2}{1}
+ \TracerCourbeInterpo[Couleur=red]{\interpoA}
+ \TracerCourbeInterpo[Couleur=blue]{\interpoB}
+ \TracerAxesGrilles[Grille=false,Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\section{Entre fonction et spline}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \TracerAxesGrilles[Grads=false,Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefinirCourbe[Nom=ch]<h>{-0.25*(x+2)^2+3.5}
+ \DefinirListeSpline{-6/4/-2§-5/2/-2§-4/0/-2§-2/-2/0§1/2/2§3/3.5/0.5}[\lstsplineA]
+ \DefinirCourbeSpline[Nom=splineblue]{\lstsplineA}<\Splineblue>
+ \TracerIntegrale%
+ [NomSplineB=\Splineblue,Type=fct/spl,Couleurs=olive/pink]%
+ {h(x)} %formule
+ [splineblue] %nomcourbespline
+ {-3}{0}
+ \TracerCourbe[Couleur=red]{h(x)}
+ \TracerCourbeSpline[Couleur=blue]{\lstsplineA}
+ \TracerAxesGrilles[Grille=false,Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\section{Entre spline et fonction}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \TracerAxesGrilles[Grads=false,Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefinirCourbe[Nom=ch]<h>{0.25*(x+2)^2-2}
+ \DefinirListeSpline{-6/4/2§-5/-2/-2§-4/0/2§-2/2/0§1/-2/-2§3/3.5/-0.5}[\lstsplineA]
+ \DefinirCourbeSpline[Nom=splineblue]{\lstsplineA}<\Splineblue>
+ \TracerIntegrale%
+ [NomSpline=\Splineblue,Type=spl/fct,Couleurs=olive/pink]%
+ {splineblue} %nomcourbespline
+ [h(x)] %formule
+ {-3}{-1}
+ \TracerCourbe[Couleur=red]{h(x)}
+ \TracerCourbeSpline[Couleur=blue]{\lstsplineA}
+ \TracerAxesGrilles[Grille=false,Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\section{Entre fonction et interpo}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \TracerAxesGrilles[Grads=false,Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefinirCourbe[Nom=cm]<m>{-0.25*(x+2)^2+4}
+ \DefinirListeInterpo{(-6,4)(-5,-2)(-2,1)(1,-2)(3,3)}[\interpoB]
+ \DefinirCourbeInterpo[Nom=interpotestb]{\interpoB}
+ \TracerIntegrale%
+ [NomInterpoB=interpotestb,Type=fct/itp,Couleurs=olive/pink]%
+ {m(x)} %formule
+ [\interpoB] %pointsinterpo
+ {-4}{1}
+ \TracerCourbe[Couleur=red]{m(x)}
+ \TracerCourbeInterpo[Couleur=blue]{\interpoB}
+ \TracerAxesGrilles[Grille=false,Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\section{Entre interpo et fonction}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \TracerAxesGrilles[Grads=false,Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefinirCourbe[Nom=courbeQ]<q>{0.25*(x+2)^2-2.5}
+ \DefinirListeInterpo{(-6,-2)(-5,4)(-2,-1)(1,2)(3,-2)}[\interpoA]
+ \DefinirCourbeInterpo[Nom=interpotest]{\interpoA}
+ \TrouverIntersections[Nom=FGH,Aff]{interpotest}{courbeQ}
+ \TracerIntegrale%
+ [NomInterpo=interpotest,Type=itp/fct,Couleurs=olive/pink,Bornes=noeuds]%
+ {\interpoA} %pointsinterpo
+ [q(x)] %formule
+ {(FGH-1)}{(FGH-2)}
+ \TracerCourbe[Couleur=red]{q(x)}
+ \TracerCourbeInterpo[Couleur=blue]{\interpoA}
+ \TracerAxesGrilles[Grille=false,Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\section{Entre spline et interpo}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \TracerAxesGrilles[Grads=false,Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefinirListeSpline{-6/-2/2§-3/4/0§3/-2/0}[\lstsplineA]
+ \DefinirCourbeSpline[Nom=splinered]{\lstsplineA}<\Splinered>
+ \DefinirListeInterpo{(-6,4)(-5,-2)(-2,1)(1,-2)(3,3)}[\interpoB]
+ \DefinirCourbeInterpo[Nom=interpotestb]{\interpoB}
+ \TracerIntegrale%
+ [NomInterpoB=interpotestb,NomSpline=\Splinered,Type=spl/itp,Couleurs=olive/pink]%
+ {splinered} %nomcourbespline
+ [\interpoB] %pointsinterpo
+ {-4}{-2}
+ \TracerCourbeSpline[Couleur=red]{\lstsplineA}
+ \TracerCourbeInterpo[Couleur=blue]{\interpoB}
+ \TracerAxesGrilles[Grille=false,Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\section{Entre interpo et spline}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \TracerAxesGrilles[Grads=false,Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefinirListeSpline{-6/4/-2§-3/-2.25/0§3/3/0}[\lstsplineB]
+ \DefinirCourbeSpline[Nom=splineblue]{\lstsplineB}<\Splineblue>
+ \DefinirListeInterpo{(-6,-2)(-5,4)(-2,-1)(1,2)(3,-2.5)}[\interpoA]
+ \DefinirCourbeInterpo[Nom=interpotest]{\interpoA}
+ \TrouverIntersections[Nom=UIO,Aff]{interpotest}{splineblue}
+ \TracerIntegrale%
+ [NomInterpo=interpotest,NomSplineB=\Splineblue,Type=itp/spl,Couleurs=olive/pink,Bornes=noeuds]%
+ {\interpoA} %pointsinterpo
+ [splineblue] %nomcourbespline
+ {(UIO-1)}{(UIO-2)}
+ \TracerCourbeSpline[Couleur=blue]{\lstsplineB}
+ \TracerCourbeInterpo[Couleur=red]{\interpoA}
+ \TracerAxesGrilles[Grille=false,Elargir=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\end{document} \ No newline at end of file
diff --git a/graphics/pgf/contrib/tkz-grapheur/tex/tkz-grapheur.sty b/graphics/pgf/contrib/tkz-grapheur/tex/tkz-grapheur.sty
new file mode 100644
index 0000000000..3e7d949764
--- /dev/null
+++ b/graphics/pgf/contrib/tkz-grapheur/tex/tkz-grapheur.sty
@@ -0,0 +1,1679 @@
+% Author : C. Pierquet
+% licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{tkz-grapheur}[2024/05/28 0.1.1 Des outils en TikZ pour travailler comme avec un grapheur]
+
+%====HISTORIQUE
+% v 0.1.1 Densité loi normale + khi deux + Améliorations diverses
+% v 0.1.0 Version initiale [fr]
+
+%====OPTION
+\newif\if@loadsiunitx \@loadsiunitxtrue
+\DeclareOption{nonsiunitx}{\@loadsiunitxfalse}%
+\newif\if@loadtikzbabel \@loadtikzbabeltrue
+\DeclareOption{nontikzbabel}{\@loadtikzbabelfalse}%
+\DeclareOption*{}
+\ProcessOptions\relax
+
+%====BASE
+\RequirePackage{tikz}
+\RequirePackage{ifthen}
+\usetikzlibrary{calc,intersections,patterns,patterns.meta}
+\RequirePackage{simplekv}
+\RequirePackage{xintexpr}
+\RequirePackage{xstring}
+\RequirePackage{listofitems}
+
+%====SIUNITX
+\if@loadsiunitx
+ \RequirePackage{siunitx}
+ \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}
+\fi
+
+%====TIKZ.BABEL
+\if@loadtikzbabel
+ \usetikzlibrary{babel}
+\fi
+
+%====COMMANDE POUR NB DECIMAL ALEA ENTRE BORNES
+\NewDocumentCommand\ChoisirNbAlea{ s O{0} m m O{\monbnalea} }{%
+ \def\tmpborneinf{\xinteval{floor(#3)}}%inf=\tmpborneinf\par%
+ \def\tmpbornesup{\xinteval{ceil(#4)}}%sup=\tmpbornesup\par%
+ \xintifboolexpr{#2 == 0}%
+ {%
+ \xdef#5{\fpeval{randint(\tmpborneinf,\tmpbornesup)}}%
+ }%
+ {%
+ \def\tmptest{0}%
+ \whiledo{\tmptest=0}{%
+ \xintifboolexpr{(\tmpbornesup-\tmpborneinf) == 1}%
+ {%
+ \xdef\tmpresalea{\fpeval{\tmpborneinf+round(rand(),#2)}}%
+ }%
+ {%
+ \xdef\tmpresalea{\fpeval{round(randint(\tmpborneinf,\tmpbornesup)+rand(),#2)}}%
+ }%
+ %essai=\tmpresalea\par
+ \IfBooleanTF{#1}%
+ {%
+ \xintifboolexpr{\tmpresalea < #4 'and' \tmpresalea > #3 }{\def\tmptest{1}}{\def\tmptest{0}}%
+ }%
+ {%
+ \xintifboolexpr{\tmpresalea <= #4 'and' \tmpresalea >= #3 }{\def\tmptest{1}}{\def\tmptest{0}}%
+ }%
+ }%
+ \xdef#5{\tmpresalea}%
+ %res=%
+ }%
+}
+
+%====PATCH NUM
+\@ifundefined{ArrondirNum}%
+ {%
+ \NewDocumentCommand\ArrondirNum{ O{2} m}{\num{\xintfloateval{round(#2,#1)}}\relax}%
+ }%
+ {%
+ \RenewDocumentCommand\ArrondirNum{ O{2} m}{\num{\xintfloateval{round(#2,#1)}}\relax}%
+ }%
+
+%====STYLES DE BASE
+\tikzset{pflpoint/.style={line width=0.95pt}}
+\tikzset{pflpointc/.style={radius=1.75pt}}
+\tikzset{pflpointnuage/.style={radius=1.75pt}}
+\tikzset{pflcadre/.style={line width=0.8pt,gray}}
+\tikzset{pflcourbe/.style={line width=1.05pt}}
+\tikzset{pfltrait/.style={line width=0.8pt}}
+\tikzset{pflflecheg/.style={<-,>=latex}}
+\tikzset{pflfleched/.style={->,>=latex}}
+\tikzset{pflflechegd/.style={<->,>=latex}}
+\tikzset{pfltraitantec/.style={line width=0.9pt,densely dashed}}
+\tikzset{pfltraitimg/.style={line width=0.9pt,densely dashed,->,>=latex}}
+\tikzset{pflgrillep/.style={thin,lightgray}}
+\tikzset{pflgrilles/.style={very thin,lightgray}}
+\tikzset{pflaxes/.style={line width=0.8pt,->,>=latex}}
+\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,
+ Xgrille/.store in=\pflgrillex,Xgrille/.default=1,Xgrille=1,
+ Xgrilles/.store in=\pflgrillexs,Xgrilles/.default=0.5,Xgrilles=0.5,
+ Ygrille/.store in=\pflgrilley,Ygrille/.default=1,Ygrille=1,
+ Ygrilles/.store in=\pflgrilleys,Ygrilles/.default=0.5,Ygrilles=0.5
+}
+\tikzset{%
+ pics/pflptcroix/.style args={#1/#2}{
+ code={
+ \draw[pflpoint,rotate=#2] (-#1,0) -- (#1,0);
+ \draw[pflpoint,rotate=#2] (0,-#1) -- (0, #1);
+ }
+ },
+ pics/pflptcroix/.default={2pt/45}
+}
+\tikzset{%
+ pics/pflptcarre/.style args={#1/#2}{
+ code={
+ \filldraw[draw=none,pflpoint,rotate=#2] (-#1,-#1) rectangle (#1,#1) ;
+ }
+ },
+ pics/pflptcarre/.default={2pt/0}
+}
+
+%====CONSTANTE PI pour xint, à voir si incompatibilité...
+\xintdefvar pi:=3.141592653589793238462643;
+
+%===COMMANDE INTERNE POUR FORMATER EN FRACTIONS
+\NewDocumentCommand\FormatterFraction{ s O{} m }{%
+ %*=moins sur le numérateur
+ %2=argument.optionnel[d/t/dec=...]
+ %3=argument mandataire {calcul ou fraction}
+ \def\calculargument{\xintPRaw{\xintIrr{\xinteval{#3}}}}%on calcule et on transforme en A/B
+ \IfSubStr{\calculargument}{/}%on teste si le symbole / apparaît
+ {%si oui := fraction
+ \StrBefore{\calculargument}{/}[\numerateur]%on extrait le numérateur
+ \StrBehind{\calculargument}{/}[\denominateur]%on extrait le dénominateur
+ \ifblank{#2}%
+ {%
+ \IfBooleanTF{#1}%
+ {\ensuremath{\frac{\num{\numerateur}}{\num{\denominateur}}}}%
+ {%
+ \ifthenelse{\numerateur < 0}%
+ {\ensuremath{-\frac{\num{\fpeval{abs(\numerateur)}}}{\num{\denominateur}}}}%
+ {\ensuremath{\frac{\num{\numerateur}}{\num{\denominateur}}}}%
+ }%
+ }%
+ {}%si l'argument optionnel est vide
+ \IfStrEq{#2}{d}%
+ {%
+ \IfBooleanTF{#1}%
+ {\ensuremath{\displaystyle\frac{\num{\numerateur}}{\num{\denominateur}}}}%
+ {%
+ \ifthenelse{\numerateur < 0}%
+ {\ensuremath{-\displaystyle\frac{\num{\fpeval{abs(\numerateur)}}}{\num{\denominateur}}}}%
+ {\ensuremath{\displaystyle\frac{\num{\numerateur}}{\num{\denominateur}}}}%
+ }%
+ }%
+ {}%si l'argument optionnel est vide
+ \IfStrEq{#2}{t}%
+ {%
+ \IfBooleanTF{#1}%
+ {\ensuremath{\tfrac{\num{\numerateur}}{\num{\denominateur}}}}%
+ {%
+ \ifthenelse{\numerateur < 0}%
+ {\ensuremath{-\frac{\num{\fpeval{abs(\numerateur)}}}{\num{\denominateur}}}}%
+ {\ensuremath{\frac{\num{\numerateur}}{\num{\denominateur}}}}%
+ }%
+ }%
+ {}%si l'argument optionnel est vide
+ \IfStrEq{#2}{n}%
+ {%
+ \ensuremath{\nicefrac{\num{\numerateur}}{\num{\denominateur}}}%
+ }%
+ {}%si l'argument optionnel est vide
+ }{%si non := entier
+ \num{\calculargument}%on affiche l'entier, avec le package siunitx
+ }%
+}
+
+%affichage d'un label en radians
+\NewDocumentCommand\FormatterTrigo{ O{t} m }{%étoilée en dfrac
+ \IfStrEq{#2}{0}%cas où l'argument vaut 0
+ {\def\restmp{0}}%
+ {%
+ \StrDel{#2}{*}[\restmpsansmoins]%
+ \StrSubstitute{\restmpsansmoins}{pi}{\pi}[\restmppi]%
+ \IfSubStr{#2}{/}%
+ {%
+ \StrCut{\restmppi}{/}\tmpnum\tmpdenom%
+ \IfSubStr{\tmpnum}{-}%
+ {%
+ \StrDel{\tmpnum}{-}[\restmppinum]%
+ \IfStrEqCase{#1}{%
+ {t}{\def\restmp{-\frac{\restmppinum}{\tmpdenom}}}%
+ {d}{\def\restmp{-\displaystyle\frac{\restmppinum}{\tmpdenom}}}%
+ {n}{\def\restmp{\nicefrac{-\restmppinum}{\tmpdenom}}}%
+ }%
+ }%
+ {%
+ \IfStrEqCase{#1}{%
+ {t}{\def\restmp{\frac{\tmpnum}{\tmpdenom}}}%
+ {d}{\def\restmp{\displaystyle\frac{\tmpnum}{\tmpdenom}}}%
+ {n}{\def\restmp{\nicefrac{\tmpnum}{\tmpdenom}}}%
+ }%
+ }%
+ }%
+ {%
+ \def\restmp{\restmppi}%
+ }%
+ }%
+ \ensuremath{\restmp}%
+}
+
+%====FORMATAGE DES RACINES SIMPLES
+\NewDocumentCommand\FormatterRacine{ O{t} m }{%
+ \IfStrEq{#2}{0}%cas où l'argument vaut 0
+ {\ensuremath{0}}%
+ {%
+ \IfSubStr{#2}{sqrt}%
+ {%
+ \StrDel{#2}{*}[\tmpargbrut]%
+ \StrBetween[1,1]{\tmpargbrut}{sqrt(}{)}[\tmpargnumrac]%
+ \StrBefore{\tmpargbrut}{sqrt}[\tmparavantrac]%
+ \IfStrEqCase{\tmparavantrac}{
+ {}{\xdef\tmparavantrac{}}%
+ {-}{\xdef\tmparavantrac{-}}%
+ }[\xdef\tmparavantrac{\num{\tmparavantrac}}]%
+ \IfSubStr{\tmpargbrut}{/}%
+ {%
+ \StrBehind{\tmpargbrut}{/}[\tmpargdenomrac]%
+ \IfStrEqCase{#1}{%
+ {d}{%
+ \ensuremath{\displaystyle\frac{\tmparavantrac\sqrt{\num{\tmpargnumrac}}}{\num{\tmpargdenomrac}}}%
+ }%
+ {t}{%
+ \ensuremath{\frac{\tmparavantrac\sqrt{\num{\tmpargnumrac}}}{\num{\tmpargdenomrac}}}%
+ }%
+ {n}{%
+ \ensuremath{\nicefrac{\tmparavantrac\sqrt{\num{\tmpargnumrac}}}{\num{\tmpargdenomrac}}}%
+ }%
+ }%
+ }%
+ {%
+ \ensuremath{\tmparavantrac\sqrt{\num{\tmpargnumrac}}}%
+ }%
+ }%
+ {%
+ \FormatterFraction[#1]{#2}%
+ }%
+ }%
+}
+
+%====COMMANDE INTERNE DE CONVERSION
+\ExplSyntaxOn
+ \NewDocumentCommand\ConvertirPtToCm{ m } { \dim_to_decimal_in_unit:nn { #1 } { 1 cm } }
+\ExplSyntaxOff
+
+%====RECUPERER COORDONNEES NOEUD
+\NewDocumentCommand\RecupererAbscisse{ m O{\monabs} }{%
+ \path #1;
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef#2{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}%
+}
+\NewDocumentCommand\RecupererOrdonnee{ m O{\monordo} }{%
+ \path #1;
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef#2{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}%
+}
+
+\NewDocumentCommand\RecupererCoordonnees{ m O{\monabs} O{\monordo} }{%
+ \RecupererAbscisse{#1}[#2]%
+ \RecupererOrdonnee{#1}[#3]%
+}
+
+%===UNITÉS
+\newcommand\DistanceEntreNoeuds[3][\MyTmpDist]{%
+ \pgfpointdiff{\pgfpointanchor{#2}{center}}
+ {\pgfpointanchor{#3}{center}}
+ % no need to use a new dimen
+ \pgf@xa=\pgf@x
+ \pgf@ya=\pgf@y
+ % to convert from pt to cm
+ \pgfmathparse{veclen(\pgf@xa,\pgf@ya)/28.45274}
+ \global\let#1\pgfmathresult %macro globale
+}
+
+\newcommand\TikZUnites{
+ \coordinate (@0) at (0,0) ;
+ \coordinate (@X) at (1,0) ;
+ \coordinate (@Y) at (0,1) ;
+ \DistanceEntreNoeuds[\pflxunit]{@0}{@X}
+ \DistanceEntreNoeuds[\pflyunit]{@0}{@Y}
+}
+
+%====ENVIRONNEMENT
+\defKV[GraphiqueTikz]{%
+ TailleGrad=\def\pflthickgrad{#1}
+}
+\setKVdefault[GraphiqueTikz]{%
+ AffCadre=false,%
+ TailleGrad=3pt
+}
+
+\NewDocumentEnvironment{GraphiqueTikz}{ O{} D<>{} }%
+%1 = options tikz, classiques
+%2 = clés spécifiques
+{%
+ \restoreKV[GraphiqueTikz]%
+ \setKV[GraphiqueTikz]{#2}%
+ %l'environnement
+ \begin{tikzpicture}[#1]%
+ %unités x/y pour des calculs de coordonnées
+ \TikZUnites
+ %noeuds
+ \coordinate (bbxTop) at (current bounding box.north) ;
+ \coordinate (bbxBottom) at (current bounding box.south) ;
+ \ifboolKV[GraphiqueTikz]{AffCadre}{\draw[pflcadre] ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ;}{}%
+ %back to normal
+}%
+{%
+ \end{tikzpicture}%
+}
+
+%====AXES
+\defKV[GraphiqueTikzAxes]{
+ Format=\def\pflformataxes{#1}
+}
+\setKVdefault[GraphiqueTikzAxes]{%
+ Grille=true,%
+ Elargir=0,%
+ Grads=true,%
+ Origine=false,%
+ Police={},%
+ Format=num,%
+ Traits=true,%
+ Dernier=false,%
+ Derriere=false,%
+ Devant=false
+}
+
+\NewDocumentCommand\FormatterValeurAxex{ m m }{%
+ \IfStrEqCase{#1}{%
+ {num}{\num{#2}}%
+ {annee}{#2}%
+ {frac}{\FormatterFraction{#2}}%
+ {dfrac}{\FormatterFraction[d]{#2}}%
+ {nfrac}{\FormatterFraction[n]{#2}}%
+ {trig}{\FormatterTrigo{#2}}%
+ {dtrig}{\FormatterTrigo[d]{#2}}%
+ {ntrig}{\FormatterTrigo[n]{#2}}%
+ {sqrt}{\FormatterRacine{#2}}%
+ {dsqrt}{\FormatterRacine[d]{#2}}%
+ {nsqrt}{\FormatterRacine[n]{#2}}%
+ }[#2]%
+}
+
+\NewDocumentCommand\FormatterValeurAxey{ m m }{%
+ \IfStrEqCase{#1}{%
+ {num}{\num{#2}}%
+ {annee}{#2}%
+ {frac}{\FormatterRacine{#2}}%
+ {dfrac}{\FormatterFraction[d]{#2}}%
+ {nfrac}{\FormatterFraction[n]{#2}}%
+ {trig}{\FormatterTrigo{#2}}%
+ {dtrig}{\FormatterTrigo[d]{#2}}%
+ {ntrig}{\FormatterTrigo[n]{#2}}%
+ {sqrt}{\FormatterRacine{#2}}%
+ {dsqrt}{\FormatterRacine[d]{#2}}%
+ {nsqrt}{\FormatterRacine[n]{#2}}%
+ }[#2]%
+}
+
+\NewDocumentCommand\TracerAxesGrilles{ s O{} m D<>{#3} m D<>{#5} }{%
+ \restoreKV[GraphiqueTikzAxes]%
+ \setKV[GraphiqueTikzAxes]{#2}%
+ %cas particuliers sous/sur impression
+ \ifboolKV[GraphiqueTikzAxes]{Derriere}%
+ {%
+ \setKV[GraphiqueTikzAxes]{Grads=false}
+ }%
+ {}%
+ \ifboolKV[GraphiqueTikzAxes]{Devant}%
+ {%
+ \setKV[GraphiqueTikzAxes]{Grille=false}
+ }%
+ {}%
+ %suite
+ \IfSubStr{\pflformataxes}{/}%
+ {%
+ \StrCut{\pflformataxes}{/}{\pflformataxex}{\pflformataxey}%
+ }%
+ {%
+ \xdef\pflformataxex{\pflformataxes}\xdef\pflformataxey{\pflformataxes}%
+ }%
+ \ifboolKV[GraphiqueTikzAxes]{Grille}%
+ {%
+ \draw[pflgrilles,xstep=\pflgrillexs,ystep=\pflgrilleys] ({\pflxmin},{\pflymin}) grid ({\pflxmax},{\pflymax});
+ \draw[pflgrillep,xstep=\pflgrillex,ystep=\pflgrilley] ({\pflxmin},{\pflymin}) grid ({\pflxmax},{\pflymax});
+ \ifboolKV[GraphiqueTikzAxes]{Dernier}%
+ {%
+ \draw[pflgrillep] ({\pflxmin},{\pflymax})--({\pflxmax},{\pflymax}) ;
+ \draw[pflgrillep] ({\pflxmax},{\pflymin})--({\pflxmax},{\pflymax}) ;
+ }%
+ {}%
+ }%
+ {}%
+ \draw[pflaxes] ({\pflxmin},{\pflOy}) -- ([xshift={\useKV[GraphiqueTikzAxes]{Elargir}}]{\pflxmax},{\pflOy}) ;
+ \draw[pflaxes] ({\pflOx},{\pflymin}) -- ([yshift={\useKV[GraphiqueTikzAxes]{Elargir}}]{\pflOx},{\pflymax}) ;
+ \IfEq{#3}{auto}%
+ {%
+ \xdef\tmprangexvalues{\xintfloateval{seq(i,i=\pflxmin..[\pflgrillex]..\pflxmax)}}\StrDel{\tmprangexvalues}{ }[\tmprangexvalues]%
+ \xdef\pflformataxex{num}%
+ }%
+ {%
+ \xdef\tmprangexvalues{#3}%
+ }%
+ \IfEq{#5}{auto}%
+ {%
+ \xdef\tmprangeyvalues{\xintfloateval{seq(i,i=\pflymin..[\pflgrilley]..\pflymax)}}\StrDel{\tmprangeyvalues}{ }[\tmprangeyvalues]%
+ \xdef\pflformataxey{num}%
+ }%
+ {%
+ \xdef\tmprangeyvalues{#5}%
+ }%
+ \foreach \x in \tmprangexvalues {\draw[pfltrait] ([yshift=\pflthickgrad]{\x},{\pflOy})--++(0,{-2*\pflthickgrad}) ;}
+ \foreach \y in \tmprangeyvalues {\draw[pfltrait] ([xshift=\pflthickgrad]{\pflOx},{\y})--++({-2*\pflthickgrad},0) ;}
+ \ifboolKV[GraphiqueTikzAxes]{Grads}%
+ {%
+ %origine
+ \ifboolKV[GraphiqueTikzAxes]{Origine}%
+ {%
+ \draw ({\pflOx},{\pflOy}) node[below left,font={\useKV[GraphiqueTikzAxes]{Police}}] {\FormatterValeurAxex{\pflformataxex}{\pflOx}} ;
+ %\draw (\pflOx,\pflOy) node[below left,font={\useKV[GraphiqueTikzAxes]{Police}}] {\ifboolKV[GraphiqueTikzAxes]{Num}{\num{\pflOx}}{\pflOx}} ;
+ }%
+ {}%
+ %graduations x, sauf si auto...
+ \foreach \x in \tmprangexvalues {%
+ \IfBooleanTF{#1}%
+ {%
+ \xintifboolexpr{\x == \pflOx}{}{\draw ([yshift=-\pflthickgrad]{\x},{\pflOy}) node[below,font={\useKV[GraphiqueTikzAxes]{Police}}] {\FormatterValeurAxex{\pflformataxex}{\x}} ;}
+ %\xintifboolexpr{\x == \pflOx}{}{\draw ([yshift=-\pflthickgrad]\x,\pflOy) node[below,font={\useKV[GraphiqueTikzAxes]{Police}}] {\ifboolKV[GraphiqueTikzAxes]{Num}{\num{\x}}{\x}} ;}
+ }%
+ {%
+ \draw ([yshift=-\pflthickgrad]{\x},{\pflOy}) node[below,font={\useKV[GraphiqueTikzAxes]{Police}}] {\FormatterValeurAxex{\pflformataxex}{\x}} ;
+ %\draw ([yshift=-\pflthickgrad]\x,\pflOy) node[below,font={\useKV[GraphiqueTikzAxes]{Police}}] {\ifboolKV[GraphiqueTikzAxes]{Num}{\num{\x}}{\x}} ;
+ }%
+ }%
+ \foreach \y in \tmprangeyvalues {%
+ \IfBooleanTF{#1}%
+ {%
+ \xintifboolexpr{\y == \pflOy}{}{\draw ([xshift=-\pflthickgrad]{\pflOx},{\y}) node[left,font={\useKV[GraphiqueTikzAxes]{Police}}] {\FormatterValeurAxey{\pflformataxey}{\y}} ;}
+ %\xintifboolexpr{\y == \pflOy}{}{\draw ([xshift=-\pflthickgrad]\pflOx,\y) node[left,font={\useKV[GraphiqueTikzAxes]{Police}}] {\ifboolKV[GraphiqueTikzAxes]{Num}{\num{\y}}{\y}} ;}
+ }%
+ {%
+ \draw ([xshift=-\pflthickgrad]{\pflOx},{\y}) node[left,font={\useKV[GraphiqueTikzAxes]{Police}}] {\FormatterValeurAxey{\pflformataxey}{\y}} ;
+ %\draw ([xshift=-\pflthickgrad]\pflOx,\y) node[left,font={\useKV[GraphiqueTikzAxes]{Police}}] {\ifboolKV[GraphiqueTikzAxes]{Num}{\num{\y}}{\y}} ;
+ }%
+ }%
+ }%
+ {}%
+}
+
+%===DEFINIR POINTS
+\setKVdefault[GraphiqueTikzDefPoints]{Couleur=black,Aff=false,Style=o}
+
+\NewDocumentCommand\DefinirPts{ O{} m }{%
+ \restoreKV[GraphiqueTikzDefPoints]%
+ \setKV[GraphiqueTikzDefPoints]{#1}%
+ \foreach \tmpnamept/\tmpxpt/\tmpypt in {#2}{%
+ \coordinate (\tmpnamept) at ({\tmpxpt},{\tmpypt}) ;
+ \ifboolKV[GraphiqueTikzDefPoints]{Aff}%
+ {%
+ \MarquerPts*[Style={\useKV[GraphiqueTikzDefPoints]{Style}},Couleur={\useKV[GraphiqueTikzDefPoints]{Couleur}}]{(\tmpnamept)}
+ %\filldraw[{\useKV[GraphiqueTikzDefPoints]{Couleur}}] (\tmpnamept) circle[pflpointc] ;
+ }%
+ {}%
+ }
+}
+
+\defKV[GraphiqueTikzMarkPoints]{%
+ Couleur=\def\pflcouleurpoints{#1},%
+ Style=\def\pflstylepoints{#1}
+}
+\setKVdefault[GraphiqueTikzMarkPoints]{%
+ Couleur=black,%
+ Taillec=2pt,%
+ Taillex=2pt,%
+ Tailleo=1.75pt,%
+ Style=o
+}
+\NewDocumentCommand\MarquerPts{ s O{} D<>{\normalfont\normalsize} m }{%
+ %étoilée = sans label
+ %2=clés
+ %3=points
+ \restoreKV[GraphiqueTikzMarkPoints]%
+ \setKV[GraphiqueTikzMarkPoints]{#2}%
+ \IfBooleanTF{#1}%
+ {%
+ \IfStrEq{\pflstylepoints}{x}%
+ {%
+ \foreach \Point in {#4} {%
+ \draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}}] \Point pic{pflptcroix={\useKV[GraphiqueTikzMarkPoints]{Taillex}}/45} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{+}%
+ {%
+ \foreach \Point in {#4} {%
+ \draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}}] \Point pic{pflptcroix={\useKV[GraphiqueTikzMarkPoints]{Taillex}}/90} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{c}%
+ {%
+ \foreach \Point in {#4} {%
+ \filldraw[draw=none,fill={\useKV[GraphiqueTikzMarkPoints]{Couleur}}] \Point pic{pflptcarre={\useKV[GraphiqueTikzMarkPoints]{Taillec}}/0} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{d}%
+ {%
+ \foreach \Point in {#4} {%
+ \filldraw[draw=none,fill={\useKV[GraphiqueTikzMarkPoints]{Couleur}}] \Point pic{pflptcarre={\useKV[GraphiqueTikzMarkPoints]{Tailleo}}/45} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{o}%
+ {%
+ \IfSubStr{\pflcouleurpoints}{/}%
+ {%
+ \StrCut{\pflcouleurpoints}{/}{\pflcouleurpointsA}{\pflcouleurpointsB}%
+ \foreach \Point in {#4} {%
+ \filldraw[pfltrait,fill=\pflcouleurpointsB,draw=\pflcouleurpointsA] \Point circle[radius={\useKV[GraphiqueTikzMarkPoints]{Tailleo}}] ;
+ }%
+ }%
+ {%
+ \foreach \Point in {#4} {%
+ \filldraw[\pflcouleurpoints] \Point circle[radius={\useKV[GraphiqueTikzMarkPoints]{Tailleo}}] ;
+ }%
+ }%
+ }%
+ {}%
+ }%
+ {%avec label
+ \IfStrEq{\pflstylepoints}{x}%
+ {%
+ \foreach \Point/\Label/\Pos in {#4} {%
+ \draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}}] \Point pic{pflptcroix={\useKV[GraphiqueTikzMarkPoints]{Taillex}}/45} node[\Pos,font=#3] {\Label} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{+}%
+ {%
+ \foreach \Point/\Label/\Pos in {#4} {%
+ \draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}}] \Point pic{pflptcroix={\useKV[GraphiqueTikzMarkPoints]{Taillex}}/90} node[\Pos,font=#3] {\Label} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{c}%
+ {%
+ \foreach \Point/\Label/\Pos in {#4} {%
+ \filldraw[draw=none,fill={\useKV[GraphiqueTikzMarkPoints]{Couleur}}] \Point pic{pflptcarre={\useKV[GraphiqueTikzMarkPoints]{Taillec}}/0} node[\Pos,{\useKV[GraphiqueTikzMarkPoints]{Couleur}},font=#3] {\Label} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{d}%
+ {%
+ \foreach \Point/\Label/\Pos in {#4} {%
+ \filldraw[draw=none,fill={\useKV[GraphiqueTikzMarkPoints]{Couleur}}] \Point pic{pflptcarre={\useKV[GraphiqueTikzMarkPoints]{Tailleo}}/45} node[\Pos,{\useKV[GraphiqueTikzMarkPoints]{Couleur}},font=#3] {\Label} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{o}%
+ {%
+ \IfSubStr{\pflcouleurpoints}{/}%
+ {%
+ \StrCut{\pflcouleurpoints}{/}{\pflcouleurpointsA}{\pflcouleurpointsB}%
+ \foreach \Point/\Label/\Pos in {#4} {%
+ \draw[pfltrait,\pflcouleurpointsA,fill=\pflcouleurpointsB] \Point circle[radius={\useKV[GraphiqueTikzMarkPoints]{Tailleo}}] node[\Pos,font=#3] {\Label} ;
+ }%
+ }%
+ {%
+ \foreach \Point/\Label/\Pos in {#4} {%
+ \filldraw[\pflcouleurpoints] \Point circle[radius={\useKV[GraphiqueTikzMarkPoints]{Tailleo}}] node[\Pos,font=#3] {\Label} ;
+ }%
+ }%
+ }%
+ {}%
+ }%
+}
+
+%===AJOUTER DES VALEURS MANUELLEMENT
+\NewDocumentCommand\RajouterValeursAxeX{ O{} m m }{%
+ \restoreKV[GraphiqueTikzAxes]%
+ \setKV[GraphiqueTikzAxes]{#1}%
+ \ifboolKV[GraphiqueTikzAxes]{Traits}{\foreach \x in {#2}{\draw[pfltrait] ([yshift=\pflthickgrad]{\x},{\pflOy})--++(0,{-2*\pflthickgrad}) ;}}{}%
+ \readlist*\LstValX{#2}%
+ \readlist*\LstValFmtX{#3}%
+ \foreach \i in {1,...,\LstValXlen}{%
+ \itemtomacro\LstValX[\i]\mavalx%
+ \itemtomacro\LstValFmtX[\i]\mavalfmtx%
+ \draw ([yshift=-\pflthickgrad]{\mavalx},{\pflOy}) node[below,font={\useKV[GraphiqueTikzAxes]{Police}}] {\mavalfmtx} ;
+ }%
+}
+
+\NewDocumentCommand\RajouterValeursAxeY{ O{} m m }{%
+ \restoreKV[GraphiqueTikzAxes]%
+ \setKV[GraphiqueTikzAxes]{#1}%
+ \ifboolKV[GraphiqueTikzAxes]{Traits}{\foreach \y in {#2}{\draw[pfltrait] ([xshift=\pflthickgrad]{\pflOx},{\y})--++({-2*\pflthickgrad},0) ;}}{}%
+ \readlist*\LstValY{#2}%
+ \readlist*\LstValFmtY{#3}%
+ \foreach \i in {1,...,\LstValXlen}{%
+ \itemtomacro\LstValY[\i]\mavaly%
+ \itemtomacro\LstValFmtY[\i]\mavalfmty%
+ \draw ([xshift=-\pflthickgrad]{\pflOx},{\mavaly}) node[left,font={\useKV[GraphiqueTikzAxes]{Police}}] {\mavalfmty} ;
+ }%
+}
+
+%====FONCTIONS ET COURBES 'classique + interpo + spline'
+\defKV[GraphiqueTikzCourbe]{%
+ Pas=\def\pflstepcurve{#1},%
+ Nom=\def\pflnamecurve{#1}
+}
+\setKVdefault[GraphiqueTikzCourbe]{%
+ Couleur=black,%
+ Debut={\pflxmin},%
+ Fin={\pflxmax},%
+ Pas={},%
+ Clip=true,%
+ Nom={},%
+ Trace=false,%
+ Tension=0.5
+}
+
+\NewDocumentCommand\DefinirFonction{ O{} D<>{f} m }{%old version
+ \restoreKV[GraphiqueTikzCourbe]%
+ \setKV[GraphiqueTikzCourbe]{#1}%
+ \xintdeffloatfunc #2(x) := #3 ;
+ \IfStrEq{\pflstepcurve}{}%
+ {%
+ \xdef\pflstepcurve{\xintfloateval{((\useKV[GraphiqueTikzCourbe]{Fin})-(\useKV[GraphiqueTikzCourbe]{Debut}))/100}}%
+ }%
+ {}%
+ \ifboolKV[GraphiqueTikzCourbe]{Clip}{\begin{scope}\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});}{}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \ifboolKV[GraphiqueTikzCourbe]{Trace}%
+ {%
+ \path[draw,pflcourbe,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphiqueTikzCourbe]{Debut}}..[\pflstepcurve]..{\useKV[GraphiqueTikzCourbe]{Fin}},{\useKV[GraphiqueTikzCourbe]{Fin}})
+ \relax
+ };
+ }%
+ {%
+ \path[draw=none,pflcourbe,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphiqueTikzCourbe]{Debut}}..[\pflstepcurve]..{\useKV[GraphiqueTikzCourbe]{Fin}},{\useKV[GraphiqueTikzCourbe]{Fin}})
+ \relax
+ };
+ }%
+ \ifboolKV[GraphiqueTikzCourbe]{Clip}{\end{scope}}{}
+}
+
+\NewDocumentCommand\DefinirCourbe{ O{} D<>{f} m }{%
+ \restoreKV[GraphiqueTikzCourbe]%
+ \setKV[GraphiqueTikzCourbe]{#1}%
+ \xintdeffloatfunc #2(x) := #3 ;
+ \IfStrEq{\pflstepcurve}{}%
+ {%
+ \xdef\pflstepcurve{\xintfloateval{((\useKV[GraphiqueTikzCourbe]{Fin})-(\useKV[GraphiqueTikzCourbe]{Debut}))/100}}%
+ }%
+ {}%
+ \ifboolKV[GraphiqueTikzCourbe]{Clip}{\begin{scope}\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});}{}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \ifboolKV[GraphiqueTikzCourbe]{Trace}%
+ {%
+ \path[draw,pflcourbe,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphiqueTikzCourbe]{Debut}}..[\pflstepcurve]..{\useKV[GraphiqueTikzCourbe]{Fin}},{\useKV[GraphiqueTikzCourbe]{Fin}})
+ \relax
+ };
+ }%
+ {%
+ \path[draw=none,pflcourbe,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphiqueTikzCourbe]{Debut}}..[\pflstepcurve]..{\useKV[GraphiqueTikzCourbe]{Fin}},{\useKV[GraphiqueTikzCourbe]{Fin}})
+ \relax
+ };
+ }%
+ \ifboolKV[GraphiqueTikzCourbe]{Clip}{\end{scope}}{}
+}
+
+\NewDocumentCommand\TracerCourbe{ O{} D<>{} m }{%
+ \restoreKV[GraphiqueTikzCourbe]%
+ \setKV[GraphiqueTikzCourbe]{#1}%
+ \IfStrEq{\pflstepcurve}{}%
+ {%
+ \xdef\pflstepcurve{\xintfloateval{((\useKV[GraphiqueTikzCourbe]{Fin})-(\useKV[GraphiqueTikzCourbe]{Debut}))/100}}%
+ }%
+ {}%
+ \ifboolKV[GraphiqueTikzCourbe]{Clip}{\begin{scope}\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});}{}
+ \IfEq{\pflnamecurve}{}%
+ {%
+ \draw[pflcourbe,{\useKV[GraphiqueTikzCourbe]{Couleur}}] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#3),x={\useKV[GraphiqueTikzCourbe]{Debut}}..[\pflstepcurve]..{\useKV[GraphiqueTikzCourbe]{Fin}},{\useKV[GraphiqueTikzCourbe]{Fin}})
+ \relax
+ };
+ }%
+ {%
+ \path[draw,pflcourbe,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#3),x={\useKV[GraphiqueTikzCourbe]{Debut}}..[\pflstepcurve]..{\useKV[GraphiqueTikzCourbe]{Fin}},{\useKV[GraphiqueTikzCourbe]{Fin}})
+ \relax
+ };
+ }%
+ \ifboolKV[GraphiqueTikzCourbe]{Clip}{\end{scope}}{}
+}
+
+\NewDocumentCommand\DefinirListeInterpo{ m O{\malisteinterpo} }{%
+ \def#2{#1}%
+}
+
+\NewDocumentCommand\DefinirCourbeInterpo{ O{} m }{%
+ \restoreKV[GraphiqueTikzCourbe]%
+ \setKV[GraphiqueTikzCourbe]{#1}%
+ \begin{scope}
+ \ifboolKV[GraphiqueTikzCourbe]{Trace}%
+ {%
+ \path[draw,pflcourbe,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] plot[smooth,tension={\useKV[GraphiqueTikzCourbe]{Tension}}] coordinates {#2};
+ }%
+ {%
+ \path[draw=none,pflcourbe,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] plot[smooth,tension={\useKV[GraphiqueTikzCourbe]{Tension}}] coordinates {#2};
+ }%
+ \end{scope}
+}
+
+\NewDocumentCommand\TracerCourbeInterpo{ O{} m }{%
+ %2=liste
+ \restoreKV[GraphiqueTikzCourbe]%
+ \setKV[GraphiqueTikzCourbe]{#1}%
+ \begin{scope}
+ \draw[pflcourbe,{\useKV[GraphiqueTikzCourbe]{Couleur}}] plot [smooth,tension={\useKV[GraphiqueTikzCourbe]{Tension}}] coordinates {#2} ;
+ \end{scope}
+}
+
+\NewDocumentCommand\DefinirListeSpline{ m O{\malistespline} }{%
+ \def#2{#1}%
+}
+
+\newcommand\pflextractcoeff[2]{%1=liste,2=numero
+ \setsepchar{§}%
+ \readlist*\lcoeffs{#1}
+ \ifnum \lcoeffslen=1
+ \def\COEFFA{#1}
+ \def\COEFFB{#1}
+ \else
+ \itemtomacro\lcoeffs[#2]\COEFF
+ \IfSubStr{\COEFF}{/}%
+ {\StrCut{\COEFF}{/}{\COEFFA}{\COEFFB}}%
+ {\def\COEFFA{\COEFF}\def\COEFFB{\COEFF}}
+ \fi
+}
+
+\defKV[GraphiqueTikzSpline]{%
+ Nom=\def\pflsplinename{#1},%
+ Coeffs=\def\pflsplinecoeffs{#1}
+}
+
+\setKVdefault[GraphiqueTikzSpline]{%
+ Nom=spline,%
+ Couleur=black,%
+ Coeffs=3,%
+ Trace=false
+}
+
+\NewDocumentCommand\GenererSpline{ m m O{\monspline} }{%
+ %1=liste
+ \setsepchar[.]{§./}%
+ \readlist*\SPLlistepoints{#1}%
+ %les données
+ \def\tmpsplinenumdeb{1}
+ \def\tmpsplinenumfin{\SPLlistepointslen}%
+ \pflextractcoeff{#2}{\tmpsplinenumdeb}%
+ %nb de calculs
+ \def\SPLnbsplines{\inteval{\tmpsplinenumfin-1}}%
+ %extraction des coordonnées
+ \itemtomacro\SPLlistepoints[\tmpsplinenumdeb,1]\xa%
+ \itemtomacro\SPLlistepoints[\tmpsplinenumdeb,2]\ya%
+ \itemtomacro\SPLlistepoints[\tmpsplinenumdeb,3]\fprimea%
+ \itemtomacro\SPLlistepoints[\tmpsplinenumdeb,1]\xb%
+ \itemtomacro\SPLlistepoints[\tmpsplinenumdeb,2]\yb%
+ \itemtomacro\SPLlistepoints[\tmpsplinenumdeb,3]\fprimeb%
+ \xdef#3{(\xa,\ya) ..controls +({atan \fprimea}:{(\xb-\xa)/\COEFFA}) and +({-180 + atan \fprimeb}:{(\xb-\xa)/\COEFFA}).. (\xb,\yb)}%
+ \foreach \i in {\tmpsplinenumdeb,...,\SPLnbsplines}{%
+ %extraction des coeffs de compensation
+ \pflextractcoeff{#2}{\i}%
+ \def\j{\inteval{\i+1}}%
+ \itemtomacro\SPLlistepoints[\i,1]\xa%
+ \itemtomacro\SPLlistepoints[\i,2]\ya%
+ \itemtomacro\SPLlistepoints[\i,3]\fprimea%
+ \itemtomacro\SPLlistepoints[\j,1]\xb%
+ \itemtomacro\SPLlistepoints[\j,2]\yb%
+ \itemtomacro\SPLlistepoints[\j,3]\fprimeb%
+ \xdef#3{#3 ..controls +({atan \fprimea}:{(\xb-\xa)/\COEFFA}) and +({-180 + atan \fprimeb}:{(\xb-\xa)/\COEFFB}).. (\xb,\yb)}%
+ }%
+}
+
+\NewDocumentCommand\DefinirCourbeSpline{ O{} m D<>{\monspline} }{%
+ %1=liste
+ \restoreKV[GraphiqueTikzSpline]%
+ \setKV[GraphiqueTikzSpline]{#1}%
+ \GenererSpline{#2}{\pflsplinecoeffs}[#3]%
+ \begin{scope}
+ \ifboolKV[GraphiqueTikzSpline]{Trace}%
+ {%
+ \path[draw,pflcourbe,{\useKV[GraphiqueTikzSpline]{Couleur}},name path global=\pflsplinename] #3 ;
+ }%
+ {%
+ \path[draw=none,pflcourbe,name path global=\pflsplinename] #3 ;
+ }%
+ \end{scope}
+}
+
+\NewDocumentCommand\DefinirSpline{ O{} m D<>{\monspline} }{%old version
+ %1=liste
+ \restoreKV[GraphiqueTikzSpline]%
+ \setKV[GraphiqueTikzSpline]{#1}%
+ \GenererSpline{#2}{\pflsplinecoeffs}[#3]%
+ \begin{scope}
+ \ifboolKV[GraphiqueTikzSpline]{Trace}%
+ {%
+ \path[draw,pflcourbe,{\useKV[GraphiqueTikzSpline]{Couleur}},name path global=\pflsplinename] #3 ;
+ }%
+ {%
+ \path[draw=none,pflcourbe,name path global=\pflsplinename] #3 ;
+ }%
+ \end{scope}
+}
+
+\NewDocumentCommand\TracerCourbeSpline{ O{} m D<>{\monspline} }{%
+ %1=liste
+ \restoreKV[GraphiqueTikzSpline]%
+ \setKV[GraphiqueTikzSpline]{#1}%
+ \GenererSpline{#2}{\pflsplinecoeffs}[#3]%
+ \begin{scope}
+ \draw[pflcourbe,{\useKV[GraphiqueTikzSpline]{Couleur}}] #3 ;
+ \end{scope}
+}
+
+\NewDocumentCommand\TracerSpline{ O{} m D<>{\monspline} }{%old version
+ %1=liste
+ \restoreKV[GraphiqueTikzSpline]%
+ \setKV[GraphiqueTikzSpline]{#1}%
+ \GenererSpline{#2}{\pflsplinecoeffs}[#3]%
+ \begin{scope}
+ \draw[pflcourbe,{\useKV[GraphiqueTikzSpline]{Couleur}}] #3 ;
+ \end{scope}
+}
+
+%===INTERSECTION & ANTÉCÉDENTS
+\defKV[GraphiqueTikzIntersect]{%
+ Nom=\def\pflintercurves{#1}
+}
+\setKVdefault[GraphiqueTikzIntersect]{%
+ Nom=S,
+ Aff=true,
+ Couleur=black,
+ AffDroite=false,%
+ Traits=false,%
+ Style=o
+}
+
+\NewDocumentCommand\TrouverIntersections{ O{} m m D<>{\myt} }{%
+ \restoreKV[GraphiqueTikzIntersect]%
+ \setKV[GraphiqueTikzIntersect]{#1}%
+ \path[name intersections={of=#2 and #3,name=\pflintercurves,total=\t}] \pgfextra{\xdef#4{\t}};
+ \ifboolKV[GraphiqueTikzIntersect]{Aff}%
+ {%
+ \xintifboolexpr{#4 == 0}{}%
+ {%
+ \foreach \i in {1,...,#4}{%
+ \ifboolKV[GraphiqueTikzIntersect]{Traits}%
+ {%
+ \draw[pfltraitimg,{\useKV[GraphiqueTikzIntersect]{Couleur}}]let \p1 = (\pflintercurves-\i) in (\pflintercurves-\i) -- ({\x1},{\pflOy}) ;
+ }%
+ {}%
+ \MarquerPts*[Style={\useKV[GraphiqueTikzIntersect]{Style}},Couleur={\useKV[GraphiqueTikzIntersect]{Couleur}}]{(\pflintercurves-\i)}
+ %\filldraw[{\useKV[GraphiqueTikzIntersect]{Couleur}}] (\pflintercurves-\i) circle[pflpointc] ;
+ }
+ }%
+ }%
+ {}%
+}
+
+\NewDocumentCommand\TrouverAntecedents{ O{} m m D<>{\myantec} }{%
+ \restoreKV[GraphiqueTikzIntersect]%
+ \setKV[GraphiqueTikzIntersect]{#1}%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \ifboolKV[GraphiqueTikzIntersect]{AffDroite}%
+ {%
+ \path[draw,{\useKV[GraphiqueTikzIntersect]{Couleur}},pflcourbe,name path=tmpanteced] ({\pflxmin},{#3})--({\pflxmax},{#3}) ;
+ }%
+ {%
+ \path[draw=none,pflcourbe,name path=tmpanteced] ({\pflxmin},{#3})--({\pflxmax},{#3}) ;
+ }%
+ \path[name intersections={of=#2 and tmpanteced,name=\pflintercurves,total=\t}] \pgfextra{\xdef#4{\t}};
+ \ifboolKV[GraphiqueTikzIntersect]{Aff}%
+ {%
+ \xintifboolexpr{#4 == 0}{}%
+ {%
+ \foreach \i in {1,...,#4}{%
+ \MarquerPts*[Style={\useKV[GraphiqueTikzIntersect]{Style}},Couleur={\useKV[GraphiqueTikzIntersect]{Couleur}}]{(\pflintercurves-\i)}
+ %\filldraw[{\useKV[GraphiqueTikzIntersect]{Couleur}}] (\pflintercurves-\i) circle[pflpointc] ;
+ }
+ }%
+ }%
+ {}%
+ \end{scope}
+}
+
+%====INTÉGRALES
+%v2 avec modification de la clé [Type=...] ?
+\defKV[GraphiqueTikzIntegr]{%
+ Couleurs=\def\pfldomtikzcolors{#1},%
+ Style=\def\pfldomtikzstyle{#1},%
+ Opacite=\def\pfldomtikzopac{#1},%
+ Hachures=\def\pfldomtikzhatch{#1},%
+ Type=\def\pfldomtikztype{#1},%
+ Pas=\def\pflstepcurve{#1},%
+ Bornes=\def\pflintbornes{#1},%
+ Jonction=\def\pfldomtikzjoin{#1},%
+ NomInterpo=\def\pfldomtikznameinterpo{#1},%
+ NomInterpoB=\def\pfldomtikznameinterpob{#1},%
+ NomSpline=\def\pfldomtikznamespline{#1},%
+ NomSplineB=\def\pfldomtikznamesplineb{#1}
+}
+\setKVdefault[GraphiqueTikzIntegr]{%
+ Couleurs=gray,%
+ Style=remplissage,%
+ Opacite=0.5,%
+ Hachures={north west lines},%
+ Type=fct,%
+ Pas={},%
+ Jonction=bevel,%
+ Bornes=abs,%
+ Bord=true,%
+ Spline=false,%
+ SplineB=false,%
+ NomInterpo={\moninterpo},%
+ NomInterpoB={\moninterpoB},%
+ NomSpline={\monspline},%
+ NomSplineB={\monsplineB},%
+ Tension=0.5,%
+ TensionB=0.5
+}
+
+\NewDocumentCommand\TracerIntegrale{ O{} D<>{} m O{0} m m }{%
+ %1 = clés
+ %2 = options particulières tikz
+ %3 = fonction, en tikz
+ %4 = fonction n°2 éventuelle
+ %de #5 à #6
+ \restoreKV[GraphiqueTikzIntegr]% revenir au valeurs par défaut
+ \setKV[GraphiqueTikzIntegr]{#1}% lit les arguments optionnels
+ %les couleurs
+ \IfSubStr{\pfldomtikzcolors}{/}%
+ {%
+ \StrCut{\pfldomtikzcolors}{/}{\pfldomtikzcolorbord}{\pfldomtikzcolorfond}
+ }%
+ {%
+ \xdef\pfldomtikzcolorbord{\pfldomtikzcolors}\xdef\pfldomtikzcolorfond{\pfldomtikzcolors}
+ }%
+ \ifboolKV[GraphiqueTikzIntegr]{Bord}%
+ {%
+ \tikzset{integralebordtikzstyle/.style={draw=\pfldomtikzcolorbord}}
+ }%
+ {%
+ \tikzset{integralebordtikzstyle/.style={draw=none}}
+ }%
+ \IfStrEq{\pfldomtikzstyle}{hachures}%
+ {%
+ \tikzset{integraletikzstyle/.style={pfltrait,pattern=\pfldomtikzhatch,pattern color=\pfldomtikzcolorfond,line join=\pfldomtikzjoin}}
+ }%
+ {}%
+ \IfStrEq{\pfldomtikzstyle}{remplissage}%
+ {%
+ \tikzset{integraletikzstyle/.style={pfltrait,fill=\pfldomtikzcolorfond,fill opacity=\pfldomtikzopac,line join=\pfldomtikzjoin}}
+ }%
+ {}%
+ %extraction des infos x/y
+ \IfStrEqCase{\pflintbornes}{%
+ {abs}%
+ {%
+ \xdef\absnoeudA{#5}%
+ \xdef\absnoeudB{#6}%
+ }%
+ {noeuds}%
+ {%
+ \path #5;
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\absnoeudA{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}%
+ \path #6;
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\absnoeudB{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}%
+ }%
+ {abs/noeud}%
+ {%
+ \xdef\absnoeudA{#5}%
+ \path #6;
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\absnoeudB{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}%
+ }%
+ {noeud/abs}%
+ {%
+ \path #5;
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\absnoeudA{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}%
+ \xdef\absnoeudB{#6}%
+ }%
+ }%
+ %suite avec les nbs points
+ \IfStrEq{\pflstepcurve}{}%
+ {%
+ \xdef\pflstepcurve{\xintfloateval{((\absnoeudB)-(\absnoeudA))/100}}%
+ }%
+ {}%
+ %TRACÉSen fonction des types de courbes
+ \IfStrEq{\pfldomtikztype}{fct}%
+ {%OK
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \draw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflOy}) -- plot[smooth] coordinates {\xintthecoords\xintfloatexpr seq((x,#3),x=\absnoeudA..[\pflstepcurve]..\absnoeudB,\absnoeudB)\relax} -- ({\absnoeudB},{\pflOy}) -- cycle ;
+ \end{scope}
+ }%
+ {}%
+ \IfStrEq{\pfldomtikztype}{spl}%avec 3=courbe spline + clé [Spline] à utiliser !
+ {%OK
+ \begin{scope}
+ \clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflOy}) -- \pfldomtikznamespline -- ({\absnoeudB},{\pflOy}) -- cycle ;
+ \end{scope}
+ \path[draw=none,pflcourbe,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;
+ \path[name intersections={of=#3 and tmpintbornea,name=YYY}] ;
+ \draw[\pfldomtikzcolorbord,pfltrait] ({\absnoeudA},{\pflOy})-- (YYY-1) ;
+ \path[draw=none,pflcourbe,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;
+ \path[name intersections={of=#3 and tmpintborneb,name=ZZZ}] ;
+ \draw[\pfldomtikzcolorbord,pfltrait] ({\absnoeudB},{\pflOy})-- (ZZZ-1) ;
+ }%
+ {}%
+ \IfStrEq{\pfldomtikztype}{itp}%avec 3=courbe interpo
+ {%OK
+ \begin{scope}
+ \clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflOy}) -- plot [smooth,tension={\useKV[GraphiqueTikzIntegr]{Tension}}] coordinates {#3} -- ({\absnoeudB},{\pflOy}) -- cycle ;
+ \end{scope}
+ \path[draw=none,pflcourbe,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;
+ \path[name intersections={of=tmpintbornea and \pfldomtikznameinterpo,name=YYY}] ;
+ \draw[\pfldomtikzcolorbord,pfltrait] ({\absnoeudA},{\pflOy})-- (YYY-1) ;
+ \path[draw=none,pflcourbe,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;
+ \path[name intersections={of=tmpintborneb and \pfldomtikznameinterpo,name=ZZZ}] ;
+ \draw[\pfldomtikzcolorbord,pfltrait] ({\absnoeudB},{\pflOy})-- (ZZZ-1) ;
+ }%
+ {}%
+ \IfStrEq{\pfldomtikztype}{fct/fct}%avec #3=formule et #4=formule
+ {%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \draw[integraletikzstyle,integralebordtikzstyle,#2] plot[smooth] coordinates {\xintthecoords\xintfloatexpr seq((x,#3),x=\absnoeudA..[\pflstepcurve]..\absnoeudB,\absnoeudB)\relax} -- plot[smooth] coordinates {\xintthecoords\xintfloatexpr seq((x,#4),x=\absnoeudB..[-(\pflstepcurve)]..\absnoeudA,\absnoeudA)\relax} -- cycle ;
+ \end{scope}
+ }%
+ {}%
+ \IfStrEq{\pfldomtikztype}{spl/spl}%avec #3=cbe spline + #4=cbe splineB
+ {%
+ \begin{scope}
+ \clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \clip ({\absnoeudA},{\pflymin}) -- \pfldomtikznamespline -- ({\absnoeudB},{\pflymin}) -- cycle ;
+ \clip ({\absnoeudA},{\pflymax}) -- \pfldomtikznamesplineb -- ({\absnoeudB},{\pflymax}) -- cycle ;
+ \filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \end{scope}
+ \path[draw=none,pflcourbe,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;
+ \path[name intersections={of=#3 and tmpintbornea,name=YYYA}] ;
+ \path[name intersections={of=#4 and tmpintbornea,name=ZZZA}] ;
+ \path[draw=none,pflcourbe,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;
+ \path[name intersections={of=#3 and tmpintborneb,name=YYYB}] ;
+ \path[name intersections={of=#4 and tmpintborneb,name=ZZZB}] ;
+ \draw[\pfldomtikzcolorbord,pfltrait] (YYYA-1)-- (ZZZA-1) ;
+ \draw[\pfldomtikzcolorbord,pfltrait] (YYYB-1)-- (ZZZB-1) ;
+ }%
+ {}%
+ \IfStrEq{\pfldomtikztype}{itp/itp}%avec #3=cbe interpo + #4=cbe interpoB
+ {%
+ \begin{scope}
+ \clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \clip ({\absnoeudA},{\pflymin}) -- plot [smooth,tension={\useKV[GraphiqueTikzIntegr]{Tension}}] coordinates {#3} -- ({\absnoeudB},{\pflymin}) ;
+ \clip ({\absnoeudA},{\pflymax}) -- plot [smooth,tension={\useKV[GraphiqueTikzIntegr]{TensionB}}] coordinates {#4} -- ({\absnoeudB},{\pflymax}) ;
+ \filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \end{scope}
+ \path[draw=none,pflcourbe,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;
+ \path[name intersections={of=tmpintbornea and \pfldomtikznameinterpo,name=YYYA}] ;
+ \path[name intersections={of=tmpintbornea and \pfldomtikznameinterpob,name=ZZZA}] ;
+ \path[draw=none,pflcourbe,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;
+ \path[name intersections={of=tmpintborneb and \pfldomtikznameinterpo,name=YYYB}] ;
+ \path[name intersections={of=tmpintborneb and \pfldomtikznameinterpob,name=ZZZB}] ;
+ \draw[\pfldomtikzcolorbord,pfltrait] (YYYA-1)-- (ZZZA-1) ;
+ \draw[\pfldomtikzcolorbord,pfltrait] (YYYB-1)-- (ZZZB-1) ;
+ }%
+ {}%
+ \IfStrEq{\pfldomtikztype}{fct/spl}%avec #3=formule + #4=spline
+ {%
+ \begin{scope}
+ \clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \clip ({\absnoeudA},{\pflymin}) -- plot[smooth] coordinates {\xintthecoords\xintfloatexpr seq((x,#3),x=\absnoeudA..[\pflstepcurve]..\absnoeudB,\absnoeudB)\relax} -- ({\absnoeudB},{\pflymin}) -- cycle ;
+ \clip ({\absnoeudA},{\pflymax}) -- \pfldomtikznamesplineb -- ({\absnoeudB},{\pflymax}) -- cycle ;
+ \filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \end{scope}
+ \path[draw=none,pflcourbe,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;
+ \path[name intersections={of=tmpintbornea and #4,name=ZZZA}] ;
+ \path[draw=none,pflcourbe,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;
+ \path[name intersections={of=tmpintborneb and #4,name=ZZZB}] ;
+ \draw[\pfldomtikzcolorbord,pfltrait] ({\absnoeudA},{\xintfloateval{subs(#3,x=\absnoeudA)}})-- (ZZZA-1) ;
+ \draw[\pfldomtikzcolorbord,pfltrait] ({\absnoeudB},{\xintfloateval{subs(#3,x=\absnoeudB)}})-- (ZZZB-1) ;
+ }%
+ {}%
+ \IfStrEq{\pfldomtikztype}{spl/fct}%avec #3=spline + #4=fct
+ {%
+ \begin{scope}
+ \clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \clip ({\absnoeudA},{\pflymax}) -- plot[smooth] coordinates {\xintthecoords\xintfloatexpr seq((x,#4),x=\absnoeudA..[\pflstepcurve]..\absnoeudB,\absnoeudB)\relax} -- ({\absnoeudB},{\pflymax}) -- cycle ;
+ \clip ({\absnoeudA},{\pflymin}) -- \pfldomtikznamespline -- ({\absnoeudB},{\pflymin}) -- cycle ;
+ \filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \end{scope}
+ \path[draw=none,pflcourbe,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;
+ \path[name intersections={of=tmpintbornea and #3,name=ZZZA}] ;
+ \path[draw=none,pflcourbe,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;
+ \path[name intersections={of=tmpintborneb and #3,name=ZZZB}] ;
+ \draw[\pfldomtikzcolorbord,pfltrait] ({\absnoeudA},{\xintfloateval{subs(#4,x=\absnoeudA)}})-- (ZZZA-1) ;
+ \draw[\pfldomtikzcolorbord,pfltrait] ({\absnoeudB},{\xintfloateval{subs(#4,x=\absnoeudB)}})-- (ZZZB-1) ;
+ }%
+ {}%
+ \IfStrEq{\pfldomtikztype}{fct/itp}%avec #3=formule + #4=liste interpo
+ {%
+ \begin{scope}
+ \clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \clip ({\absnoeudA},{\pflymin}) -- plot[smooth] coordinates {\xintthecoords\xintfloatexpr seq((x,#3),x=\absnoeudA..[\pflstepcurve]..\absnoeudB,\absnoeudB)\relax} -- ({\absnoeudB},{\pflymin}) -- cycle ;
+ \clip ({\absnoeudA},{\pflymax}) -- plot [smooth,tension={\useKV[GraphiqueTikzIntegr]{TensionB}}] coordinates {#4} -- ({\absnoeudB},{\pflymax}) ;
+ \filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \end{scope}
+ \path[draw=none,pflcourbe,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;
+ \path[draw=none,pflcourbe,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;
+ \path[name intersections={of=tmpintbornea and \pfldomtikznameinterpob,name=ZZZAA}] ;
+ \path[name intersections={of=tmpintborneb and \pfldomtikznameinterpob,name=ZZZAB}] ;
+ \draw[\pfldomtikzcolorbord,pfltrait] ({\absnoeudA},{\xintfloateval{subs(#3,x=\absnoeudA)}})-- (ZZZAA-1) ;
+ \draw[\pfldomtikzcolorbord,pfltrait] ({\absnoeudB},{\xintfloateval{subs(#3,x=\absnoeudB)}})-- (ZZZAB-1) ;
+ }%
+ {}%
+ \IfStrEq{\pfldomtikztype}{itp/fct}%
+ {%
+ \begin{scope}
+ \clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \clip ({\absnoeudA},{\pflymax}) -- plot[smooth] coordinates {\xintthecoords\xintfloatexpr seq((x,#4),x=\absnoeudA..[\pflstepcurve]..\absnoeudB,\absnoeudB)\relax} -- ({\absnoeudB},{\pflymax}) -- cycle ;
+ \clip ({\absnoeudA},{\pflymin}) -- plot [smooth,tension={\useKV[GraphiqueTikzIntegr]{Tension}}] coordinates {#3} -- ({\absnoeudB},{\pflymin}) ;
+ \filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \end{scope}
+ \path[draw=none,pflcourbe,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;
+ \path[draw=none,pflcourbe,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;
+ \path[name intersections={of=tmpintbornea and \pfldomtikznameinterpo,name=ZZZAA}] ;
+ \path[name intersections={of=tmpintborneb and \pfldomtikznameinterpo,name=ZZZAB}] ;
+ \draw[\pfldomtikzcolorbord,pfltrait] ({\absnoeudA},{\xintfloateval{subs(#4,x=\absnoeudA)}})-- (ZZZAA-1) ;
+ \draw[\pfldomtikzcolorbord,pfltrait] ({\absnoeudB},{\xintfloateval{subs(#4,x=\absnoeudB)}})-- (ZZZAB-1) ;
+ }%
+ {}%
+ \IfStrEq{\pfldomtikztype}{itp/spl}%
+ {%
+ \begin{scope}
+ \clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \clip ({\absnoeudA},{\pflymin}) -- plot [smooth,tension={\useKV[GraphiqueTikzIntegr]{Tension}}] coordinates {#3} -- ({\absnoeudB},{\pflymin}) ;
+ \clip ({\absnoeudA},{\pflymax}) -- \pfldomtikznamesplineb -- ({\absnoeudB},{\pflymax}) -- cycle ;
+ \filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \end{scope}
+ \path[draw=none,pflcourbe,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;%borne inf
+ \path[draw=none,pflcourbe,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;%borne sup
+ \path[name intersections={of=tmpintbornea and \pfldomtikznameinterpo,name=YYYKAA}] ;
+ \path[name intersections={of=tmpintborneb and \pfldomtikznameinterpo,name=YYYKBB}] ;
+ \path[name intersections={of=tmpintbornea and #4,name=ZZZKAA}] ;
+ \path[name intersections={of=tmpintborneb and #4,name=ZZZKBB}] ;
+ \draw[\pfldomtikzcolorbord,pfltrait] (YYYKAA-1)-- (ZZZKAA-1) ;
+ \draw[\pfldomtikzcolorbord,pfltrait] (YYYKBB-1)-- (ZZZKBB-1) ;
+ }%
+ {}%
+ \IfStrEq{\pfldomtikztype}{spl/itp}%
+ {%
+ \begin{scope}
+ \clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \clip ({\absnoeudA},{\pflymax}) -- plot [smooth,tension={\useKV[GraphiqueTikzIntegr]{TensionB}}] coordinates {#4} -- ({\absnoeudB},{\pflymax}) ;
+ \clip ({\absnoeudA},{\pflymin}) -- \pfldomtikznamespline -- ({\absnoeudB},{\pflymin}) -- cycle ;
+ \filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \end{scope}
+ \path[draw=none,pflcourbe,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;%borne inf
+ \path[draw=none,pflcourbe,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;%borne sup
+ \path[name intersections={of=tmpintbornea and \pfldomtikznameinterpob,name=YYYKAA}] ;
+ \path[name intersections={of=tmpintborneb and \pfldomtikznameinterpob,name=YYYKBB}] ;
+ \path[name intersections={of=tmpintbornea and #3,name=ZZZKAA}] ;
+ \path[name intersections={of=tmpintborneb and #3,name=ZZZKBB}] ;
+ \draw[\pfldomtikzcolorbord,pfltrait] (YYYKAA-1)-- (ZZZKAA-1) ;
+ \draw[\pfldomtikzcolorbord,pfltrait] (YYYKBB-1)-- (ZZZKBB-1) ;
+ }%
+ {}%
+}
+
+\NewDocumentCommand\PlacerPoints{ s O{black} D<>{\normalfont\normalsize} m }{%
+ \IfBooleanTF{#1}%
+ {%
+ \foreach \Point in {#4}{%
+ \filldraw[#2] \Point circle[pflpointc] ;
+ }
+ }%
+ {%
+ \foreach \Point/\Pos/\Label in {#4}{%
+ \filldraw[#2] \Point circle[pflpointc] node[\Pos,font=#3] {\Label} ;
+ }
+ }%
+}
+
+% %====STATS À 2 VARIABLES
+\defKV[GraphiqueTikzRegLin]{%
+ Arrondis=\def\pflarrondisreglin{#1},
+ Nom=\def\pflnamereglin{#1},
+ Debut=\def\pflreglinmin{#1},
+ Fin=\def\pflreglinmax{#1}
+}
+\setKVdefault[GraphiqueTikzRegLin]{
+ CouleurNuage=black,
+ CouleurDroite=black,
+ Arrondis={},
+ Debut={\pflxmin},
+ Fin={\pflxmax},
+ Nom=reglin,
+ TracerDroite=false,%
+ Style=o
+}
+
+\NewDocumentCommand\TracerNuage{ O{} D<>{d} m m }{%
+ \useKVdefault[GraphiqueTikzRegLin]%
+ \setKV[GraphiqueTikzRegLin]{#1}% on paramètres les nouvelles clés et on les simplifie
+ %listes des données
+ \def\xliste{#3}
+ \def\yliste{#4}
+ \readlist*\LX{\xliste}
+ \readlist*\LY{\yliste}
+ %taille des listes
+ \def\LNB{\inteval{\LXlen}}
+ %nuage
+ \foreach \i in {1,...,\LXlen}{%
+ \itemtomacro\LX[\i]\tmpmavalx%
+ \itemtomacro\LY[\i]\tmpmavaly%
+ \MarquerPts*[Style={\useKV[GraphiqueTikzRegLin]{Style}},Couleur={\useKV[GraphiqueTikzRegLin]{CouleurNuage}}]{(\tmpmavalx,\tmpmavaly)}
+ %\filldraw[{\useKV[GraphiqueTikzRegLin]{CouleurNuage}}] ({\LX[\i]},{\LY[\i]}) circle[pflpointnuage] ;
+ }
+ %droite de régression
+ \ifboolKV[GraphiqueTikzRegLin]{TracerDroite}%
+ {%
+ %mini LX
+ \def\tmpxminreglin{\fpeval{min(#2)}}
+ \def\tmpxmaxreglin{\fpeval{max(#2)}}
+ %somme des LX et des LY OK
+ \xdef\LXSomme{0}
+ \xdef\LYSomme{0}
+ \foreach \i in {1,2,...,\LNB}{
+ \xdef\LXSomme{\xintfloateval{\LXSomme+\LX[\i]}}
+ }
+ \foreach \i in {1,2,...,\LNB}{
+ \xdef\LYSomme{\xintfloateval{\LYSomme+\LY[\i]}}
+ }
+ %moyenne des LX et des LY OK
+ \xdef\LXmoy{\xintfloateval{\LXSomme/\LNB}}
+ \xdef\LYmoy{\xintfloateval{\LYSomme/\LNB}}
+ %variance des LX et des LY OK
+ \xdef\LXvar{0}
+ \foreach \i in {1,2,...,\LNB}{
+ \xdef\LXvar{\xintfloateval{\LXvar+(\LX[\i]-\LXmoy)*(\LX[\i]-\LXmoy)}}
+ }
+ \xdef\LXvar{\xintfloateval{\LXvar/\LNB}}
+ \xdef\LYvar{0}
+ \foreach \i in {1,2,...,\LNB}{
+ \xdef\LYvar{\xintfloateval{\LYvar+(\LY[\i]-\LYmoy)*(\LY[\i]-\LYmoy)}}
+ }
+ \xdef\LYvar{\xintfloateval{\LYvar/\LNB}}
+ %covariance des XY OK
+ \xdef\LXYvar{0}
+ \foreach \i in {1,2,...,\LNB}{
+ \xdef\LXYvar{\xintfloateval{\LXYvar+(\LX[\i]-\LXmoy)*(\LY[\i]-\LYmoy)}}
+ }
+ \xdef\LXYvar{\xintfloateval{\LXYvar/\LNB}}
+ %COEFFS OK
+ \IfStrEq{\pflarrondisreglin}{}%
+ {%
+ \xdef\tmpcoeffreglina{\xintfloateval{\LXYvar/\LXvar}}
+ \xdef\tmpcoeffreglinb{\xintfloateval{\LYmoy-\tmpcoeffreglina*\LXmoy}}
+ }%
+ {%
+ \IfSubStr{\pflarrondisreglin}{/}%
+ {%
+ \StrCut{\pflarrondisreglin}{/}{\pflarrondisreglina}{\pflarrondisreglinb}
+ }%
+ {%
+ \xdef\pflarrondisreglina{\pflarrondisreglin}\xdef\pflarrondisreglinb{\pflarrondisreglin}
+ }%
+ \xdef\tmpcoeffreglina{\xintfloateval{round(\LXYvar/\LXvar,\pflarrondisreglina)}}
+ \xdef\tmpcoeffreglinb{\xintfloateval{round(\LYmoy-\tmpcoeffreglina*\LXmoy,\pflarrondisreglinb)}}
+ }%
+ \xintdeffloatfunc #2(x) := (\tmpcoeffreglina)*x+(\tmpcoeffreglinb) ;
+ %tracé
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \draw[pflcourbe,{\useKV[GraphiqueTikzRegLin]{CouleurDroite}},name path global=\pflnamereglin,samples=2,domain=\pflreglinmin:\pflreglinmax] plot (\x,{\tmpcoeffreglina*\x+\tmpcoeffreglinb}) ;
+ \end{scope}
+ }%
+ {}%
+}
+
+%===IMAGES & ANTÉCÉDENTS
+\defKV[GraphiqueTikzImg]{
+ Couleurs=\def\pflimgcolors{#1},%
+ Nom=\def\pflantecednoms{#1}%,%
+ %Style=\xdef\pflantecedstyle{#1}
+}
+
+\setKVdefault[GraphiqueTikzImg]{
+ Couleurs=black,
+ Traits=false,
+ Spline=false,%
+ Nom={},%
+ Style=o
+}
+
+\NewDocumentCommand\PlacerImages{ O{} m m }{%
+ \useKVdefault[GraphiqueTikzImg]%
+ \setKV[GraphiqueTikzImg]{#1}%
+ \IfSubStr{\pflimgcolors}{/}%
+ {%
+ \StrCut{\pflimgcolors}{/}{\pflimgcolorpt}{\pflimgcolorline}
+ }%
+ {%
+ \xdef\pflimgcolorpt{\pflimgcolors}\xdef\pflimgcolorline{\pflimgcolors}
+ }%
+ \ifboolKV[GraphiqueTikzImg]{Spline}%
+ {%
+ \foreach \i in {#3}{%
+ \path[draw=none,pflcourbe,name path=tmpimage] ({\i},{\pflymin})--({\i},{\pflymax}) ;
+ \path[name intersections={of=#2 and tmpimage,name=ZZ}] ;
+ \ifboolKV[GraphiqueTikzImg]{Traits}%
+ {%
+ \draw[\pflimgcolorline,pfltraitimg] let \p1 = (ZZ-1) in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \MarquerPts*[Style={\useKV[GraphiqueTikzImg]{Style}},Couleur=\pflimgcolorpt]{(ZZ-1)}
+ %\filldraw[\pflimgcolorpt] (ZZ-1) circle[radius=2pt] ;
+ }
+ }%
+ {%
+ \foreach \i in {#3}{%
+ \xdef\tmpresimg{\xintfloateval{#2(\i)}}%
+ \ifboolKV[GraphiqueTikzImg]{Traits}%
+ {%
+ \draw[\pflimgcolorline,pfltraitimg] ({\i},{\pflOy}) |- ({\pflOx},{\tmpresimg}) ;
+ }%
+ {}%
+ \MarquerPts*[Style={\useKV[GraphiqueTikzImg]{Style}},Couleur=\pflimgcolorpt]{({\i},{\tmpresimg})}
+ %\filldraw[\pflimgcolorpt] ({\i},{\tmpresimg}) circle[radius=2pt] ;
+ }%
+ }
+}
+
+\NewDocumentCommand\PlacerAntecedents{ O{} m m }{%avec le nom de la courbe...
+ \useKVdefault[GraphiqueTikzImg]%
+ \setKV[GraphiqueTikzImg]{#1}%
+ \xdef\pflstepcurve{\xintfloateval{0.1*\pflgrillexs}}
+ \IfSubStr{\pflimgcolors}{/}%
+ {%
+ \StrCut{\pflimgcolors}{/}{\pflimgcolorpt}{\pflimgcolorline}%
+ }%
+ {%
+ \xdef\pflimgcolorpt{\pflimgcolors}\xdef\pflimgcolorline{\pflimgcolors}%
+ }%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \path[draw=none,pflcourbe,name path=tmpanteced] ({\pflxmin},{#3})--({\pflxmax},{#3}) ;
+ \path[name intersections={of=#2 and tmpanteced,name=ZZ,total=\t}] \pgfextra{\xdef\tmptotanteced{\t}};
+ \xintifboolexpr{\tmptotanteced == 0}{}%
+ {%
+ \ifboolKV[GraphiqueTikzImg]{Traits}%
+ {%
+ \draw[\pflimgcolorline,pfltraitantec] ({\pflxmin},{#3})--({\pflxmax},{#3}) ;
+ }%
+ {}%
+ \foreach \i in {1,...,\tmptotanteced}{%
+ \IfStrEq{\pflantecednoms}{}%
+ {}%
+ {%
+ \coordinate (\pflantecednoms-\i) at (ZZ-\i) ;
+ }%
+ \ifboolKV[GraphiqueTikzImg]{Traits}%
+ {%
+ \draw[\pflimgcolorline,pfltraitimg] let \p1 = (ZZ-\i) in (ZZ-\i) -- ({\x1},{\pflOy}) ;
+ }%
+ {}%
+ \MarquerPts*[Style={\useKV[GraphiqueTikzImg]{Style}},Couleur=\pflimgcolorpt]{(ZZ-\i)}
+ %\filldraw[\pflimgcolorpt] (ZZ-\i) circle[radius=2pt] ;
+ }%
+ }%
+ \end{scope}
+}
+
+%===NOMBRE DÉRIVÉ ET TANGENTE (EXPÉRIEMENTAL)
+\NewDocumentCommand\CalculerNbDerive{ s m m m }{%*=gauche+nomfct+abspt+h
+ \IfBooleanTF{#1}%
+ {%
+ \xdef\TmpResNbDeriv{\xintfloateval{(#2(#3)-#2(#3-#4))/(#4)}}%
+ }%
+ {%
+ \xdef\TmpResNbDeriv{\xintfloateval{(#2(#3+#4)-#2(#3))/(#4)}}%
+ }%
+}
+
+\defKV[GraphiqueTikzTgte]{%
+ Couleurs=\def\pfltgttikzcolors{#1},%
+ DecG=\def\pfltgttikzkl{#1},%
+ DecD=\def\pfltgttikzkr{#1},%
+ h=\def\pfltgttikzh{#1},%
+ Sens=\def\pfltgttikzsens{#1},%
+ Delta=\def\tmptgtedelta{#1}
+}
+\setKVdefault[GraphiqueTikzTgte]{%
+ Couleurs=black,%
+ DecG=1,%
+ DecD=1,%
+ AffPoint=false,%
+ Spline=false,%
+ h=0.1,%
+ Sens=gd,%
+ Noeud=false,%
+ Delta=0.01,%
+ Style=o
+}
+
+\NewDocumentCommand\TracerTangente{ O{} m m D<>{} }{%
+ \restoreKV[GraphiqueTikzTgte]%
+ \setKV[GraphiqueTikzTgte]{#1}%
+ %en fonction de la gestion de l'abscisse
+ \ifboolKV[GraphiqueTikzTgte]{Noeud}%
+ {%
+ \path #3;
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\pfltgttikzx{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}%
+ }%
+ {%
+ \xdef\pfltgttikzx{#3}%
+ }%
+ %parties communes
+ \IfSubStr{\pfltgttikzcolors}{/}%
+ {%
+ \StrCut{\pfltgttikzcolors}{/}{\pfltgttikzline}{\pfltgttikzpoint}
+ }%
+ {%
+ \xdef\pfltgttikzline{\pfltgttikzcolors}\xdef\pfltgttikzpoint{\pfltgttikzcolors}
+ }%
+ \xdef\tmptgtdeb{\xintfloateval{\pfltgttikzx-(\pfltgttikzkl)}}%
+ \xdef\tmptgtfin{\xintfloateval{\pfltgttikzx+(\pfltgttikzkr)}}%
+ %suivant le type de courbe
+ \ifboolKV[GraphiqueTikzTgte]{Spline}%
+ {%
+ \path[name path=tmpimage] ({\pfltgttikzx},{\pflymin})--({\pfltgttikzx},{\pflymax}) ;
+ \path[name intersections={of=#2 and tmpimage,name=TANp}] ;
+ \IfStrEq{\pfltgttikzsens}{gd}%
+ {%
+ \path[name path=L-vline] ({\pfltgttikzx-\tmptgtedelta},{\pflymin}) -- ({\pfltgttikzx-\tmptgtedelta},{\pflymax}) ;
+ \path[name path=R-vline] ({\pfltgttikzx+\tmptgtedelta},{\pflymin}) -- ({\pfltgttikzx+\tmptgtedelta},{\pflymax}) ;
+ %\coordinate (LXcoor) at ($(TANp-1)+({-\tmptgtedelta},0)$) ;
+ %\coordinate (RXcoor) at ($(TANp-1)+({\tmptgtedelta},0)$) ;
+ }%
+ {}%
+ \IfStrEq{\pfltgttikzsens}{g}%
+ {%
+ \path[name path=L-vline] ({\pfltgttikzx-\tmptgtedelta},{\pflymin}) -- ({\pfltgttikzx-\tmptgtedelta},{\pflymax}) ;
+ \path[name path=R-vline] ({\pfltgttikzx},{\pflymin}) -- ({\pfltgttikzx},{\pflymax}) ;
+ %\coordinate (LXcoor) at ($(TANp-1)+({-\tmptgtedelta},0)$) ;
+ %\coordinate (RXcoor) at (TANp-1) ;
+ \def\tmptgtfin{\pfltgttikzx}%
+ }%
+ {}%
+ \IfStrEq{\pfltgttikzsens}{d}%
+ {%
+ \path[name path=L-vline] ({\pfltgttikzx},{\pflymin}) -- ({\pfltgttikzx},{\pflymax}) ;
+ \path[name path=R-vline] ({\pfltgttikzx+\tmptgtedelta},{\pflymin}) -- ({\pfltgttikzx+\tmptgtedelta},{\pflymax}) ;
+ \def\tmptgtdeb{\pfltgttikzx}%
+ }%
+ {}%
+ \path[name intersections={of=#2 and L-vline,name=LXcut}] ;
+ \path[name intersections={of=#2 and R-vline,name=RXcut}] ;
+ \coordinate (tzXproj) at ($(LXcut-1)!(TANp-1)!(RXcut-1)$) ; % projection
+ \coordinate (LLpoint) at ($(LXcut-1)+(TANp-1)-(tzXproj)$) ; % move
+ \coordinate (RRpoint) at ($(RXcut-1)+(TANp-1)-(tzXproj)$) ; % move
+ \path (LLpoint);
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\tzTANLLX{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}%
+ \xdef\tzTANLLY{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}%
+ \path (RRpoint);
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\tzTANRRX{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}%
+ \xdef\tzTANRRY{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}%
+ \def\tztangentLFn{(\tzTANRRY-\tzTANLLY)/(\tzTANRRX-\tzTANLLX)*(\x-\tzTANLLX)+\tzTANLLY}%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ;
+ \draw[pfltrait,\pfltgttikzline,domain=\tmptgtdeb:\tmptgtfin,samples=2,#4] plot (\x,{\tztangentLFn}) ;
+ \end{scope}
+ }%
+ {%
+ \IfStrEq{\pfltgttikzsens}{g}%
+ {%
+ \CalculerNbDerive*{#2}{\pfltgttikzx}{\pfltgttikzh}%
+ }%
+ {%
+ \CalculerNbDerive{#2}{\pfltgttikzx}{\pfltgttikzh}%
+ }%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ;
+ \draw[pfltrait,\pfltgttikzline,#4] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,\TmpResNbDeriv*(x-(\pfltgttikzx))+#2(\pfltgttikzx)),x=\tmptgtdeb,\tmptgtfin)
+ \relax
+ };
+ \end{scope}
+ }%
+ \ifboolKV[GraphiqueTikzTgte]{AffPoint}%
+ {%
+ \ifboolKV[GraphiqueTikzTgte]{Spline}%
+ {%
+ \MarquerPts*[Style={\useKV[GraphiqueTikzTgte]{Style}},Couleur=\pfltgttikzpoint]{(TANp-1)}
+ %\filldraw[] (TANp-1) circle[pflpointc] ;
+ }%
+ {%
+ \xdef\tmpimgtgt{\xintfloateval{#2(\pfltgttikzx)}}%
+ \MarquerPts*[Style={\useKV[GraphiqueTikzTgte]{Style}},Couleur=\pfltgttikzpoint]{({\pfltgttikzx},\tmpimgtgt)}
+ %\filldraw[\pfltgttikzpoint] ({\pfltgttikzx},\tmpimgtgt) circle[pflpointc] ;
+ }%
+ }%
+ {}%
+}
+
+%====loi normale
+\defKV[GraphiqueTikzGaussienne]{%
+ Pas=\def\pflgaussstep{#1},%
+ Nom=\def\pflgaussname{#1}
+}
+
+\setKVdefault[GraphiqueTikzGaussienne]{%
+ Nom=gaussienne,%
+ Couleur=black,%
+ Trace=false,%
+ Pas={},%
+ Debut={\pflxmin},%
+ Fin={\pflxmax}
+}
+
+\NewDocumentCommand\DefinirLoiNormale{ O{} D<>{phi} m m }{%
+ %1=options
+ %2=mu
+ %3=sigma
+ \restoreKV[GraphiqueTikzGaussienne]%
+ \setKV[GraphiqueTikzGaussienne]{#1}%
+ \xintdeffloatfunc #2(x) := 1/((#4)*sqrt(2*pi))*exp(-0.5*((x-(#3))/(#4))^2) ;%
+ \IfStrEq{\pflgaussstep}{}%
+ {%
+ \xdef\pflgaussstep{\xintfloateval{((\useKV[GraphiqueTikzGaussienne]{Fin})-(\useKV[GraphiqueTikzGaussienne]{Debut}))/100}}%
+ }%
+ {}%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \ifboolKV[GraphiqueTikzGaussienne]{Trace}%
+ {%
+ \path[draw,pflcourbe,{\useKV[GraphiqueTikzGaussienne]{Couleur}},name path global=\pflgaussname] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphiqueTikzGaussienne]{Debut}}..[\pflgaussstep]..{\useKV[GraphiqueTikzGaussienne]{Fin}},{\useKV[GraphiqueTikzGaussienne]{Fin}})
+ \relax
+ } ;
+ }%
+ {%
+ \path[draw=none,pflcourbe,name path global=\pflgaussname] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphiqueTikzGaussienne]{Debut}}..[\pflgaussstep]..{\useKV[GraphiqueTikzGaussienne]{Fin}},{\useKV[GraphiqueTikzGaussienne]{Fin}})
+ \relax
+ } ;
+ }%
+ \end{scope}
+}
+
+\NewDocumentCommand\TracerLoiNormale{ O{} m }{%
+ %1=options
+ %2=mu
+ %3=sigma
+ \restoreKV[GraphiqueTikzGaussienne]%
+ \setKV[GraphiqueTikzGaussienne]{#1}%
+ \IfStrEq{\pflgaussstep}{}%
+ {%
+ \xdef\pflgaussstep{\xintfloateval{((\useKV[GraphiqueTikzGaussienne]{Fin})-(\useKV[GraphiqueTikzGaussienne]{Debut}))/100}}%
+ }%
+ {}%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \draw[pflcourbe,{\useKV[GraphiqueTikzGaussienne]{Couleur}}] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2),x={\useKV[GraphiqueTikzGaussienne]{Debut}}..[\pflgaussstep]..{\useKV[GraphiqueTikzGaussienne]{Fin}},{\useKV[GraphiqueTikzGaussienne]{Fin}})
+ \relax
+ } ;
+ \end{scope}
+}
+
+%==== DENSITÉ KHIDEUX
+\xintdeffloatfunc pflrecigamma(x) := x+0.577215664901*x^2-0.65587807152056*x^3-0.042002635033944*x^4+0.16653861138228*x^5-0.042197734555571*x^6;
+\xintdeffloatfunc pflgamma(x) := (x==1)?{1}{(abs(x)<=0.5)?{1/pflrecigamma(x)}{(x-1)*pflgamma(x-1)}};
+\xintdeffloatfunc pflkhideux(x,k) := (x<0)?{0}{(1/(2^(k/2)*pflgamma(k/2)))*x^(k/2-1)*exp(-x/2)};
+
+\NewDocumentCommand\DefinirLoiKhiDeux{ O{} D<>{khi} m }{%
+ %1=options
+ %2=mu
+ %3=sigma
+ \restoreKV[GraphiqueTikzGaussienne]%
+ \setKV[GraphiqueTikzGaussienne]{#1}%
+ \xintdeffloatfunc #2(x) := (x<0)?{0}{(1/(2^((#3)/2)*pflgamma((#3)/2)))*x^((#3)/2-1)*exp(-x/2)};
+ \IfStrEq{\pflgaussstep}{}%
+ {%
+ \xdef\pflgaussstep{\xintfloateval{((\useKV[GraphiqueTikzGaussienne]{Fin})-(\useKV[GraphiqueTikzGaussienne]{Debut}))/100}}%
+ }%
+ {}%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \ifboolKV[GraphiqueTikzGaussienne]{Trace}%
+ {%
+ \path[draw,pflcourbe,{\useKV[GraphiqueTikzGaussienne]{Couleur}},name path global=\pflgaussname] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphiqueTikzGaussienne]{Debut}}..[\pflgaussstep]..{\useKV[GraphiqueTikzGaussienne]{Fin}},{\useKV[GraphiqueTikzGaussienne]{Fin}})
+ \relax
+ } ;
+ }%
+ {%
+ \path[draw=none,pflcourbe,name path global=\pflgaussname] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphiqueTikzGaussienne]{Debut}}..[\pflgaussstep]..{\useKV[GraphiqueTikzGaussienne]{Fin}},{\useKV[GraphiqueTikzGaussienne]{Fin}})
+ \relax
+ } ;
+ }%
+ \end{scope}
+}
+
+\NewDocumentCommand\TracerLoiKhiDeux{ O{} m }{%
+ %1=options
+ %2=mu
+ %3=sigma
+ \restoreKV[GraphiqueTikzGaussienne]%
+ \setKV[GraphiqueTikzGaussienne]{#1}%
+ \IfStrEq{\pflgaussstep}{}%
+ {%
+ \xdef\pflgaussstep{\xintfloateval{((\useKV[GraphiqueTikzGaussienne]{Fin})-(\useKV[GraphiqueTikzGaussienne]{Debut}))/100}}%
+ }%
+ {}%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \draw[pflcourbe,{\useKV[GraphiqueTikzGaussienne]{Couleur}}] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2),x={\useKV[GraphiqueTikzGaussienne]{Debut}}..[\pflgaussstep]..{\useKV[GraphiqueTikzGaussienne]{Fin}},{\useKV[GraphiqueTikzGaussienne]{Fin}})
+ \relax
+ } ;
+ \end{scope}
+}
+
+\endinput \ No newline at end of file