diff options
Diffstat (limited to 'graphics/pgf')
-rw-r--r-- | graphics/pgf/contrib/argumentation/README.md | 2 | ||||
-rw-r--r-- | graphics/pgf/contrib/argumentation/argumentation-doc.pdf | bin | 183613 -> 275801 bytes | |||
-rw-r--r-- | graphics/pgf/contrib/argumentation/argumentation-doc.tex | 450 | ||||
-rw-r--r-- | graphics/pgf/contrib/argumentation/argumentation.sty | 147 | ||||
-rw-r--r-- | graphics/pgf/contrib/scrabble/doc/Scrabble-doc-en.pdf | bin | 481429 -> 540950 bytes | |||
-rw-r--r-- | graphics/pgf/contrib/scrabble/doc/Scrabble-doc-en.tex | 81 | ||||
-rw-r--r-- | graphics/pgf/contrib/scrabble/doc/Scrabble-doc-fr.pdf | bin | 520790 -> 582871 bytes | |||
-rw-r--r-- | graphics/pgf/contrib/scrabble/doc/Scrabble-doc-fr.tex | 93 | ||||
-rw-r--r-- | graphics/pgf/contrib/scrabble/tex/Scrabble.sty | 104 |
9 files changed, 651 insertions, 226 deletions
diff --git a/graphics/pgf/contrib/argumentation/README.md b/graphics/pgf/contrib/argumentation/README.md index 1bc1c6bd18..3e6a97e5ec 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.0 [2023/11/05] +Version: 1.1 [2023/12/03] 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 Binary files differindex 61331279c4..39c89e37e3 100644 --- a/graphics/pgf/contrib/argumentation/argumentation-doc.pdf +++ b/graphics/pgf/contrib/argumentation/argumentation-doc.pdf diff --git a/graphics/pgf/contrib/argumentation/argumentation-doc.tex b/graphics/pgf/contrib/argumentation/argumentation-doc.tex index 5af926f031..128765d43c 100644 --- a/graphics/pgf/contrib/argumentation/argumentation-doc.tex +++ b/graphics/pgf/contrib/argumentation/argumentation-doc.tex @@ -1,15 +1,23 @@ \documentclass{article} -\title{The \texttt{argumentation} Package} -\author{Lars Bengel\\\small lars.bengel@fernuni-hagen.de} -%\date{} +\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]} %%%%%%%%% IMPORTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\usepackage{argumentation} -\usepackage{amsmath} - +\usepackage[]{argumentation} % Main Package +\usepackage{amsmath} % For example environment +\usepackage{xspace} % For dynamic spacing after commands +\usepackage{xcolor} % Coloring +\usepackage[hidelinks]{hyperref} % Hyperlinks +\usepackage{subcaption} % For two-part figures + +\newcommand{\tikzname}{Ti\emph{k}Z\xspace} +\newcommand{\argumentation}{\texttt{argumentation}\xspace} +\newcommand{\opt}[2][red]{\ensuremath{\textcolor{#1}{\langle #2\rangle}}} \newtheorem{example}{Example} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \begin{document} \maketitle @@ -25,31 +33,33 @@ \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[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{args1}{args6} \dualattack[inactive]{args6}{args7} \attack[inactive]{args8}{args7} \attack[inactive]{args7}{args2} - \attack[]{args3}{args2} - \attack[]{args4}{args5} - \attack[]{args5}{args10} - \attack[]{args10}{args9} - \attack[]{args9}{args4} - - \support[]{args4}{args3} - \support[]{args9}{args3} + \annotatedattack{args3}{args2}{$3$} + \attack[incomplete]{args4}{args5} + \attack{args5}{args10} + \attack{args10}{args9} + \attack{args9}{args4} + + \support{args4}{args3} + \support{args9}{args3} \end{af} - \caption{An exemplary AF created with the \textsf{argumentation} package.} + \caption{An exemplary AF created with the \argumentation package.} \label{fig:example} \end{figure} \vspace{-0.4cm} @@ -62,7 +72,7 @@ \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[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} @@ -72,67 +82,139 @@ \afname[left of=args1,yshift=-0.8cm,xshift=-0.2cm]{cap}{\textbf{F:}} \selfattack{args1} - \dualattack[]{args1}{args6} + \dualattack{args1}{args6} \dualattack[inactive]{args6}{args7} \attack[inactive]{args8}{args7} \attack[inactive]{args7}{args2} - \attack[]{args3}{args2} - \attack[]{args4}{args5} - \attack[]{args5}{args10} - \attack[]{args10}{args9} - \attack[]{args9}{args4} - - \support[]{args4}{args3} - \support[]{args9}{args3} + \annotatedattack{args3}{args2}{$3$} + \attack[incomplete]{args4}{args5} + \attack{args5}{args10} + \attack{args10}{args9} + \attack{args9}{args4} + + \support{args4}{args3} + \support{args9}{args3} \end{af} - \caption{An exemplary AF created with the \textsf{argumentation} package.} + \caption{An exemplary AF created with the \argumentation package.} \label{fig:example} \end{figure} \end{verbatim} -\section{Documentation for Version 1.0 [2023/11/05]} -In the following, we provide an overview over the functionality of the \textsf{argumentation} package. +\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. \subsection{Package Options} - Three options are provided to customize the look of the argumentation framework: \textsf{namestyle}, \textsf{argumentstyle} and \textsf{attackstyle}. - The \textsf{namestyle} option accepts three different values + The \argumentation package can be imported via the command + + \noindent + \verb|\usepackage{argumentation}| + + Alternatively, one can also adjust the appearance by providing some package options via + + \noindent + \verb|\usepackage[|\opt{options}\verb|]{argumentation}| + + \begin{list}{}{\leftmargin=\parindent\rightmargin=0pt} + \item The package provides the following \emph{optional} options to customize the look of the argumentation frameworks. + \end{list} \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.}\\ + \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{(default) The argument name is rendered with \textbf{\emph{both}}.}\\ + \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*} - The \textsf{argumentstyle} option controls the style of the argument nodes and accepts two values - \begin{align*} - \mathsf{standard} &\quad \text{(default) Standard style for the argument nodes.}\\ - \mathsf{retro} &\quad \text{Alternative style, node size may vary for large argument names.} - \end{align*} +\noindent\texttt{argumentstyle=}\opt{option} - The \textsf{attackstyle} option controls the style of the attack arrows and accepts two values + The \textsf{argumentstyle} parameter accepts two options + \begin{align*} + \mathsf{standard} &\quad \text{(default) Standard style for the argument nodes.}\\ + %\mathsf{retro} &\quad \text{Thicker outline and slightly larger nodes.}\\ + \end{align*} + +\newpage +\noindent\texttt{attackstyle=}\opt{option} + + The \textsf{attackstyle} parameter accepts two options \begin{align*} \mathsf{standard} &\quad \text{(default) Standard style for the attack arrow tips.}\\ - \mathsf{retro} &\quad \text{Alternative style, arrow tip is smaller and flatter.} + \mathsf{large} &\quad \text{Alternative style, arrow tip is larger and sharper.}\\ \end{align*} + +\noindent\texttt{supportstyle=}\opt{option} + The \textsf{supportstyle} parameter accepts three options + \begin{align*} + \mathsf{standard} &\quad \text{(default) Standard style for the attack arrow tips.}\\ + \mathsf{dashed} &\quad \text{Dashed arrow line, same tip.}\\ + \mathsf{double} &\quad \text{Double arrow line and large flat tip.}\\ + \end{align*} -\subsection{Environments} -The package provides two environments for creating abstract argumentation frameworks and bipolar argumentation frameworks in \LaTeX-documents. +You can override the \textsf{argumentstyle}, \textsf{attackstyle} and \textsf{supportstyle} parameters and set a custom style via the following commands respectively. -\subsubsection{\textsf{af}-Environment} - The \textsf{argumentation} package provides the \textsf{af} environment for creating abstract argumentation framework. - The \textsf{af} environment extends the \textsf{tikzpicture} environment, meaning all \textsf{tikzpicture}-parameters can be used inside the \textsf{af} environment as well. - The most relevant parameter is \verb|node distance|, which is set to \verb|1cm| per default. - -\subsubsection{\textsf{miniaf}-Environment} - The \textsf{miniaf} environment can be used to create argumentation frameworks using less space. - Especially useful for two-column layout documents. - It provides essentially the same as the \textsf{af} environment, but with \verb|node distance=0.5cm| and for each node \verb|minimum size=0.5cm|, \verb|font=\small|. +\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} +\subsection{The \texttt{af} Environment} +The \argumentation package provides an environment for creating abstract argumentation frameworks and bipolar argumentation frameworks in \LaTeX-documents.\\ + +\noindent +\verb|\begin{af}[|\opt{options}\verb|]| + +\opt[green]{environment~content} + +\noindent +\verb|\end{af}| + +\begin{list}{}{\leftmargin=\parindent\rightmargin=0pt} + \item + The \argumentation package provides the \texttt{af} environment for creating abstract argumentation framework. + 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. + + 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. + \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.}\\ + \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} +\end{list} \begin{figure}[ht] - \centering - \begin{miniaf} + \begin{subfigure}{0.48\textwidth} + \centering + \begin{af}[small] \argument{args1}{a} \argument[right=of args1]{args2}{b} \argument[right=of args2]{args3}{c} @@ -161,107 +243,156 @@ The package provides two environments for creating abstract argumentation framew \attack[]{args5}{args10} \attack[]{args10}{args9} \attack[]{args9}{args4} - \end{miniaf} - \caption{An exemplary Mini-AF created with the \textsf{miniaf} environment.} - \label{fig:example_mini} -\end{figure} + \end{af} + \caption{An exemplary AF created with the \textsf{small} option set.} + \label{fig:example_small} + \end{subfigure} + \hfill + \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:}} -\subsection{Arguments} - Arguments can be created with the following command + \selfattack{args1} + \dualattack[]{args1}{args6} + \dualattack[inactive]{args6}{args7} + \attack[inactive]{args8}{args7} - \verb|\argument{id}{name}| + \attack[inactive]{args7}{args2} + \attack[]{args3}{args2} - \noindent - To create an argument, you must provide a unique identifier \textsf{id} and the \textsf{name} to be displayed in the picture. - The \textsf{id} of an argument is then referred to when creating attacks as well as for the relative positioning of the other arguments. + \support[]{args4}{args3} + \support[]{args9}{args3} - The \textsf{standard} style of an argument is defined with the following parameters, all of which can be overridden if desired. - \begin{align*} - \textsf{circle} &\quad \text{the shape of the argument.}\\ - \textsf{minimum~size=0.75cm} &\quad \text{the minimum size of the circle, to ensure consistent}\\ - &\quad \text{argument size.}\\ - \textsf{draw=black} &\quad \text{outline and text color of the argument.}\\ - \textsf{thick} &\quad \text{the outline of the circle is rendered in \textsf{thick} mode.}\\ - \textsf{fill=white} &\quad \text{the background color of the argument.}\\ - \textsf{font=large} &\quad \text{the font size of the argument name.}\\ - \textsf{text~centered} &\quad \text{positioning of the argument name inside the circle.}\\ - \textsf{inner~sep=0} &\quad \text{inner margins of the circle, set to \textsf{0} to optimize space.} - \end{align*} - \subsubsection{Relative Positioning} - This package supports relative placement of the arguments via the \textsf{tikz}-library \textsf{positioning}. - The relative positioning information is provided as an optional parameter via - - \verb|\argument[dir=of arg_id]{id}{name}| + \attack[]{args4}{args5} + \attack[]{args5}{args10} + \attack[]{args10}{args9} + \attack[]{args9}{args4} + \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 - with \textsf{dir} being one of: \emph{right}, \emph{left}, \emph{below} and \emph{above} and \textsf{arg\_id} being the id of another argument. + \verb|\argument{|\opt{id}\verb|}{|\opt{name}\verb|}| - Additionally, you can adjust the horizontal/vertical position of an argument via the options \textsf{xshift} and \textsf{yshift}. - You must also specify the distance in one of the following ways + \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. - \verb|\argument[xshift=5mm]{id}{name}| + \end{list} - \verb|\argument[xshift=5pt]{id}{name}| +\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\\ + + \noindent + \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} + \item\opt{arg\_id}~ is the identifier of another argument + \item Additionally, you can adjust the horizontal/vertical position of an argument via the options \verb|xshift=|\opt{v} and \verb|yshift=|\opt{v}. + The value \opt{v} is the horizontal/vertical offset, e.\,g., \verb|5pt|, \verb|-3ex| or \verb|0.2cm|. + \end{list} - \verb|\argument[xshift=5ex]{id}{name}| \begin{example}~ \begin{verbatim} \begin{af} \argument{arg1}{a} - \argument[right=of arg1]{arg2}{b} - \argument[right=of arg2, yshift=-10pt]{arg3}{c} + \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} \end{af} \end{verbatim} \begin{center} \begin{af} \argument{arg1}{a} - \argument[right=of arg1]{arg2}{b} - \argument[right=of arg2, yshift=-10pt]{arg3}{c} + \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} \end{af} \end{center} \end{example} - \subsubsection{Argument Styles} +\subsubsection{Argument Styling} Furthermore, you can provide optional parameters to adjust the style of the argument node. - For that you can use all \textsf{tikz}-style options and additionally the following pre-defined style parameters: + 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 in grey and with a dotted outline.}\\ + \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{argundec} &\quad \text{The argument is displayed with cyan background color.}\\ \end{align*} - \begin{example} - - \end{example} + %Some relevant \tikzname style-parameters are + %\begin{align*} + %\textsf{circle} &\quad \text{the shape of the argument.}\\ + % \textsf{minimum~size=0.75cm} &\quad \text{the minimum size of the circle, to ensure consistent}\\ + % &\quad \text{argument size.}\\ + % \textsf{draw=black} &\quad \text{outline and text color of the argument.}\\ + %\textsf{thick} &\quad \text{the outline of the circle is rendered in \textsf{thick} mode.}\\ + % \textsf{fill=white} &\quad \text{the background color of the argument.}\\ + % \textsf{font=large} &\quad \text{the font size of the argument name.}\\ + %\textsf{text~centered} &\quad \text{positioning of the argument name inside the circle.}\\ + % \textsf{inner~sep=0} &\quad \text{inner margins of the circle, set to \textsf{0} to optimize space.} + %\end{align*} + \subsection{Attacks} - Attacks between two arguments can be created with the command - - \verb|\attack{arg1}{arg2}| + Attacks between two arguments can be created with the command\\ \noindent - where \textsf{arg1} and \textsf{arg2} are the identifiers of two previously defined arguments. - The \textsf{standard} style for attacks is defined with the \textsf{arrows.meta} library as follows - \begin{align*} - \texttt{-{Stealth[scale=1.25]}} - \end{align*} + \verb|\attack{|\opt{arg1}\verb|}{|\opt{arg2}\verb|}| + + \begin{list}{}{\leftmargin=\parindent\rightmargin=0pt} + \item where \opt{arg1} and \opt{arg2} are the identifiers of two previously defined arguments. + \end{list} -\subsubsection{Attack Styles} + +\subsubsection{Attack Styling} To customize an attack you can provide additional optional parameters: \begin{align*} - \mathsf{inactive} &\quad \text{The attack is displayed in grey and with a dotted line.}\\ + \mathsf{inactive} &\quad \text{The attack is displayed in grey.}\\ + \mathsf{incomplete} &\quad \text{The attack is displayed with a dotted line.}\\ + \mathsf{invisible} &\quad \text{The attack is completely transparent.}\\ + \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.}\\ \end{align*} - - Furthermore, all \textsf{tikz} style parameters can be used here as well. + + Of course, all \tikzname style parameters can be used here as well. \begin{example}~ \begin{verbatim} @@ -290,16 +421,17 @@ The package provides two environments for creating abstract argumentation framew \end{af} \end{center} \end{example} - - Additionally, you can create a symmetric attack between two arguments with + Additionally, there is a shortcut for creating a symmetric attack between two arguments with - \verb|\dualattack{arg1}{arg2}| + \noindent + \verb|\dualattack{|\opt{arg1}\verb|}{|\opt{arg2}\verb|}|\\ \noindent - and a self-attack for an argument with + and a shortcut for a self-attack for an argument with - \verb|\selfattack{arg1}| + \noindent + \verb|\selfattack{|\opt{arg1}\verb|}|\\ \noindent For both commands, you can use the same optional parameters as for the \verb|\attack| command. @@ -328,15 +460,16 @@ The package provides two environments for creating abstract argumentation framew \subsection{Supports} - You can create a support relation between two arguments with the command - - \verb|\support{arg1}{arg2}| + You can create a support relation between two arguments with the command\\ \noindent - where \verb|arg1| and \verb|arg2| are the identifiers of two previously defined arguments. + \verb|\support{|\opt{arg1}\verb|}{|\opt{arg2}\verb|}| + + \begin{list}{}{\leftmargin=\parindent\rightmargin=0pt} + \item where \opt{arg1} and \opt{arg2} are the identifiers of two previously defined arguments. The support arrow use the same tip as the attack arrows, but have a perpendicular mark to distinguish them from attacks. Supports can be customized in the same way as attacks. - + \end{list} \begin{example}~ \begin{verbatim} \begin{af} @@ -361,15 +494,64 @@ The package provides two environments for creating abstract argumentation framew \end{center} \end{example} +\subsection{Annotated Attacks} + 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\\ -\subsection{Further Commands} - If you want to display an identifier for your argumentation framework in the picture, you can use the command + \noindent + \verb|\annotatedattack{|\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. + \end{list} - \verb|\afname{id}{name}| + \begin{example}~ + \begin{verbatim} + \begin{af} + \argument{arg1}{a} + \argument[right=of arg1]{arg2}{b} + \argument[right=of arg2]{arg3}{c} + + \annotatedattack{arg1}{arg2}{$x$} + \annotatedattack[bend right]{arg2}{arg3}{$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} + + \annotatedattack{arg1}{arg2}{$x$} + \annotatedattack[bend right]{arg2}{arg3}{$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\\ \noindent - where \verb|id| is an identifier for the created node and \verb|name| is the text displayed in the picture. + \verb|\afname{|\opt{id}\verb|}{|\opt{name}\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. + \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|}| + + \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. + Additionally, positioning information, via \textsf{xshift} or \textsf{yshift}, can be provided via the optional parameters. + \end{list} \begin{example}~ \begin{verbatim} @@ -377,6 +559,7 @@ The package provides two environments for creating abstract argumentation framew \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$} \attack{arg1}{arg2} \end{af} @@ -386,12 +569,31 @@ The package provides two environments for creating abstract argumentation framew \begin{af} \argument{arg1}{a} \argument[right=of arg1]{arg2}{b} - \argument[right=of arg2]{arg3}{c} \afname[left=of arg1]{caption}{$F:$} + \annotation[yshift=-0.4cm,xshift=0.4cm]{arg2}{$\neg a$} \support{arg1}{arg2} \end{af} \end{center} \end{example} +%\section{Style Definitions} + +\newpage +\section{Version History} + +\subsection*{[v1.0 2023/11/05]} +\begin{itemize} + \item First Version. +\end{itemize} + +\subsection*{[v1.1 2023/12/03]} +\begin{itemize} + \item Adjusted standard styles. + \item Added command for creating annotated attacks. + \item Now only provides one environment, which can be parameterised. + \item Changed option management to pgfkeys. + \item Updated and improved documentation. +\end{itemize} + \end{document} diff --git a/graphics/pgf/contrib/argumentation/argumentation.sty b/graphics/pgf/contrib/argumentation/argumentation.sty index 80dd5f4c83..7cd678de3c 100644 --- a/graphics/pgf/contrib/argumentation/argumentation.sty +++ b/graphics/pgf/contrib/argumentation/argumentation.sty @@ -1,104 +1,109 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{argumentation}[2023/11/05 Argumentation] -% Author: Lars Bengel -% E-Mail: lars.bengel@fernuni-hagen.de -% Version: 1.0 -% License: LaTeX Project Public License 1.3c - -%%%%%%%%%%% Package Requirements %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\RequirePackage{options} % For managing package options +\ProvidesPackage{argumentation}[2023/12/03 Argumentation] +% Author: Lars Bengel +% E-Mail: lars.bengel@fernuni-hagen.de +% Version: 1.1 +% Date: 2023/12/03 +% License: LaTeX Project Public License 1.3c + +%%%%%%%%%%% Package Requirements %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\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 -\newcommand{\argstyle}[1]{\textbf{\emph{#1}}} % Defines the font style in which argument names are displayed +\newcommand{\argstyle}[1]{#1} % Defines the font style in which argument names are displayed +%%%%%%%%%% 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, +} -%%%%%%%%%% Package Options %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\options{ - /argumentation/.new family, - /argumentation/argumentstyle/.new choice = {standard, retro}, - /argumentation/namestyle/.new choice = {normal, italics, bold, bolditalics}, - /argumentation/attackstyle/.new choice = {standard, retro}, - /argumentation/@unknown/.new cmd 2 = \PackageWarning{argumentation}{Unknown option `#1'} +\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@ProcessOptions{/argumentation} - -%%%%%%%%%% Preprocessing options %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\ifcase\option{/argumentation/namestyle/@ord}\relax -\or\renewcommand{\argstyle}[1]{\emph{#1}} -\or\renewcommand{\argstyle}[1]{\textbf{#1}} -\or\renewcommand{\argstyle}[1]{\textbf{\emph{#1}}} -\fi - -\ifcase\option{/argumentation/argumentstyle/@ord} -\tikzset{arg/.style={circle, minimum size=0.75cm,draw=black,thick,fill=white,font=\large, text centered, inner sep=0}} -\or\tikzset{arg/.style={circle, minimum size=0.7cm,draw=black,thick,fill=white}} -\fi - -\ifcase\option{/argumentation/attackstyle/@ord} -\tikzset{att/.style={-{Stealth[scale=1.25]}}} -\or\tikzset{att/.style={->}} -\fi - -%%%%%%%%%% Package Content %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\tikzset{ % Basic predefined tikz-styles - % Self-Loop style - every loop/.style={min distance=2mm,in=0,out=60,looseness=5}, - % Color shortcuts for labelled arguments and reduced arguments - inactive/.style={draw=black!30, text=black!40,densely dashed}, - argin/.style={fill=green}, - argout/.style={fill=red}, - argundec/.style={fill=cyan}, - % Style for displaying AF name in Figure - caption/.style={draw=none}, - % Style for support mark - support mark/.style = {postaction = {decorate,decoration={markings,mark=at position #1 with {\draw[-] (0,-0.1) -- (0.1,0.1);}}}}, + +\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, } -\newcommand{\setargumentstyle}[1]{\tikzset{arg/.style={#1}}} -\newcommand{\setattackstyle}[1]{\tikzset{att/.style={#1}}} -\newcommand{\setloopstyle}[1]{\tikzset{every loop/.style={#1}}} +\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, +} -\newcommand{\adjustargumentstyle}[1]{\tikzset{arg/.append style={#1}}} -\newcommand{\adjustattackstyle}[1]{\tikzset{att/.append style={#1}}} +\ProcessPgfPackageOptions{/argumentation} +%%%%%%%%%% Package Content %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\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 + 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 + 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}, +} -\newcommand{\resetargumentstyle}{\setargumentstyle{circle, minimum size=0.75cm,draw=black,thick,fill=white,font=\large, text centered, inner sep=0}} -\newcommand{\resetattackstyle}{\setattackstyle{-{Stealth[scale=1.25]}}} -\newcommand{\resetloopstyle}{\setloopstyle{min distance=2mm,in=0,out=60,looseness=5}} +% 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}}} -\newenvironment{af}{ - \tikzpicture -}{% - \endtikzpicture + +%%%%%%%%%%%%%%% 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}}, } -\newenvironment{miniaf}[1][]{ - \tikzset{arg/.append style={font=\small, minimum size=0.5cm}, - att/.append style={-{Stealth[scale=0.9]}}, - } - \tikzpicture[node distance=0.5cm,#1] +\newenvironment{af}[1][]{ + \tikzpicture[#1] }{% \endtikzpicture } +%%%%%%%%%%%%%%%% Commands %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + % Creates a node displaying the name of the AF \newcommand{\afname}[3][]{\node[caption,#1](#2){#3};} +\newcommand{\annotation}[3][]{\node[annotation,above of=#2,#1](an_#2){#3};} + % Creates an argument node -\newcommand{\argument}[3][]{\node[arg,#1](#2){\argstyle{#3}};} +\newcommand{\argument}[3][]{\node[argument,argument size,#1](#2){\argstyle{#3}};} % Creates an attack edge -\newcommand{\attack}[3][]{\path(#2) edge [att,#1] (#3);} +\newcommand{\attack}[3][]{\path(#2) edge [attack,#1] (#3);} % Creates a self-attack -\newcommand{\selfattack}[2][]{\path(#2) edge [att,loop,#1] (#2);} +\newcommand{\selfattack}[2][]{\path(#2) edge [attack,selfattack,#1] (#2);} % Creates two symmetric attack edges between two arguments -\newcommand{\dualattack}[3][]{\path(#2) edge [att, bend right,#1] (#3);\path(#3) edge [att, bend right,#1] (#2);} +\newcommand{\dualattack}[3][]{\path(#2) edge [attack, bend right,#1] (#3);\path(#3) edge [attack, bend right,#1] (#2);} + +% Creates a weighted attack +\newcommand{\annotatedattack}[4][]{\path(#2) edge [attack,#1] node[annotation](p_#2_#3){#4} (#3);} % Creates a support edge between two arguments -\newcommand{\support}[3][]{\path(#2) edge [att,support mark=0.3,#1] (#3);} +\newcommand{\support}[3][]{\path(#2) edge [support=0.35,#1] (#3);} diff --git a/graphics/pgf/contrib/scrabble/doc/Scrabble-doc-en.pdf b/graphics/pgf/contrib/scrabble/doc/Scrabble-doc-en.pdf Binary files differindex 4ec7478db8..cf1cabf2cc 100644 --- a/graphics/pgf/contrib/scrabble/doc/Scrabble-doc-en.pdf +++ b/graphics/pgf/contrib/scrabble/doc/Scrabble-doc-en.pdf diff --git a/graphics/pgf/contrib/scrabble/doc/Scrabble-doc-en.tex b/graphics/pgf/contrib/scrabble/doc/Scrabble-doc-en.tex index 3bbae9eae4..eb6f8d5eaa 100644 --- a/graphics/pgf/contrib/scrabble/doc/Scrabble-doc-en.tex +++ b/graphics/pgf/contrib/scrabble/doc/Scrabble-doc-en.tex @@ -23,7 +23,22 @@ \cfoot{\sffamily\small - \thepage{} -} \rfoot{\hyperlink{matoc}{\small\faArrowAltCircleUp[regular]}} -\usepackage{hvlogos} +\usepackage{hologo} +\usepackage{xspace} +\newcommand\tikzlogo{Ti\textit{k}Z} +\newcommand\TeXLive{\hologo{TeX}Live\xspace} +\let\TikZ\tikzlogo +\newcommand\TableauDocumentation{% + \begin{tblr}{width=\linewidth,colspec={X[c]X[c]X[c]X[c]X[c]X[c]},cells={font=\sffamily}} + {\huge \LaTeX} & & & & &\\ + & {\huge \hologo{pdfLaTeX}} & & & & \\ + & & {\huge \hologo{LuaLaTeX}} & & & \\ + & & & {\huge \TikZ} & & \\ + & & & & {\huge \TeXLive} & \\ + & & & & & {\huge \hologo{MiKTeX}} \\ + \end{tblr} +} + \usepackage{hyperref} \urlstyle{same} \hypersetup{pdfborder=0 0 0} @@ -31,8 +46,8 @@ \setlength{\parindent}{0pt} \definecolor{LightGray}{gray}{0.9} -\def\TPversion{0.1.3} -\def\TPdate{09/01/2023} +\def\TPversion{0.1.4} +\def\TPdate{03/12/2023} \usepackage[most]{tcolorbox} \tcbuselibrary{minted} @@ -104,7 +119,7 @@ {$\blacktriangleright$~~Ideas from \url{https://tex.stackexchange.com/questions/194780/tikz-drawing-a-rectangle-with-spikes-on-borders}} -\vspace{0.5cm} +\vspace{0.15cm} \begin{center} \ScrabbleBoard[Scale=0.5] @@ -133,14 +148,7 @@ \medskip -\begin{tblr}{width=\linewidth,colspec={X[c]X[c]X[c]X[c]X[c]X[c]},cells={font=\sffamily}} -{\huge \LaTeX} & & & & &\\ -& {\huge \pdfLaTeX} & & & & \\ -& & {\huge \LuaLaTeX} & & & \\ -& & & {\huge \TikZ} & & \\ -& & & & {\huge \TeXLive} & \\ -& & & & & {\huge \MiKTeX} \\ -\end{tblr} +\TableauDocumentation \medskip @@ -295,14 +303,61 @@ For putting word on the board : \end{EnvScrabble}~~~ \begin{EnvScrabble}<ES>[Scale=0.55] \ScrabblePutWord{LaTeX}{1,14} \ScrabblePutWord[V]{Madrid}{2,15} - \draw (7,15) node[font=\LARGE\sffamily] {Spanish vesion} ; + \draw (7,15) node[font=\LARGE\sffamily] {Spanish version} ; \end{EnvScrabble} \end{PresentationCode} \newpage +\subsection{\textit{Inline} word} + +The idea is to propose a command to insert a word in \textit{online} mode, with automatic adjustment of size and position. + +\begin{PresentationCode}{listing only} +%command to put inline word +\ScrabbleWord[keys]{word} +\end{PresentationCode} + +The first argument, \textit{optional}, between \texttt{[...]} allows you to configure the \Cle{keys}: + +\begin{itemize} + \item \Cle{Colback} for the color of the pieces ; \hfill~default: \Cle{yellow!40} + \item \Cle{Font} for the font ; \hfill~default: \Cle{\textbackslash bfseries\textbackslash sffamily} + \item \Cle{Colfonte} for the color of the characters ; \hfill~default: \Cle{black} + \item \Cle{Lang} to choose the language (for the number of points) ; \hfill~default: \Cle{EN} + \item \Cle{Offset} to specify horizontal spacing between pieces ; \hfill~default: \Cle{0.1pt} + \item \Cle{Scale} to specify a base scale for texts ; \hfill~default: \Cle{0.6} + \item \Cle{Score} which is a boolean to display the score of each piece. \hfill~default: \Cle{true} +\end{itemize} + +\textbf{Note 1 :} the code is responsible for positioning the pieces for \textit{satisfactory} alignment and scaling based on the active font. + +\smallskip + +\textbf{Note 2 :} the \textit{blank} (or \textit{wildcard}) is obtained by the character \texttt{*}. + +\begin{PresentationCode}{} +Online Scrabble word test positioning \ScrabbleWord{TE*ST} to see ! +\end{PresentationCode} + +\begin{PresentationCode}{} +{\Huge\sffamily Test positioning \ScrabbleWord[Colback=teal!5,Colfonte=orange]{PYTHAG*RE} to see !} +\end{PresentationCode} + +\begin{PresentationCode}{} +\scalebox{3}[3]{Positioning \ScrabbleWord[Lang=DE,Font=\ttfamily,Scale=0.75]{PYTHAG*RE} to see !} +\end{PresentationCode} + +\begin{PresentationCode}{} +{\LARGE Test positioning \ScrabbleWord[Score=false,Offset=1pt,Colback=orange!50]{PSTRICKS} to see !} +\end{PresentationCode} + +\newpage + \part*{History} +\verb|v0.1.4|~:~~~~Command to insert \textit{inline} words + \verb|v0.1.3|~:~~~~Words in uppercase or lowercase, adjusted codes for language (ISO 639-1) \verb|v0.1.2|~:~~~~Key \textsf{<ScaleLabels>} to modify scale of the cell's names diff --git a/graphics/pgf/contrib/scrabble/doc/Scrabble-doc-fr.pdf b/graphics/pgf/contrib/scrabble/doc/Scrabble-doc-fr.pdf Binary files differindex 04bb85d6fc..659b47854a 100644 --- a/graphics/pgf/contrib/scrabble/doc/Scrabble-doc-fr.pdf +++ b/graphics/pgf/contrib/scrabble/doc/Scrabble-doc-fr.pdf diff --git a/graphics/pgf/contrib/scrabble/doc/Scrabble-doc-fr.tex b/graphics/pgf/contrib/scrabble/doc/Scrabble-doc-fr.tex index 05d0ae1f4d..560ad35342 100644 --- a/graphics/pgf/contrib/scrabble/doc/Scrabble-doc-fr.tex +++ b/graphics/pgf/contrib/scrabble/doc/Scrabble-doc-fr.tex @@ -23,7 +23,24 @@ \cfoot{\sffamily\small - \thepage{} -} \rfoot{\hyperlink{matoc}{\small\faArrowAltCircleUp[regular]}} -\usepackage{hvlogos} +%\usepackage{hvlogos} +\usepackage{hologo} +\providecommand\tikzlogo{Ti\textit{k}Z} +\providecommand\TeXLive{\TeX{}Live\xspace} +\providecommand\PSTricks{\textsf{PSTricks}\xspace} +\let\pstricks\PSTricks +\let\TikZ\tikzlogo +\newcommand\TableauDocumentation{% + \begin{tblr}{width=\linewidth,colspec={X[c]X[c]X[c]X[c]X[c]X[c]},cells={font=\sffamily}} + {\huge \LaTeX} & & & & &\\ + & {\huge \hologo{pdfLaTeX}} & & & & \\ + & & {\huge \hologo{LuaLaTeX}} & & & \\ + & & & {\huge \TikZ} & & \\ + & & & & {\huge \TeXLive} & \\ + & & & & & {\huge \hologo{MiKTeX}} \\ + \end{tblr} +} + \usepackage{hyperref} \urlstyle{same} \hypersetup{pdfborder=0 0 0} @@ -31,8 +48,8 @@ \setlength{\parindent}{0pt} \definecolor{LightGray}{gray}{0.9} -\def\TPversion{0.1.3} -\def\TPdate{9 Janvier 2023} +\def\TPversion{0.1.4} +\def\TPdate{3 décembre 2023} \usepackage[most]{tcolorbox} \tcbuselibrary{minted} @@ -102,14 +119,18 @@ \smallskip +{$\blacktriangleright$~~Possibilité d'insérer un mot en mode \textit{en ligne}.} + +\smallskip + {$\blacktriangleright$~~Idée(s) venant de \url{https://tex.stackexchange.com/questions/194780/tikz-drawing-a-rectangle-with-spikes-on-borders}} -\vspace{0.5cm} +\vspace{0.15cm} \begin{center} - \PlateauScrabble[Echelle=0.4] + \PlateauScrabble[Echelle=0.5] ~~~~ - \begin{EnvScrabbleFR}[Echelle=0.4] + \begin{EnvScrabbleFR}[Echelle=0.5] \ScrabblePlaceMot{TIKZ}{1,13} \ScrabblePlaceMot[V]{pstricks}{1,15} \ScrabblePlaceMot[V]{KaTeX}{3,13} @@ -135,14 +156,7 @@ \medskip -\begin{tblr}{width=\linewidth,colspec={X[c]X[c]X[c]X[c]X[c]X[c]},cells={font=\sffamily}} -{\huge \LaTeX} & & & & &\\ -& {\huge \pdfLaTeX} & & & & \\ -& & {\huge \LuaLaTeX} & & & \\ -& & & {\huge \TikZ} & & \\ -& & & & {\huge \TeXLive} & \\ -& & & & & {\huge \MiKTeX} \\ -\end{tblr} +\TableauDocumentation \medskip @@ -258,8 +272,8 @@ Pour le placement des mots : \begin{itemize} \item le premier argument, \textit{optionnel}, entre \texttt{[...]} est l'orientation du mot, à choisir entre \Cle{H} (par défaut) et \Cle{V} (en fait toute autre lettre que \Cle{H} !) ; - \item le deuxième argument, \textit{mandataire}, entre \texttt{\{...\}}, est le mot à placer, en majuscules ou minuscules ; - \item le dernier argument, \textit{mandataire}, entre \texttt{\{...\}}, correspond aux coordonnées de la case sur laquelle sera placée le début du mot (la case (1;\,1) étant la case au bord Bas/Gauche). + \item le deuxième argument, \textit{obligatoire}, entre \texttt{\{...\}}, est le mot à placer, en majuscules ou minuscules ; + \item le dernier argument, \textit{obligatoire}, entre \texttt{\{...\}}, correspond aux coordonnées de la case sur laquelle sera placée le début du mot (la case (1;\,1) étant la case au bord Bas/Gauche). \end{itemize} \textbf{Remarque 1 :} la langue choisie permettra également d'avoir les jetons avec le \textit{bon} nombre de points ! @@ -304,6 +318,51 @@ Pour le placement des mots : \newpage +\subsection{Mot \textit{en ligne}} + +Il s'agit ici de proposer une commande pour insérer un mot en mode \textit{en ligne}, avec ajustement automatique de la taille et de la position. + +\begin{PresentationCode}{listing only} +%commande pour placer un mot en ligne +\MotScrabble[clés]{mot} +\end{PresentationCode} + +Le premier argument, \textit{optionnel}, entre \texttt{[...]} permet de paramétrer les \Cle{clés} : + +\begin{itemize} + \item \Cle{CouleurFond} pour la couleur des cases ; \hfill~défaut : \Cle{yellow!40} + \item \Cle{Police} pour la police des caractères ; \hfill~défaut : \Cle{\textbackslash bfseries\textbackslash sffamily} + \item \Cle{CouleurPolice} pour la couleur des caractères ; \hfill~défaut : \Cle{black} + \item \Cle{Langue} pour choisir la langue (pour les nombres de points) ; \hfill~défaut : \Cle{FR} + \item \Cle{Offset} pour spécifier un espacement horizontal entre les jetons ; \hfill~défaut : \Cle{0.1pt} + \item \Cle{Echelle} pour spécifier une échelle de base pour les textes ; \hfill~défaut : \Cle{0.6} + \item \Cle{Score} qui est un booléen pour afficher le score de chaque jeton.\hfill~défaut : \Cle{true} +\end{itemize} + +\textbf{Remarque 1 :} le code se charge de positionner le jeton pour un alignement et une mise à l'échelle \textit{satisfaisants} en fonction de la police active. + +\smallskip + +\textbf{Remarque 2 :} le \textit{blanc} (ou \textit{joker}) est obtenu par le caractère \texttt{*}. + +\begin{PresentationCode}{} +Essai de mot de Scrabble en ligne \MotScrabble{TE*ST} pour voir ! +\end{PresentationCode} + +\begin{PresentationCode}{} +{\Huge\sffamily En ligne \MotScrabble[CouleurFond=teal!5,CouleurPolice=orange]{PYTHAG*RE} pour voir !} +\end{PresentationCode} + +\begin{PresentationCode}{} +\scalebox{3}[3]{En ligne \MotScrabble[Langue=EN,Police=\ttfamily,Echelle=0.75]{PYTHAG*RE} pour voir !} +\end{PresentationCode} + +\begin{PresentationCode}{} +{\LARGE En ligne \MotScrabble[Score=false,Offset=1pt,CouleurFond=orange!50]{PSTRICKS} pour voir !} +\end{PresentationCode} + +\newpage + \subsection{Commandes anglaises} Le package ayant potentiellement une portée \textit{internationale}, les commandes existent également en version \textit{anglaise}. Dans ce cas, les \Cle{clés} sont également à donner en anglais. @@ -327,6 +386,8 @@ Le package ayant potentiellement une portée \textit{internationale}, les comman \part*{Historique} +\verb|v0.1.4|~:~~~~Ajout d'une commande pour placer en \textit{mot} en mode \og en ligne \fg + \verb|v0.1.3|~:~~~~Meilleure gestion de la saisie des mots (sans virgule, majuscule ou minuscule) \verb|v0.1.2|~:~~~~Clé \textsf{<EchelleLabels>} pour modifier l'échelle des noms des cases diff --git a/graphics/pgf/contrib/scrabble/tex/Scrabble.sty b/graphics/pgf/contrib/scrabble/tex/Scrabble.sty index 6c87e7e370..0d610ea117 100644 --- a/graphics/pgf/contrib/scrabble/tex/Scrabble.sty +++ b/graphics/pgf/contrib/scrabble/tex/Scrabble.sty @@ -4,7 +4,8 @@ % Inspiration : Mark Wibrow in https://tex.stackexchange.com/questions/194780/tikz-drawing-a-rectangle-with-spikes-on-borders \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{Scrabble}[2023/01/09 v0.1.3 Scrabble] +\ProvidesPackage{Scrabble}[2023/12/03 0.1.4 Scrabble] +% 0.1.4 Ajout d'un mode inline % 0.1.3 Refonte des commandes fr/en + gestion mot % 0.1.2 Clé <EchelleLabels> pour les labels des cases % 0.1.1 Commandes en/fr @@ -17,6 +18,7 @@ \RequirePackage{xparse} \RequirePackage{simplekv} \RequirePackage{listofitems} +\RequirePackage{calc} %librairies tikz \usetikzlibrary{calc,shapes.geometric} @@ -312,4 +314,104 @@ \end{tikzpicture}% } +%place mot inline +\newlength{\tmp@scrabword@total@height} +\newlength{\tmp@scrabword@depth} + +\defKV[SCRABBLEWORDINLINEFR]{% + CouleurFond=\def\ScrWordInlColFond{#1},% + Police=\def\ScrWordInlFonte{#1},% + CouleurPolice=\def\ScrWordInlColFonte{#1},% + Langue=\def\ScrWordInlLang{#1},% + Offset=\def\ScrWordInlOffset{#1},% + Echelle=\def\ScrWordInlScale{#1} +} + +\setKVdefault[SCRABBLEWORDINLINEFR]{% + CouleurFond=yellow!40,% + Police=\bfseries\sffamily,% + CouleurPolice=black,% + Langue=FR,% + Offset=0.1pt,% + Score=true,% + Echelle=0.6 +} + +\NewDocumentCommand\MotScrabble{ O{} m }{% + \useKVdefault[SCRABBLEWORDINLINEFR]% + \setKV[SCRABBLEWORDINLINEFR]{#1}% + \settototalheight{\tmp@scrabword@total@height}{\hbox{ABCDEFGHIJKLMNOPQQRSTUVWXYZabcdefghijklmnopqqrstuvwxyz}}% + \settodepth{\tmp@scrabword@depth}{\hbox{q}}% + \StrLen{#2}[\lgmot]% + \raisebox{-\tmp@scrabword@depth+0.025\tmp@scrabword@total@height}{% + \foreach \l in {1,2,...,\lgmot}% + {% + \StrChar{#2}{\l}[\ll]% + \IfStrEq{\ll}{*}% + {% + {\tikz \filldraw[\ScrWordInlColFond,rounded corners={0.15\tmp@scrabword@total@height}] (0,0) rectangle++ ({0.9\tmp@scrabword@total@height},{0.9\tmp@scrabword@total@height}) ;}% + }% + {% + {\tikz {% + \filldraw[\ScrWordInlColFond,rounded corners={0.15\tmp@scrabword@total@height}] (0,0) rectangle++ ({0.9\tmp@scrabword@total@height},{0.9\tmp@scrabword@total@height}) node[inner sep=0pt,midway,font=\ScrWordInlFonte,scale=\ScrWordInlScale,text=\ScrWordInlColFonte] {\expandafter\MakeUppercase\expandafter{\ll}};% + \ifboolKV[SCRABBLEWORDINLINEFR]{Score}% + {\draw ({0.9\tmp@scrabword@total@height},0) node[inner sep=0pt,above left={0.075\tmp@scrabword@total@height},font=\ScrWordInlFonte,scale={0.25*\ScrWordInlScale},text=\ScrWordInlColFonte] { \scrabblescorelettre[\ScrWordInlLang]{\ll} } ;} + {}% + }% + }% + }% + \ifnum \l<\lgmot\hspace*{\ScrWordInlOffset}\fi% + }% + }% +} + +\defKV[SCRABBLEWORDINLINEEN]{% + Colback=\def\ScrWordInlColFond{#1},% + Font=\def\ScrWordInlFonte{#1},% + Colfonte=\def\ScrWordInlColFonte{#1},% + Lang=\def\ScrWordInlLang{#1},% + Offset=\def\ScrWordInlOffset{#1},% + Scale=\def\ScrWordInlScale{#1} +} + +\setKVdefault[SCRABBLEWORDINLINEEN]{% + Colback=yellow!40,% + Font=\bfseries\sffamily,% + Colfonte=black,% + Lang=EN,% + Offset=0.1pt,% + Score=true,% + Scale=0.6 +} + +\NewDocumentCommand\ScrabbleWord{ O{} m }{% + \useKVdefault[SCRABBLEWORDINLINEEN]% + \setKV[SCRABBLEWORDINLINEEN]{#1}% + \settototalheight{\tmp@scrabword@total@height}{\hbox{ABCDEFGHIJKLMNOPQQRSTUVWXYZabcdefghijklmnopqqrstuvwxyz}}% + \settodepth{\tmp@scrabword@depth}{\hbox{q}}% + \StrLen{#2}[\lgmot]% + \raisebox{-\tmp@scrabword@depth+0.025\tmp@scrabword@total@height}{% + \foreach \l in {1,2,...,\lgmot}% + {% + \StrChar{#2}{\l}[\ll]% + \IfStrEq{\ll}{*}% + {% + {\tikz \filldraw[\ScrWordInlColFond,rounded corners={0.15\tmp@scrabword@total@height}] (0,0) rectangle++ ({0.9\tmp@scrabword@total@height},{0.9\tmp@scrabword@total@height}) ;}% + }% + {% + {\tikz {% + \filldraw[\ScrWordInlColFond,rounded corners={0.15\tmp@scrabword@total@height}] (0,0) rectangle++ ({0.9\tmp@scrabword@total@height},{0.9\tmp@scrabword@total@height}) node[inner sep=0pt,midway,font=\ScrWordInlFonte,scale=\ScrWordInlScale,text=\ScrWordInlColFonte] {\expandafter\MakeUppercase\expandafter{\ll}};% + \ifboolKV[SCRABBLEWORDINLINEEN]{Score}% + {\draw ({0.9\tmp@scrabword@total@height},0) node[inner sep=0pt,above left={0.075\tmp@scrabword@total@height},font=\ScrWordInlFonte,scale={0.25*\ScrWordInlScale},text=\ScrWordInlColFonte] { \scrabblescorelettre[\ScrWordInlLang]{\ll} } ;} + {}% + }% + }% + }% + \ifnum \l<\lgmot\hspace*{\ScrWordInlOffset}\fi% + }% + }% +} + + + \endinput
\ No newline at end of file |