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/pmdraw/README.md74
-rw-r--r--graphics/pgf/contrib/pmdraw/examples/example-1.tex36
-rw-r--r--graphics/pgf/contrib/pmdraw/examples/example-10.tex37
-rw-r--r--graphics/pgf/contrib/pmdraw/examples/example-11.tex37
-rw-r--r--graphics/pgf/contrib/pmdraw/examples/example-12.tex101
-rw-r--r--graphics/pgf/contrib/pmdraw/examples/example-13.tex126
-rw-r--r--graphics/pgf/contrib/pmdraw/examples/example-14.tex76
-rw-r--r--graphics/pgf/contrib/pmdraw/examples/example-15.tex76
-rw-r--r--graphics/pgf/contrib/pmdraw/examples/example-16.tex127
-rw-r--r--graphics/pgf/contrib/pmdraw/examples/example-17.tex70
-rw-r--r--graphics/pgf/contrib/pmdraw/examples/example-18.tex52
-rw-r--r--graphics/pgf/contrib/pmdraw/examples/example-19.tex53
-rw-r--r--graphics/pgf/contrib/pmdraw/examples/example-2.tex39
-rw-r--r--graphics/pgf/contrib/pmdraw/examples/example-20.tex171
-rw-r--r--graphics/pgf/contrib/pmdraw/examples/example-21.tex183
-rw-r--r--graphics/pgf/contrib/pmdraw/examples/example-22.tex179
-rw-r--r--graphics/pgf/contrib/pmdraw/examples/example-23.tex179
-rw-r--r--graphics/pgf/contrib/pmdraw/examples/example-24.tex160
-rw-r--r--graphics/pgf/contrib/pmdraw/examples/example-25.tex63
-rw-r--r--graphics/pgf/contrib/pmdraw/examples/example-3.tex53
-rw-r--r--graphics/pgf/contrib/pmdraw/examples/example-4.tex77
-rw-r--r--graphics/pgf/contrib/pmdraw/examples/example-5.tex118
-rw-r--r--graphics/pgf/contrib/pmdraw/examples/example-6.tex55
-rw-r--r--graphics/pgf/contrib/pmdraw/examples/example-7.tex63
-rw-r--r--graphics/pgf/contrib/pmdraw/examples/example-8.tex63
-rw-r--r--graphics/pgf/contrib/pmdraw/examples/example-9.tex37
-rw-r--r--graphics/pgf/contrib/pmdraw/pmdraw.pdfbin0 -> 397582 bytes
-rw-r--r--graphics/pgf/contrib/pmdraw/pmdraw.sty1544
-rw-r--r--graphics/pgf/contrib/pmdraw/pmdraw.tex3679
-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/spath3/README.txt (renamed from graphics/pgf/contrib/spath3/README)2
-rw-r--r--graphics/pgf/contrib/spath3/spath3.pdfbin441114 -> 446012 bytes
-rw-r--r--graphics/pgf/contrib/spath3/spath3.tex63
-rw-r--r--graphics/pgf/contrib/spath3/spath3_code.dtx127
-rw-r--r--graphics/pgf/contrib/spath3/spath3_code.pdfbin833596 -> 840527 bytes
-rw-r--r--graphics/pgf/contrib/tkz-grapheur/README.md7
-rw-r--r--graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-fr.pdfbin0 -> 751560 bytes
-rw-r--r--graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-fr.tex1661
-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.sty1888
62 files changed, 13894 insertions, 828 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/pmdraw/README.md b/graphics/pgf/contrib/pmdraw/README.md
new file mode 100644
index 0000000000..dfc3e2924d
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/README.md
@@ -0,0 +1,74 @@
+pmdraw
+======
+
+*README V1.4 2024-06-02*
+
+<!--
+
+*------------------------------*
+|6````````````````````````````5|
+|`````____````____`````````````|
+|````|MFMF\ /MFMF|````````````|
+|````|MF|MF\/MF|MF|````````````|
+|````|MF|\MFMF/|MF|_______`````|
+|````|MF|``````|MFMFMFMFMF|````|
+|````|MF|``````|MF|````````````|
+|````|MF|``````|MF|___`````````|
+|``````````````|MFMFMF|````````|
+|``````````````|MF|````````````|
+|``````````````|MF|````````````|
+|``````````````|MF|````````````|
+|4````````````````````````````1|
+*------------------------------*
+-->
+
+The `pmdraw` package allows you to draw elements of the diagram monoids, commonly referred to as diagrams. The package provides a lot of
+flexibility to draw most diagrams and can be customised as needed.
+
+The package makes use of the `tikz` and `keyval` packages.
+
+
+Usage
+-----
+
+The usage of the package requires some basic understanding of
+partition diagrams as well as the interface used. Please read the
+manual for a complete explanation.
+
+
+Contact
+-------
+
+If you discover a bug, please be so kind and send me a minimum working
+example of the bug in action and I will work on fixing it. My details
+are <matthias.ypg37@slmail.me>.
+
+
+Author
+-------
+
+- Matthias Fresacher
+
+
+License
+-------
+
+Copyright 2023-10-16 (original release) & 2024, Matthias Fresacher
+
+This work may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is found via
+<http://www.latex-project.org/lppl.txt>.
+
+This work has the LPPL maintenance status `maintained`.
+
+The Current Maintainer of this work is Matthias Fresacher.
+
+
+Contents
+-------
+
+This work consists of the files `pmdraw.sty`, `pmdraw.tex` and the
+examples in the folder `examples`, in addition to the derived file
+`pmdraw.pdf`. \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/examples/example-1.tex b/graphics/pgf/contrib/pmdraw/examples/example-1.tex
new file mode 100644
index 0000000000..402c418a15
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/examples/example-1.tex
@@ -0,0 +1,36 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |4````````````````````````````8|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |1````````````````````````````8|
+% *------------------------------*
+
+\pmdBrick[ % Options
+ degree=5,
+ levels top=4,
+ levels bottom=3
+]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ [level=2]{2}{4}
+ [level=3]{2}{5}
+ [level=4]{1}{5}
+}{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ [level=2]{2}{4}
+ [level=3]{2}{5}
+}{ % Transversal edges
+ \pmdEmpty
+} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/examples/example-10.tex b/graphics/pgf/contrib/pmdraw/examples/example-10.tex
new file mode 100644
index 0000000000..01d1502f32
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/examples/example-10.tex
@@ -0,0 +1,37 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |6````````````````````````````8|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |2````````````````````````````8|
+% *------------------------------*
+
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=17
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ [height=1.75]{11}{1}
+ [height=1.5]{12}{2}
+ [height=1.25]{13}{3}
+ [height=1]{14}{4}
+ [height=0.75]{15}{5}
+ [height=0.5]{16}{6}
+ [height=0.25]{17}{7}
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/examples/example-11.tex b/graphics/pgf/contrib/pmdraw/examples/example-11.tex
new file mode 100644
index 0000000000..9729320f40
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/examples/example-11.tex
@@ -0,0 +1,37 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |4````````````````````````````8|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |8````````````````````````````3|
+% *------------------------------*
+
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=14
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ [height=1.75]{11}{1}
+ [height=1.25]{12}{2}
+ [height=0.75]{13}{3}
+ [height=0.25]{14}{4}
+ [height=0.5]{1}{11}
+ [height=1]{2}{12}
+ [height=1.5]{3}{13}
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/examples/example-12.tex b/graphics/pgf/contrib/pmdraw/examples/example-12.tex
new file mode 100644
index 0000000000..f21946849f
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/examples/example-12.tex
@@ -0,0 +1,101 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |6````````````````````````````7|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |2````````````````````````````4|
+% *------------------------------*
+
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=16,
+ row sep=3, % Must be before levels key
+ levels=3,
+ vertices options={
+ \fill[red] (#1,#2) circle (.5);
+ },
+ edges upper={very thick},
+ edges transversal={red,very thick},
+ brace={
+ left=1,
+ right=4,
+ label={4},
+ options={
+ \draw [
+ red,
+ very thick,
+ decorate,
+ decoration={calligraphic brace,mirror,amplitude=6pt}
+ ] (#1-0.17,-0.5) -- (#2+0.17,-0.5) node[pos=0.5,below=6pt]{\(#3\)};
+ }
+ }
+ ]{ % Upper non transversal edges
+ {4}{5}
+ [ % Options
+ options={
+ \draw[blue] (#1,3) arc (180:270:\pmdraw{edgeHeight}); % Draw left arch
+ \draw[blue] (#1+\pmdraw{edgeHeight},3-\pmdraw{edgeHeight}) -- (#2-\pmdraw{edgeHeight},3-\pmdraw{edgeHeight}); % Draw straight line
+ \draw[blue] (#2-\pmdraw{edgeHeight},3-\pmdraw{edgeHeight}) arc (270:360:\pmdraw{edgeHeight}); % Draw right arc
+ }
+ ]{4}{6}
+ [level=2]{4}{7}
+ [level=3]{4}{8}
+ }{ % Lower non transversal edges
+ {4}{5}
+ [
+ options={
+ \draw[green] (#1,0) arc (180:90:\pmdraw{edgeHeight}); % Draw left arch
+ \draw[green] (#1+\pmdraw{edgeHeight},\pmdraw{edgeHeight}) -- (#2-\pmdraw{edgeHeight},\pmdraw{edgeHeight}); % Draw straight line
+ \draw[green] (#2-\pmdraw{edgeHeight},\pmdraw{edgeHeight}) arc (90:0:\pmdraw{edgeHeight}); % Draw right arc
+ }
+ ]{4}{6}
+ [level=2]{4}{7}
+ [level=3]{4}{8}
+ }
+ { % Transversal edges
+ [height=1.75]{11}{1}
+ [height=1.25]{12}{2}
+ [height=0.75]{13}{3}
+ [height=0.25]{14}{4}
+ [height=0.5]{1}{11}
+ [height=1]{2}{12}
+ [height=1.5]{3}{13}
+ [
+ options={
+ \draw[dashed] (#1, 3) -- (#2, 0); % Draw straight line
+ }
+ ]{16}{16}
+ {15}{15}
+ }
+ }
+ { % Brick 2
+ [ % Options
+ degree=14,
+ row sep=3, % Must be before levels key
+ levels=3
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ [height=1.75]{11}{1}
+ [height=1.25]{12}{2}
+ [height=0.75]{13}{3}
+ [height=0.25]{14}{4}
+ [height=0.5]{1}{11}
+ [height=1]{2}{12}
+ [height=1.5]{3}{13}
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/examples/example-13.tex b/graphics/pgf/contrib/pmdraw/examples/example-13.tex
new file mode 100644
index 0000000000..c3a189e202
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/examples/example-13.tex
@@ -0,0 +1,126 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |8````````````````````````````7|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |2````````````````````````````8|
+% *------------------------------*
+
+\pmdProduct
+[ % Options
+ row sep=3,
+ diagram sep=2,
+ dots options={
+ \draw (#1,#2) node[red] {\(\dots\dots\)};
+ }
+]{ % Added edges
+ {1}{3}
+ {7}{11}
+ {18}{21}
+}{ % Top Diagram
+ { % Brick 1
+ [ % Options
+ degree top=3,
+ degree bottom=4
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{2}
+ {2}{3}
+ {3}{4}
+ {7}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=7,
+ blank bottom=1,
+ degree bottom=5,
+ levels=2
+ ]{ % Upper non transversal edges
+ [level=2]{3}{16}
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ {1}{2}
+ }
+ }{ % Brick 3
+ [ % Options
+ blank top=3,
+ degree top=5,
+ blank bottom=4,
+ degree bottom=4,
+ levels=2
+ ]{ % Upper non transversal edges
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {5}{6}
+ {7}{8}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}{ % Bottom Diagram
+ { % Brick 1
+ [ % Options
+ degree top=3,
+ degree bottom=4
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{2}
+ {2}{3}
+ {3}{4}
+ [height=1.5]{7}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=7,
+ blank bottom=1,
+ degree bottom=5,
+ levels=2
+ ]{ % Upper non transversal edges
+ [level=2]{3}{16}
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ {1}{2}
+ }
+ }{ % Brick 3
+ [ % Options
+ blank top=3,
+ degree top=5,
+ blank bottom=4,
+ degree bottom=4,
+ levels=2
+ ]{ % Upper non transversal edges
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {5}{6}
+ {7}{8}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/examples/example-14.tex b/graphics/pgf/contrib/pmdraw/examples/example-14.tex
new file mode 100644
index 0000000000..0ad77f546d
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/examples/example-14.tex
@@ -0,0 +1,76 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |6````````````````````````````2|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |4````````````````````````````1|
+% *------------------------------*
+
+\pmdDiagram
+[ % Options
+ row sep=3,
+ diagram sep=2,
+ dots options={
+ \draw (#1,#2) node[red] {\(\mid\)};
+ }
+]{
+ { % Brick 1
+ [ % Options
+ degree top=3,
+ degree bottom=4
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{2}
+ {2}{3}
+ {3}{4}
+ {7}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=7,
+ blank bottom=1,
+ degree bottom=5,
+ levels=2
+ ]{ % Upper non transversal edges
+ [level=2]{3}{16}
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ {1}{2}
+ }
+ }{ % Brick 3
+ [ % Options
+ blank top=-1,
+ degree top=9,
+ blank bottom=4,
+ degree bottom=4,
+ levels=2
+ ]{ % Upper non transversal edges
+ {0}{1}
+ {2}{3}
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {5}{6}
+ {7}{8}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/examples/example-15.tex b/graphics/pgf/contrib/pmdraw/examples/example-15.tex
new file mode 100644
index 0000000000..672965eb13
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/examples/example-15.tex
@@ -0,0 +1,76 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |3````````````````````````````7|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |1````````````````````````````6|
+% *------------------------------*
+
+\pmdDiagram
+[ % Options
+ row sep=3,
+ diagram sep=2,
+ dots options={
+ \draw (#1,#2) node {};
+ }
+]{
+ { % Brick 1
+ [ % Options
+ degree top=3,
+ degree bottom=4
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{2}
+ {2}{3}
+ {3}{4}
+ {7}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=7,
+ blank bottom=1,
+ degree bottom=5,
+ levels=2
+ ]{ % Upper non transversal edges
+ [level=2]{3}{16}
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ {1}{2}
+ }
+ }{ % Brick 3
+ [ % Options
+ blank top=-1,
+ degree top=9,
+ blank bottom=4,
+ degree bottom=4,
+ levels=2
+ ]{ % Upper non transversal edges
+ {0}{1}
+ {2}{3}
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {5}{6}
+ {7}{8}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/examples/example-16.tex b/graphics/pgf/contrib/pmdraw/examples/example-16.tex
new file mode 100644
index 0000000000..efacb4d246
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/examples/example-16.tex
@@ -0,0 +1,127 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |3````````````````````````````0|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |1````````````````````````````9|
+% *------------------------------*
+
+\pmdProduct
+[ % options
+ row sep=3,
+ diagram sep=2,
+ dots options={
+ \draw (#1,#2) node[red] {\(\dots\dots\)};
+ },
+ edges added={dashed,blue}
+]{ % Added edges
+ {1}{3}
+ {7}{11}
+ {18}{21}
+}{ % Top Diagram
+ { % Brick 1
+ [ % Options
+ degree top=3,
+ degree bottom=4
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{2}
+ {2}{3}
+ {3}{4}
+ {7}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=7,
+ blank bottom=1,
+ degree bottom=5,
+ levels=2
+ ]{ % Upper non transversal edges
+ [level=2]{3}{16}
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ {1}{2}
+ }
+ }{ % Brick 3
+ [ % Options
+ blank top=3,
+ degree top=5,
+ blank bottom=4,
+ degree bottom=4,
+ levels=2
+ ]{ % Upper non transversal edges
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {5}{6}
+ {7}{8}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}{ % Bottom Diagram
+ { % Brick 1
+ [ % Options
+ degree top=3,
+ degree bottom=4
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{2}
+ {2}{3}
+ {3}{4}
+ [height=1.5]{7}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=7,
+ blank bottom=1,
+ degree bottom=5,
+ levels=2
+ ]{ % Upper non transversal edges
+ [level=2]{3}{16}
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ {1}{2}
+ }
+ }{ % Brick 3
+ [ % Options
+ blank top=3,
+ degree top=5,
+ blank bottom=4,
+ degree bottom=4,
+ levels=2
+ ]{ % Upper non transversal edges
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {5}{6}
+ {7}{8}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/examples/example-17.tex b/graphics/pgf/contrib/pmdraw/examples/example-17.tex
new file mode 100644
index 0000000000..97c6052f8a
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/examples/example-17.tex
@@ -0,0 +1,70 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |9````````````````````````````0|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |7````````````````````````````0|
+% *------------------------------*
+
+\pmdDiagram[grid]{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace node=red,
+ edges transversal=blue,
+ brace={
+ left=1,
+ right=4,
+ label={p - 1}
+ }
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }
+ { % Brick 2
+ [ % Options
+ degree top=6,
+ degree bottom=5,
+ dots node=blue,
+ edges upper=red,
+ edges lower=green,
+ edges transversal=blue
+ ]{ % Upper non transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Lower non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ [height=1]{2}{10}
+ {1}{1}
+ }
+ }{ % Brick 3
+ [ % Options
+ degree top=2,
+ blank top=1,
+ degree bottom=3
+ ]{ % Upper non transversal edges
+ {2}{3}
+ }{ % Lower non transversal edges
+ {1}{2}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/examples/example-18.tex b/graphics/pgf/contrib/pmdraw/examples/example-18.tex
new file mode 100644
index 0000000000..2d1014a1cb
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/examples/example-18.tex
@@ -0,0 +1,52 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |8````````````````````````````0|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |4````````````````````````````0|
+% *------------------------------*
+
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=5,
+ levels top=1,
+ levels bottom=1,
+ labels,
+ labels top node={red,above=16pt}
+ ]{ % Upper non transversal edges
+ [height=1.1]{2}{5}
+ }{ % Lower non transversal edges
+ [height=0.3]{2}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=2,
+ levels top=1,
+ levels bottom=1,
+ labels,
+ labels bottom options={
+ \draw (#1,#2) node[below=6pt] {\(#3''\)};
+ },
+ labels bottom start=6
+ ]{ % Upper non transversal edges
+ {1}{2}
+ }{ % Lower non transversal edges
+ {1}{2}
+ }{ % Transversal edges
+ {1}{2}
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/examples/example-19.tex b/graphics/pgf/contrib/pmdraw/examples/example-19.tex
new file mode 100644
index 0000000000..32c24bcf23
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/examples/example-19.tex
@@ -0,0 +1,53 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |7````````````````````````````6|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |7````````````````````````````3|
+% *------------------------------*
+
+\pmdDiagram[grid]{
+ { % Brick 1
+ [ % Options
+ degree=5,
+ levels top=1,
+ levels bottom=1,
+ labels,
+ labels top node={red,above=16pt}
+ ]{ % Upper non transversal edges
+ [height=1.1]{2}{5}
+ }{ % Lower non transversal edges
+ [height=0.3]{2}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=2,
+ levels top=1,
+ levels bottom=1,
+ labels,
+ labels bottom options={
+ \draw (#1,#2) node[below=6pt] {\(#3''\)};
+ },
+ labels bottom start=6,
+ labels top start=-4
+ ]{ % Upper non transversal edges
+ {1}{2}
+ }{ % Lower non transversal edges
+ {1}{2}
+ }{ % Transversal edges
+ {1}{2}
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/examples/example-2.tex b/graphics/pgf/contrib/pmdraw/examples/example-2.tex
new file mode 100644
index 0000000000..c80de8e5a3
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/examples/example-2.tex
@@ -0,0 +1,39 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |0````````````````````````````5|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |0````````````````````````````3|
+% *------------------------------*
+
+\pmdBrick[ % Options
+ blank top=2,
+ degree top=5,
+ blank bottom=1,
+ degree bottom=4,
+ levels top=4,
+ levels bottom=3
+]{ % Upper non transversal edges
+ {3}{4}
+ {5}{6}
+ [level=2]{4}{6}
+ [level=3]{4}{7}
+ [level=4]{3}{7}
+}{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ [level=2]{2}{4}
+ [level=3]{2}{5}
+}{ % Transversal edges
+ \pmdEmpty
+} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/examples/example-20.tex b/graphics/pgf/contrib/pmdraw/examples/example-20.tex
new file mode 100644
index 0000000000..8d0bc25cb3
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/examples/example-20.tex
@@ -0,0 +1,171 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |0````````````````````````````9|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |3````````````````````````````8|
+% *------------------------------*
+
+\usetikzlibrary{patterns}
+
+\newcommand{\blockStyles}{
+ \tikzstyle{typeI} = [
+ very thick,
+ rounded corners=5pt,
+ red,
+ preaction={fill, red!3}
+ ]
+ \tikzstyle{typeT} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 7.5pt off 2.5pt},
+ green,
+ preaction={fill, green!3}
+ ]
+ \tikzstyle{typeB} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 2.5pt off 2.5pt},
+ blue,
+ preaction={fill, blue!3}
+ ]
+ \tikzstyle{typeO} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 2.5pt off 2.5pt on 7.5pt off 2.5pt},
+ orange,
+ preaction={fill, orange!3}
+ ]
+ \tikzstyle{typeU} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 2.5pt off 2.5pt on 2.5pt off 2.5pt on 7.5pt off 2.5pt},
+ violet,
+ preaction={fill, violet!3}
+ ]
+ \tikzstyle{typeN} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 7.5pt off 2.5pt on 7.5pt off 2.5pt on 2.5pt off 2.5pt},
+ yellow,
+ preaction={fill, yellow!3}
+ ]
+}
+
+\pmdProduct[ % Options
+ decorate before={
+ \blockStyles
+ \draw[typeI] (0.6, 2.4) -- (1.4, 2.4) -- (1.4, 0.7) -- (3.4, 0.7) -- (3.4, -3.4) -- (2.6, -3.4) -- (2.6, -1.7) -- (0.6, -1.7) -- cycle;
+ \draw[typeT] (1.6, 1.3) rectangle (3.4, 2.4);
+ \draw[typeB] (0.6, -3.4) rectangle (2.4, -2.3);
+ }
+]{ % Added edges
+ {1}{3}
+}{ % Top Diagram
+ { % Brick 1
+ [ % Options
+ degree=3
+ ]{ % Upper non transversal edges
+ {2}{3}
+ }{ % Lower non transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}{ % Bottom Diagram
+ { % Brick 1
+ [ % Options
+ degree=3
+ ]{ % Upper non transversal edges
+ {1}{2}
+ }{ % Lower non transversal edges
+ {1}{2}
+ }{ % Transversal edges
+ {3}{3}
+ }
+ }
+}
+\hspace{5em}
+\pmdProduct[ % Options
+ decorate before={
+ \blockStyles
+ \draw[typeI] (0.6, 2.4) -- (1.4, 2.4) -- (1.4, 0.7) -- (10.4, 0.7) -- (10.4, -3.4) -- (9.6, -3.4) -- (9.6, -1.7) -- (0.6, -1.7) -- cycle;
+ \foreach \x in {0,2,7} {
+ \begin{scope}[shift={(\x,0)}]
+ \draw[typeT] (1.6, 1.3) rectangle (3.4, 2.4);
+ \end{scope}
+ }
+ \foreach \x in {0,2,4,7} {
+ \begin{scope}[shift={(\x,0)}]
+ \draw[typeB] (0.6, -3.4) rectangle (2.4, -2.3);
+ \end{scope}
+ }
+ }
+]{ % Added edges
+ {1}{5}
+ {9}{10}
+}{ % Top Diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ blank top=2,
+ degree top=2,
+ blank bottom=2,
+ degree bottom=2
+ ]{ % Upper non transversal edges
+ {3}{4}
+ }{ % Lower non transversal edges
+ {3}{4}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}{ % Bottom Diagram
+ { % Brick 1
+ [ % Options
+ degree=6
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ {5}{6}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=3
+ ]{ % Upper non transversal edges
+ {1}{2}
+ }{ % Lower non transversal edges
+ {1}{2}
+ }{ % Transversal edges
+ {3}{3}
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/examples/example-21.tex b/graphics/pgf/contrib/pmdraw/examples/example-21.tex
new file mode 100644
index 0000000000..e4bd9556cc
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/examples/example-21.tex
@@ -0,0 +1,183 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |8````````````````````````````7|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |7````````````````````````````3|
+% *------------------------------*
+
+\usetikzlibrary{patterns}
+
+\newcommand{\blockStyles}{
+ \tikzstyle{typeI} = [
+ very thick,
+ rounded corners=5pt,
+ red,
+ preaction={fill, red!3}
+ ]
+ \tikzstyle{typeT} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 7.5pt off 2.5pt},
+ green,
+ preaction={fill, green!3}
+ ]
+ \tikzstyle{typeB} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 2.5pt off 2.5pt},
+ blue,
+ preaction={fill, blue!3}
+ ]
+ \tikzstyle{typeO} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 2.5pt off 2.5pt on 7.5pt off 2.5pt},
+ orange,
+ preaction={fill, orange!3}
+ ]
+ \tikzstyle{typeU} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 2.5pt off 2.5pt on 2.5pt off 2.5pt on 7.5pt off 2.5pt},
+ violet,
+ preaction={fill, violet!3}
+ ]
+ \tikzstyle{typeN} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 7.5pt off 2.5pt on 7.5pt off 2.5pt on 2.5pt off 2.5pt},
+ yellow,
+ preaction={fill, yellow!3}
+ ]
+}
+
+\pmdProduct[ % Options
+ decorate before={
+ \blockStyles
+ \draw[typeO] (0.6, -1.9) rectangle (4.4, 0.7);
+ \foreach \x in {0,2} {
+ \begin{scope}[shift={(\x,0)}]
+ \draw[typeB] (0.6, -3.4) rectangle (2.4, -2.3);
+ \draw[typeT] (0.6, 1.3) rectangle (2.4, 2.4);
+ \end{scope}
+ }
+ }
+]{ % Added edges
+ {1}{4}
+}{ % Top Diagram
+ { % Brick 1
+ [ % Options
+ degree=4
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}{ % Bottom Diagram
+ { % Brick 1
+ [ % Options
+ degree=4,
+ levels top=2
+ ]{ % Upper non transversal edges
+ [level=2]{1}{4}
+ {2}{3}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}
+\hspace{5em}
+\pmdProduct[ % Options
+ decorate before={
+ \blockStyles
+ \draw[typeO] (0.6, -1.9) rectangle (11.4, 0.7);
+ \foreach \x in {0,2,4,7,9} {
+ \begin{scope}[shift={(\x,0)}]
+ \draw[typeB] (0.6, -3.4) rectangle (2.4, -2.3);
+ \draw[typeT] (0.6, 1.3) rectangle (2.4, 2.4);
+ \end{scope}
+ }
+ }
+]{ % Added edges
+ {1}{5}
+ {9}{11}
+}{ % Top Diagram
+ { % Brick 1
+ [ % Options
+ degree=6
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ {5}{6}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=4
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}{ % Bottom Diagram
+ { % Brick 1
+ [ % Options
+ degree top=5,
+ levels top=2,
+ degree bottom=6
+ ]{ % Upper non transversal edges
+ [level=2]{1}{11}
+ {2}{3}
+ {4}{5}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }{ % Brick 2
+ [ % Options
+ blank top=1,
+ degree top=3,
+ degree bottom=4,
+ levels top=2
+ ]{ % Upper non transversal edges
+ {2}{3}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/examples/example-22.tex b/graphics/pgf/contrib/pmdraw/examples/example-22.tex
new file mode 100644
index 0000000000..c7aa5c4cba
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/examples/example-22.tex
@@ -0,0 +1,179 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |7````````````````````````````9|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |6````````````````````````````5|
+% *------------------------------*
+
+\usetikzlibrary{patterns}
+
+\newcommand{\blockStyles}{
+ \tikzstyle{typeI} = [
+ very thick,
+ rounded corners=5pt,
+ red,
+ preaction={fill, red!3}
+ ]
+ \tikzstyle{typeT} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 7.5pt off 2.5pt},
+ green,
+ preaction={fill, green!3}
+ ]
+ \tikzstyle{typeB} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 2.5pt off 2.5pt},
+ blue,
+ preaction={fill, blue!3}
+ ]
+ \tikzstyle{typeO} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 2.5pt off 2.5pt on 7.5pt off 2.5pt},
+ orange,
+ preaction={fill, orange!3}
+ ]
+ \tikzstyle{typeU} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 2.5pt off 2.5pt on 2.5pt off 2.5pt on 7.5pt off 2.5pt},
+ violet,
+ preaction={fill, violet!3}
+ ]
+ \tikzstyle{typeN} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 7.5pt off 2.5pt on 7.5pt off 2.5pt on 2.5pt off 2.5pt},
+ yellow,
+ preaction={fill, yellow!3}
+ ]
+}
+
+\pmdProduct[ % Options
+ decorate before={
+ \blockStyles
+ \draw[typeU] (0.6, 2.4) -- (1.4, 2.4) -- (1.4, 0.7) -- (3.6, 0.7) -- (3.6, 2.4) -- (4.4, 2.4) -- (4.4, -1.7) -- (0.6, -1.7) -- cycle;
+ \draw[typeT] (1.6, 1.3) rectangle (3.4, 2.4);
+ \foreach \x in {0,2} {
+ \begin{scope}[shift={(\x,0)}]
+ \draw[typeB] (0.6, -3.4) rectangle (2.4, -2.3);
+ \end{scope}
+ }
+ }
+]{ % Added edges
+ {1}{4}
+}{ % Top Diagram
+ { % Brick 1
+ [ % Options
+ degree=4
+ ]{ % Upper non transversal edges
+ {2}{3}
+ }{ % Lower non transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ {1}{1}
+ {4}{4}
+ }
+ }
+}{ % Bottom Diagram
+ { % Brick 1
+ [ % Options
+ degree=4
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}
+\hspace{5em}
+\pmdProduct[ % Options
+ decorate before={
+ \blockStyles
+ \draw[typeU] (0.6, 2.4) -- (1.4, 2.4) -- (1.4, 0.7) -- (10.6, 0.7) -- (10.6, 2.4) -- (11.4, 2.4) -- (11.4, -1.7) -- (0.6, -1.7) -- cycle;
+ \foreach \x in {0,2,4,7,9} {
+ \begin{scope}[shift={(\x,0)}]
+ \draw[typeB] (0.6, -3.4) rectangle (2.4, -2.3);
+ \end{scope}
+ }
+ \foreach \x in {1,3,8} {
+ \begin{scope}[shift={(\x,0)}]
+ \draw[typeT] (0.6, 1.3) rectangle (2.4, 2.4);
+ \end{scope}
+ }
+ }
+]{ % Added edges
+ {1}{5}
+ {9}{11}
+}{ % Top Diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ blank top=2,
+ blank bottom=2,
+ degree=3
+ ]{ % Upper non transversal edges
+ {3}{4}
+ }{ % Lower non transversal edges
+ {3}{4}
+ }{ % Transversal edges
+ {5}{5}
+ }
+ }
+}{ % Bottom Diagram
+ { % Brick 1
+ [ % Options
+ degree=6
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ {5}{6}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=4
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/examples/example-23.tex b/graphics/pgf/contrib/pmdraw/examples/example-23.tex
new file mode 100644
index 0000000000..d2ae85c4e7
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/examples/example-23.tex
@@ -0,0 +1,179 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |6````````````````````````````5|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |4````````````````````````````3|
+% *------------------------------*
+
+\usetikzlibrary{patterns}
+
+\newcommand{\blockStyles}{
+ \tikzstyle{typeI} = [
+ very thick,
+ rounded corners=5pt,
+ red,
+ preaction={fill, red!3}
+ ]
+ \tikzstyle{typeT} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 7.5pt off 2.5pt},
+ green,
+ preaction={fill, green!3}
+ ]
+ \tikzstyle{typeB} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 2.5pt off 2.5pt},
+ blue,
+ preaction={fill, blue!3}
+ ]
+ \tikzstyle{typeO} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 2.5pt off 2.5pt on 7.5pt off 2.5pt},
+ orange,
+ preaction={fill, orange!3}
+ ]
+ \tikzstyle{typeU} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 2.5pt off 2.5pt on 2.5pt off 2.5pt on 7.5pt off 2.5pt},
+ violet,
+ preaction={fill, violet!3}
+ ]
+ \tikzstyle{typeN} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 7.5pt off 2.5pt on 7.5pt off 2.5pt on 2.5pt off 2.5pt},
+ yellow,
+ preaction={fill, yellow!3}
+ ]
+}
+
+\pmdProduct[ % Options
+ decorate before={
+ \blockStyles
+ \draw[typeN] (0.6, -3.4) -- (1.4, -3.4) -- (1.4, -1.7) -- (3.6, -1.7) -- (3.6, -3.4) -- (4.4, -3.4) -- (4.4, 0.7) -- (0.6, 0.7) -- cycle;
+ \draw[typeB] (1.6, -3.4) rectangle (3.4, -2.3);
+ \foreach \x in {0,2} {
+ \begin{scope}[shift={(\x,0)}]
+ \draw[typeT] (0.6, 1.3) rectangle (2.4, 2.4);
+ \end{scope}
+ }
+ }
+]{ % Added edges
+ {1}{4}
+}{ % Top Diagram
+ { % Brick 1
+ [ % Options
+ degree=4
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}{ % Bottom Diagram
+ { % Brick 1
+ [ % Options
+ degree=4
+ ]{ % Upper non transversal edges
+ {2}{3}
+ }{ % Lower non transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ {1}{1}
+ {4}{4}
+ }
+ }
+}
+\hspace{5em}
+\pmdProduct[ % Options
+ decorate before={
+ \blockStyles
+ \draw[typeN] (0.6, -3.4) -- (1.4, -3.4) -- (1.4, -1.7) -- (10.6, -1.7) -- (10.6, -3.4) -- (11.4, -3.4) -- (11.4, 0.7) -- (0.6, 0.7) -- cycle;
+ \foreach \x in {0,2,4,7,9} {
+ \begin{scope}[shift={(\x,0)}]
+ \draw[typeT] (0.6, 1.3) rectangle (2.4, 2.4);
+ \end{scope}
+ }
+ \foreach \x in {1,3,8} {
+ \begin{scope}[shift={(\x,0)}]
+ \draw[typeB] (0.6, -3.4) rectangle (2.4, -2.3);
+ \end{scope}
+ }
+ }
+]{ % Added edges
+ {1}{5}
+ {9}{11}
+}{ % Top Diagram
+ { % Brick 1
+ [ % Options
+ degree=6
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ {5}{6}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=4
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}{ % Bottom Diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ blank top=2,
+ blank bottom=2,
+ degree=3
+ ]{ % Upper non transversal edges
+ {3}{4}
+ }{ % Lower non transversal edges
+ {3}{4}
+ }{ % Transversal edges
+ {5}{5}
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/examples/example-24.tex b/graphics/pgf/contrib/pmdraw/examples/example-24.tex
new file mode 100644
index 0000000000..7b93adc805
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/examples/example-24.tex
@@ -0,0 +1,160 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |6```````````````````````````0|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |9````````````````````````````8|
+% *------------------------------*
+
+\pmdProduct[ % Options
+ decorate after={
+ \draw (1, 2) node[above=6pt] {\( x \)\strut};
+ \draw (2, 2) node[above=6pt] {\( y \)\strut};
+ }
+]{ % Added edges
+ {1}{3}
+}{ % Top diagram
+ { % Brick 1
+ [
+ degree=3
+ ]{ % Upper non transversal edges
+ {1}{2}
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [
+ degree=3
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}
+\hspace{2em}
+\pmdProduct[ % Options
+ decorate after={
+ \draw (1, 2) node[above=6pt] {\( x \)};
+ \draw (1, 0) node[left=6pt] {\( y \)};
+ \draw (1, -1) node[left=6pt] {\( j''' \)};
+ \draw (1, -3) node[left=6pt] {\( z \)};
+ }
+]{ % Added edges
+ {1}{3}
+}{ % Top diagram
+ { % Brick 1
+ [
+ degree=3
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [
+ degree=3
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\hspace{2em}
+\pmdProduct[ % Options
+ decorate after={
+ \draw (1, 2) node[above=6pt] {\( x \)};
+ \draw (1, 0) node[left=6pt] {\( y \)};
+ \draw (1, -1) node[left=6pt] {\( j''' \)};
+ \draw (2, -1) node[below=4pt] {\( z \)};
+ \draw (2, 0) node[above right=0pt] {\( k'' \)};
+ \draw (2, 2) node[above=6pt] {\( w \)};
+ }
+]{ % Added edges
+ {1}{3}
+}{ % Top diagram
+ { % Brick 1
+ [
+ degree=3
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [
+ degree=3
+ ]{ % Upper non transversal edges
+ {1}{2}
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}
+\hspace{2em}
+\pmdProduct[ % Options
+ decorate after={
+ \draw (1, 2) node[above=6pt] {\( x \)};
+ \draw (1, 0) node[left=6pt] {\( y \)};
+ \draw (1, -1) node[left=6pt] {\( j''' \)};
+ \draw (2, -1) node[below=4pt] {\( z \)};
+ \draw (2, 0) node[above=4pt] {\( k'' \)};
+ \draw (3, 0) node[above=4pt] {\( w \)};
+ }
+]{ % Added edges
+ {1}{4}
+}{ % Top diagram
+ { % Brick 1
+ [
+ degree=4
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [
+ degree=4
+ ]{ % Upper non transversal edges
+ {1}{2}
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/examples/example-25.tex b/graphics/pgf/contrib/pmdraw/examples/example-25.tex
new file mode 100644
index 0000000000..bea76db2f3
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/examples/example-25.tex
@@ -0,0 +1,63 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |9````````````````````````````1|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |4````````````````````````````2|
+% *------------------------------*
+
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=5,
+ brace={
+ left=4,
+ right=7,
+ label={p - 3}
+ }
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{2}
+ {2}{3}
+ {3}{1}
+ {4}{4}
+ {5}{5}
+ }
+ }
+ { % Brick 2
+ [ % Options
+ degree=5
+ ]{ % Upper non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }{ % Brick 3
+ [ % Options
+ degree=2
+ ]{ % Upper non transversal edges
+ {1}{2}
+ }{ % Lower non transversal edges
+ {1}{2}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/examples/example-3.tex b/graphics/pgf/contrib/pmdraw/examples/example-3.tex
new file mode 100644
index 0000000000..09a5256eac
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/examples/example-3.tex
@@ -0,0 +1,53 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |6````````````````````````````2|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |9````````````````````````````4|
+% *------------------------------*
+
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=5,
+ levels top=4,
+ levels bottom=3
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ [level=2]{2}{4}
+ [level=3]{2}{5}
+ [level=4]{1}{5}
+ [level=3]{5}{7}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ [level=2]{2}{4}
+ [level=3]{2}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=4
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Lower non transversal edges
+ {1}{2}
+ }{ % Transversal edges
+ {1}{2}
+ {3}{4}
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/examples/example-4.tex b/graphics/pgf/contrib/pmdraw/examples/example-4.tex
new file mode 100644
index 0000000000..bbbf5bd819
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/examples/example-4.tex
@@ -0,0 +1,77 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |1````````````````````````````1|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |8````````````````````````````3|
+% *------------------------------*
+
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree top=3,
+ degree bottom=4,
+ brace={
+ left=2,
+ right=7,
+ label={p}
+ }
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{2}
+ {2}{3}
+ {3}{4}
+ {7}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=7,
+ blank bottom=1,
+ degree bottom=5,
+ levels=2,
+ brace={
+ left=4,
+ right=12,
+ label={q},
+ above
+ }
+ ]{ % Upper non transversal edges
+ [level=2]{3}{13}
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ {1}{2}
+ }
+ }{ % Brick 3
+ [ % Options
+ degree top=5,
+ blank bottom=1,
+ degree bottom=4,
+ levels=2
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Lower non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/examples/example-5.tex b/graphics/pgf/contrib/pmdraw/examples/example-5.tex
new file mode 100644
index 0000000000..e7a9c63e96
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/examples/example-5.tex
@@ -0,0 +1,118 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |1````````````````````````````2|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |2````````````````````````````8|
+% *------------------------------*
+
+\pmdProduct{ % Added edges
+ {1}{3}
+ {7}{11}
+ {15}{18}
+}{ % Top Diagram
+ { % Brick 1
+ [ % Options
+ degree top=3,
+ degree bottom=4
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{2}
+ {2}{3}
+ {3}{4}
+ {7}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=7,
+ blank bottom=1,
+ degree bottom=5,
+ levels=2
+ ]{ % Upper non transversal edges
+ [level=2]{3}{13}
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ {1}{2}
+ }
+ }{ % Brick 3
+ [ % Options
+ degree top=5,
+ blank bottom=1,
+ degree bottom=4,
+ levels=2
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Lower non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}{ % Bottom Diagram
+ { % Brick 1
+ [ % Options
+ degree top=3,
+ degree bottom=4
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{2}
+ {2}{3}
+ {3}{4}
+ {7}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=7,
+ blank bottom=1,
+ degree bottom=5,
+ levels=2,
+ no dots
+ ]{ % Upper non transversal edges
+ [level=2]{3}{13}
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ {1}{2}
+ }
+ }{ % Brick 3
+ [ % Options
+ degree top=5,
+ blank bottom=1,
+ degree bottom=4,
+ levels=2
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Lower non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/examples/example-6.tex b/graphics/pgf/contrib/pmdraw/examples/example-6.tex
new file mode 100644
index 0000000000..18a47a794c
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/examples/example-6.tex
@@ -0,0 +1,55 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |4````````````````````````````5|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |1````````````````````````````9|
+% *------------------------------*
+
+\pmdProduct[ % Options
+ decorate after={
+ \draw[very thick,red,rounded corners=5pt] (0.6, -3.4) rectangle (1.4, 2.4);
+ }
+]{ % Added edges
+ {1}{4}
+}{ % Top Diagram
+ { % Brick 1
+ [ % Options
+ degree=4
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ {3}{3}
+ {4}{4}
+ }
+ }
+}{ % Bottom Diagram
+ { % Brick 1
+ [ % Options
+ degree=4
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ {3}{3}
+ {4}{4}
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/examples/example-7.tex b/graphics/pgf/contrib/pmdraw/examples/example-7.tex
new file mode 100644
index 0000000000..171bf113a4
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/examples/example-7.tex
@@ -0,0 +1,63 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |3````````````````````````````6|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |3````````````````````````````2|
+% *------------------------------*
+
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={p}
+ }
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=5,
+ degree bottom=6
+ ]{ % Upper non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ [height=1]{10}{2}
+ {1}{1}
+ }
+ }{ % Brick 3
+ [ % Options
+ degree top=3,
+ blank bottom=1,
+ degree bottom=2
+ ]{ % Upper non transversal edges
+ {1}{2}
+ }{ % Lower non transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/examples/example-8.tex b/graphics/pgf/contrib/pmdraw/examples/example-8.tex
new file mode 100644
index 0000000000..6ed2f2cf5c
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/examples/example-8.tex
@@ -0,0 +1,63 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |0````````````````````````````7|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |7````````````````````````````9|
+% *------------------------------*
+
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={p}
+ }
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=6,
+ degree bottom=5
+ ]{ % Upper non transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Lower non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ [height=1]{2}{10}
+ {1}{1}
+ }
+ }{ % Brick 3
+ [ % Options
+ degree top=2,
+ blank top=1,
+ degree bottom=3
+ ]{ % Upper non transversal edges
+ {2}{3}
+ }{ % Lower non transversal edges
+ {1}{2}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/examples/example-9.tex b/graphics/pgf/contrib/pmdraw/examples/example-9.tex
new file mode 100644
index 0000000000..8e7d87023f
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/examples/example-9.tex
@@ -0,0 +1,37 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |1````````````````````````````1|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |7````````````````````````````4|
+% *------------------------------*
+
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=17
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ [height=0.25]{1}{11}
+ [height=0.5]{2}{12}
+ [height=0.75]{3}{13}
+ [height=1]{4}{14}
+ [height=1.25]{5}{15}
+ [height=1.5]{6}{16}
+ [height=1.75]{7}{17}
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/pmdraw.pdf b/graphics/pgf/contrib/pmdraw/pmdraw.pdf
new file mode 100644
index 0000000000..1cc4de9135
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/pmdraw.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/pmdraw/pmdraw.sty b/graphics/pgf/contrib/pmdraw/pmdraw.sty
new file mode 100644
index 0000000000..36f506b51f
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/pmdraw.sty
@@ -0,0 +1,1544 @@
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{pmdraw}[2024-06-02 v1.4 pmdraw]
+
+% *------------------------------*
+% |7````````````````````````````4|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |3````````````````````````````4|
+% *------------------------------*
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% Required packages %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% \RequirePackage{datetime}
+\RequirePackage{keyval}
+\RequirePackage{tikz}
+\usetikzlibrary{math,decorations.pathreplacing,calligraphy,backgrounds}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% Internal control and option commands %
+% - loosely ordered alphabetically %
+% - includes default values where appropriate %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\newcommand{\pmdraw@braceLabel}{}% Label of brace
+
+\newcommand{\pmdraw@diagSep}{1}% Vertical separation between bottom row of top diagram and top row of bottom diagram in product diagram
+
+\newcommand{\pmdraw@drawAedgesOptions}{}% Draw options for added edges in product diagram
+\newcommand{\pmdraw@drawAedges}[2]{% Draws added edges in product diagram from #1 vertex to #2 vertex, assumes #1<#2
+ \@ifclassloaded{beamer}{% If in beamer
+ \uncover<\pmdraw@edgesAddedUncover>{% Uncovers added edges
+ \foreach \x in {#1,...,#2} {% For each vertex in range
+ \ifnum\value{pmdraw@ifEdgesAdded}=0% If drawing added edges
+ \draw[dotted,thick,apply style/.expand once=\pmdraw@drawAedgesOptions] (\x,0) -- (\x,-\pmdraw@diagSep);% Draw concatenation edge
+ \else% If hiding top vertices
+ \phantom{%
+ \draw[dotted,thick,apply style/.expand once=\pmdraw@drawAedgesOptions] (\x,0) -- (\x,-\pmdraw@diagSep);% Draw concatenation edge
+ }%
+ \fi%
+ }%
+ }%
+ }{% If not in beamer
+ \foreach \x in {#1,...,#2} {% For each vertex in range
+ \ifnum\value{pmdraw@ifEdgesAdded}=0% If drawing added edges
+ \draw[dotted,thick,apply style/.expand once=\pmdraw@drawAedgesOptions] (\x,0) -- (\x,-\pmdraw@diagSep);% Draw concatenation edge
+ \else% If hiding top vertices
+ \phantom{%
+ \draw[dotted,thick,apply style/.expand once=\pmdraw@drawAedgesOptions] (\x,0) -- (\x,-\pmdraw@diagSep);% Draw concatenation edge
+ }%
+ \fi%
+ }%
+ }%
+ \pmdraw@AedgesLoop% Restart for loop
+}
+
+\newcommand{\pmdraw@drawBraceDrawOptions}{}% Draw options for brace
+\newcommand{\pmdraw@drawBraceNodeOptions}{}% Node options for brace
+\newcommand{\pmdraw@drawBraceDefault}[3]{% Draws brace a brace starting from #1 vertex to #2 vertex with label #3, assumes #1<#2 - DEFAULT
+ \ifnum\pmdraw@ifProdDiag=1% If drawing a product diagram or if placing brace above diagram
+ \draw[
+ very thick,
+ decorate,
+ decoration={calligraphic brace,amplitude=6pt},
+ apply style/.expand once=\pmdraw@drawBraceDrawOptions
+ ] (#1-0.17,\pmdraw@rowSep+0.5) -- (#2+0.17,\pmdraw@rowSep+0.5)
+ node[
+ pos=0.5,
+ above=6pt,
+ apply style/.expand once=\pmdraw@drawBraceNodeOptions
+ ] {\(#3\)};% Draw brace on top of diagram
+ \else% If not drawing a product diagram or if placing brace below diagram
+ \draw[
+ very thick,
+ decorate,
+ decoration={calligraphic brace,mirror,amplitude=6pt},
+ apply style/.expand once=\pmdraw@drawBraceDrawOptions
+ ] (#1-0.17,-0.5) -- (#2+0.17,-0.5)
+ node[
+ pos=0.5,
+ below=6pt,
+ apply style/.expand once=\pmdraw@drawBraceNodeOptions
+ ] {\(#3\)};% Draw brace on bottom of diagram
+ \fi%
+}
+\let\pmdraw@drawBrace\pmdraw@drawBraceDefault% Draws brace a brace starting from #1 vertex to #2 vertex with label #3, assumes #1<#2
+
+\newcommand{\pmdraw@drawDotsDrawOptions}{}% Draw options for dots between bricks
+\newcommand{\pmdraw@drawDotsNodeOptions}{}% Node options for dots between bricks
+\newcommand{\pmdraw@drawDotsDefault}[2]{% Draws dots between bricks at (#1,#2) - DEFAULT
+ \draw[apply style/.expand once=\pmdraw@drawDotsDrawOptions] (#1,#2) node[apply style/.expand once=\pmdraw@drawDotsNodeOptions] {\(\dots\)};%
+}
+\let\pmdraw@drawDots\pmdraw@drawDotsDefault% Draws dots between bricks at (#1,#2)
+
+\newcommand{\pmdraw@drawEdgeDrawOptions}{}% Draw options for edge
+
+\newcommand{\pmdraw@drawLabelBDrawOptions}{}% Draw options for label of a vertex in bottom row
+\newcommand{\pmdraw@drawLabelBNodeOptions}{}% Node options for label of a vertex in bottom row
+\newcommand{\pmdraw@drawLabelBottomDefault}[3]{% For bottom row, draws the label #3 for a vertex at (#1,#2) - DEFAULT
+ \draw[apply style/.expand once=\pmdraw@drawLabelBDrawOptions] (#1,#2) node[below=6pt,apply style/.expand once=\pmdraw@drawLabelBNodeOptions] {\(#3'\)};%
+}
+\let\pmdraw@drawLabelBottom\pmdraw@drawLabelBottomDefault% For bottom row, draws the label #3 for a vertex at (#1,#2)
+
+\newcommand{\pmdraw@drawLabelTDrawOptions}{}% Draw options for label of a vertex in top row
+\newcommand{\pmdraw@drawLabelTNodeOptions}{}% Node options for label of a vertex in top row
+\newcommand{\pmdraw@drawLabelTopDefault}[3]{% For top row, draws the label #3 for a vertex at (#1,#2) - DEFAULT
+ \draw[apply style/.expand once=\pmdraw@drawLabelTDrawOptions] (#1,#2) node[above=6pt,apply style/.expand once=\pmdraw@drawLabelTNodeOptions] {\(#3\)};%
+}
+\let\pmdraw@drawLabelTop\pmdraw@drawLabelTopDefault% For top row, draws the label #3 for a vertex at (#1,#2)
+
+\newcommand{\pmdraw@drawLedgesDrawOptions}{}% Draw options for lower non-transversal edges
+\newcommand{\pmdraw@drawLedgesDrawDefault}[2]{% Draws lower non-transversal edge from #1 vertex to #2 vertex, assumes #1<#2 - DEFAULT
+ \draw[apply style/.expand once=\pmdraw@drawLedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#1,0) arc (180:90:\pmdraw{edgeHeight});% Draw left arch
+ \draw[apply style/.expand once=\pmdraw@drawLedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#1+\pmdraw{edgeHeight},\pmdraw{edgeHeight}) -- (#2-\pmdraw{edgeHeight},\pmdraw{edgeHeight});% Draw straight line
+ \draw[apply style/.expand once=\pmdraw@drawLedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#2-\pmdraw{edgeHeight},\pmdraw{edgeHeight}) arc (90:0:\pmdraw{edgeHeight});% Draw right arc
+ \renewcommand{\pmdraw@drawEdgeDrawOptions}{}% Reset draw options for edge
+}
+\let\pmdraw@drawLedgesDraw\pmdraw@drawLedgesDrawDefault% Draws lower non-transversal edge from #1 vertex to #2 vertex, assumes #1<#2
+
+\newcommand{\pmdraw@drawNoLabelBa}{-1}% 1st vertex to skip label in bottom row
+\newcommand{\pmdraw@drawNoLabelBb}{-1}% 2nd vertex to skip label in bottom row
+\newcommand{\pmdraw@drawNoLabelBc}{-1}% 3rd vertex to skip label in bottom row
+\newcommand{\pmdraw@drawNoLabelBd}{-1}% 4th vertex to skip label in bottom row
+\newcommand{\pmdraw@drawNoLabelBe}{-1}% 5th vertex to skip label in bottom row
+\newcommand{\pmdraw@drawNoLabelBf}{-1}% 6th vertex to skip label in bottom row
+\newcommand{\pmdraw@drawNoLabelBg}{-1}% 7th vertex to skip label in bottom row
+\newcommand{\pmdraw@drawNoLabelBh}{-1}% 8th vertex to skip label in bottom row
+\newcommand{\pmdraw@drawNoLabelBi}{-1}% 9th vertex to skip label in bottom row
+\newcommand{\pmdraw@drawNoLabelTa}{-1}% 1st vertex to skip label in top row
+\newcommand{\pmdraw@drawNoLabelTb}{-1}% 2nd vertex to skip label in top row
+\newcommand{\pmdraw@drawNoLabelTc}{-1}% 3rd vertex to skip label in top row
+\newcommand{\pmdraw@drawNoLabelTd}{-1}% 4th vertex to skip label in top row
+\newcommand{\pmdraw@drawNoLabelTe}{-1}% 5th vertex to skip label in top row
+\newcommand{\pmdraw@drawNoLabelTf}{-1}% 6th vertex to skip label in top row
+\newcommand{\pmdraw@drawNoLabelTg}{-1}% 7th vertex to skip label in top row
+\newcommand{\pmdraw@drawNoLabelTh}{-1}% 8th vertex to skip label in top row
+\newcommand{\pmdraw@drawNoLabelTi}{-1}% 9th vertex to skip label in top row
+
+\newcommand{\pmdraw@drawNoVertexBa}{-1}% 1st vertex to skip in bottom row
+\newcommand{\pmdraw@drawNoVertexBb}{-1}% 2nd vertex to skip in bottom row
+\newcommand{\pmdraw@drawNoVertexBc}{-1}% 3rd vertex to skip in bottom row
+\newcommand{\pmdraw@drawNoVertexBd}{-1}% 4th vertex to skip in bottom row
+\newcommand{\pmdraw@drawNoVertexBe}{-1}% 5th vertex to skip in bottom row
+\newcommand{\pmdraw@drawNoVertexBf}{-1}% 6th vertex to skip in bottom row
+\newcommand{\pmdraw@drawNoVertexBg}{-1}% 7th vertex to skip in bottom row
+\newcommand{\pmdraw@drawNoVertexBh}{-1}% 8th vertex to skip in bottom row
+\newcommand{\pmdraw@drawNoVertexBi}{-1}% 9th vertex to skip in bottom row
+\newcommand{\pmdraw@drawNoVertexTa}{-1}% 1st vertex to skip in top row
+\newcommand{\pmdraw@drawNoVertexTb}{-1}% 2nd vertex to skip in top row
+\newcommand{\pmdraw@drawNoVertexTc}{-1}% 3rd vertex to skip in top row
+\newcommand{\pmdraw@drawNoVertexTd}{-1}% 4th vertex to skip in top row
+\newcommand{\pmdraw@drawNoVertexTe}{-1}% 5th vertex to skip in top row
+\newcommand{\pmdraw@drawNoVertexTf}{-1}% 6th vertex to skip in top row
+\newcommand{\pmdraw@drawNoVertexTg}{-1}% 7th vertex to skip in top row
+\newcommand{\pmdraw@drawNoVertexTh}{-1}% 8th vertex to skip in top row
+\newcommand{\pmdraw@drawNoVertexTi}{-1}% 9th vertex to skip in top row
+
+\newcommand{\pmdraw@drawTedgesDrawOptions}{}% Draw options for transversal edges
+\newcommand{\pmdraw@drawTedgesDrawDefault}[2]{% Draws transversal edge from #1 vertex in top row to #2 vertex in bottom row - DEFAULT
+ \ifnum\pmdraw@ifTedgeHorizontal=0% If drawing a straight line edge
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#1,\pmdraw@rowSep) -- (#2,0);% Draw straight line
+ \else% If transversal edge is drawn horizontally
+ \ifnum#1>#2% If edge goes from top right to bottom left
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#2,0) arc (180:90:\pmdraw{Tlevel});% Draw bottom arch
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#2+\pmdraw{Tlevel},\pmdraw{Tlevel}) -- (#1-\pmdraw@rowSep+\pmdraw{Tlevel}, \pmdraw{Tlevel});% Draw straight line
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#1-\pmdraw@rowSep+\pmdraw{Tlevel},\pmdraw{Tlevel}) arc (270:360:{\pmdraw@rowSep-\pmdraw{Tlevel}});% Draw top arc
+ \else% If edge goes from top left to bottom right
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#2,0) arc (0:90:\pmdraw{Tlevel});% Draw bottom arch
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#2-\pmdraw{Tlevel},\pmdraw{Tlevel}) -- (#1+\pmdraw@rowSep-\pmdraw{Tlevel}, \pmdraw{Tlevel});% Draw straight line
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#1+\pmdraw@rowSep-\pmdraw{Tlevel},\pmdraw{Tlevel}) arc (270:180:{\pmdraw@rowSep-\pmdraw{Tlevel}});% Draw top arc
+ \fi%
+ \renewcommand{\pmdraw@ifTedgeHorizontal}{0}% Reset flag to default
+ \fi%
+ \renewcommand{\pmdraw@drawEdgeDrawOptions}{}% Reset draw options for edge
+}
+\let\pmdraw@drawTedgesDraw\pmdraw@drawTedgesDrawDefault% Draws transversal edge from #1 vertex in top row to #2 vertex in bottom row
+
+\newcommand{\pmdraw@drawUedgesDrawOptions}{}% Draw options for upper non-transversal edges
+\newcommand{\pmdraw@drawUedgesDrawDefault}[2]{% Draws upper non-transversal edge from #1 vertex to #2 vertex, assumes #1<#2 - DEFAULT
+ \draw[apply style/.expand once=\pmdraw@drawUedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#1,\pmdraw@rowSep) arc (180:270:\pmdraw{edgeHeight});% Draw left arch
+ \draw[apply style/.expand once=\pmdraw@drawUedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#1+\pmdraw{edgeHeight},\pmdraw@rowSep-\pmdraw{edgeHeight}) -- (#2-\pmdraw{edgeHeight},\pmdraw@rowSep-\pmdraw{edgeHeight});% Draw straight line
+ \draw[apply style/.expand once=\pmdraw@drawUedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#2-\pmdraw{edgeHeight},\pmdraw@rowSep-\pmdraw{edgeHeight}) arc (270:360:\pmdraw{edgeHeight});% Draw right arc
+ \renewcommand{\pmdraw@drawEdgeDrawOptions}{}% Reset draw options for edge
+}
+\let\pmdraw@drawUedgesDraw\pmdraw@drawUedgesDrawDefault% Draws upper non-transversal edge from #1 vertex to #2 vertex, assumes #1<#2
+
+\newcommand{\pmdraw@drawVertexOptions}{}% Draw options for vertices
+\newcommand{\pmdraw@drawVertex}[2]{% Draws a vertex at (#1,#2)
+ \fill[apply style/.expand once=\pmdraw@drawVertexOptions] (#1,#2) circle (.17);%
+}
+
+\newcommand{\pmdraw@edgeUncover}{1-}% Sets the uncover options of edge
+\newcommand{\pmdraw@edgesAddedUncover}{1-}% Sets the uncover options of added edges
+\newcommand{\pmdraw@edgesUncover}{1-}% Sets the uncover options of edges
+
+\newcommand{\pmdraw@hookAfterBrick}{}% Hook after drawing a brick
+\newcommand{\pmdraw@hookAfterDiagram}{}% Hook after drawing a diagram
+\newcommand{\pmdraw@hookBeforeBrick}{}% Hook before drawing a brick
+\newcommand{\pmdraw@hookBeforeDiagram}{}% Hook before drawing a diagram
+
+\newcommand{\pmdraw@ifDiagWDots}{0}% Boolean if drawing a diagram with dots
+\newcommand{\pmdraw@ifEdgesFirst}{0}% Boolean if drawing edges before vertices
+\newcommand{\pmdraw@ifGrid}{0}% Boolean if displaying helper grid
+\newcommand{\pmdraw@ifLabelsB}{0}% Boolean if displaying labels for vertices in bottom row
+\newcommand{\pmdraw@ifLabelsT}{0}% Boolean if displaying labels for vertices in top row
+\newcommand{\pmdraw@ifProdDiag}{0}% Boolean if drawing a product diagram
+\newcommand{\pmdraw@ifTedgesFirst}{0}% Boolean if drawing transversal edges before non-transversal edges
+\newcommand{\pmdraw@ifTedgeHorizontal}{0}% Boolean if transversal edge is drawn horizontally
+
+\newcommand{\pmdraw@NTedgesHeight}{-1000}% Height of non-transversal edges if manually set, a value of -1000 sets height automatically
+
+\newcommand{\pmdraw@reset}{% Resets user keys and other flags to default values after drawing diagram
+ \renewcommand{\pmdraw@diagSep}{1}% Resets vertical space between product diagrams
+ \renewcommand{\pmdraw@drawAedgesOptions}{}% Resets draw options for added edges in product diagram
+ \let\pmdraw@drawDots\pmdraw@drawDotsDefault% Resets drawing of dots between bricks
+ \renewcommand{\pmdraw@edgesAddedUncover}{1-}% Resets the uncover options of added edges
+ \renewcommand{\pmdraw@hookAfterDiagram}{}% Clears hook after drawing a diagram
+ \renewcommand{\pmdraw@hookBeforeDiagram}{}% Clears hook before drawing a diagram
+ \renewcommand{\pmdraw@ifGrid}{0}% Hides grid
+ \renewcommand{\pmdraw@ifDiagWDots}{0}% Reset if drawing a diagram with dots
+ \renewcommand{\pmdraw@rowSep}{2}% Resets vertical separation between rows of vertices in brick
+ \renewcommand{\pmdraw@tikz}{}% Resets tikz options
+ \renewcommand{\pmdraw@vertexSep}{0}% Resets vertical space between product diagrams
+ \setcounter{pmdraw@blankB}{0}% Resets number of blank vertices in bottom row to the left of brick
+ \setcounter{pmdraw@blankT}{0}% Resets number of blank vertices in top row to the left of brick
+ \setcounter{pmdraw@bottomShift}{0}% Resets shift on right end of bottom row of brick
+ \setcounter{pmdraw@topShift}{0}% Resets shift on right end of top row of brick
+ \setcounter{pmdraw@ifDiagWDotsFirst}{1}% Reset if drawing first brick of diagram
+ \setcounter{pmdraw@ifEdgesAdded}{0}% Resets boolean if hiding added edges
+}
+
+\newcommand{\pmdraw@rowSep}{2}% Vertical separation between rows of vertices in brick
+
+\newcommand{\pmdraw@tikz}{}% Tikz options
+
+\newcommand{\pmdraw@verticesBottomUncover}{1-}% Sets the uncover options of bottom vertices
+\newcommand{\pmdraw@verticesTopUncover}{1-}% Sets the uncover options of top vertices
+
+\newcommand{\pmdraw@vertexSep}{0}% Vertical separation between bottom row of top diagram and top row of bottom diagram in product diagram not for added edges
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% Counters %
+% - loosely ordered alphabetically %
+% - includes default values where appropriate %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\newcounter{pmdraw@blankB}% Number of blank vertices in bottom row to the left of brick
+\newcounter{pmdraw@blankT}% Number of blank vertices in top row to the left of brick
+
+\newcounter{pmdraw@bottomTotal}% Size of bottom row of brick
+\newcounter{pmdraw@bottomShift}% Shift on right end of bottom row of brick
+
+\newcounter{pmdraw@braceL}% Left starting vertex of brace
+\newcounter{pmdraw@braceR}% Right terminating vertex of brace
+
+\newcounter{pmdraw@brickShift}% Shift required for bricks after dots in diagram with dots
+
+\newcounter{pmdraw@degreeB}% Degree (number of vertices) of bottom row of brick
+\newcounter{pmdraw@degreeT}% Degree (number of vertices) of top row of brick
+
+\newcounter{pmdraw@ifDiagWDotsFirst}% In drawing with dots, boolean if drawing first brick of diagram
+\setcounter{pmdraw@ifDiagWDotsFirst}{1}
+
+\newcounter{pmdraw@ifEdge}% Boolean if hiding edge
+\setcounter{pmdraw@ifEdge}{0}
+\newcounter{pmdraw@ifEdgesAdded}% Boolean if hiding added edges
+\setcounter{pmdraw@ifEdgesAdded}{0}
+\newcounter{pmdraw@ifEdges}% Boolean if hiding edges
+\setcounter{pmdraw@ifEdges}{0}
+
+\newcounter{pmdraw@ifVerticesBottom}% Boolean if hiding bottom row of vertices
+\setcounter{pmdraw@ifVerticesBottom}{0}
+\newcounter{pmdraw@ifVerticesTop}% Boolean if hiding top row of vertices
+\setcounter{pmdraw@ifVerticesTop}{0}
+
+\newcounter{pmdraw@labelStartB}% Starting value of labels of vertices in bottom row
+\setcounter{pmdraw@labelStartB}{1}
+\newcounter{pmdraw@labelStartT}% Starting value of labels of vertices in top row
+\setcounter{pmdraw@labelStartT}{1}
+
+\newcounter{pmdraw@NTlevel}% Level corresponding to a height for a non-transversal edge
+
+\newcounter{pmdraw@topTotal}% Size of top row of brick
+\newcounter{pmdraw@topShift}% Shift on right end of top row of brick
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% Keys for bricks %
+% - ordered as per manual %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% To pass draw options to \draw command
+% Verbatim copy from:
+% https://tex.stackexchange.com/a/64237
+\tikzset{apply style/.code={\tikzset{#1}}}
+
+\define@key{pmdraw@brick}{degree}{% Sets degree (number of vertices per row) of diagram
+ \setcounter{pmdraw@degreeB}{#1}% Sets degree (number of vertices per row) for bottom row
+ \setcounter{pmdraw@degreeT}{#1}% Sets degree (number of vertices per row) for top row
+}
+\define@key{pmdraw@brick}{degree bottom}{% Sets degree (number of vertices per row) for bottom row
+ \setcounter{pmdraw@degreeB}{#1}%
+}
+\define@key{pmdraw@brick}{degree top}{% Sets degree (number of vertices per row) for top row
+ \setcounter{pmdraw@degreeT}{#1}%
+}
+
+\define@key{pmdraw@brick}{blank bottom}{% Sets the number of blank vertices on left of bottom row
+ \setcounter{pmdraw@blankB}{#1}%
+}
+\define@key{pmdraw@brick}{blank top}{% Sets the number of blank vertices on left of top row
+ \setcounter{pmdraw@blankT}{#1}%
+}
+
+\define@key{pmdraw@brick}{row sep}{% Sets vertical separation between rows of vertices in brick
+ \renewcommand{\pmdraw@rowSep}{#1}%
+}
+
+\define@key{pmdraw@brick}{vertices}{% Sets the draw options of vertices
+ \renewcommand{\pmdraw@drawVertexOptions}{#1}%
+}
+\define@key{pmdraw@brick}{no vertex bottom 1}{% Sets 1st vertex to skip in bottom row
+ \renewcommand{\pmdraw@drawNoVertexBa}{#1}%
+}
+\define@key{pmdraw@brick}{no vertex bottom 2}{% Sets 2nd vertex to skip in bottom row
+ \renewcommand{\pmdraw@drawNoVertexBb}{#1}%
+}
+\define@key{pmdraw@brick}{no vertex bottom 3}{% Sets 3rd vertex to skip in bottom row
+ \renewcommand{\pmdraw@drawNoVertexBc}{#1}%
+}
+\define@key{pmdraw@brick}{no vertex bottom 4}{% Sets 4th vertex to skip in bottom row
+ \renewcommand{\pmdraw@drawNoVertexBd}{#1}%
+}
+\define@key{pmdraw@brick}{no vertex bottom 5}{% Sets 5th vertex to skip in bottom row
+ \renewcommand{\pmdraw@drawNoVertexBe}{#1}%
+}
+\define@key{pmdraw@brick}{no vertex bottom 6}{% Sets 6th vertex to skip in bottom row
+ \renewcommand{\pmdraw@drawNoVertexBf}{#1}%
+}
+\define@key{pmdraw@brick}{no vertex bottom 7}{% Sets 7th vertex to skip in bottom row
+ \renewcommand{\pmdraw@drawNoVertexBg}{#1}%
+}
+\define@key{pmdraw@brick}{no vertex bottom 8}{% Sets 8th vertex to skip in bottom row
+ \renewcommand{\pmdraw@drawNoVertexBh}{#1}%
+}
+\define@key{pmdraw@brick}{no vertex bottom 9}{% Sets 9th vertex to skip in bottom row
+ \renewcommand{\pmdraw@drawNoVertexBi}{#1}%
+}
+\define@key{pmdraw@brick}{no vertex top 1}{% Sets 1st vertex to skip in top row
+ \renewcommand{\pmdraw@drawNoVertexTa}{#1}%
+}
+\define@key{pmdraw@brick}{no vertex top 2}{% Sets 2nd vertex to skip in top row
+ \renewcommand{\pmdraw@drawNoVertexTb}{#1}%
+}
+\define@key{pmdraw@brick}{no vertex top 3}{% Sets 3rd vertex to skip in top row
+ \renewcommand{\pmdraw@drawNoVertexTc}{#1}%
+}
+\define@key{pmdraw@brick}{no vertex top 4}{% Sets 4th vertex to skip in top row
+ \renewcommand{\pmdraw@drawNoVertexTd}{#1}%
+}
+\define@key{pmdraw@brick}{no vertex top 5}{% Sets 5th vertex to skip in top row
+ \renewcommand{\pmdraw@drawNoVertexTe}{#1}%
+}
+\define@key{pmdraw@brick}{no vertex top 6}{% Sets 6th vertex to skip in top row
+ \renewcommand{\pmdraw@drawNoVertexTf}{#1}%
+}
+\define@key{pmdraw@brick}{no vertex top 7}{% Sets 7th vertex to skip in top row
+ \renewcommand{\pmdraw@drawNoVertexTg}{#1}%
+}
+\define@key{pmdraw@brick}{no vertex top 8}{% Sets 8th vertex to skip in top row
+ \renewcommand{\pmdraw@drawNoVertexTh}{#1}%
+}
+\define@key{pmdraw@brick}{no vertex top 9}{% Sets 9th vertex to skip in top row
+ \renewcommand{\pmdraw@drawNoVertexTi}{#1}%
+}
+
+\define@key{pmdraw@brick}{vertices options}{% Sets the draw command of vertices
+ \renewcommand{\pmdraw@drawVertex}[2]{#1}%
+}
+
+\define@key{pmdraw@brick}{labels}[]{% Draws labels for vertices
+ \renewcommand{\pmdraw@ifLabelsB}{1}%
+ \renewcommand{\pmdraw@ifLabelsT}{1}%
+}
+\define@key{pmdraw@brick}{labels bottom}[]{% Draws labels for bottom vertices
+ \renewcommand{\pmdraw@ifLabelsB}{1}%
+}
+\define@key{pmdraw@brick}{labels top}[]{% Draws labels for top vertices
+ \renewcommand{\pmdraw@ifLabelsT}{1}%
+}
+
+\define@key{pmdraw@brick}{labels start}{% Sets starting number for vertex labels
+ \setcounter{pmdraw@labelStartT}{#1}%
+ \setcounter{pmdraw@labelStartB}{#1}%
+}
+\define@key{pmdraw@brick}{labels bottom start}{% Sets starting number for bottom vertex labels
+ \setcounter{pmdraw@labelStartB}{#1}%
+}
+\define@key{pmdraw@brick}{labels top start}{% Sets starting number for top vertex labels
+ \setcounter{pmdraw@labelStartT}{#1}%
+}
+
+\define@key{pmdraw@brick}{no label bottom 1}{% Sets 1st label to skip in bottom row
+ \renewcommand{\pmdraw@drawNoLabelBa}{#1}%
+}
+\define@key{pmdraw@brick}{no label bottom 2}{% Sets 2nd label to skip in bottom row
+ \renewcommand{\pmdraw@drawNoLabelBb}{#1}%
+}
+\define@key{pmdraw@brick}{no label bottom 3}{% Sets 3rd label to skip in bottom row
+ \renewcommand{\pmdraw@drawNoLabelBc}{#1}%
+}
+\define@key{pmdraw@brick}{no label bottom 4}{% Sets 4th label to skip in bottom row
+ \renewcommand{\pmdraw@drawNoLabelBd}{#1}%
+}
+\define@key{pmdraw@brick}{no label bottom 5}{% Sets 5th label to skip in bottom row
+ \renewcommand{\pmdraw@drawNoLabelBe}{#1}%
+}
+\define@key{pmdraw@brick}{no label bottom 6}{% Sets 6th label to skip in bottom row
+ \renewcommand{\pmdraw@drawNoLabelBf}{#1}%
+}
+\define@key{pmdraw@brick}{no label bottom 7}{% Sets 7th label to skip in bottom row
+ \renewcommand{\pmdraw@drawNoLabelBg}{#1}%
+}
+\define@key{pmdraw@brick}{no label bottom 8}{% Sets 8th label to skip in bottom row
+ \renewcommand{\pmdraw@drawNoLabelBh}{#1}%
+}
+\define@key{pmdraw@brick}{no label bottom 9}{% Sets 9th label to skip in bottom row
+ \renewcommand{\pmdraw@drawNoLabelBi}{#1}%
+}
+\define@key{pmdraw@brick}{no label top 1}{% Sets 1st label to skip in top row
+ \renewcommand{\pmdraw@drawNoLabelTa}{#1}%
+}
+\define@key{pmdraw@brick}{no label top 2}{% Sets 2nd label to skip in top row
+ \renewcommand{\pmdraw@drawNoLabelTb}{#1}%
+}
+\define@key{pmdraw@brick}{no label top 3}{% Sets 3rd label to skip in top row
+ \renewcommand{\pmdraw@drawNoLabelTc}{#1}%
+}
+\define@key{pmdraw@brick}{no label top 4}{% Sets 4th label to skip in top row
+ \renewcommand{\pmdraw@drawNoLabelTd}{#1}%
+}
+\define@key{pmdraw@brick}{no label top 5}{% Sets 5th label to skip in top row
+ \renewcommand{\pmdraw@drawNoLabelTe}{#1}%
+}
+\define@key{pmdraw@brick}{no label top 6}{% Sets 6th label to skip in top row
+ \renewcommand{\pmdraw@drawNoLabelTf}{#1}%
+}
+\define@key{pmdraw@brick}{no label top 7}{% Sets 7th label to skip in top row
+ \renewcommand{\pmdraw@drawNoLabelTg}{#1}%
+}
+\define@key{pmdraw@brick}{no label top 8}{% Sets 8th label to skip in top row
+ \renewcommand{\pmdraw@drawNoLabelTh}{#1}%
+}
+\define@key{pmdraw@brick}{no label top 9}{% Sets 9th label to skip in top row
+ \renewcommand{\pmdraw@drawNoLabelTi}{#1}%
+}
+
+\define@key{pmdraw@brick}{labels bottom draw}{% Sets the draw options for labels of bottom vertices
+ \renewcommand{\pmdraw@drawLabelBDrawOptions}{#1}%
+}
+\define@key{pmdraw@brick}{labels bottom node}{% Sets the node options for labels of bottom vertices
+ \renewcommand{\pmdraw@drawLabelBNodeOptions}{#1}%
+}
+\define@key{pmdraw@brick}{labels top draw}{% Sets the draw options for labels of top vertices
+ \renewcommand{\pmdraw@drawLabelTDrawOptions}{#1}%
+}
+\define@key{pmdraw@brick}{labels top node}{% Sets the node options for labels of top vertices
+ \renewcommand{\pmdraw@drawLabelTNodeOptions}{#1}%
+}
+
+\define@key{pmdraw@brick}{labels bottom options}{% Sets the draw command of labels of bottom vertices
+ \renewcommand{\pmdraw@drawLabelBottom}[3]{#1}%
+}
+\define@key{pmdraw@brick}{labels top options}{% Sets the draw command of labels of top vertices
+ \renewcommand{\pmdraw@drawLabelTop}[3]{#1}%
+}
+
+\define@key{pmdraw@brick}{no dots}[]{% Does not draw dots in bricks
+ \setcounter{pmdraw@ifDiagWDotsFirst}{1}%
+}
+
+\define@key{pmdraw@brick}{dots draw}{% Sets the draw options for drawing of dots
+ \renewcommand{\pmdraw@drawDotsDrawOptions}{#1}%
+}
+\define@key{pmdraw@brick}{dots node}{% Sets the node options for drawing of dots
+ \renewcommand{\pmdraw@drawDotsNodeOptions}{#1}%
+}
+
+\define@key{pmdraw@brick}{vertices bottom phantom}[]{% Does not draw bottom vertices
+ \setcounter{pmdraw@ifVerticesBottom}{1}%
+}
+\define@key{pmdraw@brick}{vertices top phantom}[]{% Does not draw top vertices
+ \setcounter{pmdraw@ifVerticesTop}{1}%
+}
+
+\define@key{pmdraw@brick}{vertices bottom uncover}{% Sets the uncover options of bottom vertices
+ \renewcommand{\pmdraw@verticesBottomUncover}{#1}%
+}
+\define@key{pmdraw@brick}{vertices top uncover}{% Sets the uncover options of top vertices
+ \renewcommand{\pmdraw@verticesTopUncover}{#1}%
+}
+
+\define@key{pmdraw@brick}{levels}[1]{% Sets number of horizontal levels for non-transversal edges and evenly spaces them
+ \tikzmath{%
+ \pmdraw{edgeSepU} = (0.5*\pmdraw@rowSep)/(#1 + 1);% Calculates vertical separation between each edge
+ \pmdraw{edgeSepL} = \pmdraw{edgeSepU};% Calculates vertical separation between each edge
+ }%
+}
+\define@key{pmdraw@brick}{levels bottom}{% Sets number of horizontal levels for lower non-transversal edges and evenly spaces them
+ \tikzmath{%
+ \pmdraw{edgeSepL} = (0.5*\pmdraw@rowSep)/(#1 + 1);% Calculates vertical separation between each edge
+ }%
+}
+\define@key{pmdraw@brick}{levels top}{% Sets number of horizontal levels for upper non-transversal edges and evenly spaces them
+ \tikzmath{%
+ \pmdraw{edgeSepU} = (0.5*\pmdraw@rowSep)/(#1 + 1);% Calculates vertical separation between each edge
+ }%
+}
+
+\define@key{pmdraw@brick}{levels sep}{% Sets vertical separation of horizontal levels for non-transversal edges
+ \tikzmath{%
+ \pmdraw{edgeSepU} = #1;%
+ \pmdraw{edgeSepL} = \pmdraw{edgeSepU};%
+ }%
+}
+\define@key{pmdraw@brick}{levels sep bottom}{% Sets vertical separation of lower horizontal levels for non-transversal edges
+ \tikzmath{%
+ \pmdraw{edgeSepL} = #1;%
+ }%
+}
+\define@key{pmdraw@brick}{levels sep top}{% Sets vertical separation of upper horizontal levels for non-transversal edges
+ \tikzmath{%
+ \pmdraw{edgeSepU} = #1;%
+ }%
+}
+
+\define@key{pmdraw@brick}{edges}{% Sets the draw options of all edges
+ \renewcommand{\pmdraw@drawUedgesDrawOptions}{#1}%
+ \renewcommand{\pmdraw@drawLedgesDrawOptions}{#1}%
+ \renewcommand{\pmdraw@drawTedgesDrawOptions}{#1}%
+}
+\define@key{pmdraw@brick}{edges non-transversal}{% Sets the draw options of non-transversal edges
+ \renewcommand{\pmdraw@drawUedgesDrawOptions}{#1}%
+ \renewcommand{\pmdraw@drawLedgesDrawOptions}{#1}%
+}
+\define@key{pmdraw@brick}{edges upper}{% Sets the draw options of upper non-transversal edges
+ \renewcommand{\pmdraw@drawUedgesDrawOptions}{#1}%
+}
+\define@key{pmdraw@brick}{edges lower}{% Sets the draw options of lower non-transversal edges
+ \renewcommand{\pmdraw@drawLedgesDrawOptions}{#1}%
+}
+\define@key{pmdraw@brick}{edges transversal}{% Sets the draw options of transversal edges
+ \renewcommand{\pmdraw@drawTedgesDrawOptions}{#1}%
+}
+
+\define@key{pmdraw@brick}{edges first}[]{% Draws edges before vertices
+ \renewcommand{\pmdraw@ifEdgesFirst}{1}%
+}
+\define@key{pmdraw@brick}{transversals first}[]{% Draws transversal edges before non-transversal edges
+ \renewcommand{\pmdraw@ifTedgesFirst}{1}%
+}
+
+\define@key{pmdraw@brick}{edges phantom}[]{% Does not draw edges
+ \setcounter{pmdraw@ifEdges}{1}%
+}
+
+\define@key{pmdraw@brick}{edges uncover}{% Sets the uncover options of edges
+ \renewcommand{\pmdraw@edgesUncover}{#1}%
+}
+
+\define@key{pmdraw@brick}{brace}{% Draws a brace
+ \setkeys{pmdraw@brace}{#1}% Processes details of brace
+ \pmdraw@drawBrace{\value{pmdraw@braceL}}{\value{pmdraw@braceR}}{\pmdraw@braceLabel}% Draws brace
+ \let\pmdraw@drawBrace\pmdraw@drawBraceDefault% Resets brace options if changed
+}
+
+\define@key{pmdraw@brick}{brace draw}{% Sets the draw options for drawing of brace
+ \renewcommand{\pmdraw@drawBraceDrawOptions}{#1}%
+}
+\define@key{pmdraw@brick}{brace node}{% Sets the node options for drawing of brace
+ \renewcommand{\pmdraw@drawBraceNodeOptions}{#1}%
+}
+
+\define@key{pmdraw@brick}{decorate before}{% Hook for decorations before brick is drawn
+ \renewcommand{\pmdraw@hookBeforeBrick}{#1}%
+}
+\define@key{pmdraw@brick}{decorate after}{% Hook for decorations after brick is drawn
+ \renewcommand{\pmdraw@hookAfterBrick}{#1}%
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% Keys for edges %
+% - ordered as per manual %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\define@key{pmdraw@NTedges}{level}{% Sets level of non-transversal edge
+ \setcounter{pmdraw@NTlevel}{#1}%
+}
+\define@key{pmdraw@NTedges}{height}{% Sets manual height of non-transversal edge
+ \renewcommand{\pmdraw@NTedgesHeight}{#1}%
+}
+\define@key{pmdraw@NTedges}{edge draw}{% Sets the draw options for drawing of edge
+ \renewcommand{\pmdraw@drawEdgeDrawOptions}{#1}%
+}
+\define@key{pmdraw@NTedges}{options}{% Sets the draw command of non-transversal edge
+ \renewcommand{\pmdraw@drawUedgesDraw}[2]{#1}%
+ \renewcommand{\pmdraw@drawLedgesDraw}[2]{#1}%
+}
+\define@key{pmdraw@NTedges}{phantom}[]{% Does not draw edge
+ \setcounter{pmdraw@ifEdge}{1}%
+}
+\define@key{pmdraw@NTedges}{uncover}{% Sets the uncover options of edge
+ \renewcommand{\pmdraw@edgeUncover}{#1}%
+}
+\define@key{pmdraw@Tedges}{height}{% Sets manual height of transversal edge
+ \tikzmath{%
+ \pmdraw{Tlevel} = #1;%
+ }%
+ \renewcommand{\pmdraw@ifTedgeHorizontal}{1}% Flags manual height
+}
+\define@key{pmdraw@Tedges}{edge draw}{% Sets the draw options for drawing of edge
+ \renewcommand{\pmdraw@drawEdgeDrawOptions}{#1}%
+}
+\define@key{pmdraw@Tedges}{options}{% Sets the draw command of transversal edge
+ \renewcommand{\pmdraw@drawTedgesDraw}[2]{#1}%
+}
+\define@key{pmdraw@Tedges}{phantom}[]{% Does not draw edge
+ \setcounter{pmdraw@ifEdge}{1}%
+}
+\define@key{pmdraw@Tedges}{uncover}{% Sets the uncover options of edge
+ \renewcommand{\pmdraw@edgeUncover}{#1}%
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% Keys for brace %
+% - ordered as per manual %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\define@key{pmdraw@brace}{left}{% Sets starting position of brace
+ \setcounter{pmdraw@braceL}{#1}%
+}
+\define@key{pmdraw@brace}{right}{% Sets terminating position of brace
+ \setcounter{pmdraw@braceR}{#1}%
+}
+\define@key{pmdraw@brace}{label}{% Sets label of brace
+ \renewcommand{\pmdraw@braceLabel}{#1}%
+}
+\define@key{pmdraw@brace}{above}[]{% Set flag to draw brace above diagram
+ \renewcommand{\pmdraw@ifProdDiag}{1}%
+}
+\define@key{pmdraw@brace}{options}{% Sets the draw command of brace
+ \renewcommand{\pmdraw@drawBrace}[3]{#1}%
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% Keys for diagrams and product diagrams %
+% - ordered as per manual %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\define@key{pmdraw@diagram}{row sep}{% Sets vertical separation between rows of vertices in diagram
+ \renewcommand{\pmdraw@rowSep}{#1}%
+}
+\define@key{pmdraw@diagram}{tikz}{% Sets the tikz options
+ \renewcommand{\pmdraw@tikz}{#1}%
+}
+\define@key{pmdraw@diagram}{dots options}{% Sets the draw command of dots between bricks
+ \renewcommand{\pmdraw@drawDots}[2]{#1}%
+}
+\define@key{pmdraw@diagram}{grid}[]{% Flag for drawing coordinate grid
+ \renewcommand{\pmdraw@ifGrid}{1}%
+}
+\define@key{pmdraw@diagram}{decorate before}{% Hook before drawing diagrams
+ \renewcommand{\pmdraw@hookBeforeDiagram}{#1}%
+}
+\define@key{pmdraw@diagram}{decorate after}{% Hook after drawing diagrams
+ \renewcommand{\pmdraw@hookAfterDiagram}{#1}%
+}
+
+\define@key{pmdraw@diagram}{diagram sep}{% Sets vertical separation between bottom row of top diagram and top row of bottom diagram in product diagram
+ \renewcommand{\pmdraw@diagSep}{#1}%
+}
+\define@key{pmdraw@diagram}{vertex sep}{% Sets vertical separation between bottom row of top diagram and top row of bottom diagram in product diagram not for added edges
+ \renewcommand{\pmdraw@vertexSep}{#1}%
+}
+\define@key{pmdraw@diagram}{edges added}{% Sets the draw options for drawing of added edges in product diagram
+ \renewcommand{\pmdraw@drawAedgesOptions}{#1}%
+}
+\define@key{pmdraw@diagram}{edges added phantom}[]{% Does not draw added edges
+ \setcounter{pmdraw@ifEdgesAdded}{1}%
+}
+\define@key{pmdraw@diagram}{edges added uncover}{% Sets the uncover options of added edges
+ \renewcommand{\pmdraw@edgesAddedUncover}{#1}%
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% User commands %
+% - loosely ordered alphabetically %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\newcommand{\pmdBrick}[4][]{% Draws brick
+ % #1 Options
+ % #2 Upper non-transversal edges, as list [<options>]{<left vertex>}{<right vertex>}, eg [level=1]{2}{3}
+ % #3 Lower non-transversal edges, as list [<options>]{<left vertex>}{<right vertex>}, eg [level=1]{2}{3}
+ % #4 Transversals, as list [<options>]{<upper vertex>}{<lower vertex>}, eg [level=1]{2}{3}
+ \pmdDiagram{{[#1]{#2}{#3}{#4}}}% Uses complete diagram method to draw brick
+}
+
+\newcommand{\pmdDiagram}[2][]{% Draws diagram
+ % #1 Options
+ % #2 List of bricks
+ \setkeys{pmdraw@diagram}{#1}% Processes options
+ \renewcommand{\pmdraw@ifDiagWDots}{1}% Flags that diagram has dots
+ \setcounter{pmdraw@brickShift}{0}% Reset shifting of individual bricks
+ \ifmmode% If drawing diagram in a maths equation
+ \,% Add space
+ \ifnum\pmdraw@ifGrid=1% If displaying helper grid
+ \begin{tikzpicture}[scale=.5,baseline=0.405cm,show grid=true,apply style/.expand once=\pmdraw@tikz]%
+ \else% If not displaying helper grid
+ \begin{tikzpicture}[scale=.5,baseline=0.405cm,apply style/.expand once=\pmdraw@tikz]%
+ \fi%
+ \pmdraw@hookBeforeDiagram% Hook before drawing diagrams
+ \pmdraw@bricksLoop% Commences loop for each brick to be drawn
+ #2%
+ \pmdEmpty% Terminates loop
+ \pmdraw@hookAfterDiagram% Hook after drawing diagrams
+ \end{tikzpicture}%
+ \,% Add space
+ \else% If drawing diagram in normal text
+ \raisebox{0.5cm}{% Raise diagram so bottom row is on text baseline
+ \ifnum\pmdraw@ifGrid=1% If displaying helper grid
+ \begin{tikzpicture}[scale=.5,baseline=0.405cm,show grid=true,apply style/.expand once=\pmdraw@tikz]%
+ \else% If not displaying helper grid
+ \begin{tikzpicture}[scale=.5,baseline=0.405cm,apply style/.expand once=\pmdraw@tikz]%
+ \fi%
+ \pmdraw@hookBeforeDiagram% Hook before drawing diagrams
+ \pmdraw@bricksLoop% Commences loop for each brick to be drawn
+ #2%
+ \pmdEmpty% Terminates loop
+ \pmdraw@hookAfterDiagram% Hook after drawing diagrams
+ \end{tikzpicture}%
+ }%
+ \fi%
+ \pmdraw@reset% Resets user keys and other flags to default values
+}
+
+\newcommand{\pmdEmpty}{}% Indicates no edges, internally halts input loops, always is = {}
+
+\newcommand{\pmdProduct}[4][]{% Draws product diagram
+ % #1 Options
+ % #2 List of added edges
+ % #3 Top diagram as list of bricks
+ % #4 Bottom diagram as list of bricks
+ \setkeys{pmdraw@diagram}{#1}% Processes options
+ \ifmmode% If drawing diagram in a maths equation
+ \,% Add space
+ \ifnum\pmdraw@ifGrid=1% If displaying helper grid
+ \begin{tikzpicture}[scale=.5,baseline=-.3475cm,show grid=true,apply style/.expand once=\pmdraw@tikz]%
+ \else% If not displaying helper grid
+ \begin{tikzpicture}[scale=.5,baseline=-.3475cm,apply style/.expand once=\pmdraw@tikz]%
+ \fi%
+ \pmdraw@hookBeforeDiagram% Hook before drawing diagrams
+ \pmdraw@AedgesLoop% Commences loop for added edges to be drawn
+ #2%
+ \pmdEmpty% Terminates loop
+ \renewcommand{\pmdraw@ifDiagWDots}{1}% Flags that diagram has dot
+ \renewcommand{\pmdraw@ifProdDiag}{1}% Flags that diagram is product
+ \setcounter{pmdraw@brickShift}{0}% Reset shifting of individual bricks
+ \pmdraw@bricksLoop% Commences loop for each brick to be drawn
+ #3%
+ \pmdEmpty% Terminates loop
+ \renewcommand{\pmdraw@ifProdDiag}{0}% Resets flag that diagram is product
+ \setcounter{pmdraw@ifDiagWDotsFirst}{1}% Reset if drawing first brick of diagram
+ \setcounter{pmdraw@brickShift}{0}% Reset shifting of individual bricks
+ \begin{scope}[shift={(0,-\pmdraw@diagSep-\pmdraw@rowSep-\pmdraw@vertexSep)}]% Shift coordinates to be underneath top diagram
+ \pmdraw@bricksLoop% Commences loop for each brick to be drawn
+ #4%
+ \pmdEmpty% Terminates loop
+ \renewcommand{\pmdraw@ifDiagWDots}{0}% Reset if drawing a diagram with dots
+ \setcounter{pmdraw@ifDiagWDotsFirst}{1}% Reset if drawing first brick of diagram
+ \end{scope}%
+ \pmdraw@hookAfterDiagram% Hook after drawing diagrams
+ \end{tikzpicture}%
+ \,% Add space
+ \else% If drawing diagram in normal text
+ \raisebox{2cm}{% Raise diagram so bottom row is on text baseline
+ \ifnum\pmdraw@ifGrid=1% If displaying helper grid
+ \begin{tikzpicture}[scale=.5,baseline=0.405cm,show grid=true,apply style/.expand once=\pmdraw@tikz]%
+ \else% If not displaying helper grid
+ \begin{tikzpicture}[scale=.5,baseline=0.405cm,apply style/.expand once=\pmdraw@tikz]%
+ \fi%
+ \pmdraw@hookBeforeDiagram% Hook before drawing diagrams
+ \pmdraw@AedgesLoop% Commences loop for added edges to be drawn
+ #2%
+ \pmdEmpty% Terminates loop
+ \renewcommand{\pmdraw@ifDiagWDots}{1}% Flags that diagram has dot
+ \renewcommand{\pmdraw@ifProdDiag}{1}% Flags that diagram is product
+ \setcounter{pmdraw@brickShift}{0}% Reset shifting of individual bricks
+ \pmdraw@bricksLoop% Commences loop for each brick to be drawn
+ #3%
+ \pmdEmpty% Terminates loop
+ \renewcommand{\pmdraw@ifProdDiag}{0}% Resets flag that diagram is products
+ \setcounter{pmdraw@ifDiagWDotsFirst}{1}% Reset if drawing first brick of diagram
+ \setcounter{pmdraw@brickShift}{0}% Reset shifting of individual bricks
+ \begin{scope}[shift={(0,-\pmdraw@diagSep-\pmdraw@rowSep-\pmdraw@vertexSep)}]% Shift coordinates to be underneath top diagram
+ \pmdraw@bricksLoop% Commences loop for each brick to be drawn
+ #4%
+ \pmdEmpty% Terminates loop
+ \renewcommand{\pmdraw@ifDiagWDots}{0}% Reset if drawing a diagram with dots
+ \setcounter{pmdraw@ifDiagWDotsFirst}{1}% Reset if drawing first brick of diagram
+ \end{scope}%
+ \pmdraw@hookAfterDiagram% Hook after drawing diagrams diagram
+ \end{tikzpicture}%
+ }%
+ \fi%
+ \pmdraw@reset% Resets user keys and other flags to default values
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% For loop commands %
+% - loosely ordered alphabetically %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\newcommand{\pmdraw@AedgesLoop}{% Starts loop for added edges in product diagram
+ \@ifnextchar\pmdEmpty{}{% If not at end of list
+ \pmdraw@drawAedges% Draw each edge
+ }%
+}
+\newcommand{\pmdraw@bricksLoop}{% Starts loop to iterate over each brick in diagram
+ \@ifnextchar\pmdEmpty{}{% If not at end of list
+ \pmdraw@drawBrickInit% Draw each brick
+ }%
+}
+\newcommand{\pmdraw@LedgesLoop}{% Starts loop for lower non-transversal edges
+ \@ifnextchar\pmdEmpty{}{% If not at end of list
+ \pmdraw@drawLedges% Draw each edge
+ }%
+}
+\newcommand{\pmdraw@TedgesLoop}{% Starts loop for transversal edges
+ \@ifnextchar\pmdEmpty{}{% If not at end of list
+ \pmdraw@drawTedges% Draw each edge
+ }%
+}
+\newcommand{\pmdraw@UedgesLoop}{% Starts loop for upper non-transversal edges
+ \@ifnextchar\pmdEmpty{}{% If not at end of list
+ \pmdraw@drawUedges% Draw each edge
+ }%
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% Draw commands %
+% - loosely ordered alphabetically %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\newcommand{\pmdraw@drawBottomVertices}{% Draws bottom row of vertices
+ \setcounter{pmdraw@bottomTotal}{\value{pmdraw@blankB}}% Store size of bottom row of vertices
+ \addtocounter{pmdraw@bottomTotal}{\value{pmdraw@degreeB}}% Store size of bottom row of vertices
+ \ifnum\value{pmdraw@ifDiagWDotsFirst}=1% If drawing first brick of diagram
+ \setcounter{pmdraw@ifDiagWDotsFirst}{0}% Mark that first brick has been drawn
+ \else% If not drawing first brick of diagram
+ \pmdraw@drawDots{0.5*\value{pmdraw@topShift}+0.5*\value{pmdraw@blankT}}{\pmdraw@rowSep}% Draw upper dots
+ \pmdraw@drawDots{0.5*\value{pmdraw@bottomShift}+0.5*\value{pmdraw@blankB}}{0}% Draw lower dots
+ \fi%
+ \ifnum\value{pmdraw@topTotal}>\value{pmdraw@bottomTotal}% If top row is longer than bottom row
+ \ifnum\pmdraw@ifDiagWDots=1% If drawing a diagram with dots
+ \addtocounter{pmdraw@brickShift}{\value{pmdraw@topTotal}}% Keep track of size of diagram
+ % Store shifts
+ \setcounter{pmdraw@topShift}{-\value{pmdraw@topTotal}}%
+ \addtocounter{pmdraw@topShift}{\value{pmdraw@topTotal}}%
+ \setcounter{pmdraw@bottomShift}{-\value{pmdraw@topTotal}}%
+ \addtocounter{pmdraw@bottomShift}{\value{pmdraw@bottomTotal}}%
+ \else% If drawing a diagram without dots
+ \setcounter{pmdraw@brickShift}{\value{pmdraw@topTotal}}% Keep track of size of diagram
+ \fi%
+ \else% If bottom row is longer than top row
+ \ifnum\pmdraw@ifDiagWDots=1% If drawing a diagram with dots
+ \addtocounter{pmdraw@brickShift}{\value{pmdraw@bottomTotal}}% Keep track of size of diagram
+ % Store shifts
+ \setcounter{pmdraw@topShift}{-\value{pmdraw@bottomTotal}}%
+ \addtocounter{pmdraw@topShift}{\value{pmdraw@topTotal}}%
+ \setcounter{pmdraw@bottomShift}{-\value{pmdraw@bottomTotal}}%
+ \addtocounter{pmdraw@bottomShift}{\value{pmdraw@bottomTotal}}%
+ \else% If drawing a diagram without dots
+ \setcounter{pmdraw@brickShift}{\value{pmdraw@bottomTotal}}% Keep track of size of diagram
+ \fi%
+ \fi%
+ \foreach \x in {1,...,\value{pmdraw@degreeB}} {% For each vertex in row
+ \ifnum\pmdraw@drawNoVertexBa=\x\else% If not skipping vertex
+ \ifnum\pmdraw@drawNoVertexBb=\x\else% If not skipping vertex
+ \ifnum\pmdraw@drawNoVertexBc=\x\else% If not skipping vertex
+ \ifnum\pmdraw@drawNoVertexBd=\x\else% If not skipping vertex
+ \ifnum\pmdraw@drawNoVertexBe=\x\else% If not skipping vertex
+ \ifnum\pmdraw@drawNoVertexBf=\x\else% If not skipping vertex
+ \ifnum\pmdraw@drawNoVertexBg=\x\else% If not skipping vertex
+ \ifnum\pmdraw@drawNoVertexBh=\x\else% If not skipping vertex
+ \ifnum\pmdraw@drawNoVertexBi=\x\else% If not skipping vertex
+ \pmdraw@drawVertex{\x + \value{pmdraw@blankB}}{0}% Draw lower vertex
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \ifnum\pmdraw@drawNoLabelBa=\x\else% If not skipping label
+ \ifnum\pmdraw@drawNoLabelBb=\x\else% If not skipping label
+ \ifnum\pmdraw@drawNoLabelBc=\x\else% If not skipping label
+ \ifnum\pmdraw@drawNoLabelBd=\x\else% If not skipping label
+ \ifnum\pmdraw@drawNoLabelBe=\x\else% If not skipping label
+ \ifnum\pmdraw@drawNoLabelBf=\x\else% If not skipping label
+ \ifnum\pmdraw@drawNoLabelBg=\x\else% If not skipping label
+ \ifnum\pmdraw@drawNoLabelBh=\x\else% If not skipping label
+ \ifnum\pmdraw@drawNoLabelBi=\x\else% If not skipping label
+ \ifnum\pmdraw@ifLabelsB=1% If drawing labels
+ \pmdraw@drawLabelBottom{\x + \value{pmdraw@blankT}}{0}{\thepmdraw@labelStartB}% Draw label
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \stepcounter{pmdraw@labelStartB}% Update label counter
+ }%
+}
+\newcommand{\pmdraw@drawBrickInit}[1]{% Initialises the drawing of a brick
+ \ifnum\value{pmdraw@ifDiagWDotsFirst}=0% If not drawing first brick in diagram
+ \stepcounter{pmdraw@brickShift}% Makes space for dots to left of current brick
+ \fi%
+ \begin{scope}[shift={(\value{pmdraw@brickShift},0)}]% Shift brick to the right of already drawn bricks
+ \pmdraw@drawBrick#1% Draw brick
+ \end{scope}%
+ \pmdraw@bricksLoop% Restart for loop
+}
+\newcommand{\pmdraw@drawBrick}[4][]{% Draws a brick
+ % #1 Options
+ % #2 Upper non-transversal edges, as list [<options>]{<left vertex>}{<right vertex>}, eg [level=1]{2}{3}
+ % #3 Lower non-transversal edges, as list [<options>]{<left vertex>}{<right vertex>}, eg [level=1]{2}{3}
+ % #4 Transversals, as list [<options>]{<upper vertex>}{<lower vertex>}, eg [level=1]{2}{3}
+ \setkeys{pmdraw@brick}{levels,#1}% Processes options and set default levels
+ \pmdraw@hookBeforeBrick% Hook before drawing brick
+ \ifnum\pmdraw@ifEdgesFirst=0% If drawing vertices first
+ \@ifclassloaded{beamer}{% If in beamer
+ \uncover<\pmdraw@verticesTopUncover>{% Uncovers top vertices
+ \ifnum\value{pmdraw@ifVerticesTop}=0% If drawing top vertices
+ \pmdraw@drawTopVertices% Draw base diagram
+ \else% If hiding top vertices
+ \phantom{%
+ \pmdraw@drawTopVertices% Draw base diagram
+ }%
+ \fi%
+ }%
+ \uncover<\pmdraw@verticesBottomUncover>{% Uncovers bottom vertices
+ \ifnum\value{pmdraw@ifVerticesBottom}=0% If drawing bottom vertices
+ \pmdraw@drawBottomVertices% Draw base diagram
+ \else% If hiding top vertices
+ \phantom{%
+ \pmdraw@drawBottomVertices% Draw base diagram
+ }%
+ \fi%
+ }%
+ \uncover<\pmdraw@edgesUncover>{% Uncovers edges
+ \ifnum\value{pmdraw@ifEdges}=0% If drawing edges
+ \ifnum\pmdraw@ifTedgesFirst=0% If drawing non-transversals first
+ \pmdraw@UedgesLoop% Draws upper edges
+ #2%
+ \pmdEmpty%
+ \pmdraw@LedgesLoop% Draws lower edges
+ #3%
+ \pmdEmpty%
+ \pmdraw@TedgesLoop% Draws transversals
+ #4%
+ \pmdEmpty%
+ \else% If drawing transversal first
+ \pmdraw@TedgesLoop% Draws transversals
+ #4%
+ \pmdEmpty%
+ \pmdraw@UedgesLoop% Draws upper edges
+ #2%
+ \pmdEmpty%
+ \pmdraw@LedgesLoop% Draws lower edges
+ #3%
+ \pmdEmpty%
+ \fi%
+ \else% If hiding edges
+ \phantom{%
+ \ifnum\pmdraw@ifTedgesFirst=0% If drawing non-transversals first
+ \pmdraw@UedgesLoop% Draws upper edges
+ #2%
+ \pmdEmpty%
+ \pmdraw@LedgesLoop% Draws lower edges
+ #3%
+ \pmdEmpty%
+ \pmdraw@TedgesLoop% Draws transversals
+ #4%
+ \pmdEmpty%
+ \else% If drawing transversal first
+ \pmdraw@TedgesLoop% Draws transversals
+ #4%
+ \pmdEmpty%
+ \pmdraw@UedgesLoop% Draws upper edges
+ #2%
+ \pmdEmpty%
+ \pmdraw@LedgesLoop% Draws lower edges
+ #3%
+ \pmdEmpty%
+ \fi%
+ }%
+ \fi%
+ }%
+ }{% If not in beamer
+ \ifnum\value{pmdraw@ifVerticesTop}=0% If drawing top vertices
+ \pmdraw@drawTopVertices% Draw base diagram
+ \else% If hiding top vertices
+ \phantom{%
+ \pmdraw@drawTopVertices% Draw base diagram
+ }%
+ \fi%
+ \ifnum\value{pmdraw@ifVerticesBottom}=0% If drawing bottom vertices
+ \pmdraw@drawBottomVertices% Draw base diagram
+ \else% If hiding top vertices
+ \phantom{%
+ \pmdraw@drawBottomVertices% Draw base diagram
+ }%
+ \fi%
+ \ifnum\value{pmdraw@ifEdges}=0% If drawing edges
+ \ifnum\pmdraw@ifTedgesFirst=0% If drawing non-transversals first
+ \pmdraw@UedgesLoop% Draws upper edges
+ #2%
+ \pmdEmpty%
+ \pmdraw@LedgesLoop% Draws lower edges
+ #3%
+ \pmdEmpty%
+ \pmdraw@TedgesLoop% Draws transversals
+ #4%
+ \pmdEmpty%
+ \else% If drawing transversal first
+ \pmdraw@TedgesLoop% Draws transversals
+ #4%
+ \pmdEmpty%
+ \pmdraw@UedgesLoop% Draws upper edges
+ #2%
+ \pmdEmpty%
+ \pmdraw@LedgesLoop% Draws lower edges
+ #3%
+ \pmdEmpty%
+ \fi%
+ \else% If hiding edges
+ \phantom{%
+ \ifnum\pmdraw@ifTedgesFirst=0% If drawing non-transversals first
+ \pmdraw@UedgesLoop% Draws upper edges
+ #2%
+ \pmdEmpty%
+ \pmdraw@LedgesLoop% Draws lower edges
+ #3%
+ \pmdEmpty%
+ \pmdraw@TedgesLoop% Draws transversals
+ #4%
+ \pmdEmpty%
+ \else% If drawing transversal first
+ \pmdraw@TedgesLoop% Draws transversals
+ #4%
+ \pmdEmpty%
+ \pmdraw@UedgesLoop% Draws upper edges
+ #2%
+ \pmdEmpty%
+ \pmdraw@LedgesLoop% Draws lower edges
+ #3%
+ \pmdEmpty%
+ \fi%
+ }%
+ \fi%
+ }%
+ \else% If drawing edges first
+ \@ifclassloaded{beamer}{% If in beamer
+ \uncover<\pmdraw@edgesUncover>{% Uncovers edges
+ \ifnum\value{pmdraw@ifEdges}=0% If drawing edges
+ \ifnum\pmdraw@ifTedgesFirst=0% If drawing non-transversals first
+ \pmdraw@UedgesLoop% Draws upper edges
+ #2%
+ \pmdEmpty%
+ \pmdraw@LedgesLoop% Draws lower edges
+ #3%
+ \pmdEmpty%
+ \pmdraw@TedgesLoop% Draws transversals
+ #4%
+ \pmdEmpty%
+ \else% If drawing transversal first
+ \pmdraw@TedgesLoop% Draws transversals
+ #4%
+ \pmdEmpty%
+ \pmdraw@UedgesLoop% Draws upper edges
+ #2%
+ \pmdEmpty%
+ \pmdraw@LedgesLoop% Draws lower edges
+ #3%
+ \pmdEmpty%
+ \fi%
+ \else% If hiding edges
+ \phantom{%
+ \ifnum\pmdraw@ifTedgesFirst=0% If drawing non-transversals first
+ \pmdraw@UedgesLoop% Draws upper edges
+ #2%
+ \pmdEmpty%
+ \pmdraw@LedgesLoop% Draws lower edges
+ #3%
+ \pmdEmpty%
+ \pmdraw@TedgesLoop% Draws transversals
+ #4%
+ \pmdEmpty%
+ \else% If drawing transversal first
+ \pmdraw@TedgesLoop% Draws transversals
+ #4%
+ \pmdEmpty%
+ \pmdraw@UedgesLoop% Draws upper edges
+ #2%
+ \pmdEmpty%
+ \pmdraw@LedgesLoop% Draws lower edges
+ #3%
+ \pmdEmpty%
+ \fi%
+ }%
+ \fi%
+ }%
+ \uncover<\pmdraw@verticesTopUncover>{% Uncovers top vertices
+ \ifnum\value{pmdraw@ifVerticesTop}=0% If drawing top vertices
+ \pmdraw@drawTopVertices% Draw base diagram
+ \else% If hiding top vertices
+ \phantom{%
+ \pmdraw@drawTopVertices% Draw base diagram
+ }%
+ \fi%
+ }%
+ \uncover<\pmdraw@verticesBottomUncover>{% Uncovers bottm vertices
+ \ifnum\value{pmdraw@ifVerticesBottom}=0% If drawing bottom vertices
+ \pmdraw@drawBottomVertices% Draw base diagram
+ \else% If hiding top vertices
+ \phantom{%
+ \pmdraw@drawBottomVertices% Draw base diagram
+ }%
+ \fi%
+ }%
+ }{% If not in beamer
+ \ifnum\value{pmdraw@ifEdges}=0% If drawing edges
+ \ifnum\pmdraw@ifTedgesFirst=0% If drawing non-transversals first
+ \pmdraw@UedgesLoop% Draws upper edges
+ #2%
+ \pmdEmpty%
+ \pmdraw@LedgesLoop% Draws lower edges
+ #3%
+ \pmdEmpty%
+ \pmdraw@TedgesLoop% Draws transversals
+ #4%
+ \pmdEmpty%
+ \else% If drawing transversal first
+ \pmdraw@TedgesLoop% Draws transversals
+ #4%
+ \pmdEmpty%
+ \pmdraw@UedgesLoop% Draws upper edges
+ #2%
+ \pmdEmpty%
+ \pmdraw@LedgesLoop% Draws lower edges
+ #3%
+ \pmdEmpty%
+ \fi%
+ \else% If hiding edges
+ \phantom{%
+ \ifnum\pmdraw@ifTedgesFirst=0% If drawing non-transversals first
+ \pmdraw@UedgesLoop% Draws upper edges
+ #2%
+ \pmdEmpty%
+ \pmdraw@LedgesLoop% Draws lower edges
+ #3%
+ \pmdEmpty%
+ \pmdraw@TedgesLoop% Draws transversals
+ #4%
+ \pmdEmpty%
+ \else% If drawing transversal first
+ \pmdraw@TedgesLoop% Draws transversals
+ #4%
+ \pmdEmpty%
+ \pmdraw@UedgesLoop% Draws upper edges
+ #2%
+ \pmdEmpty%
+ \pmdraw@LedgesLoop% Draws lower edges
+ #3%
+ \pmdEmpty%
+ \fi%
+ }%
+ \fi%
+ \ifnum\value{pmdraw@ifVerticesTop}=0% If drawing top vertices
+ \pmdraw@drawTopVertices% Draw base diagram
+ \else% If hiding top vertices
+ \phantom{%
+ \pmdraw@drawTopVertices% Draw base diagram
+ }%
+ \fi%
+ \ifnum\value{pmdraw@ifVerticesBottom}=0% If drawing bottom vertices
+ \pmdraw@drawBottomVertices% Draw base diagram
+ \else% If hiding top vertices
+ \phantom{%
+ \pmdraw@drawBottomVertices% Draw base diagram
+ }%
+ \fi%
+ }%
+ \fi%
+ \pmdraw@hookAfterBrick% Hook after drawing brick
+ % Resets user keys and other flags to default values
+ \renewcommand{\pmdraw@drawBraceDrawOptions}{}%
+ \renewcommand{\pmdraw@drawBraceNodeOptions}{}%
+ \renewcommand{\pmdraw@drawDotsDrawOptions}{}%
+ \renewcommand{\pmdraw@drawDotsNodeOptions}{}%
+ \renewcommand{\pmdraw@drawLabelBDrawOptions}{}%
+ \renewcommand{\pmdraw@drawLabelBNodeOptions}{}%
+ \renewcommand{\pmdraw@drawLabelTDrawOptions}{}%
+ \renewcommand{\pmdraw@drawLabelTNodeOptions}{}%
+ \renewcommand{\pmdraw@drawLedgesDrawOptions}{}%
+ \renewcommand{\pmdraw@drawNoLabelBa}{-1}%
+ \renewcommand{\pmdraw@drawNoLabelBb}{-1}%
+ \renewcommand{\pmdraw@drawNoLabelBc}{-1}%
+ \renewcommand{\pmdraw@drawNoLabelBd}{-1}%
+ \renewcommand{\pmdraw@drawNoLabelBe}{-1}%
+ \renewcommand{\pmdraw@drawNoLabelBf}{-1}%
+ \renewcommand{\pmdraw@drawNoLabelBg}{-1}%
+ \renewcommand{\pmdraw@drawNoLabelBh}{-1}%
+ \renewcommand{\pmdraw@drawNoLabelBi}{-1}%
+ \renewcommand{\pmdraw@drawNoLabelTa}{-1}%
+ \renewcommand{\pmdraw@drawNoLabelTb}{-1}%
+ \renewcommand{\pmdraw@drawNoLabelTc}{-1}%
+ \renewcommand{\pmdraw@drawNoLabelTd}{-1}%
+ \renewcommand{\pmdraw@drawNoLabelTe}{-1}%
+ \renewcommand{\pmdraw@drawNoLabelTf}{-1}%
+ \renewcommand{\pmdraw@drawNoLabelTg}{-1}%
+ \renewcommand{\pmdraw@drawNoLabelTh}{-1}%
+ \renewcommand{\pmdraw@drawNoLabelTi}{-1}%
+ \renewcommand{\pmdraw@drawNoVertexBa}{-1}%
+ \renewcommand{\pmdraw@drawNoVertexBb}{-1}%
+ \renewcommand{\pmdraw@drawNoVertexBc}{-1}%
+ \renewcommand{\pmdraw@drawNoVertexBd}{-1}%
+ \renewcommand{\pmdraw@drawNoVertexBe}{-1}%
+ \renewcommand{\pmdraw@drawNoVertexBf}{-1}%
+ \renewcommand{\pmdraw@drawNoVertexBg}{-1}%
+ \renewcommand{\pmdraw@drawNoVertexBh}{-1}%
+ \renewcommand{\pmdraw@drawNoVertexBi}{-1}%
+ \renewcommand{\pmdraw@drawNoVertexTa}{-1}%
+ \renewcommand{\pmdraw@drawNoVertexTb}{-1}%
+ \renewcommand{\pmdraw@drawNoVertexTc}{-1}%
+ \renewcommand{\pmdraw@drawNoVertexTd}{-1}%
+ \renewcommand{\pmdraw@drawNoVertexTe}{-1}%
+ \renewcommand{\pmdraw@drawNoVertexTf}{-1}%
+ \renewcommand{\pmdraw@drawNoVertexTg}{-1}%
+ \renewcommand{\pmdraw@drawNoVertexTh}{-1}%
+ \renewcommand{\pmdraw@drawNoVertexTi}{-1}%
+ \renewcommand{\pmdraw@drawTedgesDrawOptions}{}%
+ \renewcommand{\pmdraw@drawUedgesDrawOptions}{}%
+ \renewcommand{\pmdraw@drawVertexOptions}{}%
+ \renewcommand{\pmdraw@hookBeforeBrick}{}%
+ \renewcommand{\pmdraw@hookAfterBrick}{}%
+ \renewcommand{\pmdraw@ifEdgesFirst}{0}%
+ \renewcommand{\pmdraw@ifLabelsB}{0}%
+ \renewcommand{\pmdraw@ifLabelsT}{0}%
+ \renewcommand{\pmdraw@ifTedgesFirst}{0}%
+ \renewcommand{\pmdraw@edgesUncover}{1-}%
+ \renewcommand{\pmdraw@verticesBottomUncover}{1-}%
+ \renewcommand{\pmdraw@verticesTopUncover}{1-}%
+ \let\pmdraw@drawLabelBottom\pmdraw@drawLabelBottomDefault%
+ \let\pmdraw@drawLabelTop\pmdraw@drawLabelTopDefault%
+ \let\pmdraw@drawLabelBottom\pmdraw@drawLabelBottomDefault%
+ \setcounter{pmdraw@blankB}{0}%
+ \setcounter{pmdraw@blankT}{0}%
+ \setcounter{pmdraw@labelStartB}{1}%
+ \setcounter{pmdraw@labelStartT}{1}%
+ \setcounter{pmdraw@ifEdges}{0}%
+ \setcounter{pmdraw@ifVerticesBottom}{0}%
+ \setcounter{pmdraw@ifVerticesTop}{0}%
+}
+\newcommand{\pmdraw@drawLedges}[3][]{% Draws lower non-transversal edge, #1 options, #2 L vertex, #3 R vertex
+ \setcounter{pmdraw@NTlevel}{1}% Store default level of edge
+ \setkeys{pmdraw@NTedges}{#1}% Processes options
+ \ifdim\pmdraw@NTedgesHeight pt=-1000pt% If using default heights
+ \tikzmath{%
+ \pmdraw{edgeHeight}=\value{pmdraw@NTlevel}*\pmdraw{edgeSepL};% Calculates height based on level of edge
+ }%
+ \else% If using manual heights
+ \tikzmath{%
+ \pmdraw{edgeHeight}=\pmdraw@NTedgesHeight;% Set manual height
+ }%
+ \fi%
+ \@ifclassloaded{beamer}{% If in beamer
+ \uncover<\pmdraw@edgeUncover>{% Uncovers edge
+ \ifnum\value{pmdraw@ifEdge}=0% If drawing edge
+ \pmdraw@drawLedgesDraw{#2}{#3}% Draw edge
+ \else% If hiding edge
+ \phantom{%
+ \pmdraw@drawLedgesDraw{#2}{#3}% Draw edge
+ }%
+ \fi%
+ }%
+ }{% If not in beamer
+ \ifnum\value{pmdraw@ifEdge}=0% If drawing edge
+ \pmdraw@drawLedgesDraw{#2}{#3}% Draw edge
+ \else% If hiding edge
+ \phantom{%
+ \pmdraw@drawLedgesDraw{#2}{#3}% Draw edge
+ }%
+ \fi%
+ }%
+ % Resets user keys and other flags to default values
+ \renewcommand{\pmdraw@NTedgesHeight}{-1000}%
+ \renewcommand{\pmdraw@edgeUncover}{1-}%
+ \setcounter{pmdraw@ifEdge}{0}%
+ \let\pmdraw@drawLedgesDraw\pmdraw@drawLedgesDrawDefault%
+ \pmdraw@LedgesLoop% Restart for loop
+}
+\newcommand{\pmdraw@drawTedges}[3][]{% Draws transversal edge, #1 options, #2 upper vertex, #3 lower vertex
+ \setkeys{pmdraw@Tedges}{#1}% Processes options
+ \@ifclassloaded{beamer}{% If in beamer
+ \uncover<\pmdraw@edgeUncover>{% Uncovers edge
+ \ifnum\value{pmdraw@ifEdge}=0% If drawing edge
+ \pmdraw@drawTedgesDraw{#2}{#3}% Draw edge
+ \else% If hiding edge
+ \phantom{%
+ \pmdraw@drawTedgesDraw{#2}{#3}% Draw edge
+ }%
+ \fi%
+ }%
+ }{% If not in beamer
+ \ifnum\value{pmdraw@ifEdge}=0% If drawing edge
+ \pmdraw@drawTedgesDraw{#2}{#3}% Draw edge
+ \else% If hiding edge
+ \phantom{%
+ \pmdraw@drawTedgesDraw{#2}{#3}% Draw edge
+ }%
+ \fi%
+ }%
+ % Resets user keys and other flags to default values
+ \renewcommand{\pmdraw@edgeUncover}{1-}%
+ \setcounter{pmdraw@ifEdge}{0}%
+ \let\pmdraw@drawTedgesDraw\pmdraw@drawTedgesDrawDefault%
+ \pmdraw@TedgesLoop% Restart for loop
+}
+\newcommand{\pmdraw@drawTopVertices}{% Draws top row of vertices
+ \setcounter{pmdraw@topTotal}{\value{pmdraw@blankT}}% Store size of top row of vertices
+ \addtocounter{pmdraw@topTotal}{\value{pmdraw@degreeT}}% Store size of top row of vertices
+ \foreach \x in {1,...,\value{pmdraw@degreeT}} {% For each vertex in row
+ \ifnum\pmdraw@drawNoVertexTa=\x\else% If not skipping vertex
+ \ifnum\pmdraw@drawNoVertexTb=\x\else% If not skipping vertex
+ \ifnum\pmdraw@drawNoVertexTc=\x\else% If not skipping vertex
+ \ifnum\pmdraw@drawNoVertexTd=\x\else% If not skipping vertex
+ \ifnum\pmdraw@drawNoVertexTe=\x\else% If not skipping vertex
+ \ifnum\pmdraw@drawNoVertexTf=\x\else% If not skipping vertex
+ \ifnum\pmdraw@drawNoVertexTg=\x\else% If not skipping vertex
+ \ifnum\pmdraw@drawNoVertexTh=\x\else% If not skipping vertex
+ \ifnum\pmdraw@drawNoVertexTi=\x\else% If not skipping vertex
+ \pmdraw@drawVertex{\x + \value{pmdraw@blankT}}{\pmdraw@rowSep}% Draw upper vertex
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \ifnum\pmdraw@drawNoLabelTa=\x\else% If not skipping label
+ \ifnum\pmdraw@drawNoLabelTb=\x\else% If not skipping label
+ \ifnum\pmdraw@drawNoLabelTc=\x\else% If not skipping label
+ \ifnum\pmdraw@drawNoLabelTd=\x\else% If not skipping label
+ \ifnum\pmdraw@drawNoLabelTe=\x\else% If not skipping label
+ \ifnum\pmdraw@drawNoLabelTf=\x\else% If not skipping label
+ \ifnum\pmdraw@drawNoLabelTg=\x\else% If not skipping label
+ \ifnum\pmdraw@drawNoLabelTh=\x\else% If not skipping label
+ \ifnum\pmdraw@drawNoLabelTi=\x\else% If not skipping label
+ \ifnum\pmdraw@ifLabelsT=1% If drawing labels
+ \pmdraw@drawLabelTop{\x + \value{pmdraw@blankT}}{\pmdraw@rowSep}{\thepmdraw@labelStartT}% Draw label
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \stepcounter{pmdraw@labelStartT}% Update label counter
+ }%
+}
+\newcommand{\pmdraw@drawUedges}[3][]{% Draws upper non-transversal edge, #1 options, #2 L vertex, #3 R vertex
+ \setcounter{pmdraw@NTlevel}{1}% Store default level of edge
+ \setkeys{pmdraw@NTedges}{#1}% Processes options
+ \ifdim\pmdraw@NTedgesHeight pt=-1000pt% If using default heights
+ \tikzmath{%
+ \pmdraw{edgeHeight}=\value{pmdraw@NTlevel}*\pmdraw{edgeSepU};% Calculates height based on level of edge
+ }%
+ \else% If using manual heights
+ \tikzmath{%
+ \pmdraw{edgeHeight}=\pmdraw@rowSep-\pmdraw@NTedgesHeight;% Set manual height
+ }%
+ \fi%
+ \@ifclassloaded{beamer}{% If in beamer
+ \uncover<\pmdraw@edgeUncover>{% Uncovers edge
+ \ifnum\value{pmdraw@ifEdge}=0% If drawing edge
+ \pmdraw@drawUedgesDraw{#2}{#3}% Draw edge
+ \else% If hiding edge
+ \phantom{%
+ \pmdraw@drawUedgesDraw{#2}{#3}% Draw edge
+ }%
+ \fi%
+ }%
+ }{% If not in beamer
+ \ifnum\value{pmdraw@ifEdge}=0% If drawing edge
+ \pmdraw@drawUedgesDraw{#2}{#3}% Draw edge
+ \else% If hiding edge
+ \phantom{%
+ \pmdraw@drawUedgesDraw{#2}{#3}% Draw edge
+ }%
+ \fi%
+ }%
+ % Resets user keys and other flags to default values
+ \renewcommand{\pmdraw@NTedgesHeight}{-1000}%
+ \renewcommand{\pmdraw@edgeUncover}{1-}%
+ \setcounter{pmdraw@ifEdge}{0}%
+ \let\pmdraw@drawLedgesDraw\pmdraw@drawLedgesDrawDefault%
+ \let\pmdraw@drawUedgesDraw\pmdraw@drawUedgesDrawDefault%
+ \pmdraw@UedgesLoop% Restart for loop
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% Grid creation %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% This is a verbatim copy of:
+% https://tex.stackexchange.com/a/467908
+
+\newif\if@showgrid@grid
+\newif\if@showgrid@left
+\newif\if@showgrid@right
+\newif\if@showgrid@below
+\newif\if@showgrid@above
+\tikzset{%
+ every show grid/.style={},
+ show grid/.style={execute at end picture={\@showgrid{grid=true,#1}}},%
+ show grid/.default={true},
+ show grid/.cd,
+ labels/.style={font={\sffamily\small},help lines},
+ xlabels/.style={},
+ ylabels/.style={},
+ keep bb/.code={\useasboundingbox (current bounding box.south west) rectangle (current bounding box.north west);},
+ true/.style={left,below},
+ false/.style={left=false,right=false,above=false,below=false,grid=false},
+ none/.style={left=false,right=false,above=false,below=false},
+ all/.style={left=true,right=true,above=true,below=true},
+ grid/.is if=@showgrid@grid,
+ left/.is if=@showgrid@left,
+ right/.is if=@showgrid@right,
+ below/.is if=@showgrid@below,
+ above/.is if=@showgrid@above,
+ false,
+}
+
+\def\@showgrid#1{%
+ \begin{scope}[every show grid,show grid/.cd,#1]
+ \if@showgrid@grid
+ \begin{pgfonlayer}{background}
+ \draw [help lines]
+ (current bounding box.south west) grid
+ (current bounding box.north east);
+%
+ \pgfpointxy{1}{1}%
+ \edef\xs{\the\pgf@x}%
+ \edef\ys{\the\pgf@y}%
+ \pgfpointanchor{current bounding box}{south west}
+ \edef\xa{\the\pgf@x}%
+ \edef\ya{\the\pgf@y}%
+ \pgfpointanchor{current bounding box}{north east}
+ \edef\xb{\the\pgf@x}%
+ \edef\yb{\the\pgf@y}%
+ \pgfmathtruncatemacro\xbeg{ceil(\xa/\xs)}
+ \pgfmathtruncatemacro\xend{floor(\xb/\xs)}
+ \if@showgrid@below
+ \foreach \X in {\xbeg,...,\xend} {
+ \node [below,show grid/labels,show grid/xlabels] at (\X,\ya) {\X};
+ }
+ \fi
+ \if@showgrid@above
+ \foreach \X in {\xbeg,...,\xend} {
+ \node [above,show grid/labels,show grid/xlabels] at (\X,\yb) {\X};
+ }
+ \fi
+ \pgfmathtruncatemacro\ybeg{ceil(\ya/\ys)}
+ \pgfmathtruncatemacro\yend{floor(\yb/\ys)}
+ \if@showgrid@left
+ \foreach \Y in {\ybeg,...,\yend} {
+ \node [left,show grid/labels,show grid/ylabels] at (\xa,\Y) {\Y};
+ }
+ \fi
+ \if@showgrid@right
+ \foreach \Y in {\ybeg,...,\yend} {
+ \node [right,show grid/labels,show grid/ylabels] at (\xb,\Y) {\Y};
+ }
+ \fi
+ \end{pgfonlayer}
+ \fi
+ \end{scope}
+}
+\tikzset{every show grid/.style={show grid/keep bb}}% Keep the original bounding box!
+
+\endinput \ No newline at end of file
diff --git a/graphics/pgf/contrib/pmdraw/pmdraw.tex b/graphics/pgf/contrib/pmdraw/pmdraw.tex
new file mode 100644
index 0000000000..b4111bcff2
--- /dev/null
+++ b/graphics/pgf/contrib/pmdraw/pmdraw.tex
@@ -0,0 +1,3679 @@
+\documentclass{ltxdoc}
+
+% *------------------------------*
+% |6````````````````````````````2|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |3````````````````````````````0|
+% *------------------------------*
+
+\usepackage{pmdraw}
+\usepackage{xcolor}
+\usepackage{fancyvrb}
+\usepackage{hyperref}
+
+\begin{document}
+
+\hypersetup{colorlinks, linkcolor=blue, urlcolor=blue}
+
+\title{The \textsf{pmdraw} package\thanks{This document
+ corresponds to \textsf{pmdraw}~v1.4, 2024-06-02.}}
+\author{Matthias Fresacher \\ \texttt{matthias.ypg37@slmail.me}}
+
+\maketitle
+
+\begin{abstract}
+The \texttt{pmdraw} package allows you to draw elements of the diagram monoids, commonly referred to as diagrams. The package provides a lot of flexibility to draw most diagrams and can be customised as needed.
+\end{abstract}
+
+\tableofcontents
+
+\newpage
+\section{Introduction}
+
+\subsection{Motivation}
+
+Diagram monoids and their closely related algebras are well studied objects with applications in theoretical physics and representation theory in mathematics. The elements of these monoids are called diagrams because they can be drawn graphically as a graph following certain conventions.
+
+My PhD thesis examines properties of these diagram monoids and hence I needed to draw a large number of diagrams in a neat and consistent way. This thesis work formed the basis of this package with only customisability and the manual needed to be added to complete this package.
+
+\subsection{Acknowledgments}
+
+Most importantly, I thank James East, my PhD supervisor for allowing me to get a little sidetracked in my PhD research and develop and publish this package rather than work on my thesis like I should have.
+
+This package has at its core the basic drawing macro of a diagram as used by James East and Nik Ru\v{s}kuc in their 2022 publication {\it Classification of congruences of twisted partition monoids} in Advances in Mathematics. I thank them both for allowing me to build on their work.
+
+I thank everybody that has helped me proof read, spot bugs, provide feedback, suggest improvements or has otherwise contributed to this package. Those that are happy to be named are (in chronological order):
+\begin{itemize}
+ \item Nik Ru\v{s}kuc
+\end{itemize}
+
+This package heavily uses commands that can accept an arbitrary number of arguments as inputs. I thank \texttt{egreg} for their template upon which my commands are based (\url{https://tex.stackexchange.com/a/72915}).
+
+As this was my first time using keys, I thank David Carlisle for their very helpful example (\url{https://tex.stackexchange.com/a/542555}).
+
+As it turns out, passing my keys to the \verb`\draw` command of \texttt{tikz} is a little more tricky than one might expect. I thank Andrew Stacey for their solution (\url{https://tex.stackexchange.com/a/64237}).
+
+I thank Partha~D.~for their ready to use out of the box macro for adding grid lines to a \texttt{tikz} drawing (\url{https://tex.stackexchange.com/a/467908}).
+
+I also thank everybody on \url{https://tex.stackexchange.com} who has answered a questions or solved a problem. There are too many to list you all. Thank you.
+
+\section{Bugs and known problems}
+
+\subsection{Bugs}
+
+If you discover a bug, please be so kind and send me a minimum working example of the bug in action and I will work on fixing it.
+
+I would like this package to be as perfect as it can be but I will need your help with this as there simply are too many keys to test every combination or use case.
+
+The following are a list of currently known bugs that will be addressed:
+\begin{enumerate}
+ \item When the radius of the arc for non-transversal edges is too large compared to the distance between the two nodes, the arcs overlap. The current solution is to manually specify a \texttt{level} or \texttt{height} that makes the arcs smaller.
+ \item Baseline adjustments are hard coded so when changing \texttt{scale}, \texttt{row sep} or text size, for example, the vertical position of diagrams is likely to be incorrect. The current solution is to manually adjust the \texttt{baseline} within the \texttt{tikz} key.
+ \item In a product diagram, if \texttt{row sep} is used in the bottom diagram, the spacing between diagrams is incorrect.
+\end{enumerate}
+
+\subsection{Incompatibilities}
+
+The following are a list of known problems or incompatibilities that are not scheduled to be resolved anytime soon:
+\begin{enumerate}
+ \item None at the moment
+\end{enumerate}
+
+\section{Usage}
+
+To use the package, one must understand that all diagrams are created from a basic building block called a brick.
+
+\subsection{Bricks}
+
+\DescribeMacro{brick}
+A \texttt{brick} is a diagram that contains no dots. For example,
+\begin{center}
+ \pmdBrick[ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+ }{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Transversal edges
+ {1}{1}
+ {3}{4}
+ }
+\end{center}
+is a brick whilst
+\begin{center}
+ \pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=2
+ ]{ % Upper non-transversal edges
+ {1}{2}
+ }{ % Lower non-transversal edges
+ {1}{2}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+ }
+\end{center}
+is not a brick.
+\DescribeMacro{<brick>}
+The syntax for a brick contains four components and is as follows:
+\begin{center}
+ \texttt{<brick>~=~[<options>]\{<Uedges>\}\{<Ledges>\}\{<Tedges>\}}
+\end{center}
+where
+\DescribeMacro{brick/<options>}
+the \texttt{<options>} are described in Section~\ref{sec: brick/options}.
+
+\DescribeMacro{<Uedges>}
+is a list of upper non-transversal edges. An upper non-transversal edges has three components \texttt{<Uedges>~=~[<options>]\{<Svertex>\}\{<Tvertex>\}} where
+\DescribeMacro{Uedges/<options>}\DescribeMacro{Ledges/<options>}
+the \texttt{<options>} are described in Section~\ref{sec: NT edge/options},
+\DescribeMacro{<Svertex>}
+\texttt{\{<Svertex>\}} is the starting vertex and
+\DescribeMacro{<Tvertex>}
+\texttt{\{<Tvertex>\}} is the terminating vertex of the edge. Both \texttt{\{<Svertex>\}} and \texttt{\{<Tvertex>\}} are a \( x \)-coordinate and it is assumed that \( \texttt{\{<Svertex>\}} < \texttt{\{<Tvertex>\}} \).
+
+\DescribeMacro{list}
+A \texttt{list} of upper non-transversal edges is simply each upper non-transversal edge written after the other. For example a list with one upper non-transversal edges is
+\begin{verbatim}
+ {1}{2}
+\end{verbatim}
+whilst one with three upper non-transversal edges may be
+\begin{verbatim}
+ {1}{2}[level=1]{3}{4}{5}{6}
+\end{verbatim}
+For ease of reading this will coded as
+\begin{verbatim}
+ {1}{2}
+ [level=1]{3}{4}
+ {5}{6}
+\end{verbatim}
+\DescribeMacro{\pmdEmpty}
+Should a list be empty, the command \verb`\pmdEmpty` should be used.
+
+\DescribeMacro{<Ledges>}
+is a list of lower non-transversal edges. A lower non-transversal edges has the same three components as an upper non-transversal edge, namely \texttt{<Ledges>~=~[<options>]\{<Svertex>\}\{<Tvertex>\}}.
+
+\DescribeMacro{<Tedges>}
+is a list of transversal edges. A transversal edges has three components \texttt{<Tedges>~=~[<options>]\{<Tvertex>\}\{<Bvertex>\}} where
+\DescribeMacro{Tedges/<options>}
+the \texttt{<options>} are described in Section~\ref{sec: T edge/options},
+\DescribeMacro{<Tvertex>}
+\texttt{\{<Tvertex>\}} is the top vertex and
+\DescribeMacro{<Bvertex>}
+\texttt{\{<Bvertex>\}} is the bottom vertex of the edge. Both \texttt{\{<Tvertex>\}} and \texttt{\{<Bvertex>\}} are a \( x \)-coordinate.
+
+An example \texttt{<brick>} and the resultant diagram is:
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+ {4}{5}
+}{ % Transversal edges
+ \pmdEmpty
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+ {4}{5}
+}{ % Transversal edges
+ \pmdEmpty
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\subsection{Draw commands}
+
+This package has three draw commands.
+
+\DescribeMacro{\pmdBrick}
+draws a brick and has the syntax \verb`\pmdBrick<brick>`.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+ {4}{5}
+}{ % Transversal edges
+ \pmdEmpty
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+ {4}{5}
+}{ % Transversal edges
+ \pmdEmpty
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{\pmdDiagram}
+draws arbitrarily many bricks separated by dots and has the syntax
+\begin{verbatim}
+\pmdDiagram[<options>]{<bricks>}
+\end{verbatim}
+where
+\DescribeMacro{diagram/<options>}
+the \texttt{<options>} are described in Section~\ref{sec: diagram/options} and
+\DescribeMacro{<bricks>}
+\texttt{<bricks>} is a list of \texttt{<brick>}-s, with each brick enclosed in curly brackets.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{center}
+
+It should be noted that \verb`\pmdBrick` is simply a wrapper for a single brick that calls \verb`\pmdDiagram` with no diagram options. This means that, for example, the \texttt{grid} key is not available for \verb`\pmdBrick` and \verb`\pmdDiagram` must be used instead to access the \texttt{grid} key.
+
+For edges that go across multiple bricks, know that the coordinate positions of the vertices extends infinitely in both directions. If using default settings, the dots between bricks occupies one vertex position. To help with counting and identifying the correct coordinate position, the \texttt{grid} flag may also be used, see Section~\ref{sec: diagram/options all}.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=3,
+ brace={
+ left=2,
+ right=6,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{6}
+ {3}{5}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=2
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{-1}
+ {2}{-2}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=3,
+ brace={
+ left=2,
+ right=6,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{6}
+ {3}{5}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=2
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{-1}
+ {2}{-2}
+ }
+ }
+}
+\end{center}
+
+\DescribeMacro{\pmdProduct}
+draws two diagrams on top of each other as is the case during multiplication or concatenation and has the syntax
+\begin{verbatim}
+\pmdProduct[<options>]{<Aedges>}{<Tbricks>}{<Bbricks>}
+\end{verbatim}
+where
+\DescribeMacro{diagram/<options>}
+the \texttt{<options>} are described in Section~\ref{sec: diagram/options}.
+
+\DescribeMacro{<Aedges>}
+is a list of edges that are added during the concatenation process. An added edge has two components, namely \texttt{<Aedges>~=~\{<Svertex>\}\{<Tvertex>\}}, where \texttt{\{<Svertex>\}} is the starting vertex and \texttt{\{<Tvertex>\}} is the terminating vertex of the collection of added edges. Both \texttt{\{<Svertex>\}} and \texttt{\{<Tvertex>\}} are a \( x \)-coordinate and it is assumed that \( \texttt{\{<Svertex>\}} < \texttt{\{<Tvertex>\}} \).
+
+\DescribeMacro{<Tbricks>}
+is a list of bricks that correspond to the top diagram, with each brick enclosed in curly brackets.
+
+\DescribeMacro{<Bbricks>}
+is a list of bricks that correspond to the bottom diagram, with each brick enclosed in curly brackets.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdProduct{ % Added edges
+ {1}{5}
+ {7}{8}
+}{ % Top diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ {3}{3}
+ {4}{4}
+ {5}{5}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=2
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=2
+ ]{ % Upper non-transversal edges
+ {1}{2}
+ }{ % Lower non-transversal edges
+ {1}{2}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdProduct{ % Added edges
+ {1}{5}
+ {7}{8}
+}{ % Top diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ {3}{3}
+ {4}{4}
+ {5}{5}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=2
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=2
+ ]{ % Upper non-transversal edges
+ {1}{2}
+ }{ % Lower non-transversal edges
+ {1}{2}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}
+\end{center}
+
+\subsection{Brick options} \label{sec: brick/options}
+
+The following are all of the keys that are available for bricks.
+
+\subsubsection{Vertex options}
+
+\DescribeMacro{degree}
+specifies the degree, that is, the number of vertices in the top and bottom row of the diagram. Must be a positive integer and must be provided unless using \texttt{degree top} and \texttt{degree bottom}.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{degree top} \DescribeMacro{degree bottom}
+specifies the degree, that is, the number of vertices in the top (bottom) row of the diagram. Must be a positive integer and must be provided as a pair \texttt{degree top} and \texttt{degree bottom}.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree top=5,
+ degree bottom=4
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree top=5,
+ degree bottom=4
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{blank top} \DescribeMacro{blank bottom}
+specifies the number of blank vertices to the left of the top (bottom) row of the diagram. Default is zero.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ blank top=1,
+ degree top=4,
+ degree bottom=5
+]{ % Upper non-transversal edges
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ blank top=1,
+ degree top=4,
+ degree bottom=5
+]{ % Upper non-transversal edges
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+It should also be noted that the \texttt{blank top} and \texttt{blank bottom} can also be used to create more space between bricks and the dots between bricks by setting a large number. Likewise if set to \( -1 \) and the dots is redefined to not draw, the space between bricks can be removed altogether. See Examples~13-15.
+
+\DescribeMacro{row sep}
+specifies the vertical separation between rows of vertices. Default is two. If using edge options such as \texttt{levels}, \texttt{row sep} must be given before \texttt{levels}.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ row sep=4
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ row sep=4
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{vertices}
+passes through options to the \verb`\draw` command of vertices. The default is no argument.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ vertices=blue
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ vertices=blue
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{no vertex bottom 1}
+\DescribeMacro{ \vdots}
+\DescribeMacro{no vertex bottom 9}
+\DescribeMacro{no vertex top 1}
+\DescribeMacro{ \vdots}
+\DescribeMacro{no vertex top 9}
+specifies a vertex that is not drawn. Any of the nine available keys can be used in any order. It can be used to draw single vertices that are different to the others. If more than nine vertices need to be excluded, simply draw multiple bricks next to each other. The default is no argument.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ no vertex top 1=2,
+ no vertex top 2=3,
+ no vertex bottom 1=4,
+ decorate after={
+ \fill[red] (4,0) circle (.1);
+ }
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdBrick[ % Options
+ degree=5,
+ no vertex top 1=2,
+ no vertex top 2=3,
+ no vertex bottom 1=4,
+ decorate after={
+ \fill[red] (4,0) circle (.1);
+ }
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{center}
+
+\DescribeMacro{vertices options}
+allows for the redefinition of the command that draws the vertices. It has two arguments, the \( x \) and \( y \)-position of the vertex. The default is
+\begin{verbatim}
+\fill[apply style/.expand once=\pmdraw@drawVertexOptions] (#1,#2) circle (.17);
+\end{verbatim}
+An example use is
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ vertices options={
+ \draw[very thick] (#1,#2) circle (.25);
+ }
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdBrick[ % Options
+ degree=5,
+ vertices options={
+ \draw[very thick] (#1,#2) circle (.25);
+ }
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{center}
+
+\DescribeMacro{labels}\DescribeMacro{labels top}\DescribeMacro{labels bottom}
+flags that allow for the drawing of labels for the vertices. Use \texttt{labels} for labels on both the top and bottom or set individually. The default is no labels.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ labels bottom
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ labels bottom
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{labels start}\DescribeMacro{labels top start}\DescribeMacro{labels bottom start}
+sets the starting value of the labels for the vertices. The default is one.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ labels,
+ labels top start=3,
+ labels bottom start=-2
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ labels,
+ labels top start=3,
+ labels bottom start=-2
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{no labels bottom 1}
+\DescribeMacro{ \vdots}
+\DescribeMacro{no labels bottom 9}
+\DescribeMacro{no labels top 1}
+\DescribeMacro{ \vdots}
+\DescribeMacro{no labels top 9}
+specifies a vertex for which no label is drawn. Any of the nine available keys can be used in any order. It can be used to insert single unique labels that are different to the others. If more than nine labels need to be excluded, simply draw multiple bricks next to each other. The default is no argument.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ labels,
+ no label top 1=2,
+ no label top 2=3,
+ no label bottom 1=4,
+ decorate after={
+ \draw (3,2) node[above=6pt,red] {\(x\)};
+ }
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdBrick[ % Options
+ degree=5,
+ labels,
+ no label top 1=2,
+ no label top 2=3,
+ no label bottom 1=4,
+ decorate after={
+ \draw (3,2) node[above=6pt,red] {\(x\)};
+ }
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{center}
+
+\DescribeMacro{labels top draw}\DescribeMacro{labels top node}\DescribeMacro{labels bottom draw}\DescribeMacro{labels bottom node}
+passes through options to the \verb`\draw` and \verb`node` command of the labels of vertices. The default is no argument.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ labels,
+ labels top node=red,
+ labels bottom node={right=2pt}
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdBrick[ % Options
+ degree=5,
+ labels,
+ labels top node=red,
+ labels bottom node={right=2pt}
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{center}
+
+\DescribeMacro{labels top options}\DescribeMacro{labels bottom options}
+allows for the redefinition of the command that draws the labels of the vertices. They have three arguments, the \( x \) and \( y \)-position of the vertex and the label value. The default for the top is
+\begin{verbatim}
+\draw[apply style/.expand once=\pmdraw@drawLabelTDrawOptions] (#1,#2)
+ node[above=6pt,apply style/.expand once=\pmdraw@drawLabelTNodeOptions] {\(#3\)};
+\end{verbatim}
+and for the bottom
+\begin{verbatim}
+\draw[apply style/.expand once=\pmdraw@drawLabelBDrawOptions] (#1,#2)
+ node[below=6pt,apply style/.expand once=\pmdraw@drawLabelBNodeOptions] {\(#3'\)};
+\end{verbatim}
+An example use is
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ labels,
+ labels bottom options={
+ \draw (#1,#2) node[below=6pt,blue] {\(#3''\)};
+ }
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdBrick[ % Options
+ degree=5,
+ labels,
+ labels bottom options={
+ \draw (#1,#2) node[below=6pt,blue] {\(#3''\)};
+ }
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{center}
+
+\DescribeMacro{no dots}
+The \texttt{no dots} flag removes the drawing of dots to the left of the current brick in diagrams. Default is to draw dots except for the first brick.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1,
+ no dots
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1,
+ no dots
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{center}
+
+
+\DescribeMacro{dots draw}\DescribeMacro{dots node}
+passes through options to the \verb`\draw` and \verb`node` command of the dots. The default is no argument.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1,
+ dots node=red
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1,
+ dots node=red
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{center}
+
+\DescribeMacro{vertices top phantom}\DescribeMacro{vertices bottom phantom}
+These flags allow for all of the top or bottom vertices to be hidden using the \texttt{phantom} command. Simply wraps the vertex drawing macros with a \texttt{phantom} command. This hiding will also apply to the labels of that row (top or bottom) of vertices. To only hide a selected number of vertices, use seperate bricks. The default is false.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ vertices top phantom,
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ vertices top phantom
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{vertices top uncover}\DescribeMacro{vertices bottom uncover}
+allows for all of the top or bottom vertices to be uncovered in a \texttt{beamer} presentation using the command \verb`\uncover<n->{text}`. Simply passes the slide uncover information \verb`<n->` to the embedded \texttt{uncover} command within the vertex drawing macros. This uncover will also apply to the labels of that row (top or bottom) of vertices. To only uncover a selected number of vertices, use seperate bricks. The default is~\texttt{1-}.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ vertices top uncover={2,4-7,9-},
+ vertices bottom uncover={3-}
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ vertices top uncover={2,4-7,9-},
+ vertices bottom uncover={3-}
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+
+\subsubsection{Edge options}
+
+These options should be read in conjunction with Section~\ref{sec: edge/options}.
+
+\DescribeMacro{levels}
+specifies how many horizontal levels there are for non-transversal edges. Default is one.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ levels=3
+]{ % Upper non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Lower non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Transversal edges
+ \pmdEmpty
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ levels=3
+]{ % Upper non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Lower non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Transversal edges
+ \pmdEmpty
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{levels top} \DescribeMacro{levels bottom}
+specifies how many horizontal levels there are for upper (lower) non-transversal edges. Default is one.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ levels top=3,
+ levels bottom=2
+]{ % Upper non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Lower non-transversal edges
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Transversal edges
+ \pmdEmpty
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ levels top=3,
+ levels bottom=2
+]{ % Upper non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Lower non-transversal edges
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Transversal edges
+ \pmdEmpty
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{levels sep}
+specifies the vertical separation between horizontal levels for non-transversal edges. Default is evenly spaced within the space available for the given number of \texttt{levels}.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ levels=3,
+ levels sep=0.3
+]{ % Upper non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Lower non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Transversal edges
+ \pmdEmpty
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ levels=3,
+ levels sep=0.3
+]{ % Upper non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Lower non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Transversal edges
+ \pmdEmpty
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{levels sep top} \DescribeMacro{levels sep bottom}
+specifies the vertical separation between horizontal levels for upper (lower) non-transversal edges. Default is evenly spaced within the space available for the given number of \texttt{levels}.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ levels=3,
+ levels sep top=0.4,
+ levels sep bottom=0.15
+]{ % Upper non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Lower non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Transversal edges
+ \pmdEmpty
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ levels=3,
+ levels sep top=0.4,
+ levels sep bottom=0.15
+]{ % Upper non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Lower non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Transversal edges
+ \pmdEmpty
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{edges}\DescribeMacro{edges non-transversal}\DescribeMacro{edges upper}\DescribeMacro{edges lower}\DescribeMacro{edges transversal}
+pass through options to the \verb`\draw` command of their respective edge types. The default is no argument.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ edges upper=blue,
+ edges lower={red, dotted, very thick},
+ edges transversal=dashed
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdBrick[ % Options
+ degree=5,
+ edges upper=blue,
+ edges lower={red, dotted, very thick},
+ edges transversal=dashed
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{center}
+
+\DescribeMacro{edges first}
+flag ensures edges are drawn before vertices. The default is vertices are drawn first.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ edges lower={red, very thick},
+ edges first
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ edges lower={red, very thick},
+ edges first
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{transversals first}
+flag ensures transversal edges are drawn before non-transversal edges. The default is non-transversal edges are drawn first.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ edges lower={red, very thick},
+ transversals first
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ edges lower={red, very thick},
+ transversals first
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{edges phantom}
+This flag allows for all edges to be hidden using the \texttt{phantom} command. Simply wraps the edge drawing macros with a \texttt{phantom} command. The default is false.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ edges phantom
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ edges phantom
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{edges uncover}
+allows for all edges to be uncovered in a \texttt{beamer} presentation using the command \verb`\uncover<n->{text}`. Simply passes the slide uncover information \verb`<n->` to the embedded \texttt{uncover} command within the edge drawing macros. The default is~\texttt{1-}.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ edges uncover={2,4-7,9-}
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ edges uncover={2,4-7,9-}
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\subsubsection{Brace}
+
+\DescribeMacro{brace}
+specifies instructions for the drawing of a brace with the brace keys. These are described in Section~\ref{sec: brace}. The default is no brace is drawn.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{center}
+
+\DescribeMacro{brace draw}\DescribeMacro{brace node}
+passes through options to the \verb`\draw` and \verb`node` command of the brace. Must be given before the \texttt{brace} key. The default is no argument.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace draw=thin,
+ brace node={pos=0.25},
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace draw=thin,
+ brace node={pos=0.25},
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{center}
+
+\subsubsection{Decorations}
+
+\DescribeMacro{decorate before}\DescribeMacro{decorate after}
+provides a hook to draw additional \texttt{tikz} elements before and after the brick is drawn. The default is empty.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ decorate after={
+ \draw[
+ very thick,
+ red,
+ rounded corners=5pt
+ ] (0.6, -0.4) rectangle (1.4, 2.4);
+ }
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdBrick[ % Options
+ degree=5,
+ decorate after={
+ \draw[
+ very thick,
+ red,
+ rounded corners=5pt
+ ] (0.6, -0.4) rectangle (1.4, 2.4);
+ }
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{center}
+
+These hooks can also be used for more sophisticated manipulation of diagrams be inserting not just \texttt{tikz} elements but arbitrary code before and after draw a brick.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=4
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ {1}{1}
+ {4}{4}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=3,
+ decorate before={\begin{scope}[red,shift={(1,1)},rotate=30]},
+ decorate after={\end{scope}}
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{2}
+ {2}{3}
+ {3}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=4
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ {1}{1}
+ {4}{4}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=3,
+ decorate before={\begin{scope}[red,shift={(1,1)},rotate=30]},
+ decorate after={\end{scope}}
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{2}
+ {2}{3}
+ {3}{1}
+ }
+ }
+}
+\end{center}
+
+\subsubsection{Drawing order} \label{sec: order}
+
+For clarity, this is the default drawing order for a brick:
+\begin{enumerate}
+ \item \texttt{decorate before}
+ \item Top row of vertices
+ \item Bottom row of vertices
+ \item Upper non-transversal edges
+ \item Lower non-transversal edges
+ \item Transversal edges
+ \item \texttt{decorate after}
+\end{enumerate}
+
+This order can be altered using the \texttt{edges first} and \texttt{transversals first} flags.
+
+For the drawing order of a diagram and product diagram, see the \texttt{decorate before} and \texttt{decorate after} keys in Section~\ref{sec: diagram/options all}.
+
+\subsection{Edge options} \label{sec: edge/options}
+
+\subsubsection{Non-transversal edge options} \label{sec: NT edge/options}
+
+\DescribeMacro{level}
+specifies the horizontal level of a non-transversal edges. Default is one.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ levels=3
+]{ % Upper non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Lower non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Transversal edges
+ \pmdEmpty
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ levels=3
+]{ % Upper non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Lower non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Transversal edges
+ \pmdEmpty
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{height}
+specifies a manually set horizontal height of a non-transversal edges. Default is to use levels.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{5}
+ [height=1.75]{1}{4}
+}{ % Lower non-transversal edges
+ [height=1.25]{1}{5}
+ {1}{4}
+}{ % Transversal edges
+ \pmdEmpty
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{5}
+ [height=1.75]{1}{4}
+}{ % Lower non-transversal edges
+ [height=1.25]{1}{5}
+ {1}{4}
+}{ % Transversal edges
+ \pmdEmpty
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{edge draw}
+passes through options to the \verb`\draw` command of the edge. The default is no argument.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{2}
+ [edge draw=red]{2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ [edge draw=dotted]{1}{2}
+ {3}{4}
+}{ % Transversal edges
+ \pmdEmpty
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{2}
+ [edge draw=red]{2}{3}
+ {4}{5}
+}{ % Lower non-transversal edges
+ [edge draw=dotted]{1}{2}
+ {3}{4}
+}{ % Transversal edges
+ \pmdEmpty
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{options}
+allows for the redefinition of the command that draws the non-transversal edge. It has two arguments, the start and end \( x \)-position of the edge. The default for an upper non-transversal is
+\begin{verbatim}
+ \draw[apply style/.expand once=\pmdraw@drawUedgesDrawOptions,
+ apply style/.expand once=\pmdraw@drawEdgeDrawOptions]
+ (#1,\pmdraw@rowSep) arc (180:270:\pmdraw{edgeHeight});% Draw left arch
+ \draw[apply style/.expand once=\pmdraw@drawUedgesDrawOptions,
+ apply style/.expand once=\pmdraw@drawEdgeDrawOptions]
+ (#1+\pmdraw{edgeHeight},\pmdraw@rowSep-\pmdraw{edgeHeight})
+ -- (#2-\pmdraw{edgeHeight},\pmdraw@rowSep-\pmdraw{edgeHeight});
+ % Draw straight line
+ \draw[apply style/.expand once=\pmdraw@drawUedgesDrawOptions,
+ apply style/.expand once=\pmdraw@drawEdgeDrawOptions]
+ (#2-\pmdraw{edgeHeight},\pmdraw@rowSep-\pmdraw{edgeHeight})
+ arc (270:360:\pmdraw{edgeHeight});% Draw right arc
+ \renewcommand{\pmdraw@drawEdgeDrawOptions}{}% Reset draw options for edge
+\end{verbatim}
+and for a lower non-transversal
+\begin{verbatim}
+ \draw[apply style/.expand once=\pmdraw@drawLedgesDrawOptions,
+ apply style/.expand once=\pmdraw@drawEdgeDrawOptions]
+ (#1,0) arc (180:90:\pmdraw{edgeHeight});% Draw left arch
+ \draw[apply style/.expand once=\pmdraw@drawLedgesDrawOptions,
+ apply style/.expand once=\pmdraw@drawEdgeDrawOptions]
+ (#1+\pmdraw{edgeHeight},\pmdraw{edgeHeight})
+ -- (#2-\pmdraw{edgeHeight},\pmdraw{edgeHeight});% Draw straight line
+ \draw[apply style/.expand once=\pmdraw@drawLedgesDrawOptions,
+ apply style/.expand once=\pmdraw@drawEdgeDrawOptions]
+ (#2-\pmdraw{edgeHeight},\pmdraw{edgeHeight})
+ arc (90:0:\pmdraw{edgeHeight});% Draw right arc
+ \renewcommand{\pmdraw@drawEdgeDrawOptions}{}% Reset draw options for edge
+\end{verbatim}
+An example use is
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ [options={
+ \draw[blue, very thick] (#1,0) -- (#2,0);
+ }]{1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ [options={
+ \draw[blue, very thick] (#1,0) -- (#2,0);
+ }]{1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{center}
+
+\DescribeMacro{phantom}
+This flag allows for the edge to be hidden using the \texttt{phantom} command. Simply wraps the edge drawing macros with a \texttt{phantom} command. The default is false.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ [phantom]{1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ [phantom]{1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ [phantom]{1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ [phantom]{1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{uncover}
+allows for that edge to be uncovered in a \texttt{beamer} presentation using the command \verb`\uncover<n->{text}`. Simply passes the slide uncover information \verb`<n->` to the embedded \texttt{uncover} command within the edge drawing macros. This uncover is nested inside the \texttt{edges uncover} and hence the limitations of nested uncovers are present here. For example, an individual edge will not uncover until the \texttt{edges uncover} has been uncovered. In such instances only use individual uncovers for each edge. The default is~\texttt{1-}.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ [uncover={2,4-7,9-}]{1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ [uncover={3-}]{1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ [uncover={2,4-7,9-}]{1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ [uncover={3-}]{1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\subsubsection{Transversal edge options} \label{sec: T edge/options}
+
+\DescribeMacro{height}
+draws transversal edges with a horizontal component and specifies the manually set horizontal height of the transversal edges. Default is to use non-horizontal transversal edges.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree top=5,
+ degree bottom=6
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ [height=1]{10}{2}
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=3,
+ blank bottom=1,
+ degree bottom=2
+ ]{ % Upper non-transversal edges
+ {1}{2}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree top=5,
+ degree bottom=6
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ [height=1]{10}{2}
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=3,
+ blank bottom=1,
+ degree bottom=2
+ ]{ % Upper non-transversal edges
+ {1}{2}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}
+\end{center}
+
+\DescribeMacro{edge draw}
+passes through options to the \verb`\draw` command of the edge. The default is no argument.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{2}
+ }{ % Lower non-transversal edges
+ {4}{5}
+ {3}{4}
+}{ % Transversal edges
+ [edge draw=red]{1}{1}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{2}
+}{ % Lower non-transversal edges
+ {4}{5}
+ {3}{4}
+}{ % Transversal edges
+ [edge draw=red]{1}{1}
+ {3}{2}
+ [edge draw=dashed]{4}{5}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{options}
+allows for the redefinition of the command that draws the transversal edge. It has two arguments, the \( x \)-position of the edge in the top row of vertices and the \( x \)-position of the edge in the bottom row of vertices. The default is
+\begin{verbatim}
+ \ifnum\pmdraw@ifTedgeHorizontal=0% If drawing a straight line edge
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions,
+ apply style/.expand once=\pmdraw@drawEdgeDrawOptions]
+ (#1,\pmdraw@rowSep) -- (#2,0);% Draw straight line
+ \else% If transversal edge is drawn horizontally
+ \ifnum#1>#2% If edge goes from top right to bottom left
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions,
+ apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#2,0) arc
+ (180:90:\pmdraw{Tlevel});% Draw bottom arch
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions,
+ apply style/.expand once=\pmdraw@drawEdgeDrawOptions]
+ (#2+\pmdraw{Tlevel},\pmdraw{Tlevel}) --
+ (#1-\pmdraw@rowSep+\pmdraw{Tlevel}, \pmdraw{Tlevel});% Draw straight line
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions,
+ apply style/.expand once=\pmdraw@drawEdgeDrawOptions]
+ (#1-\pmdraw@rowSep+\pmdraw{Tlevel},\pmdraw{Tlevel}) arc
+ (270:360:{\pmdraw@rowSep-\pmdraw{Tlevel}});% Draw top arc
+ \else% If edge goes from top left to bottom right
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions,
+ apply style/.expand once=\pmdraw@drawEdgeDrawOptions]
+ (#2,0) arc (0:90:\pmdraw{Tlevel});% Draw bottom arch
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions,
+ apply style/.expand once=\pmdraw@drawEdgeDrawOptions]
+ (#2-\pmdraw{Tlevel},\pmdraw{Tlevel}) --
+ (#1+\pmdraw@rowSep-\pmdraw{Tlevel}, \pmdraw{Tlevel});% Draw straight line
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions,
+ apply style/.expand once=\pmdraw@drawEdgeDrawOptions]
+ (#1+\pmdraw@rowSep-\pmdraw{Tlevel},\pmdraw{Tlevel}) arc
+ (270:180:{\pmdraw@rowSep-\pmdraw{Tlevel}});% Draw top arc
+ \fi%
+ \renewcommand{\pmdraw@ifTedgeHorizontal}{0}% Reset flag to default
+ \fi%
+ \renewcommand{\pmdraw@drawEdgeDrawOptions}{}% Reset draw options for edge
+\end{verbatim}
+An example use is
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree top=5,
+ degree bottom=6
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ [options={
+ \draw (#2,0) -- (#2+1,1); % Draw bottom line
+ \draw (#2+1,1) -- (#1-1, 1); % Draw straight line
+ \draw (#1-1,1) -- (#1,2); % Draw top line
+ }]{10}{2}
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=3,
+ blank bottom=1,
+ degree bottom=2
+ ]{ % Upper non-transversal edges
+ {1}{2}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree top=5,
+ degree bottom=6
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ [options={
+ \draw (#2,0) -- (#2+1,1); % Draw bottom line
+ \draw (#2+1,1) -- (#1-1, 1); % Draw straight line
+ \draw (#1-1,1) -- (#1,2); % Draw top line
+ }]{10}{2}
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=3,
+ blank bottom=1,
+ degree bottom=2
+ ]{ % Upper non-transversal edges
+ {1}{2}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}
+\end{center}
+
+\DescribeMacro{phantom}
+This flag allows for the edge to be hidden using the \texttt{phantom} command. Simply wraps the edge drawing macros with a \texttt{phantom} command. The default is false.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ [phantom]{1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ [phantom]{1}{1}
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{uncover}
+allows for that edge to be uncovered in a \texttt{beamer} presentation using the command \verb`\uncover<n->{text}`. Simply passes the slide uncover information \verb`<n->` to the embedded \texttt{uncover} command within the edge drawing macros. This uncover is nested inside the \texttt{edges uncover} and hence the limitations of nested uncovers are present here. For example, an individual edge will not uncover until the \texttt{edges uncover} has been uncovered. In such instances only use individual uncovers for each edge. The default is~\texttt{1-}.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ [uncover={2,4-7,9-}]{1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ [uncover={2,4-7,9-}]{1}{1}
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\subsection{Brace} \label{sec: brace}
+
+\DescribeMacro{brick/brace}
+As part of a diagram, it may be useful to draw a brace. The options of a brace are as follows:
+
+\DescribeMacro{left}\DescribeMacro{right}
+specifies the \( x \)-position of the start/left and end/right of the brace. Both must be provided.
+
+\DescribeMacro{label}
+specifies the label to be printed with the brace. Default is empty.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{center}
+
+\DescribeMacro{above}
+The \texttt{above} flag draws the brace above the diagram. Default is below.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n},
+ above
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n},
+ above
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{center}
+
+\DescribeMacro{options}
+allows for the redefinition of the command that draws the brace. It has three arguments, the \( x \)-position start and end of the brace, as well as the label of the brace. The default is
+\begin{verbatim}
+ \ifnum\pmdraw@ifProdDiag=1 % If drawing a product diagram
+ % or if placing brace above diagram
+ \draw[
+ very thick,
+ decorate,
+ decoration={calligraphic brace,amplitude=6pt},
+ apply style/.expand once=\pmdraw@drawBraceDrawOptions
+ ] (#1-0.17,\pmdraw@rowSep+0.5) -- (#2+0.17,\pmdraw@rowSep+0.5)
+ node[
+ pos=0.5,
+ above=6pt,
+ apply style/.expand once=\pmdraw@drawBraceNodeOptions
+ ] {\(#3\)}; % Draw brace on top of diagram
+ \else % If not drawing a product diagram or if placing brace below diagram
+ \draw[
+ very thick,
+ decorate,
+ decoration={calligraphic brace,mirror,amplitude=6pt},
+ apply style/.expand once=\pmdraw@drawBraceDrawOptions
+ ] (#1-0.17,-0.5) -- (#2+0.17,-0.5)
+ node[
+ pos=0.5,
+ below=6pt,
+ apply style/.expand once=\pmdraw@drawBraceNodeOptions
+ ] {\(#3\)}; % Draw brace on bottom of diagram
+ \fi%
+\end{verbatim}
+it should be noted that the flag \verb`\pmdraw@ifProdDiag` is both used for when drawing a product diagram but also when placing the brace above the diagram as this clearly must be the default for the top diagram in a product diagram.
+An example use is
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n},
+ options={
+ \draw[
+ red,
+ very thick,
+ decorate,
+ decoration={calligraphic brace,mirror,amplitude=6pt}
+ ] (#1-0.17,-0.5) -- (#2+0.17,-0.5)
+ node[pos=0.25,below=6pt]{\(#3\)};
+ }
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n},
+ options={
+ \draw[
+ red,
+ very thick,
+ decorate,
+ decoration={calligraphic brace,mirror,amplitude=6pt}
+ ] (#1-0.17,-0.5) -- (#2+0.17,-0.5)
+ node[pos=0.25,below=6pt]{\(#3\)};
+ }
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{center}
+
+\subsection{Diagram options} \label{sec: diagram/options}
+
+\subsubsection{For all (product) diagrams} \label{sec: diagram/options all}
+
+The following options can be used for both diagrams (\verb`\pmdDiagram`) and product diagrams (\verb`\pmdProduct`).
+
+\DescribeMacro{row sep}
+same as \texttt{row sep} option in bricks but applied to all bricks within (product) diagram.
+
+\DescribeMacro{tikz}
+passes through options to \texttt{tikz} environment. Specifically, the options in \verb`\begin{tikzpicture}[<options>]`. The default is no argument. However there are some default options passed to \texttt{tikz} automatically. These are an adjustment to the \texttt{baseline} depending on the current typesetting mode and a \texttt{grid} key if the grid is activated.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram[ % Options
+ tikz={scale=2}
+]{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram[ % Options
+ tikz={scale=2}
+]{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{center}
+
+\DescribeMacro{dots options}
+allows for the redefinition of the command that draws dots between bricks. It has two arguments, the \( x \) and \( y \)-position of the dots. The default is
+\begin{verbatim}
+ \draw[apply style/.expand once=\pmdraw@drawDotsDrawOptions]
+ (#1,#2) node[apply style/.expand once=\pmdraw@drawDotsNodeOptions] {\(\dots\)};
+\end{verbatim}
+An example use is
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram[ % Options
+ dots options={
+ \draw[red] (#1,#2) node {\(\dots\dots\)};
+ }
+]{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=5,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1,
+ blank top=1,
+ blank bottom=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {2}{2}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram[ % Options
+ dots options={
+ \draw[red] (#1,#2) node {\(\dots\dots\)};
+ }
+]{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=5,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1,
+ blank top=1,
+ blank bottom=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {2}{2}
+ }
+ }
+}
+\end{center}
+
+\DescribeMacro{grid}
+As it can get confusing where things are drawn and the different coordinate scopes between all the bricks and diagrams, the \texttt{grid} flag draws the base coordinate grid that the first drawn brick is based on. This should help with all coordinate related inquiries. Default is no grid.
+
+It should be noted that the \texttt{grid} key is not available for \verb`\pmdBrick` and \verb`\pmdDiagram` must be used instead when needing a grid for a single brick only.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram[ % Options
+ grid
+]{
+ { % Brick 1
+ [ % Options
+ degree top=5,
+ degree bottom=6,
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ [height=1]{10}{2}
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=3,
+ blank bottom=1,
+ degree bottom=
+ ]{ % Upper non-transversal edges
+ {1}{2}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram[ % Options
+ grid
+]{
+ { % Brick 1
+ [ % Options
+ degree top=5,
+ degree bottom=6
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ [height=1]{10}{2}
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=3,
+ blank bottom=1,
+ degree bottom=2
+ ]{ % Upper non-transversal edges
+ {1}{2}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}
+\end{center}
+
+\DescribeMacro{decorate before}\DescribeMacro{decorate after}
+same as \texttt{decorate before} and \texttt{decorate after} in bricks but these are drawn before (after) all bricks are drawn. For clarity, this is default drawing order for a diagram:
+\begin{enumerate}
+ \item \texttt{diagram/decorate before}
+ \item Brick loop:
+ \begin{enumerate}
+ \item \texttt{brick/decorate before}
+ \item Draws brick
+ \item \texttt{brick/decorate after}
+ \end{enumerate}
+ \item \texttt{diagram/decorate after}
+\end{enumerate}
+And this is default drawing order for a product diagram:
+\begin{enumerate}
+ \item \texttt{diagram/decorate before}
+ \item Draws added edges
+ \item Top diagram:
+ \begin{enumerate}
+ \item Brick loop:
+ \begin{enumerate}
+ \item \texttt{brick/decorate before}
+ \item Draws brick
+ \item \texttt{brick/decorate after}
+ \end{enumerate}
+ \end{enumerate}
+ \item Bottom diagram:
+ \begin{enumerate}
+ \item Brick loop:
+ \begin{enumerate}
+ \item \texttt{brick/decorate before}
+ \item Draws brick
+ \item \texttt{brick/decorate after}
+ \end{enumerate}
+ \end{enumerate}
+ \item \texttt{diagram/decorate after}
+\end{enumerate}
+
+For the drawing order of a brick see Section~\ref{sec: order}.
+
+\subsubsection{For product diagrams only}
+
+The following options can only be used for product diagrams (\verb`\pmdProduct`).
+
+\DescribeMacro{diagram sep}
+specifies the vertical separation between the bottom row of vertices in top diagram and the top row of vertices in bottom diagram. Also controls the length of the added edges. Default is one.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdProduct[ % Options
+ diagram sep=2
+]{ % Added edges
+ {1}{5}
+}{ % Top diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ {3}{3}
+ {4}{4}
+ {5}{5}
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdProduct[ % Options
+ diagram sep=2
+]{ % Added edges
+ {1}{5}
+}{ % Top diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ {3}{3}
+ {4}{4}
+ {5}{5}
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{center}
+
+\DescribeMacro{vertex sep}
+increases the vertical separation between the bottom row of vertices in top diagram and the top row of vertices in bottom diagram without altering the length of the added edges. Useful for things when adjusting the \texttt{row sep} of the bottom diagram for example. Default is zero.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdProduct[ % Options
+ vertex sep=1
+]{ % Added edges
+ {1}{5}
+}{ % Top diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ {3}{3}
+ {4}{4}
+ {5}{5}
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [ % Options
+ degree=5,
+ row sep=3
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdProduct[ % Options
+ vertex sep=1
+]{ % Added edges
+ {1}{5}
+}{ % Top diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ {3}{3}
+ {4}{4}
+ {5}{5}
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [ % Options
+ degree=5,
+ row sep=3
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{center}
+
+\DescribeMacro{edges added}
+passes through options to the \verb`\draw` command of the added edges. The default is no argument.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdProduct[ % Options
+ edges added={red,very thick}
+]{ % Added edges
+ {1}{5}
+}{ % Top diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ {3}{3}
+ {4}{4}
+ {5}{5}
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdProduct[ % Options
+ edges added={red,very thick}
+]{ % Added edges
+ {1}{5}
+}{ % Top diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ {3}{3}
+ {4}{4}
+ {5}{5}
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{center}
+
+\DescribeMacro{edges added phantom}
+This flag allows for the added edges to be hidden using the \texttt{phantom} command. Simply wraps the edge drawing macros with a \texttt{phantom} command. The default is false.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdProduct[ % Options
+ edges added phantom
+]{ % Added edges
+ {1}{5}
+}{ % Top diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ {3}{3}
+ {4}{4}
+ {5}{5}
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdProduct[ % Options
+ edges added phantom
+]{ % Added edges
+ {1}{5}
+}{ % Top diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ {3}{3}
+ {4}{4}
+ {5}{5}
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{center}
+
+\DescribeMacro{edges added uncover}
+allows for the added edges to be uncovered in a \texttt{beamer} presentation using the command \verb`\uncover<n->{text}`. Simply passes the slide uncover information \verb`<n->` to the embedded \texttt{uncover} command within the added edge drawing macros. The default is~\texttt{1-}.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdProduct[ % Options
+ edges added uncover={2,4-7,9-}
+]{ % Added edges
+ {1}{5}
+}{ % Top diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ {3}{3}
+ {4}{4}
+ {5}{5}
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdProduct[ % Options
+ edges added uncover={2,4-7,9-}
+]{ % Added edges
+ {1}{5}
+}{ % Top diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ {3}{3}
+ {4}{4}
+ {5}{5}
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{center}
+
+\section{Future features/work}
+
+I have attempted to make most use cases easy to use with dedicated functionality that does not require significant \LaTeX\ knowledge whilst at the same time provide more advanced interfaces to allow for hopefully almost complete customisability for those who put in the effort.
+
+Having said that, please do let me know if there are features or improvements you will like to see added.
+
+The following are some of the aims for the future for this package:
+\begin{enumerate}
+ \item Fix bugs.
+ \item Add warning and error messages to log.
+ \item Allow all brick keys to work as diagram keys that apply to all bricks in a diagram. This will require setting up a flag for each key so that the diagram key sets the brick key but the brick key is not reset after drawing the first brick. This process also will need to be able to handle when a single brick has a custom special different key value and that this is reset to the digram key value and not the global default key value.
+ \item Allow appropriate diagram keys to work as brick keys. Notably the \texttt{grid} key.
+ \item The creation of user profiles that allows for fast and efficient setting of default key values that are different to the package defaults. Hence within a diagram, there can be a number of different diagram styles that can be accessed with one command. That is, in the options for a diagram, have this profile key.
+ \item Have global settings so that all diagrams in a document have the specified options.
+ \item Allow for adjusting the horizontal spacing of vertices. Need to think about making that a simple scale factor so that integer interface for edge positions is the same but then hooks will have very messy coordinates or keep it as absolute coordinates with messy edges. Alternatively, do both, allowing the user to choose which option to do and somehow distinguish between the two in the background.
+ \item Create \texttt{pmdMirror} command that mirrors all upper non-transversals into lower non-transversals.
+ \item Create \texttt{invert} key for bricks, diagrams and product diagrams that inverts everything. Probably easiest done with a \texttt{scope} environment around everything and \texttt{yscale=-1}.
+ \item For product diagram, have interface where you input diagram instead of bricks so that you have access to diagram options.
+ \item Create a transversal edge key \texttt{identity} so that all edges in between the two values are straight vertical edges. Thus eliminating the need to write out each edge manually.
+ \item Create \texttt{shift} key for edges that shifts horizontal position.
+ \item Decouple the uncover of labels from \texttt{vertices top uncover}/\texttt{vertices bottom uncover}.
+ \item Decouple the phantom of labels from \texttt{vertices top phantom}/\texttt{vertices bottom phantom}.
+\end{enumerate}
+
+\section{Examples}
+
+This section is simply a collection of example diagrams. The code for them can be found in the \texttt{examples} folder. Perhaps you will find them useful as a starting point for your diagrams or to see what this package is capable of.
+
+\usetikzlibrary{patterns}
+
+\foreach \example in {1,...,25}{
+ \paragraph{Example~\example}
+ \begin{center}
+ \input{examples/example-\example}
+ \end{center}
+}
+
+\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/spath3/README b/graphics/pgf/contrib/spath3/README.txt
index dad3e28a92..b1104b7f4d 100644
--- a/graphics/pgf/contrib/spath3/README
+++ b/graphics/pgf/contrib/spath3/README.txt
@@ -1,6 +1,6 @@
----------------------------------------------------------------
spath3 --- LaTeX3 functions for manipulating PGF soft paths
-E-mail: loopspace@mathforge.org
+E-mail: Andrew Stacey <loopspace@mathforge.org>
Released under the LaTeX Project Public License v1.3c or later
See http://www.latex-project.org/lppl.txt
----------------------------------------------------------------
diff --git a/graphics/pgf/contrib/spath3/spath3.pdf b/graphics/pgf/contrib/spath3/spath3.pdf
index 9282e0adfe..6ade2656ac 100644
--- a/graphics/pgf/contrib/spath3/spath3.pdf
+++ b/graphics/pgf/contrib/spath3/spath3.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/spath3/spath3.tex b/graphics/pgf/contrib/spath3/spath3.tex
index c8e9d65af7..897f5f7b3d 100644
--- a/graphics/pgf/contrib/spath3/spath3.tex
+++ b/graphics/pgf/contrib/spath3/spath3.tex
@@ -1,5 +1,5 @@
\RequirePackage{shellesc}
-\immediate\write18{tex spath3_code.dtx}
+%\immediate\write18{tex spath3_code.dtx}
\documentclass{l3doc}
\usepackage{tikz}
\usetikzlibrary{
@@ -50,27 +50,29 @@
\title{The \textsf{spath3} Package: Documentation}
\author{Andrew Stacey \\ \url{loopspace@mathforge.org}}
- \date{\fileversion~from \filedate}
+\date{\fileversion~from \filedate}
- \begin{document}
+\let\OriginalBar=|
- \maketitle
+\begin{document}
+
+\maketitle
\tableofcontents
- \section{Introduction}
+\section{Introduction}
- The \texttt{spath3} package was originally designed as a low-level package for manipulating the \emph{soft paths} defined by PGF/TikZ.
- Soft paths form one stage of the stack of translations between what the author writes in the \texttt{tikzpicture} environments in their \LaTeX\ document and what is eventually written to the output file.
- Most of the complicated processing has been done by the time a soft path is constructed, but it is still very definitely a \TeX\ object and there has not, for example, been any consideration as to what the eventual output file format is (such as PDF, DVI, or SVG).
- So it is very amenable to being modified at this stage and this package provides a set of routines for doing so.
+The \texttt{spath3} package was originally designed as a low-level package for manipulating the \emph{soft paths} defined by PGF/TikZ.
+Soft paths form one stage of the stack of translations between what the author writes in the \texttt{tikzpicture} environments in their \LaTeX\ document and what is eventually written to the output file.
+Most of the complicated processing has been done by the time a soft path is constructed, but it is still very definitely a \TeX\ object and there has not, for example, been any consideration as to what the eventual output file format is (such as PDF, DVI, or SVG).
+So it is very amenable to being modified at this stage and this package provides a set of routines for doing so.
- The original purpose was to provide a common core on which other packages would be built.
- Indeed, the packages \texttt{calligraphy}, \texttt{knots}, and \texttt{penrose} all use this package.
- However, over time I've found myself wanting to use the routines of this package at a higher level and so have designed some user-level interfaces.
- This document documents those.
+The original purpose was to provide a common core on which other packages would be built.
+Indeed, the packages \texttt{calligraphy}, \texttt{knots}, and \texttt{tilings} all use this package.
+However, over time I've found myself wanting to use the routines of this package at a higher level and so have designed some user-level interfaces.
+This document documents those.
- To clarify some terminology used in this document (and more generally, this package), I regard paths as being composed of \emph{segments} and \emph{components}.
+To clarify some terminology used in this document (and more generally, this package), I regard paths as being composed of \emph{segments} and \emph{components}.
A \emph{segment} is a minimal drawing piece.
Thus it might be a straight line or a B\'ezier curve.
A \emph{component} is a minimal connected section of the path.
@@ -634,6 +636,24 @@ The ones that keep the middle need two parameters to specify the break points.
\end{function}
+\begin{function}{
+ arrow shortening
+}
+\begin{syntax}
+|arrow shortening|
+|arrow shortening=|\marg{true{\OriginalBar}false}
+\end{syntax}
+
+When an arrow is added to a path then the path is shortened so that the arrow tip is at the end of where the path should end up.
+Placing an arrow, therefore, has two effects: modifying the path and rendering the arrow.
+The former should happen before a soft path is manipulated, the latter afterwards.
+This key allows for the necessary separation to occur.
+Invoking it when the path is used disables the shortening at that juncture.
+
+Note that if the path (or its last segment) is very short then when the arrow is eventually placed it may end up pointing backwards.
+Fixing this is on the \emph{ToDo} list!
+\end{function}
+
\subsection{Exporting Paths}
There are two keys to export a path.
@@ -908,6 +928,21 @@ The intention with the second key is that it is similar to what happens with the
\end{tikzpicture}
\end{example}
+\begin{example}
+\begin{tikzpicture}[>=Latex, line width=5pt]
+% Just a simple line
+\draw (0,1) to[bend left] +(5,0);
+% Same line but with arrows, also save the path
+\draw[->.>, spath/save=arrow] (0,0) to[bend left] +(5,0);
+% Let's redraw that path without the arrows - it's short! But also distorted
+\draw[spath/use={arrow,transform={yshift=-1cm}}];
+% So if we redraw it with arrows it gets doubly shortened
+\draw[->.>,spath/use={arrow,transform={yshift=-2cm}}];
+% If we disable the shortening, the arrows end up in the right place
+\draw[->.>,spath/use={arrow,transform={yshift=-3cm}}, spath/arrow shortening=false];
+\end{tikzpicture}
+\end{example}
+
\item Intersections.
One of the main motivations for implementing the intersection routines was to provide a different way of drawing knots and links and similar diagrams.
diff --git a/graphics/pgf/contrib/spath3/spath3_code.dtx b/graphics/pgf/contrib/spath3/spath3_code.dtx
index 031c0e7bd3..3b0178db5a 100644
--- a/graphics/pgf/contrib/spath3/spath3_code.dtx
+++ b/graphics/pgf/contrib/spath3/spath3_code.dtx
@@ -5,7 +5,7 @@
%<*readme>
----------------------------------------------------------------
spath3 --- LaTeX3 functions for manipulating PGF soft paths
-E-mail: loopspace@mathforge.org
+E-mail: Andrew Stacey <loopspace@mathforge.org>
Released under the LaTeX Project Public License v1.3c or later
See http://www.latex-project.org/lppl.txt
----------------------------------------------------------------
@@ -27,7 +27,7 @@ As applications of its use, included are a package for drawing calligraphic path
\preamble
----------------------------------------------------------------
spath3 --- Functions for manipulating PGF soft paths
-E-mail: loopspace@mathforge.org
+E-mail: Andrew Stacey <loopspace@mathforge.org>
Released under the LaTeX Project Public License v1.3c or later
See http://www.latex-project.org/lppl.txt
----------------------------------------------------------------
@@ -35,7 +35,7 @@ See http://www.latex-project.org/lppl.txt
\endpreamble
\postamble
-Copyright (C) 2011-2021 by Andrew Stacey <loopspace@mathforge.org>
+Copyright (C) 2011-2024 by Andrew Stacey <loopspace@mathforge.org>
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License (LPPL), either
@@ -60,7 +60,7 @@ and the derived files spath3.ins,
calligraphy.pdf
knots.pdf
spath3.pdf
- README
+ README.txt
\endpostamble
\usedir{tex/latex/spath3}
@@ -143,7 +143,7 @@ and the derived files spath3.ins,
%</driver>
% \fi
%
-% \CheckSum{10189}
+% \CheckSum{10278}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -171,6 +171,7 @@ and the derived files spath3.ins,
% \changes{2.4}{2021/02/21}{Rejigged how the routines for using paths were implemented, added some more routines for joining paths.}
% \changes{2.6}{2021/11/23}{Modified core routines to cope with a "true rectangle" path; added routines for splitting at a parametrised point.}
% \changes{2.7}{2022/08/24}{Bug fixes}
+% \changes{2.8}{2024/05/31}{Routine to disable arrow shortening, bug fixes}
%
% \DoNotIndex{\newcommand,\newenvironment}
%
@@ -198,7 +199,7 @@ and the derived files spath3.ins,
% It was originally not really intended for use by end users but as a foundation on which other packages can be built.
% However, over the years I've found myself using it at ever higher levels and so a set of interfaces has been designed using TikZ keys.
%
-% It also provides the engine that drives a few other packages, such as the \Verb+calligraphy+, \Verb+knot+, and \Verb+penrose+ packages.
+% It also provides the engine that drives a few other packages, such as the \Verb+calligraphy+, \Verb+knot+, and \Verb+tilings+ (formerly, \Verb+penrose+) packages.
% The first two of these are subpackages of this one.
% The \Verb+calligraphy+ package simulates a calligraphic pen stroking a path.
% The \Verb+knots+ package can be used to draw knot (and similar) diagrams.
@@ -208,7 +209,7 @@ and the derived files spath3.ins,
% \begin{itemize}
% \item \Verb+calligraphy+
% \item \Verb+knots+
-% \item \Verb+penrose+
+% \item \Verb+tilings+
% \item \Verb+spath3+ (\emph{this} document is the code, there's another which focusses on usage)
% \end{itemize}
%
@@ -259,7 +260,7 @@ and the derived files spath3.ins,
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
\RequirePackage{pgf}
-\ProvidesExplPackage {spath3} {2022/08/24} {2.7} {Functions for
+\ProvidesExplPackage {spath3} {2024/05/31} {2.8} {Functions for
manipulating PGF soft paths}
\RequirePackage{xparse}
% \end{macrocode}
@@ -375,6 +376,13 @@ manipulating PGF soft paths}
\bool_new:N \l_spath_movetorelevant_bool
% \end{macrocode}
%
+% When manipulating soft paths, we might need to separate the shortening due to an arrow from when the path is rendered.
+%
+% \begin{macrocode}
+\bool_new:N \l_spath_arrow_shortening_bool
+\bool_set_true:N \l_spath_arrow_shortening_bool
+% \end{macrocode}
+%
% The intersection routine can't happen inside a group so we need two token lists to hold the paths that we'll intersect.
%
% \begin{macrocode}
@@ -457,7 +465,7 @@ manipulating PGF soft paths}
{
\tl_set:Nx \l_@@_tmpc_tl {\tl_head:N \l_@@_tmpa_tl}
\tl_set:Nx \l_@@_tmpa_tl {\tl_tail:N \l_@@_tmpa_tl}
- \tl_case:NnF \l_@@_tmpc_tl
+ \token_case_meaning:NnF \l_@@_tmpc_tl
{
\c_spath_moveto_tl
{
@@ -718,7 +726,7 @@ manipulating PGF soft paths}
\int_set:Nn \l_@@_tmpa_int {0}
\tl_map_inline:nn {#1} {
\tl_set:Nn \l_@@_tmpa_tl {##1}
- \tl_case:NnT \l_@@_tmpa_tl
+ \token_case_meaning:NnT \l_@@_tmpa_tl
{
\c_spath_lineto_tl {}
\c_spath_curveto_tl {}
@@ -763,7 +771,7 @@ manipulating PGF soft paths}
\int_set:Nn \l_@@_tmpa_int {0}
\tl_map_inline:nn {#1} {
\tl_set:Nn \l_@@_tmpa_tl {##1}
- \tl_case:Nn \l_@@_tmpa_tl
+ \token_case_meaning:Nn \l_@@_tmpa_tl
{
\c_spath_moveto_tl
{
@@ -910,7 +918,7 @@ manipulating PGF soft paths}
}
{
\tl_set:Nx \l_@@_tmpb_tl {\tl_head:N \l_@@_tmpa_tl}
- \tl_case:Nn \l_@@_tmpb_tl
+ \token_case_meaning:Nn \l_@@_tmpb_tl
{
\c_spath_moveto_tl
{
@@ -1102,7 +1110,7 @@ manipulating PGF soft paths}
}
{
\tl_set:Nx \l_@@_tmpb_tl {\tl_head:N \l_@@_tmpa_tl}
- \tl_case:Nn \l_@@_tmpb_tl
+ \token_case_meaning:Nn \l_@@_tmpb_tl
{
\c_spath_moveto_tl
{
@@ -1229,7 +1237,7 @@ manipulating PGF soft paths}
\tl_set:Nx \l_@@_tmpc_tl {\tl_head:N \l_@@_tmpa_tl}
\bool_set_false:N \l_@@_rect_bool
- \tl_case:NnTF \l_@@_tmpc_tl
+ \token_case_meaning:NnTF \l_@@_tmpc_tl
{
\c_spath_moveto_tl {
@@ -1679,8 +1687,8 @@ manipulating PGF soft paths}
\tl_clear:N \l_@@_tmpa_tl
\tl_put_right:Nn \l_@@_tmpa_tl {
\ExplSyntaxOn
- \tl_clear_new:N #1
- \tl_set:Nn #1 {#2}
+ \tl_gclear_new:N #1
+ \tl_gset:Nn #1 {#2}
\ExplSyntaxOff
}
\protected@write\@auxout{}{
@@ -3054,6 +3062,35 @@ manipulating PGF soft paths}
}
\cs_generate_variant:Nn \spath_gbake_shorten:N {c}
% \end{macrocode}
+%
+% Shortening the path when it is baked can cause issues with arrows.
+% Putting an arrow in a path definition affects the path because the path gets shortened so that the arrow ends where the path was meant to end.
+% So an arrow affects the path definition, but the arrow is not itself part of the path so if an arrow is used when the path is defined and again when the path is used, the path will be shortened twice which might not be what is intended.
+% Therefore it is useful to have a way to disable the shortening and place an arrow tip at the actual end of the line.
+% The following code achieves that.
+%
+% Save the original command that computes the arrow shortening.
+% \begin{macrocode}
+\cs_set_eq:Nc \@@_pgf_arrow_compute_shortening:n {pgf@arrow@compute@shortening}
+% \end{macrocode}
+%
+% After \verb+\pgf@arrow@compute@shortening+ then \verb+\pgf@xa+ is the amount to shorten the line by, so we will be setting that to 0pt.
+% Then \verb+\pgf@xb+ is the length of the arrow head which is used to position the arrow and so before zeroing \verb+\pgf@xa+ we subtract it from \verb+\pgf@xb+ so that the arrow is placed so that its back point is at the current position.
+%
+% \begin{macrocode}
+\cs_new_nopar:Npn \@@_arrow_compute_shortening:n #1
+{
+ \@@_pgf_arrow_compute_shortening:n {#1}
+ \bool_if:NF \l_spath_arrow_shortening_bool
+ {
+ \dim_sub:cn {pgf@xb} {\dim_use:c {pgf@xa}}
+ \dim_zero:c {pgf@xa}
+ }
+}
+
+\cs_set_eq:cN {pgf@arrow@compute@shortening} \@@_arrow_compute_shortening:n
+% \end{macrocode}
+%
% \end{macro}
%
% \begin{macro}[internal]{
@@ -3209,7 +3246,7 @@ manipulating PGF soft paths}
\tl_set:Nx \l_@@_tmpc_tl {\tl_head:N \l_@@_tmpa_tl}
\tl_set:Nx \l_@@_tmpa_tl {\tl_tail:N \l_@@_tmpa_tl}
- \tl_case:NnF \l_@@_tmpc_tl
+ \token_case_meaning:NnF \l_@@_tmpc_tl
{
\c_spath_closepath_tl {
@@ -3930,7 +3967,7 @@ manipulating PGF soft paths}
}
{
\tl_set:Nx \l_@@_tmpc_tl {\tl_head:N \l_@@_tmpa_tl}
- \tl_case:NnF \l_@@_tmpc_tl
+ \token_case_meaning:NnF \l_@@_tmpc_tl
{
\c_spath_curvetoa_tl
{
@@ -4225,7 +4262,7 @@ manipulating PGF soft paths}
{
\tl_set:Nx \l_@@_tmpf_tl {\tl_head:N \l_@@_tmpe_tl}
\tl_set:Nx \l_@@_tmpe_tl {\tl_tail:N \l_@@_tmpe_tl }
- \tl_case:Nn \l_@@_tmpf_tl
+ \token_case_meaning:Nn \l_@@_tmpf_tl
{
\c_spath_lineto_tl
{
@@ -4279,7 +4316,7 @@ manipulating PGF soft paths}
}
{
- \tl_case:Nn \l_@@_tmpf_tl
+ \token_case_meaning:Nn \l_@@_tmpf_tl
{
\c_spath_lineto_tl
{
@@ -5018,7 +5055,7 @@ manipulating PGF soft paths}
\tl_clear:N \l_@@_tmpc_tl
- \tl_case:Nn \l_@@_tmpb_tl
+ \token_case_meaning:Nn \l_@@_tmpb_tl
{
\c_spath_moveto_tl
{
@@ -5263,7 +5300,7 @@ manipulating PGF soft paths}
\tl_clear:N \l_@@_tmpc_tl
- \tl_case:Nn \l_@@_tmpb_tl
+ \token_case_meaning:Nn \l_@@_tmpb_tl
{
\c_spath_moveto_tl
{
@@ -6383,7 +6420,7 @@ manipulating PGF soft paths}
\tl_map_inline:nn {#1}
{
\tl_set:Nn \l_@@_tmpb_tl {##1}
- \tl_case:NnF \l_@@_tmpb_tl
+ \token_case_meaning:NnF \l_@@_tmpb_tl
{
\c_spath_moveto_tl
{
@@ -6516,10 +6553,14 @@ manipulating PGF soft paths}
\cs_new_protected_nopar:Npn \spath_protocol_path:n #1
{
\spath_minbb:Nn \l_@@_tmpa_tl {#1}
- \exp_last_unbraced:NV \pgf@protocolsizes\l_@@_tmpa_tl
+ \dim_set:Nn \l_@@_tmpa_dim {\tl_item:Nn \l_@@_tmpa_tl {1}}
+ \dim_set:Nn \l_@@_tmpb_dim {\tl_item:Nn \l_@@_tmpa_tl {2}}
+ \pgf@protocolsizes\l_@@_tmpa_dim\l_@@_tmpb_dim
\spath_maxbb:Nn \l_@@_tmpa_tl {#1}
- \exp_last_unbraced:NV \pgf@protocolsizes\l_@@_tmpa_tl
+ \dim_set:Nn \l_@@_tmpa_dim {\tl_item:Nn \l_@@_tmpa_tl {1}}
+ \dim_set:Nn \l_@@_tmpb_dim {\tl_item:Nn \l_@@_tmpa_tl {2}}
+ \pgf@protocolsizes\l_@@_tmpa_dim\l_@@_tmpb_dim
}
\cs_generate_variant:Nn \spath_protocol_path:n {V}
% \end{macrocode}
@@ -6880,7 +6921,7 @@ manipulating PGF soft paths}
}
}
{
- \msg_warning:nnn { spath3 } { missing soft path } { #2 }
+ \msg_warning:nnx { spath3 } { missing soft path } { #2 }
}
\tl_use:N \l_@@_check_tl
}
@@ -9027,12 +9068,8 @@ manipulating PGF soft paths}
% This puts a conditional around the \texttt{spot weld} key because when figuring out a knot drawing then we will initially want to render it without the spot weld to keep the number of components constant.
%
% \begin{macrocode}
- draft~ mode/.is~ choice,
- draft~ mode/true/.code={
- \bool_set_true:N \l_@@_draft_bool
- },
- draft~ mode/false/.code={
- \bool_set_false:N \l_@@_draft_bool
+ draft~ mode/.code={
+ \@@_set_bool:Nn \l_@@_draft_bool {#1}
},
maybe~ spot~ weld/.code={
\bool_if:NF \l_@@_draft_bool
@@ -9113,6 +9150,12 @@ manipulating PGF soft paths}
},
% \end{macrocode}
%
+% \begin{macrocode}
+ arrow~ shortening/.code={
+ \@@_set_bool:Nn \l_spath_arrow_shortening_bool {#1}
+ },
+% \end{macrocode}
+%
% For single argument commands which take a path as their argument, set the default to be \Verb+current+ so that they use the current path.
%
% \begin{macrocode}
@@ -9616,7 +9659,7 @@ manipulating PGF soft paths}
\dim_set:Nn \l_@@_tmpb_dim {\tl_item:Nn \l_@@_tmpa_tl {3}}
\tl_set:Nx \l_@@_tmpb_tl {\tl_item:Nn \l_@@_tmpa_tl {4}}
- \tl_case:NnF \l_@@_tmpb_tl
+ \token_case_meaning:NnF \l_@@_tmpb_tl
{
\c_spath_lineto_tl
{
@@ -9668,7 +9711,7 @@ manipulating PGF soft paths}
\dim_set:Nn \l_@@_tmpb_dim {\tl_item:Nn \l_@@_tmpa_tl {-1}}
\tl_set:Nx \l_@@_tmpb_tl {\tl_item:Nn \l_@@_tmpa_tl {-3}}
- \tl_case:NnF \l_@@_tmpb_tl
+ \token_case_meaning:NnF \l_@@_tmpb_tl
{
\c_spath_lineto_tl
{
@@ -10411,6 +10454,15 @@ manipulating PGF soft paths}
}
}
+\cs_new_nopar:Npn \knot_show_strand:n #1
+{
+ \bool_if:NT \l_@@_debugging_bool
+ {
+ \iow_term:n {===Knot~ debug: #1===}
+ \spath_show:v {knot #1}
+ }
+}
+
\cs_generate_variant:Nn \knot_debug:n {x}
% \end{macrocode}
% \end{macro}
@@ -10592,6 +10644,7 @@ manipulating PGF soft paths}
knot~ diagram/only~ when~ rendering/.try,
only~ when~ rendering/.try,
}
+ \knot_show_strand:n {strand #1}
\spath_tikz_path:Vv \l_@@_tmpa_tl {knot strand #1}
\group_end:
\endpgfscope
@@ -10629,6 +10682,7 @@ manipulating PGF soft paths}
}
{
\tl_clear:N \l_@@_tmpa_tl
+ \spath_remove_empty_components:c {knot strand #1}
\spath_initialpoint:Nv \l_@@_tmpa_tl {knot strand #1}
\tl_put_left:NV \l_@@_tmpa_tl \c_spath_moveto_tl
\spath_segments_to_seq:Nv \l_@@_segments_seq {knot strand #1}
@@ -10649,7 +10703,7 @@ manipulating PGF soft paths}
{
\knot_debug:n {knot~ split~ self~ intersects}
\tl_set:Nx \l_@@_tmpc_tl {\tl_item:nn {#1} {4}}
- \tl_case:NnF \l_@@_tmpc_tl
+ \token_case_meaning:NnF \l_@@_tmpc_tl
{
\c_spath_curvetoa_tl
{
@@ -11271,6 +11325,7 @@ manipulating PGF soft paths}
\int_set_eq:NN \l_@@_component_start_int \g_@@_filaments_int
\int_incr:N \l_@@_component_start_int
\tl_set_eq:Nc \l_@@_tmpa_tl {l_@@_options_strand #1}
+ \spath_remove_empty_components:c {knot strand #1}
\spath_segments_to_seq:Nv \l_@@_segments_seq {knot strand #1}
\seq_map_function:NN \l_@@_segments_seq \knot_save_filament:N
}
@@ -11284,7 +11339,7 @@ manipulating PGF soft paths}
{
\knot_debug:n {knot~ save~ filament}
\tl_set:Nx \l_@@_tmpb_tl {\tl_item:nn {#1} {4}}
- \tl_case:NnF \l_@@_tmpb_tl
+ \token_case_meaning:NnF \l_@@_tmpb_tl
{
\c_spath_moveto_tl
{
diff --git a/graphics/pgf/contrib/spath3/spath3_code.pdf b/graphics/pgf/contrib/spath3/spath3_code.pdf
index f773a0b534..840b7842d3 100644
--- a/graphics/pgf/contrib/spath3/spath3_code.pdf
+++ b/graphics/pgf/contrib/spath3/spath3_code.pdf
Binary files differ
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..03f337aee4
--- /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..579a131c33
--- /dev/null
+++ b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-fr.tex
@@ -0,0 +1,1661 @@
+% !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.2}
+\def\TPdate{31/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,bbox} ;
+ \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 la 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{Tracer une droite}\label{tracdroite}
+
+L'idée est de proposer une commande pour tracer une droite, à partir :
+
+\begin{itemize}
+ \item de deux points (ou nœuds) ;
+ \item d'un point (ou nœud) et de la pente.
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%dans l'environnement GraphiqueTikz
+\TracerDroite[clés]{point ou nœud}{point ou noeud ou pente}
+\end{tcblisting}
+
+Les \MontreCode{[clés]}, optionnelles, disponibles sont :
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Nom} : nom éventuel du tracé (pour réutilisation) ;
+ \item \MontreCode{Pente} : booléen pour préciser que la pente est utilisée (\MontreCode{false} par défaut) ;
+ \item \MontreCode{Debut} : début du tracé (\MontreCode{\textbackslash pflxmin} par défaut) ;
+ \item \MontreCode{Fin} : fin du tracé (\MontreCode{\textbackslash pflxmax} par défaut) ;
+ \item \MontreCode{Couleur} : couleur du tracé (\MontreCode{black} par défaut).
+\end{itemize}
+
+\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]{auto}{auto}
+ \DefinirPts[Aff,Couleur=gray]{A/-4/3,B/2/0,C/0/-1}
+ \TracerDroite[Couleur=red]{(-2,-1)}{(2,4)}
+ \TracerDroite[Couleur=blue,Debut=-5,Fin=3]{(A)}{(B)}
+ \TracerDroite[Couleur=olive,Pente]{(C)}{(0.25)}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Définir une fonction, tracer la courbe d'une fonction}\label{deftracfct}
+
+L'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{Extremums}\label{maximum}\label{minimum}
+
+L'idée (encore \textit{expérimentale}) est de proposer des commandes pour extraire les extremums d'une courbe définie par le package.
+
+La commande crée le nœud correspondant, et il est du coup possible de récupérer ses coordonnées pour exploitation ultérieure.
+
+\smallskip
+
+Il est possible, en le spécifiant, de travailler sur les différentes courbes gérées par le package (fonction, interpolation, spline).
+
+Pour des courbes singulières, il est possible que les résultats ne soient pas tout à fait ceux attendus\ldots
+
+\smallskip
+
+{\small\faBomb} Pour le moment, les \textit{limitations} sont :
+
+\begin{itemize}
+ \item pas de gestion d'extremums multiples (seul le premier sera traité)\ldots
+ \item pas de gestion d'extremums aux bornes du tracé\ldots
+ \item pas de récupération automatique des paramètres de définition des courbes\ldots
+ \item le temps de compilation peut être plus long\ldots
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%dans l'environnement GraphiqueTikz
+\TrouverMaximum[clés]{objet}[nœud créé]
+\TrouverMinimum[clés]{objet}[nœud créé]
+\end{tcblisting}
+
+Les \MontreCode{[clés]}, optionnelles, disponibles sont :
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Methode} : méthode, parmi \MontreCode{fonction/interpo/spline} pour les calculs (\MontreCode{fonction} par défaut) ;
+ \item \MontreCode{Debut} : début du tracé (\MontreCode{\textbackslash pflxmin} par défaut) ;
+ \item \MontreCode{Fin} : fin du tracé (\MontreCode{\textbackslash pflxmax} par défaut) ;
+ \item \MontreCode{Pas} : pas du tracé si \MontreCode{fonction} (il est déterminé \textit{automatiquement} au départ mais peut être modifié) ;
+ \item \MontreCode{Coeffs} : modifier les \textit{coefficients} du spline si \MontreCode{spline} ;
+ \item \MontreCode{Tension} : paramétrage de la \textit{tension} du tracé d'interpolation si \MontreCode{interpo}(\MontreCode{0.5} par défaut).
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}[x=1cm,y=1cm,Xmin=-1,Xmax=5,Ymin=-1,Ymax=3]
+ \TracerAxesGrilles[Elargir=2.5mm]{auto}{auto}
+ \DefinirCourbe[Nom=cf,Debut=0.35,Fin=4.2,Trace]%
+ <f>{0.6*cos(4.5*(x-4)+2.1)-1.2*sin(x-4)+0.1*x+0.2}
+ \TrouverMaximum[Debut=0.35,Fin=4.2]{f}[cf-max]
+ \TrouverMaximum[Debut=3,Fin=4]{f}[cf-maxlocal]
+ \TrouverMinimum[Debut=1,Fin=2]{f}[cf-minlocal]
+ \MarquerPts*[Couleur=red,Traits]{(cf-max)}
+ \MarquerPts*[Couleur=blue,Traits]{(cf-maxlocal)}
+ \MarquerPts*[Couleur=olive,Traits]{(cf-minlocal)}
+ \RecupererCoordonnees{(cf-max)}[\MonMaxX][\MonMaxY]
+\end{GraphiqueTikz}\\
+Le maximum est $M\approx\ArrondirNum{\MonMaxY}$, atteint en $x\approx\ArrondirNum{\MonMaxX}$
+\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}
+ \DefinirCourbeInterpo[Nom=interpotest,Couleur=red,Trace,Tension=1]%
+ {(-6,4)(-2,-2)(3,3.5)}
+ \TrouverMinimum[Methode=interpo,Tension=1]{(-6,4)(-2,-2)(3,3.5)}[interpo-min]
+ \MarquerPts*[Couleur=blue]{(interpo-min)}
+ \RecupererCoordonnees{(interpo-min)}[\MinInterpoX][\MinInterpoY]
+\end{GraphiqueTikz}\\
+Le minimum est $M\approx\ArrondirNum[3]{\MinInterpoY}$, atteint en $x\approx\ArrondirNum[3]{\MinInterpoX}$
+\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[Elargir=2.5mm]{auto}{auto}
+ \def\LISTETEST{-6/2/0§-1/-2/0§2/1/0§3.5/0/-1}
+ \DefinirCourbeSpline[Nom=splinetest,Trace]{\LISTETEST}
+ \TrouverMinimum[Methode=spline]{\LISTETEST}[spline-min]
+ \MarquerPts*[Couleur=red]{(spline-min)}
+\end{GraphiqueTikz}
+\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{tracé droite~~~}{\TracerDroite}{tracdroite}
+ \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{maximum~~~~~~~~}{\TrouverMaximum}{maximum}
+ \lstcmd{minimum~~~~~~~~}{\TrouverMinimum}{minimum}
+ \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 : Droites + Extremums
+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..8fa5917f56
--- /dev/null
+++ b/graphics/pgf/contrib/tkz-grapheur/tex/tkz-grapheur.sty
@@ -0,0 +1,1888 @@
+% 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/31 0.1.2 Des outils en TikZ pour travailler comme avec un grapheur]
+
+%====HISTORIQUE
+% v 0.1.2 Max/Min + Droites
+% 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,bbox}
+\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,%
+ Traits=false
+}
+\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} {%
+ \ifboolKV[GraphiqueTikzMarkPoints]{Traits}%
+ {%
+ \draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}}] \Point pic{pflptcroix={\useKV[GraphiqueTikzMarkPoints]{Taillex}}/45} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{+}%
+ {%
+ \foreach \Point in {#4} {%
+ \ifboolKV[GraphiqueTikzMarkPoints]{Traits}%
+ {%
+ \draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}}] \Point pic{pflptcroix={\useKV[GraphiqueTikzMarkPoints]{Taillex}}/90} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{c}%
+ {%
+ \foreach \Point in {#4} {%
+ \ifboolKV[GraphiqueTikzMarkPoints]{Traits}%
+ {%
+ \draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \filldraw[draw=none,fill={\useKV[GraphiqueTikzMarkPoints]{Couleur}}] \Point pic{pflptcarre={\useKV[GraphiqueTikzMarkPoints]{Taillec}}/0} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{d}%
+ {%
+ \foreach \Point in {#4} {%
+ \ifboolKV[GraphiqueTikzMarkPoints]{Traits}%
+ {%
+ \draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \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} {%
+ \ifboolKV[GraphiqueTikzMarkPoints]{Traits}%
+ {%
+ \draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \filldraw[pfltrait,fill=\pflcouleurpointsB,draw=\pflcouleurpointsA] \Point circle[radius={\useKV[GraphiqueTikzMarkPoints]{Tailleo}}] ;
+ }%
+ }%
+ {%
+ \foreach \Point in {#4} {%
+ \ifboolKV[GraphiqueTikzMarkPoints]{Traits}%
+ {%
+ \draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \filldraw[\pflcouleurpoints] \Point circle[radius={\useKV[GraphiqueTikzMarkPoints]{Tailleo}}] ;
+ }%
+ }%
+ }%
+ {}%
+ }%
+ {%avec label
+ \IfStrEq{\pflstylepoints}{x}%
+ {%
+ \foreach \Point/\Label/\Pos in {#4} {%
+ \ifboolKV[GraphiqueTikzMarkPoints]{Traits}%
+ {%
+ \draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}}] \Point pic{pflptcroix={\useKV[GraphiqueTikzMarkPoints]{Taillex}}/45} node[\Pos,font=#3] {\Label} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{+}%
+ {%
+ \foreach \Point/\Label/\Pos in {#4} {%
+ \ifboolKV[GraphiqueTikzMarkPoints]{Traits}%
+ {%
+ \draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \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} {%
+ \ifboolKV[GraphiqueTikzMarkPoints]{Traits}%
+ {%
+ \draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \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} {%
+ \ifboolKV[GraphiqueTikzMarkPoints]{Traits}%
+ {%
+ \draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \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} {%
+ \ifboolKV[GraphiqueTikzMarkPoints]{Traits}%
+ {%
+ \draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \draw[pfltrait,\pflcouleurpointsA,fill=\pflcouleurpointsB] \Point circle[radius={\useKV[GraphiqueTikzMarkPoints]{Tailleo}}] node[\Pos,font=#3] {\Label} ;
+ }%
+ }%
+ {%
+ \foreach \Point/\Label/\Pos in {#4} {%
+ \ifboolKV[GraphiqueTikzMarkPoints]{Traits}%
+ {%
+ \draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \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}
+}
+
+%====droite
+\defKV[GraphiquetikzDroite]{%
+ Nom=\def\pfldroitename{#1}
+}
+
+\setKVdefault[GraphiquetikzDroite]{%
+ Pente=false,%
+ Couleur=black,%
+ Debut={\pflxmin},%
+ Fin={\pflxmax},%
+ Nom={}
+}
+
+\NewDocumentCommand\TracerDroite{ O{} m m D<>{} }{%
+ \restoreKV[GraphiquetikzDroite]%
+ \setKV[GraphiquetikzDroite]{#1}%
+ %1er point
+ \path #2;%
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\pfldtetikzxA{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}%
+ \xdef\pfldtetikzyA{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}%
+ %2ème point si besoin
+ \ifboolKV[GraphiquetikzDroite]{Pente}%
+ {%
+ \xdef\pfldtepente{\xintfloateval{#3}}%
+ }%
+ {%
+ \path #3;%
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\pfldtetikzxB{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}%
+ \xdef\pfldtetikzyB{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}%
+ \xdef\pfldtepente{\xintfloateval{(\pfldtetikzyB-\pfldtetikzyA)/(\pfldtetikzxB-\pfldtetikzxA)}}%
+ }%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ;
+ \xintifboolexpr{\pfldtetikzxA == \pfldtetikzxB}%
+ {%
+ \IfEq{\pfldroitename}{}%
+ {%
+ \draw[pfltrait,{\useKV[GraphiquetikzDroite]{Couleur}},#4] (\pfldtetikzxA,\pflymin) -- (\pfldtetikzxA,\pflymax) ;
+ }%
+ {%
+ \draw[pfltrait,{\useKV[GraphiquetikzDroite]{Couleur}},#4,name path global=\pfldroitename] (\pfldtetikzxA,\pflymin) -- (\pfldtetikzxA,\pflymax) ;
+ }%
+ }%
+ {%
+ \IfEq{\pfldroitename}{}%
+ {%
+ \draw[pfltrait,{\useKV[GraphiquetikzDroite]{Couleur}},domain={\useKV[GraphiquetikzDroite]{Debut}}:{\useKV[GraphiquetikzDroite]{Fin}},samples=2,#4] plot (\x,{\pfldtepente*(\x-\pfldtetikzxA)+\pfldtetikzyA}) ;
+ }%
+ {%
+ \draw[pfltrait,{\useKV[GraphiquetikzDroite]{Couleur}},domain={\useKV[GraphiquetikzDroite]{Debut}}:{\useKV[GraphiquetikzDroite]{Fin}},samples=2,name path global=\pfldroitename,#4] plot (\x,{\pfldtepente*(\x-\pfldtetikzxA)+\pfldtetikzyA}) ;
+ }%
+ }%
+ \end{scope}
+}
+
+\defKV[GraphiqueTikzMinMax]{%
+ Pas=\def\pflminmaxstep{#1},%
+ Methode=\def\pflminmaxmethode{#1},%
+ Coeffs=\def\pflminmaxcoeffs{#1}
+}
+\setKVdefault[GraphiqueTikzMinMax]{%
+ Debut={\pflxmin},%
+ Fin={\pflxmax},%
+ Pas={},%
+ Tension=0.5,%
+ Methode=fonction,%
+ Coeffs=3
+}
+
+\NewDocumentCommand\TrouverMaximum{ O{} m O{c-max} }{%
+ %1=clés
+ %2=paramètres en fonction de [Methode]
+ \restoreKV[GraphiqueTikzMinMax]%
+ \setKV[GraphiqueTikzMinMax]{#1}%
+ \IfStrEq{\pflstepcurve}{}%
+ {%
+ \xdef\pflminmaxstep{\xintfloateval{((\useKV[GraphiqueTikzMinMax]{Fin})-(\useKV[GraphiqueTikzMinMax]{Debut}))/100}}%
+ }%
+ {}%
+ \begin{scope}[bezier bounding box,local bounding box=bbtmpmax]
+ \IfStrEq{\pflminmaxmethode}{fonction}%
+ {%
+ \path[draw=none,name path=curvetmpmax] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphiqueTikzMinMax]{Debut}}..[\pflstepcurve]..{\useKV[GraphiqueTikzMinMax]{Fin}},{\useKV[GraphiqueTikzMinMax]{Fin}})
+ \relax
+ };
+ }%
+ {}%
+ \IfStrEq{\pflminmaxmethode}{interpo}%
+ {%
+ \path[draw=none,name path=curvetmpmax] plot[smooth,tension={\useKV[GraphiqueTikzMinMax]{Tension}}] coordinates {#2};
+ }%
+ {}%
+ \IfStrEq{\pflminmaxmethode}{spline}%
+ {%
+ \GenererSpline{#2}{\pflminmaxcoeffs}[\tmpsplineminmax]%
+ \path[draw=none,name path=curvetmpmax] \tmpsplineminmax ;
+ }%
+ {}%
+ %retour
+ \path[name path=tmpmax] ([yshift=-0.25\pgflinewidth]bbtmpmax.north east) -- ([yshift=-0.25\pgflinewidth]bbtmpmax.north west) ;
+ \path[name intersections={of=curvetmpmax and tmpmax,name=#3}] ;
+ \coordinate (#3) at ($0.5*(#3-1)+0.5*(#3-2)+(0,0.25\pgflinewidth)$) ;
+ \end{scope}
+}
+
+\NewDocumentCommand\TrouverMinimum{ O{} m O{c-min} }{%
+ %1=clés
+ %2=paramètres en fonction de [Methode]
+ \restoreKV[GraphiqueTikzMinMax]%
+ \setKV[GraphiqueTikzMinMax]{#1}%
+ \IfStrEq{\pflstepcurve}{}%
+ {%
+ \xdef\pflminmaxstep{\xintfloateval{((\useKV[GraphiqueTikzMinMax]{Fin})-(\useKV[GraphiqueTikzMinMax]{Debut}))/100}}%
+ }%
+ {}%
+ \begin{scope}[bezier bounding box,local bounding box=bbtmpmin]
+ \IfStrEq{\pflminmaxmethode}{fonction}%
+ {%
+ \path[draw=none,name path=curvetmpmin] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphiqueTikzMinMax]{Debut}}..[\pflstepcurve]..{\useKV[GraphiqueTikzMinMax]{Fin}},{\useKV[GraphiqueTikzMinMax]{Fin}})
+ \relax
+ };
+ }%
+ {}%
+ \IfStrEq{\pflminmaxmethode}{interpo}%
+ {%
+ \path[draw=none,name path=curvetmpmin] plot[smooth,tension={\useKV[GraphiqueTikzMinMax]{Tension}}] coordinates {#2};
+ }%
+ {}%
+ \IfStrEq{\pflminmaxmethode}{spline}%
+ {%
+ \GenererSpline{#2}{\pflminmaxcoeffs}[\tmpsplineminmax]%
+ \path[draw=none,name path=curvetmpmin] \tmpsplineminmax ;
+ }%
+ {}%
+ %retour
+ \path[name path=tmpmin] ([yshift=0.25\pgflinewidth]bbtmpmin.south east) -- ([yshift=0.25\pgflinewidth]bbtmpmin.south west) ;
+ \path[name intersections={of=curvetmpmin and tmpmin,name=#3}] ;
+ \coordinate (#3) at ($0.5*(#3-1)+0.5*(#3-2)+(0,-0.25\pgflinewidth)$) ;
+ \end{scope}
+}
+
+\endinput \ No newline at end of file