summaryrefslogtreecommitdiff
path: root/graphics/pgf
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pgf')
-rw-r--r--graphics/pgf/contrib/argumentation/README.md2
-rw-r--r--graphics/pgf/contrib/argumentation/argumentation-doc.pdfbin275801 -> 307239 bytes
-rw-r--r--graphics/pgf/contrib/argumentation/argumentation-doc.tex888
-rw-r--r--graphics/pgf/contrib/argumentation/argumentation.sty227
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/changelog.tex29
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdfbin13862 -> 13867 bytes
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.pdfbin2422724 -> 2431321 bytes
-rw-r--r--graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex65
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/circuitikz.sty4
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex151
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcirctripoles.tex24
-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/pgfgantt/README17
-rw-r--r--graphics/pgf/contrib/pgfgantt/pgfgantt-doc.pdfbin0 -> 661617 bytes
-rw-r--r--graphics/pgf/contrib/pgfgantt/pgfgantt.dtx348
-rw-r--r--graphics/pgf/contrib/pgfgantt/pgfgantt.ins11
-rw-r--r--graphics/pgf/contrib/pgfgantt/pgfgantt.pdfbin941473 -> 0 bytes
-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-en.pdfbin0 -> 746493 bytes
-rw-r--r--graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-en.tex1712
-rw-r--r--graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-fr.pdfbin0 -> 804095 bytes
-rw-r--r--graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-fr.tex1810
-rw-r--r--graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-examples-integrals.pdfbin0 -> 141889 bytes
-rw-r--r--graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-examples-integrals.tex251
-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.sty4064
74 files changed, 18706 insertions, 1267 deletions
diff --git a/graphics/pgf/contrib/argumentation/README.md b/graphics/pgf/contrib/argumentation/README.md
index 3e6a97e5ec..b0df71dbd0 100644
--- a/graphics/pgf/contrib/argumentation/README.md
+++ b/graphics/pgf/contrib/argumentation/README.md
@@ -4,5 +4,5 @@ The argumentation package provides utility to create abstract argumentation fram
For bug reports and feedback, please contact:
Lars Bengel <lars.bengel@fernuni-hagen.de>
-Version: 1.1 [2023/12/03]
+Version: 1.2 [2024/06/07]
This package is subject to the LaTeX Project Public License 1.3c \ No newline at end of file
diff --git a/graphics/pgf/contrib/argumentation/argumentation-doc.pdf b/graphics/pgf/contrib/argumentation/argumentation-doc.pdf
index 39c89e37e3..48f396a1fe 100644
--- a/graphics/pgf/contrib/argumentation/argumentation-doc.pdf
+++ b/graphics/pgf/contrib/argumentation/argumentation-doc.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/argumentation/argumentation-doc.tex b/graphics/pgf/contrib/argumentation/argumentation-doc.tex
index 128765d43c..d524e50afd 100644
--- a/graphics/pgf/contrib/argumentation/argumentation-doc.tex
+++ b/graphics/pgf/contrib/argumentation/argumentation-doc.tex
@@ -2,7 +2,7 @@
\title{The \argumentation Package}
\author{Lars Bengel\footnote{Please report any issues at \url{https://github.com/aig-hagen/tikz_argumentation}}\\\small lars.bengel@fernuni-hagen.de}
-\date{Version 1.1 [2023/12/03]}
+\date{Version 1.2 [2024/06/07]}
%%%%%%%%% IMPORTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[]{argumentation} % Main Package
@@ -12,6 +12,8 @@
\usepackage[hidelinks]{hyperref} % Hyperlinks
\usepackage{subcaption} % For two-part figures
+%%% Various commands used in the document
+\newcommand{\todo}[1]{\textcolor{magenta}{TODO: #1}} % for todos
\newcommand{\tikzname}{Ti\emph{k}Z\xspace}
\newcommand{\argumentation}{\texttt{argumentation}\xspace}
\newcommand{\opt}[2][red]{\ensuremath{\textcolor{#1}{\langle #2\rangle}}}
@@ -21,43 +23,135 @@
\begin{document}
\maketitle
+\begin{minipage}{.28\textwidth}
+ \centering
+ \begin{af}
+ \argument{$a$}
+ \argument[right=of a1]{$b$}
+ \argument[below=of a1]{$c$}
+ \argument[right=of a3]{$d$}
+
+ \attack{a1}{a2}
+ \attack{a2}{a3}
+ \attack[bend right]{a3}{a4}
+ \end{af}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+ \begin{verbatim}
+ \begin{af}
+ \argument{$a$}
+ \argument[right=of a1]{$b$}
+ \argument[below=of a1]{$c$}
+ \argument[right=of a3]{$d$}
+
+ \attack{a1}{a2}
+ \attack{a2}{a3}
+ \attack[bend right]{a3}{a4}
+ \end{af}
+ \end{verbatim}
+\end{minipage}
+
+
\tableofcontents
\newpage
-\section{Example}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Quick Guide}\label{sec:quick}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\noindent
+To create an argumentation framework in your \LaTeX document, you have to import the \argumentation package:\\
+
+\vspace{-0.3cm}
+\verb|\usepackage{argumentation}|\\
+
+\noindent
+You can then create a new \texttt{af} environment in which the argumentation framework can then be built:\\
+
+\vspace{-0.3cm}
+\verb|\begin{af}|
+
+\quad\opt[green]{environment~content}
+
+\verb|\end{af}|\\
+
+\noindent
+You may want to wrap the \texttt{af} environment in a \texttt{figure} environment in order to add a caption and reference label.
+The easiest way to create an argument in the argumentation framework is:\\
+
+\vspace{-0.3cm}
+\verb|\argument{|\opt{name}\verb|}|\\
+
+\noindent
+Here, \opt{name} is the name of the argument displayed in the graph and the argument is automatically assigned an \emph{identifier} of the form: $a1$, $a2$, \dots.
+
+To properly add further arguments, you also need to specify a position.
+The \argumentation package offers two easy ways of doing that:\\
+
+\vspace{-0.3cm}
+\verb|\argument[|\opt{dir}\verb|=of |\opt{arg\_id}\verb|]{|\opt{name}\verb|}|
+
+\verb|\argument{|\opt{name}\verb|}| \verb|at (|\opt{posX},\opt{posY}\verb|)|\\
+
+\noindent
+The first instance is \emph{relative position} where \opt{dir} is the direction of placement relative to the argument with the identifier \opt{arg\_id}, with \opt{dir} typically being one of the values: \textsf{right}, \textsf{left}, \textsf{above}, \textsf{below}.
+
+The second instance is \emph{absolute positioning} where (\opt{posX}, \opt{posY}) is a set of coordinates, for example something like $(2, 0)$, $(0, -2)$ or $(2, 4)$.\\
+
+\noindent
+To create an attack between two arguments, you simply use the command:\\
+
+\vspace{-0.3cm}
+\verb|\attack{|\opt{a1}\verb|}{|\opt{a2}\verb|}|\\
+
+\noindent
+Substitute \opt{a1} and \opt{a2} with the identifier of the two arguments.
+Alternatively, you can also directly create bidirectional attacks and self-attacks with the following two commands:\\
+
+\vspace{-0.3cm}
+\verb|\dualattack{|\opt{a1}\verb|}{|\opt{a2}\verb|}|
+
+\verb|\selfattack{|\opt{a1}\verb|}|\\
+
+\noindent
+To customize the look of the arguments and attacks and for a detailed overview over all options and commands provided by this package, please refer to the following example or to the full documentation in Section~\ref{sec:documentation}.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\newpage\section{Example}\label{sec:example}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\vspace{-0.7cm}
\begin{figure}[ht]
\centering
\begin{af}
- \argument{args1}{a}
- \argument[right=of args1]{args2}{b}
- \argument[right=of args2]{args3}{c}
- \argument[right=of args3]{args4}{d}
- \argument[right=of args4,incomplete]{args5}{e}
- \argument[below=of args1]{args6}{f}
- \argument[inactive,right=of args6]{args7}{g}
- \argument[inactive,argin,right=of args7]{args8}{h}
- \argument[right=of args8]{args9}{i}
- \argument[right=of args9]{args10}{j}
-
- %\annotation[right]{args5}{$a\lor b$}
-
- \afname[left of=args1,yshift=-0.8cm,xshift=-0.2cm]{cap}{\textbf{F:}}
-
- \selfattack{args1}
- \dualattack{args1}{args6}
- \dualattack[inactive]{args6}{args7}
+ \argument{a}
+ \argument[right=of a1]{b}
+ \argument[right=of a2]{c}
+ \argument[right=of a3]{d}
+ \argument[right=of a4,incomplete]{e}
+ \argument[below=of a1]{f}
+ \argument[inactive,right=of a6]{g}
+ \argument[inactive,argin,right=of a7]{h}
+ \argument[right=of a8]{i}
+ \argument[right=of a9]{j}
+
+ %\annotation[right]{a5}{$a\lor b$}
+
+ \afname[left of=a1,yshift=-0.8cm,xshift=-0.2cm]{\textbf{F:}}
+
+ \selfattack{a1}
+ \dualattack{a1}{a6}
+ \dualattack[inactive]{a6}{a7}
- \attack[inactive]{args8}{args7}
- \attack[inactive]{args7}{args2}
- \annotatedattack{args3}{args2}{$3$}
- \attack[incomplete]{args4}{args5}
- \attack{args5}{args10}
- \attack{args10}{args9}
- \attack{args9}{args4}
-
- \support{args4}{args3}
- \support{args9}{args3}
+ \attack[inactive]{a8}{a7}
+ \attack[inactive]{a7}{a2}
+ \annotatedattack{a3}{a2}{$3$}
+ \attack[incomplete]{a4}{a5}
+ \attack{a5}{a10}
+ \attack{a10}{a9}
+ \attack{a9}{a4}
+
+ \support{a4}{a3}
+ \support{a9}{a3}
\end{af}
\caption{An exemplary AF created with the \argumentation package.}
\label{fig:example}
@@ -68,95 +162,170 @@
\begin{figure}[ht]
\centering
\begin{af}
- \argument{args1}{a}
- \argument[right=of args1]{args2}{b}
- \argument[right=of args2]{args3}{c}
- \argument[right=of args3]{args4}{d}
- \argument[right=of args4,incomplete]{args5}{e}
- \argument[below=of args1]{args6}{f}
- \argument[inactive,right=of args6]{args7}{g}
- \argument[inactive,argin,right=of args7]{args8}{h}
- \argument[right=of args8]{args9}{i}
- \argument[right=of args9]{args10}{j}
-
- \afname[left of=args1,yshift=-0.8cm,xshift=-0.2cm]{cap}{\textbf{F:}}
-
- \selfattack{args1}
- \dualattack{args1}{args6}
- \dualattack[inactive]{args6}{args7}
+ \argument{a}
+ \argument[right=of a1]{b}
+ \argument[right=of a2]{c}
+ \argument[right=of a3]{d}
+ \argument[right=of a4,incomplete]{e}
+ \argument[below=of a1]{f}
+ \argument[inactive,right=of a6]{g}
+ \argument[inactive,argin,right=of a7]{h}
+ \argument[right=of a8]{i}
+ \argument[right=of a9]{j}
+
+ \afname[left of=a1,yshift=-0.8cm,xshift=-0.2cm]{\textbf{F:}}
+
+ \selfattack{a1}
+ \dualattack{a1}{a6}
+ \dualattack[inactive]{a6}{a7}
- \attack[inactive]{args8}{args7}
- \attack[inactive]{args7}{args2}
- \annotatedattack{args3}{args2}{$3$}
- \attack[incomplete]{args4}{args5}
- \attack{args5}{args10}
- \attack{args10}{args9}
- \attack{args9}{args4}
-
- \support{args4}{args3}
- \support{args9}{args3}
+ \attack[inactive]{a8}{a7}
+ \attack[inactive]{a7}{a2}
+ \annotatedattack{a3}{a2}{$3$}
+ \attack[incomplete]{a4}{a5}
+ \attack{a5}{a10}
+ \attack{a10}{a9}
+ \attack{a9}{a4}
+
+ \support{a4}{a3}
+ \support{a9}{a3}
\end{af}
\caption{An exemplary AF created with the \argumentation package.}
\label{fig:example}
\end{figure}
\end{verbatim}
-\section{Documentation for Version 1.1 [2023/12/03]}
-In the following, we give an overview over the functionality of the \argumentation package.
-In general, the functionality provided by this package is fully compatible with \tikzname.
-Meaning every command from this package can be used inside the \textsf{tikzpicture} environment and every \tikzname command or option can be used inside the \texttt{af} environment or in context of the argument nodes and attack edges.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\newpage\section{Documentation for Version 1.2 [2024/06/07]}\label{sec:documentation}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\subsection{Package Options}
- The \argumentation package can be imported via the command
+The \argumentation package provides an easy way for creating argumentation frameworks\footnote{Dung, P. M. (1995). On the acceptability of arguments and its fundamental role in nonmonotonic reasoning, logic programming and n-person games. Artificial intelligence.} in \LaTeX documents.
+It builds on the \tikzname package for drawing the graphs and provides simplified syntax while keeping the same customisation options and keeping full compatibility with all \tikzname commands.
+The package comes with multiple predefined style options for arguments, attacks and supports.
+In the following, we give an overview over the functionality of the \argumentation package.
+The \argumentation package can be imported via the command
- \noindent
\verb|\usepackage{argumentation}|
+ \noindent
Alternatively, one can also adjust the appearance by providing some package options via
- \noindent
\verb|\usepackage[|\opt{options}\verb|]{argumentation}|
-
+
+\subsection{Style Options}\label{sec:style}
\begin{list}{}{\leftmargin=\parindent\rightmargin=0pt}
- \item The package provides the following \emph{optional} options to customize the look of the argumentation frameworks.
+ \item The \argumentation package provides the following options to customize the look of the argumentation frameworks. They can both be set globally (as an option for the \emph{usepackage} command) and also locally for each \texttt{af} environment (see Section~\ref{sec:af}).
\end{list}
+ \vspace{-0.3cm}
\begin{align*}
- \mathsf{namestyle} &\quad \text{Customizes the font of the argument names.}\\
- \mathsf{argumentstyle} &\quad \text{Customizes the appearance of the argument nodes.}\\
- \mathsf{attackstyle} &\quad \text{Customizes the appearance of the attack edges.}\\
- \mathsf{supportstyle} &\quad \text{Customizes the appearance of the support edges.}\\
+ \mathsf{argumentstyle} &\quad \text{Customizes the appearance of argument nodes.}\\
+ \mathsf{attackstyle} &\quad \text{Customizes the appearance of attack edges.}\\
+ \mathsf{supportstyle} &\quad \text{Customizes the appearance of support edges.}\\
+ \mathsf{namestyle} &\quad \text{Customizes the font style of the argument names.}\\
\end{align*}
In the following, we list the available options for each of the style parameters.\\
-\noindent\texttt{namestyle=}\opt{option}
-
- The \textsf{namestyle} parameter accepts three different options
- \begin{align*}
- \mathsf{normal} &\quad \text{(default) The argument name is rendered normally.}\\
- \mathsf{italics} &\quad \text{The argument name is rendered in \emph{italics}.}\\
- \mathsf{bold} &\quad \text{The argument name is rendered in \textbf{bold}.}\\
- \mathsf{bolditalics} &\quad \text{The argument name is rendered with \textbf{\emph{both}}.}\\
- \mathsf{monospace} &\quad \text{The argument name is rendered in \texttt{monospace} font.}\\
- \end{align*}
-
\noindent\texttt{argumentstyle=}\opt{option}
- The \textsf{argumentstyle} parameter accepts two options
+ The \textsf{argumentstyle} parameter accepts three options
\begin{align*}
\mathsf{standard} &\quad \text{(default) Standard style for the argument nodes.}\\
- %\mathsf{retro} &\quad \text{Thicker outline and slightly larger nodes.}\\
+ \mathsf{large} &\quad \text{Same node size, but larger font.}\\
+ \mathsf{thick} &\quad \text{Same node size, thicker outline.}\\
\end{align*}
+\begin{figure}[!h]
+ \begin{subfigure}{0.32\textwidth}
+ \centering
+ \begin{af}[argumentstyle=standard]
+ \argument{a}
+ \argument[right=of a1]{b}
+
+ \attack[]{a1}{a2}
+ \label{af:test}
+ \end{af}
+ \caption{\textsf{argumentstyle}=\textit{standard}}
+ \label{fig:argumentstyle_standard}
+ \end{subfigure}
+ \hfill
+ \begin{subfigure}{0.3\textwidth}
+ \centering
+ \begin{af}[argumentstyle=large]
+ \argument{a}
+ \argument[right=of a1]{b}
+
+ \attack[]{a1}{a2}
+ \end{af}
+ \caption{\textsf{argumentstyle}=\textit{large}}
+ \label{fig:argumentstyle_large}
+ \end{subfigure}
+ \hfill
+ \begin{subfigure}{0.3\textwidth}
+ \centering
+ \begin{af}[argumentstyle=thick]
+ \argument{a}
+ \argument[right=of a1]{b}
+
+ \attack[]{a1}{a2}
+ \end{af}
+ \caption{\textsf{argumentstyle}=\textit{thick}}
+ \label{fig:argumentstyle_thick}
+ \end{subfigure}
+ \caption{The available options for \textsf{argumentstyle}.}
+ \label{fig:argumentstyle}
+\end{figure}
+
\newpage
\noindent\texttt{attackstyle=}\opt{option}
- The \textsf{attackstyle} parameter accepts two options
+ The \textsf{attackstyle} parameter accepts three options
\begin{align*}
\mathsf{standard} &\quad \text{(default) Standard style for the attack arrow tips.}\\
- \mathsf{large} &\quad \text{Alternative style, arrow tip is larger and sharper.}\\
+ \mathsf{large} &\quad \text{Arrow tip is larger and sharper.}\\
+ \mathsf{modern} &\quad \text{\tikzname ModernCS arrow tip.}\\
\end{align*}
+\begin{figure}[!h]
+ \begin{subfigure}{0.32\textwidth}
+ \centering
+ \begin{af}[attackstyle=standard]
+ \argument{a}
+ \argument[right=of a1]{b}
+
+ \attack[]{a1}{a2}
+ \end{af}
+ \caption{\textsf{attackstyle}=\textit{standard}}
+ \label{fig:attackstyle_standard}
+ \end{subfigure}
+ \hfill
+ \begin{subfigure}{0.3\textwidth}
+ \centering
+ \begin{af}[attackstyle=large]
+ \argument{a}
+ \argument[right=of a1]{b}
+
+ \attack[]{a1}{a2}
+ \end{af}
+ \caption{\textsf{attackstyle}=\textit{large}}
+ \label{fig:attackstyle_large}
+ \end{subfigure}
+ \hfill
+ \begin{subfigure}{0.3\textwidth}
+ \centering
+ \begin{af}[attackstyle=modern]
+ \argument{a}
+ \argument[right=of a1]{b}
+
+ \attack[]{a1}{a2}
+ \end{af}
+ \caption{\textsf{attackstyle}=\textit{modern}}
+ \label{fig:attackstyle_thick}
+ \end{subfigure}
+ \caption{The available options for \textsf{attackstyle}.}
+ \label{fig:attackstyle}
+\end{figure}
+
\noindent\texttt{supportstyle=}\opt{option}
The \textsf{supportstyle} parameter accepts three options
@@ -166,25 +335,131 @@ Meaning every command from this package can be used inside the \textsf{tikzpictu
\mathsf{double} &\quad \text{Double arrow line and large flat tip.}\\
\end{align*}
-You can override the \textsf{argumentstyle}, \textsf{attackstyle} and \textsf{supportstyle} parameters and set a custom style via the following commands respectively.
-
-\noindent
-\verb|\setargumentstyle{|\opt{style}\verb|}|
+\begin{figure}[!h]
+ \begin{subfigure}{0.32\textwidth}
+ \centering
+ \begin{af}[supportstyle=standard]
+ \argument{a}
+ \argument[right=of a1]{b}
+
+ \support[]{a1}{a2}
+ \end{af}
+ \caption{\textsf{supportstyle}=\textit{standard}}
+ \label{fig:supportstyle_standard}
+ \end{subfigure}
+ \hfill
+ \begin{subfigure}{0.3\textwidth}
+ \centering
+ \begin{af}[supportstyle=dashed]
+ \argument{a}
+ \argument[right=of a1]{b}
+
+ \support[]{a1}{a2}
+ \end{af}
+ \caption{\textsf{supportstyle}=\textit{dashed}}
+ \label{fig:supportstyle_dashed}
+ \end{subfigure}
+ \hfill
+ \begin{subfigure}{0.3\textwidth}
+ \centering
+ \begin{af}[supportstyle=double]
+ \argument{a}
+ \argument[right=of a1]{b}
+
+ \support[]{a1}{a2}
+ \end{af}
+ \caption{\textsf{supportstyle}=\textit{double}}
+ \label{fig:supportstyle_double}
+ \end{subfigure}
+ \caption{The available options for \textsf{supportstyle}. Note that for \textit{standard} and \textit{dashed} the arrow tip of the selected \textsf{attackstyle} will be used.}
+ \label{fig:supportstyle}
+\end{figure}
-\noindent
-\verb|\setattackstyle{|\opt{style}\verb|}|
+\newpage
+\noindent\texttt{namestyle=}\opt{option}
+
+ The \textsf{namestyle} parameter offers five different options
+ \begin{align*}
+ \mathsf{none} &\quad \text{(default) No effect applied to argument name.}\\
+ \mathsf{math} &\quad \text{The argument name is rendered as $math$ text.}\\
+ &\quad\quad \text{(name must be given without mathmode).}\\
+ \mathsf{italics} &\quad \text{The argument name is rendered in \textit{italics}.}\\
+ &\quad\quad \text{(name must be given in mathmode to apply effect).}\\
+ \mathsf{bold} &\quad \text{The argument name is rendered in $\boldsymbol{bold}$.}\\
+ &\quad\quad \text{(name must be given in mathmode to apply effect).}\\
+ \mathsf{monospace} &\quad \text{The argument name is rendered in \texttt{monospace} font.}\\
+ &\quad\quad \text{(name must be given in mathmode to apply effect).}\\
+ \end{align*}
-\noindent
-\verb|\setsupportstyle{|\opt{style}\verb|}|
-\begin{list}{}{\leftmargin=\parindent\rightmargin=0pt}
- \item
- where \opt{style} is a list of \tikzname style parameters.
-\end{list}
+\begin{figure}[!h]
+ \begin{subfigure}{0.3\textwidth}
+ \centering
+ \begin{af}[namestyle=none]
+ \argument{a}
+ \argument[right=of a1]{b}
+
+ \attack[]{a1}{a2}
+ \end{af}
+ \caption{\textsf{namestyle}=\textit{none}}
+ \label{fig:namestyle_none}
+ \end{subfigure}
+ \hfill
+ \begin{subfigure}{0.3\textwidth}
+ \centering
+ \begin{af}[namestyle=math]
+ \argument{a}
+ \argument[right=of a1]{b}
+
+ \attack[]{a1}{a2}
+ \end{af}
+ \caption{\textsf{namestyle}=\textit{math}}
+ \label{fig:namestyle_math}
+ \end{subfigure}
+ \hfill
+ \begin{subfigure}{0.3\textwidth}
+ \centering
+ \begin{af}[namestyle=italics]
+ \argument{$a$}
+ \argument[right=of a1]{$b$}
+
+ \attack[]{a1}{a2}
+ \end{af}
+ \caption{\textsf{namestyle}=\textit{italics}}
+ \label{fig:namestyle_italics}
+ \end{subfigure}
+ \par\bigskip
+ \begin{subfigure}{0.49\textwidth}
+ \centering
+ \begin{af}[namestyle=bold]
+ \argument{$a$}
+ \argument[right=of a1]{$b$}
+
+ \attack[]{a1}{a2}
+ \end{af}
+ \caption{\textsf{namestyle}=\textit{bold}}
+ \label{fig:namestyle_bold}
+ \end{subfigure}
+ \hfill
+ \begin{subfigure}{0.49\textwidth}
+ \centering
+ \begin{af}[namestyle=monospace]
+ \argument{$a$}
+ \argument[right=of a1]{$b$}
+
+ \attack[]{a1}{a2}
+ \end{af}
+ \caption{\textsf{namestyle}=\textit{monospace}}
+ \label{fig:namestyle_monospace}
+ \end{subfigure}
+ \caption{The available options for \textsf{namestyle}. You can of course apply any formatting yourself when using the default \textsf{namestyle}=\textit{none}.}
+ \label{fig:namestyle}
+\end{figure}
-\subsection{The \texttt{af} Environment}
-The \argumentation package provides an environment for creating abstract argumentation frameworks and bipolar argumentation frameworks in \LaTeX-documents.\\
+\subsection{The \texttt{af} Environment}\label{sec:af}
+The \argumentation package provides an environment for creating abstract argumentation frameworks and many of its extensions in \LaTeX-documents.\\
+\vspace{-0.2cm}
\noindent
\verb|\begin{af}[|\opt{options}\verb|]|
@@ -195,54 +470,58 @@ The \argumentation package provides an environment for creating abstract argumen
\begin{list}{}{\leftmargin=\parindent\rightmargin=0pt}
\item
- The \argumentation package provides the \texttt{af} environment for creating abstract argumentation framework.
+ The above described style options can be set locally for each instance of the \texttt{af} environment by setting the respective parameters in the options of the environment.
+ Local settings override the defaults and globally set values (See Section~\ref{sec:style}
+ for examples).
+
The \texttt{af} environment extends the \textsf{tikzpicture} environment, meaning all \tikzname commands can be used inside the \texttt{af} environment as well.
- Furthermore, all options for the \textsf{tikzpicture} environment can be used for the \texttt{af} environment as well.
- For instance, the option parameter \verb|node distance|, which is set to \verb|1cm| per default.
+ Furthermore, all options for the \textsf{tikzpicture} environment can be used for the \texttt{af} environment as well, e.\,g the option \verb|node distance|, which is set to \verb|1cm| per default.
- If you want to create an argumentation framework with limited space available, you can provide one of the following predefined options for the environment. This is especially useful for two-column layout documents.
+ If you want to create an argumentation framework with limited space available, you can use one of the following predefined options for the \texttt{af} environment.
+ This is especially useful for two-column layout documents.
\begin{align*}
\mathsf{tiny} &\quad \text{\textsf{node distance} is set to $0.35cm$ and nodes are smaller.}\\
- \mathsf{small} &\quad \text{\textsf{node distance} is set to $0.55cm$ and nodes are smaller.}\\
+ \mathsf{small} &\quad \text{\textsf{node distance} is set to $0.55cm$ and nodes are smaller.}
+ %TODO:& argument size as parameter
\end{align*}
- \begin{example}
- Consider the two AFs in Figure~\ref{fig:mini_afs} created with the \textsf{small} and \textsf{tiny} option respectively.
- \end{example}
+ %\begin{example}
+ % Consider the two AFs in Figure~\ref{fig:mini_afs} created with the \textsf{small} and \textsf{tiny} option respectively.
+ %\end{example}
\end{list}
\begin{figure}[ht]
\begin{subfigure}{0.48\textwidth}
\centering
\begin{af}[small]
- \argument{args1}{a}
- \argument[right=of args1]{args2}{b}
- \argument[right=of args2]{args3}{c}
- \argument[right=of args3]{args4}{d}
- \argument[right=of args4]{args5}{e}
- \argument[below=of args1]{args6}{f}
- \argument[inactive,right=of args6]{args7}{g}
- \argument[inactive,argin,right=of args7]{args8}{h}
- \argument[right=of args8]{args9}{i}
- \argument[right=of args9]{args10}{j}
-
- \afname[left of=args1,yshift=-0.5cm,xshift=-0.2cm]{cap}{\textbf{F:}}
-
- \selfattack{args1}
- \dualattack[]{args1}{args6}
- \dualattack[inactive]{args6}{args7}
- \attack[inactive]{args8}{args7}
-
- \attack[inactive]{args7}{args2}
- \attack[]{args3}{args2}
-
- \support[]{args4}{args3}
- \support[]{args9}{args3}
-
- \attack[]{args4}{args5}
- \attack[]{args5}{args10}
- \attack[]{args10}{args9}
- \attack[]{args9}{args4}
+ \argument{a}
+ \argument[right=of a1]{b}
+ \argument[right=of a2]{c}
+ \argument[right=of a3]{d}
+ \argument[right=of a4]{e}
+ \argument[below=of a1]{f}
+ \argument[inactive,right=of a6]{g}
+ \argument[inactive,argin,right=of a7]{h}
+ \argument[right=of a8]{i}
+ \argument[right=of a9]{j}
+
+ \afname[left of=a1,yshift=-0.55cm,xshift=-0.2cm]{\textbf{F:}}
+
+ \selfattack{a1}
+ \dualattack[]{a1}{a6}
+ \dualattack[inactive]{a6}{a7}
+ \attack[inactive]{a8}{a7}
+
+ \attack[inactive]{a7}{a2}
+ \attack[]{a3}{a2}
+
+ \support[]{a4}{a3}
+ \support[]{a9}{a3}
+
+ \attack[]{a4}{a5}
+ \attack[]{a5}{a10}
+ \attack[]{a10}{a9}
+ \attack[]{a9}{a4}
\end{af}
\caption{An exemplary AF created with the \textsf{small} option set.}
\label{fig:example_small}
@@ -251,65 +530,90 @@ The \argumentation package provides an environment for creating abstract argumen
\begin{subfigure}{0.48\textwidth}
\centering
\begin{af}[tiny]
- \argument{args1}{a}
- \argument[right=of args1]{args2}{b}
- \argument[right=of args2]{args3}{c}
- \argument[right=of args3]{args4}{d}
- \argument[right=of args4]{args5}{e}
- \argument[below=of args1]{args6}{f}
- \argument[inactive,right=of args6]{args7}{g}
- \argument[inactive,argin,right=of args7]{args8}{h}
- \argument[right=of args8]{args9}{i}
- \argument[right=of args9]{args10}{j}
-
- \afname[left of=args1,yshift=-0.5cm,xshift=-0.2cm]{cap}{\textbf{F:}}
-
- \selfattack{args1}
- \dualattack[]{args1}{args6}
- \dualattack[inactive]{args6}{args7}
- \attack[inactive]{args8}{args7}
-
- \attack[inactive]{args7}{args2}
- \attack[]{args3}{args2}
-
- \support[]{args4}{args3}
- \support[]{args9}{args3}
-
- \attack[]{args4}{args5}
- \attack[]{args5}{args10}
- \attack[]{args10}{args9}
- \attack[]{args9}{args4}
+ \argument{a}
+ \argument[right=of a1]{b}
+ \argument[right=of a2]{c}
+ \argument[right=of a3]{d}
+ \argument[right=of a4]{e}
+ \argument[below=of a1]{f}
+ \argument[inactive,right=of a6]{g}
+ \argument[inactive,argin,right=of a7]{h}
+ \argument[right=of a8]{i}
+ \argument[right=of a9]{j}
+
+ \afname[left of=a1,yshift=-0.4cm,xshift=-0.2cm]{\textbf{F:}}
+
+ \selfattack{a1}
+ \dualattack[]{a1}{a6}
+ \dualattack[inactive]{a6}{a7}
+ \attack[inactive]{a8}{a7}
+
+ \attack[inactive]{a7}{a2}
+ \attack[]{a3}{a2}
+
+ \support[]{a4}{a3}
+ \support[]{a9}{a3}
+
+ \attack[]{a4}{a5}
+ \attack[]{a5}{a10}
+ \attack[]{a10}{a9}
+ \attack[]{a9}{a4}
\end{af}
\caption{An exemplary AF created with the \textsf{tiny} option set.}
\label{fig:example_tiny}
\end{subfigure}
\caption{Two AFs with smaller nodes, created by using the \textsf{small} and \textsf{tiny} options of the \texttt{af} environment.}
\label{fig:mini_afs}
-
\end{figure}
While the following commands are intended to be used inside the \texttt{af} environment, they can also be used inside the \textsf{tikzpicture} environment.
-\subsection{Arguments}
- Arguments can be created with the following command\\
-
- \noindent
- \verb|\argument{|\opt{id}\verb|}{|\opt{name}\verb|}|
+\subsection{Creating Arguments}
+ Arguments can be created with the \verb|\argument| command.
+ The full command is defined as follows\\
- \begin{list}{}{\leftmargin=\parindent\rightmargin=0pt}
- \item\opt{id}~ is the identifier of the new argument
- \item\opt{name}~ is the displayed name of the argument
- \item To create an argument, you must provide a unique identifier and the name to be displayed in the picture.
- The \opt{id} of an argument is then referred to when creating attacks as well as for the relative positioning of other arguments.
+ \noindent
+ \verb|\argument[|\opt{options}\verb|](|\opt{id}\verb|){|\opt{name}\verb|}| \verb|at| (\opt{posX}, \opt{posY})
+ \begin{list}{}{\leftmargin=\parindent\rightmargin=0pt}
+ \item\opt{options}~ (optional) a list of \tikzname style parameters and/or relative positioning information (see Section~\ref{sec:relpos}).
+ \item\opt{id}~ (optional) the identifier of the new argument. When omitted, arguments will automatically be assigned an identifier of the form: $a1, a2, a3,...$
+ \item\opt{name}~ the displayed name of the argument.
+ \item\opt{posX}, \opt{posY}~ (optional) the coordinates where the argument is placed. Should be omitted if relative positioning is used.
+
+ \item When creating an argument you only have to provide the \opt{name}, all other parameters are optional.
+ The \opt{id} of an argument is used for referencing, e.\,g., when creating attacks or for the relative positioning of other arguments.
\end{list}
-\subsubsection{Relative Positioning}
- This package supports relative placement of the arguments via the \tikzname-library \textsf{positioning}.
- The relative positioning information is provided as an optional parameter via\\
+\newpage
+\begin{example}~
+ \begin{verbatim}
+ \begin{af}
+ \argument{$a$}
+ \argument{$b$} at (1, 1)
+ \argument[right=of a2]{$c$}
+ \argument(argD){$d$} at (-2, 0)
+ \argument[above=of argD]{$e$}
+ \end{af}
+ \end{verbatim}
+
+ \begin{center}
+ \begin{af}
+ \argument{$a$}
+ \argument{$b$} at (1, 1)
+ \argument[right=of a2]{$c$}
+ \argument(argD){$d$} at (-2, 0)
+ \argument[above=of argD]{$e$}
+ \end{af}
+ \end{center}
+\end{example}
+
+\subsubsection{Relative Positioning}\label{sec:relpos}
+ Placement of argument nodes with the \argumentation package relies on relative placement via the \tikzname-library \textsf{positioning}.
+ The relative positioning information is provided as an optional parameter as follows\\
\noindent
- \verb|\argument[|\opt{dir}\verb|=of |\opt{arg\_id}\verb|]{|\opt{id}\verb|}{|\opt{name}\verb|}|
+ \verb|\argument[|\opt{dir}\verb|=of |\opt{arg\_id}\verb|](|\opt{id}\verb|){|\opt{name}\verb|}|
\begin{list}{}{\leftmargin=\parindent\rightmargin=0pt}
\item\opt{dir}~ has to be one of: \emph{right}, \emph{left}, \emph{below} and \emph{above}
@@ -323,36 +627,44 @@ While the following commands are intended to be used inside the \texttt{af} envi
\begin{verbatim}
\begin{af}
- \argument{arg1}{a}
- \argument[below=of arg1]{arg2}{b}
- \argument[right=of arg1, yshift=-24pt,xshift=-8pt]{arg3}{c}
- \argument[right=of arg3, xshift=-0.5cm]{arg4}{d}
- \argument[right=of arg4, yshift=5ex]{arg4}{e}
+ \argument{a}
+ \argument[below=of a1]{b}
+ \argument[right=of a1, yshift=-24pt,xshift=-8pt]{c}
+ \argument[right=of a3, xshift=-0.5cm]{d}
+ \argument[right=of a4, yshift=5ex]{e}
\end{af}
\end{verbatim}
\begin{center}
\begin{af}
- \argument{arg1}{a}
- \argument[below=of arg1]{arg2}{b}
- \argument[right=of arg1, yshift=-24pt,xshift=-8pt]{arg3}{c}
- \argument[right=of arg3, xshift=-0.5cm]{arg4}{d}
- \argument[right=of arg4, yshift=5ex]{arg4}{e}
+ \argument{a}
+ \argument[below=of a1]{b}
+ \argument[right=of a1, yshift=-24pt,xshift=-8pt]{c}
+ \argument[right=of a3, xshift=-0.5cm]{d}
+ \argument[right=of a4, yshift=5ex]{e}
\end{af}
\end{center}
\end{example}
-\subsubsection{Argument Styling}
+%\subsubsection{Absolute Positioning}
+
+\subsubsection{Argument Identifiers}
+ When creating an argument, it is automatically assigned an identifier for the sake of simplicity.
+ You can override this identifier by giving another identifier in parenthesis to the \verb|\argument| command.
+ Per default, the argument identifiers will be numerical of the form $a1, a2, a3, \dots$ based on their order of creation inside the \texttt{af} environment.
+ If you preferred alphabetical identifiers, you can set the package option \textsf{indexing}=\emph{alphabetic} and the argument identifiers will instead be $a, b, c, \dots$.
+
+\subsubsection{Additional Argument Styles}
Furthermore, you can provide optional parameters to adjust the style of the argument node.
For that you can use all \tikzname-style options and additionally the following predefined style parameters:
\begin{align*}
\mathsf{inactive} &\quad \text{The argument is displayed with grey outline and text.}\\
\mathsf{incomplete} &\quad \text{The argument is displayed with a dotted outline.}\\
\mathsf{invisible} &\quad \text{The argument node is completely transparent.}\\
- \mathsf{argin} &\quad \text{The argument is displayed with green background color.}\\
- \mathsf{argout} &\quad \text{The argument is displayed with red background color.}\\
- \mathsf{argundec} &\quad \text{The argument is displayed with cyan background color.}\\
+ \mathsf{accepted} &\quad \text{The argument is displayed with green background color.}\\
+ \mathsf{rejected} &\quad \text{The argument is displayed with red background color.}\\
+ \mathsf{undecided} &\quad \text{The argument is displayed with cyan background color.}\\
\end{align*}
%Some relevant \tikzname style-parameters are
@@ -369,7 +681,7 @@ While the following commands are intended to be used inside the \texttt{af} envi
%\end{align*}
-\subsection{Attacks}
+\subsection{Creating Attacks}
Attacks between two arguments can be created with the command\\
\noindent
@@ -380,7 +692,7 @@ While the following commands are intended to be used inside the \texttt{af} envi
\end{list}
-\subsubsection{Attack Styling}
+\subsubsection{Additional Attack Styles}
To customize an attack you can provide additional optional parameters:
\begin{align*}
\mathsf{inactive} &\quad \text{The attack is displayed in grey.}\\
@@ -389,7 +701,7 @@ While the following commands are intended to be used inside the \texttt{af} envi
\mathsf{selfattack} &\quad \text{Use if source and target of the attack are the same node.}\\
\mathsf{bend~right} &\quad \text{The attack arrow is bent to the right.}\\
&\quad \text{Can additionally provide the angle, e.\,g., \textsf{bend~right=40}.}\\
- \mathsf{bend~left} &\quad \text{The attack arrow is bent to the left. Can also provide an angle.}\\
+ \mathsf{bend~left} &\quad \text{The attack arrow is bent to the left. Can also provide an angle.}
\end{align*}
Of course, all \tikzname style parameters can be used here as well.
@@ -397,27 +709,27 @@ While the following commands are intended to be used inside the \texttt{af} envi
\begin{example}~
\begin{verbatim}
\begin{af}
- \argument{arg1}{a}
- \argument[right=of arg1]{arg2}{b}
- \argument[right=of arg2]{arg3}{c}
- \argument[right=of arg3]{arg4}{d}
-
- \attack{arg1}{arg2}
- \attack[bend right]{arg2}{arg3}
- \attack[bend left=10,inactive]{arg3}{arg4}
- \end{af}
+ \argument{a}
+ \argument[right=of a1]{b}
+ \argument[right=of a2]{c}
+ \argument[right=of a3]{d}
+
+ \attack{a1}{a2}
+ \attack[bend right]{a2}{a3}
+ \attack[bend left=10,inactive]{a3}{a4}
+ \end{af}
\end{verbatim}
\begin{center}
\begin{af}
- \argument{arg1}{a}
- \argument[right=of arg1]{arg2}{b}
- \argument[right=of arg2]{arg3}{c}
- \argument[right=of arg3]{arg4}{d}
-
- \attack{arg1}{arg2}
- \attack[bend right]{arg2}{arg3}
- \attack[bend left=10,inactive]{arg3}{arg4}
+ \argument{a}
+ \argument[right=of a1]{b}
+ \argument[right=of a2]{c}
+ \argument[right=of a3]{d}
+
+ \attack{a1}{a2}
+ \attack[bend right]{a2}{a3}
+ \attack[bend left=10,inactive]{a3}{a4}
\end{af}
\end{center}
\end{example}
@@ -439,27 +751,27 @@ While the following commands are intended to be used inside the \texttt{af} envi
\begin{example}~
\begin{verbatim}
\begin{af}
- \argument{arg1}{a}
- \argument[right=of arg1]{arg2}{b}
+ \argument{a}
+ \argument[right=of a1]{b}
- \selfattack{arg1}
- \dualattack{arg1}{arg2}
- \end{af}
+ \selfattack{a2}
+ \dualattack{a1}{a2}
+ \end{af}
\end{verbatim}
\begin{center}
\begin{af}
- \argument{arg1}{a}
- \argument[right=of arg1]{arg2}{b}
+ \argument{a}
+ \argument[right=of a1]{b}
- \selfattack{arg2}
- \dualattack{arg1}{arg2}
+ \selfattack{a2}
+ \dualattack{a1}{a2}
\end{af}
\end{center}
\end{example}
-\subsection{Supports}
+\subsection{Creating Support Relations}
You can create a support relation between two arguments with the command\\
\noindent
@@ -473,23 +785,23 @@ While the following commands are intended to be used inside the \texttt{af} envi
\begin{example}~
\begin{verbatim}
\begin{af}
- \argument{arg1}{a}
- \argument[right=of arg1]{arg2}{b}
- \argument[right=of arg2]{arg3}{c}
+ \argument{a}
+ \argument[right=of a1]{b}
+ \argument[right=of a2]{c}
- \support{arg1}{arg2}
- \support[bend right]{arg2}{arg3}
- \end{af}
+ \support{a1}{a2}
+ \support[bend right]{a2}{a3}
+ \end{af}
\end{verbatim}
\begin{center}
\begin{af}
- \argument{arg1}{a}
- \argument[right=of arg1]{arg2}{b}
- \argument[right=of arg2]{arg3}{c}
+ \argument{a}
+ \argument[right=of a1]{b}
+ \argument[right=of a2]{c}
- \support{arg1}{arg2}
- \support[bend right]{arg2}{arg3}
+ \support{a1}{a2}
+ \support[bend right]{a2}{a3}
\end{af}
\end{center}
\end{example}
@@ -498,55 +810,63 @@ While the following commands are intended to be used inside the \texttt{af} envi
Many extensions of the original abstract argumentation framework rely on attacks with an associated value.
This may, for instance, be probabilities in the case of probabilistic argumentation frameworks or numerical weights in the case of weighted argumentation frameworks.
These annotations can be added manually via \tikzname or via the following command\\
-
+
\noindent
- \verb|\annotatedattack{|\opt{arg1}\verb|}{|\opt{arg2}\verb|}{|\opt{value}\verb|}|
+ \verb|\annotatedattack[|\opt{position}\verb|]{|\opt{arg1}\verb|}{|\opt{arg2}\verb|}{|\opt{value}\verb|}|
\begin{list}{}{\leftmargin=\parindent\rightmargin=0pt}
- \item where \opt{arg1} and \opt{arg2} are the identifiers of two previously defined arguments and \opt{value} is the number or string that should be annotated to the attack.
- With this command, the annotation is placed above the attack arrow.
+ \item where \opt{arg1} and \opt{arg2} are the identifiers of two previously defined arguments and \opt{value} is the text or number that should be annotated to the attack.
+ \opt{position} specifies where the annotation should be placed relative to the attack arrow and should be one of: \textsf{above}, \textsf{below}, \textsf{left}, \textsf{right}.
\end{list}
\begin{example}~
\begin{verbatim}
\begin{af}
- \argument{arg1}{a}
- \argument[right=of arg1]{arg2}{b}
- \argument[right=of arg2]{arg3}{c}
+ \argument{a}
+ \argument[right=of a1]{b}
+ \argument[right=of a2]{c}
- \annotatedattack{arg1}{arg2}{$x$}
- \annotatedattack[bend right]{arg2}{arg3}{$0.6$}
- \end{af}
+ \annotatedattack[below]{a1}{a2}{$x$}
+ \annotatedattack[above,bend right]{a2}{a3}{$0.6$}
+ \end{af}
\end{verbatim}
\begin{center}
\begin{af}
- \argument{arg1}{a}
- \argument[right=of arg1]{arg2}{b}
- \argument[right=of arg2]{arg3}{c}
+ \argument{a}
+ \argument[right=of a1]{b}
+ \argument[right=of a2]{c}
- \annotatedattack{arg1}{arg2}{$x$}
- \annotatedattack[bend right]{arg2}{arg3}{$0.6$}
- \end{af}
+ \annotatedattack[below]{a1}{a2}{$x$}
+ \annotatedattack[above,bend right]{a2}{a3}{$0.6$}
+ \end{af}
\end{center}
\end{example}
\subsection{Further Commands}
- If you want to display an identifier for your argumentation framework in the picture, you can use the command\\
+ If you want to display an name (or some other text) for your argumentation framework in the picture, you can use the \verb|\afname| command.
+ Just like the \verb|\argument| command it can include an optional identifier and supports both relative and absolute positioning.
+ Some example usages:\\
- \noindent
- \verb|\afname{|\opt{id}\verb|}{|\opt{name}\verb|}|
+ \vspace{-0.25cm}
+ \noindent\verb|\afname{|\opt{name}\verb|}|
+
+ \noindent\verb|\afname(|\opt{id}\verb|){|\opt{name}\verb|}|
+
+ \noindent\verb|\afname[|\opt{relPos}\verb|]{|\opt{name}\verb|}|
+
+ \noindent\verb|\afname{|\opt{name}\verb|}| \verb|at (|\opt{posX},\opt{posY}\verb|)|
\begin{list}{}{\leftmargin=\parindent\rightmargin=0pt}
- \item where \opt{id} is an identifier for the created node and \opt{name} is the text displayed in the picture.
- Additionally, positioning information can be provided via the optional parameters.
+ \item where \opt{id} is an (optional) identifier for the created node (if omitted, the default identifier will be \textit{cap}) and \opt{name} is the text displayed in the picture.
+ Additional positioning information, via \textsf{xshift} or \textsf{yshift}, can be provided via the optional parameters.
\end{list}
\noindent
To create an annotation, e.\,g., an acceptance condition or a weight, next to an argument, the following command can be used.\\
\noindent
- \verb|\annotation{|\opt{arg\_id}\verb|}{|\opt{text}\verb|}|
+ \verb|\annotation[|\opt{optional}\verb|]{|\opt{arg\_id}\verb|}{|\opt{text}\verb|}|
\begin{list}{}{\leftmargin=\parindent\rightmargin=0pt}
\item where \opt{arg\_id} is the identifier of some argument and \opt{text} is the text to be displayed.
@@ -556,35 +876,58 @@ While the following commands are intended to be used inside the \texttt{af} envi
\begin{example}~
\begin{verbatim}
\begin{af}
- \argument{arg1}{a}
- \argument[right=of arg1]{arg2}{b}
- \afname[left=of arg1]{caption}{$F:$}
- \annotation[yshift=-0.4cm,xshift=0.4cm]{arg2}{$\neg a$}
+ \argument{a}
+ \argument[right=of a1]{b}
+ \afname{$F:$} at (-1,0)
+ \annotation[yshift=-0.4cm,xshift=0.4cm]{a2}{$\neg a$}
- \attack{arg1}{arg2}
- \end{af}
+ \support{a1}{a2}
+ \end{af}
\end{verbatim}
\begin{center}
\begin{af}
- \argument{arg1}{a}
- \argument[right=of arg1]{arg2}{b}
- \afname[left=of arg1]{caption}{$F:$}
- \annotation[yshift=-0.4cm,xshift=0.4cm]{arg2}{$\neg a$}
+ \argument{a}
+ \argument[right=of a1]{b}
+ \afname{$F:$} at (-1,0)
+ \annotation[yshift=-0.4cm,xshift=0.4cm]{a2}{$\neg a$}
- \support{arg1}{arg2}
- \end{af}
+ \support{a1}{a2}
+ \end{af}
\end{center}
\end{example}
+ You can manually override the \textsf{argumentstyle}, \textsf{attackstyle} and \textsf{supportstyle} parameters and set a custom style globally via the following commands respectively.\\
+
+ \vspace{-0.3cm}
+ \noindent
+ \verb|\setargumentstyle{|\opt{style}\verb|}|
+
+ \noindent
+ \verb|\setattackstyle{|\opt{style}\verb|}|
+
+ \noindent
+ \verb|\setsupportstyle{|\opt{style}\verb|}|
+
+ \begin{list}{}{\leftmargin=\parindent\rightmargin=0pt}
+ \item
+ where \opt{style} is a list of \tikzname style parameters.
+ \end{list}
+
%\section{Style Definitions}
\newpage
-\section{Version History}
+\section{Version History}\label{sec:history}
-\subsection*{[v1.0 2023/11/05]}
+\subsection*{[v1.2 2024/06/07]}
\begin{itemize}
- \item First Version.
+ \item Changed Syntax of \verb|\argument| command. The \textit{id} parameter is now given inside parenthesis instead of curly braces and is optional.
+ \item Added absolute positioning to \verb|\argument| command, like for \tikzname nodes.
+ \item Added package option $\textsf{indexing}$ to toggle automatic generation of identifiers for created argument nodes. Can be set to \textit{none}, or selected between \textit{alphabetic} and \textit{numeric} (default).
+ \item All package style options can now also be set locally in the \texttt{af} environment.
+ \item Adjusted \verb|\annotatedattack| to require position parameter.
+ \item Various minor bugfixes regarding the \textsf{namestyle} package option.
+ \item Added new argumentstyle \textsf{large}.
\end{itemize}
\subsection*{[v1.1 2023/12/03]}
@@ -596,4 +939,9 @@ While the following commands are intended to be used inside the \texttt{af} envi
\item Updated and improved documentation.
\end{itemize}
+\subsection*{[v1.0 2023/11/05]}
+\begin{itemize}
+ \item First Version.
+\end{itemize}
+
\end{document}
diff --git a/graphics/pgf/contrib/argumentation/argumentation.sty b/graphics/pgf/contrib/argumentation/argumentation.sty
index 7cd678de3c..f247cd959a 100644
--- a/graphics/pgf/contrib/argumentation/argumentation.sty
+++ b/graphics/pgf/contrib/argumentation/argumentation.sty
@@ -1,5 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{argumentation}[2023/12/03 Argumentation]
+\ProvidesPackage{argumentation}[2024/05/03 Argumentation]
% Author: Lars Bengel
% E-Mail: lars.bengel@fernuni-hagen.de
% Version: 1.1
@@ -7,77 +7,195 @@
% License: LaTeX Project Public License 1.3c
%%%%%%%%%%% Package Requirements %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\RequirePackage{amsbsy,amsmath} % For proper bold letters in math mode
\RequirePackage{pgfopts} % For managing package options
\RequirePackage{tikz} % For drawing the argumentation frameworks
\usetikzlibrary{positioning} % For relative node positioning
\usetikzlibrary{arrows.meta} % For directed edges / attack arrows
\usetikzlibrary{arrows} % For directed edges / attack arrows
\usetikzlibrary{decorations.markings} % For creating the support edge markings
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%% Package Tikz Style Definitions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\newcounter{argument}
+%\newcommand{\argument}{\relax}
+\newcommand{\argstyle}[1]{#1} % Defines the font style in which argument names are displayed
+
+%%% Argument Style Definitions
+\tikzset{ % global base styles
+ argument size/.style={minimum size=0.7cm}, % Standard size of argument nodes
+ argument/.style={}, % Base style for argument nodes
+ argument standard/.style={circle,draw=black,inner sep=0,outer sep=0, argument size},
+ argument large/.style={circle,draw=black,inner sep=0,outer sep=0, argument size, font=\large},
+ argument thick/.style={circle,draw=black,inner sep=0,outer sep=0, argument size, thick},
+}
-\newcommand{\argstyle}[1]{#1} % Defines the font style in which argument names are displayed
+%%% Attack/Support Edge Definitions
+\tikzset{ % global base styles
+ attack/.style={}, % Base style for attack arrow
+ attack standard/.style={-{stealth'}}, % Standard attack arrow
+ attack large/.style={-{Stealth[scale=1.25]}}, % Larger arrow tip
+ attack modern/.style={-{To[sharp,length=0.9mm,line width=0.7pt]}}, % Mordern rightarrow style tip
+ support/.style={},
+ support standard/.style = {attack, postaction = {decorate,decoration={markings,mark=at position 0.36 with {\draw[-] (0,-0.1) -- (0.1,0.1);}}}}, % Standard support arrow
+ support dashed/.style={attack,densely dashed},
+ support double/.style={-{Classical TikZ Rightarrow},double},
+}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%% Package Options %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\pgfkeys{/argumentation/argumentstyle/.is choice,
- /argumentation/argumentstyle/standard/.code={\tikzset{argument/.style={circle,draw=black,inner sep=0,outer sep=0}}},
- /argumentation/argumentstyle/custom/.code={},
- /argumentation/argumentstyle=standard,
+%%% Options for style of the argument node itself
+\pgfkeys{/tikz/.cd,
+ argumentstyle/.is choice,
+ argumentstyle/standard/.code={\tikzset{argument/.style={argument standard}}},
+ argumentstyle/large/.code={\tikzset{argument/.style={argument large}}},
+ argumentstyle/thick/.code={\tikzset{argument/.style={argument thick}}},
+}
+\pgfkeys{/argumentation/.cd,
+ .unknown/.code={},
+ argumentstyle/.is choice,
+ argumentstyle/standard/.code={\tikzset{argument/.style={argument standard}}},
+ argumentstyle/large/.code={\tikzset{argument/.style={argument large}}},
+ argumentstyle/thick/.code={\tikzset{argument/.style={argument thick}}},
+ argumentstyle=standard,
}
-\pgfkeys{/argumentation/attackstyle/.is choice,
- /argumentation/attackstyle/standard/.code={\tikzset{attack/.style={-{stealth'}}}},
- /argumentation/attackstyle/large/.code={\tikzset{attack/.style={-{Stealth[scale=1.25]}}}},
- /argumentation/attackstyle=standard,
+%%% Options for the style of the attack edges
+\pgfkeys{/tikz/.cd,
+ attackstyle/.is choice,
+ attackstyle/standard/.code={\tikzset{attack/.style={attack standard}}},
+ attackstyle/large/.code={\tikzset{attack/.style={attack large}}},
+ attackstyle/modern/.code={\tikzset{attack/.style={attack modern}}},
+ attackstyle=standard,
+}
+\pgfkeys{/argumentation/.cd,
+ attackstyle/.is choice,
+ attackstyle/standard/.code={\tikzset{attack/.style={attack standard}}},
+ attackstyle/large/.code={\tikzset{attack/.style={attack large}}},
+ attackstyle/modern/.code={\tikzset{attack/.style={attack modern}}},
+ attackstyle=standard,
+}
+
+%%% Options for the style of the support edges
+\pgfkeys{/tikz/.cd,
+ supportstyle/.is choice,
+ supportstyle/standard/.code={\tikzset{support/.style={support standard}}},
+ supportstyle/dashed/.code={\tikzset{support/.style={support dashed}}},
+ supportstyle/double/.code={\tikzset{support/.style={support double}}},
+ supportstyle=standard,
+}
+\pgfkeys{/argumentation/.cd,
+ supportstyle/.is choice,
+ supportstyle/standard/.code={\tikzset{support/.style={support standard}}},
+ supportstyle/dashed/.code={\tikzset{support/.style={support dashed}}},
+ supportstyle/double/.code={\tikzset{support/.style={support double}}},
+ supportstyle=standard,
}
-\pgfkeys{/argumentation/supportstyle/.is choice,
- /argumentation/supportstyle/standard/.code={\tikzset{support/.style = {attack,postaction = {decorate,decoration={markings,mark=at position 0.36 with {\draw[-] (0,-0.1) -- (0.1,0.1);}}}}}},
- /argumentation/supportstyle/dashed/.code={\tikzset{support/.style = {attack,densely dashed}}},
- /argumentation/supportstyle/double/.code={\tikzstyle{support}=[-{Classical TikZ Rightarrow},double]},
- /argumentation/supportstyle=standard,
+%%% Options for the automatic text formatting for the argument names
+\pgfkeys{/tikz/.cd,
+ namestyle/.is choice,
+ namestyle/none/.code={\renewcommand{\argstyle}[1]{##1}},
+ namestyle/math/.code={\renewcommand{\argstyle}[1]{\ensuremath{##1}}},
+ namestyle/italics/.code={\renewcommand{\argstyle}[1]{\ensuremath{\mathit{\text{##1}}}}},
+ namestyle/bold/.code={\renewcommand{\argstyle}[1]{\ensuremath{\boldsymbol{\text{##1}}}}},
+ namestyle/monospace/.code={\renewcommand{\argstyle}[1]{\ensuremath{\mathtt{\text{##1}}}}},
+ namestyle=none,
+}
+\pgfkeys{/argumentation/.cd,
+ namestyle/.is choice,
+ namestyle/none/.code={\renewcommand{\argstyle}[1]{##1}},
+ namestyle/math/.code={\renewcommand{\argstyle}[1]{\ensuremath{##1}}},
+ namestyle/italics/.code={\renewcommand{\argstyle}[1]{\ensuremath{\mathit{##1}}}},
+ namestyle/bold/.code={\renewcommand{\argstyle}[1]{\ensuremath{\boldsymbol{\text{##1}}}}},
+ namestyle/monospace/.code={\renewcommand{\argstyle}[1]{\ensuremath{\mathtt{##1}}}},
+ namestyle=none,
}
-\pgfkeys{/argumentation/namestyle/.is choice,
- /argumentation/namestyle/normal/.code={\relax},
- /argumentation/namestyle/italics/.code={\renewcommand{\argstyle}[1]{\emph{#1}}},
- /argumentation/namestyle/bold/.code={\renewcommand{\argstyle}[1]{\textbf{#1}}},
- /argumentation/namestyle/bolditalics/.code={\renewcommand{\argstyle}[1]{\emph{\textbf{#1}}}},
- /argumentation/namestyle/monospace/.code={\renewcommand{\argstyle}[1]{\texttt{#1}}},
- /argumentation/namestyle=normal,
+%%% Options for automatic indexing (and naming) of argument nodes
+\NewDocumentCommand { \argument } {} {\relax}
+\pgfkeys{/argumentation/.cd,
+ indexing/.is choice,
+ indexing/none/.code={
+ \RenewDocumentCommand { \argument } {O{} r() m dat d()} {
+ \IfNoValueTF {##5}{%
+ \node[argument size,argument,##1](##2) {\argstyle{##3}};
+ }{%
+ \node[argument size,argument,##1](##2) at (##5) {\argstyle{##3}};
+ }
+ }
+ },
+ indexing/numeric/.code={
+ \RenewDocumentCommand { \argument } {O{} d() m dat d()} {
+ \stepcounter{argument}
+ \IfNoValueTF {##2}{%
+ \IfNoValueTF {##5}{%
+ \node[argument size,argument,##1](a\arabic{argument}) {\argstyle{##3}};
+ }{%
+ \node[argument size,argument,##1](a\arabic{argument}) at (##5) {\argstyle{##3}};
+ }
+ }{%
+ \IfNoValueTF {##5}{%
+ \node[argument size,argument,##1](##2) {\argstyle{##3}};
+ }{%
+ \node[argument size,argument,##1](##2) at (##5) {\argstyle{##3}};
+ }
+ }
+ }
+ },
+ indexing/alphabetic/.code={
+ \RenewDocumentCommand { \argument } {O{} d() m dat d()} {
+ \stepcounter{argument}
+ \IfNoValueTF {##2}{%
+ \IfNoValueTF {##5}{%
+ \node[argument size,argument,##1](\alph{argument}) {\argstyle{##3}};
+ }{%
+ \node[argument size,argument,##1](\alph{argument}) at (##5) {\argstyle{##3}};
+ }
+ }{%
+ \IfNoValueTF {##5}{%
+ \node[argument size,argument,##1](##2) {\argstyle{##3}};
+ }{%
+ \node[argument size,argument,##1](##2) at (##5) {\argstyle{##3}};
+ }
+ }
+ }
+ },
+ indexing/.default=numeric,
+ indexing=numeric,
}
\ProcessPgfPackageOptions{/argumentation}
-%%%%%%%%%% Package Content %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%% AF Environment %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% Additional AF Style Parameters
\tikzset{ % global predefined tikz-styles
- argument size/.style={minimum size=0.7cm}, % Standard size of argument nodes
selfattack/.style={loop,min distance=2mm,in=0,out=60,looseness=5}, % Standard style for self-attacks
- inactive/.style={draw=black!30, text=black!40}, % Make a node or edge inactive, i.e., greyed out
+ inactive/.style={draw=black!30,text=black!40}, % Make a node or edge inactive, i.e., greyed out
incomplete/.style={densely dashed}, % Style for displaying incomplete nodes or attacks
- argin/.style={fill=green}, % Color an argument that is labelled in
- argout/.style={fill=red}, % Color an argument that is labelled out
- argundec/.style={fill=cyan}, % Color an argument that is labelled undecided
+ accepted/.style={fill=green}, % Color an argument that is labelled in
+ rejected/.style={fill=red}, % Color an argument that is labelled out
+ undecided/.style={fill=cyan}, % Color an argument that is labelled undecided
caption/.style={draw=none}, % Style for displaying AF name in Figure
invisible/.style={draw=none,text=black!0}, % Make a node or edge invisible
- annotation/.style={above,font=\small},
+ annotation/.style={font=\small}, % text annotation style
+ argin/.style={accepted},
+ argout/.style={rejected},
+ argundec/.style={undecided},
}
-% Commands for setting custom tikz-style parameters (experimental)
-\newcommand{\setargumentstyle}[1]{\tikzset{argument/.style={#1}}}
-\newcommand{\setattackstyle}[1]{\tikzset{attack/.style={#1}}}
-\newcommand{\setsupportstyle}[1]{\tikzset{support/.style={#1}}}
-
-%\newcommand{\setloopstyle}[1]{\tikzset{selfattack/.style={#1}}}
-%\newcommand{\adjustargumentstyle}[1]{\tikzset{argument/.append style={#1}}}
-%\newcommand{\adjustattackstyle}[1]{\tikzset{attack/.append style={#1}}}
-
-
-%%%%%%%%%%%%%%% Environment %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\pgfkeys{
- /tikz/small/.style = {node distance=0.55cm,argument size/.style={minimum size=0.55cm},caption/.append style={font=\small}},
- /tikz/tiny/.style = {node distance=0.35cm,argument size/.style={font=\small, minimum size=0.4cm},caption/.append style={font=\small}},
+%%% Options for af environment
+\pgfkeys{/tikz/.cd,
+ small/.style = {node distance=0.55cm,argument size/.style={minimum size=0.55cm},caption/.append style={font=\small}},
+ tiny/.style = {node distance=0.35cm,argument size/.style={minimum size=0.4cm,font=\small},caption/.append style={font=\small}},
}
+%%% Initializing the af environment
+\newcounter{af}
\newenvironment{af}[1][]{
+ \refstepcounter{af}
+ \setcounter{argument}{0}
+ \pgfkeys{/argumentation/.cd, #1}
\tikzpicture[#1]
}{%
\endtikzpicture
@@ -86,13 +204,17 @@
%%%%%%%%%%%%%%%% Commands %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Creates a node displaying the name of the AF
-\newcommand{\afname}[3][]{\node[caption,#1](#2){#3};}
+\NewDocumentCommand { \afname } { O{} D(){caption} m dat d()} {
+ \IfNoValueTF {#5}{%
+ \node[caption,#1](#2){#3};
+ }{%
+ \node[caption,#1](#2) at (#5) {#3};
+ }
+
+}
\newcommand{\annotation}[3][]{\node[annotation,above of=#2,#1](an_#2){#3};}
-% Creates an argument node
-\newcommand{\argument}[3][]{\node[argument,argument size,#1](#2){\argstyle{#3}};}
-
% Creates an attack edge
\newcommand{\attack}[3][]{\path(#2) edge [attack,#1] (#3);}
@@ -107,3 +229,14 @@
% Creates a support edge between two arguments
\newcommand{\support}[3][]{\path(#2) edge [support=0.35,#1] (#3);}
+
+%%% Commands for setting custom tikz-style parameters
+\newcommand{\setargumentstyle}[1]{\tikzset{argument/.style={#1}}}
+\newcommand{\setattackstyle}[1]{\tikzset{attack/.style={#1}}}
+\newcommand{\setsupportstyle}[1]{\tikzset{support/.style={#1}}}
+\newcommand{\setannotationstyle}[1]{\tikzset{annotation/.style={#1}}}
+
+%\newcommand{\setloopstyle}[1]{\tikzset{selfattack/.style={#1}}}
+%\newcommand{\adjustargumentstyle}[1]{\tikzset{argument/.append style={#1}}}
+%\newcommand{\adjustattackstyle}[1]{\tikzset{attack/.append style={#1}}}
+
diff --git a/graphics/pgf/contrib/circuitikz/doc/changelog.tex b/graphics/pgf/contrib/circuitikz/doc/changelog.tex
index d9594dc1fc..0806a20b78 100644
--- a/graphics/pgf/contrib/circuitikz/doc/changelog.tex
+++ b/graphics/pgf/contrib/circuitikz/doc/changelog.tex
@@ -5,6 +5,35 @@ 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
diff --git a/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf b/graphics/pgf/contrib/circuitikz/doc/circuitikz-context.pdf
index d4f9bc36a2..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 9d1e52303d..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 20a79f3d68..ac116af09e 100644
--- a/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
+++ b/graphics/pgf/contrib/circuitikz/doc/circuitikzmanual.tex
@@ -3266,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}{}
@@ -3287,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)
@@ -3324,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]
@@ -3342,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.
@@ -4827,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:
@@ -4869,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}
diff --git a/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty b/graphics/pgf/contrib/circuitikz/tex/circuitikz.sty
index 69ce1bbddd..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.8}
-\def\pgfcircversiondate{2024/05/05}
+\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 4978311dca..626ed28812 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
@@ -3696,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}}
@@ -6977,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}
@@ -6994,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}
@@ -7001,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}
@@ -7233,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}
{}
@@ -7340,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}
@@ -7355,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 7457dabb46..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}}
@@ -8613,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
@@ -8647,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%
diff --git a/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex b/graphics/pgf/contrib/circuitikz/tex/t-circuitikz.tex
index a738c664ea..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.8}
-\def\pgfcircversiondate{2024/05/05}
+\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/pgfgantt/README b/graphics/pgf/contrib/pgfgantt/README
index b46f25054c..017c065fc6 100644
--- a/graphics/pgf/contrib/pgfgantt/README
+++ b/graphics/pgf/contrib/pgfgantt/README
@@ -1,19 +1,22 @@
-The pgfgantt package v5.0
+The pgfgantt package v5.0a
------------------------------------------------------------------------------
This package is released under the LaTeX Project Public License v1.3c or later
-(see http://www.latex-project.org/lppl.txt).
+(see https://www.latex-project.org/lppl.txt).
The pgfgantt package provides the ganttchart environment, which
draws a Gantt chart within a TikZ picture. The user may add various
-elements to the chart, for example, titles, bars, groups, milestones and different
-links between these elements. The appearance of the chart elements
+elements to the chart, for example, titles, bars, groups, milestones and
+different links between these elements. The appearance of the chart elements
is highly customizable, and even new chart elements may be defined.
-The package makes use of pgf/TikZ (http://tug.ctan.org/pkg/pgf).
+The package requires pgf/TikZ (https://ctan.org/pkg/pgf).
Installation: Run pgfgantt.ins through LaTeX and follow the instructions.
+This package is unmaintained. If you want to volunteer to take over
+the maintenance, contact me at https://wolfgang.esser-skala.at/contact/ .
+
--
-Wolfgang Skala
-10th January 2018
+Wolfgang Esser-Skala
+2024-06-19
diff --git a/graphics/pgf/contrib/pgfgantt/pgfgantt-doc.pdf b/graphics/pgf/contrib/pgfgantt/pgfgantt-doc.pdf
new file mode 100644
index 0000000000..62c09d84c7
--- /dev/null
+++ b/graphics/pgf/contrib/pgfgantt/pgfgantt-doc.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/pgfgantt/pgfgantt.dtx b/graphics/pgf/contrib/pgfgantt/pgfgantt.dtx
index 7bb4d52138..e734668f59 100644
--- a/graphics/pgf/contrib/pgfgantt/pgfgantt.dtx
+++ b/graphics/pgf/contrib/pgfgantt/pgfgantt.dtx
@@ -1,19 +1,19 @@
% \iffalse meta-comment
%
-% Copyright (C) 2018 by Wolfgang Skala
+% Copyright (C) 2024 by Wolfgang Esser-Skala
%
% This work may be distributed and/or modified under the
% 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
+% https://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX
% version 2008/05/04 or later.
%
% \fi
%
% \iffalse
-%<pgfgantt>\ProvidesPackage{pgfgantt}[2018/01/10 v5.0 Draw Gantt diagrams with TikZ]
+%<pgfgantt>\ProvidesPackage{pgfgantt}[2024/06/19 v5.0a Draw Gantt diagrams with TikZ]
%<pgfgantt>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%
%<*driver>
@@ -181,30 +181,10 @@
\ignorespaces}
\let\endoption\endmacro
\let\endintmacro\endmacro
-\renewenvironment{theglossary}{\glossary@prologue\GlossaryParms\let\item\@idxitem\ignorespaces}{}
\makeatother
\AtBeginDocument{\lstMakeShortInline|}
-\begingroup
- \makeatletter
- \def\x\begingroup#1\@nil{%
- \endgroup
- \def\DoNotIndex{%
- \begingroup
- \@makeother\#%
- \@makeother\$%
- \@makeother\%%
- \@makeother\^%
- \@makeother\_%
- \@makeother\~%
- \@makeother\ %
- \@makeother\&%
- #1%
- }%
- }%
-\expandafter\x\DoNotIndex\@nil
-
\usepackage[
hyperfootnotes=false,
bookmarksnumbered,%
@@ -237,27 +217,13 @@
\def\TikZ{Ti\textit{k}Z}
\DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}}
-\def\GlossaryParms{%
- \def\pfill##1{}
- \parindent 0pt
- \parskip 0pt plus 1pt
- \small\raggedright
- \def\@idxitem{\par\hangindent 30pt}%
- \def\subitem{\@idxitem\hspace*{15pt}}%
- \def\subsubitem{\@idxitem\hspace*{25pt}}%
- \def\indexspace{\par\vspace{10pt plus 2pt minus 3pt}}%
-}
-
\usepackage{pgfgantt}
\usetikzlibrary{shadows,shadings,decorations.pathmorphing,shapes.misc}
\EnableCrossrefs
\CodelineIndex
-\RecordChanges
\IndexPrologue{\clearpage\section{Index}\markboth{Index}{Index}Bold numbers refer to the page where the corresponding entry is described; italic numbers refer to the code line of the definition; upright numbers refer to the code lines where the entry is used.}
-\GlossaryPrologue{\clearpage\section{Change History}\markboth{Change history}{Change history}}
-
\setkomafont{title}{\rmfamily\bfseries}
\addtokomafont{sectioning}{\rmfamily}
@@ -270,34 +236,15 @@
%</driver>
% \fi
%
-% \CheckSum{2245}
-%
-% \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
-% Lower-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
-% Digits \0\1\2\3\4\5\6\7\8\9
-% Exclamation \! Double quote \" Hash (number) \#
-% Dollar \$ Percent \% Ampersand \&
-% Acute accent \' Left paren \( Right paren \)
-% Asterisk \* Plus \+ Comma \,
-% Minus \- Point \. Solidus \/
-% Colon \: Semicolon \; Less than \<
-% Equals \= Greater than \> Question mark \?
-% Commercial at \@ Left bracket \[ Backslash \\
-% Right bracket \] Circumflex \^ Underscore \_
-% Grave accent \` Left brace \{ Vertical bar \|
-% Right brace \} Tilde \~}
-%
-%
% \GetFileInfo{pgfgantt.sty}
%
% \DoNotIndex{\@auxout,\@empty,\@firstoftwo,\@ifundefined,\@namedef,\@nameuse,\@tempa,\@tempb,\@tempc,\@tempcnta,\@tempcntb,\@tempdima,\advance,\anchor,\backgroundpath,\begin,\begingroup,\bfseries,\breakforeach,\clip,\csname,\def,\divide,\draw,\edef,\else,\end,\endcsname,\endgroup,\expandafter,\fi,\foreach,\global,\i,\ifcase,\ifdate,\ifdim,\ifnum,\ifx,\inheritanchor,\inheritanchorborder,\inheritbackgroundpath,\inheritsavedanchors,\itshape,\kernel@ifnextchar,\let,\multiply,\newcommand,\newcount,\newenvironment,\newif,\node,\normalcolor,\normalfont,\normalsize,\northeast,\outernortheast,\PackageError,\PackageWarning,\path,\pgf@process,\pgf@x,\pgf@y,\pgf@xa,\pgf@xb,\pgf@xc,\pgf@ya,\pgf@yb,\pgf@yc,\pgfcalendar,\pgfcalendarbeginjulian,\pgfcalendarcurrentday,\pgfcalendarcurrentjulian,\pgfcalendarcurrentmonth,\pgfcalendarcurrentweekday,\pgfcalendarcurrentyear,\pgfcalendardatetojulian,\pgfcalendarendiso,\pgfcalendarifdateday,\pgfcalendarifdatemonth,\pgfcalendarifdateyear,\pgfcalendarjuliantodate,\pgfcalendarmatchestrue,\pgfdeclareshape,\pgfextractx,\pgfkeys,\pgfkeyscurrentname,\pgfkeyssetvalue,\pgfkeysvalueof,\pgfmathparse,\pgfmathprintnumber,\pgfmathresult,\pgfmathsetlength,\pgfmathsetmacro,\pgfpathclose,\pgfpathlineto,\pgfpathmoveto,\pgfpoint,\pgfpointadd,\pgfpointanchor,\pgfpointdiff,\pgfpointscale,\pgfqkeys,\protected@write,\relax,\RequirePackage,\savedanchor,\scriptsize,\setcounter,\small,\southwest,\stepcounter,\string,\strut,\t,\the,\tikz@align@newline,\usetikzlibrary,\value,\x,\xdef}
%
-%
+%
% \title{Drawing Gantt Charts in \LaTeX\\with \TikZ}
% \subtitle{The \texttt{pgfgantt} Package}
-% \author{Wolfgang Skala\thanks{Department of Biosciences, University of Salzburg, Austria; \texttt{Wolfgang.Skala@sbg.ac.at}}}
-% \date{\fileversion\\\filedate}
+% \author{\texorpdfstring{Wolfgang Esser-Skala\thanks{Computational Systems Biology Group, Department of Biosciences and Medical Biology, University of Salzburg, Austria; \texttt{Wolfgang.Esser-Skala@plus.ac.at}}}{Wolfgang Esser-Skala}}
+% \date{\fileversion\\\filedate}
% \maketitle
%
% \begin{abstract}
@@ -305,72 +252,13 @@
% \end{abstract}
%
% \clearpage\tableofcontents
-% \changes{v5.0}{2018/01/10}{\cs{gantttitlecalendar} now recognizes the \texttt{decade} key.}
-% \changes{v5.0}{2018/01/10}{Key \texttt{compress calendar} has been replaced by \texttt{time slot unit} to allow an additional level of compression (year).}
-% \changes{v5.0}{2018/01/10}{The command \cs{ganttvrule} allows to draw general vertical rules (similar to the today rule). The keys \texttt{vrule}, \texttt{vrule offset}, \texttt{vrule label font} and \texttt{vrule label text} configure those rules.}
-% \changes{v5.0}{2018/01/10}{The key \texttt{expand chart} was added, which specifies that a chart should expand horizontally to a given dimension.}
-% \changes{v5.0}{2018/01/10}{The key \texttt{title label text} was added to allow fine-tuning of title label formatting.}
-% \changes{v5.0}{2018/01/10}{Made \pack{pgfgantt} robust to \pack{amsgen}'s redefinition of \cs{@ifstar}.}
-% \changes{v4.0}{2013/06/01}{The key \texttt{link label anchor} was renamed to \texttt{link label node}.}
-% \changes{v4.0}{2013/06/01}{\cs{newganttchartelement} defines completely new chart elements.}
-% \changes{v4.0}{2013/06/01}{The key \texttt{progress label anchor} was replaced by \texttt{bar}/\texttt{group}/\texttt{milestone progress label node}.}
-% \changes{v4.0}{2013/06/01}{The keys \texttt{bar}/\texttt{group}/\texttt{milestone progress label anchor} were added.}
-% \changes{v4.0}{2013/06/01}{The key \texttt{progress label font} was replaced by the keys \texttt{bar}/\texttt{group}/\texttt{milestone progress label font}.}
-% \changes{v4.0}{2013/06/01}{The key \texttt{incomplete} was removed.}
-% \changes{v4.0}{2013/06/01}{The keys \texttt{group right}/\texttt{left peak} and \texttt{group peaks} were replaced by \texttt{group right}/\texttt{left peak tip position}, \texttt{group peaks tip position}, \texttt{group right}/\texttt{left peak width}, \texttt{group peaks width}, \texttt{group right}/\texttt{left peak height} and \texttt{group peaks height}.}
-% \changes{v4.0}{2013/06/01}{Chart elements are now nodes, so the corresponding styles must specify a node shape.}
-% \changes{v4.0}{2013/06/01}{The key \texttt{time slot modifier} was renamed to \texttt{chart element start border}.}
-% \changes{v4.0}{2013/06/01}{The keys \texttt{bar}/\texttt{group}/\texttt{milestone label inline anchor} were renamed to \texttt{bar}/\texttt{group}/\texttt{milestone inline label node}.}
-% \changes{v4.0}{2013/06/01}{The keys \texttt{bar}/\texttt{group}/\texttt{milestone label shape anchor} were renamed to \texttt{bar}/\texttt{group}/\texttt{milestone inline label anchor}.}
-% \changes{v4.0}{2013/06/01}{The keys \texttt{bar}/\texttt{group}/\texttt{milestone label anchor} were renamed to \texttt{bar}/\texttt{group}/\texttt{milestone label node}.}
-% \changes{v4.0}{2013/06/01}{The key \texttt{title label anchor} was renamed to \texttt{title label node}.}
-% \changes{v4.0}{2013/06/01}{\cs{gantttitlecalendar} prints a title calendar.}
-% \changes{v4.0}{2013/06/01}{The keys \texttt{calendar week text} and \texttt{compress calendar} were added.}
-% \changes{v4.0}{2013/06/01}{The key \texttt{newline shortcut} determines whether the shortcut for line breaks is defined in the chart. In this case, \cs{ganttalignnewline} allows line breaks in the node text.}
-% \changes{v4.0}{2013/06/01}{The keys \texttt{today offset}, \texttt{today label font} and \texttt{today label node} were added.}
-% \changes{v4.0}{2013/06/01}{The key \texttt{today} accepts a time slot specifier.}
-% \changes{v4.0}{2013/06/01}{The canvas is now a node with shape \texttt{rectangle} by default.}
-% \changes{v4.0}{2013/06/01}{\cs{newgantttimeslotformat} allows the user to define custom time slot formats.}
-% \changes{v4.0}{2013/06/01}{The key \texttt{time slot format/start date} specifies the internal date representation of digit 1 in the \texttt{simple} time slot format.}
-% \changes{v4.0}{2013/06/01}{The key \texttt{time slot format/base century} provides the century for autocompletion of two-digit years.}
-% \changes{v4.0}{2013/06/01}{The key \texttt{time slot format} changes the format of time slot specifiers.}
-% \changes{v4.0}{2013/06/01}{The \texttt{ganttchart} environment now requires two mandatory arguments.}
-%
-% \changes{v3.0}{2012/01/25}{\cs{setganttlinklabel} specifies the label for all links of a certain type. The \texttt{link label} key locally overrides any label set by this command.}
-% \changes{v3.0}{2012/01/25}{The \texttt{chart element} shape supports four additional anchors (\texttt{on left}, \texttt{on top}, \texttt{on right} and \texttt{on bottom}).}
-% \changes{v3.0}{2012/01/25}{\cs{@gtt@get} has been renamed to \cs{ganttvalueof} to provide a convenient access for link type authors.}
-% \changes{v3.0}{2012/01/25}{\cs{@gtt@keydef} and \cs{@gtt@stylekeydef} have been rewritten to support \texttt{pgfkey}'s abilities to store key values.}
-% \changes{v3.0}{2012/01/25}{New auxiliary macros for \cs{newganttlinkstyle}: \cs{xLeft}, \cs{xRight}, \cs{yUpper}, \cs{yLower}, \cs{ganttsetstartanchor}, \cs{ganttsetendanchor} and \cs{ganttlinklabel}.}
-% \changes{v3.0}{2012/01/25}{Completely rewrote the code for links (again). Definition of new link types is now possible (via \cs{newganttlinktype} and \cs{newganttlinktypealias}).}
-% \changes{v3.0}{2012/01/25}{The \texttt{bar/group/milestone label shape anchor} keys allow for a fine-tuned placement of chart element labels.}
-% \changes{v3.0}{2012/01/25}{All style keys (\texttt{canvas}, \texttt{bar} etc.) only support the common \TikZ\ style key syntax.}
-% \changes{v2.1}{2011/11/10}{The \texttt{inline} key moves labels close to their respective chart elements.}
-% \changes{v2.1}{2011/11/10}{Added three keys (\texttt{bar/group/milestone label inline anchor}) for placing inline labels.}
-% \changes{v2.1}{2011/11/10}{The \texttt{ganttchart} environment may be used outside a \texttt{tikzpicture}.}
-% \changes{v2.0}{2011/10/10}{The syntax of \cs{ganttlink} was completely changed. The command now takes one optional and \textit{two} mandatory arguments. The latter specify the name of the chart elements to be linked. Consequently, the keys \texttt{b-b}, \texttt{b-m}, \texttt{m-b} and \texttt{m-m} were removed. The keys \texttt{s-s}, \texttt{s-f}, \texttt{f-s} and \texttt{f-f} are now values for the \texttt{link type} key.}
-% \changes{v2.0}{2011/10/10}{The optional argument of \cs{ganttnewline} now also accepts a style.}
-% \changes{v2.0}{2011/10/10}{Removed the \texttt{hgrid shift} and \texttt{last line height} keys.}
-% \changes{v2.0}{2011/10/10}{Removed the \texttt{vgrid lines list} key, as its behaviour can be simulated by an appropriate \meta{style list} for \texttt{vgrid}.}
-% \changes{v2.0}{2011/10/10}{Added style lists for the horizontal and vertical grid.}
-% \changes{v2.0}{2011/10/10}{Removed the \texttt{vgrid style} key.}
-% \changes{v2.0}{2011/10/10}{Completely rewrote the calculation of coordinates.}
-% \changes{v2.0}{2011/10/10}{The \texttt{x unit}, \texttt{y unit title} and \texttt{y unit chart} keys specify the width of time slots and the height of title or chart lines, respectively. Thus, one can draw titles whose height differs from the rest of the chart. Furthermore, the $x$- and $y$-dimensions of the chart are independent of the dimensions of the surrounding \texttt{tikzpicture}.}
-% \changes{v1.1}{2011/04/18}{\texttt{link tolerance} decides whether a five- or a three-part link is drawn.}
-% \changes{v1.1}{2011/04/18}{\texttt{milestone label text} configures the text of a milestone label.}
-% \changes{v1.1}{2011/04/18}{\texttt{bar label text} configures the text of a bar label.}
-% \changes{v1.1}{2011/04/18}{The \texttt{time slot modifier} key has been added. If set to zero, all $x$-coordinates are interpreted as given, without regarding them as time slots.}
-% \changes{v1.1}{2011/04/18}{The \texttt{vgrid lines list} key determines the number of vertical grid lines drawn.}
-% \changes{v1.1}{2011/04/18}{The introduction clarifies what I mean by ``a current \textsc{pgf} installation''.}
-% \changes{v1.1}{2011/04/18}{\texttt{group label text} configures the text of a group label.}
-% \changes{v1.0}{2011/03/01}{Initial release}
-%
%
% \clearpage\section{Introduction}
%
-% The \pack{pgfgantt} package allows you to draw Gantt charts in \LaTeX. Thus, you can describe simple project schedules without having to include images produced by external programs. Similar to Martin Kumm's \pack{gantt} package\footnote{\url{http://www.martin-kumm.de/tex_gantt_package.php}} (which inspired \pack{pgfgantt}'s fundamental aspects), \pack{pgfgantt} bases upon \textsc{pgf} and its \TikZ\ frontend\footnote{\url{http://ctan.org/tex-archive/graphics/pgf/}}. Besides, it provides a comprehensive (and portable) alternative to \pack{pst-gantt}\footnote{\url{http://ctan.org/tex-archive/graphics/pstricks/contrib/pst-gantt/}}.
+% The \pack{pgfgantt} package allows you to draw Gantt charts in \LaTeX. Thus, you can describe simple project schedules without having to include images produced by external programs. Similar to Martin Kumm's \pack{gantt} package\footnote{\url{https://www.martin-kumm.de/tex_gantt_package.php}} (which inspired \pack{pgfgantt}'s fundamental aspects), \pack{pgfgantt} bases upon \textsc{pgf} and its \TikZ\ frontend\footnote{\url{https://ctan.org/pkg/pgf/}}. Besides, it provides a comprehensive (and portable) alternative to \pack{pst-gantt}\footnote{\url{https://ctan.org/pkg/pst-gantt/}}.
%
% \paragraph{Requirements} \pack{pgfgantt} requires a \textit{current} \textsc{pgf} installation. Note that the version number must at least be 2.10, dated October 25th, 2010. Furthermore, \pack{pgfgantt}~\fileversion\ and above is not fully downwards compatible.
-%
+%
% \paragraph{Suggestions} Please report any suggestions and improvements at the project's GitHub page (\url{https://github.com/skafdasschaf/latex-pgfgantt}).
%
% \paragraph{Acknowledgements} I would like to thank the following people for their ideas concerning new features:
@@ -425,7 +313,7 @@
% \end{ganttchart}
% \end{center}
%
-%
+%
% \subsection{Specifying Keys}
%
% \textit{Keys} (sometimes called \textit{options}) modify the output from \pack{pgfgantt}'s commands. You may specify a key in two ways: (1) Pass it to the optional argument present in each command, e.\,g.
@@ -439,7 +327,7 @@
% Since \pack{pgfgantt} uses the \pack{pgfkeys} package for key management, all its keys reside in the |/pgfgantt/| path. However, if you set your keys by one of the methods explained above, this path is automatically prepended to each key.
%
% \subsection{The Canvas}
-%
+%
% Let us have a look at the basic anatomy of a Gantt chart and define some common terms. Each \textit{chart} consists of several \textit{lines}, which may contain one or more \textit{title elements} (at the top) or \textit{chart elements} (such as bars, groups and milestones). From left to right, the chart is divided into an integer number of \textit{time slots} that represent the basic $x$-unit.
%
% The \DescribeEnv{ganttchart}|ganttchart| environment draws a single Gantt chart:
@@ -449,7 +337,7 @@
% \end{ganttchart}
% \end{texcode}
% The environment has one optional argument, which specifies the \meta{options} for the chart, and two mandatory arguments, which indicate the start and end time slot specifier. Although you will often put a |ganttchart| into a |tikzpicture| environment, you may actually use this environment on its own. \pack{pgfgantt} checks whether a chart is surrounded by a |tikzpicture| and adds this environment if necessary.
-%
+%
% \begin{key}{time slot format}{\meta{format}}{simple}
% Sets the \meta{format} of time slot specifiers. A \textbf{time slot specifier} (abbreviated ``tss'') denotes a certain time slot along the horizontal axis. \pack{pgfgantt} defines a range of formats:
% \begin{itemize}
@@ -469,23 +357,23 @@
% \textit{Examples:} \texttt{2013-03-14}, \texttt{13/03/14}, \texttt{2013.3.14}
% \end{itemize}
% \end{key}
-%
+%
% \noindent Two subkeys of \opt{time slot format} let you configure \pack{pgfgantt}'s behavior regarding automatic completion of abbreviated dates:
-%
+%
% \begin{key}{time slot format/base century}{\meta{year}}{2000}
% Sets the century for auto-completion of two-digit years (used by the time slot formats \texttt{little-endian}, \texttt{middle-endian} and \texttt{big-endian}). Consequently, default settings convert a year like \texttt{13} to \texttt{2013}.
% \end{key}
-%
+%
% \begin{key}{time slot format/start date}{\meta{ISO-standard date}}{2000-01-01}
% Numbers denoting time slots in the \texttt{simple} format are internally converted to a date, where \texttt{1} is converted to \meta{ISO-standard date}, \texttt{2} to $\meta{ISO-standard date} + 1$ etc.
% \end{key}
-%
+%
% \bigskip\noindent Advanced users may add their own time slot \DescribeMacro{\newgantttimeslotformat}formats:
% \begin{texcode}
% \newgantttimeslotformat`\marg{name}\marg{converter code}'
% \end{texcode}
% Defines a new time slot format called \meta{name}. The \meta{converter code} must convert the time slot specifier stored in |#1| to its corresponding Julian day number (see section~57 of the \TikZ\ manual) and assign this number to the count register |#2|. The \meta{converter code} is executed within a \TeX\ group, so you may use temporary macros like |\@tempa|, counts like |\@tempcnta| etc.
-%
+%
% For example, we would like to create a format called \texttt{stardate}, where dates are given as ``\meta{year}\texttt{.}\meta{day of year}''. Thus, we will enter 24th February 2259 as ``\texttt{2259.55}''. To this end, we write the following code:
% \par\bigskip\noindent
% \begin{texcode}[numbers=left]
@@ -498,10 +386,10 @@
% \advance#2 by-1\relax%
% \advance#2 by\stardateday\relax%
% }
-%
+%
% \begin{ganttchart}[
% hgrid,
-% vgrid,
+% vgrid,
% time slot format=stardate
% ]{2259.55}{2259.67}
% \gantttitlecalendar{year, month=name, day} \\
@@ -517,18 +405,18 @@
% \advance#2 by-1\relax%
% \advance#2 by\stardateday\relax%
% }
-%
+%
% \begin{ganttchart}[
% hgrid,
-% vgrid,
+% vgrid,
% time slot format=stardate
% ]{2259.55}{2259.67}
% \gantttitlecalendar{year, month=name, day} \\
% \end{ganttchart}
% \end{center}
-%
+%
% \noindent The macro |\decomposestardate| (lines 2--4) has two delimited arguments: The first one is delimited by a period and the second one by |\relax|. The call in line 5 decomposes the tss stored in |#1| and saves the day in |\stardateday| and the year in |\stardateyear|. |\pgfcalendardatetojulian| (section~57.1.1 of the \TikZ\ manual) calculates the Julian date of the first day of |\stardateyear| and stores it in |#2| (line 6). We then subtract 1 from |#2| (line 7) and add the |\stardateday| (line 8).
-%
+%
% \begin{key}[./style=]{canvas}{\meta{style}}{shape=rectangle, draw, fill=white}
% The \opt{canvas} key changes the appearance of the canvas. \meta{style} is a list of \TikZ\ keys suitable for the \meta{options} of a \TikZ\ node (such as |shape=rectangle|, |fill| or |draw|; see chapter~16 of the \TikZ\ manual). By default, the canvas is a white rectangle with a black frame.
% \par\bigskip\noindent
@@ -617,9 +505,9 @@
% \opt{hgrid} draws a horizontal grid which starts immediately below the last title element. The key can be specified in four different ways: Firstly, \opt{hgrid}|=false| eliminates the horizontal grid. You may omit this declaration, since it is the default. Secondly, both \opt{hgrid} and \opt{hgrid}|=true| activate the horizontal grid, which is then drawn in the default style |dotted|. Finally, \opt{hgrid}|=|\meta{style list} draws the horizontal grid in the given \meta{style list} (see below).
%
% \opt{hgrid style} changes the style of single horizontal grid lines that are drawn with |\ganttnewline[grid]| (see section~\ref{ssc:LineBreaks}).
-%
+%
% The \opt{vgrid} key governs the vertical grid; otherwise, use it exactly like \opt{hgrid}.
-%
+%
% \textit{Style lists} allow you to draw the grid lines in different styles. Each style list consists of several \textit{style list items} separated by a comma. A style list item has the general syntax |*{|\meta{n}|}{|\meta{style}|}| and orders the package to repeat the \meta{style} \meta{n}-times. (This syntax is reminiscent of column specifications in a |tabular| environment.) Thus, the list |*2{red}, *1{green}, *{10}{blue, dashed}| instructs \pack{pgfgantt} to draw first two red vertical grid lines, then a green one and finally ten dashed blue lines. If any grid lines remain to be drawn at the end of the list, the package starts again at the beginning of the list.
% \par\bigskip\noindent
% \begin{texcode}
@@ -642,7 +530,7 @@
% \ganttbar{}{9}{20}
% \end{ganttchart}
% \end{center}
-%
+%
% In most situations, you can omit the multiplier |*1|. Hence, the following style lists are equal:\\
% |{*1{red}, *1{blue, dashed}}|\\
% |{{red}, {blue, dashed}}|\\
@@ -653,7 +541,7 @@
% \begin{minipage}[t]{.45\textwidth}
% \begin{texcode}
% % wrong code
-%
+%
% \begin{ganttchart}[
% hgrid=true,
% vgrid={{red, dotted}}
@@ -667,7 +555,7 @@
% \begin{minipage}[t]{.45\textwidth}
% \begin{texcode}
% % correct code
-%
+%
% \begin{ganttchart}[
% hgrid=true,
% vgrid={*1{red, dotted}}
@@ -717,7 +605,7 @@
% \end{ganttchart}
% \end{center}
% \end{key}
-%
+%
% \begin{key}{today}{\meta{tss}}{none}
% \keyline{today offset}{\meta{number}}{1}
% \keyline[/.style=]{today rule}{\meta{style}}{dashed, line width=1pt}
@@ -787,13 +675,13 @@
% \end{ganttchart}
% \end{center}
% \end{key}
-%
-%
+%
+%
% \subsection{Line Breaks between Chart Elements}
% \label{ssc:LineBreaks}
%
% \pack{pgfgantt} does not automatically begin a new line after finishing a \DescribeMacro{\ganttnewline}chart element. Instead, you must insert an explicit line break with |\ganttnewline|.
-%
+%
% \begin{key}{newline shortcut}{\meta{boolean}}{true}
% If true, \DescribeMacro{\\}|\\| is defined as a shortcut for |\ganttnewline| within a |ganttchart| environment, so that the syntax is reminiscent of \LaTeX's |tabular| enviroment.
% \par\bigskip\noindent
@@ -868,7 +756,7 @@
% }{1}{3}
% \end{ganttchart}
% \end{center}
-%
+%
% Even if you prefer a canvas without a horizontal grid, you may nevertheless want to separate certain lines by a grid rule. For this purpose, specify the optional argument |[grid]| for |\ganttnewline| (or |\\|), which draws a grid rule in \opt{hgrid style} between the current and the new line. Alternatively, directly give the desired style as optional argument.
% \par\bigskip\noindent
% \begin{texcode}
@@ -921,7 +809,7 @@
% \gantttitlelist`\oarg{options}\marg{pgffor list}\marg{length of each element}'
% \end{texcode}
% This macro generates one title element for each element of the \meta{pgffor list}. The second mandatory argument specifies the \meta{length of each element}. Refer to section~56 of the \TikZ\ manual for the detailed syntax for the \meta{pgffor list}.
-%
+%
% A simple application is to draw twelve title elements that contain the numbers from 1 to 12. The \meta{pgffor list} is |1,...,12|.
% \par\bigskip\noindent
% \begin{texcode}
@@ -942,9 +830,9 @@
% \begin{texcode}
% \gantttitle{1}{1} \gantttitle{2}{1} `\dots' \gantttitle{12}{1} \\
% \end{texcode}
-%
+%
% As an advanced example, we will draw seven title elements containing the names of the weekdays (``Mon'' to ``Sun''). To this end, we introduce an additional key:
-%
+%
% \begin{key}{title list options}{\meta{pgffor options}}{var=\string\x, evaluate=\string\x}
% Changes the \meta{pgffor options} of the |\foreach| command called by |\gantttitlelist| (see section~56 of the \TikZ\ manual). The macro that yields the labels to be printed by |\gantttitlelist| must be called |\x|.
% \par\bigskip\noindent\shorthandoff{"}
@@ -971,7 +859,7 @@
% \end{ganttchart}
% \end{center}\shorthandon{"}
% \end{key}
-%
+%
% \bigskip While you actually may build any chart title with the two commands described previously, \DescribeMacro{\gantttitlecalendar}|\gantttitlecalendar| saves a lot of time when you wish to create elaborate calendars:
% \begin{texcode}
% \gantttitlecalendar`\oarg{options}\marg{calendar lines}'
@@ -999,7 +887,7 @@
% \bottomrule
% \end{tabular}
% \end{center}
-%
+%
% The \meta{number} for the \texttt{week} line type is the number of the first week in the calendar.
% \par\bigskip\noindent
% \begin{texcode}
@@ -1024,16 +912,16 @@
% \ganttbar{}{2013-01-14}{2013-01-17}
% \end{ganttchart}\hspace*{-51.4pt}
% \end{center}
-%
+%
% You can easily add new output formats for \texttt{month} and \texttt{weekday}. The predefined ones use the macros described in section~57.1.3 of the \TikZ\ manual. For example, |weekday=name| calls |\pgfcalendarweekdayname|. Thus, new macros called |\pgfcalendarmonth|\textcolor{RoyalBlue}{\meta{output format}} or |\pgfcalendarweekday|\textcolor{RoyalBlue}{\meta{output format}} will provide additional \meta{output format}s for |month| and |weekday|, respectively.
-%
+%
% A weekday output format called |letter|, which displays a weekday as single letter, might be implemented as follows:
% \par\bigskip\noindent
% \begin{texcode}
% \def\pgfcalendarweekdayletter#1{%
% \ifcase#1M\or T\or W\or T\or F\or S\or S\fi%
% }
-%
+%
% \begin{ganttchart}[
% hgrid,
% vgrid,
@@ -1050,7 +938,7 @@
% \def\pgfcalendarweekdayletter#1{%
% \ifcase#1M\or T\or W\or T\or F\or S\or S\fi%
% }
-%
+%
% \begin{ganttchart}[
% hgrid,
% vgrid,
@@ -1063,7 +951,7 @@
% }
% \end{ganttchart}
% \end{center}
-%
+%
% \begin{key}{calendar week text}{\meta{format}}{Week\string~\string\currentweek}
% Changes the text displayed in a week title element. In \meta{format}, four additional macros are available: \DescribeMacro{\currentweek}|\currentweek| is the current week number; \DescribeMacro{\startyear}|\startyear|, \DescribeMacro{\startmonth}|\startmonth| and \DescribeMacro{\startday}|\startday| expand to the year, month and day of the current week's Monday.
% \par\bigskip\noindent
@@ -1100,7 +988,7 @@
% \end{ganttchart}
% \end{center}
% \end{key}
-%
+%
% \begin{key}{time slot unit}{\texttt{day}\space\textbar\space\texttt{month}\space\textbar\space\texttt{year}}{day}
% By default, one \textit{calendar day} is one time slot wide. With \opt{time slot unit}\texttt{=month}, one \textit{month} corresponds to one time slot. Consequently, in such calendars only |year| and |month| are sensible line types for |\gantttitlecalendar|, and the time slot format \texttt{isodate-yearmonth} is especially suited.
% \par\bigskip\noindent
@@ -1226,7 +1114,7 @@
% \end{ganttchart}
% \end{center}
% \end{key}
-%
+%
% \begin{key}{title left shift}{\meta{factor}}{0}
% \keyline{title right shift}{\meta{factor}}{0}
% \keyline{title top shift}{\meta{factor}}{0}
@@ -1394,7 +1282,7 @@
%
%
% \subsection{Predefined Chart Elements}
-%
+%
% \pack{pgfgantt} predefines three chart elements:
% \begin{enumerate}
% \item \DescribeMacro{\ganttbar}\textit{Bars} indicate the duration of a task or one of its parts.
@@ -1411,7 +1299,7 @@
% \end{texcode}
% \end{enumerate}
% Each of these macros draws a \meta{label}ed chart element from the \meta{start tss} to the \meta{end tss} (or at the given \meta{tss} in case of |\ganttmilestone|).
-%
+%
% \par\bigskip\noindent
% \begin{texcode}
% \begin{ganttchart}[vgrid, hgrid]{1}{12}
@@ -1443,7 +1331,7 @@
% \begin{minipage}[t]{.49\textwidth}
% \begin{texcode}
% % Short version
-%
+%
% \begin{ganttchart}[
% vgrid,
% hgrid
@@ -1459,7 +1347,7 @@
% \begin{minipage}[t]{.47\textwidth}
% \begin{texcode}
% % Long version
-%
+%
% \begin{ganttchart}[
% vgrid,
% hgrid
@@ -1475,7 +1363,7 @@
% \end{ganttchart}
% \end{texcode}
% \end{minipage}
-%
+%
% \begin{center}
% \begin{ganttchart}[
% vgrid,
@@ -1488,7 +1376,7 @@
% \ganttlinkedbar{Task 3}{7}{11}
% \end{ganttchart}
% \end{center}
-%
+%
% \begin{key}{chart element start border}{\texttt{left}\space\textbar\space\texttt{right}}{left}
% Determines which border of the start time slot a chart element touches. \texttt{left} is the behavior usually expected, while \texttt{right} strictly interprets the start time slot as an $x$-coordinate.
% \par\bigskip\noindent
@@ -1511,10 +1399,10 @@
% \end{ganttchart}
% \end{center}
% \end{key}
-%
-%
+%
+%
% \subsubsection{Options: Chart Element Appearance}
-%
+%
% The following options are similar for all predefined (and user-defined) chart elements:
%
% \begin{key}[/.style=]{bar}{\meta{style}}{shape=ganttbar, inner sep=0pt, draw, fill=white}
@@ -1558,9 +1446,9 @@
% \end{center}
% \end{key}
%
-%
+%
% \subsubsection{Options: Label Formatting}
-%
+%
% \begin{key}{bar label text}{\meta{text}}{\string\strut\#1}
% \keyline{group label text}{\meta{text}}{\string\strut\#1}
% \keyline{milestone label text}{\meta{text}}{\string\strut\#1}
@@ -1611,7 +1499,7 @@
% \end{ganttchart}
% \end{center}
% \end{key}
-%
+%
% \begin{key}{inline}{\meta{boolean}}{false}
% \keyline{bar inline label anchor}{\meta{anchor}}{center}
% \keyline{group inline label anchor}{\meta{anchor}}{center}
@@ -1650,10 +1538,10 @@
% \end{ganttchart}
% \end{center}
% \end{key}
-%
-%
+%
+%
% \subsubsection{Options: Chart Element Positioning}
-%
+%
% \begin{key}{bar left shift}{\meta{factor}}{0}
% \keyline{bar right shift}{\meta{factor}}{0}
% \keyline{bar top shift}{\meta{factor}}{.3}
@@ -1667,7 +1555,7 @@
% \keyline{milestone top shift}{\meta{factor}}{.3}
% \keyline{milestone height}{\meta{factor}}{.4}
% Shift the coordinates of a chart element's borders (\opt{\dots\ shift}) and change its height (\opt{\dots\ height}).
-%
+%
% \begin{center}
% \begin{tikzpicture}[x=.5cm, y=1cm]
% \begin{ganttchart}[vgrid, hgrid]{1}{8}
@@ -1701,7 +1589,7 @@
% \draw[-latex,teal] (8,-4.2) node[right] {End time slot (6)} -- (6,-3.8);
% \end{tikzpicture}
% \end{center}
-%
+%
% The three following figures illustrate the distances modified by these keys. The first figure shows a Gantt chart with a bar, two lines and one time slot.
% \begin{center}
% \begin{tikzpicture}[x=8cm, y=2cm]
@@ -1809,7 +1697,7 @@
% -- (.4,-.85);
% \end{tikzpicture}
% \end{center}
-%
+%
% \begin{key}{group right peak tip position}{\meta{fraction}}{0.5}
% \keyline{group right peak width}{\meta{factor}}{0.4}
% \keyline{group right peak height}{\meta{factor}}{0.1}
@@ -1820,7 +1708,7 @@
% \keyline{group peaks width}{\meta{factor}}{\textrm{(none)}}
% \keyline{group peaks height}{\meta{factor}}{\textrm{(none)}}
% Change the appearance of the peaks at both ends of a group. By default, both the left and right peak are 0.4~units wide and 0.1~units high, their tips lie between the peak sides. The \opt{group peaks \dots} keys set the dimensions for both peaks simultaneously. The figure below exemplifies the keys that apply to the left peak.
-%
+%
% \begin{center}
% \begin{tikzpicture}[x=8cm, y=2cm]
% \small
@@ -1845,7 +1733,7 @@
% \end{tikzpicture}
% \end{center}
% \end{key}
-%
+%
% For example, you might devise the following layout: Bars are small and rounded; they do not touch the borders of their start and end time slots. Groups stay within the start and end time slot, and the peaks are more acute.
% \par\bigskip\noindent
% \begin{texcode}
@@ -1887,12 +1775,12 @@
% \end{ganttchart}
% \end{center}
% \end{key}
-%
-%
+%
+%
% \subsubsection{Options: Progress}
-%
+%
% The \textit{progress} of a chart element illustrates the extent to which this element has been completed.
-%
+%
% \begin{key}{progress}{\texttt{none}\space\textbar\space\texttt{today}\space\textbar\space\meta{number}}{none}
% Indicates that a chart element is \meta{number} percent complete. The value \texttt{none} turns progress calculations off.
% \par\bigskip\noindent
@@ -1950,7 +1838,7 @@
% \end{ganttchart}
% \end{center}
% \end{key}
-%
+%
% \begin{key}[/.style=]{bar incomplete}{\meta{style}}{/pgfgantt/bar, fill=black!25}
% \keyline[/.style=]{group incomplete}{\meta{style}}{/pgfgantt/group, fill=black!25}
% \keyline[/.style=]{milestone incomplete}{\meta{style}}{/pgfgantt/milestone, fill=black!25}
@@ -1993,7 +1881,7 @@
% \end{ganttchart}
% \end{center}
% \end{key}
-%
+%
% \begin{key}{progress label text}{\meta{text}}{\string\pgfmathprintnumber[precision=0, verbatim]\{\#1\}\string\% complete}
% \keyline{bar progress label anchor}{\meta{anchor}}{east}
% \keyline{bar progress label font}{\meta{font commands}}{\string\scriptsize}
@@ -2047,16 +1935,16 @@
% \end{ganttchart}
% \end{center}
% \end{key}
-%
-%
+%
+%
% \subsubsection{New Node Shapes}
% \label{sss:NewNodeShapes}
-%
+%
% \pack{pgfgantt} defines three new node shapes:
-%
+%
% \bigskip\noindent
% (1) The \texttt{ganttbar} node shape derives from shape \texttt{rectangle} (section~48.2 of the \TikZ\ manual). It provides four additional anchors: \texttt{on top}, \texttt{on bottom}, \texttt{on left} and \texttt{on right}. The \meta{fraction} set by the following keys indicates a position between the left and right (for \texttt{on top} and \texttt{on bottom}) or upper and lower border (for \texttt{on left} and \texttt{on right}), similarly to the \opt{/tikz/pos} key.
-%
+%
% \begin{key}{on top fraction}{\meta{fraction}}{0.5}
% \keyline{on bottom fraction}{\meta{fraction}}{0.5}
% \keyline{on left fraction}{\meta{fraction}}{0.5}
@@ -2097,7 +1985,7 @@
% \end{tikzpicture}
% \end{center}
% \end{key}
-%
+%
% \bigskip\noindent
% (2) The \texttt{ganttgroup} node shape also derives from shape \texttt{rectangle}. It provides the additional anchors \texttt{on top}, \texttt{on bottom}, \texttt{on left}, \texttt{on right} (same as above), \texttt{left peak} and \texttt{right peak}.
% \begin{center}
@@ -2138,7 +2026,7 @@
% node [\placement] {\scriptsize\texttt{(s.\anchor)}};
% \end{tikzpicture}
% \end{center}
-%
+%
% \bigskip\noindent
% (3) The \texttt{ganttmilestone} node shape derives from shape \texttt{diamond} (section~48.3 of the \TikZ\ manual), but does not consider any aspect ratio. It provides the additional anchors \texttt{on top}, \texttt{on bottom}, \texttt{on left} and \texttt{on right} (same as above).
% \begin{center}
@@ -2172,19 +2060,19 @@
% node [\placement] {\scriptsize\texttt{(s.\anchor)}};
% \end{tikzpicture}
% \end{center}
-%
-%
+%
+%
% \subsection{Defining Custom Chart Elements}
-%
+%
% You may define completely new chart elements with
% \begin{texcode}
% \newganttchartelement`\marg{name}\marg{new default key values}'
% \newganttchartelement*`\marg{name}\marg{new default key values}'
% \end{texcode}
% \DescribeMacro{\newganttchartelement}|\newganttchartelement| (unstarred) defines a new chart element |\gantt|\textcolor{RoyalBlue}{\meta{name}} and the corresponding |\ganttlinked|\textcolor{RoyalBlue}{\meta{name}}. These chart element macros take one optional argument \meta{options} and \textit{three} mandatory arguments \meta{label}, \meta{start tss} and \meta{end tss} (like |\ganttbar|).
-%
+%
% Chart element macros defined by the starred form, \DescribeMacro{\newganttchartelement*}|\newganttchartelement*|, take the same single optional argument, but \textit{two} mandatory arguments \meta{label} and \meta{tss} (like |\ganttmilestone|).
-%
+%
% For each new chart element, |\newganttchartelement| also introduces a set of nine value-storing keys and five style keys and assigns default values to them:
% \begin{center}
% \begin{tabular}{l >{\ttfamily}l}
@@ -2212,13 +2100,13 @@
% \end{tabular}\hspace*{-120pt}
% \end{center}
% Consequently, a new chart element will look like the standard |\ganttbar| unless you introduce some \meta{new default key values}.
-%
+%
% Let us define a new chart element called ``foobar'', which is basically a fancy-colored and -shaped bar:
% \par\bigskip\noindent
% \begin{texcode}
% \definecolor{foobarblue}{RGB}{0,153,255}
% \definecolor{foobaryellow}{RGB}{234,187,0}
-%
+%
% \newganttchartelement{foobar}{
% foobar/.style={
% shape=rounded rectangle,
@@ -2237,7 +2125,7 @@
% foobar left shift=-.1,
% foobar right shift=.1
% }
-%
+%
% \begin{ganttchart}[
% vgrid,
% progress=today,
@@ -2253,7 +2141,7 @@
% \begin{center}
% \definecolor{foobarblue}{RGB}{0,153,255}
% \definecolor{foobaryellow}{RGB}{234,187,0}
-%
+%
% \newganttchartelement{foobar}{
% foobar/.style={
% shape=rounded rectangle,
@@ -2272,7 +2160,7 @@
% foobar left shift=-.1,
% foobar right shift=.1
% }
-%
+%
% \begin{ganttchart}[
% vgrid,
% progress=today,
@@ -2285,7 +2173,7 @@
% \ganttlinkedfoobar{Foobar 3}{9}{12}
% \end{ganttchart}
% \end{center}
-%
+%
%
% \subsection{Links}
% \label{ssc:Links}
@@ -2294,7 +2182,7 @@
% \begin{texcode}
% \ganttlink`\oarg{options}\marg{start element name}\marg{end element name}'
% \end{texcode}
-%
+%
% \begin{key}{name}{\meta{name}}{\textrm{(empty)}}
% The \DescribeMacro{\ganttlink}|\ganttlink| macro connects two elements, which are specified by their \meta{name}s. By default, chart elements are named automatically: The first one receives the name \texttt{elem0}, the second one is called \texttt{elem1} and so on. However, the \opt{name} key allows you to assign a name to each chart element.
% \par\bigskip\noindent
@@ -2348,7 +2236,7 @@
% \end{ganttchart}
% \end{center}
% \end{key}
-%
+%
% \begin{key}[/.style=]{link}{\meta{style}}{-latex, rounded corners=1pt}
% Sets the appearance of the link.
% \par\bigskip\noindent
@@ -2490,7 +2378,7 @@
% \DescribeMacro{\newganttlinktype}It defines a new link \meta{type} which is drawn by the given \meta{TikZ code}. When you write this code, you do not have to know the final absolute coordinates of each link type instance. On the contrary, several commands that are only available in the second argument of |\newganttlinktype| help you to design generic link types:
% \begin{itemize}
% \item First, you have to choose the border points of the chart elements the link will connect. For this purpose, \DescribeMacro{\ganttsetstartanchor}|\ganttsetstartanchor{|\meta{anchor}|}| and \DescribeMacro{\ganttsetendanchor}|\ganttsetendanchor{|\meta{anchor}|}| select an \meta{anchor} of the start and end element, respectively. See the figures in section~\ref{sss:NewNodeShapes} for possible \meta{anchor}s of the default chart element shapes. You may specify a certain \meta{fraction} for anchors like \texttt{on top} by |\ganttsetstartanchor{on top=|\meta{fraction}|}|.
-%
+%
% \pack{pgfgantt} sets the default anchors to |\ganttsetstartanchor{east}| and |\ganttsetendanchor{west}|, so you even may omit these two commands.
% \item The two macro pairs \DescribeMacro{\xLeft}|\xLeft|/\DescribeMacro{\yUpper}|\yUpper| and \DescribeMacro{\xRight}|\xRight|/\DescribeMacro{\yLower}|\yLower| provide the $x$- and $y$-coordinates of the link start and end points, respectively.
% \begin{center}\makeatletter
@@ -2509,7 +2397,7 @@
% \end{itemize}
% \end{enumerate}
% \end{key}
-%
+%
% \begin{texcode}
% \newganttlinktypealias`\marg{new type}\marg{existing type}'
% \end{texcode}
@@ -2524,7 +2412,7 @@
% \newganttlinktypealias{sta-to-sta}{s-s}
% \newganttlinktypealias{fin-to-fin}{f-f}
% \setganttlinklabel{fin-to-fin}{f2f}
-%
+%
% \begin{ganttchart}[vgrid, hgrid]{1}{12}
% \gantttitle{Title}{12} \\
% \ganttbar{Task 1}{2}{3} \\
@@ -2538,7 +2426,7 @@
% \newganttlinktypealias{sta-to-sta}{s-s}
% \newganttlinktypealias{fin-to-fin}{f-f}
% \setganttlinklabel{fin-to-fin}{f2f}
-%
+%
% \begin{ganttchart}[vgrid, hgrid]{1}{12}
% \gantttitle{Title}{12} \\
% \ganttbar{Task 1}{2}{3} \\
@@ -2552,7 +2440,7 @@
% \par\bigskip\noindent
% \begin{texcode}
% \usetikzlibrary{decorations.pathmorphing}
-%
+%
% \newganttlinktype{zigzag}{
% \ganttsetstartanchor{on right=1}
% \ganttsetendanchor{on left=0}
@@ -2560,7 +2448,7 @@
% (\xLeft, \yUpper) --
% (\xRight, \yLower);
% }
-%
+%
% \begin{ganttchart}[vgrid, hgrid]{1}{12}
% \gantttitle{Title}{12} \\
% \ganttbar{Task 1}{2}{3} \\
@@ -2612,7 +2500,7 @@
% (\xRight, \yLower);
% }
% \setganttlinklabel{drur}{a fancy link}
-%
+%
% \begin{ganttchart}[
% vgrid,
% hgrid,
@@ -2648,7 +2536,7 @@
% (\xRight, \yLower);
% }
% \setganttlinklabel{drur}{a fancy link}
-%
+%
% \begin{ganttchart}[
% vgrid,
% hgrid,
@@ -2663,7 +2551,7 @@
% \end{ganttchart}
% \end{center}
% (Please remove the comments if you copy the code above -- they will confuse \TikZ\ and generate tons of errors.)
-%
+%
% \begin{key}{link label}{\meta{label}}{\textrm{(empty)}}
% \keyline{link label font}{\meta{font commands}}{\string\scriptsize\string\itshape}
% \keyline[/.style=]{link label node}{\meta{options}}{anchor=west, font=\string\ganttvalueof\{link label font\}}
@@ -2812,9 +2700,9 @@
% \ganttlink[link mid=.159]{pp}{T2A}
% \end{ganttchart}
% \end{center}
-%
+%
% \bigskip
-% The second example demonstrates that \pack{pgfgantt} is really flexible: Even an appearance quite different from the standard layout is possible. (More precisely, the code below tries to reproduce the Gantt chart from the English Wikipedia site, see \url{http://en.wikipedia.org/wiki/Gantt_chart}.)
+% The second example demonstrates that \pack{pgfgantt} is really flexible: Even an appearance quite different from the standard layout is possible. (More precisely, the code below tries to reproduce the Gantt chart from the English Wikipedia site, see \url{https://en.wikipedia.org/wiki/Gantt_chart}.)
% \par\bigskip\noindent
% \begin{texcode}
% \definecolor{barblue}{RGB}{153,204,254}
@@ -2967,8 +2855,8 @@
% \end{ganttchart}
% \end{center}
%
-%
-% \StopEventually{\PrintIndex\PrintChanges}
+%
+% \StopEventually{\PrintIndex}
% \lstDeleteShortInline|
% \MakeShortVerb{\|}
% \clearpage\section{Implementation}
@@ -3050,7 +2938,7 @@
%
%
% \subsection{The Horizontal and Vertical Grid}
-%
+%
% \begin{intmacro}{\gtt@currentline}
% \begin{intmacro}{\gtt@lasttitleline}
% \begin{intmacro}{\gtt@currgrid}
@@ -3202,7 +3090,7 @@
%
%
% \subsection{Time Slot Formats}
-%
+%
% \begin{intmacro}{\gtt@smugglecount}
% |\gtt@smugglecount|\marg{count} smuggles the local value of a count register over the end of a \TeX\ group.
% \begin{macrocode}
@@ -3390,11 +3278,11 @@
% \end{macrocode}
% \end{intmacro}
% \end{option}
-%
-%
+%
+%
% \subsection{The Main Environment}
% \label{ssc:ImplMain}
-%
+%
% \begin{option}{x unit}
% \begin{option}{y unit title}
% \begin{option}{y unit chart}
@@ -4222,10 +4110,10 @@
}
% \end{macrocode}
-%
-%
+%
+%
% \subsection{Chart Elements}
-%
+%
% \begin{option}{progress}
% \begin{intmacro}{\gtt@progress}
% \begin{option}{progress label text}
@@ -4606,7 +4494,7 @@
% \end{option}
% \end{macro}
% \end{macro}
-% \clearpage
+% \clearpage
% \begin{macro}{\ganttgroup}
% \begin{macro}{\ganttlinkedgroup}
% \begin{option}{group}
@@ -4772,10 +4660,10 @@
% \end{option}
% \end{macro}
% \end{macro}
-%
-%
+%
+%
% \subsection{Node Shapes}
-%
+%
% \begin{option}{on top fraction}
% \begin{option}{on bottom fraction}
% \begin{option}{on left fraction}
@@ -5067,11 +4955,11 @@
}
% \end{macrocode}
-%
+%
%
% \subsection{Links}
% \label{ssc:ImplLinks}
-%
+%
% \begin{option}{link}
% \begin{option}{link type}
% \begin{option}{link label}
@@ -5302,7 +5190,7 @@
% \end{macrocode}
% \end{intmacro}
% \begin{intmacro}{\@gtt@link@anchor}
-% We need the following keys for setting the start and end anchor of a link: Whenever a key |/pgfgantt/link anchor/|\meta{anchor} is undefined, \pack{pgfgantt} stores \meta{anchor} in |\@gtt@link@anchor|.
+% We need the following keys for setting the start and end anchor of a link: Whenever a key |/pgfgantt/link anchor/|\meta{anchor} is undefined, \pack{pgfgantt} stores \meta{anchor} in |\@gtt@link@anchor|.
% \begin{macrocode}
\ganttset{%
link anchor/.unknown/.code={%
diff --git a/graphics/pgf/contrib/pgfgantt/pgfgantt.ins b/graphics/pgf/contrib/pgfgantt/pgfgantt.ins
index 6e4aa0dd2b..2c6c6a4c03 100644
--- a/graphics/pgf/contrib/pgfgantt/pgfgantt.ins
+++ b/graphics/pgf/contrib/pgfgantt/pgfgantt.ins
@@ -1,6 +1,6 @@
%% pgfgantt.ins
%%
-%% Copyright (C) 2083 by Wolfgang Skala
+%% Copyright (C) 2024 by Wolfgang Esser-Skala
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
@@ -10,9 +10,7 @@
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2008/05/04 or later.
%%
-%% This work has the LPPL maintenance status `maintained'.
-%%
-%% The Current Maintainer of this work is Wolfgang Skala.
+%% This work has the LPPL maintenance status `unmaintained'.
%%
%% This work consists of the files pgfgantt.dtx and pgfgantt.ins
%% and the derived file pgfgantt.sty.
@@ -24,7 +22,7 @@
\preamble
-Copyright (C) 2018 by Wolfgang Skala
+Copyright (C) 2024 by Wolfgang Esser-Skala
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3c
@@ -51,11 +49,10 @@ version 2008/05/04 or later.
\Msg{*}
\Msg{* pdflatex pgfgantt.dtx}
\Msg{* makeindex -s gind.ist -o pgfgantt.ind pgfgantt.idx}
-\Msg{* makeindex -s gglo.ist -o pgfgantt.gls pgfgantt.glo}
\Msg{* pdflatex pgfgantt.dtx (2x)}
\Msg{*}
\Msg{* Happy TeXing!}
\Msg{*}
\Msg{****************************************************}
-\endbatchfile \ No newline at end of file
+\endbatchfile
diff --git a/graphics/pgf/contrib/pgfgantt/pgfgantt.pdf b/graphics/pgf/contrib/pgfgantt/pgfgantt.pdf
deleted file mode 100644
index 5536734a4c..0000000000
--- a/graphics/pgf/contrib/pgfgantt/pgfgantt.pdf
+++ /dev/null
Binary files differ
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-en.pdf b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-en.pdf
new file mode 100644
index 0000000000..6ef7f59476
--- /dev/null
+++ b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-en.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-en.tex b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-en.tex
new file mode 100644
index 0000000000..88e9abb16a
--- /dev/null
+++ b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-en.tex
@@ -0,0 +1,1712 @@
+% !TeX TXS-program:compile = txs:///arara
+% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode}
+% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)')
+
+\documentclass[11pt,a4paper]{ltxdoc}
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
+\usepackage[english]{tkz-grapheur}
+\usepackage{amsmath}
+\usepackage{fancyvrb}
+\usepackage{fancyhdr}
+\usepackage{hyperref}
+\usepackage{nicefrac}
+\usepackage{fontawesome5}
+\usepackage{tcolorbox}
+\tcbuselibrary{skins,minted}
+\fancyhf{}
+\renewcommand{\headrulewidth}{0pt}
+\lfoot{\sffamily\small [tkz-grapheur]}
+\rfoot{\sffamily\small - \thepage{} -}
+\usepackage{hologo}
+\providecommand\tikzlogo{Ti\textit{k}Z}
+\providecommand\TeXLive{\TeX{}Live\xspace}
+\providecommand\PSTricks{\textsf{PSTricks}\xspace}
+\let\pstricks\PSTricks
+\let\TikZ\tikzlogo
+
+\urlstyle{same}
+\hypersetup{pdfborder=0 0 0}
+\usepackage[margin=2cm]{geometry}
+\setlength{\parindent}{0pt}
+\def\TPversion{0.1.5}
+\def\TPdate{22/06/2024}
+\usepackage{soul}
+\usepackage{codehigh}
+\usepackage{tabularray}
+\sethlcolor{lightgray!25}
+\NewDocumentCommand\MontreCode{ m }{%
+ \hl{\vphantom{\texttt{pf}}\texttt{#1}}%
+}
+\usepackage[english]{babel}
+
+\renewcommand{\footnoterule}{\vfill\kern -3pt \hrule width 0.4\columnwidth \kern 2.6pt}
+
+\begin{document}
+
+\pagestyle{fancy}
+
+\thispagestyle{empty}
+
+\begin{center}
+ \begin{minipage}{0.88\linewidth}
+ \begin{tcolorbox}[colframe=yellow,colback=yellow!15]
+ \begin{center}
+ \begin{tabular}{c}
+ {\Huge \texttt{tkz-grapheur [en]}}\\
+ \\
+ {\LARGE A grapher, based}\\
+ \\
+ {\LARGE on \textsf{\TikZ} and \textsf{xint}.}\\
+ \\
+ {\small \texttt{Version \TPversion{} -- \TPdate}}
+ \end{tabular}
+ \end{center}
+ \end{tcolorbox}
+\end{minipage}
+\end{center}
+
+\begin{center}
+ \begin{tabular}{c}
+ \texttt{Cédric Pierquet}\\
+ {\ttfamily c pierquet -- at -- outlook . fr}\\
+ \texttt{\url{https://forge.apps.education.fr/pierquetcedric/package-latex-tkz-grapheur}} \\
+\end{tabular}
+\end{center}
+
+\hrule
+
+\vfill
+
+\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5,halign=center]
+\begin{GraphTikz}[x=0.85cm,y=0.35cm,Xmin=0,Xmax=10,Ymin=0,Ymax=16]
+ %préparation de la fenêtre
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]{0,1,...,10}{0,2,...,16}
+ %déf des fonctions avec nom courbe + nom fonction + expression
+ \DefineCurve[Name=cf]<f>{3*x-6}
+ \DefineCurve[Name=cg]<g>{-(x-6)^2+12}
+ %antécédents et intersection
+ \FindIntersections[Disp=false,Name=K]{cf}{cg}
+ \FindCounterimage[DispLine,Color=orange,Name=I]{cg}{8}
+ \FindCounterimage[Disp=false,Name=J]{cg}{0}
+ %intégrale sous une courbe, avec intersection
+ \DrawIntegral%
+ [Colors=blue/purple,Bounds=nodes,Style=hatch,Hatch=bricks]%
+ {g(x)}%
+ {(I-2)}{(J-2)}
+ %intégrale entre les deux courbes
+ \DrawIntegral[Bounds=nodes,Type=fct/fct]{f(x)}[g(x)]{(K-1)}{(K-2)}
+ %tracé des courbes et des points
+ \DrawCurve[Color=red]{f(x)}
+ \DrawCurve[Color=teal]{g(x)}
+ \MarkPts<\small>{(K-1)/below right/L,(K-2)/above left/M}%
+ \MarkPts[violet]<\small>{(I-1)/above left/D,(I-2)/above right/E}%
+ %essai de tangente
+ \DrawTangent[Colors=pink!75!black/yellow,OffsetL=2,OffsetR=2,DispPt]{g}{5}
+ %essai d'image
+ \DrawRanges[Colors=cyan]{g}{7,7.25,7.5}
+ %surimpression des axes
+ \DrawAxisGrids[Grads=false,Grid=false,Enlarge=2.5mm]{0,1,...,10}{0,2,...,16}
+\end{GraphTikz}
+\end{tcolorbox}
+
+\vspace*{5mm}
+
+\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5,halign=center]
+\begin{GraphTikz}%
+ [x=3.5cm,y=4cm,
+ Xmin=0,Xmax=3.5,Xgrid=pi/12,Xgrids=pi/24,
+ Ymin=-1.05,Ymax=1.05,Ygrid=0.2,Ygrids=0.05]
+ %préparation de la fenêtre
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm,Format=ntrig/nsqrt]%
+ {pi/6,pi/4,pi/3,pi/2,2*pi/3,3*pi/4,5*pi/6,pi}
+ {0,sqrt(2)/2,1/2,sqrt(3)/2,1,-1,-sqrt(3)/2,-1/2,-sqrt(2)/2}
+ %rajouter des valeurs
+ \AddXvalues{0.25,1.4,3.3}{\num{0.25},\num{1.4},\num{3.3}}
+ %fonction trigo (déf + tracé)
+ \DefineCurve[Name=ccos,Start=0,End=pi]<fcos>{cos(x)}
+ \DefineCurve[Name=csin,Start=0,End=pi]<fsin>{sin(x)}
+ %intégrale
+ \FindIntersections[Disp=false,Name=JKL]{ccos}{csin}
+ %\DefinirPts{FIN/pi/0}
+ \DrawIntegral%
+ [Bounds=node/abs,Type=fct/fct,Colors=cyan/cyan!50]%
+ {fsin(x)}[fcos(x)]%
+ {(JKL-1)}{pi}
+ %tracé des courbes
+ \DrawCurve[Color=red,Start=0,End=pi]{fcos(x)}
+ \DrawCurve[Color=olive,Start=0,End=pi]{fsin(x)}
+ %antécédent(s)
+ \DrawCounterimage[Color=blue/teal!50!black,Lines]{ccos}{-0.25}
+ \DrawCounterimage[Colors=red/magenta!50!black,Lines]{csin}{0.5}
+ \DrawCounterimage[Colors=orange/orange!50!black,Lines]{csin}{sqrt(2)/2}
+ \DrawCounterimage[Colors=green!50!black/green,Lines]{csin}{sqrt(3)/2}
+ %surimpression axes
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm,Format=ntrig/nsqrt]%
+ {pi/6,pi/4,pi/3,pi/2,2*pi/3,3*pi/4,5*pi/6,pi}
+ {0,sqrt(2)/2,1/2,sqrt(3)/2,1,-1,-sqrt(3)/2,-1/2,-sqrt(2)/2}
+\end{GraphTikz}
+\end{tcolorbox}
+
+\vfill
+
+\hfill{\footnotesize\textit{\ttfamily To my Dad.}}
+
+\vspace*{5mm}
+
+\pagebreak
+
+\phantomsection
+
+\hypertarget{matoc}{}
+
+\tableofcontents
+
+\vspace*{5mm}
+
+\hrule
+
+\vspace*{5mm}
+
+\pagebreak
+
+\section{Introduction}
+
+\subsection{Description and general ideas}
+
+With this modest package, far from the capabilities offered by the excellent packages \MontreCode{tkz-*}\footnote{for example tkz-base \url{https://ctan.org/pkg/tkz-base} and tkz- fct \url{https://ctan.org/pkg/tkz-fct}.} (by Alain Matthes) or \MontreCode{tzplot}\footnote{CTAN: \url{https://ctan.org/pkg/ tzplot}.} (by In-Sung Cho), it is possible to work on function graphs, in \TikZ\ language, in an \textit{intuitive} and \textit{explicit} way.
+
+\smallskip
+
+Concerning the overall operation:
+
+\smallskip
+
+\begin{itemize}
+ \item particular styles for the objects used have been defined, but they can be modified locally;
+ \item the name of the commands is in \textit{operational} form, so that the construction of the graphic elements has an almost \textit{algorithmic} form.
+\end{itemize}
+
+\subsection{Overall operation}
+
+To schematize, it \textit{is enough}:
+
+\smallskip
+
+\begin{itemize}
+ \item to declare the parameters of the graphics window (\textbf{units in cm !});
+ \item to display grid/axes/graduations;
+ \item to declare functions or interpolation curves;
+ \item to possibly declare particular points;
+ \item to place a point scatter.
+\end{itemize}
+
+\smallskip
+
+It will then be possible:
+
+\begin{itemize}
+ \item to draw curves;
+ \item to graphically determine images or backgrounds;
+ \item to add elements of derivation (tangents) or integration (domain);
+ \item to draw a linear fit line or the curve of another fit.
+\end{itemize}
+
+\subsection{Packages used, and package options}
+
+The package uses:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{tikz}, with the libraries \MontreCode{calc,intersections,patterns,patterns.meta,bbox};
+ \item \MontreCode{simplekv}, \MontreCode{xintexpr}, \MontreCode{xstring}, \MontreCode{listofitems};
+ \item \MontreCode{xint-regression}\footnote{CTAN: \url{https://ctan.org/pkg/xint-regression}.} (for regressions, switchable via \MontreCode{[noxintreg]}).
+\end{itemize}
+
+\smallskip
+
+The package also loads \MontreCode{siunitx} with the classic options, but it is possible not to load it using the \MontreCode{[nosiunitx]} option.
+
+\smallskip
+
+The package also loads the \TikZ\ \MontreCode{babel} library, but it is possible not to load it using the \MontreCode{[notikzbabel]} option.
+
+\smallskip
+
+The different options are obviously cumulative.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%loading by default, with french setup of siunitx
+\usepackage{tkz-grapheur}
+%loading by default, with normal setup of siunitx
+\usepackage[english]{tkz-grapheur}
+
+%loading without sinuitx, to be loaded manually
+\usepackage[nosiunitx]{tkz-grapheur}
+
+%loading without tikz.babel
+\usepackage[notikzbabel]{tkz-grapheur}
+\end{tcblisting}
+
+Also note that certain commands can use packages like \MontreCode{nicefrac}, which will therefore have to be loaded if necessary.
+
+\smallskip
+
+Concerning the \textit{calculations} and \textit{plots} part, the \MontreCode{xint} package takes care of it.
+
+\subsection{Warnings}
+
+It is possible, due to the (multiple) calculations carried out internally, that the compilation time may be a little \textit{long}.
+
+\smallskip
+
+The precision of the (determination) results seems to be around $10^{-4}$, which should normally guarantee \textit{satisfactory} plots and readings. It is still advisable to be cautious about the results obtained and those expected.
+
+\subsection{Introductory example}
+
+For example, we can start from the following example to \textit{illustrate} the flow of the commands for this package. The commands and syntax will be detailed in the following sections!
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+\begin{GraphTikz}%
+ [x=7.5cm,y=7.5cm,Xmin=0,Xmax=1.001,Xgrid=0.1,Xgrids=0.02,
+ Ymin=0,Ymax=1.001,Ygrid=0.1,Ygrids=0.02]
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]%
+ {0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1}
+ {0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1}
+ \DefineCurve[Name=cf,Start=0,End=1]<f>{x*exp(x-1)}
+ \DefineCurve[Name=delta,Start=0,End=1]<D>{x}
+ \DrawIntegral[Type=fct/fct]{f(x)}[D(x)]{0}{1}
+ \DrawCurve[Color=red]{f(x)}
+ \DrawCurve[Color=teal]{D(x)}
+ \DrawRanges[Colors=blue/cyan,Lines]{f}{0.8,0.9}
+ \DrawCounterimage[Colors=green!50!black/olive,Lines]{cf}{0.5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,text only}
+ \begin{GraphTikz}%
+ [x=7.5cm,y=7.5cm,Xmin=0,Xmax=1.001,Xgrid=0.1,Xgrids=0.02,
+ Ymin=0,Ymax=1.001,Ygrid=0.1,Ygrids=0.02]
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]%
+ {0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1}
+ {0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1}
+ \DefineCurve[Name=cf,Start=0,End=1]<f>{x*exp(x-1)}
+ \DefineCurve[Name=delta,Start=0,End=1]<D>{x}
+ \DrawIntegral[Type=fct/fct]{f(x)}[D(x)]{0}{1}
+ \DrawCurve[Color=red]{f(x)}
+ \DrawCurve[Color=teal]{D(x)}
+ \DrawRanges[Colors=blue/cyan,Lines]{f}{0.8,0.9}
+ \DrawCounterimage[Colors=green!50!black/olive,Lines]{cf}{0.5}
+ \end{GraphTikz}
+\end{tcblisting}
+
+\newpage
+
+\section{Basic Styles and Environment Creation}
+
+\subsection{Basic Styles}
+
+The styles used for plots are given below.
+
+\smallskip
+
+For \textit{simplicity} purposes, only the color of the elements can be configured, but if the user wishes, he can redefine the proposed styles.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%parameters declared and stored (usable in the environment a posteriori)
+\tikzset{
+ Xmin/.store in=\pflxmin,Xmin/.default=-3,Xmin=-3,
+ Xmax/.store in=\pflxmax,Xmax/.default=3,Xmax=3,
+ Ymin/.store in=\pflymin,Ymin/.default=-3,Ymin=-3,
+ Ymax/.store in=\pflymax,Ymax/.default=3,Ymax=3,
+ Origx/.store in=\pflOx,Origx/.default=0,Origx=0,
+ Origy/.store in=\pflOy,Origy/.default=0,Origy=0,
+ Xgrid/.store in=\pflgrillex,Xgrid/.default=1,Xgrid=1,
+ Xgrids/.store in=\pflgrillexs,Xgrids/.default=0.5,Xgrids=0.5,
+ Ygrid/.store in=\pflgrilley,Ygrid/.default=1,Ygrid=1,
+ Ygrids/.store in=\pflgrilleys,Ygrids/.default=0.5,Ygrids=0.5
+}
+\end{tcblisting}
+
+We therefore find:
+
+\smallskip
+
+\begin{itemize}
+ \item the origin of the mark (\MontreCode{Origx}/\MontreCode{Origy});
+ \item the extreme values of the axes (\MontreCode{Xmin}/\MontreCode{Xmax}/\MontreCode{Ymin}/\MontreCode{Ymax});
+ \item the parameters of the main and secondary grids (\MontreCode{Xgrid}/\MontreCode{Xgrids}/\MontreCode{Ygrid}/\MontreCode{Ygrids}).
+\end{itemize}
+
+\smallskip
+
+Concerning the styles of \textit{objects}, they are given below.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+\tikzset{tkzgrphnode/.style={}}
+\tikzset{tkzgrphpoint/.style={line width=0.95pt}}
+\tikzset{tkzgrphpointc/.style={radius=1.75pt}}
+\tikzset{tkzgrphscatter/.style={radius=1.75pt}}
+\tikzset{tkzgrphframe/.style={line width=0.8pt,gray}}
+\tikzset{tkzgrphcurve/.style={line width=1.05pt}}
+\tikzset{tkzgrphline/.style={line width=0.8pt}}
+\tikzset{tkzgrpharrowl/.style={<-,>=latex}}
+\tikzset{tkzgrpharrowr/.style={->,>=latex}}
+\tikzset{tkzgrpharrowlr/.style={<->,>=latex}}
+\tikzset{tkzgrphcounterimage/.style={line width=0.9pt,densely dashed}}
+\tikzset{tkzgrphrange/.style={line width=0.9pt,densely dashed,->,>=latex}}
+\tikzset{tkzgrphgridp/.style={thin,lightgray}}
+\tikzset{tkzgrphgrids/.style={very thin,lightgray}}
+\tikzset{tkzgrphaxes/.style={line width=0.8pt,->,>=latex}}
+\end{tcblisting}
+
+The idea is therefore to be able to redefine styles globally or locally, and possibly add elements, using \mintinline{latex}|mystyle/.append style={...}|.
+
+\subsection{Creating the environment}\label{creaenvt}
+
+The proposed environment is based on \TikZ, so that any \textit{classic} command linked to \TikZ\ can be used alongside the package commands!
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+\begin{GraphTikz}[tikz options]<keys>
+ %code(s)
+\end{GraphTikz}
+\end{tcblisting}
+
+The \MontreCode{[tikz options]} are the \textit{classic} options that can be passed to a \TikZ\ environment, as well as the \textsf{axes/grids/window} keys presented previously.
+
+\smallskip
+
+The specific (and optional) \MontreCode{<keys>} are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{ThickGrad}: size of the axis graduations (\MontreCode{3pt} for 3pt \textit{above} and 3pt \textit{below});
+ \item \MontreCode{Frame}: boolean (\MontreCode{false} by default) to display a frame which delimits the graphic window (excluding possible graduations).
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}
+ [x=0.075cm,y=0.03cm,Xmin=0,Xmax=160,Xgrid=20,Xgrids=10,
+ Origy=250,Ymin=250,Ymax=400,Ygrid=25,Ygrids=5]
+ <Frame>
+\end{GraphTikz}
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
+ <Frame>
+\end{GraphTikz}
+\end{tcblisting}
+
+It will obviously be more meaningful with the added graphic elements!
+
+\pagebreak
+
+\subsection{Grids and axes}\label{creaaxesgr}
+
+The first command \textit{useful} will allow you to create the grids, axes and graduations.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\DrawAxisGrids[keys]{gradX}{gradY}
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} available are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Grid}: boolean (\MontreCode{true} by default) to display the grids (for a single grid, simply set the identical parameters for \MontreCode{Xgrid}/\MontreCode{Xgrids} or \MontreCode {Ygrid}/\MontreCode{Ygrids});
+ \item \MontreCode{Enlarge}: addition at the end of the axes (\MontreCode{0} by default);
+ \item \MontreCode{Grads}: boolean (\MontreCode{true} by default) for graduations;
+ \item \MontreCode{Font}: global font for graduations {\MontreCode{empty} by default};
+ \item \MontreCode{Format}: special formatting (see below) of the axis values.
+\end{itemize}
+
+\smallskip
+
+Concerning the \MontreCode{Format} key, it allows you to specify a specific setting for the axis values.
+
+\smallskip
+
+It can be given in the form \MontreCode{fmt} for combined formatting, or in the form \MontreCode{fmtX/fmtY} to differentiate the formatting.
+
+\smallskip
+
+The possible options are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{num}: format with \textsf{siunitx};
+ \item \MontreCode{year}: format in year;
+ \item \MontreCode{frac}: format as fraction \textsf{frac};
+ \item \MontreCode{dfrac}: format as fraction \textsf{dfrac};
+ \item \MontreCode{nfrac}: format as fraction \textsf{nicefrac};\hfill (to load!)
+ \item \MontreCode{trig}: format in trig with \textsf{frac};
+ \item \MontreCode{dtrig}: format in trig with \textsf{dfrac};
+ \item \MontreCode{ntrig}: format in trig with \textsf{nfrac};
+ \item \MontreCode{sqrt}: format in root with \textsf{frac};
+ \item \MontreCode{dsqrt}: format in root with \textsf{dfrac};
+ \item \MontreCode{nsqrt}: format in root with \textsf{nicefrac}.
+\end{itemize}
+
+\smallskip
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}
+ [x=0.075cm,y=0.03cm,Xmin=0,Xmax=160,Xgrid=20,Xgrids=10,
+ Origy=250,Ymin=250,Ymax=400,Ygrid=25,Ygrids=5]
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]{0,10,...,160}{250,275,...,400}
+\end{GraphTikz}
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]{4,5,...,20}{40,42,...,56}
+\end{GraphTikz}
+\end{tcblisting}
+
+Note that there are the Boolean keys \MontreCode{[Behind]} (without the graduations) and \MontreCode{[Above]} (without the grid) to display the axes in \textit{under/over}-printing mode in the case of integrals for example.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=2.75cm,y=3cm,
+ Xmin=0,Xmax=3.5,Xgrid=pi/12,Xgrids=pi/24,
+ Ymin=-1.05,Ymax=1.05,Ygrid=0.2,Ygrids=0.05]
+ \DrawAxisGrids[Enlarge=2.5mm,Format=dtrig/nsqrt,Font=\footnotesize]%
+ {pi/6,pi/4,pi/3,pi/2,2*pi/3,3*pi/4,5*pi/6,pi}
+ {0,sqrt(2)/2,1/2,sqrt(3)/2,1,-1,-sqrt(3)/2,-1/2,-sqrt(2)/2}
+\end{GraphTikz}
+\end{tcblisting}
+
+In the case where the formatting does not give satisfactory result(s), it is possible to use a generic command for placing the graduations.
+
+\subsection{Adding values manually}\label{additionvals}
+
+It is also possible to use a specific command to place values on the axes, independently of an \textit{automated} formatting system.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+in the environment
+\AddXvalues[keys]{grads}{formatted values}
+\AddYvalues[keys]{grads}{formatted values}
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} available are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Font}: global font for graduations {\MontreCode{empty} by default};
+ \item \MontreCode{Lines}: boolean to add the tick marks {\MontreCode{true} by default}.
+\end{itemize}
+
+\smallskip
+
+The mandatory arguments correspond to the x-coordinates (in \TikZ\ language) and to the labels (in \LaTeX\ language) of the graduations.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=2.75cm,y=3cm,
+ Xmin=0,Xmax=3.5,Xgrid=pi/12,Xgrids=pi/24,
+ Ymin=-1.05,Ymax=1.05,Ygrid=0.2,Ygrids=0.05]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{}{}
+ \AddXvalues
+ {0.15,0.6,pi/2,2.8284}
+ {\num{0.15},$\frac35$,$\displaystyle\frac{\pi}{2}$,$\sqrt{8}$}
+ \AddYvalues
+ {-1,0.175,0.3,sqrt(3)/2}
+ {\num{-1},\num{0.175},$\nicefrac{3}{10}$,$\frac{\sqrt{3}}{2}$}
+\end{GraphTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\section{Specific definition commands}
+
+\subsection{Draw a line}\label{tracstraight}
+
+The idea is to propose a command to draw a line, from:
+
+\begin{itemize}
+ \item of two points (or nodes);
+ \item of a point (or node) and the slope.
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\DrawLine[keys]{point or node}{point or node or slope}
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} available are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Name}: possible name of the plot (for reuse);
+ \item \MontreCode{Slope}: boolean to specify that the slope is used (\MontreCode{false} by default);
+ \item \MontreCode{Start}: start of the plot (\MontreCode{\textbackslash pflxmin} by default);
+ \item \MontreCode{End}: end of the plot (\MontreCode{\textbackslash pflxmax} by default);
+ \item \MontreCode{Color}: color of the trace (\MontreCode{black} by default).
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Enlarge=2.5mm]{auto}{auto}
+ \DefinePts[Mark,Color=gray]{A/-4/3,B/2/0,C/0/-1}
+ \DrawLine[Color=red]{(-2,-1)}{(2,4)}
+ \DrawLine[Color=blue,Start=-5,End=3]{(A)}{(B)}
+ \DrawLine[Color=olive,Slope]{(C)}{0.25}
+\end{GraphTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Define a function, draw the curve of a function}\label{deftracfct}
+
+The idea is to define a function, for later reuse. This command \textit{creates} the function, without tracing it, because in certain cases elements will have to be traced beforehand.
+
+\smallskip
+
+There is also a command to plot the curve of a previously defined function.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\DefineCurve[keys]<fct name>{xint formula}
+\DrawCurve[keys]{xint formula}
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} for definition or tracing are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Start}: lower bound of the definition set (\MontreCode{\textbackslash pflxmin} by default);
+ \item \MontreCode{End}: lower bound of the definition set (\MontreCode{\textbackslash pflxmax} by default);
+ \item \MontreCode{Name}: name of the curve (important for the rest!);
+ \item \MontreCode{Color}: color of the trace (\MontreCode{black} by default);
+ \item \MontreCode{Step}: plot step (it is determined \textit{automatically} at the start but can be modified);
+ \item \MontreCode{Trace}: boolean to also trace the curve (\MontreCode{false} by default).
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]{4,5,...,20}{40,42,...,56}
+ %definition of the function + drawing of the curve
+ \DefineCurve[Name=cf,Start=5,End=19]<f>{-2*x+3+24*log(2*x)}
+ \DrawCurve[Color=red,Start=5,End=19]{f(x)}
+ %or in a single command if "sufficient"
+ %\DefineCurve[Name=cf,Start=5,End=19,Trace]<f>{-2*x+3+24*log(2*x)}
+\end{GraphTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Define/draw an interpolation curve (simple)}\label{deftracinterpo}
+
+It is also possible to define a curve via support points, therefore a simple interpolation curve.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\DefineInterpoCurve[keys]{list of support points}
+\DrawInterpoCurve[keys]{list of support points}
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} for definition or tracing are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Name}: name of the interpolation curve (important for the rest!);
+ \item \MontreCode{Color}: color of the trace (\MontreCode{black} by default);
+ \item \MontreCode{Tension}: setting the \textit{tension} of the interpolation plot (\MontreCode{0.5} by default);
+ \item \MontreCode{Trace}: boolean to also trace the curve (\MontreCode{false} by default).
+\end{itemize}
+
+The mandatory argument allows you to specify the list of support points in the form \MontreCode{(x1,y1)(x2,y2)...}.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ %simple interpolation curves (with diff tension)
+ \DefineInterpoCurve[Name=interpotest,Color=blue,Trace]%
+ {(-6,4)(-2,-2)(3,3.5)}
+ \DefineInterpoCurve[Name=interpotest,Color=red,Trace,Tension=1]%
+ {(-6,4)(-2,-2)(3,3.5)}
+\end{GraphTikz}
+\end{tcblisting}
+
+\newpage
+
+\subsection{Define/draw an interpolation curve (Hermite)}\label{deftracfctspline}
+
+It is also possible to define a curve via support points, therefore an interpolation curve with derivative control.
+
+\smallskip
+
+Some operations require different techniques depending on the type of function used, a \textsf{Boolean} key \MontreCode{Spline} will allow the code to adapt its calculations depending on the object used.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\DefineSplineCurve[keys]{list of support points}[\macronomspline]
+\DrawSplineCurve[keys]{list of support points}[\macronomspline]
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} for definition or tracing are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Name}: name of the interpolation curve (important for the rest!);
+ \item \MontreCode{Coeffs}: modify (see the \textsf{ProfLycee}\footnote{CTAN documentation: \url{https://ctan.org/pkg/proflycee}} the \textit{coefficients} of the spline;
+ \item \MontreCode{Color}: color of the trace (\MontreCode{black} by default);
+ \item \MontreCode{Trace}: boolean to also trace the curve (\MontreCode{false} by default).
+\end{itemize}
+
+The mandatory argument allows you to specify the list of support points in the form \MontreCode{x1/y1/f'1§x2/y2/f'2§...} with:
+
+\begin{itemize}
+ \item \MontreCode{xi/yi} the coordinates of the point;
+ \item \MontreCode{f'i} the derivative at the support point.
+\end{itemize}
+
+\smallskip
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ %definition of the list of spline support points
+ \def\LISTETEST{-6/4/-2§-5/2/-2§-4/0/-2§-2/-2/0§1/2/2§3/3.5/0.5}
+ %definition and plot of the cubic spline
+ \DefineSplineCurve[Name=splinetest,Trace,Color=olive]{\LISTETEST}
+\end{GraphTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Define points as nodes}\label{defpts}
+
+The second idea is to work with \TikZ nodes, which could be useful for tangent plots, representations of integrals$\ldots$
+
+\smallskip
+
+It is also possible to define nodes for \textit{image} points.
+
+\smallskip
+
+Certain commands (explained later) allow you to determine particular points of curves in the form of nodes, so it seems interesting to be able to define them directly.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%by coordinates
+\DefinePts[keys]{Name1/x1/y1,Name2/x2/y2,...}
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} available are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Mark}: boolean to mark points (\MontreCode{false} by default);
+ \item \MontreCode{Color}: color of the points, if \MontreCode{Mark=true} (\MontreCode{black} by default).
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%as image
+\DefineRange[keys]{object}{abscissa}
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} available are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Name}: node name (\MontreCode{empty} by default);
+ \item \MontreCode{Spline}: boolean to specify that a spline is used (\MontreCode{false} by default).
+\end{itemize}
+
+The first mandatory argument is the \textit{object} considered (name of the curve for the spline, function otherwise); the second is the abscissa of the point considered.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]{4,5,...,20}{40,42,...,56}
+ %definition of the function + drawing of the curve
+ \DefineFunction[Name=cf,Start=5,End=19,Trace,Color=red]<f>{-2*x+3+24*log(2*x)}
+ %manual nodes
+ \DefinePts[Mark,Color=brown]{A/7/42,B/16/49}
+ %imagenode
+ \DefineRange[Name=IMGf]{f}{14}
+ \MarkPts*[Style=x,Color=blue]{(IMGf)} %see next section ;-)
+\end{GraphTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Mark Points}\label{markpts}
+
+The idea is to offer something to score points with a particular style.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\MarkPts(*)[keys]<font>{list}
+\end{tcblisting}
+
+The \textit{starred} version scores the points without the \textit{names}, while the \textit{unstarred} version displays them:
+
+\begin{itemize}
+ \item in the case of the \textit{starred} version, the list should be given in the form \MontreCode{(ptA),(ptB),...};
+ \item otherwise, the list should be given in the form \MontreCode{(ptA)/poslabelA/labelA,...}.
+\end{itemize}
+
+\smallskip
+
+The optional \MontreCode{[keys]} available are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Color}: color (\MontreCode{black} by default);
+ \item \MontreCode{Style}: style of marks (\MontreCode{o} by default).
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}[x=1.5cm,y=1.5cm,Ymin=-2]
+ \DrawAxisGrids[Enlarge=2.5mm]{auto}{auto}
+ \DefinePts{A/1.75,-1.25}\MarkPts[Color=pink]{(A)/below/A} %round (default)
+ \MarkPts[Color=teal]{(1,1)/below/M}
+ \MarkPts[Color=red,Style=x]{(1.25,1)/below/$A$} %cross
+ \MarkPts[Color=orange,Style=+]<\small\sffamily>{(1.5,1)/below/K} %plus
+ \MarkPts[Color=blue,Style=c]{(1.75,1)/below/P} %square
+ \MarkPts[Color=gray,Style=d]{(2,1)/below/P} %diamond
+ \MarkPts*[Color=orange/yellow]{(2,2),(2.5,2.25)} %two-tone round
+ \MarkPts*[Style=+,Color=red]{(1,2)}
+ \MarkPts*[Style=x,Color=blue]{(2.25,1)}
+ \MarkPts*[Style=c,Color=magenta]{(-2,-1)}
+ \MarkPts[Color=red,Style=x]{(-1,1)/below/$A$,(-2,2)/below left/$B$}
+\end{GraphTikz}
+\end{tcblisting}
+
+Note that it is also possible to modify the size of the \MontreCode{o/x/+/c} marks via the \MontreCode{[keys]}:
+
+\begin{itemize}
+ \item \MontreCode{Sizex=...} (\MontreCode{2pt} by default) for points \textit{cross};
+ \item \MontreCode{Sizeo=...} (\MontreCode{1.75pt} by default) for the points \textit{circle};
+ \item \MontreCode{Sizec=...} (\MontreCode{2pt} by default) for the \textit{square} points.
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}[x=1cm,y=1cm,Xmin=0,Ymin=0]
+ \DrawAxisGrids[Enlarge=2.5mm]{auto}{auto}
+ \MarkPts[Color=red,Style=x,Size=3.5pt]{(1.25,1.25)/below/$A$}
+ \MarkPts[Color=teal,Size=2.5pt]{(2,2)/right/$A$}
+ \MarkPts*[Color=orange,Style=c,Size=4pt]{(0.5,2.5)}
+\end{GraphTikz}
+\end{tcblisting}
+
+\subsection{Retrieve node coordinates}\label{recupcoordo}
+
+It is also possible, with a view to reusing coordinates, to recover the coordinates of a node (defined or determined).
+
+\smallskip
+
+The calculations are carried out by floating according to the (re)calculated units, the values are therefore approximated !
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\GetXcoord{node}[\macrox]
+\GetYcoord{node}[\macroy]
+\GetXYcoord{node}[\macrox][\macroy]
+\end{tcblisting}
+
+\subsection{Place text}\label{placetxt}
+
+Note that a text placement command is available.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\DrawTxt[keys]{(node or coordinates)}{text}
+\end{tcblisting}
+
+The available \MontreCode{[keys]} are:
+
+\begin{itemize}
+ \item \MontreCode{Font=...} (\MontreCode{\textbackslash normalsize\textbackslash normalfont} by default) for the font;
+ \item \MontreCode{Color=...} (\MontreCode{black} by default) for the color;
+ \item \MontreCode{Position=...} (\MontreCode{empty} by default) for the position of the text relative to the coordinates.
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}[x=1cm,y=1cm,Xmin=0,Xmax=5,Ymin=0,Ymax=1]
+ \DrawAxisGrids[Enlarge=2.5mm]{auto}{auto}
+ \DrawTxt[Color=red,Font=\LARGE,Position=right]{(1.5,0.5)}{curve $C_1$}
+\end{GraphTikz}
+\end{tcblisting}
+
+\section{Specific commands for using curves}
+
+\subsection{Image placement}\label{images}
+
+It is possible to place points (images) on a curve, with possible construction lines.
+
+The function/curve used must have been declared previously for this command to work.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\DrawRanges[keys]{function or curve}{list of abscissa}
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} available are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Lines}: boolean to display construction traits (\MontreCode{false} by default);
+ \item \MontreCode{Colors}: color of the points/lines, in the form \MontreCode{Couleurs} or \MontreCode{ColPoint/ColLines};
+ \item \MontreCode{Spline}: boolean to specify that the curve used is defined as a \textsf{spline} (\MontreCode{false} by default).
+\end{itemize}
+
+\smallskip
+
+The first mandatory argument allows you to specify:
+
+\smallskip
+
+\begin{itemize}
+ \item the name of the curve in the case \MontreCode{Spline=true};
+ \item the name of the function otherwise.
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]{4,5,...,20}{40,42,...,56}
+ %definition of the function + drawing of the curve
+ \DefineCurve[Name=cf,Start=5,End=19,Trace,Color=red]<f>{-2*x+3+24*log(2*x)}
+ %images
+ \DrawRanges[Lines,Colors=teal/blue]{f}{6,7,8,9,10}
+\end{GraphTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Antecedent determination}\label{defanteced}
+
+It is possible to graphically determine the antecedents of a given reality.
+
+The function/curve used must have been declared previously for this command to work.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\FindCounterimage[keys]{curve}{k}
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} available are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Name}: base of the name of the \textbf{nodes} intersection (\MontreCode{S} by default, which will give \textsf{S-1}, \textsf{S-2}, etc);
+ \item \MontreCode{Disp}: boolean to display the points (\MontreCode{true} by default);
+ \item \MontreCode{Color}: color of the points (\MontreCode{black} by default);
+ \item \MontreCode{DispLine}: boolean to display the horizontal line (\MontreCode{false} by default).
+\end{itemize}
+
+\smallskip
+
+The first mandatory argument allows you to specify the \textbf{name} of the curve.
+
+\smallskip
+
+The second mandatory argument allows you to specify the value to reach.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]{4,5,...,20}{40,42,...,56}
+ %definition of the function + drawing of the curve
+ \DefineCurve[Name=cf,Start=5,End=19,Trace,Color=red]<f>{-2*x+3+24*log(2*x)}
+ %history
+ \FindCounterimage[Color=teal,DispLine,Disp]{cf}{53}
+ %the two antecedents are at nodes (S-1) and (S-2)
+\end{GraphTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Antecedent construction}\label{tracanteced}
+
+It is possible to graphically construct the antecedents.
+
+The function/curve used must have been declared previously for this command to work.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\DrawCounterimage[keys]{curve}{k}
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} available are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Colors}: color of the points/lines, in the form \MontreCode{Color} or \MontreCode{ColPoint/ColLines};
+ \item \MontreCode{Name}: name \textit{possible} for the intersection points linked to the antecedents (\MontreCode{empty} by default);
+ \item \MontreCode{Lines}: boolean to display construction traits (\MontreCode{false} by default).
+\end{itemize}
+
+\smallskip
+
+The first mandatory argument allows you to specify the \textbf{name} of the curve.
+
+\smallskip
+
+The second mandatory argument allows you to specify the value to reach.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]{4,5,...,20}{40,42,...,56}
+ %definition of the function + drawing of the curve
+ \DefineCurve[Name=cf,Start=5,End=19,Trace,Color=red]<f>{-2*x+3+24*log(2*x)}
+ %history
+ \DrawCounterimage[Colors=teal/cyan,Lines,Name=PO]{cf}{53}
+ \GetXcoord{(PO-1)}[\premsol]
+ \GetXcoord{(PO-2)}[\deuxsol]
+\end{GraphTikz}
+
+Graphically, the antecedents of 53 are (approximately):
+
+\begin{itemize}
+ \item \num{\premsol}
+ \item \num{\deuxsol}
+\end{itemize}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Intersections of two curves}\label{intersect}
+
+It is also possible to determine (in the form of nodes) the possible points of intersection of two previously defined curves.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\FindIntersections[keys]{curve1}{curve2}
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} available are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Name}: base of the name of the \textbf{nodes} intersection (\MontreCode{S} by default, which will give \textsf{S-1}, \textsf{S-2}, etc);
+ \item \MontreCode{Disp}: boolean to display the points (\MontreCode{true} by default);
+ \item \MontreCode{Color}: color of the points (\MontreCode{black} by default).
+\end{itemize}
+
+\smallskip
+
+The first mandatory argument allows you to specify the \textbf{name} of the first curve.
+
+\smallskip
+
+The first mandatory argument allows you to specify the \textbf{name} of the second curve.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]{4,5,...,20}{40,42,...,56}
+ \DefineCurve[Name=cf,Start=5,End=19,Trace,Color=red]<f>{-2*x+3+24*log(2*x)}
+ \DefineCurve[Name=cg,Start=5,End=19,Trace,Color=blue]<g>{0.25*(x-12)^2+46}
+ %intersections, named (TT-1) and (TT-2)
+ \FindIntersections[Name=TT,Color=darkgray,Display,Lines]{cf}{cg}
+ %recovery of intersection points
+ \GetXYcoord{(TT-1)}[\alphaA][\betaA]
+ \GetXYcoord{(TT-2)}[\alphaB][\betaB]
+\end{GraphTikz}\\
+The solutions of $f(x)=g(x)$ are $\alpha \approx \num{\alphaA}$ and
+$\beta \approx \num{\alphaB}$.\\
+The points of intersection of the curves of $f$ and $g$ are therefore
+$(\RoundNb[2]{\alphaA};\RoundNb[2]{\betaA})$ and
+$(\RoundNb[2]{\alphaB};\RoundNb[2]{\betaB})$.
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Extrema}\label{maximum}\label{minimum}
+
+The idea (still \textit{experimental}) is to offer commands to extract the extrema of a curve defined by the package.
+
+The command creates the corresponding node, and it is therefore possible to retrieve its coordinates for later use.
+
+\smallskip
+
+It is possible, by specifying it, to work on the different curves managed by the package (function, interpolation, spline).
+
+For singular curves, it is possible that the results are not quite those expected\ldots
+
+\smallskip
+
+{\small\faBomb} For the moment, the \textit{limitations} are:
+
+\begin{itemize}
+ \item no management of multiple extrema (only the first will be processed)\ldots
+ \item no management of extrema at the boundaries of the route\ldots
+ \item no automatic recovery of curve definition parameters\ldots
+ \item compilation time may be longer\ldots
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\FindMax[keys]{object}[node created]
+\FindMin[keys]{object}[node created]
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} available are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Method}: method, among \MontreCode{function/interpo/spline} for calculations (\MontreCode{function} by default);
+ \item \MontreCode{Start}: start of the plot (\MontreCode{\textbackslash pflxmin} by default);
+ \item \MontreCode{End}: end of the plot (\MontreCode{\textbackslash pflxmax} by default);
+ \item \MontreCode{Step}: not in the plot if \MontreCode{function} (it is determined \textit{automatically} at the start but can be modified);
+ \item \MontreCode{Coeffs}: modify the \textit{coefficients} of the spline if \MontreCode{spline};
+ \item \MontreCode{Tension}: setting the \textit{tension} of the interpolation plot if \MontreCode{interpo}(\MontreCode{0.5} by default).
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}[x=1cm,y=1cm,Xmin=-1,Xmax=5,Ymin=-1,Ymax=3]
+ \DrawAxisGrids[Enlarge=2.5mm]{auto}{auto}
+ \DefineCurve[Name=cf,Start=0.35,End=4.2,Trace]%
+ <f>{0.6*cos(4.5*(x-4)+2.1)-1.2*sin(x-4)+0.1*x+0.2}
+ \FindMax[Start=0.35,End=4.2]{f}[cf-max]
+ \FindMax[Start=3,End=4]{f}[cf-maxlocal]
+ \FindMin[Start=1,End=2]{f}[cf-minlocal]
+ \MarkPts*[Color=red,Lines]{(cf-max)}
+ \MarkPts*[Color=blue,Lines]{(cf-maxlocal)}
+ \MarkPts*[Color=olive,Lines]{(cf-minlocal)}
+ \GetXYcoord{(cf-max)}[\MyMaxX][\MyMaxY]
+\end{GraphTikz}\\
+The maximum is $M\approx\RoundNb{\MyMaxY}$, reached in $x\approx\RoundNb{\MyMaxX}$
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}[x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineInterpoCurve[Name=interpotest,Color=red,Trace,Tension=1]%
+ {(-6,4)(-2,-2)(3,3.5)}
+ \FindMin[Method=interpo,Tension=1]{(-6,4)(-2,-2)(3,3.5)}[interpo-min]
+ \MarkPts*[Color=blue]{(interpo-min)}
+ \GetXYcoord{(interpo-min)}[\MinInterpoX][\MinInterpoY]
+\end{GraphTikz}\\
+The minimum is $M\approx\RoundNb[3]{\MinInterpoY}$, reached at $x\approx\RoundNb[3]{\MinInterpoX}$
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=1.2cm,y=1.6cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=3,Ygrid=0.5,Ygrids=0.25]
+ \DrawAxisGrids[Enlarge=2.5mm]{auto}{auto}
+ \def\LISTETEST{-6/2/0§-1/-2/0§2/1/0§3.5/0/-1}
+ \DefineSplineCurve[Name=splinetest,Trace]{\LISTETEST}
+ \FindMin[Method=spline]{\LISTETEST}[spline-min]
+ \MarkPts*[Color=red]{(spline-min)}
+\end{GraphTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Integrals (improved version)}\label{integr}
+
+We can also work with integrals.
+
+In this case it is preferable to highlight the domain \textbf{before} the plots, to avoid overprinting in relation to the curves/points.
+
+\smallskip
+
+It is possible to :
+
+\begin{itemize}
+ \item represent an integral \textbf{under} a defined curve;
+ \item represent an integral \textbf{between} two curves;
+ \item the integration limits can be x-coordinates and/or nodes.
+\end{itemize}
+
+\smallskip
+
+{\small\faBomb} Given the differences in processing between formula curves, simple interpolation curves or cubic interpolation curves, the arguments and keys may differ depending on the configuration!
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\DrawIntegral[keys]<specific options>{object1}[object2]{A}{B}
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} for definition or tracing are:
+
+\begin{itemize}
+ \item \MontreCode{Colors} =: colors of the filling, in the form \MontreCode{Col} or \MontreCode{ColBorder/ColBg} (\MontreCode{gray} by default);
+ \item \MontreCode{Style}: type of filling, among \MontreCode{fill}/\MontreCode{hatch} (\MontreCode{fill} by default);
+ \item \MontreCode{Opacity}: opacity (\MontreCode{0.5} by default) of the filling;
+ \item \MontreCode{Hatch}: style (\MontreCode{north west lines} by default) of the hatch filling;
+ \item \MontreCode{Type}: type of integral among
+ \begin{itemize}
+ \item \MontreCode{fct} (default) for an integral under a curve defined by a formula;
+ \item \MontreCode{spl} for an integral under a curve defined by a cubic spline;
+ \item \MontreCode{itp} for an integral under a curve defined by interpolation ;
+ \item \MontreCode{fct/fct} for an integral between two curves defined by a formula;
+ \item \MontreCode{fct/spl} for an integral between a curve (above) defined by a formula and a curve (below) defined by a spline cubic;
+ \item etc.
+ \end{itemize}
+ \item \MontreCode{Step}: steps (calculated by default otherwise) for the plot;
+ \item \MontreCode{Junction}: junction of segments (\MontreCode{bevel} by default);
+ \item \MontreCode{Bounds}: type of terminals among:
+ \begin{itemize}
+ \item \MontreCode{abs} for the limits given by the abscissa;
+ \item \MontreCode{nodes} for the limits given by the nodes;
+ \item \MontreCode{abs/node} for the limits given by abscissa and node;
+ \item \MontreCode{node/abs} for the limits given by node and abscissa;
+ \end{itemize}
+ \item \MontreCode{Border}: boolean (\MontreCode{true} by default) to display the side lines,%
+ \item \MontreCode{SplineName}: macro (important!) of the spline generated previously for a higher version spline;
+ \item \MontreCode{SplineNameB}: macro (important!) of the spline generated previously for a lower version spline;
+ \item \MontreCode{InterpoName}: name (important!) of the interpolation curve generated previously, in higher version;
+ \item \MontreCode{InterpoBName}: name (important!) of the interpolation curve generated previously, in lower version;
+ \item \MontreCode{Tension}: Tension for the interpolation curve generated previously, in higher version;
+ \item \MontreCode{TensionB}: Tension of the interpolation curve generated previously, in lower version.
+\end{itemize}
+
+\smallskip
+
+The first required argument is the spline function or curve or list of interpolation points.
+
+\smallskip
+
+The next optional argument is the spline function or curve or list of interpolation points.
+
+\smallskip
+
+The last two mandatory arguments are the limits of the integral, given in a form consistent with the key \MontreCode{Bounds}.
+
+\pagebreak
+
+In the case of curves defined by \textit{points}, it is necessary to work on intervals on which the first curve is \textbf{above} the second.
+
+It will undoubtedly be interesting to work with \textit{intersections} in this case.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.6cm,y=0.06cm,
+ Xmin=0,Xmax=21,Xgrid=1,Xgrids=0.5,
+ Ymin=0,Ymax=155,Ygrid=10,Ygrids=5]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{}{}
+ \DefineCurve[Name=cf,Start=1,End=20,Color=red]<f>{80*x*exp(-0.2*x)}
+ \DrawIntegral
+ [Bounds=abs,Colors=blue/cyan!50]%
+ {f(x)}{3}{12}
+ \DrawCurve[Color=red,Start=1,End=20]{f(x)}
+ \DrawAxisGrids%
+ [Grid=false,Enlarge=2.5mm,Font=\small]{0,1,...,20}{0,10,...,150}
+\end{GraphTikz}
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=1.2cm,y=1.6cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=3,Ygrid=0.5,Ygrids=0.25]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{}{}
+ \def\LISTETEST{-6/2/0§-1/-2/0§2/1/0§3.5/0/-1}
+ \DefineSplineCurve[Name=splinetest]{\LISTETEST}
+ \DrawIntegral[Type=spl,Style=hatch,Colors=purple]{splinetest}{-5.75}{-4.75}
+ \DrawIntegral[Type=spl,Colors=blue]{splinetest}{-2}{-1}
+ \DrawIntegral[Type=spl,Colors=orange]{splinetest}{1}{3}
+ \DrawSplineCurve[Color=olive]{\LISTETEST}
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm]
+ {-7,-6,...,4}%
+ {-3,-2.5,...,3}
+\end{GraphTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Tangents}\label{tgte}
+
+The idea of this command is to draw the tangent to a previously defined curve, specifying:
+
+\begin{itemize}
+ \item the point (abscissa or node) at which we wish to work;
+ \item possibly the direction (in the case of a discontinuity or a terminal);
+ \item possibly the step ($h$) of the calculation;
+ \item the \textit{lateral spacings} to draw the tangent.
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\DrawTangent[keys]{function or curve}{point}<line options>
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} for definition or tracing are:
+
+\begin{itemize}
+ \item \MontreCode{Colors} =: colors of the plots, in the form \MontreCode{Col} or \MontreCode{ColLine/ColPoint} (\MontreCode{black} by default);
+ \item \MontreCode{OffsetL} =: left horizontal spacing to start the trace (\MontreCode{1} by default);
+ \item \MontreCode{OffsetR} =: left horizontal spacing to start the trace (\MontreCode{1} by default);
+ \item \MontreCode{DispPt}: boolean to display the support point (\MontreCode{false} by default);
+ \item \MontreCode{Spline}: boolean to specify that a spline is used (\MontreCode{false} by default);
+ \item \MontreCode{h}: delta $h$ used for calculations (\MontreCode{0.01} by default);
+ \item \MontreCode{Direction}: allows you to specify the \textit{direction} of the tangent, among \MontreCode{lr}/\MontreCode{l}/\MontreCode{r} (\MontreCode{lr} by default);
+ \item \MontreCode{Node}: boolean to specify that a node is used (\MontreCode{false} by default).
+\end{itemize}
+
+\smallskip
+
+The first required argument is the spline function or curve (if applicable).
+
+\smallskip
+
+The last mandatory argument is the work point (abscissa version or node following the key \MontreCode{Node}).
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]{4,5,...,20}{40,42,...,56}
+ \DefineCurve[Name=cf,Start=5,End=19,Color=red,Trace]<f>{-2*x+3+24*log(2*x)}
+ \FindCounterimage[Color=teal,Name=JKL,Disp=false]{cf}{53}
+ %tangent
+ \DrawTangent%
+ [Colors=cyan/gray,OffsetL=2.5,OffsetR=2.5,Node,DispPt]{f}{(JKL-1)}
+\end{GraphTikz}
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \def\LISTETEST{-6/4/-0.5§-5/2/-2§-4/0/-2§-2/-2/0§1/2/2§3/3.5/0.5}
+ \DefineSplineCurve[Name=splinetest,Trace,Color=olive]{\LISTETEST}
+ \DrawTangent[Colors=red,Spline,DispPt]{splinetest}{1}
+ \DrawTangent%
+ [Colors=blue,Spline,OffsetL=1.5,OffsetR=1.5,DispPt]{splinetest}{-3}%
+ <tkzgrpharrowlr>
+ \DrawTangent[Direction=l,Colors=orange,Spline,OffsetL=1.5,DispPt]{splinetest}{3}
+ \DrawTangent[Direction=r,Colors=purple,Spline,OffsetR=1.5,DispPt]{splinetest}{-6}
+\end{GraphTikz}
+\end{tcblisting}
+
+\pagebreak
+
+%\section{Specific commands for density functions}
+%
+%\subsection{Normal distribution}\label{normal distribution}
+%
+%The idea is to provide something to work with standard deviation.
+%
+%\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+% %in the GraphiqueTikz environment
+% \DefineNormalDistribution[keys]<fct name>{mu}{sigma}
+% \TraceNormalDistribution[keys]{fct(x)}
+%\end{tcblisting}
+%
+%The optional \MontreCode{[keys]} available are:
+%
+%\smallskip
+%
+%\begin{itemize}
+% \item \MontreCode{Name}: name of the plot (\MontreCode{Gaussian} by default);
+% \item \MontreCode{Trace}: boolean to trace the curve (\MontreCode{false} by default);
+% \item \MontreCode{Couleur}: color of the trace, if requested (\MontreCode{black} by default);
+% \item \MontreCode{Debut}: lower bound of the definition set (\MontreCode{\textbackslash pflxmin} by default);
+% \item \MontreCode{End}: lower bound of the definition set (\MontreCode{\textbackslash pflxmax} by default);
+% \item \MontreCode{Pas}: plot step (it is determined \textit{automatically} at the start but can be modified).
+%\end{itemize}
+%
+%Note that the vertical axis must be adapted according to the parameters of the normal law.
+%
+%\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+% \begin{GraphTikz}%
+% [x=1.25cm,y=15cm,Origx=5,Xmin=5,Xmax=15,Ymin=0,Ymax=0.3,
+% Ygrid=0.1,Ygrids=0.05]
+% \DrawAxisGrids[Enlarge=2.5mm]{auto}{auto}
+% \DefineNormalDistribution[Name=Gaussian]<phi>{10}{1.5}
+% \TracerIntegral
+% [Terminals=abs, Colors=blue/cyan!50]%
+% {phi(x)}{7}{13}
+% \TraceNormalLaw[Color=purple,Start=5,End=15]{phi(x)}
+% \end{GraphTikz}
+%\end{tcblisting}
+%
+%\pagebreak
+%
+%\subsection{Chi-square law}\label{loikhideux}
+%
+%The idea is to provide something to work with normal laws.
+%
+%\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+% %in the GraphiqueTikz environment
+% \DefineKhiTwoLaw[keys]<fct name>{k}
+% \TraceLawKhiTwo[keys]{fct(x)}
+%\end{tcblisting}
+%
+%The optional \MontreCode{[keys]} available are:
+%
+%\smallskip
+%
+%\begin{itemize}
+% \item \MontreCode{Name}: name of the plot (\MontreCode{Gaussian} by default);
+% \item \MontreCode{Trace}: boolean to trace the curve (\MontreCode{false} by default);
+% \item \MontreCode{Couleur}: color of the trace, if requested (\MontreCode{black} by default);
+% \item \MontreCode{Debut}: lower bound of the definition set (\MontreCode{\textbackslash pflxmin} by default);
+% \item \MontreCode{End}: lower bound of the definition set (\MontreCode{\textbackslash pflxmax} by default);
+% \item \MontreCode{Pas}: plot step (it is determined \textit{automatically} at the start but can be modified).
+%\end{itemize}
+%
+%Note that the vertical axis must be adapted according to the parameter of the chi-square law.
+%
+%\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+% \begin{GraphTikz}[
+% x=1.5cm,y=7.5cm,
+% Xmin=0,Xmax=8,Xgrid=1,Xgrids=0.5,
+% Ymin=0,Ymax=0.5,Ygrid=0.1,Ygrids=0.05
+% ]
+% \DrawAxisGrids[Enlarge=2.5mm]{auto}{auto}
+% \DefineKhiTwoLaw[Color=red,Start=0.25,Trace]<phiA>{1}
+% \DefineKhiTwoLaw[Color=blue,Trace]<phiB>{2}
+% \DefineLawKhiDeux[Color=orange,Trace]<phiC>{3}
+% \DefineKhiTwoLaw[Color=purple,Trace]<phiD>{4}
+% \DefineKhiTwoLaw[Color=yellow,Trace]<phiE>{5}
+% \DefineKhiTwoLaw[Color=teal,Trace]<phiF>{6}
+% \end{GraphTikz}
+%\end{tcblisting}
+
+\pagebreak
+
+\section{Commands specific to two-variable statistics}
+
+\subsection{The point cloud}\label{scatter}
+
+In addition to commands linked to functions, it is also possible to represent double statistical series.
+
+\smallskip
+
+The following paragraph shows that adding a key allows you to add the linear adjustment line.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\DrawScatter[keys]{ListX}{ListY}
+\end{tcblisting}
+
+The optional \MontreCode{[key]} is:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{ColorScatter}: color of the cloud points (\MontreCode{black} by default).
+\end{itemize}
+
+\smallskip
+
+The mandatory arguments allow you to specify:
+
+\smallskip
+
+\begin{itemize}
+ \item the list of x;
+ \item the list of y.
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.075cm,y=0.03cm,Xmin=0,Xmax=160,Xgrid=20,Xgrids=10,
+ Origy=250,Ymin=250,Ymax=400,Ygrid=25,Ygrids=5]
+ %window preparation
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]{0,10,...,160}{250,275,...,400}
+ %A cloud of dots
+ \DrawScatter[Style=x,ColorScatter=red]{0,50,100,140}{275,290,315,350}
+\end{GraphTikz}
+\end{tcblisting}
+
+\subsection{The regression line}\label{reglin}
+
+The linear regression line (obtained by the least squares method) can easily be added, using the key \MontreCode{DrawLine}.
+
+\smallskip
+
+In this case, new keys are available:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{ColorLine}: color of the line (\MontreCode{black} by default);
+ \item \MontreCode{Rounds}: precision of coefficients (\MontreCode{empty} by default);
+ \item \MontreCode{Start}: initial abscissa of the plot (\MontreCode{\textbackslash pflxmin} by default);
+ \item \MontreCode{End}: terminal abscissa of the plot (\MontreCode{\textbackslash pflxmax} by default);
+ \item \MontreCode{Name}: name of the line, for later use (\MontreCode{reglin} by default).
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.075cm,y=0.03cm,Xmin=0,Xmax=160,Xgrid=20,Xgrids=10,
+ Origy=250,Ymin=250,Ymax=400,Ygrid=25,Ygrids=5]
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]{0,10,...,160}{250,275,...,400}
+ %cloud and right
+ \DrawScatter%
+ [ColorScatter=red,ColorLine=brown,DrawLine]%
+ {0,50,100,140}{275,290,315,350}
+ %picture
+ \DrawRanges[Colors=cyan/magenta,Lines]{d}{120}
+ %history
+ \DrawCounterimage[Style=x,Colors=blue/green!50!black,Lines]{reglin}{300}
+\end{GraphTikz}
+\end{tcblisting}
+
+\subsection{Other regressions}\label{regressions}
+
+In partnership with the \MontreCode{xint-regression} package, loaded by the package (but \textit{can be deactivated} via the \MontreCode{[noxintreg]} option), it is possible to work on other types of regression:
+
+\begin{itemize}
+ \item linear \fbox{$ax+b$};
+ \item quadratic \fbox{$ax^2+bx+c$};
+ \item cubic \fbox{$ax^3+bx^2+cx+d$};
+ \item power \fbox{$ax^b$};
+ \item exponential \fbox{$ab^x$} or \fbox{$e^{ax+b}$} or \fbox{$b e^{ax}$} or \fbox{$C + be^{ax} $};
+ \item logarithmic \fbox{$a+b\ln(x)$};
+ \item hyperbolic \fbox{$a+\displaystyle\frac{b}{x}$}.
+\end{itemize}
+
+The command, similar to that of defining a curve, is:
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+\DrawRegression[keys]<no fct>{type}<rounded>{listex}{listey}
+\end{tcblisting}
+
+The \MontreCode{[keys]} available are, classically:
+
+\begin{itemize}
+ \item \MontreCode{Start}: lower bound of the definition set (\MontreCode{\textbackslash pflxmin} by default);
+ \item \MontreCode{End}: lower bound of the definition set (\MontreCode{\textbackslash pflxmax} by default);
+ \item \MontreCode{Name}: name of the curve (important for the rest!);
+ \item \MontreCode{Color}: color of the trace (\MontreCode{black} by default);
+ \item \MontreCode{Step}: plot step (it is determined \textit{automatically} at the start but can be modified).
+\end{itemize}
+
+\pagebreak
+
+The second argument, optional and between \MontreCode{<...>}, allows you to name the regression function.
+
+The third argument, mandatory and between \MontreCode{\{...\}} allows you to choose the type of regression, among:
+
+\begin{itemize}
+ \item \MontreCode{lin}: linear \fbox{$ax+b$};
+ \item \MontreCode{quad}: quadratic \fbox{$ax^2+bx+c$};
+ \item \MontreCode{cub}: cubic \fbox{$ax^3+bx^2+cx+d$};
+ \item \MontreCode{pow}: power \fbox{$ax^b$};
+ \item \MontreCode{expab}: exponential \fbox{$ab^x$}
+ \item \MontreCode{hyp}: hyperbolic \fbox{$a+\displaystyle\frac{b}{x}$};
+ \item \MontreCode{log}: logarithmic \fbox{$a+b\ln(x)$};
+ \item \MontreCode{exp}: exponential \fbox{$e^{ax+b}$};
+ \item \MontreCode{expalt}: exponential \fbox{$be^{ax}$};
+ \item \MontreCode{expoff=C}: exponential \fbox{$C + be^{ax}$}.
+\end{itemize}
+
+The fourth argument, optional and between \MontreCode{<...>}, allows you to specify the rounding(s) for the coefficients of the regression function.
+
+The last two arguments are the lists of values of X and Y.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\def\LISTEXX{0,50,100,140}\def\LISTEYY{275,290,315,350}%
+ListX := \LISTEXX\\
+ListY := \LISTEYY
+
+\begin{GraphTikz}
+ [x=0.05cm,y=0.04cm,Xmin=0,Xmax=160,Xgrid=20,Xgrids=10,
+ Origy=250,Ymin=250,Ymax=400,Ygrid=25,Ygrids=5]
+ %window preparation
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\footnotesize]{auto}{auto}
+ %A cloud of dots
+ \DrawScatter[Style=o,ColorScatter=red]{\LISTEXX}{\LISTEYY}
+ %adjustment expoffset
+ \DrawRegression[Color=blue,Name=adjust]<adjust>{expoff=250}{\LISTEXX}{\LISTEYY}
+ %holdings
+ \DrawRanges[Colors=cyan/magenta,Lines]{adjust}{80}
+ \DrawCounterimage[Style=x,Colors=blue/green!50!black,Lines]{adjust}{325}
+\end{GraphTikz}
+
+\xintexpoffreg[offset=250,round=3/1]{\LISTEXX}{\LISTEYY}%
+We obtain $y=250+\num{\expregoffb}\text{e}^{\num{\expregoffa}x}$
+\end{tcblisting}
+
+\newpage
+
+\section{Auxiliary commands}
+
+\subsection{Intro}
+
+In addition to purely \textit{graphic} commands, some auxiliary commands are available:
+
+\begin{itemize}
+ \item a to format a number with a given precision;
+ \item one for working on random numbers, with constraints.
+\end{itemize}
+
+\subsection{Formatted rounding}\label{round number}
+
+The \MontreCode{\textbackslash RoundNb} command allows you to format, using the \MontreCode{siunitx} package, a number (or a calculation), with a given precision. This can be \textit{useful} for formatting results obtained using coordinate retrieval commands, for example.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+\RoundNb[precision]{xint calculation}
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\RoundNb{1/3}\\
+\RoundNb{16.1}\\
+\RoundNb[3]{log(10)}\\
+\end{tcblisting}
+
+\subsection{Random number under constraints}\label{nbalea}
+
+The idea of this second command is to be able to determine a random number:
+
+\begin{itemize}
+ \item integer or decimal;
+ \item under constraints (between two fixed values).
+\end{itemize}
+
+This can allow, for example, to work on curves with \textit{random} points, but respecting certain constraints.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+\PickRandomNb(*)[precision (def 0)]{lower limit}{upper limit}[\macro]
+\end{tcblisting}
+
+The star version takes the constraints in strict form ($\text{lower bound} < \text{macro} < \text{upper bound}$) while the normal version takes the constraints in broad form ($\text{lower bound) } \leq \text{macro} \leq \text{upper bound}$).
+
+\smallskip
+
+Note that the \textit{terminals} can be existing \textit{macros}!
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+%a number (2 digits after the decimal point) between 0.75 and 0.95
+%a number (2 digits after the decimal point) between 0.05 and 0.25
+%a number (2 decimal places) between 0.55 and \YrandMax
+%a number (2 decimal places) between \YrandMin and 0.45
+\PickRandomNb[2]{0.75}{0.95}[\YrandMax]%
+\PickRandomNb[2]{0.05}{0.25}[\YrandMin]%
+\PickRandomNb*[2]{0.55}{\YrandMax}[\YrandA]%
+\PickRandomNb*[2]{\YrandMin}{0.45}[\YrandB]%
+%verification
+\num{\YrandMax} \& \num{\YrandMin} \& \num{\YrandA} \& \num{\YrandB}
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+%a number (2 digits after the decimal point) between 0.75 and 0.95
+%a number (2 digits after the decimal point) between 0.05 and 0.25
+%a number (2 decimal places) between 0.55 and \YrandMax
+%a number (2 decimal places) between \YrandMin and 0.45
+\PickRandomNb[2]{0.75}{0.95}[\YrandMax]%
+\PickRandomNb[2]{0.05}{0.25}[\YrandMin]%
+\PickRandomNb*[2]{0.55}{\YrandMax}[\YrandA]%
+\PickRandomNb*[2]{\YrandMin}{0.45}[\YrandB]%
+%verification
+\num{\YrandMax} \& \num{\YrandMin} \& \num{\YrandA} \& \num{\YrandB}
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+%the curve is designed so that there are 3 antecedents
+\PickRandomNb[2]{0.75}{0.95}[\YrandMax]%
+\PickRandomNb[2]{0.05}{0.25}[\YrandMin]%
+\PickRandomNb*[2]{0.55}{\YrandMax}[\YrandA]%
+\PickRandomNb*[2]{\YrandMin}{0.45}[\YrandB]%
+
+\begin{GraphTikz}
+ [x=0.075cm,y=7.5cm,Xmin=0,Xmax=150,Xgrid=10,Xgrids=5,
+ Ymin=0,Ymax=1,Ygrid=0.1,Ygrids=0.05]
+ \DrawAxisGrids[Last,Enlarge=2.5mm]{auto}{auto}
+ \DefineInterpoCurve[Color=red,Trace,Name=functiontest,Tension=0.75]
+ {(0,\YrandA)(40,\YrandMin)(90,\YrandMax)(140,\YrandB)}
+ \FindCounterimage[Disp=false,Name=ANTECED]{functiontest}{0.5}
+ \DrawCounterimage[Colors=blue/teal,Lines]{functiontest}{0.5}
+ \GetXcoord{(ANTECED-1)}[\Aalpha]
+ \GetXcoord{(ANTECED-2)}[\Bbeta]
+ \GetXcoord
+ {(ANTECED-3)}[\Cgamma]
+\end{GraphTikz}
+
+The solutions of $f(x)=\num{0.5}$ are, by graphic reading:
+$\begin{cases}
+ \alpha \approx \RoundNb[0]{\Aalpha} \\
+ \beta \approx \RoundNb[0]{\Bbeta} \\
+ \gamma \approx \RoundNb[0]{\Cgamma}
+\end{cases}$.
+\end{tcblisting}
+%
+%\newpage
+%
+%\section{Liste des commandes}
+%
+%Les commandes disponibles sont :
+%
+%\NewDocumentCommand\lstcmd{ m m m }{%
+% \item[\texttt{#1}] : \mintinline{latex}|#2|\hfill{}page \pageref{#3}
+%}
+%
+%\begin{description}
+% \lstcmd{environnement~~}{\begin{GraphiqueTikz}...\end{GraphiqueTikz}}{creaenvt}
+% \lstcmd{axes et grilles}{\TracerAxesGrille}{creaaxesgr}
+% \lstcmd{aj val axes X~~}{\RajouterValeursAxeX}{ajoutvals}
+% \lstcmd{aj val axes Y~~}{\RajouterValeursAxeY}{ajoutvals}
+% \lstcmd{def fonction~~~}{\DefineCurve}{deftracfct}
+% \lstcmd{tracé courbe~~~}{\DrawCurve}{deftracfct}
+% \lstcmd{def interpo~~~~}{\DefineCurveInterpo}{deftracinterpo}
+% \lstcmd{tracé interpo~~}{\DrawCurveInterpo}{deftracinterpo}
+% \lstcmd{def spline~~~~~}{\DefineSplineCurve}{deftracfctspline}
+% \lstcmd{tracé spline~~~}{\DrawSplineCurve}{deftracfctspline}
+% \lstcmd{tracé droite~~~}{\TracerDroite}{tracdroite}
+% \lstcmd{def points~~~~~}{\DefinirPts}{defpts}
+% \lstcmd{def image~~~~~~}{\DefinirImage}{defpts}
+% \lstcmd{marq pts~~~~~~~}{\MarquerPts}{markpts}
+% \lstcmd{placer txt~~~~~}{\PlacerTexte}{placetxt}
+% \lstcmd{récup absc~~~~~}{\RecupererAbscisse}{recupcoordo}
+% \lstcmd{récup ordo~~~~~}{\RecupererOrdonnee}{recupcoordo}
+% \lstcmd{récup coordos~~}{\RecupererCoordonnees}{recupcoordo}
+% \lstcmd{images~~~~~~~~~}{\PlacerImages}{images}
+% \lstcmd{antécédents~~~~}{\TrouverAntecedents}{defanteced}
+% \lstcmd{antécédents~~~~}{\PlacerAntecedents}{tracanteced}
+% \lstcmd{intersection~~~}{\TrouverIntersections}{intersect}
+% \lstcmd{maximum~~~~~~~~}{\TrouverMaximum}{maximum}
+% \lstcmd{minimum~~~~~~~~}{\TrouverMinimum}{minimum}
+% \lstcmd{intégrale~~~~~~}{\DrawIntegral}{integr}
+% \lstcmd{tangente~~~~~~~}{\DrawTangente}{tgte}
+% \lstcmd{loi normale~~~~}{\DefinirLoiNormale}{loinormale}
+% \lstcmd{loi normale~~~~}{\TracerLoiNormale}{loinormale}
+% \lstcmd{loi khideux~~~~}{\DefinirLoiKhiDeux}{loikhideux}
+% \lstcmd{loi khideux~~~~}{\TracerLoiKhiDeux}{loikhideux}
+% \lstcmd{stats 2 var~~~~}{\TracerNuage}{nuage}
+% \lstcmd{regressions~~~~}{\TracerAjustement}{regressions}
+% \lstcmd{arrondi~~~~~~~~}{\RoundNb}{numarrond}
+% \lstcmd{nb aléat~~~~~~~}{\ChoisirNbAlea}{nbalea}
+%\end{description}
+
+\pagebreak
+
+\section{History}
+
+\begin{quote}
+\begin{verbatim}
+0.1.5 : Initial version [en]
+\end{verbatim}
+\end{quote}
+
+\end{document} \ 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..c53d69179c
--- /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..9ea6b13200
--- /dev/null
+++ b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-doc-fr.tex
@@ -0,0 +1,1810 @@
+% !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.5}
+\def\TPdate{22/06/2024}
+\usepackage{soul}
+\usepackage{codehigh}
+\usepackage{tabularray}
+\sethlcolor{lightgray!25}
+\NewDocumentCommand\MontreCode{ m }{%
+ \hl{\vphantom{\texttt{pf}}\texttt{#1}}%
+}
+\usepackage[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,}\\
+ \\
+ {\LARGE basé sur \textsf{\TikZ} et \textsf{xint}.}\\
+ \\
+ {\small \texttt{Version \TPversion{} -- \TPdate}}
+ \end{tabular}
+ \end{center}
+ \end{tcolorbox}
+\end{minipage}
+\end{center}
+
+\begin{center}
+ \begin{tabular}{c}
+ \texttt{Cédric Pierquet}\\
+ {\ttfamily c pierquet -- at -- outlook . fr}\\
+ \texttt{\url{https://forge.apps.education.fr/pierquetcedric/package-latex-tkz-grapheur}} \\
+\end{tabular}
+\end{center}
+
+\hrule
+
+\vfill
+
+\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5,halign=center]
+\begin{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
+
+\hfill{\footnotesize\textit{\ttfamily À mon papa.}}
+
+\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 ou la courbe d'un autre ajustement.
+\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}, \MontreCode{xintexpr}, \MontreCode{xstring}, \MontreCode{listofitems} ;
+ \item \MontreCode{xint-regression}\footnote{CTAN : \url{https://ctan.org/pkg/xint-regression}.} (pour les régressions, désactivable via \MontreCode{[nonxintreg]}).
+\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 /labels)
+\tikzset{pflpoint/.style={line width=0.95pt}}
+\tikzset{pflpointc/.style={radius=1.75pt}}
+\tikzset{pflpointnuage/.style={radius=1.75pt}}
+\tikzset{pflnoeud/.style={}} %pour les inner sep par exemple :-)
+
+%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
+\TracerAxesGrilles[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
+ %la fonction ln a été créée pour xint !
+ \DefinirCourbe[Nom=cf,Debut=5,Fin=19]<f>{-2*x+3+24*ln(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*ln(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
+
+Il est également possible de définir des nœuds pour des points \textit{image}.
+
+\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}
+%par les coordonnées
+\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,listing only}
+%sous forme d'image
+\DefinirImage[clés]{objet}{abscisse}
+\end{tcblisting}
+
+Les \MontreCode{[clés]}, optionnelles, disponibles sont :
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Nom} : nom du nœud (\MontreCode{vide} par défaut) ;
+ \item \MontreCode{Spline} : booléen pour spécifier qu'un spline est utilisé (\MontreCode{false} par défaut).
+\end{itemize}
+
+Le premier argument obligatoire est l'\textit{objet} considéré (nom de la courbe pour le spline, fonction sinon) ; le second est l'abscisse du point considéré.
+
+\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}
+ %nœud image
+ \DefinirImage[Nom=IMGf]{f}{14}
+ \MarquerPts*[Style=x,Couleur=blue]{(IMGf)}
+\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,Ymin=-2]
+ \TracerAxesGrilles[Elargir=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}
+
+À noter qu'il est également possible de modifier la taille des marques \MontreCode{o/x/+/c} via les \MontreCode{[clés]} :
+
+\begin{itemize}
+ \item \MontreCode{Taillex=...} (\MontreCode{2pt} par défaut) pour les points \textit{croix} ;
+ \item \MontreCode{Tailleo=...} (\MontreCode{1.75pt} par défaut) pour les points \textit{cercle} ;
+ \item \MontreCode{Taillec=...} (\MontreCode{2pt} par défaut) pour les points \textit{carré}.
+\end{itemize}
+
+\pagebreak
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphiqueTikz}[x=1cm,y=1cm,Xmin=0,Ymin=0]
+ \TracerAxesGrilles[Elargir=2.5mm]{auto}{auto}
+ \MarquerPts[Couleur=red,Style=x,Taillex=3.5pt]{(1.25,1.25)/$A$/below}
+ \MarquerPts[Couleur=teal,Tailleo=2.5pt]{(2,2)/$A$/right}
+ \MarquerPts*[Couleur=orange,Style=c,Taillec=4pt]{(0.5,2.5)}
+\end{GraphiqueTikz}
+\end{tcblisting}
+
+\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}
+
+\subsection{Placer du texte}\label{placetxt}
+
+À noter qu'une commande de placement de texte est disponible.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%dans l'environnement GraphiqueTikz
+\PlacerTexte[clés]{(nœud ou coordonnées)}{texte}
+\end{tcblisting}
+
+Les \MontreCode{[clés]} disponibles sont :
+
+\begin{itemize}
+ \item \MontreCode{Police=...} (\MontreCode{\textbackslash normalsize\textbackslash normalfont} par défaut) pour la police ;
+ \item \MontreCode{Couleur=...} (\MontreCode{black} par défaut) pour la couleur ;
+ \item \MontreCode{Position=...} (\MontreCode{vide} par défaut) pour la position du texte par rapport aux coordonnées.
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+ \begin{GraphiqueTikz}[x=1cm,y=1cm,Xmin=0,Xmax=5,Ymin=0,Ymax=1]
+ \TracerAxesGrilles[Elargir=2.5mm]{auto}{auto}
+ \PlacerTexte[Couleur=red,Police=\LARGE,Position=right]{(1.5,0.5)}{courbe $C_1$}
+ \end{GraphiqueTikz}
+\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}
+
+\subsection{Autres régressions}\label{regressions}
+
+En partenariat avec le package \MontreCode{xint-regression}, chargé par le package (mais \textit{désactivable} via l'option \MontreCode{[nonxintreg]}), il est possible de travailler sur d'autres types de régression :
+
+\begin{itemize}
+ \item linéaire \fbox{$ax+b$} ;
+ \item quadratique \fbox{$ax^2+bx+c$} ;
+ \item cubique \fbox{$ax^3+bx^2+cx+d$} ;
+ \item puissance \fbox{$ax^b$} ;
+ \item exponentielle \fbox{$ab^x$} ou \fbox{$e^{ax+b}$} ou \fbox{$b e^{ax}$} ou \fbox{$C + be^{ax}$} ;
+ \item logarithmique \fbox{$a+b\ln(x)$} ;
+ \item hyperbolique \fbox{$a+\displaystyle\frac{b}{x}$}.
+\end{itemize}
+
+La commande, similaire à celle de définition d'une courbe, est :
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+\TracerAjustement[clés]<non fct>{type}<arrondis>{listex}{listey}
+\end{tcblisting}
+
+Les \MontreCode{[clés]} disponibles sont, de manière classique :
+
+\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é).
+\end{itemize}
+
+\pagebreak
+
+Le deuxième argument, optionnel et entre \MontreCode{<...>} permet de nommer la fonction de régression.
+
+Le troisième argument, obligatoire et entre \MontreCode{\{...\}} permet de choisir le type de régression, parmi :
+
+\begin{itemize}
+ \item \MontreCode{lin} : linéaire \fbox{$ax+b$} ;
+ \item \MontreCode{quad} : quadratique \fbox{$ax^2+bx+c$} ;
+ \item \MontreCode{cub} : cubique \fbox{$ax^3+bx^2+cx+d$} ;
+ \item \MontreCode{pow} : puissance \fbox{$ax^b$} ;
+ \item \MontreCode{expab} : exponentielle \fbox{$ab^x$}
+ \item \MontreCode{hyp} : hyperbolique \fbox{$a+\displaystyle\frac{b}{x}$} ;
+ \item \MontreCode{log} : logarithmique \fbox{$a+b\ln(x)$} ;
+ \item \MontreCode{exp} : exponentielle \fbox{$e^{ax+b}$} ;
+ \item \MontreCode{expalt} : exponentielle \fbox{$be^{ax}$} ;
+ \item \MontreCode{expoff=C} : exponentielle \fbox{$C + be^{ax}$}.
+\end{itemize}
+
+Le quatrième argument, optionnel et entre \MontreCode{<...>} permet de spécifier le ou les arrondis pour les coefficients de la fonction de régression.
+
+Les deux derniers arguments sont les listes des valeurs de X et de Y.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\def\LISTEXX{0,50,100,140}\def\LISTEYY{275,290,315,350}%
+ListeX := \LISTEXX\\
+ListeY := \LISTEYY
+
+\begin{GraphiqueTikz}
+ [x=0.05cm,y=0.04cm,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=\footnotesize]{auto}{auto}
+ %nuage de points
+ \TracerNuage[Style=o,CouleurNuage=red]{\LISTEXX}{\LISTEYY}
+ %ajustement expoffset
+ \TracerAjustement[Couleur=blue,Nom=ajust]<ajust>{expoff=250}{\LISTEXX}{\LISTEYY}
+ %exploitations
+ \PlacerImages[Couleurs=cyan/magenta,Traits]{ajust}{80}
+ \PlacerAntecedents[Style=x,Couleurs=blue/green!50!black,Traits]{ajust}{325}
+\end{GraphiqueTikz}
+
+\xintexpoffreg[offset=250,round=3/1]{\LISTEXX}{\LISTEYY}%
+On obtient $y=250+\num{\expregoffb}\text{e}^{\num{\expregoffa}x}$
+\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{def image~~~~~~}{\DefinirImage}{defpts}
+ \lstcmd{marq pts~~~~~~~}{\MarquerPts}{markpts}
+ \lstcmd{placer txt~~~~~}{\PlacerTexte}{placetxt}
+ \lstcmd{récup absc~~~~~}{\RecupererAbscisse}{recupcoordo}
+ \lstcmd{récup ordo~~~~~}{\RecupererOrdonnee}{recupcoordo}
+ \lstcmd{récup coordos~~}{\RecupererCoordonnees}{recupcoordo}
+ \lstcmd{images~~~~~~~~~}{\PlacerImages}{images}
+ \lstcmd{antécédents~~~~}{\TrouverAntecedents}{defanteced}
+ \lstcmd{antécédents~~~~}{\PlacerAntecedents}{tracanteced}
+ \lstcmd{intersection~~~}{\TrouverIntersections}{intersect}
+ \lstcmd{maximum~~~~~~~~}{\TrouverMaximum}{maximum}
+ \lstcmd{minimum~~~~~~~~}{\TrouverMinimum}{minimum}
+ \lstcmd{intégrale~~~~~~}{\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{regressions~~~~}{\TracerAjustement}{regressions}
+ \lstcmd{arrondi~~~~~~~~}{\ArrondirNum}{numarrond}
+ \lstcmd{nb aléat~~~~~~~}{\ChoisirNbAlea}{nbalea}
+\end{description}
+
+\pagebreak
+
+\section{Historique}
+
+\begin{quote}
+\begin{verbatim}
+0.1.5 : Correction d'un bug sur les rajouts de valeurs + Nœud pour une image + [en] version !
+0.1.4 : Placement de texte
+0.1.3 : Ajout de régressions avec le package xint-regression
+0.1.2 : 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-examples-integrals.pdf b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-examples-integrals.pdf
new file mode 100644
index 0000000000..917caaab19
--- /dev/null
+++ b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-examples-integrals.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-examples-integrals.tex b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-examples-integrals.tex
new file mode 100644
index 0000000000..068ba103eb
--- /dev/null
+++ b/graphics/pgf/contrib/tkz-grapheur/doc/tkz-grapheur-examples-integrals.tex
@@ -0,0 +1,251 @@
+% !TeX TXS-program:compile = txs:///arara
+% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode}
+
+\documentclass[a4paper,english,11pt]{article}
+\usepackage[margin=1cm,includefoot]{geometry}
+\usepackage[english]{tkz-grapheur}
+\usepackage{tcolorbox}
+\tcbuselibrary{skins,minted}
+\usepackage{babel}
+
+\begin{document}
+
+\part*{Integrals examples}
+
+\section{Below cruve, by default}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Behind,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineCurve[Name=ch]<h>{0.25*(x+2)^2+1}
+ \DrawIntegral%
+ [Colors=blue/cyan,Style=fill]%
+ {h(x)} %formula
+ {-5.25}{1.5}
+ \DrawCurve[Color=red]{h(x)}
+ \DrawAxisGrids[Above,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\section{Behind interpolation curve}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineLstInterpol{(-6,4)(-2,-2)(3,3.5)}[\interpoA]
+ \DefineInterpoCurve[Name=interpotest,Tension=1.05]{\interpoA}
+ \DrawIntegral%
+ [NameInterpo=interpotest,Colors=blue/cyan,Style=fill,Type=itp,Tension=1.05]%
+ {\interpoA} %pointsinterpo
+ {-5.25}{1.5}
+ \DrawInterpoCurve[Color=red,Tension=1.05]{\interpoA}
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\section{Behind cubic spline}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineLstSpline{-6/4/-2§-5/2/-2§-4/0/-2§-2/-2/0§1/2/2§3/3.5/0.5}[\lstsplineA]
+ \DefineSplineCurve[Name=splinetest]{\lstsplineA}<\SplineTeal>
+ \DrawIntegral%
+ [NameSpline=\SplineTeal,Type=spl,Colors=blue/purple,Style=hatch]%
+ {splinetest} %namesplinecurve
+ {-5}{2}
+ \DrawSplineCurve[Color=teal]{\lstsplineA}
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\section{Between curves}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineCurve[Name=ch]<h>{0.25*(x+2)^2-1}
+ \DefineCurve[Name=ck]<k>{-0.25*x+1}
+ \FindIntersections[Name=ITSC,Disp=false]{ch}{ck}
+ \DrawIntegral%
+ [Colors=olive/pink,Style=fill,Type=fct/fct,Bounds=node/abs]%
+ {h(x)}[k(x)] %formules
+ {(ITSC-1)}{1.5}
+ \DrawCurve[Color=red]{h(x)}
+ \DrawCurve[Color=blue]{k(x)}
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\section{Between splines}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineLstSpline{-6/4/-2§-5/2/-2§-4/0/-2§-2/-2/0§1/2/2§3/3.5/0.5}[\lstsplineA]
+ \DefineLstSpline{-6/-2/3§-2/4/0§3/-1/0}[\lstsplineB]
+ \DefineSplineCurve[Name=splinetestolive]{\lstsplineA}<\SplineOlive>
+ \DefineSplineCurve[Name=splinetestteal]{\lstsplineB}<\SplineTeal>
+ \FindIntersections[Name=ITT,Disp=false]{splinetestteal}{splinetestolive}
+ \DrawIntegral%
+ [NameSpline=\SplineTeal,NameSplineB=\SplineOlive,Type=spl/spl,Colors=blue/purple,Bounds=nodes]%
+ {splinetestolive} %Namecourbespline
+ [splinetestteal] %Namecourbespline
+ {(ITT-1)}{(ITT-2)}
+ \DrawSplineCurve[Color=teal]{\lstsplineA}
+ \DrawSplineCurve[Color=olive]{\lstsplineB}
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\section{Between interpolations}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineLstInterpol{(-6,4)(-2,-2)(3,3.5)}[\interpoA]
+ \DefineInterpoCurve[Name=interpotest]{\interpoA}
+ \DefineLstInterpol{(-6,-2)(-1,4)(3,0)}[\interpoB]
+ \DefineInterpoCurve[Name=interpotesta]{\interpoB}
+ \DrawIntegral%
+ [NameInterpo=interpotesta,NameInterpoB=interpotest,Type=itp/itp,Colors=olive/pink]%
+ {\interpoB} %pointsinterpo
+ [\interpoA] %pointsinterpo
+ {-2}{1}
+ \DrawInterpoCurve[Color=red]{\interpoA}
+ \DrawInterpoCurve[Color=blue]{\interpoB}
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\section{Betweend function and spline}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineCurve[Name=ch]<h>{-0.25*(x+2)^2+3.5}
+ \DefineLstSpline{-6/4/-2§-5/2/-2§-4/0/-2§-2/-2/0§1/2/2§3/3.5/0.5}[\lstsplineA]
+ \DefineSplineCurve[Name=splineblue]{\lstsplineA}<\Splineblue>
+ \DrawIntegral%
+ [NameSplineB=\Splineblue,Type=fct/spl,Colors=olive/pink]%
+ {h(x)} %formule
+ [splineblue] %Namecourbespline
+ {-3}{0}
+ \DrawCurve[Color=red]{h(x)}
+ \DrawSplineCurve[Color=blue]{\lstsplineA}
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\section{Between spline and function}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineCurve[Name=ch]<h>{0.25*(x+2)^2-2}
+ \DefineLstSpline{-6/4/2§-5/-2/-2§-4/0/2§-2/2/0§1/-2/-2§3/3.5/-0.5}[\lstsplineA]
+ \DefineSplineCurve[Name=splineblue]{\lstsplineA}<\Splineblue>
+ \DrawIntegral%
+ [NameSpline=\Splineblue,Type=spl/fct,Colors=olive/pink]%
+ {splineblue} %Namecourbespline
+ [h(x)] %formule
+ {-3}{-1}
+ \DrawCurve[Color=red]{h(x)}
+ \DrawSplineCurve[Color=blue]{\lstsplineA}
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\section{Between function and interpo}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineCurve[Name=cm]<m>{-0.25*(x+2)^2+4}
+ \DefineLstInterpol{(-6,4)(-5,-2)(-2,1)(1,-2)(3,3)}[\interpoB]
+ \DefineInterpoCurve[Name=interpotestb]{\interpoB}
+ \DrawIntegral%
+ [NameInterpoB=interpotestb,Type=fct/itp,Colors=olive/pink]%
+ {m(x)} %formule
+ [\interpoB] %pointsinterpo
+ {-4}{1}
+ \DrawCurve[Color=red]{m(x)}
+ \DrawInterpoCurve[Color=blue]{\interpoB}
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\section{Between interpo and function}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineCurve[Name=courbeQ]<q>{0.25*(x+2)^2-2.5}
+ \DefineLstInterpol{(-6,-2)(-5,4)(-2,-1)(1,2)(3,-2)}[\interpoA]
+ \DefineInterpoCurve[Name=interpotest]{\interpoA}
+ \FindIntersections[Name=FGH,Disp]{interpotest}{courbeQ}
+ \DrawIntegral%
+ [NameInterpo=interpotest,Type=itp/fct,Colors=olive/pink,Bounds=nodes]%
+ {\interpoA} %pointsinterpo
+ [q(x)] %formule
+ {(FGH-1)}{(FGH-2)}
+ \DrawCurve[Color=red]{q(x)}
+ \DrawInterpoCurve[Color=blue]{\interpoA}
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\section{Between spline and interpo}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineLstSpline{-6/-2/2§-3/4/0§3/-2/0}[\lstsplineA]
+ \DefineSplineCurve[Name=splinered]{\lstsplineA}<\Splinered>
+ \DefineLstInterpol{(-6,4)(-5,-2)(-2,1)(1,-2)(3,3)}[\interpoB]
+ \DefineInterpoCurve[Name=interpotestb]{\interpoB}
+ \DrawIntegral%
+ [NameInterpoB=interpotestb,NameSpline=\Splinered,Type=spl/itp,Colors=olive/pink]%
+ {splinered} %Namecourbespline
+ [\interpoB] %pointsinterpo
+ {-4}{-2}
+ \DrawSplineCurve[Color=red]{\lstsplineA}
+ \DrawInterpoCurve[Color=blue]{\interpoB}
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\section{Between interpo and spline}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineLstSpline{-6/4/-2§-3/-2.25/0§3/3/0}[\lstsplineB]
+ \DefineSplineCurve[Name=splineblue]{\lstsplineB}<\Splineblue>
+ \DefineLstInterpol{(-6,-2)(-5,4)(-2,-1)(1,2)(3,-2.5)}[\interpoA]
+ \DefineInterpoCurve[Name=interpotest]{\interpoA}
+ \FindIntersections[Name=UIO,Disp]{interpotest}{splineblue}
+ \DrawIntegral%
+ [NameInterpo=interpotest,NameSplineB=\Splineblue,Type=itp/spl,Colors=olive/pink,Bounds=nodes]%
+ {\interpoA} %pointsinterpo
+ [splineblue] %Namecourbespline
+ {(UIO-1)}{(UIO-2)}
+ \DrawSplineCurve[Color=blue]{\lstsplineB}
+ \DrawInterpoCurve[Color=red]{\interpoA}
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\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..985d09c617
--- /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..3de4286c8e
--- /dev/null
+++ b/graphics/pgf/contrib/tkz-grapheur/tex/tkz-grapheur.sty
@@ -0,0 +1,4064 @@
+% 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/06/22 0.1.5.Des outils en TikZ pour travailler comme avec un grapheur]
+
+%====HISTORIQUE
+% v 0.1.5 Correction d'un bug avec les valeurs manuelles + Nœud pour une image + [en] version !
+% v 0.1.4 Ajout des placements de textes
+% v 0.1.3 Régressions, avec xintreg (désactivable)
+% 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]
+
+%====OPTIONS
+\newif\if@loadsiunitx \@loadsiunitxtrue
+\DeclareOption{nonsiunitx}{\@loadsiunitxfalse}%
+\DeclareOption{nosiunitx}{\@loadsiunitxfalse}%
+
+\newif\if@loadtikzbabel \@loadtikzbabeltrue
+\DeclareOption{nontikzbabel}{\@loadtikzbabelfalse}%
+\DeclareOption{notikzbabel}{\@loadtikzbabelfalse}%
+
+\newif\if@loadxintreg \@loadxintregtrue
+\DeclareOption{nonxintreg}{\@loadxintregfalse}%
+\DeclareOption{noxintreg}{\@loadxintregfalse}%
+
+\newif\if@lngenglish \@lngenglishfalse
+\DeclareOption{english}{\@lngenglishtrue}%
+
+\DeclareOption*{}
+\ProcessOptions\relax
+
+%====BASE
+\RequirePackage{tikz}
+\RequirePackage{ifthen}
+\usetikzlibrary{calc,intersections,patterns,patterns.meta,bbox}
+\RequirePackage{simplekv}
+\RequirePackage{xintexpr}
+\RequirePackage{xstring}
+\RequirePackage{listofitems}
+\if@loadxintreg
+ \RequirePackage{xint-regression}
+\fi
+
+%====SIUNITX + [en]
+\if@loadsiunitx
+ \RequirePackage{siunitx}
+ \if@lngenglish
+ \sisetup{mode=match,propagate-math-font=true,reset-math-version=false,reset-text-family=false,reset-text-series=false,reset-text-shape=false,text-family-to-math=true,text-series-to-math=true}
+ \else
+ \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
+\fi
+
+%====TIKZ.BABEL
+\if@loadtikzbabel
+ \usetikzlibrary{babel}
+\fi
+
+%++++++++++++++++++++++++++
+%+++++++++FRANÇAIS+++++++++
+%++++++++++++++++++++++++++
+
+%====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{pflnoeud/.style={}}
+\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;
+
+%====focntion ln, en langage xint
+\xintdeffloatfunc ln(x) := log(x);
+
+%===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[pflnoeud,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[pflnoeud,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[pflnoeud,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[pflnoeud,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[pflnoeud,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[pflnoeud,\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[pflnoeud,\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[pflnoeud,\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[pflnoeud,\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[pflnoeud,\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[pflnoeud,\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[pflnoeud,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,...,\LstValYlen}{%
+ \itemtomacro\LstValY[\i]\mavaly%
+ \itemtomacro\LstValFmtY[\i]\mavalfmty%
+ \draw ([xshift=-\pflthickgrad]{\pflOx},{\mavaly}) node[pflnoeud,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[pflnoeud,\Pos,font=#3] {\Label} ;
+ }
+ }%
+}
+
+% %====STATS À 2 VARIABLES
+\defKV[GraphiqueTikzRegLin]{%
+ Arrondis=\def\pflarrondisreglin{#1},
+ Nom=\def\pflnamereglin{#1},
+ NomPara=\def\pflnameregquad{#1},
+ Debut=\def\pflreglinmin{#1},
+ Fin=\def\pflreglinmax{#1}
+}
+\setKVdefault[GraphiqueTikzRegLin]{
+ CouleurNuage=black,
+ CouleurDroite=black,
+ CouleurPara=black,
+ Arrondis={},
+ Debut={\pflxmin},
+ Fin={\pflxmax},
+ Nom=reglin,%
+ NomPara=quadreg,%
+ TracerDroite=false,%
+ TracerParabole=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)}%
+ }
+ %droite de régression
+ \ifboolKV[GraphiqueTikzRegLin]{TracerDroite}%
+ {%
+ %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}
+ }%
+ {}%
+ \ifboolKV[GraphiqueTikzRegLin]{TracerParabole}%
+ {%
+ %somme importantes
+ \xdef\LXSomme{0}%
+ \xdef\LXCSomme{0}%
+ \xdef\LYSomme{0}%
+ \xdef\LXXSomme{0}%
+ \xdef\LXYSomme{0}%
+ \xdef\LXXCSomme{0}%
+ \xdef\LXCXCSomme{0}%
+ \xdef\LXCYSomme{0}%
+ %calculs
+ \foreach \i in {1,2,...,\LNB}{%
+ \xdef\LXSomme{\xintfloateval{\LXSomme+\LX[\i]}}%
+ \xdef\LXCSomme{\xintfloateval{\LXCSomme+(\LX[\i])^2}}%
+ }%
+ \foreach \i in {1,2,...,\LNB}{%
+ \xdef\LYSomme{\xintfloateval{\LYSomme+\LY[\i]}}%
+ }%
+ \xdef\LXmoy{\xintfloateval{\LXSomme/\LNB}}%
+ \xdef\LYmoy{\xintfloateval{\LYSomme/\LNB}}%
+ \xdef\LXCmoy{\xintfloateval{\LXCSomme/\LNB}}%
+ %calculs suites
+ \foreach \i in {1,2,...,\LNB}{%
+ \xdef\LXXSomme{\xintfloateval{\LXXSomme+(\LX[\i]-\LXmoy)^2}}%
+ \xdef\LXYSomme{\xintfloateval{\LXYSomme+(\LX[\i]-\LXmoy)*(\LY[\i]-\LYmoy)}}%
+ \xdef\LXXCSomme{\xintfloateval{\LXXCSomme+(\LX[\i]-\LXmoy)*((\LX[\i])*(\LX[\i])-\LXCmoy)}}%
+ \xdef\LXCXCSomme{\xintfloateval{\LXCXCSomme+((\LX[\i])^2-\LXCmoy)^2}}%
+ \xdef\LXCYSomme{\xintfloateval{\LXCYSomme+((\LX[\i])^2-\LXCmoy)*(\LY[\i]-\LYmoy)}}%
+ }%
+ %COEFFS OK
+ \IfStrEq{\pflarrondisreglin}{}%
+ {%
+ \xdef\tmpcoeffregquadb{\xintfloateval{(\LXYSomme*\LXCXCSomme-\LXCYSomme*\LXXCSomme)/(\LXXSomme*\LXCXCSomme-(\LXXCSomme)^2)}}
+ \xdef\tmpcoeffregquada{\xintfloateval{(\LXCYSomme*\LXXSomme-\LXYSomme*\LXXCSomme)/(\LXXSomme*\LXCXCSomme-(\LXXCSomme)^2)}}
+ \xdef\tmpcoeffregquadc{\xintfloateval{\LYmoy-\tmpcoeffregquadb*\LXmoy-\tmpcoeffregquada*\LXCmoy}}
+ }%
+ {%
+ \xdef\tmpcoeffregquadb{\xintfloateval{round((\LXYSomme*\LXCXCSomme-\LXCYSomme*\LXXCSomme)/(\LXXSomme*\LXCXCSomme-(\LXXCSomme)^2),\pflarrondisreglin)}}
+ \xdef\tmpcoeffregquada{\xintfloateval{round((\LXCYSomme*\LXXSomme-\LXYSomme*\LXXCSomme)/(\LXXSomme*\LXCXCSomme-(\LXXCSomme)^2),\pflarrondisreglin)}}
+ \xdef\tmpcoeffregquadc{\xintfloateval{round(\LYmoy-\tmpcoeffregquadb*\LXmoy-\tmpcoeffregquada*\LXCmoy,\pflarrondisreglin)}}
+ }%
+ \xintdeffloatfunc #2(x) := (\tmpcoeffregquada)*x^2+(\tmpcoeffregquadb)*x+\tmpcoeffregquadc ;
+ %tracé
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \draw[pflcourbe,{\useKV[GraphiqueTikzRegLin]{CouleurPara}},name path global=\pflnameregquad,samples=250,domain=\pflreglinmin:\pflreglinmax] plot (\x,{\tmpcoeffregquada*(\x)^2+\tmpcoeffregquadb*\x+\tmpcoeffregquadc}) ;
+ \end{scope}
+ }%
+ {}%
+}
+
+\if@loadxintreg
+%régressions alternatives
+\NewDocumentCommand\TracerAjustement{ O{} D<>{cbajust} m D<>{} m m }{%
+ %1=options de tracés
+ %2=nom courbe
+ %3=type
+ %4=arrondis
+ %5=liste X
+ %6=liste Y
+ \IfStrEq{#3}{lin}%
+ {%
+ \xintlinreg[round={#4}]{#5}{#6}%
+ \DefinirFonction[#1,Trace]<#2>{\linrega*x+\linregb}%
+ }%
+ {}%
+ \IfStrEq{#3}{quad}%
+ {%
+ \xintquadreg[round={#4}]{#5}{#6}%
+ \DefinirFonction[#1,Trace]<#2>{\quadrega*x^2+\quadregb*x+\quadregc}%
+ }%
+ {}%
+ \IfStrEq{#3}{pow}%
+ {%
+ \xintpowreg[round={#4}]{#5}{#6}%
+ \DefinirFonction[#1,Trace]<#2>{\powrega*x^(\powregb)}%
+ }%
+ {}%
+ \IfStrEq{#3}{expab}%
+ {%
+ \xintexpabreg[round={#4}]{#5}{#6}%
+ \DefinirFonction[#1,Trace]<#2>{\expabrega*(\expabregb)^x}%
+ }%
+ {}%
+ \IfStrEq{#3}{hyp}%
+ {%
+ \xinthypreg[round={#4}]{#5}{#6}%
+ \DefinirFonction[#1,Trace]<#2>{\hyprega+(\hypregb)/x}%
+ }%
+ {}%
+ \IfStrEq{#3}{log}%
+ {%
+ \xintlogreg[round={#4}]{#5}{#6}%
+ \DefinirFonction[#1,Trace]<#2>{\logrega+(\logregb)*log(x)}%
+ }%
+ {}%
+ \IfStrEq{#3}{exp}%
+ {%
+ \xintexpreg[round={#4}]{#5}{#6}%
+ \DefinirFonction[#1,Trace]<#2>{exp(\exprega*x+\expregb)}%
+ }%
+ {}%
+ \IfStrEq{#3}{expalt}%
+ {%
+ \xintexpreg[Alt,round={#4}]{#5}{#6}%
+ \DefinirFonction[#1,Trace]<#2>{\expregb*exp(\exprega*x)}%
+ }%
+ {}%
+ \IfStrEq{#3}{cub}%
+ {%
+ \xintcubreg[round={#4}]{#5}{#6}%
+ \DefinirFonction[#1,Trace]<#2>{\cubrega*x^3+\cubregb*x^2+\cubregc*x+\cubregd}%
+ }%
+ {}%
+ \IfSubStr{#3}{expoff}%
+ {%
+ \StrBehind{#3}{=}[\expoffset]%
+ \xintexpoffreg[round={#4},offset=\expoffset]{#5}{#6}%
+ \DefinirFonction[#1,Trace]<#2>{\expoffset+\expregoffb*exp(\expregoffa*x)}%
+ }%
+ {}%
+}
+\fi
+
+%===IMAGES & ANTÉCÉDENTS
+\defKV[GraphiqueTikzImg]{
+ Couleurs=\def\pflimgcolors{#1},%
+ Nom=\def\pflantecednoms{#1}%
+}
+
+\setKVdefault[GraphiqueTikzImg]{
+ Couleurs=black,%
+ Traits=false,%
+ Spline=false,%
+ Nom={},%
+ Style=o
+}
+
+\NewDocumentCommand\DefinirImage{ O{} m m }{%
+ \useKVdefault[GraphiqueTikzImg]%
+ \setKV[GraphiqueTikzImg]{#1}%
+ \ifboolKV[GraphiqueTikzImg]{Spline}%
+ {%
+ \path[draw=none,pflcourbe,name path=tmpimage] ({#3},{\pflymin})--({#3},{\pflymax}) ;
+ \path[name intersections={of=#2 and tmpimage,name=ZZZZ}] ;
+ \coordinate (\pflantecednoms) at (ZZZZ-1) ;
+ }%
+ {%
+ \xdef\tmpresimg{\xintfloateval{#2(#3)}}%
+ \coordinate (\pflantecednoms) at ({#3},{\tmpresimg}) ;
+ }%
+}
+
+\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}
+}
+
+%====TEXTES
+\defKV[GraphiqueTikzNode]{%
+ Couleur=\def\pflnodecol{#1},%
+ Police=\def\pflnodefonte{#1},%
+ Position=\def\pfnodepos{#1}
+}
+\setKVdefault[GraphiqueTikzNode]{%
+ Couleur=black,%
+ Debut={\normalfont\normalsize},%
+ Position={}
+}
+\NewDocumentCommand\PlacerTexte{ O{} m m }{%
+ \restoreKV[GraphiqueTikzNode]%
+ \setKV[GraphiqueTikzNode]{#1}%
+ \draw #2 node[pflnoeud,font=\pflnodefonte,text=\pflnodecol,\pfnodepos] {#3} ;
+}
+
+%++++++++++++++++++++++++++
+%++++++++++ENGLISH+++++++++
+%++++++++++++++++++++++++++
+
+%====COMMANDE POUR NB DECIMAL ALEA ENTRE BORNES
+\NewDocumentCommand\PickRandomNb{ s O{0} m m O{\mmyrandomnb} }{%
+ \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{RoundNb}%
+ {%
+ \NewDocumentCommand\RoundNb{ O{2} m}{\num{\xintfloateval{round(#2,#1)}}\relax}%
+ }%
+ {%
+ \RenewDocumentCommand\RoundNb{ O{2} m}{\num{\xintfloateval{round(#2,#1)}}\relax}%
+ }%
+
+%====STYLES DE BASE
+\tikzset{tkzgrphnode/.style={}}
+\tikzset{tkzgrphpoint/.style={line width=0.95pt}}
+\tikzset{tkzgrphpointc/.style={radius=1.75pt}}
+\tikzset{tkzgrphscatter/.style={radius=1.75pt}}
+\tikzset{tkzgrphframe/.style={line width=0.8pt,gray}}
+\tikzset{tkzgrphcurve/.style={line width=1.05pt}}
+\tikzset{tkzgrphline/.style={line width=0.8pt}}
+\tikzset{tkzgrpharrowl/.style={<-,>=latex}}
+\tikzset{tkzgrpharrowr/.style={->,>=latex}}
+\tikzset{tkzgrpharrowlr/.style={<->,>=latex}}
+\tikzset{tkzgrphcounterimage/.style={line width=0.9pt,densely dashed}}
+\tikzset{tkzgrphrange/.style={line width=0.9pt,densely dashed,->,>=latex}}
+\tikzset{tkzgrphgridp/.style={thin,lightgray}}
+\tikzset{tkzgrphgrids/.style={very thin,lightgray}}
+\tikzset{tkzgrphaxes/.style={line width=0.8pt,->,>=latex}}
+\tikzset{
+ Xgrid/.store in=\pflgrillex,Xgrid/.default=1,Xgrid=1,
+ Xgrids/.store in=\pflgrillexs,Xgrids/.default=0.5,Xgrids=0.5,
+ Ygrid/.store in=\pflgrilley,Ygrid/.default=1,Ygrid=1,
+ Ygrids/.store in=\pflgrilleys,Ygrids/.default=0.5,Ygrids=0.5
+}
+\tikzset{%
+ pics/tkzgraphcross/.style args={#1/#2}{
+ code={
+ \draw[tkzgrphpoint,rotate=#2] (-#1,0) -- (#1,0);
+ \draw[tkzgrphpoint,rotate=#2] (0,-#1) -- (0, #1);
+ }
+ },
+ pics/tkzgraphcross/.default={2pt/45}
+}
+\tikzset{%
+ pics/tkzgraphsquare/.style args={#1/#2}{
+ code={
+ \filldraw[draw=none,tkzgrphpoint,rotate=#2] (-#1,-#1) rectangle (#1,#1) ;
+ }
+ },
+ pics/tkzgraphsquare/.default={2pt/0}
+}
+
+%===COMMANDE INTERNE POUR FORMATER EN FRACTIONS
+\NewDocumentCommand\FormatFraction{ 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\FormatTrig{ 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\FormatSqrt{ 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}}}%
+ }%
+ }%
+ {%
+ \FormatFraction[#1]{#2}%
+ }%
+ }%
+}
+
+%====COMMANDE INTERNE DE CONVERSION
+\ExplSyntaxOn
+ \NewDocumentCommand\ConvertPtToCm{ m } { \dim_to_decimal_in_unit:nn { #1 } { 1 cm } }
+\ExplSyntaxOff
+
+%====RECUPERER COORDONNEES NOEUD
+\NewDocumentCommand\GetXcoord{ m O{\myxcoord} }{%
+ \path #1;
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef#2{\xintfloateval{(\ConvertPtToCm{\macrox})/(\pflxunit)}}%
+}
+\NewDocumentCommand\GetYcoord{ m O{\myycoord} }{%
+ \path #1;
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef#2{\xintfloateval{(\ConvertPtToCm{\macroy})/(\pflyunit)}}%
+}
+
+\NewDocumentCommand\GetXYcoord{ m O{\myxcoord} O{\myycoord} }{%
+ \GetXcoord{#1}[#2]%
+ \GetYcoord{#1}[#3]%
+}
+
+%===UNITÉS
+\newcommand\DistBetweenNodes[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\TikZUnits{
+ \coordinate (@0) at (0,0) ;
+ \coordinate (@X) at (1,0) ;
+ \coordinate (@Y) at (0,1) ;
+ \DistBetweenNodes[\pflxunit]{@0}{@X}
+ \DistBetweenNodes[\pflyunit]{@0}{@Y}
+}
+
+%====ENVIRONNEMENT
+\defKV[GraphicTikz]{%
+ GradThick=\def\pflthickgrad{#1}
+}
+\setKVdefault[GraphicTikz]{%
+ Frame=false,%
+ GradThick=3pt
+}
+
+\NewDocumentEnvironment{GraphTikz}{ O{} D<>{} }%
+%1 = options tikz, classiques
+%2 = clés spécifiques
+{%
+ \restoreKV[GraphicTikz]%
+ \setKV[GraphicTikz]{#2}%
+ %l'environnement
+ \begin{tikzpicture}[#1]%
+ %unités x/y pour des calculs de coordonnées
+ \TikZUnits
+ %noeuds
+ \coordinate (bbxTop) at (current bounding box.north) ;
+ \coordinate (bbxBottom) at (current bounding box.south) ;
+ \ifboolKV[GraphicTikz]{Frame}{\draw[tkzgrphframe] ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ;}{}%
+ %back to normal
+}%
+{%
+ \end{tikzpicture}%
+}
+
+%====AXES
+\defKV[GraphicTikzAxis]{
+ Format=\def\pflformataxes{#1}
+}
+\setKVdefault[GraphicTikzAxis]{%
+ Grid=true,%
+ Enlarge=0,%
+ Grads=true,%
+ Origin=false,%
+ Font={},%
+ Format=num,%
+ Lines=true,%
+ Last=false,%
+ Behind=false,%
+ Above=false
+}
+
+\NewDocumentCommand\FormatXaxisValues{ m m }{%
+ \IfStrEqCase{#1}{%
+ {num}{\num{#2}}%
+ {year}{#2}%
+ {frac}{\FormatFrac{#2}}%
+ {dfrac}{\FormatFrac[d]{#2}}%
+ {nfrac}{\FormatFrac[n]{#2}}%
+ {trig}{\FormatTrig{#2}}%
+ {dtrig}{\FormatTrig[d]{#2}}%
+ {ntrig}{\FormatTrig[n]{#2}}%
+ {sqrt}{\FormatSqrt{#2}}%
+ {dsqrt}{\FormatSqrt[d]{#2}}%
+ {nsqrt}{\FormatSqrt[n]{#2}}%
+ }[#2]%
+}
+
+\NewDocumentCommand\FormatYaxisValues{ m m }{%
+ \IfStrEqCase{#1}{%
+ {num}{\num{#2}}%
+ {year}{#2}%
+ {frac}{\FormatSqrt{#2}}%
+ {dfrac}{\FormatFrac[d]{#2}}%
+ {nfrac}{\FormatFrac[n]{#2}}%
+ {trig}{\FormatTrig{#2}}%
+ {dtrig}{\FormatTrig[d]{#2}}%
+ {ntrig}{\FormatTrig[n]{#2}}%
+ {sqrt}{\FormatSqrt{#2}}%
+ {dsqrt}{\FormatSqrt[d]{#2}}%
+ {nsqrt}{\FormatSqrt[n]{#2}}%
+ }[#2]%
+}
+
+\NewDocumentCommand\DrawAxisGrids{ s O{} m D<>{#3} m D<>{#5} }{%
+ \restoreKV[GraphicTikzAxis]%
+ \setKV[GraphicTikzAxis]{#2}%
+ %cas particuliers sous/sur impression
+ \ifboolKV[GraphicTikzAxis]{Behind}%
+ {%
+ \setKV[GraphicTikzAxis]{Grads=false}
+ }%
+ {}%
+ \ifboolKV[GraphicTikzAxis]{Above}%
+ {%
+ \setKV[GraphicTikzAxis]{Grid=false}
+ }%
+ {}%
+ %suite
+ \IfSubStr{\pflformataxes}{/}%
+ {%
+ \StrCut{\pflformataxes}{/}{\pflformataxex}{\pflformataxey}%
+ }%
+ {%
+ \xdef\pflformataxex{\pflformataxes}\xdef\pflformataxey{\pflformataxes}%
+ }%
+ \ifboolKV[GraphicTikzAxis]{Grid}%
+ {%
+ \draw[tkzgrphgrids,xstep=\pflgrillexs,ystep=\pflgrilleys] ({\pflxmin},{\pflymin}) grid ({\pflxmax},{\pflymax});
+ \draw[tkzgrphgridp,xstep=\pflgrillex,ystep=\pflgrilley] ({\pflxmin},{\pflymin}) grid ({\pflxmax},{\pflymax});
+ \ifboolKV[GraphicTikzAxis]{Last}%
+ {%
+ \draw[tkzgrphgridp] ({\pflxmin},{\pflymax})--({\pflxmax},{\pflymax}) ;
+ \draw[tkzgrphgridp] ({\pflxmax},{\pflymin})--({\pflxmax},{\pflymax}) ;
+ }%
+ {}%
+ }%
+ {}%
+ \draw[tkzgrphaxes] ({\pflxmin},{\pflOy}) -- ([xshift={\useKV[GraphicTikzAxis]{Enlarge}}]{\pflxmax},{\pflOy}) ;
+ \draw[tkzgrphaxes] ({\pflOx},{\pflymin}) -- ([yshift={\useKV[GraphicTikzAxis]{Enlarge}}]{\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[tkzgrphline] ([yshift=\pflthickgrad]{\x},{\pflOy})--++(0,{-2*\pflthickgrad}) ;}
+ \foreach \y in \tmprangeyvalues {\draw[tkzgrphline] ([xshift=\pflthickgrad]{\pflOx},{\y})--++({-2*\pflthickgrad},0) ;}
+ \ifboolKV[GraphicTikzAxis]{Grads}%
+ {%
+ %origine
+ \ifboolKV[GraphicTikzAxis]{Origin}%
+ {%
+ \draw ({\pflOx},{\pflOy}) node[tkzgrphnode,below left,font={\useKV[GraphicTikzAxis]{Font}}] {\FormatXaxisValues{\pflformataxex}{\pflOx}} ;
+ %\draw (\pflOx,\pflOy) node[below left,font={\useKV[GraphicTikzAxis]{Font}}] {\ifboolKV[GraphicTikzAxis]{Num}{\num{\pflOx}}{\pflOx}} ;
+ }%
+ {}%
+ %graduations x, sauf si auto...
+ \foreach \x in \tmprangexvalues {%
+ \IfBooleanTF{#1}%
+ {%
+ \xintifboolexpr{\x == \pflOx}{}{\draw ([yshift=-\pflthickgrad]{\x},{\pflOy}) node[tkzgrphnode,below,font={\useKV[GraphicTikzAxis]{Font}}] {\FormatXaxisValues{\pflformataxex}{\x}} ;}
+ %\xintifboolexpr{\x == \pflOx}{}{\draw ([yshift=-\pflthickgrad]\x,\pflOy) node[below,font={\useKV[GraphicTikzAxis]{Font}}] {\ifboolKV[GraphicTikzAxis]{Num}{\num{\x}}{\x}} ;}
+ }%
+ {%
+ \draw ([yshift=-\pflthickgrad]{\x},{\pflOy}) node[tkzgrphnode,below,font={\useKV[GraphicTikzAxis]{Font}}] {\FormatXaxisValues{\pflformataxex}{\x}} ;
+ %\draw ([yshift=-\pflthickgrad]\x,\pflOy) node[below,font={\useKV[GraphicTikzAxis]{Font}}] {\ifboolKV[GraphicTikzAxis]{Num}{\num{\x}}{\x}} ;
+ }%
+ }%
+ \foreach \y in \tmprangeyvalues {%
+ \IfBooleanTF{#1}%
+ {%
+ \xintifboolexpr{\y == \pflOy}{}{\draw ([xshift=-\pflthickgrad]{\pflOx},{\y}) node[tkzgrphnode,left,font={\useKV[GraphicTikzAxis]{Font}}] {\FormatYaxisValues{\pflformataxey}{\y}} ;}
+ %\xintifboolexpr{\y == \pflOy}{}{\draw ([xshift=-\pflthickgrad]\pflOx,\y) node[left,font={\useKV[GraphicTikzAxis]{Font}}] {\ifboolKV[GraphicTikzAxis]{Num}{\num{\y}}{\y}} ;}
+ }%
+ {%
+ \draw ([xshift=-\pflthickgrad]{\pflOx},{\y}) node[tkzgrphnode,left,font={\useKV[GraphicTikzAxis]{Font}}] {\FormatYaxisValues{\pflformataxey}{\y}} ;
+ %\draw ([xshift=-\pflthickgrad]\pflOx,\y) node[left,font={\useKV[GraphicTikzAxis]{Font}}] {\ifboolKV[GraphicTikzAxis]{Num}{\num{\y}}{\y}} ;
+ }%
+ }%
+ }%
+ {}%
+}
+
+%===DEFINIR POINTS
+\setKVdefault[GraphicTikzDefPoints]{Color=black,Mark=false,Style=o}
+
+\NewDocumentCommand\DefinePts{ O{} m }{%
+ \restoreKV[GraphicTikzDefPoints]%
+ \setKV[GraphicTikzDefPoints]{#1}%
+ \foreach \tmpnamept/\tmpxpt/\tmpypt in {#2}{%
+ \coordinate (\tmpnamept) at ({\tmpxpt},{\tmpypt}) ;
+ \ifboolKV[GraphicTikzDefPoints]{Mark}%
+ {%
+ \MarkPts*[Style={\useKV[GraphicTikzDefPoints]{Style}},Color={\useKV[GraphicTikzDefPoints]{Color}}]{(\tmpnamept)}
+ %\filldraw[{\useKV[GraphicTikzDefPoints]{Color}}] (\tmpnamept) circle[tkzgrphpointc] ;
+ }%
+ {}%
+ }
+}
+
+\defKV[GraphicTikzMarkPoints]{%
+ Color=\def\pflcouleurpoints{#1},%
+ Style=\def\pflstylepoints{#1}
+}
+\setKVdefault[GraphicTikzMarkPoints]{%
+ Color=black,%
+ Sizec=2pt,%
+ Sizex=2pt,%
+ Sizeo=1.75pt,%
+ Style=o,%
+ Lines=false
+}
+\NewDocumentCommand\MarkPts{ s O{} D<>{\normalfont\normalsize} m }{%
+ %étoilée = sans label
+ %2=clés
+ %3=points
+ \restoreKV[GraphicTikzMarkPoints]%
+ \setKV[GraphicTikzMarkPoints]{#2}%
+ \IfBooleanTF{#1}%
+ {%
+ \IfStrEq{\pflstylepoints}{x}%
+ {%
+ \foreach \Point in {#4} {%
+ \ifboolKV[GraphicTikzMarkPoints]{Lines}%
+ {%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}},tkzgrphcounterimage] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}}] \Point pic{tkzgraphcross={\useKV[GraphicTikzMarkPoints]{Sizex}}/45} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{+}%
+ {%
+ \foreach \Point in {#4} {%
+ \ifboolKV[GraphicTikzMarkPoints]{Lines}%
+ {%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}},tkzgrphcounterimage] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}}] \Point pic{tkzgraphcross={\useKV[GraphicTikzMarkPoints]{Sizex}}/90} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{c}%
+ {%
+ \foreach \Point in {#4} {%
+ \ifboolKV[GraphicTikzMarkPoints]{Lines}%
+ {%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}},tkzgrphcounterimage] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \filldraw[draw=none,fill={\useKV[GraphicTikzMarkPoints]{Color}}] \Point pic{tkzgraphsquare={\useKV[GraphicTikzMarkPoints]{Sizec}}/0} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{d}%
+ {%
+ \foreach \Point in {#4} {%
+ \ifboolKV[GraphicTikzMarkPoints]{Lines}%
+ {%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}},tkzgrphcounterimage] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \filldraw[draw=none,fill={\useKV[GraphicTikzMarkPoints]{Color}}] \Point pic{tkzgraphsquare={\useKV[GraphicTikzMarkPoints]{Sizeo}}/45} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{o}%
+ {%
+ \IfSubStr{\pflcouleurpoints}{/}%
+ {%
+ \StrCut{\pflcouleurpoints}{/}{\pflcouleurpointsA}{\pflcouleurpointsB}%
+ \foreach \Point in {#4} {%
+ \ifboolKV[GraphicTikzMarkPoints]{Lines}%
+ {%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}},tkzgrphcounterimage] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \filldraw[tkzgrphline,fill=\pflcouleurpointsB,draw=\pflcouleurpointsA] \Point circle[radius={\useKV[GraphicTikzMarkPoints]{Sizeo}}] ;
+ }%
+ }%
+ {%
+ \foreach \Point in {#4} {%
+ \ifboolKV[GraphicTikzMarkPoints]{Lines}%
+ {%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}},tkzgrphcounterimage] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \filldraw[\pflcouleurpoints] \Point circle[radius={\useKV[GraphicTikzMarkPoints]{Sizeo}}] ;
+ }%
+ }%
+ }%
+ {}%
+ }%
+ {%avec label
+ \IfStrEq{\pflstylepoints}{x}%
+ {%
+ \foreach \Point/\Pos/\Label in {#4} {%
+ \ifboolKV[GraphicTikzMarkPoints]{Lines}%
+ {%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}},tkzgrphcounterimage] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}}] \Point pic{tkzgraphcross={\useKV[GraphicTikzMarkPoints]{Sizex}}/45} node[tkzgrphnode,\Pos,font=#3] {\Label} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{+}%
+ {%
+ \foreach \Point/\Pos/\Label in {#4} {%
+ \ifboolKV[GraphicTikzMarkPoints]{Lines}%
+ {%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}},tkzgrphcounterimage] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}}] \Point pic{tkzgraphcross={\useKV[GraphicTikzMarkPoints]{Sizex}}/90} node[tkzgrphnode,\Pos,font=#3] {\Label} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{c}%
+ {%
+ \foreach \Point/\Pos/\Label in {#4} {%
+ \ifboolKV[GraphicTikzMarkPoints]{Lines}%
+ {%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}},tkzgrphcounterimage] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \filldraw[draw=none,fill={\useKV[GraphicTikzMarkPoints]{Color}}] \Point pic{tkzgraphsquare={\useKV[GraphicTikzMarkPoints]{Sizec}}/0} node[tkzgrphnode,\Pos,{\useKV[GraphicTikzMarkPoints]{Color}},font=#3] {\Label} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{d}%
+ {%
+ \foreach \Point/\Pos/\Label in {#4} {%
+ \ifboolKV[GraphicTikzMarkPoints]{Lines}%
+ {%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}},tkzgrphcounterimage] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \filldraw[draw=none,fill={\useKV[GraphicTikzMarkPoints]{Color}}] \Point pic{tkzgraphsquare={\useKV[GraphicTikzMarkPoints]{Sizeo}}/45} node[tkzgrphnode,\Pos,{\useKV[GraphicTikzMarkPoints]{Color}},font=#3] {\Label} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{o}%
+ {%
+ \IfSubStr{\pflcouleurpoints}{/}%
+ {%
+ \StrCut{\pflcouleurpoints}{/}{\pflcouleurpointsA}{\pflcouleurpointsB}%
+ \foreach \Point/\Pos/\Label in {#4} {%
+ \ifboolKV[GraphicTikzMarkPoints]{Lines}%
+ {%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}},tkzgrphcounterimage] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \draw[tkzgrphline,\pflcouleurpointsA,fill=\pflcouleurpointsB] \Point circle[radius={\useKV[GraphicTikzMarkPoints]{Sizeo}}] node[tkzgrphnode,\Pos,font=#3] {\Label} ;
+ }%
+ }%
+ {%
+ \foreach \Point/\Pos/\Label in {#4} {%
+ \ifboolKV[GraphicTikzMarkPoints]{Lines}%
+ {%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}},tkzgrphcounterimage] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \filldraw[\pflcouleurpoints] \Point circle[radius={\useKV[GraphicTikzMarkPoints]{Sizeo}}] node[tkzgrphnode,\Pos,font=#3] {\Label} ;
+ }%
+ }%
+ }%
+ {}%
+ }%
+}
+
+%===AJOUTER DES VALEURS MANUELLEMENT
+\NewDocumentCommand\AddXvalues{ O{} m m }{%
+ \restoreKV[GraphicTikzAxis]%
+ \setKV[GraphicTikzAxis]{#1}%
+ \ifboolKV[GraphicTikzAxis]{Lines}{\foreach \x in {#2}{\draw[tkzgrphline] ([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[tkzgrphnode,below,font={\useKV[GraphicTikzAxis]{Font}}] {\mavalfmtx} ;
+ }%
+}
+
+\NewDocumentCommand\AddYvalues{ O{} m m }{%
+ \restoreKV[GraphicTikzAxis]%
+ \setKV[GraphicTikzAxis]{#1}%
+ \ifboolKV[GraphicTikzAxis]{Lines}{\foreach \y in {#2}{\draw[tkzgrphline] ([xshift=\pflthickgrad]{\pflOx},{\y})--++({-2*\pflthickgrad},0) ;}}{}%
+ \readlist*\LstValY{#2}%
+ \readlist*\LstValFmtY{#3}%
+ \foreach \i in {1,...,\LstValYlen}{%
+ \itemtomacro\LstValY[\i]\mavaly%
+ \itemtomacro\LstValFmtY[\i]\mavalfmty%
+ \draw ([xshift=-\pflthickgrad]{\pflOx},{\mavaly}) node[tkzgrphnode,left,font={\useKV[GraphicTikzAxis]{Font}}] {\mavalfmty} ;
+ }%
+}
+
+%====FONCTIONS ET COURBES 'classique + interpo + spline'
+\defKV[GraphicTikzCourbe]{%
+ Step=\def\pflstepcurve{#1},%
+ Name=\def\pflnamecurve{#1}
+}
+\setKVdefault[GraphicTikzCourbe]{%
+ Color=black,%
+ Start={\pflxmin},%
+ End={\pflxmax},%
+ Step={},%
+ Clip=true,%
+ Name={},%
+ Trace=false,%
+ Tension=0.5
+}
+
+\NewDocumentCommand\DefineFunction{ O{} D<>{f} m }{%old version
+ \restoreKV[GraphicTikzCourbe]%
+ \setKV[GraphicTikzCourbe]{#1}%
+ \xintdeffloatfunc #2(x) := #3 ;
+ \IfStrEq{\pflstepcurve}{}%
+ {%
+ \xdef\pflstepcurve{\xintfloateval{((\useKV[GraphicTikzCourbe]{End})-(\useKV[GraphicTikzCourbe]{Start}))/100}}%
+ }%
+ {}%
+ \ifboolKV[GraphicTikzCourbe]{Clip}{\begin{scope}\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});}{}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \ifboolKV[GraphicTikzCourbe]{Trace}%
+ {%
+ \path[draw,tkzgrphcurve,{\useKV[GraphicTikzCourbe]{Color}},name path global=\pflnamecurve] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphicTikzCourbe]{Start}}..[\pflstepcurve]..{\useKV[GraphicTikzCourbe]{End}},{\useKV[GraphicTikzCourbe]{End}})
+ \relax
+ };
+ }%
+ {%
+ \path[draw=none,tkzgrphcurve,{\useKV[GraphicTikzCourbe]{Color}},name path global=\pflnamecurve] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphicTikzCourbe]{Start}}..[\pflstepcurve]..{\useKV[GraphicTikzCourbe]{End}},{\useKV[GraphicTikzCourbe]{End}})
+ \relax
+ };
+ }%
+ \ifboolKV[GraphicTikzCourbe]{Clip}{\end{scope}}{}
+}
+
+\NewDocumentCommand\DefineCurve{ O{} D<>{f} m }{%
+ \restoreKV[GraphicTikzCourbe]%
+ \setKV[GraphicTikzCourbe]{#1}%
+ \xintdeffloatfunc #2(x) := #3 ;
+ \IfStrEq{\pflstepcurve}{}%
+ {%
+ \xdef\pflstepcurve{\xintfloateval{((\useKV[GraphicTikzCourbe]{End})-(\useKV[GraphicTikzCourbe]{Start}))/100}}%
+ }%
+ {}%
+ \ifboolKV[GraphicTikzCourbe]{Clip}{\begin{scope}\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});}{}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \ifboolKV[GraphicTikzCourbe]{Trace}%
+ {%
+ \path[draw,tkzgrphcurve,{\useKV[GraphicTikzCourbe]{Color}},name path global=\pflnamecurve] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphicTikzCourbe]{Start}}..[\pflstepcurve]..{\useKV[GraphicTikzCourbe]{End}},{\useKV[GraphicTikzCourbe]{End}})
+ \relax
+ };
+ }%
+ {%
+ \path[draw=none,tkzgrphcurve,{\useKV[GraphicTikzCourbe]{Color}},name path global=\pflnamecurve] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphicTikzCourbe]{Start}}..[\pflstepcurve]..{\useKV[GraphicTikzCourbe]{End}},{\useKV[GraphicTikzCourbe]{End}})
+ \relax
+ };
+ }%
+ \ifboolKV[GraphicTikzCourbe]{Clip}{\end{scope}}{}
+}
+
+\NewDocumentCommand\DrawCurve{ O{} D<>{} m }{%
+ \restoreKV[GraphicTikzCourbe]%
+ \setKV[GraphicTikzCourbe]{#1}%
+ \IfStrEq{\pflstepcurve}{}%
+ {%
+ \xdef\pflstepcurve{\xintfloateval{((\useKV[GraphicTikzCourbe]{End})-(\useKV[GraphicTikzCourbe]{Start}))/100}}%
+ }%
+ {}%
+ \ifboolKV[GraphicTikzCourbe]{Clip}{\begin{scope}\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});}{}
+ \IfEq{\pflnamecurve}{}%
+ {%
+ \draw[tkzgrphcurve,{\useKV[GraphicTikzCourbe]{Color}}] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#3),x={\useKV[GraphicTikzCourbe]{Start}}..[\pflstepcurve]..{\useKV[GraphicTikzCourbe]{End}},{\useKV[GraphicTikzCourbe]{End}})
+ \relax
+ };
+ }%
+ {%
+ \path[draw,tkzgrphcurve,{\useKV[GraphicTikzCourbe]{Color}},name path global=\pflnamecurve] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#3),x={\useKV[GraphicTikzCourbe]{Start}}..[\pflstepcurve]..{\useKV[GraphicTikzCourbe]{End}},{\useKV[GraphicTikzCourbe]{End}})
+ \relax
+ };
+ }%
+ \ifboolKV[GraphicTikzCourbe]{Clip}{\end{scope}}{}
+}
+
+\NewDocumentCommand\DefineLstInterpol{ m O{\myinterpolist} }{%
+ \def#2{#1}%
+}
+
+\NewDocumentCommand\DefineInterpoCurve{ O{} m }{%
+ \restoreKV[GraphicTikzCourbe]%
+ \setKV[GraphicTikzCourbe]{#1}%
+ \begin{scope}
+ \ifboolKV[GraphicTikzCourbe]{Trace}%
+ {%
+ \path[draw,tkzgrphcurve,{\useKV[GraphicTikzCourbe]{Color}},name path global=\pflnamecurve] plot[smooth,tension={\useKV[GraphicTikzCourbe]{Tension}}] coordinates {#2};
+ }%
+ {%
+ \path[draw=none,tkzgrphcurve,{\useKV[GraphicTikzCourbe]{Color}},name path global=\pflnamecurve] plot[smooth,tension={\useKV[GraphicTikzCourbe]{Tension}}] coordinates {#2};
+ }%
+ \end{scope}
+}
+
+\NewDocumentCommand\DrawInterpoCurve{ O{} m }{%
+ %2=liste
+ \restoreKV[GraphicTikzCourbe]%
+ \setKV[GraphicTikzCourbe]{#1}%
+ \begin{scope}
+ \draw[tkzgrphcurve,{\useKV[GraphicTikzCourbe]{Color}}] plot [smooth,tension={\useKV[GraphicTikzCourbe]{Tension}}] coordinates {#2} ;
+ \end{scope}
+}
+
+\NewDocumentCommand\DefineLstSpline{ m O{\mysplinelst} }{%
+ \def#2{#1}%
+}
+
+\newcommand\tkzextractcoeff[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[GraphicTikzSpline]{%
+ Name=\def\pflsplinename{#1},%
+ Coeffs=\def\pflsplinecoeffs{#1}
+}
+
+\setKVdefault[GraphicTikzSpline]{%
+ Name=spline,%
+ Color=black,%
+ Coeffs=3,%
+ Trace=false
+}
+
+\NewDocumentCommand\GenerateSpline{ m m O{\myspline} }{%
+ %1=liste
+ \setsepchar[.]{§./}%
+ \readlist*\SPLlistepoints{#1}%
+ %les données
+ \def\tmpsplinenumdeb{1}
+ \def\tmpsplinenumfin{\SPLlistepointslen}%
+ \tkzextractcoeff{#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
+ \tkzextractcoeff{#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\DefineSplineCurve{ O{} m D<>{\myspline} }{%
+ %1=liste
+ \restoreKV[GraphicTikzSpline]%
+ \setKV[GraphicTikzSpline]{#1}%
+ \GenerateSpline{#2}{\pflsplinecoeffs}[#3]%
+ \begin{scope}
+ \ifboolKV[GraphicTikzSpline]{Trace}%
+ {%
+ \path[draw,tkzgrphcurve,{\useKV[GraphicTikzSpline]{Color}},name path global=\pflsplinename] #3 ;
+ }%
+ {%
+ \path[draw=none,tkzgrphcurve,name path global=\pflsplinename] #3 ;
+ }%
+ \end{scope}
+}
+
+\NewDocumentCommand\DefineSpline{ O{} m D<>{\myspline} }{%old version
+ %1=liste
+ \restoreKV[GraphicTikzSpline]%
+ \setKV[GraphicTikzSpline]{#1}%
+ \GenerateSpline{#2}{\pflsplinecoeffs}[#3]%
+ \begin{scope}
+ \ifboolKV[GraphicTikzSpline]{Trace}%
+ {%
+ \path[draw,tkzgrphcurve,{\useKV[GraphicTikzSpline]{Color}},name path global=\pflsplinename] #3 ;
+ }%
+ {%
+ \path[draw=none,tkzgrphcurve,name path global=\pflsplinename] #3 ;
+ }%
+ \end{scope}
+}
+
+\NewDocumentCommand\DrawSplineCurve{ O{} m D<>{\myspline} }{%
+ %1=liste
+ \restoreKV[GraphicTikzSpline]%
+ \setKV[GraphicTikzSpline]{#1}%
+ \GenerateSpline{#2}{\pflsplinecoeffs}[#3]%
+ \begin{scope}
+ \draw[tkzgrphcurve,{\useKV[GraphicTikzSpline]{Color}}] #3 ;
+ \end{scope}
+}
+
+\NewDocumentCommand\DrawSpline{ O{} m D<>{\myspline} }{%old version
+ %1=liste
+ \restoreKV[GraphicTikzSpline]%
+ \setKV[GraphicTikzSpline]{#1}%
+ \GenerateSpline{#2}{\pflsplinecoeffs}[#3]%
+ \begin{scope}
+ \draw[tkzgrphcurve,{\useKV[GraphicTikzSpline]{Color}}] #3 ;
+ \end{scope}
+}
+
+%===INTERSECTION & ANTÉCÉDENTS
+\defKV[GraphicTikzIntersect]{%
+ Name=\def\pflintercurves{#1}
+}
+\setKVdefault[GraphicTikzIntersect]{%
+ Name=S,
+ Disp=true,
+ Color=black,
+ DispLine=false,%
+ Lines=false,%
+ Style=o
+}
+
+\NewDocumentCommand\FindIntersections{ O{} m m D<>{\myt} }{%
+ \restoreKV[GraphicTikzIntersect]%
+ \setKV[GraphicTikzIntersect]{#1}%
+ \path[name intersections={of=#2 and #3,name=\pflintercurves,total=\t}] \pgfextra{\xdef#4{\t}};
+ \ifboolKV[GraphicTikzIntersect]{Disp}%
+ {%
+ \xintifboolexpr{#4 == 0}{}%
+ {%
+ \foreach \i in {1,...,#4}{%
+ \ifboolKV[GraphicTikzIntersect]{Lines}%
+ {%
+ \draw[tkzgrphrange,{\useKV[GraphicTikzIntersect]{Color}}]let \p1 = (\pflintercurves-\i) in (\pflintercurves-\i) -- ({\x1},{\pflOy}) ;
+ }%
+ {}%
+ \MarkPts*[Style={\useKV[GraphicTikzIntersect]{Style}},Color={\useKV[GraphicTikzIntersect]{Color}}]{(\pflintercurves-\i)}
+ %\filldraw[{\useKV[GraphicTikzIntersect]{Color}}] (\pflintercurves-\i) circle[tkzgrphpointc] ;
+ }
+ }%
+ }%
+ {}%
+}
+
+\NewDocumentCommand\FindCounterimage{ O{} m m D<>{\myantec} }{%
+ \restoreKV[GraphicTikzIntersect]%
+ \setKV[GraphicTikzIntersect]{#1}%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \ifboolKV[GraphicTikzIntersect]{DispLine}%
+ {%
+ \path[draw,{\useKV[GraphicTikzIntersect]{Color}},tkzgrphcurve,name path=tmpanteced] ({\pflxmin},{#3})--({\pflxmax},{#3}) ;
+ }%
+ {%
+ \path[draw=none,tkzgrphcurve,name path=tmpanteced] ({\pflxmin},{#3})--({\pflxmax},{#3}) ;
+ }%
+ \path[name intersections={of=#2 and tmpanteced,name=\pflintercurves,total=\t}] \pgfextra{\xdef#4{\t}};
+ \ifboolKV[GraphicTikzIntersect]{Disp}%
+ {%
+ \xintifboolexpr{#4 == 0}{}%
+ {%
+ \foreach \i in {1,...,#4}{%
+ \MarkPts*[Style={\useKV[GraphicTikzIntersect]{Style}},Color={\useKV[GraphicTikzIntersect]{Color}}]{(\pflintercurves-\i)}
+ %\filldraw[{\useKV[GraphicTikzIntersect]{Color}}] (\pflintercurves-\i) circle[tkzgrphpointc] ;
+ }
+ }%
+ }%
+ {}%
+ \end{scope}
+}
+
+%====INTÉGRALES
+%v2 avec modification de la clé [Type=...] ?
+\defKV[GraphicTikzIntegr]{%
+ Colors=\def\pfldomtikzcolors{#1},%
+ Style=\def\pfldomtikzstyle{#1},%
+ Opacity=\def\pfldomtikzopac{#1},%
+ Hatch=\def\pfldomtikzhatch{#1},%
+ Type=\def\pfldomtikztype{#1},%
+ Step=\def\pflstepcurve{#1},%
+ Bounds=\def\pflintbornes{#1},%
+ Junction=\def\pfldomtikzjoin{#1},%
+ NameInterpo=\def\pfldomtikznameinterpo{#1},%
+ NameInterpoB=\def\pfldomtikznameinterpob{#1},%
+ NameSpline=\def\pfldomtikznamespline{#1},%
+ NameSplineB=\def\pfldomtikznamesplineb{#1}
+}
+\setKVdefault[GraphicTikzIntegr]{%
+ Colors=gray,%
+ Style=fill,%
+ Opacity=0.5,%
+ Hatch={north west lines},%
+ Type=fct,%
+ Step={},%
+ Junction=bevel,%
+ Bounds=abs,%
+ Border=true,%
+ Spline=false,%
+ SplineB=false,%
+ NameInterpo={\myinterpo},%
+ NameInterpoB={\myinterpoB},%
+ NameSpline={\myspline},%
+ NameSplineB={\myplineB},%
+ Tension=0.5,%
+ TensionB=0.5
+}
+
+\NewDocumentCommand\DrawIntegral{ 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[GraphicTikzIntegr]% revenir au valeurs par défaut
+ \setKV[GraphicTikzIntegr]{#1}% lit les arguments optionnels
+ %les couleurs
+ \IfSubStr{\pfldomtikzcolors}{/}%
+ {%
+ \StrCut{\pfldomtikzcolors}{/}{\pfldomtikzcolorbord}{\pfldomtikzcolorfond}
+ }%
+ {%
+ \xdef\pfldomtikzcolorbord{\pfldomtikzcolors}\xdef\pfldomtikzcolorfond{\pfldomtikzcolors}
+ }%
+ \ifboolKV[GraphicTikzIntegr]{Border}%
+ {%
+ \tikzset{integralebordtikzstyle/.style={draw=\pfldomtikzcolorbord}}
+ }%
+ {%
+ \tikzset{integralebordtikzstyle/.style={draw=none}}
+ }%
+ \IfStrEq{\pfldomtikzstyle}{hatch}%
+ {%
+ \tikzset{integraletikzstyle/.style={tkzgrphline,pattern=\pfldomtikzhatch,pattern color=\pfldomtikzcolorfond,line join=\pfldomtikzjoin}}
+ }%
+ {}%
+ \IfStrEq{\pfldomtikzstyle}{fill}%
+ {%
+ \tikzset{integraletikzstyle/.style={tkzgrphline,fill=\pfldomtikzcolorfond,fill opacity=\pfldomtikzopac,line join=\pfldomtikzjoin}}
+ }%
+ {}%
+ %extraction des infos x/y
+ \IfStrEqCase{\pflintbornes}{%
+ {abs}%
+ {%
+ \xdef\absnoeudA{#5}%
+ \xdef\absnoeudB{#6}%
+ }%
+ {nodes}%
+ {%
+ \path #5;
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\absnoeudA{\xintfloateval{(\ConvertPtToCm{\macrox})/(\pflxunit)}}%
+ \path #6;
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\absnoeudB{\xintfloateval{(\ConvertPtToCm{\macrox})/(\pflxunit)}}%
+ }%
+ {abs/node}%
+ {%
+ \xdef\absnoeudA{#5}%
+ \path #6;
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\absnoeudB{\xintfloateval{(\ConvertPtToCm{\macrox})/(\pflxunit)}}%
+ }%
+ {node/abs}%
+ {%
+ \path #5;
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\absnoeudA{\xintfloateval{(\ConvertPtToCm{\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,tkzgrphcurve,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;
+ \path[name intersections={of=#3 and tmpintbornea,name=YYY}] ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] ({\absnoeudA},{\pflOy})-- (YYY-1) ;
+ \path[draw=none,tkzgrphcurve,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;
+ \path[name intersections={of=#3 and tmpintborneb,name=ZZZ}] ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] ({\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[GraphicTikzIntegr]{Tension}}] coordinates {#3} -- ({\absnoeudB},{\pflOy}) -- cycle ;
+ \end{scope}
+ \path[draw=none,tkzgrphcurve,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;
+ \path[name intersections={of=tmpintbornea and \pfldomtikznameinterpo,name=YYY}] ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] ({\absnoeudA},{\pflOy})-- (YYY-1) ;
+ \path[draw=none,tkzgrphcurve,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;
+ \path[name intersections={of=tmpintborneb and \pfldomtikznameinterpo,name=ZZZ}] ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] ({\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,tkzgrphcurve,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,tkzgrphcurve,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,tkzgrphline] (YYYA-1)-- (ZZZA-1) ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] (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[GraphicTikzIntegr]{Tension}}] coordinates {#3} -- ({\absnoeudB},{\pflymin}) ;
+ \clip ({\absnoeudA},{\pflymax}) -- plot [smooth,tension={\useKV[GraphicTikzIntegr]{TensionB}}] coordinates {#4} -- ({\absnoeudB},{\pflymax}) ;
+ \filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \end{scope}
+ \path[draw=none,tkzgrphcurve,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,tkzgrphcurve,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,tkzgrphline] (YYYA-1)-- (ZZZA-1) ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] (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,tkzgrphcurve,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;
+ \path[name intersections={of=tmpintbornea and #4,name=ZZZA}] ;
+ \path[draw=none,tkzgrphcurve,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;
+ \path[name intersections={of=tmpintborneb and #4,name=ZZZB}] ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] ({\absnoeudA},{\xintfloateval{subs(#3,x=\absnoeudA)}})-- (ZZZA-1) ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] ({\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,tkzgrphcurve,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;
+ \path[name intersections={of=tmpintbornea and #3,name=ZZZA}] ;
+ \path[draw=none,tkzgrphcurve,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;
+ \path[name intersections={of=tmpintborneb and #3,name=ZZZB}] ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] ({\absnoeudA},{\xintfloateval{subs(#4,x=\absnoeudA)}})-- (ZZZA-1) ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] ({\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[GraphicTikzIntegr]{TensionB}}] coordinates {#4} -- ({\absnoeudB},{\pflymax}) ;
+ \filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \end{scope}
+ \path[draw=none,tkzgrphcurve,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;
+ \path[draw=none,tkzgrphcurve,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,tkzgrphline] ({\absnoeudA},{\xintfloateval{subs(#3,x=\absnoeudA)}})-- (ZZZAA-1) ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] ({\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[GraphicTikzIntegr]{Tension}}] coordinates {#3} -- ({\absnoeudB},{\pflymin}) ;
+ \filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \end{scope}
+ \path[draw=none,tkzgrphcurve,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;
+ \path[draw=none,tkzgrphcurve,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,tkzgrphline] ({\absnoeudA},{\xintfloateval{subs(#4,x=\absnoeudA)}})-- (ZZZAA-1) ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] ({\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[GraphicTikzIntegr]{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,tkzgrphcurve,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;%borne inf
+ \path[draw=none,tkzgrphcurve,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,tkzgrphline] (YYYKAA-1)-- (ZZZKAA-1) ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] (YYYKBB-1)-- (ZZZKBB-1) ;
+ }%
+ {}%
+ \IfStrEq{\pfldomtikztype}{spl/itp}%
+ {%
+ \begin{scope}
+ \clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \clip ({\absnoeudA},{\pflymax}) -- plot [smooth,tension={\useKV[GraphicTikzIntegr]{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,tkzgrphcurve,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;%borne inf
+ \path[draw=none,tkzgrphcurve,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,tkzgrphline] (YYYKAA-1)-- (ZZZKAA-1) ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] (YYYKBB-1)-- (ZZZKBB-1) ;
+ }%
+ {}%
+}
+
+\NewDocumentCommand\DrawPts{ s O{black} D<>{\normalfont\normalsize} m }{%
+ \IfBooleanTF{#1}%
+ {%
+ \foreach \Point in {#4}{%
+ \filldraw[#2] \Point circle[tkzgrphpointc] ;
+ }
+ }%
+ {%
+ \foreach \Point/\Pos/\Label in {#4}{%
+ \filldraw[#2] \Point circle[tkzgrphpointc] node[tkzgrphnode,\Pos,font=#3] {\Label} ;
+ }
+ }%
+}
+
+% %====STATS À 2 VARIABLES
+\defKV[GraphicTikzRegLin]{%
+ Rounds=\def\pflarrondisreglin{#1},
+ Name=\def\pflnamereglin{#1},
+ NameParab=\def\pflnameregquad{#1},
+ Start=\def\pflreglinmin{#1},
+ End=\def\pflreglinmax{#1}
+}
+\setKVdefault[GraphicTikzRegLin]{
+ ColorScatter=black,
+ ColorLine=black,
+ ColorParab=black,
+ Rounds={},
+ Start={\pflxmin},
+ End={\pflxmax},
+ Name=reglin,%
+ NameParab=quadreg,%
+ DrawLine=false,%
+ DrawParab=false,%
+ Style=o
+}
+
+\NewDocumentCommand\DrawScatter{ O{} D<>{d} m m }{%
+ \useKVdefault[GraphicTikzRegLin]%
+ \setKV[GraphicTikzRegLin]{#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%
+ \MarkPts*[Style={\useKV[GraphicTikzRegLin]{Style}},Color={\useKV[GraphicTikzRegLin]{ColorScatter}}]{(\tmpmavalx,\tmpmavaly)}%
+ }
+ %droite de régression
+ \ifboolKV[GraphicTikzRegLin]{DrawLine}%
+ {%
+ %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[tkzgrphcurve,{\useKV[GraphicTikzRegLin]{ColorLine}},name path global=\pflnamereglin,samples=2,domain=\pflreglinmin:\pflreglinmax] plot (\x,{\tmpcoeffreglina*\x+\tmpcoeffreglinb}) ;
+ \end{scope}
+ }%
+ {}%
+ \ifboolKV[GraphicTikzRegLin]{DrawParab}%
+ {%
+ %somme importantes
+ \xdef\LXSomme{0}%
+ \xdef\LXCSomme{0}%
+ \xdef\LYSomme{0}%
+ \xdef\LXXSomme{0}%
+ \xdef\LXYSomme{0}%
+ \xdef\LXXCSomme{0}%
+ \xdef\LXCXCSomme{0}%
+ \xdef\LXCYSomme{0}%
+ %calculs
+ \foreach \i in {1,2,...,\LNB}{%
+ \xdef\LXSomme{\xintfloateval{\LXSomme+\LX[\i]}}%
+ \xdef\LXCSomme{\xintfloateval{\LXCSomme+(\LX[\i])^2}}%
+ }%
+ \foreach \i in {1,2,...,\LNB}{%
+ \xdef\LYSomme{\xintfloateval{\LYSomme+\LY[\i]}}%
+ }%
+ \xdef\LXmoy{\xintfloateval{\LXSomme/\LNB}}%
+ \xdef\LYmoy{\xintfloateval{\LYSomme/\LNB}}%
+ \xdef\LXCmoy{\xintfloateval{\LXCSomme/\LNB}}%
+ %calculs suites
+ \foreach \i in {1,2,...,\LNB}{%
+ \xdef\LXXSomme{\xintfloateval{\LXXSomme+(\LX[\i]-\LXmoy)^2}}%
+ \xdef\LXYSomme{\xintfloateval{\LXYSomme+(\LX[\i]-\LXmoy)*(\LY[\i]-\LYmoy)}}%
+ \xdef\LXXCSomme{\xintfloateval{\LXXCSomme+(\LX[\i]-\LXmoy)*((\LX[\i])*(\LX[\i])-\LXCmoy)}}%
+ \xdef\LXCXCSomme{\xintfloateval{\LXCXCSomme+((\LX[\i])^2-\LXCmoy)^2}}%
+ \xdef\LXCYSomme{\xintfloateval{\LXCYSomme+((\LX[\i])^2-\LXCmoy)*(\LY[\i]-\LYmoy)}}%
+ }%
+ %COEFFS OK
+ \IfStrEq{\pflarrondisreglin}{}%
+ {%
+ \xdef\tmpcoeffregquadb{\xintfloateval{(\LXYSomme*\LXCXCSomme-\LXCYSomme*\LXXCSomme)/(\LXXSomme*\LXCXCSomme-(\LXXCSomme)^2)}}
+ \xdef\tmpcoeffregquada{\xintfloateval{(\LXCYSomme*\LXXSomme-\LXYSomme*\LXXCSomme)/(\LXXSomme*\LXCXCSomme-(\LXXCSomme)^2)}}
+ \xdef\tmpcoeffregquadc{\xintfloateval{\LYmoy-\tmpcoeffregquadb*\LXmoy-\tmpcoeffregquada*\LXCmoy}}
+ }%
+ {%
+ \xdef\tmpcoeffregquadb{\xintfloateval{round((\LXYSomme*\LXCXCSomme-\LXCYSomme*\LXXCSomme)/(\LXXSomme*\LXCXCSomme-(\LXXCSomme)^2),\pflarrondisreglin)}}
+ \xdef\tmpcoeffregquada{\xintfloateval{round((\LXCYSomme*\LXXSomme-\LXYSomme*\LXXCSomme)/(\LXXSomme*\LXCXCSomme-(\LXXCSomme)^2),\pflarrondisreglin)}}
+ \xdef\tmpcoeffregquadc{\xintfloateval{round(\LYmoy-\tmpcoeffregquadb*\LXmoy-\tmpcoeffregquada*\LXCmoy,\pflarrondisreglin)}}
+ }%
+ \xintdeffloatfunc #2(x) := (\tmpcoeffregquada)*x^2+(\tmpcoeffregquadb)*x+\tmpcoeffregquadc ;
+ %tracé
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \draw[tkzgrphcurve,{\useKV[GraphicTikzRegLin]{ColorParab}},name path global=\pflnameregquad,samples=250,domain=\pflreglinmin:\pflreglinmax] plot (\x,{\tmpcoeffregquada*(\x)^2+\tmpcoeffregquadb*\x+\tmpcoeffregquadc}) ;
+ \end{scope}
+ }%
+ {}%
+}
+
+\if@loadxintreg
+%régressions alternatives
+\NewDocumentCommand\DrawRegression{ O{} D<>{curvajust} m D<>{} m m }{%
+ %1=options de tracés
+ %2=nom courbe
+ %3=type
+ %4=arrondis
+ %5=liste X
+ %6=liste Y
+ \IfStrEq{#3}{lin}%
+ {%
+ \xintlinreg[round={#4}]{#5}{#6}%
+ \DefineFunction[#1,Trace]<#2>{\linrega*x+\linregb}%
+ }%
+ {}%
+ \IfStrEq{#3}{quad}%
+ {%
+ \xintquadreg[round={#4}]{#5}{#6}%
+ \DefineFunction[#1,Trace]<#2>{\quadrega*x^2+\quadregb*x+\quadregc}%
+ }%
+ {}%
+ \IfStrEq{#3}{pow}%
+ {%
+ \xintpowreg[round={#4}]{#5}{#6}%
+ \DefineFunction[#1,Trace]<#2>{\powrega*x^(\powregb)}%
+ }%
+ {}%
+ \IfStrEq{#3}{expab}%
+ {%
+ \xintexpabreg[round={#4}]{#5}{#6}%
+ \DefineFunction[#1,Trace]<#2>{\expabrega*(\expabregb)^x}%
+ }%
+ {}%
+ \IfStrEq{#3}{hyp}%
+ {%
+ \xinthypreg[round={#4}]{#5}{#6}%
+ \DefineFunction[#1,Trace]<#2>{\hyprega+(\hypregb)/x}%
+ }%
+ {}%
+ \IfStrEq{#3}{log}%
+ {%
+ \xintlogreg[round={#4}]{#5}{#6}%
+ \DefineFunction[#1,Trace]<#2>{\logrega+(\logregb)*log(x)}%
+ }%
+ {}%
+ \IfStrEq{#3}{exp}%
+ {%
+ \xintexpreg[round={#4}]{#5}{#6}%
+ \DefineFunction[#1,Trace]<#2>{exp(\exprega*x+\expregb)}%
+ }%
+ {}%
+ \IfStrEq{#3}{expalt}%
+ {%
+ \xintexpreg[Alt,round={#4}]{#5}{#6}%
+ \DefineFunction[#1,Trace]<#2>{\expregb*exp(\exprega*x)}%
+ }%
+ {}%
+ \IfStrEq{#3}{cub}%
+ {%
+ \xintcubreg[round={#4}]{#5}{#6}%
+ \DefineFunction[#1,Trace]<#2>{\cubrega*x^3+\cubregb*x^2+\cubregc*x+\cubregd}%
+ }%
+ {}%
+ \IfSubStr{#3}{expoff}%
+ {%
+ \StrBehind{#3}{=}[\expoffset]%
+ \xintexpoffreg[round={#4},offset=\expoffset]{#5}{#6}%
+ \DefineFunction[#1,Trace]<#2>{\expoffset+\expregoffb*exp(\expregoffa*x)}%
+ }%
+ {}%
+}
+\fi
+
+%===IMAGES & ANTÉCÉDENTS
+\defKV[GraphicTikzImg]{
+ Colors=\def\pflimgcolors{#1},%
+ Name=\def\pflantecednoms{#1}%
+}
+
+\setKVdefault[GraphicTikzImg]{
+ Colors=black,%
+ Lines=false,%
+ Spline=false,%
+ Name={},%
+ Style=o
+}
+
+\NewDocumentCommand\DefineRange{ O{} m m }{%
+ \useKVdefault[GraphicTikzImg]%
+ \setKV[GraphicTikzImg]{#1}%
+ \ifboolKV[GraphicTikzImg]{Spline}%
+ {%
+ \path[draw=none,tkzgrphcurve,name path=tmpimage] ({#3},{\pflymin})--({#3},{\pflymax}) ;
+ \path[name intersections={of=#2 and tmpimage,name=ZZZZ}] ;
+ \coordinate (\pflantecednoms) at (ZZZZ-1) ;
+ }%
+ {%
+ \xdef\tmpresimg{\xintfloateval{#2(#3)}}%
+ \coordinate (\pflantecednoms) at ({#3},{\tmpresimg}) ;
+ }%
+}
+
+\NewDocumentCommand\DrawRanges{ O{} m m }{%
+ \useKVdefault[GraphicTikzImg]%
+ \setKV[GraphicTikzImg]{#1}%
+ \IfSubStr{\pflimgcolors}{/}%
+ {%
+ \StrCut{\pflimgcolors}{/}{\pflimgcolorpt}{\pflimgcolorline}
+ }%
+ {%
+ \xdef\pflimgcolorpt{\pflimgcolors}\xdef\pflimgcolorline{\pflimgcolors}
+ }%
+ \ifboolKV[GraphicTikzImg]{Spline}%
+ {%
+ \foreach \i in {#3}{%
+ \path[draw=none,tkzgrphcurve,name path=tmpimage] ({\i},{\pflymin})--({\i},{\pflymax}) ;
+ \path[name intersections={of=#2 and tmpimage,name=ZZ}] ;
+ \ifboolKV[GraphicTikzImg]{Lines}%
+ {%
+ \draw[\pflimgcolorline,tkzgrphrange] let \p1 = (ZZ-1) in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \MarkPts*[Style={\useKV[GraphicTikzImg]{Style}},Color=\pflimgcolorpt]{(ZZ-1)}
+ %\filldraw[\pflimgcolorpt] (ZZ-1) circle[radius=2pt] ;
+ }
+ }%
+ {%
+ \foreach \i in {#3}{%
+ \xdef\tmpresimg{\xintfloateval{#2(\i)}}%
+ \ifboolKV[GraphicTikzImg]{Lines}%
+ {%
+ \draw[\pflimgcolorline,tkzgrphrange] ({\i},{\pflOy}) |- ({\pflOx},{\tmpresimg}) ;
+ }%
+ {}%
+ \MarkPts*[Style={\useKV[GraphicTikzImg]{Style}},Color=\pflimgcolorpt]{({\i},{\tmpresimg})}
+ %\filldraw[\pflimgcolorpt] ({\i},{\tmpresimg}) circle[radius=2pt] ;
+ }%
+ }%
+}
+
+\NewDocumentCommand\DrawCounterimage{ O{} m m }{%avec le nom de la courbe...
+ \useKVdefault[GraphicTikzImg]%
+ \setKV[GraphicTikzImg]{#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,tkzgrphcurve,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[GraphicTikzImg]{Lines}%
+ {%
+ \draw[\pflimgcolorline,tkzgrphcounterimage] ({\pflxmin},{#3})--({\pflxmax},{#3}) ;
+ }%
+ {}%
+ \foreach \i in {1,...,\tmptotanteced}{%
+ \IfStrEq{\pflantecednoms}{}%
+ {}%
+ {%
+ \coordinate (\pflantecednoms-\i) at (ZZ-\i) ;
+ }%
+ \ifboolKV[GraphicTikzImg]{Lines}%
+ {%
+ \draw[\pflimgcolorline,tkzgrphrange] let \p1 = (ZZ-\i) in (ZZ-\i) -- ({\x1},{\pflOy}) ;
+ }%
+ {}%
+ \MarkPts*[Style={\useKV[GraphicTikzImg]{Style}},Color=\pflimgcolorpt]{(ZZ-\i)}
+ %\filldraw[\pflimgcolorpt] (ZZ-\i) circle[radius=2pt] ;
+ }%
+ }%
+ \end{scope}
+}
+
+%===NOMBRE DÉRIVÉ ET TANGENTE (EXPÉRIEMENTAL)
+\NewDocumentCommand\CalcDerivate{ 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[GraphicTikzTgte]{%
+ Colors=\def\pfltgttikzcolors{#1},%
+ OffsetL=\def\pfltgttikzkl{#1},%
+ OffsetR=\def\pfltgttikzkr{#1},%
+ h=\def\pfltgttikzh{#1},%
+ Direction=\def\pfltgttikzsens{#1},%
+ Delta=\def\tmptgtedelta{#1}
+}
+\setKVdefault[GraphicTikzTgte]{%
+ Colors=black,%
+ OffsetL=1,%
+ OffsetR=1,%
+ DispPt=false,%
+ Spline=false,%
+ h=0.1,%
+ Direction=lr,%
+ Node=false,%
+ Delta=0.01,%
+ Style=o
+}
+
+\NewDocumentCommand\DrawTangent{ O{} m m D<>{} }{%
+ \restoreKV[GraphicTikzTgte]%
+ \setKV[GraphicTikzTgte]{#1}%
+ %en fonction de la gestion de l'abscisse
+ \ifboolKV[GraphicTikzTgte]{Node}%
+ {%
+ \path #3;
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\pfltgttikzx{\xintfloateval{(\ConvertPtToCm{\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[GraphicTikzTgte]{Spline}%
+ {%
+ \path[name path=tmpimage] ({\pfltgttikzx},{\pflymin})--({\pfltgttikzx},{\pflymax}) ;
+ \path[name intersections={of=#2 and tmpimage,name=TANp}] ;
+ \IfStrEq{\pfltgttikzsens}{lr}%
+ {%
+ \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}{l}%
+ {%
+ \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}{r}%
+ {%
+ \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{(\ConvertPtToCm{\macrox})/(\pflxunit)}}%
+ \xdef\tzTANLLY{\xintfloateval{(\ConvertPtToCm{\macroy})/(\pflyunit)}}%
+ \path (RRpoint);
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\tzTANRRX{\xintfloateval{(\ConvertPtToCm{\macrox})/(\pflxunit)}}%
+ \xdef\tzTANRRY{\xintfloateval{(\ConvertPtToCm{\macroy})/(\pflyunit)}}%
+ \def\tztangentLFn{(\tzTANRRY-\tzTANLLY)/(\tzTANRRX-\tzTANLLX)*(\x-\tzTANLLX)+\tzTANLLY}%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ;
+ \draw[tkzgrphline,\pfltgttikzline,domain=\tmptgtdeb:\tmptgtfin,samples=2,#4] plot (\x,{\tztangentLFn}) ;
+ \end{scope}
+ }%
+ {%
+ \IfStrEq{\pfltgttikzsens}{l}%
+ {%
+ \CalcDerivate*{#2}{\pfltgttikzx}{\pfltgttikzh}%
+ }%
+ {%
+ \CalcDerivate{#2}{\pfltgttikzx}{\pfltgttikzh}%
+ }%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ;
+ \draw[tkzgrphline,\pfltgttikzline,#4] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,\TmpResNbDeriv*(x-(\pfltgttikzx))+#2(\pfltgttikzx)),x=\tmptgtdeb,\tmptgtfin)
+ \relax
+ };
+ \end{scope}
+ }%
+ \ifboolKV[GraphicTikzTgte]{DispPt}%
+ {%
+ \ifboolKV[GraphicTikzTgte]{Spline}%
+ {%
+ \MarkPts*[Style={\useKV[GraphicTikzTgte]{Style}},Color=\pfltgttikzpoint]{(TANp-1)}
+ %\filldraw[] (TANp-1) circle[tkzgrphpointc] ;
+ }%
+ {%
+ \xdef\tmpimgtgt{\xintfloateval{#2(\pfltgttikzx)}}%
+ \MarkPts*[Style={\useKV[GraphicTikzTgte]{Style}},Color=\pfltgttikzpoint]{({\pfltgttikzx},\tmpimgtgt)}
+ %\filldraw[\pfltgttikzpoint] ({\pfltgttikzx},\tmpimgtgt) circle[tkzgrphpointc] ;
+ }%
+ }%
+ {}%
+}
+
+%====loi normale
+\defKV[GraphicTikzGaussienne]{%
+ Step=\def\pflgaussstep{#1},%
+ Name=\def\pflgaussname{#1}
+}
+
+\setKVdefault[GraphicTikzGaussienne]{%
+ Name=gaussian,%
+ Color=black,%
+ Trace=false,%
+ Step={},%
+ Start={\pflxmin},%
+ End={\pflxmax}
+}
+
+\NewDocumentCommand\DefineStandartDeviation{ O{} D<>{phi} m m }{%
+ %1=options
+ %2=mu
+ %3=sigma
+ \restoreKV[GraphicTikzGaussienne]%
+ \setKV[GraphicTikzGaussienne]{#1}%
+ \xintdeffloatfunc #2(x) := 1/((#4)*sqrt(2*pi))*exp(-0.5*((x-(#3))/(#4))^2) ;%
+ \IfStrEq{\pflgaussstep}{}%
+ {%
+ \xdef\pflgaussstep{\xintfloateval{((\useKV[GraphicTikzGaussienne]{End})-(\useKV[GraphicTikzGaussienne]{Start}))/100}}%
+ }%
+ {}%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \ifboolKV[GraphicTikzGaussienne]{Trace}%
+ {%
+ \path[draw,tkzgrphcurve,{\useKV[GraphicTikzGaussienne]{Color}},name path global=\pflgaussname] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphicTikzGaussienne]{Start}}..[\pflgaussstep]..{\useKV[GraphicTikzGaussienne]{End}},{\useKV[GraphicTikzGaussienne]{End}})
+ \relax
+ } ;
+ }%
+ {%
+ \path[draw=none,tkzgrphcurve,name path global=\pflgaussname] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphicTikzGaussienne]{Start}}..[\pflgaussstep]..{\useKV[GraphicTikzGaussienne]{End}},{\useKV[GraphicTikzGaussienne]{End}})
+ \relax
+ } ;
+ }%
+ \end{scope}
+}
+
+\NewDocumentCommand\DrawStandartDeviation{ O{} m }{%
+ %1=options
+ %2=mu
+ %3=sigma
+ \restoreKV[GraphicTikzGaussienne]%
+ \setKV[GraphicTikzGaussienne]{#1}%
+ \IfStrEq{\pflgaussstep}{}%
+ {%
+ \xdef\pflgaussstep{\xintfloateval{((\useKV[GraphicTikzGaussienne]{End})-(\useKV[GraphicTikzGaussienne]{Start}))/100}}%
+ }%
+ {}%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \draw[tkzgrphcurve,{\useKV[GraphicTikzGaussienne]{Color}}] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2),x={\useKV[GraphicTikzGaussienne]{Start}}..[\pflgaussstep]..{\useKV[GraphicTikzGaussienne]{End}},{\useKV[GraphicTikzGaussienne]{End}})
+ \relax
+ } ;
+ \end{scope}
+}
+
+\NewDocumentCommand\DefineKhiSquared{ O{} D<>{khi} m }{%
+ %1=options
+ %2=mu
+ %3=sigma
+ \restoreKV[GraphicTikzGaussienne]%
+ \setKV[GraphicTikzGaussienne]{#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[GraphicTikzGaussienne]{End})-(\useKV[GraphicTikzGaussienne]{Start}))/100}}%
+ }%
+ {}%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \ifboolKV[GraphicTikzGaussienne]{Trace}%
+ {%
+ \path[draw,tkzgrphcurve,{\useKV[GraphicTikzGaussienne]{Color}},name path global=\pflgaussname] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphicTikzGaussienne]{Start}}..[\pflgaussstep]..{\useKV[GraphicTikzGaussienne]{End}},{\useKV[GraphicTikzGaussienne]{End}})
+ \relax
+ } ;
+ }%
+ {%
+ \path[draw=none,tkzgrphcurve,name path global=\pflgaussname] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphicTikzGaussienne]{Start}}..[\pflgaussstep]..{\useKV[GraphicTikzGaussienne]{End}},{\useKV[GraphicTikzGaussienne]{End}})
+ \relax
+ } ;
+ }%
+ \end{scope}
+}
+
+\NewDocumentCommand\DrawKhiSquared{ O{} m }{%
+ %1=options
+ %2=mu
+ %3=sigma
+ \restoreKV[GraphicTikzGaussienne]%
+ \setKV[GraphicTikzGaussienne]{#1}%
+ \IfStrEq{\pflgaussstep}{}%
+ {%
+ \xdef\pflgaussstep{\xintfloateval{((\useKV[GraphicTikzGaussienne]{End})-(\useKV[GraphicTikzGaussienne]{Start}))/100}}%
+ }%
+ {}%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \draw[tkzgrphcurve,{\useKV[GraphicTikzGaussienne]{Color}}] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2),x={\useKV[GraphicTikzGaussienne]{Start}}..[\pflgaussstep]..{\useKV[GraphicTikzGaussienne]{End}},{\useKV[GraphicTikzGaussienne]{End}})
+ \relax
+ } ;
+ \end{scope}
+}
+
+%====droite
+\defKV[GraphiquetikzDroite]{%
+ Name=\def\pfldroitename{#1}
+}
+
+\setKVdefault[GraphiquetikzDroite]{%
+ Slope=false,%
+ Color=black,%
+ Start={\pflxmin},%
+ End={\pflxmax},%
+ Name={}
+}
+
+\NewDocumentCommand\DrawLine{ O{} m m D<>{} }{%
+ \restoreKV[GraphiquetikzDroite]%
+ \setKV[GraphiquetikzDroite]{#1}%
+ %1er point
+ \path #2;%
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\pfldtetikzxA{\xintfloateval{(\ConvertPtToCm{\macrox})/(\pflxunit)}}%
+ \xdef\pfldtetikzyA{\xintfloateval{(\ConvertPtToCm{\macroy})/(\pflyunit)}}%
+ %2ème point si besoin
+ \ifboolKV[GraphiquetikzDroite]{Slope}%
+ {%
+ \xdef\pfldtepente{\xintfloateval{#3}}%
+ }%
+ {%
+ \path #3;%
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\pfldtetikzxB{\xintfloateval{(\ConvertPtToCm{\macrox})/(\pflxunit)}}%
+ \xdef\pfldtetikzyB{\xintfloateval{(\ConvertPtToCm{\macroy})/(\pflyunit)}}%
+ \xdef\pfldtepente{\xintfloateval{(\pfldtetikzyB-\pfldtetikzyA)/(\pfldtetikzxB-\pfldtetikzxA)}}%
+ }%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ;
+ \xintifboolexpr{\pfldtetikzxA == \pfldtetikzxB}%
+ {%
+ \IfEq{\pfldroitename}{}%
+ {%
+ \draw[tkzgrphline,{\useKV[GraphiquetikzDroite]{Color}},#4] (\pfldtetikzxA,\pflymin) -- (\pfldtetikzxA,\pflymax) ;
+ }%
+ {%
+ \draw[tkzgrphline,{\useKV[GraphiquetikzDroite]{Color}},#4,name path global=\pfldroitename] (\pfldtetikzxA,\pflymin) -- (\pfldtetikzxA,\pflymax) ;
+ }%
+ }%
+ {%
+ \IfEq{\pfldroitename}{}%
+ {%
+ \draw[tkzgrphline,{\useKV[GraphiquetikzDroite]{Color}},domain={\useKV[GraphiquetikzDroite]{Start}}:{\useKV[GraphiquetikzDroite]{End}},samples=2,#4] plot (\x,{\pfldtepente*(\x-\pfldtetikzxA)+\pfldtetikzyA}) ;
+ }%
+ {%
+ \draw[tkzgrphline,{\useKV[GraphiquetikzDroite]{Color}},domain={\useKV[GraphiquetikzDroite]{Start}}:{\useKV[GraphiquetikzDroite]{End}},samples=2,name path global=\pfldroitename,#4] plot (\x,{\pfldtepente*(\x-\pfldtetikzxA)+\pfldtetikzyA}) ;
+ }%
+ }%
+ \end{scope}
+}
+
+\defKV[GraphicTikzMinMax]{%
+ Pas=\def\pflminmaxstep{#1},%
+ Method=\def\pflminmaxmethode{#1},%
+ Coeffs=\def\pflminmaxcoeffs{#1}
+}
+\setKVdefault[GraphicTikzMinMax]{%
+ Start={\pflxmin},%
+ End={\pflxmax},%
+ Pas={},%
+ Tension=0.5,%
+ Method=function,%
+ Coeffs=3
+}
+
+\NewDocumentCommand\FindMax{ O{} m O{c-max} }{%
+ %1=clés
+ %2=paramètres en fonction de [Methode]
+ \restoreKV[GraphicTikzMinMax]%
+ \setKV[GraphicTikzMinMax]{#1}%
+ \IfStrEq{\pflstepcurve}{}%
+ {%
+ \xdef\pflminmaxstep{\xintfloateval{((\useKV[GraphicTikzMinMax]{End})-(\useKV[GraphicTikzMinMax]{Start}))/100}}%
+ }%
+ {}%
+ \begin{scope}[bezier bounding box,local bounding box=bbtmpmax]
+ \IfStrEq{\pflminmaxmethode}{function}%
+ {%
+ \path[draw=none,name path=curvetmpmax] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphicTikzMinMax]{Start}}..[\pflstepcurve]..{\useKV[GraphicTikzMinMax]{End}},{\useKV[GraphicTikzMinMax]{End}})
+ \relax
+ };
+ }%
+ {}%
+ \IfStrEq{\pflminmaxmethode}{interpo}%
+ {%
+ \path[draw=none,name path=curvetmpmax] plot[smooth,tension={\useKV[GraphicTikzMinMax]{Tension}}] coordinates {#2};
+ }%
+ {}%
+ \IfStrEq{\pflminmaxmethode}{spline}%
+ {%
+ \GenerateSpline{#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\FindMin{ O{} m O{c-min} }{%
+ %1=clés
+ %2=paramètres en fonction de [Methode]
+ \restoreKV[GraphicTikzMinMax]%
+ \setKV[GraphicTikzMinMax]{#1}%
+ \IfStrEq{\pflstepcurve}{}%
+ {%
+ \xdef\pflminmaxstep{\xintfloateval{((\useKV[GraphicTikzMinMax]{End})-(\useKV[GraphicTikzMinMax]{Start}))/100}}%
+ }%
+ {}%
+ \begin{scope}[bezier bounding box,local bounding box=bbtmpmin]
+ \IfStrEq{\pflminmaxmethode}{function}%
+ {%
+ \path[draw=none,name path=curvetmpmin] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphicTikzMinMax]{Start}}..[\pflstepcurve]..{\useKV[GraphicTikzMinMax]{End}},{\useKV[GraphicTikzMinMax]{End}})
+ \relax
+ };
+ }%
+ {}%
+ \IfStrEq{\pflminmaxmethode}{interpo}%
+ {%
+ \path[draw=none,name path=curvetmpmin] plot[smooth,tension={\useKV[GraphicTikzMinMax]{Tension}}] coordinates {#2};
+ }%
+ {}%
+ \IfStrEq{\pflminmaxmethode}{spline}%
+ {%
+ \GenerateSpline{#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}
+}
+
+%====TEXTES
+\defKV[GraphicTikzNode]{%
+ Color=\def\pflnodecol{#1},%
+ Font=\def\pflnodefonte{#1},%
+ Position=\def\pfnodepos{#1}
+}
+\setKVdefault[GraphicTikzNode]{%
+ Color=black,%
+ Start={\normalfont\normalsize},%
+ Position={}
+}
+\NewDocumentCommand\DrawTxt{ O{} m m }{%
+ \restoreKV[GraphicTikzNode]%
+ \setKV[GraphicTikzNode]{#1}%
+ \draw #2 node[tkzgrphnode,font=\pflnodefonte,text=\pflnodecol,\pfnodepos] {#3} ;
+}
+
+\endinput \ No newline at end of file