summaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'graphics')
-rw-r--r--graphics/pgf/contrib/causets/README.md25
-rw-r--r--graphics/pgf/contrib/causets/causet_tikz_example1.pdfbin17024 -> 18369 bytes
-rw-r--r--graphics/pgf/contrib/causets/causet_tikz_example1.tex17
-rw-r--r--graphics/pgf/contrib/causets/causet_tikz_example2.pdfbin22314 -> 54048 bytes
-rw-r--r--graphics/pgf/contrib/causets/causet_tikz_example2.tex160
-rw-r--r--graphics/pgf/contrib/causets/causets.pdfbin435576 -> 483657 bytes
-rw-r--r--graphics/pgf/contrib/causets/causets.sty507
-rw-r--r--graphics/pgf/contrib/causets/causets.tex865
-rw-r--r--graphics/pgf/contrib/pgf-umlcd/COPYING21
-rw-r--r--graphics/pgf/contrib/pgf-umlcd/LICENSE-GPL2.txt339
-rw-r--r--graphics/pgf/contrib/pgf-umlcd/LICENSE-LPPL1.3c.txt416
-rw-r--r--graphics/pgf/contrib/pgf-umlcd/README3
-rw-r--r--graphics/pgf/contrib/pgf-umlcd/README.md15
-rw-r--r--graphics/pgf/contrib/pgf-umlcd/RELEASE_NOTES.md12
-rw-r--r--graphics/pgf/contrib/pgf-umlcd/demo/color.tex14
-rw-r--r--graphics/pgf/contrib/pgf-umlcd/demo/multiple-inheritance.tex16
-rw-r--r--graphics/pgf/contrib/pgf-umlcd/description.html2
-rw-r--r--graphics/pgf/contrib/pgf-umlcd/pgf-umlcd-manual.pdfbin269669 -> 233921 bytes
-rw-r--r--graphics/pgf/contrib/pgf-umlcd/pgf-umlcd-manual.tex15
-rw-r--r--graphics/pgf/contrib/pgf-umlcd/pgf-umlcd.sty353
-rw-r--r--graphics/pgf/contrib/pgf-umlcd/tikzlibraryumlcd.code.tex402
21 files changed, 2202 insertions, 980 deletions
diff --git a/graphics/pgf/contrib/causets/README.md b/graphics/pgf/contrib/causets/README.md
index 56a3c857cd..76e8b4593f 100644
--- a/graphics/pgf/contrib/causets/README.md
+++ b/graphics/pgf/contrib/causets/README.md
@@ -1,7 +1,7 @@
-LaTeX Package: causets
-======================
-This is a LaTeX package to create (Hasse) diagrams of causal sets - short causets (locally finite, partially ordered sets) to be used inline with text or mathematical expressions, as well as with TikZ pictures.
+# The `causets` package
+The LaTeX package `causets` lets you create (Hasse) diagrams of causal sets. Causal sets (causets) are locally finite, partially ordered sets and are consider as a framework for quantum gravity. This package is built on the package `tikz`, which is usually included in the standard LaTeX installations and loaded automatically with `\usepackage{causets}`.
+The diagrams can be used inline with text or mathematical expressions, or they may be included in a TikZ pictures.
The three main commands (macros) are
```tex
% causet generated from a permutation:
@@ -13,13 +13,11 @@ The three main commands (macros) are
```
For a full documentation, please see causets.pdf.
+The documentation includes some examples.
+More examples are included at
+https://github.com/c-minz/LaTeX-causets/tree/main/examples
-Additional Packages
-===================
-This package is built on the package `tikz`, which is usually included in the standard LaTeX installations.
-
-Bug Reports
-===========
+## Bug reports
Problems with the package are reported here:
https://github.com/c-minz/LaTeX-causets/issues
@@ -34,12 +32,11 @@ Bug reports can be send to the maintainer:
C. Minz
christoph{dot}minz[AT]gmail{dot}com
-Information on Distribution
-===========================
+## License and distribution
Copyright 2020-2022 by C. Minz
-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 in
+This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this licence or (at your option) any later version.
+The latest version of this licence is in
http://www.latex-project.org/lppl.txt
This work has the LPPL maintenance status "maintained".
@@ -47,7 +44,7 @@ This work has the LPPL maintenance status "maintained".
The current maintainer of this work is C. Minz.
https://github.com/c-minz
-Current version: 1.2
+**Current version: v1.3**
CTAN location: /graphics/pgf/contrib/causets/
diff --git a/graphics/pgf/contrib/causets/causet_tikz_example1.pdf b/graphics/pgf/contrib/causets/causet_tikz_example1.pdf
index cf83e39a82..2ebdf2ce48 100644
--- a/graphics/pgf/contrib/causets/causet_tikz_example1.pdf
+++ b/graphics/pgf/contrib/causets/causet_tikz_example1.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/causets/causet_tikz_example1.tex b/graphics/pgf/contrib/causets/causet_tikz_example1.tex
index 7be620b9a2..dfbe3abf76 100644
--- a/graphics/pgf/contrib/causets/causet_tikz_example1.tex
+++ b/graphics/pgf/contrib/causets/causet_tikz_example1.tex
@@ -1,18 +1,23 @@
\documentclass[tikz]{standalone}
-\usepackage[permutation,huge,neon]{causets}
+\usepackage[permutation,larger,neon]{causets}
\usetikzlibrary{fit,shapes.geometric}
\begin{document}
\begin{tikzpicture}
+ % Create causet, shifted in x- and y-direction:
\begin{scope}[xshift=3cm, yshift=-1cm]
+ \tikzcausetsset{offset=-2}
\drawpcauset{5,2,7,3,6,1,4}
\draw[red, double] (0, 0) circle[radius=0.1];
\end{scope}
- \node[draw=blue, inner sep=1pt, thick, ellipse, fit=(E4) (E6) (E7)] (Finf) {};
- \node[draw=blue] (FinfLabel) at (6.5, -0.5) {future infinity};
- \node[draw=red] (centerLabel) at (0.5, -0.5) {center};
- \node[draw=green!50!black] (myEventLabel) at (5.5, -2.5) {event (E2)};
+ % Circumscribe the future infinity:
+ \node[draw=blue, inner sep=1pt, thick, ellipse, fit=(E2) (E4) (E5)] (Finf) {};
+ % Add labels on top:
+ \node[draw=blue, right, align=right] (FinfLabel) at (4.8, -0.5) {future infinity / \\ maximal events};
+ \node[draw=red] (centerLabel) at (0.5, -0.5) {centre};
+ \node[draw=green!50!black] (myEventLabel) at (5.5, -2.5) {event (E0)};
+ % Draw arrows from the labels to the references:
\draw[ultra thick, blue, ->] (FinfLabel) -- (Finf);
\draw[ultra thick, red, ->] (centerLabel) -- (3, -1);
- \draw[ultra thick, green!50!black, ->] (myEventLabel) -- (E2);
+ \draw[ultra thick, green!50!black, ->] (myEventLabel) -- (E0);
\end{tikzpicture}
\end{document}
diff --git a/graphics/pgf/contrib/causets/causet_tikz_example2.pdf b/graphics/pgf/contrib/causets/causet_tikz_example2.pdf
index d9343512a7..4319525eb9 100644
--- a/graphics/pgf/contrib/causets/causet_tikz_example2.pdf
+++ b/graphics/pgf/contrib/causets/causet_tikz_example2.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/causets/causet_tikz_example2.tex b/graphics/pgf/contrib/causets/causet_tikz_example2.tex
index 4cd5ee3b45..83b3de699c 100644
--- a/graphics/pgf/contrib/causets/causet_tikz_example2.tex
+++ b/graphics/pgf/contrib/causets/causet_tikz_example2.tex
@@ -1,69 +1,101 @@
\documentclass[tikz]{standalone}
-\usepackage[blue]{causets}
+\usepackage[black]{causets}
\usetikzlibrary{fit,shapes.geometric}
+% Set colours and style:
+\colorlet{future colour}{green!50!black}
+\colorlet{past colour}{yellow!50!orange!80!black}
+\colorlet{anywhere colour}{red!80!black}
+\tikzset{prob arrow/.style={line width=1.5pt}}
+% Define some helper functions:
+\def\defCevents#1#2#3{\xdef\Ea{#1}\xdef\Eb{#2}\xdef\Ec{#3}}
+\def\defDevents#1#2#3#4{\expandafter\defCevents#1#2#3\xdef\Ed{#4}}
+\newcommand*{\semiopaque}[1]{% Adds a transparency group.
+\begin{scope}[transparency group, opacity=0.5]
+ #1
+\end{scope}
+}
+\newcommand*{\drawprobarrow}[4][]{% Draws a (probability) arrow.
+\draw[prob arrow] (#2) -- node[sloped, midway, below, #1] {$#3$} (#4);
+}
+\newcommand{\drawlegendsymbol}{% Draws the symbol for a legend entry.
+\draw[prob arrow] (0,0) -- +(10pt, 6pt);
+}
+\newcommand{\legendsymbol}[1]{% Creates the legend symbol.
+\begin{tikzpicture}
+ \ifnum#1=0
+ \drawlegendsymbol
+ \else
+ \semiopaque{\drawlegendsymbol}
+ \fi
+\end{tikzpicture}
+}
\begin{document}
-\begin{tikzpicture}[-stealth, line width=2pt]
- \matrix[nodes={draw, fill=yellow!10, thin, circle, inner sep=0.6ex, minimum size=5ex}, row sep=1.5cm, column sep=0.1cm]
- {
- \node (C1234) {\pcauset{1,2,3,4}};
- & \node (C1243) {\pcauset{1,2,4,3}};
- & \node[fill=yellow!20] (C1423) {\pcauset{1,4,2,3}};
- & \node (C1324) {\pcauset{1,3,2,4}};
- & \node (C1432) {\pcauset{1,4,3,2}};
- & \node[fill=yellow!30] (C4123) {\pcauset{4,1,2,3}};
- & \node[fill=yellow!30] (C4132) {\pcauset{4,1,3,2}};
- & \node[fill=yellow!20] (C3124) {\pcauset{3,1,2,4}};
- & & \node[fill=yellow!20] (C3412) {\pcauset{3,4,1,2}};
- & \node[fill=yellow!30] (C3142) {\pcauset{3,1,4,2}};
- & \node[fill=yellow!30] (C4312) {\pcauset{4,3,1,2}};
- & \node (C2134) {\pcauset{2,1,3,4}};
- & \node (C2143) {\pcauset{2,1,4,3}};
- & \node[fill=yellow!20] (C4213) {\pcauset{4,2,1,3}};
- & \node (C3214) {\pcauset{3,2,1,4}};
- & \node (C4321) {\pcauset{4,3,2,1}};
- \\
- \\
- & & \node (C123) {\pcauset{1,2,3}};
- & & & \node (C132) {\pcauset{1,3,2}};
- & & & \node[fill=yellow!20] (C312) {\pcauset{3,1,2}};
- & & & \node (C213) {\pcauset{2,1,3}};
- & & & \node (C321) {\pcauset{3,2,1}};
- \\
- & & & & & \node (C12) {\pcauset{1,2}};
- & & & & & & \node (C21) {\pcauset{2,1}};
- \\
- & & & & & & & & \node (C1) {\pcauset{1}};
- \\
- };
- \draw (C1) -- node[below left] {$p_{12}$} (C12);
- \draw (C12) -- node[below left] {$p_{123}$} (C123);
- \draw (C123) -- node[sloped, midway, below] {$p_{1234}$} (C1234);
- \draw (C123) -- node[sloped, near end, below] {$p_{1243}$} (C1243);
- \draw (C123) -- node[sloped, midway, below] {$p_{1423}$} (C1423);
- \draw (C123) -- node[sloped, near start, below] {$p_{4123}$} (C4123);
- \draw (C12) -- node[left] {$p_{132}$} (C132);
- \draw (C132) -- node[sloped, near start, below] {$p_{1342}$} (C1423);
- \draw (C132) -- node[sloped, near end, below] {$p_{1324}$} (C1324);
- \draw (C132) -- node[sloped, midway, above] {$p_{1432}$} (C1432);
- \draw (C132) -- node[sloped, near start, below] {$p_{4132}$} (C4132);
- \draw (C12) -- node[below right] {$p_{312}$} (C312);
- \draw (C312) -- node[sloped, near end, above] {$p_{3124}$} (C3124);
- \draw (C312) -- node[sloped, near end, above] {$p_{3412}$} (C3412);
- \draw (C312) -- node[sloped, near end, above] {$p_{3142}$} (C3142);
- \draw (C312) -- node[sloped, near start, below] {$p_{4312}$} (C4312);
- \draw (C1) -- node[below right] {$p_{21}$} (C21);
- \draw (C21) -- node[below left] {$p_{231}$} (C312);
- \draw (C312) -- node[sloped, near start, below] {$p_{2341}$} (C4123);
- \draw (C312) -- node[sloped, near end, above] {$p_{2431}$} (C4132);
- \draw (C21) -- node[right] {$p_{213}$} (C213);
- \draw (C213) -- node[sloped, midway, above] {$p_{2134}$} (C2134);
- \draw (C213) -- node[sloped, near start, below] {$p_{2413}$} (C3142);
- \draw (C213) -- node[sloped, near end, below] {$p_{2143}$} (C2143);
- \draw (C213) -- node[sloped, near start, below] {$p_{4213}$} (C4213);
- \draw (C21) -- node[below right] {$p_{321}$} (C321);
- \draw (C321) -- node[sloped, near start, below] {$p_{3421}$} (C4312);
- \draw (C321) -- node[sloped, midway, above] {$p_{3241}$} (C4213);
- \draw (C321) -- node[sloped, near end, above] {$p_{3214}$} (C3214);
- \draw (C321) -- node[sloped, midway, below] {$p_{4321}$} (C4321);
+\begin{tikzpicture}[-stealth]
+ \def\ystep{2.0cm}
+ \def\xstep{0.52cm}
+ % Create nodes of all causets with 1 to 4 events:
+ \begin{scope}[nodes={draw, thin, circle, minimum size=1.02cm}]
+ \node (C1) at ( 0, 0) {\pcauset{1}};
+ \node (C12) at (-4*\xstep, 1*\ystep) {\pcauset{1,2}};
+ \node (C21) at ( 4*\xstep, 1*\ystep) {\pcauset{2,1}};
+ \foreach \perm [count=\i from 0] in {123, 132, 312, 213, 321}{%
+ \expandafter\defCevents\perm
+ \node (C\perm) at (4*\i*\xstep-8*\xstep, 2*\ystep) {\pcauset{\Ea,\Eb,\Ec}};
+ }
+ \foreach \perm [count=\i from 0] in {1234, 1243, 1423, 1324, 1432, 4123, 4132, 3124, 3412, 3142, 4312, 2134, 2143, 4213, 3214, 4321}{%
+ \expandafter\defDevents\perm
+ \node (C\perm) at (2*\i*\xstep-15*\xstep, 3.75*\ystep) {\pcauset{\Ea,\Eb,\Ec,\Ed}};
+ }
+ \end{scope}
+ % Add graph edges for expandings ...
+ % ... to the past (additionally):
+ \begin{scope}[past colour]
+ \foreach \perma/\permb in {12/213, 123/3124, 123/2134, 132/1243, 132/3142, 132/2143, 312/1423, 312/4213, 213/1324, 213/3124, 213/3214, 321/1432, 321/4132, 21/132}
+ \semiopaque{\drawprobarrow{C\perma}{}{C\permb}};
+ \end{scope}
+ % ... to anywhere (additionally, further):
+ \begin{scope}[anywhere colour]
+ \semiopaque{\drawprobarrow{C123}{}{C1324}};
+ \end{scope}
+ % ... to the future:
+ \begin{scope}[prob arrow, future colour]
+ \drawprobarrow{C1}{p_{12}}{C12}
+ \drawprobarrow{C12}{p_{123}}{C123}
+ \drawprobarrow{C123}{p_{1234}}{C1234}
+ \drawprobarrow[near end]{C123}{p_{1243}}{C1243}
+ \drawprobarrow[near end]{C123}{p_{1423}}{C1423}
+ \drawprobarrow[near start, above]{C123}{p_{4123}}{C4123}
+ \drawprobarrow[above]{C12}{p_{132}}{C132}
+ \drawprobarrow[near end]{C132}{p_{1342}}{C1423}
+ \drawprobarrow[near end]{C132}{p_{1324}}{C1324}
+ \drawprobarrow[midway, above]{C132}{p_{1432}}{C1432}
+ \drawprobarrow[near start]{C132}{p_{4132}}{C4132}
+ \drawprobarrow[near start, above]{C12}{p_{312}}{C312}
+ \drawprobarrow[near end]{C312}{p_{3124}}{C3124}
+ \drawprobarrow[near end]{C312}{p_{3412}}{C3412}
+ \drawprobarrow[near end]{C312}{p_{3142}}{C3142}
+ \drawprobarrow[near start]{C312}{p_{4312}}{C4312}
+ \drawprobarrow{C1}{p_{21}}{C21}
+ \drawprobarrow[near start, above]{C21}{p_{231}}{C312}
+ \drawprobarrow[near start]{C312}{p_{2341}}{C4123}
+ \drawprobarrow[near end]{C312}{p_{2431}}{C4132}
+ \drawprobarrow{C21}{p_{213}}{C213}
+ \drawprobarrow[above]{C213}{p_{2134}}{C2134}
+ \drawprobarrow[near start]{C213}{p_{2413}}{C3142}
+ \drawprobarrow[near end]{C213}{p_{2143}}{C2143}
+ \drawprobarrow[near end]{C213}{p_{4213}}{C4213}
+ \drawprobarrow{C21}{p_{321}}{C321}
+ \drawprobarrow[near start, above]{C321}{p_{3421}}{C4312}
+ \drawprobarrow[near end]{C321}{p_{3241}}{C4213}
+ \drawprobarrow[near end]{C321}{p_{3214}}{C3214}
+ \drawprobarrow{C321}{p_{4321}}{C4321}
+ \end{scope}
+ % Add legend:
+ \node[above left, align=left, draw, inner sep=3ex, fill=gray!05]
+ at (15*\xstep, 0)
+ {Expanding towards\\
+ \bfseries\color{future colour}\legendsymbol{0}\ the future\\
+ \bfseries\color{past colour}\legendsymbol{1}\ + the past\\
+ \bfseries\color{anywhere colour}\legendsymbol{1}\ + anywhere};
\end{tikzpicture}
\end{document}
diff --git a/graphics/pgf/contrib/causets/causets.pdf b/graphics/pgf/contrib/causets/causets.pdf
index e9a7d7add1..b6a2ccd03f 100644
--- a/graphics/pgf/contrib/causets/causets.pdf
+++ b/graphics/pgf/contrib/causets/causets.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/causets/causets.sty b/graphics/pgf/contrib/causets/causets.sty
index 1606afe7da..291537cb9e 100644
--- a/graphics/pgf/contrib/causets/causets.sty
+++ b/graphics/pgf/contrib/causets/causets.sty
@@ -1,16 +1,16 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{causets}[2022/02/07 v1.2 Package to draw causal set diagrams]
+\ProvidesPackage{causets}[2022/05/23 v1.3 Package to draw causal set diagrams]
%% Copyright 2020-2022 by C. Minz
%
% 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 in
+% of this licence or (at your option) any later version.
+% The latest version of this licence is in
% http://www.latex-project.org/lppl.txt
%
% This work has the LPPL maintenance status "maintained".
%
-% The current version of this package is 1.2.
+% The current version of this package is 1.3.
%
% The current maintainer of this work is C. Minz.
% https://github.com/c-minz
@@ -22,72 +22,62 @@
\RequirePackage{tikz}
\usepgflibrary{arrows.meta}
-%% PGF keys:
+%% PGF keys and style macros:
\def\tikzcausetsset#1{\pgfqkeys{/tikz/causets}{#1}}
\pgfkeys{/tikz/causets/.search also={/tikz}}
-% size options:
+% Size options:
\tikzcausetsset{%
+ size unit/.store in=\causetTileSize,
+ size unit/.value required,
tile size/.store in=\causetTileSize,
tile size/.value required,
- region line width/.store in=\causetRegionLine,
- region line width/.value required,
- grid line width/.store in=\causetGridLine,
- grid line width/.value required,
- event size/.store in=\causetEventSize,
- event size/.value required,
- link width/.store in=\causetLinkWidth,
- link width/.value required,
- broken link gap/.store in=\causetBrokenLinkGap,
- broken link gap/.value required,
+ text font/.store in=\causetTextFont,
+ text font/.value required,
text scale/.store in=\causetTextScale,
text scale/.value required,
+ region line width/.initial=0.07*\causetTileSize,
+ grid line width/.initial=0.04*\causetTileSize,
+ event size/.initial=0.56*\causetTileSize,
+ event outline/.initial=0.04*\causetTileSize,
+ link width/.initial=0.14*\causetTileSize,
+ broken link gap/.initial=0.42*\causetTileSize,
tiny/.value forbidden,
- small/.value forbidden,
- normal/.value forbidden,
- large/.value forbidden,
- huge/.value forbidden,
tiny/.style={%
- tile size=0.30ex,
- region line width=0.02ex,
- grid line width=0.01ex,
- event size=0.16ex,
- link width=0.05ex,
- broken link gap=0.15ex,
- text scale=0.16},
+ size unit=0.30ex,
+ text font=\tiny,
+ text scale=0.30},
+ very small/.value forbidden,
+ very small/.style={%
+ size unit=0.40ex,
+ text font=\tiny,
+ text scale=0.40},
+ small/.value forbidden,
small/.style={%
- tile size=0.60ex,
- region line width=0.04ex,
- grid line width=0.02ex,
- event size=0.32ex,
- link width=0.10ex,
- broken link gap=0.30ex,
- text scale=0.32},
+ size unit=0.60ex,
+ text font=\scriptsize,
+ text scale=0.43},
+ normal/.value forbidden,
normal/.style={%
- tile size=0.90ex,
- region line width=0.06ex,
- grid line width=0.03ex,
- event size=0.48ex,
- link width=0.15ex,
- broken link gap=0.45ex,
- text scale=0.48},
+ size unit=0.90ex,
+ text font=\footnotesize,
+ text scale=0.56},
+ large/.value forbidden,
large/.style={%
- tile size=1.35ex,
- region line width=0.09ex,
- grid line width=0.05ex,
- event size=0.75ex,
- link width=0.20ex,
- broken link gap=0.60ex,
+ size unit=1.35ex,
+ text font=\small,
text scale=0.75},
+ very large/.value forbidden,
+ very large/.style={%
+ size unit=2.025ex,
+ text font=\normalsize,
+ text scale=1.02},
+ huge/.value forbidden,
huge/.style={%
- tile size=1.80ex,
- region line width=0.12ex,
- grid line width=0.07ex,
- event size=1.00ex,
- link width=0.25ex,
- broken link gap=0.75ex,
- text scale=1.00}
+ size unit=2.70ex,
+ text font=\Large,
+ text scale=0.97}
}
-% color options:
+% Colour options:
\tikzcausetsset{%
region color/.initial=black!75,
grid color/.initial=black!25,
@@ -139,7 +129,13 @@
ulabel color=magenta,
vlabel color=magenta}
}
-% styles:
+% Causet modification options:
+\tikzcausetsset{%
+ offset/.store in=\causet@Offset,
+ every causet/.value forbidden,
+ every causet/.style={baseline=(baseline point)}
+}
+% Graphic component switches:
\newif\ifcausetsDrawPermutation
\newif\ifcausetsDrawLinks
\newif\ifcausetsBreakLinks
@@ -167,26 +163,58 @@
labeled u/.code={\causetsDrawULabelstrue},
unlabeled u/.code={\causetsDrawULabelsfalse},
labeled v/.code={\causetsDrawVLabelstrue},
- unlabeled v/.code={\causetsDrawVLabelsfalse},
+ unlabeled v/.code={\causetsDrawVLabelsfalse}
+}
+% Permutation grid styles:
+\tikzcausetsset{%
every region/.value forbidden,
- every region/.style={color=\pgfkeysvalueof{/tikz/causets/region color}, line width=\causetRegionLine},
+ every region/.style={color=\pgfkeysvalueof{/tikz/causets/region color}, line width=\pgfkeysvalueof{/tikz/causets/region line width}},
region/.style={show permutation, every region/.append style={#1}},
every grid/.value forbidden,
- every grid/.style={color=\pgfkeysvalueof{/tikz/causets/grid color}, line width=\causetGridLine, step=\causetTileSize},
+ every grid/.style={color=\pgfkeysvalueof{/tikz/causets/grid color}, line width=\pgfkeysvalueof{/tikz/causets/grid line width}, step=\causetTileSize},
grid/.style={show permutation, every grid/.append style={#1}},
every tile/.value forbidden,
- every tile/.style={color=\pgfkeysvalueof{/tikz/causets/tile color}, line width=\causetGridLine, fill},
- tiles/.style={show permutation, every tile/.append style={#1}},
+ every tile/.style={color=\pgfkeysvalueof{/tikz/causets/tile color}, line width=\pgfkeysvalueof{/tikz/causets/grid line width}, fill},
+ tiles/.style={show permutation, every tile/.append style={#1}}
+}
+% Label styles:
+\tikzcausetsset{%
+ every label base/.value forbidden,
+ every label base/.style={text opacity=1, scale=\causetTextScale, font=\causetTextFont, inner sep=0pt},
+ all labels/.style={every label base/.append style={#1}},
+ at/.initial=center,
+ every label/.value forbidden,
+ every label/.style={every label base, color=\pgfkeysvalueof{/tikz/causets/label color}, below left, at=south west},
+ labels/.style={show labels, every label/.append style={#1}},
+ every ulabel/.value forbidden,
+ every ulabel/.style={every label base, color=\pgfkeysvalueof{/tikz/causets/ulabel color}, right, rotate=-45, inner sep=1pt, align=left},
+ ulabels/.style={show ulabels, every ulabel/.append style={#1}},
+ every vlabel/.value forbidden,
+ every vlabel/.style={every label base, color=\pgfkeysvalueof{/tikz/causets/vlabel color}, left, rotate=45, inner sep=1pt, align=right},
+ vlabels/.style={show vlabels, every vlabel/.append style={#1}},
+ every replaced label/.value forbidden,
+ every replaced label/.style={every label},
+ replaced labels/.style={every replaced label/.append style={#1}}
+}
+% Event styles:
+\tikzcausetsset{%
every event/.value forbidden,
- every event/.style={color=\pgfkeysvalueof{/tikz/causets/event color}, circle, fill, inner sep=0pt, minimum size=\causetEventSize},
+ every event/.style={color=\pgfkeysvalueof{/tikz/causets/event color}, circle, fill, inner sep=0pt, minimum size=\pgfkeysvalueof{/tikz/causets/event size}, line width=\pgfkeysvalueof{/tikz/causets/event outline}},
events/.value required,
events/.style={every event/.append style={#1}},
+ every replaced event/.value forbidden,
+ every replaced event/.style={every label base, circle, minimum size=\pgfkeysvalueof{/tikz/causets/event size}},
+ replaced events/.value required,
+ replaced events/.style={every replaced event/.append style={#1}}
+}
+% Link styles:
+\tikzcausetsset{%
Link Start/.tip={},
Link Pause/.tip={Triangle Cap[] . Fast Triangle[] . Fast Triangle[]},
Link Resume/.tip={Triangle Cap[reversed] . Fast Triangle[reversed] . Fast Triangle[reversed]},
Link End/.tip={},
every link/.value forbidden,
- every link/.style={color=\pgfkeysvalueof{/tikz/causets/link color}, line width=\causetLinkWidth, {Link Start[]}-{Link End[]}},
+ every link/.style={color=\pgfkeysvalueof{/tikz/causets/link color}, line width=\pgfkeysvalueof{/tikz/causets/link width}, {Link Start[]}-{Link End[]}},
links/.style={show links, every link/.append style={#1}},
link starts/.value required,
link starts/.style={Link Start/.tip={#1}},
@@ -199,135 +227,129 @@
cap links/.value forbidden,
cap links/.style={link starts={Triangle Cap[reversed]}, link ends={Triangle Cap[]}},
arrow links/.value forbidden,
- arrow links/.style={link ends={Stealth[round, open, length=4*\causetLinkWidth, line width=\causetLinkWidth/3]}},
+ arrow links/.style={link ends={Stealth[round, open, length=4*\pgfkeysvalueof{/tikz/causets/link width}, line width=\pgfkeysvalueof{/tikz/causets/link width}/3]}},
every spatial link/.value forbidden,
every spatial link/.style={every link, color=\pgfkeysvalueof{/tikz/causets/spatial link color}, dashed},
- spatial links/.style={show spatial links, every spatial link/.append style={#1}},
- every label base/.value forbidden,
- every label base/.style={text opacity=1.0, scale=\causetTextScale, inner sep=0.5*\causetTextScale ex},
- all labels/.style={every label base/.append style={#1}},
- every label/.value forbidden,
- every label/.style={every label base, color=\pgfkeysvalueof{/tikz/causets/label color}, below left},
- labels/.style={show labels, every label/.append style={#1}},
- every ulabel/.value forbidden,
- every ulabel/.style={every label base, color=\pgfkeysvalueof{/tikz/causets/ulabel color}, right, rotate=-45, align=left},
- ulabels/.style={show ulabels, every ulabel/.append style={#1}},
- every vlabel/.value forbidden,
- every vlabel/.style={every label base, color=\pgfkeysvalueof{/tikz/causets/vlabel color}, left, rotate=45, align=right},
- vlabels/.style={show vlabels, every vlabel/.append style={#1}},
- every causet/.value forbidden,
- every causet/.style={baseline=-0.707*\causetTileSize}
+ spatial links/.style={show spatial links, every spatial link/.append style={#1}}
}
-%% delare and execute options:
-\tikzcausetsset{normal}
+%% Package options:
+\tikzcausetsset{normal, offset=0}
\causetsDrawLinkstrue
\causetsBreakLinkstrue
\causetsDrawULabelstrue
\causetsDrawVLabelstrue
\DeclareOption{tiny}{\tikzcausetsset{tiny}}
+\DeclareOption{smaller}{\tikzcausetsset{very small}}
\DeclareOption{small}{\tikzcausetsset{small}}
\DeclareOption{large}{\tikzcausetsset{large}}
+\DeclareOption{larger}{\tikzcausetsset{very large}}
\DeclareOption{huge}{\tikzcausetsset{huge}}
\DeclareOption{gray}{\tikzcausetsset{gray colors}}
\DeclareOption{black}{\tikzcausetsset{black colors}}
\DeclareOption{blue}{\tikzcausetsset{blue colors}}
\DeclareOption{neon}{\tikzcausetsset{neon colors}}
-\DeclareOption{gray colors}{\tikzcausetsset{gray colors}}
-\DeclareOption{black colors}{\tikzcausetsset{black colors}}
-\DeclareOption{blue colors}{\tikzcausetsset{blue colors}}
-\DeclareOption{neon colors}{\tikzcausetsset{neon colors}}
\DeclareOption{linked}{\causetsDrawLinkstrue}
\DeclareOption{unlinked}{\causetsDrawLinksfalse}
-\DeclareOption{cap linked}{\tikzcausetsset{cap links}}
-\DeclareOption{arrow linked}{\tikzcausetsset{arrow links}}
-\DeclareOption{brokenly linked}{\causetsBreakLinkstrue}
-\DeclareOption{continuously linked}{\causetsBreakLinksfalse}
-\DeclareOption{spatially linked}{\causetsDrawSpatialLinkstrue}
-\DeclareOption{spatially unlinked}{\causetsDrawSpatialLinksfalse}
+\DeclareOption{caps}{\tikzcausetsset{cap links}}
+\DeclareOption{arrows}{\tikzcausetsset{arrow links}}
+\DeclareOption{continuous}{\causetsBreakLinksfalse}
+\DeclareOption{spatial}{\causetsDrawSpatialLinkstrue}
\DeclareOption{permutation}{\causetsDrawPermutationtrue}
\DeclareOption{labeled}{\causetsDrawLabelstrue}
\DeclareOption{unlabeled}{\causetsDrawLabelsfalse}
-\DeclareOption{labeled u}{\causetsDrawULabelstrue}
-\DeclareOption{unlabeled u}{\causetsDrawULabelsfalse}
-\DeclareOption{labeled v}{\causetsDrawVLabelstrue}
-\DeclareOption{unlabeled v}{\causetsDrawVLabelsfalse}
+\DeclareOption{ulabeled}{\causetsDrawULabelstrue}
+\DeclareOption{uunlabeled}{\causetsDrawULabelsfalse}
+\DeclareOption{vlabeled}{\causetsDrawVLabelstrue}
+\DeclareOption{vunlabeled}{\causetsDrawVLabelsfalse}
\DeclareOption*{\PackageWarning{causets}{The package causets does not support the option: \CurrentOption}}
\ProcessOptions\relax
-%% functions:
-% variables:
-\newcounter{causet@i}
-\newcounter{causet@j}
+%% Package functions:
\newif\ifcauset@ItemFoundInList
-% count the number of events:
-\newcommand*{\causets@readCausetSize}[1]{%
-\setcounter{causet@i}{0}%
-\foreach \causet@p in {#1}{%
- \stepcounter{causet@i}%
-}%
-\pgfmathsetmacro\causet@N{\value{causet@i}}%
+\newcommand*{\causets@prepareCauset}[1]{%
+% Count the number of events (\causet@N), find the minimal value in the list argument (\causet@Start), and define baseline point.
+\foreach \causet@E@i/\causet@Label/\causet@Text [count=\causet@i] in {#1}{%
+ \ifnum\causet@i=1
+ \pgfmathparse{int(\causet@E@i)}
+ \else
+ \pgfmathparse{int(min(\causet@Start, \causet@E@i))}
+ \fi
+ \xdef\causet@Start{\pgfmathresult}
+ \xdef\causet@N{\causet@i}
+}
+\pgfmathsetmacro\causet@Start{int(\causet@Start + \causet@Offset)}
+\coordinate (baseline point) at (0, -0.707*\causetTileSize);
+}
+
+\newcommand*{\causets@drawEvent}[2][every event]{%
+% Draws the event node for \causet@E@i. By default the event style (optional argument #1) is that of every event. The text of the node is #2.
+\pgfmathsetmacro\causet@u{\causet@E@i - \causet@Start + 0.5}
+\pgfmathsetmacro\causet@v{\causet@i - 0.5}
+\node[causets/.cd, #1] (E\causet@E@i)
+ at ( \causet@u * \causetTileSize, \causet@v * \causetTileSize )
+ {#2};
}
-% define and draw events as (E#):
\newcommand*{\causets@drawEvents}[1]{%
-\setcounter{causet@i}{0}
-\foreach \causet@p in {#1}{%
- \stepcounter{causet@i}
- \pgfmathsetmacro\causet@e@U{\causet@p - 1.0}
- \pgfmathsetmacro\causet@e@V{\value{causet@i} - 1.0}
+% Draws a permutation tile and defines and draws an event node (E#) on top of the tile, for each event number # in the list argument.
+\foreach \causet@E@i/\causet@Label/\causet@Text [count=\causet@i] in {#1}{%
+ \pgfmathsetmacro\causet@E@i{int(\causet@E@i + \causet@Offset)}
+ \pgfmathsetmacro\causet@u{\causet@E@i - \causet@Start}
+ \pgfmathsetmacro\causet@v{\causet@i - 1.0}
\ifcausetsDrawPermutation
- \path[causets/.cd, every tile] ( \causet@e@U * \causetTileSize, \causet@e@V * \causetTileSize )
+ \path[causets/.cd, every tile]
+ ( \causet@u * \causetTileSize, \causet@v * \causetTileSize )
rectangle +( \causetTileSize, \causetTileSize );
\fi
- \pgfmathsetmacro\causet@e@U{\causet@p - 0.5}
- \pgfmathsetmacro\causet@e@V{\value{causet@i} - 0.5}
- \node[causets/.cd, every event] (E\causet@p)
- at ( \causet@e@U * \causetTileSize, \causet@e@V * \causetTileSize )
- {};
+ \ifx\causet@Text\causet@Label
+ \causets@drawEvent{}
+ \else
+ \causets@drawEvent[every replaced event]{\causet@Text}
+ \fi
}
}
-% draw the permutation and the null coordinate labels:
\newcommand*{\causets@drawPermutation}[1]{%
+% Draws the permutation grid and adds the u- and v-coordinate labels.
\ifcausetsDrawPermutation
\draw[causets/.cd, every grid] ( 0, 0 )
grid ( \causet@N * \causetTileSize, \causet@N * \causetTileSize );
\draw[causets/.cd, every region] ( 0, 0 )
rectangle ( \causet@N * \causetTileSize, \causet@N * \causetTileSize );
- \setcounter{causet@i}{0}
- \foreach \causet@p in {#1}{%
- \stepcounter{causet@i}
+ \foreach \causet@E@i/\causet@Label/\causet@Text [count=\causet@i] in {#1}{%
+ \pgfmathsetmacro\causet@E@i{int(\causet@E@i + \causet@Offset)}
\ifcausetsDrawULabels
- \node[causets/.cd, every ulabel] (EUL\causet@p)
- at ( \value{causet@i} * \causetTileSize - 0.5 * \causetTileSize, 0 )
- {\thecauset@i};
+ \pgfmathsetmacro\causet@u{int(\causet@i + \causet@Start - 1)}
+ \node[causets/.cd, every ulabel] (EUL\causet@E@i)
+ at ( \causet@i * \causetTileSize - 0.5 * \causetTileSize, 0 )
+ {\causet@u};
\fi
\ifcausetsDrawVLabels
- \node[causets/.cd, every vlabel] (EVL\causet@p)
- at ( 0, \value{causet@i} * \causetTileSize - 0.5 * \causetTileSize )
- {\causet@p};
+ \node[causets/.cd, every vlabel] (EVL\causet@E@i)
+ at ( 0, \causet@i * \causetTileSize - 0.5 * \causetTileSize )
+ {\causet@E@i};
\fi
}
\fi
}
-% draw the spatial links from the permutation:
\newcommand*{\causets@drawSpatialLinks}[1]{%
+% Draws the spatial links between the events (only for \drawpcauset and \drawrcauset).
\ifcausetsDrawSpatialLinks
- \setcounter{causet@i}{0}
- \foreach \causet@p in {#1}{%
- \stepcounter{causet@i}
- \edef\causet@qBound{0}
- \setcounter{causet@j}{0}
- \foreach \causet@q in {#1}{%
- \stepcounter{causet@j}
- \ifnum\value{causet@j}>\value{causet@i}
- \ifnum\causet@q>\causet@qBound
- \ifnum\causet@p>\causet@q
- \draw[causets/.cd, every spatial link] (E\causet@q) -- (E\causet@p);
- \xdef\causet@qBound{\causet@q}
+ \foreach \causet@E@i/\causet@Label/\causet@Text [count=\causet@i] in {#1}{%
+ \pgfmathsetmacro\causet@E@i{int(\causet@E@i + \causet@Offset)}
+ % \causet@Bound stores the lower bound to find spatially linked events.
+ \edef\causet@Bound{\causet@Offset}
+ \foreach \causet@E@j/\causet@Label/\causet@Text [count=\causet@j] in {#1}{%
+ \ifnum\causet@j>\causet@i
+ \pgfmathsetmacro\causet@E@j{int(\causet@E@j + \causet@Offset)}
+ \ifnum\causet@E@j>\causet@Bound
+ \ifnum\causet@E@i>\causet@E@j
+ % Add spatial link and remember new lower bound:
+ \draw[causets/.cd, every spatial link] (E\causet@E@j) -- (E\causet@E@i);
+ \xdef\causet@Bound{\causet@E@j}
\fi
\fi
\fi
@@ -336,37 +358,51 @@
\fi
}
-% draw event labels:
+\newcommand*{\causets@drawEventLabel}[1][every label]{%
+% Draws the event label for \causet@E@i (shifted by \causet@Offset). By default the label style is assumed that of a standard event label.
+\pgfmathsetmacro\causet@E@i{int(\causet@E@i + \causet@Offset)}
+\node[causets/.cd, #1] (EL\causet@E@i)
+ at (E\causet@E@i.\pgfkeysvalueof{/tikz/causets/at}) {\causet@Label};
+}
+
\newcommand*{\causets@drawEventLabels}[1]{%
-\ifcausetsDrawLabels
- \foreach \causet@p in {#1}{%
- \node[causets/.cd, every label] (EL\causet@p)
- at (E\causet@p) {\causet@p};
- }
-\fi
+% Adds event labels to the events.
+\foreach \causet@E@i/\causet@Label/\causet@Text in {#1}{%
+ \ifx\causet@E@i\causet@Label
+ \ifcausetsDrawLabels
+ \causets@drawEventLabel
+ \fi
+ \else
+ \ifx\causet@Label\empty
+ \relax% Skip empty labels
+ \else
+ \causets@drawEventLabel[every replaced label]
+ \fi
+ \fi
+}
}
-% draw a causet from a permutation:
\newcommand*{\drawpcauset}[1]{%
-\causets@readCausetSize{#1}
+% Draws a causet from a permutation.
+\causets@prepareCauset{#1}
\begin{scope}[rotate=45]
\begin{scope}[xshift=-\causet@N * \causetTileSize / 2,
yshift=-\causet@N * \causetTileSize / 2]
\causets@drawEvents{#1}
\causets@drawPermutation{#1}
\ifcausetsDrawLinks
- \setcounter{causet@i}{0}
- \foreach \causet@p in {#1}{%
- \stepcounter{causet@i}
- \pgfmathsetmacro\causet@qBound{int(\causet@N + 1)}
- \setcounter{causet@j}{0}
- \foreach \causet@q in {#1}{%
- \stepcounter{causet@j}
- \ifnum\value{causet@j}>\value{causet@i}
- \ifnum\causet@q<\causet@qBound
- \ifnum\causet@p<\causet@q
- \draw[causets/.cd, every link] (E\causet@p) -- (E\causet@q);
- \xdef\causet@qBound{\causet@q}
+ \foreach \causet@E@i/\causet@Label/\causet@Text [count=\causet@i] in {#1}{%
+ \pgfmathsetmacro\causet@E@i{int(\causet@E@i + \causet@Offset)}
+ % \causet@Bound stores the upper bound to find linked events.
+ \pgfmathsetmacro\causet@Bound{int(\causet@N + \causet@Start)}
+ \foreach \causet@E@j/\causet@Label/\causet@Text [count=\causet@j] in {#1}{%
+ \ifnum\causet@j>\causet@i
+ \pgfmathsetmacro\causet@E@j{int(\causet@E@j + \causet@Offset)}
+ \ifnum\causet@E@j<\causet@Bound
+ \ifnum\causet@E@i<\causet@E@j
+ % Add link and remember new upper bound:
+ \draw[causets/.cd, every link] (E\causet@E@i) -- (E\causet@E@j);
+ \xdef\causet@Bound{\causet@E@j}
\fi
\fi
\fi
@@ -379,9 +415,9 @@
\end{scope}
}
-% draw a causet from a permutation and a link-pair list:
\newcommand*{\drawcauset}[2]{%
-\causets@readCausetSize{#1}
+% Draws a causet from a permutation and a link-pair list.
+\causets@prepareCauset{#1}
\begin{scope}[rotate=45]
\begin{scope}[xshift=-\causet@N * \causetTileSize / 2,
yshift=-\causet@N * \causetTileSize / 2]
@@ -389,55 +425,67 @@
\causets@drawPermutation{#1}
\ifcausetsDrawLinks
\ifcausetsBreakLinks
+ % Broken links are allowed, so test every link if it crosses over an unlinked event:
\foreach \causet@From/\causet@To in {#2}{%
- \pgfmathsetmacro\causet@dU{int(\causet@To) - int(\causet@From)}
- \setcounter{causet@i}{0}
- \foreach \causet@p in {#1}{%
- \ifnum\causet@p=\causet@To
- \pgfmathparse{int(\value{causet@i})}
- \xdef\causet@dV{\pgfmathresult}
- \fi
- \ifnum\value{causet@i}>0
- \stepcounter{causet@i}
+ % In this function, \causet@u and \causet@v store the link distance in the u- and in the v-direction, respectively. Since these are coordinate differences, they are computed without adding the offset.
+ \pgfmathsetmacro\causet@u{int(\causet@To) - int(\causet@From)}
+ \foreach \causet@E@i/\causet@Label/\causet@Text [count=\causet@i] in {#1}{%
+ \ifnum\causet@E@i=\causet@From
+ \xdef\causet@v{\causet@i}
\fi
- \ifnum\causet@p=\causet@From
- \stepcounter{causet@i}
+ \ifnum\causet@E@i=\causet@To
+ \pgfmathparse{int(\causet@i - \causet@v)}
+ \xdef\causet@v{\pgfmathresult}
+ \breakforeach
\fi
}
- \def\causet@LastBreak{0}
- \setcounter{causet@i}{0}
- \foreach \causet@p in {#1}{%
- \ifnum\causet@p=\causet@To
- \setcounter{causet@i}{0}
+ % Now add offset to events:
+ \pgfmathsetmacro\causet@From{int(\causet@From + \causet@Offset)}
+ \pgfmathsetmacro\causet@To{int(\causet@To + \causet@Offset)}
+ % In this function, \causet@E@j stores the last breaking point and \causet@j the index of \causet@From.
+ \pgfmathsetmacro\causet@E@j{int(\causet@From - 1)}
+ \edef\causet@j{0}
+ \foreach \causet@E@i/\causet@Label/\causet@Text [count=\causet@i] in {#1}{%
+ \pgfmathsetmacro\causet@E@i{int(\causet@E@i + \causet@Offset)}
+ \ifnum\causet@E@i=\causet@To
+ \edef\causet@j{0}
+ \breakforeach
\fi
- \pgfmathparse{and(\value{causet@i} > 0, int((\causet@p - \causet@From) * \causet@dV) == int(\causet@dU * \value{causet@i}))}
- \ifnum\pgfmathresult=1
- \ifnum\causet@LastBreak=0
- \draw[causets/.cd, every link, {Link Start}-{Link Pause}, shorten >=\causetBrokenLinkGap]
- (E\causet@From) -- (E\causet@p);
- \else
- \draw[causets/.cd, every link, {Link Resume}-{Link Pause}, shorten <=\causetBrokenLinkGap, shorten >=\causetBrokenLinkGap]
- (E\causet@LastBreak) -- (E\causet@p);
+ \ifnum\causet@j>0
+ % If the u-/v-coordinate ratio is the same, the event \causet@E@i falls along the link and the link needs to break. The ratios are compared via cross-multiplication, which is faster and does not cause rounding errors:
+ \pgfmathequal{int((\causet@E@i - \causet@From) * \causet@v)}{int(\causet@u * (\causet@i - \causet@j)))}
+ \ifnum\pgfmathresult=1
+ \ifnum\causet@E@j<\causet@From
+ % Link is crossing over another event, so draw the link up to the (first) breaking point:
+ \draw[causets/.cd, every link, {Link Start}-{Link Pause}, shorten >=\pgfkeysvalueof{/tikz/causets/broken link gap}]
+ (E\causet@From) -- (E\causet@E@i);
+ \else
+ % Link is crossing over yet another event, so continue from last breaking point to next breaking point:
+ \draw[causets/.cd, every link, {Link Resume}-{Link Pause}, shorten <=\pgfkeysvalueof{/tikz/causets/broken link gap}, shorten >=\pgfkeysvalueof{/tikz/causets/broken link gap}]
+ (E\causet@E@j) -- (E\causet@E@i);
+ \fi
+ \xdef\causet@E@j{\causet@E@i}
\fi
- \xdef\causet@LastBreak{\causet@p}
- \fi
- \ifnum\value{causet@i}>0
- \stepcounter{causet@i}
\fi
- \ifnum\causet@p=\causet@From
- \setcounter{causet@i}{1}
+ \ifnum\causet@E@i=\causet@From
+ \xdef\causet@j{\causet@i}
\fi
}
- \ifnum\causet@LastBreak>0
- \draw[causets/.cd, every link, {Link Resume}-{Link End}, shorten <=\causetBrokenLinkGap]
- (E\causet@LastBreak) -- (E\causet@To);
+ \ifnum\causet@E@j>\causet@From
+ % Link did cross over another event, so finish the link from last breaking point to final event:
+ \draw[causets/.cd, every link, {Link Resume}-{Link End}, shorten <=\pgfkeysvalueof{/tikz/causets/broken link gap}]
+ (E\causet@E@j) -- (E\causet@To);
\else
+ % Link does not cross over another event, so just draw it:
\draw[causets/.cd, every link]
(E\causet@From) -- (E\causet@To);
\fi
}
\else
+ % Broken links are not allowed, so just draw the links:
\foreach \causet@From/\causet@To in {#2}{%
+ \pgfmathsetmacro\causet@From{int(\causet@From + \causet@Offset)}
+ \pgfmathsetmacro\causet@To{int(\causet@To + \causet@Offset)}
\draw[causets/.cd, every link] (E\causet@From) -- (E\causet@To);
}
\fi
@@ -447,38 +495,40 @@
\end{scope}
}
-% draw a causet from a permutation removes links given in a link-pair list:
\newcommand*{\drawrcauset}[2]{%
-\causets@readCausetSize{#1}
+% Draws a causet from a permutation and ignoring links given in the second list argument (of link-pairs).
+\causets@prepareCauset{#1}
\begin{scope}[rotate=45]
\begin{scope}[xshift=-\causet@N * \causetTileSize / 2,
yshift=-\causet@N * \causetTileSize / 2]
\causets@drawEvents{#1}
\causets@drawPermutation{#1}
\ifcausetsDrawLinks
- \setcounter{causet@i}{0}
- \foreach \causet@p in {#1}{%
- \stepcounter{causet@i}
- \pgfmathsetmacro\causet@qBound{int(\causet@N + 1)}
- \setcounter{causet@j}{0}
- \foreach \causet@q in {#1}{
- \stepcounter{causet@j}
- \ifnum\value{causet@j}>\value{causet@i}
- \ifnum\causet@q<\causet@qBound
- \ifnum\causet@p<\causet@q
+ \foreach \causet@E@i/\causet@Label/\causet@Text [count=\causet@i] in {#1}{%
+ \pgfmathsetmacro\causet@E@i{int(\causet@E@i + \causet@Offset)}
+ % \causet@Bound stores the upper bound to find linked events.
+ \pgfmathsetmacro\causet@Bound{int(\causet@N + \causet@Start)}
+ \foreach \causet@E@j/\causet@Label/\causet@Text [count=\causet@j] in {#1}{%
+ \ifnum\causet@j>\causet@i
+ \pgfmathsetmacro\causet@E@j{int(\causet@E@j + \causet@Offset)}
+ \ifnum\causet@E@j<\causet@Bound
+ \ifnum\causet@E@i<\causet@E@j
+ % Check second list argument if the link has to be ignored:
\global\causet@ItemFoundInListfalse
\foreach \causet@From/\causet@To in {#2}{%
- \pgfmathparse{and(int(\causet@From) == int(\causet@p), int(\causet@To) == int(\causet@q))}
+ \pgfmathparse{and(int(\causet@From + \causet@Offset) == int(\causet@E@i), int(\causet@To + \causet@Offset) == int(\causet@E@j))}
\ifnum\pgfmathresult=1
\global\causet@ItemFoundInListtrue
\fi
}
\ifcauset@ItemFoundInList
- % skip link
+ \relax% Skip link as it is included in the second argument.
\else
- \draw[causets/.cd, every link] (E\causet@p) -- (E\causet@q);
+ % Draw link as it is not included in the second argument:
+ \draw[causets/.cd, every link] (E\causet@E@i) -- (E\causet@E@j);
\fi
- \xdef\causet@qBound{\causet@q}
+ % Remember new upper bound:
+ \xdef\causet@Bound{\causet@E@j}
\fi
\fi
\fi
@@ -486,8 +536,11 @@
}
\fi
\causets@drawSpatialLinks{#1}
+ % Add omitted links as spatial links:
\ifcausetsDrawSpatialLinks
\foreach \causet@From/\causet@To in {#2}{%
+ \pgfmathsetmacro\causet@From{int(\causet@From + \causet@Offset)}
+ \pgfmathsetmacro\causet@To{int(\causet@To + \causet@Offset)}
\draw[causets/.cd, every spatial link] (E\causet@From) -- (E\causet@To);
}
\fi
@@ -496,53 +549,51 @@
\end{scope}
}
-% insert a TikZ picture with a causet from a permutation:
\newcommand*{\pcauset}[2][]{%
+% Inserts a TikZ picture with a causet, created from a permutation.
\begin{tikzpicture}[causets/.cd, every causet, #1]\drawpcauset{#2}\end{tikzpicture}}
-% insert a TikZ picture with a causet from a permutation and a link-pair list:
\newcommand*{\causet}[3][]{%
+% Inserts a TikZ picture with a causet, created from a permutation and a link-pair list.
\begin{tikzpicture}[causets/.cd, every causet, #1]\drawcauset{#2}{#3}\end{tikzpicture}}
-% insert a TikZ picture with a causet from a permutation removes links given
-% in a link-pair list:
\newcommand*{\rcauset}[3][]{%
+% Inserts a TikZ picture with a causet, created from a permutation and a link-pair list of links to remove.
\begin{tikzpicture}[causets/.cd, every causet, #1]\drawrcauset{#2}{#3}\end{tikzpicture}}
-%% short-hand functions:
+%% Short-hand and pre-computed causet functions:
\providecommand{\causetspath}{.}
\newcommand*{\causetfile}[2][]{%
\includegraphics[#1]{\causetspath/#2}}
\newcommand*{\pcausetP}[2][]{%
-{\causetsDrawPermutationtrue\pcauset[#1]{#2}}}
+{\causetsDrawPermutationtrue\causetsDrawLabelsfalse\pcauset[#1]{#2}}}
\newcommand*{\pcausetL}[2][]{%
-{\causetsDrawLabelstrue\pcauset[#1]{#2}}}
+{\causetsDrawPermutationfalse\causetsDrawLabelstrue\pcauset[#1]{#2}}}
\newcommand*{\pcausetX}[2][]{%
-{\causetsDrawPermutationtrue\pcausetL[#1]{#2}}}
+{\causetsDrawPermutationtrue\causetsDrawLabelstrue\pcauset[#1]{#2}}}
\newcommand*{\causetP}[3][]{%
-{\causetsDrawPermutationtrue\causet[#1]{#2}{#3}}}
+{\causetsDrawPermutationtrue\causetsDrawLabelsfalse\causet[#1]{#2}{#3}}}
\newcommand*{\causetL}[3][]{%
-{\causetsDrawLabelstrue\causet[#1]{#2}{#3}}}
+{\causetsDrawPermutationfalse\causetsDrawLabelstrue\causet[#1]{#2}{#3}}}
\newcommand*{\causetX}[3][]{%
-{\causetsDrawPermutationtrue\causetL[#1]{#2}{#3}}}
+{\causetsDrawPermutationtrue\causetsDrawLabelstrue\causet[#1]{#2}{#3}}}
\newcommand*{\rcausetP}[3][]{%
-{\causetsDrawPermutationtrue\rcauset[#1]{#2}{#3}}}
+{\causetsDrawPermutationtrue\causetsDrawLabelsfalse\rcauset[#1]{#2}{#3}}}
\newcommand*{\rcausetL}[3][]{%
-{\causetsDrawLabelstrue\rcauset[#1]{#2}{#3}}}
+{\causetsDrawPermutationfalse\causetsDrawLabelstrue\rcauset[#1]{#2}{#3}}}
\newcommand*{\rcausetX}[3][]{%
-{\causetsDrawPermutationtrue\rcausetL[#1]{#2}{#3}}}
+{\causetsDrawPermutationtrue\causetsDrawLabelstrue\rcauset[#1]{#2}{#3}}}
-%% some standard causets:
\newcommand*{\causetFence}[2][]{%
\ifcase#2%
\or%=1
diff --git a/graphics/pgf/contrib/causets/causets.tex b/graphics/pgf/contrib/causets/causets.tex
index 20e41b656e..dafa688cb8 100644
--- a/graphics/pgf/contrib/causets/causets.tex
+++ b/graphics/pgf/contrib/causets/causets.tex
@@ -16,9 +16,9 @@
\pagestyle{fancy}
\fancypagestyle{plain}{\fancyhf{}\renewcommand{\headrulewidth}{0.0pt}}
\setlength{\headheight}{16.0pt}
-\fancyhead[L]{\sffamily causets - Documentation}
+\fancyhead[L]{}
\fancyhead[C]{}
-\fancyhead[R]{\sffamily \nouppercase{\rightmark}}
+\fancyhead[R]{\sffamily causets package manual}
\renewcommand{\headrulewidth}{0.2pt}
\renewcommand{\footrulewidth}{0.0pt}
\fancyfoot[L]{}
@@ -29,7 +29,7 @@
bookmarksopen = true, %
bookmarksopenlevel = 0, %
bookmarksnumbered = true, %
- pdftitle = {{Package Documentation: causets}}, %
+ pdftitle = {{Package documentation: causets}}, %
pdfauthor = {{Christoph Minz}}, %
pdfstartpage = 1, %
pdfstartview = {FitH}, %
@@ -49,19 +49,19 @@
\usepackage{longtable} % tables spanning pages
\usepackage{multirow} % spanning multiple rows
\usepackage{listings} % code environments
-\lstset{
+\lstset{
backgroundcolor=\color{yellow!50!black!10},
basicstyle=\ttfamily\footnotesize,
breakatwhitespace=true,
breaklines=true,
captionpos=b,
- commentstyle=\color{green!25!gray},
+ commentstyle=\color{green!50!black!50!gray},
keepspaces=true,
- keywordstyle=\color{black},
+ keywordstyle={},
language=TeX,
numbers=left,
numbersep=5pt,
- numberstyle=\tiny\color{gray},
+ numberstyle=\scriptsize\color{black!35},
rulecolor=\color{black},
showspaces=false,
showstringspaces=false,
@@ -73,13 +73,19 @@
\usepackage{amsmath}
\usepackage{causets}
-\renewcommand{\causetspath}{.}
-\newcommand*{\valuePH}{{\small\itshape$\langle$value$\rangle$}} % placeholder
+\newcommand*{\PH}[1][value]{{\small\itshape$\langle$#1$\rangle$}} % placeholder
-\title{{\small package}\\[0.5cm] \huge causets \\[0.2cm]{\small version 1.2}\\[0.5cm]}
+\usetikzlibrary{tikzmark}
+\newcommand*{\versioncauset}[3][-1.03cm]{%
+\tikzmark{#2}%
+\tikz[remember picture, overlay]%
+ \path (pic cs:#2) -- ++(-1cm, 0.5em) -- ++(#1, 0) node {#3};%
+}% version causet
+
+\title{{\small package}\\[0.5cm] \huge causets \\[0.2cm]{\small version 1.3\\[0.5cm]}}
\author{Christoph Minz}
-\date{February 07, 2022}
+\date{May 23, 2022}
\begin{document}
@@ -88,198 +94,230 @@
\begin{center}
$\displaystyle
\tikzcausetsset{large}
- \left\{
- \pcauset{3,2,1},
- \pcauset{3,1,2},
- \pcauset{2,1,3},
- \pcauset{1,3,2},
- \pcauset{1,2,3}
- \right\}
+ \left\{
+ \pcauset{3,2,1},
+ \pcauset{3,1,2},
+ \pcauset{2,1,3},
+ \pcauset{1,3,2},
+ \pcauset{1,2,3}
+ \right\}
$
\\
$\displaystyle
\tikzcausetsset{large}
\causetsDrawLabelstrue
- \left\{
- \pcauset{3,2,1},
- \pcauset{4,5,3,1,2},
- \pcauset{2,1,3},
- \pcauset{1,3,2},
- \pcauset{1,2,3}
- \right\}
+ \left\{
+ \pcauset{3,2,1},
+ \pcauset{3,1,2},
+ \pcauset{2,1,3},
+ \pcauset{1,3,2},
+ \pcauset{1,2,3}
+ \right\}
$
\\
$\displaystyle
\tikzcausetsset{large}
\causetsDrawPermutationtrue
- \left\{
- \pcauset{3,2,1},
- \pcauset{3,1,2},
- \pcauset{2,1,3},
- \pcauset{1,3,2},
- \pcauset{1,2,3}
- \right\}
+ \left\{
+ \pcauset{3,2,1},
+ \pcauset{3,1,2},
+ \pcauset{2,1,3},
+ \pcauset{1,3,2},
+ \pcauset{1,2,3}
+ \right\}
$
\end{center}
\vspace{2em}
-\section*{What Is the Purpose of This Package?}
+\section*{What is the purpose of this package?}
\label{sec:Purpose}
-Causal set theory is a proposed framework for quantum gravity.
-Causal sets (\textbf{causets} for short) are locally finite, partially ordered sets.
-Though one can describe them mathematically as a set with a partial order, it is usually much simpler to just draw (Hasse) diagrams.
+Causal set theory is a proposed framework for quantum gravity.
+Causal sets (\textbf{causets} for short) are locally finite, partially ordered sets.
+Though one can describe them mathematically as a set with a partial order, it is usually much simpler to just draw (Hasse) diagrams.
-This package implements some simple functionality to produce such diagrams for causets by drawing them as TikZ graphics.
-The drawing algorithm makes use of the fact that every finite causet that embeds in $\smash{1 + 1}$ dimensional Minkowski spacetime can be represented by a product of two total orders (2D-orders), where one order can be the total order of the integers labeling the causet elements, while the other is a permutation of the labels\footnote{See \url{https://arxiv.org/abs/0706.0375} and \url{https://arxiv.org/abs/2011.02965} for more details on 2D-orders and causal sets.}.
-The idea is then used as a blueprint to draw diagrams for any generic (finite) causet, so that it becomes easy to draw causets and even use them in mathematical expressions.
+This package implements some simple functionality to produce such diagrams for causets by drawing them as TikZ graphics.
+The drawing algorithm makes use of the fact that every finite causet that embeds in $\smash{1 + 1}$ dimensional Minkowski spacetime can be represented by a product of two total orders (2D-orders), where one order can be the total order of the integers labelling the causet elements, while the other is a permutation of the labels\footnote{See \url{https://arxiv.org/abs/0706.0375} and \url{https://arxiv.org/abs/2011.02965} for more details on 2D-orders and causal sets.}.
+The idea is then used as a blueprint to draw diagrams for any generic (finite) causet, so that it becomes easy to draw causets and even use them in mathematical expressions.
\clearpage
-\section{Introduction - the Main Commands}
+\section{Introduction - the main commands}
\label{sec:Introduction}
-This package is built on the package \lstinline§tikz§ to draw the diagrams.
-To import the \lstinline§causets§ package into a \LaTeX\ file, write
+This package is built on the package \lstinline§tikz§ to draw the diagrams.
+To import the \lstinline§causets§ package into a \LaTeX\ file, write
\begin{lstlisting}
\usepackage{causets}
\end{lstlisting}
-in the preamble of the document.
+in the preamble of the document (this will automatically load the \lstinline§tikz§ package as well).
-For a more demonstrative introduction in this first section, I use the package options \lstinline§black§ (only black and white diagrams) and \lstinline§permutation§ (also shows the permutation),
+For the command introduction in \autoref{tab:MainCommandsExamples}, I use the package options \lstinline§black§ (only black and white diagrams) and \lstinline§permutation§ (also shows the permutation),
\begin{lstlisting}
\usepackage[black,permutation]{causets}
\end{lstlisting}
-The three main commands of this package are
+At first, let us take a brief look at the three main commands of the package, before we look into the (physical) ideas behind these three commands.
+
+The three main commands of this package are
\begin{lstlisting}
-\pcauset{..,i,..,k,..,j,..}
-\rcauset{...}{..,i/j,..}
-\causet{...}{..,i/j,..}
+\pcauset{...,i,...,k,...,j,...}
+\rcauset{...}{...,i/j,...}
+\causet{...}{...,i/j,...}
\end{lstlisting}
-The first command takes a permutation of the integers $[ 1, N ]$ (where $N$ is the cardinality of the causet).
-The permutation determines the event positions and causal structure such that events $i$ and $j$ are linked if $i < j$ and there is no $k > j$ between $i$ and $j$.
-The second command does the same, but ignores links between event pairs \lstinline§i/j§ as given in the second argument.
-The third command only uses the permutation to position the events, the links have to be explicitly specified by event pairs \lstinline§i/j§ in the second argument.
-
-Any causet that can be embedded in $1 + 1$ dimensional Minkowski spacetime can also be described by the product of two total orders (a 2D-order).
-Let the causets elements be labeled by an increasing null coordinate $u$ (pointing upwards along the right axis of the grids under the diagrams below), then the causal relation (partial order) implies a label permutation along the null coordinate $v$ (pointing upwards along the left axis of the grids under the diagrams below).
-This permutation is the input of the \lstinline§\pcauset§ command that computes the causal relation from the permutation.
-See example 1 in \autoref{tab:MainCommandsExamples}.
-\tikzcausetsset{black colors, show permutation}
+The first command takes a permutation of the integers from an interval $[ a, b ]$ (where $N = b - a + 1 \geq 0$ is the cardinality of the causet).
+The permutation determines the event positions and causal structure such that events $i$ and $j$ are linked if $i < j$ and there is no $k > j$ between $i$ and $j$ in the permutation.
+The second command does the same, but ignores links between event pairs \lstinline§i/j§ as given in the second argument.
+The third command only uses the permutation to position the events, the links have to be explicitly specified by event pairs \lstinline§i/j§ in the second argument.
+
+Any causet that can be embedded in $1 + 1$ dimensional Minkowski spacetime can also be described by the product of two total orders (a 2D-order).
+Let the causets elements be labeled by an increasing null coordinate $u$.
+In the first diagram of \autoref{tab:MainCommandsExamples}, the $u$-coordinate axis points upwards on the right hand side.
+The causal relation (partial order) implies a label permutation along the null coordinate $v$ (pointing upwards along the left axis).
+This permutation is the input of the \lstinline§\pcauset§ command that computes the causal relation from the permutation.
+See example 1 in \autoref{tab:MainCommandsExamples}.
\begin{table}[h!]
- \begin{tabular*}{\textwidth}{lp{0.72\textwidth}c}
+ \centering
+ \tikzcausetsset{black colors, show permutation}
+ \begin{tabular*}{\textwidth}{lp{0.73\textwidth}c}
\toprule
\#
- & command
- & inline output
+ & command
+ & inline output
\\\midrule
- 1
+ 1
& \lstinline§\pcauset{4,7,2,6,1,5,3}§
& \pcauset{4,7,2,6,1,5,3}
\\\midrule
- 2
+ 2
& \lstinline§\rcauset{4,7,2,6,1,5,3}{2/5}§
& \rcauset{4,7,2,6,1,5,3}{2/5}
\\\midrule
- 3
+ 3
& \lstinline§\causet{4,7,2,6,1,5,3}{1/3,1/5,2/3,2/6,4/5,4/6,4/7}§
& \causet{4,7,2,6,1,5,3}{1/3,1/5,2/3,2/6,4/5,4/6,4/7}
\\\bottomrule
\end{tabular*}
\caption{\label{tab:MainCommandsExamples} Examples for the three main commands of the package.}
\end{table}
-\tikzcausetsset{gray colors, show permutation=false}
-Every causet that does not embed in $1 + 1$ dimensional Minkowski spacetime can be made embeddable by adding links to it.
-Adding the minimal number of links yields permutations that should be used to determine the coordinates of the diagram.
-The links that have been added to obtain the permutation need to be removed from the generated causet, which is specified by link pairs \lstinline§i/j§.
-See example 2 in \autoref{tab:MainCommandsExamples}.
+Every causet that does not embed in $1 + 1$ dimensional Minkowski spacetime can be made embeddable by adding links, for which the \lstinline§\rcauset§ command is defined.
+Find an embedding causet by adding a minimal number of causal relations to the given causet.
+The so obtained, embedding causet gives a permutation as discussed before for the \lstinline§\pcauset§ causet.
+The links that have been added to obtain this permutation need to be removed from the generated causet, which is specified by link pairs \lstinline§i/j§ in the second argument.
+See example 2 in \autoref{tab:MainCommandsExamples}.
-In some situations, it might be easier to specify the list of link pairs that exist, instead of removing links.
-For this purpose, use the \lstinline§\causet§ command.
-As an example, we rewrite the example 2 by specifying all existing links as pairs, see example 3 in \autoref{tab:MainCommandsExamples}.
-Note that the \lstinline§\rcauset§ command was actually much shorter for this particular example.
-However, if the list of link pairs in the \lstinline§\rcauset§ command is very long, specifying all existing link pairs instead with the \lstinline§\causet§ yields a faster performance.
+In some situations, it might be easier to specify the list of link pairs that exist, instead of removing links.
+For this purpose, use the \lstinline§\causet§ command.
+As an example, we rewrite the example 2 by specifying all existing links as pairs, see example 3 in \autoref{tab:MainCommandsExamples}.
+Note that the \lstinline§\rcauset§ command was actually much shorter for this particular example.
+However, if the list of link pairs in the \lstinline§\rcauset§ command is very long, specifying all existing link pairs instead with the \lstinline§\causet§ yields a faster performance.
-As an example for the use in mathematical expressions, here is the code for the first set of causets on the title page:
+You may use any of the three main commands to add a causet diagram in-line with text or within a mathematical expression.
+As an example for the use in a mathematical equation, here is the code for the first set of causets on the title page:
\begin{lstlisting}
\usepackage{causets}
-... % ... \begin{document} ...
-\begin{align*}
- \left\{
- \pcauset{3,2,1}, \pcauset{3,1,2}, \pcauset{2,1,3}, \pcauset{1,3,2}, \pcauset{1,2,3}
- \right\}.
-\end{align*}
+
+...
+
+\begin{document}
+
+...
+
+\begin{align}
+ S &=
+ \left\{
+ \pcauset{3,2,1},\, \pcauset{3,1,2},\, \pcauset{2,1,3},\, \pcauset{1,3,2},\, \pcauset{1,2,3}
+ \right\}.
+\end{align}
\end{lstlisting}
\vspace{-1.5em}
-\begin{align*}
- \left\{
- \pcauset{3,2,1},
- \pcauset{3,1,2},
- \pcauset{2,1,3},
- \pcauset{1,3,2},
- \pcauset{1,2,3}
- \right\}
- .
-\end{align*}
-(Note that here the package is imported without any options.)
-
-Of course, a given causet might have more than one representing permutation, so that any of those permutations may be used.
-However, you may consider it a good practice to choose the permutation that starts with the larger integer, so that disjoint elements appear to the right in the graphs.
-For example, you may write \lstinline§\pcauset{3,1,2}§, \pcauset{3,1,2}, as opposed to \lstinline§\pcauset{2,3,1}§, \pcauset{2,3,1}.
+\begin{align}
+ S &=
+ \left\{
+ \pcauset{3,2,1},\,
+ \pcauset{3,1,2},\,
+ \pcauset{2,1,3},\,
+ \pcauset{1,3,2},\,
+ \pcauset{1,2,3}
+ \right\}
+ .
+\end{align}
+
+Of course, a given causet might have more than one representing permutation, so that any of those permutations may be used.
+However, you may consider it a good practice to choose the permutation that starts with the larger integer, so that disjoint elements appear to the right in the graphs.
+For example, you may write \lstinline§\pcauset{3,1,2}§, \pcauset{3,1,2}, as opposed to \lstinline§\pcauset{2,3,1}§, \pcauset{2,3,1}.
+
+The arguments of the commands are lists that are iterated over by a \lstinline§\foreach§ loop of PGF/TikZ.
+So you may use dots {...} to complete ranges of integers automatically.
+You may use this feature to draw chains like \pcauset{1,...,5} (with \lstinline§\pcauset{1,...,5}§) or antichains like \pcauset{5,...,1} (with \lstinline§\pcauset{5,...,1}§).
+As a more complex example for the dots notation, consider
+\begin{lstlisting}
+\pcauset{20,18,...,8,
+ 1,7,6,...,2,
+ 9,11,...,19}
+\end{lstlisting}
+which produces the same diagram as
+\begin{lstlisting}
+\pcauset{20,18,16,14,12,10,8,
+ 1,7,6,5,4,3,2,
+ 9,11,13,15,17,19}
+\end{lstlisting}
+\begin{center}
+ \pcauset[black colors, permutation]{20,18,16,...,8,1,7,6,...,2,9,11,...,19}
+\end{center}
-It is possible to use dots in a permutation so that TikZ will auto-complete the list.
-For example, the command \lstinline§\pcauset{14,...,10,8,2,1,9,3,4,...,7}§ will generate the diagram
-\begin{align*}
- \pcauset[black colors, show permutation]{14,...,10,8,2,1,9,3,4,...,7}
-\end{align*}
-which is the same as \lstinline§\pcauset{14,13,12,11,10,8,2,1,9,3,4,5,6,7}§. (This graphic uses the package options \lstinline§black§ and \lstinline§permutation§ again.)
+In an optional argument, the main commands accepts any causets or TikZ keys to change the style of the causet.
+For example, the blue causet \pcauset[blue colors]{2,4,5,1,3} is obtained with
+\begin{lstlisting}
+\pcauset[blue colors]{2,4,5,1,3}
+\end{lstlisting}
-\clearpage
-\section{Package Options}
+\section{Package options}
\label{sec:PackageOptions}
-Each of the package options can either be specified in square brackets when declaring the package (option applies globally) or be changed with a macro at any point in the document (option applies to the local scope).
+Each of the package options can either be specified in square brackets when declaring the package (option applies globally) or be changed with a macro at any point in the document (option applies to the local scope).
If no options are used, an output like \rcauset{4,2,7,6,1,5,3}{2/5} is obtained with the commands
\begin{lstlisting}
\usepackage{causets}
-... % ... \begin{document} ...
+... \begin{document} ...
\rcauset{4,2,7,6,1,5,3}{2/5}
\end{lstlisting}
-The options -- given in the following table -- are passed to the \lstinline§causets§ package as optional parameter and can be combined. If not specified otherwise, any package option works with the command \lstinline§\causet§ as well as with the two shown examples created with the commands
+The options -- given in the following table -- are passed to the \lstinline§causets§ package as optional parameter and can be combined.
+The package options are listed together with example outputs created with the commands
\begin{lstlisting}
\pcauset{4,2,7,6,1,5,3}
\rcauset{4,2,7,6,1,5,3}{2/5}
\end{lstlisting}
+If not specified otherwise, any package option also works with the command \lstinline§\causet§.
\begin{longtable}{p{0.65\textwidth}p{0.13\textwidth}p{0.13\textwidth}}
\toprule
Package option & \lstinline§\pcauset§ & \lstinline§\rcauset§
\\\midrule
\endfirsthead
-
- \multicolumn{3}{c}{\footnotesize \textit{continued from the previous page}}
+
+ \multicolumn{3}{c}{\footnotesize \textit{continued from the previous page}}
\\\midrule
Package option & \lstinline§\pcauset§ & \lstinline§\rcauset§
\\\midrule
\endhead
-
+
\midrule
\multicolumn{3}{c}{\footnotesize \textit{continued on the next page}}
\endfoot
-
+
\endlastfoot
-
+
\lstinline§\usepackage[permutation]{causets}§ shows permutations
& \multirow{3}{5em}{%
\causetsDrawPermutationtrue \pcauset{4,2,7,6,1,5,3}}
& \multirow{3}{5em}{%
\causetsDrawPermutationtrue \rcauset{4,2,7,6,1,5,3}{2/5}}
\\
- ~~(\lstinline§\causetsDrawPermutationtrue§ activates this option)
+ (\lstinline§\causetsDrawPermutationtrue§ activates this option)
\\
- ~~(\lstinline§\causetsDrawPermutationfalse§ deactivates this option)
+ (\lstinline§\causetsDrawPermutationfalse§ deactivates this option)
\\\midrule
- \lstinline§\usepackage[permutation, unlabeled u]{causets}§
+ \lstinline§\usepackage[permutation, uunlabeled]{causets}§
& \multirow{4}{5em}{%
\causetsDrawPermutationtrue \causetsDrawULabelsfalse \pcauset{4,2,7,6,1,5,3}}
& \multirow{4}{5em}{%
@@ -287,11 +325,11 @@ The options -- given in the following table -- are passed to the \lstinline§caus
\\
shows permutations without u-labels
\\
- ~~(\lstinline§\causetsDrawULabelstrue§ activates u-labels)
+ (\lstinline§\causetsDrawULabelstrue§ activates u-labels)
\\
- ~~(\lstinline§\causetsDrawULabelsfalse§ deactivates u-labels)
+ (\lstinline§\causetsDrawULabelsfalse§ deactivates u-labels)
\\\midrule
- \lstinline§\usepackage[permutation, unlabeled v]{causets}§
+ \lstinline§\usepackage[permutation, vunlabeled]{causets}§
& \multirow{4}{5em}{%
\causetsDrawPermutationtrue \causetsDrawVLabelsfalse \pcauset{4,2,7,6,1,5,3}}
& \multirow{4}{5em}{%
@@ -299,276 +337,439 @@ The options -- given in the following table -- are passed to the \lstinline§caus
\\
shows permutations without v-labels
\\
- ~~(\lstinline§\causetsDrawVLabelstrue§ activates v-labels)
+ (\lstinline§\causetsDrawVLabelstrue§ activates v-labels)
\\
- ~~(\lstinline§\causetsDrawVLabelsfalse§ deactivates v-labels)
-\\\midrule
+ (\lstinline§\causetsDrawVLabelsfalse§ deactivates v-labels)
+\\\midrule\midrule
\lstinline§\usepackage[labeled]{causets}§ shows labeled events
& \multirow{3}{5em}{%
\causetsDrawLabelstrue \pcauset{4,2,7,6,1,5,3}}
& \multirow{3}{5em}{%
\causetsDrawLabelstrue \rcauset{4,2,7,6,1,5,3}{2/5}}
\\
- ~~(\lstinline§\causetsDrawLabelstrue§ activates labels)
+ (\lstinline§\causetsDrawLabelstrue§ activates labels)
\\
- ~~(\lstinline§\causetsDrawLabelsfalse§ deactivates labels)
-\\\midrule
- \lstinline§\usepackage[continuously linked]{causets}§ allows links to cross over events. Broken links (that is the default option: \lstinline§\usepackage[brokenly linked]{causets}§) affects only the \lstinline§\causet§ command, but not the examples of \lstinline§\pcauset§ and \lstinline§\rcauset§, shown on the right.
-& \multirow{3}{5em}{%
+ (\lstinline§\causetsDrawLabelsfalse§ deactivates labels)
+\\\midrule\midrule
+ \lstinline§\usepackage[continuous]{causets}§ allows links to cross over events. Link interruptions (default) only affect the \lstinline§\causet§ command, but not the examples of \lstinline§\pcauset§ and \lstinline§\rcauset§, shown on the right.
+& \multirow{5}{5em}{%
\causetsBreakLinkstrue \pcauset{4,2,7,6,1,5,3}}
-& \multirow{3}{5em}{%
+& \multirow{5}{5em}{%
\causetsBreakLinkstrue \rcauset{4,2,7,6,1,5,3}{2/5}}
\\
- Details on broken links are given below.
-\\[0.5cm]
- \lstinline§\usepackage[cap linked]{causets}§ sets caps as link tips
+ Details on interrupted (broken) links are given below.
+\\\midrule
+ \lstinline§\usepackage[caps]{causets}§ sets caps as link tips
& \multirow{2}{5em}{%
\pcauset[cap links]{4,2,7,6,1,5,3}}
& \multirow{2}{5em}{%
\rcauset[cap links]{4,2,7,6,1,5,3}{2/5}}
\\
-\\
- \lstinline§\usepackage[arrow linked]{causets}§ sets arrows (rounded, open stealth) as link tips
+\\\midrule
+ \lstinline§\usepackage[arrows]{causets}§ sets arrows (rounded, open stealth) as link tips
& \multirow{2}{5em}{%
\pcauset[arrow links]{4,2,7,6,1,5,3}}
& \multirow{2}{5em}{%
\rcauset[arrow links]{4,2,7,6,1,5,3}{2/5}}
-\\
+\\\midrule
\lstinline§\usepackage[unlinked]{causets}§ does not draw links
& \multirow{3}{5em}{%
\causetsDrawLinksfalse \pcauset{4,2,7,6,1,5,3}}
& \multirow{3}{5em}{%
\causetsDrawLinksfalse \rcauset{4,2,7,6,1,5,3}{2/5}}
\\
- ~~(\lstinline§\causetsDrawLinkstrue§ actives links)
+ (\lstinline§\causetsDrawLinkstrue§ actives links)
\\
- ~~(\lstinline§\causetsDrawLinksfalse§ deactivates links)
-\\\midrule
+ (\lstinline§\causetsDrawLinksfalse§ deactivates links)
+\\\midrule\midrule
\lstinline§\usepackage[tiny]{causets}§ for tiny diagrams
& \multirow{2}{5em}{%
\pcauset[tiny]{4,2,7,6,1,5,3}}
& \multirow{2}{5em}{%
\rcauset[tiny]{4,2,7,6,1,5,3}{2/5}}
\\
- ~~(\lstinline§\tikzcausetsset{tiny}§ sets tiny sizes)
+ (\lstinline§\tikzcausetsset{tiny}§ sets tiny sizes)
+\\\midrule
+ \lstinline§\usepackage[smaller]{causets}§ for very small diagrams
+& \multirow{2}{5em}{%
+ \pcauset[very small]{4,2,7,6,1,5,3}}
+& \multirow{2}{5em}{%
+ \rcauset[very small]{4,2,7,6,1,5,3}{2/5}}
\\
+ (\lstinline§\tikzcausetsset{very small}§ sets very small sizes)
+\\\midrule
\lstinline§\usepackage[small]{causets}§ for small diagrams
& \multirow{2}{5em}{%
\pcauset[small]{4,2,7,6,1,5,3}}
& \multirow{2}{5em}{%
\rcauset[small]{4,2,7,6,1,5,3}{2/5}}
\\
- ~~(\lstinline§\tikzcausetsset{small}§ sets small sizes)
+ (\lstinline§\tikzcausetsset{small}§ sets small sizes)
+\\\pagebreak%\midrule
+ For comparison, here are the normal sized causets.
+& \multirow{2}{5em}{%
+ \pcauset[normal]{4,2,7,6,1,5,3}}
+& \multirow{2}{5em}{%
+ \rcauset[normal]{4,2,7,6,1,5,3}{2/5}}
\\
+ (\lstinline§\tikzcausetsset{normal}§ sets normal sizes)
+\\\midrule
\lstinline§\usepackage[large]{causets}§ for large diagrams
& \multirow{3}{5em}{%
\pcauset[large]{4,2,7,6,1,5,3}}
& \multirow{3}{5em}{%
\rcauset[large]{4,2,7,6,1,5,3}{2/5}}
\\
- ~~(\lstinline§\tikzcausetsset{large}§ sets large sizes)
-\\
+ (\lstinline§\tikzcausetsset{large}§ sets large sizes)
+\\[1.3em]\midrule
+ \lstinline§\usepackage[larger]{causets}§ for very large diagrams
+& \multirow{3}{5em}{%
+ \pcauset[very large]{4,2,7,6,1,5,3}}
+& \multirow{3}{5em}{%
+ \rcauset[very large]{4,2,7,6,1,5,3}{2/5}}
\\
+ (\lstinline§\tikzcausetsset{very large}§ sets very large sizes)
+\\[2.1em]\midrule
\lstinline§\usepackage[huge]{causets}§ for huge diagrams
& \multirow{4}{5em}{%
\pcauset[huge]{4,2,7,6,1,5,3}}
-& \multirow{4}{5em}{%
- \rcauset[huge]{4,2,7,6,1,5,3}{2/5}}
-\\
- ~~(\lstinline§\tikzcausetsset{huge}§ sets huge sizes)
\\
- ~~(\lstinline§\tikzcausetsset{normal}§ resets to normal sizes)
+ (\lstinline§\tikzcausetsset{huge}§ sets huge sizes)
\\
Details on size options are given in \autoref{sec:Sizes}.
-\\\midrule
+\\[2.5em]\midrule\midrule
\lstinline§\usepackage[black]{causets}§ for black and white causets
& \multirow{2}{5em}{%
\pcauset[black colors]{4,2,7,6,1,5,3}}
& \multirow{2}{5em}{%
\rcauset[black colors]{4,2,7,6,1,5,3}{2/5}}
\\
- ~~(\lstinline§\tikzcausetsset{black colors}§ activates the option)
-\\
- \lstinline§\usepackage[gray]{causets}§ for gray scale causets (default)
+ (\lstinline§\tikzcausetsset{black colors}§ activates the option)
+\\\midrule
+ \lstinline§\usepackage[gray]{causets}§ for grey scale causets (default)
& \multirow{2}{5em}{%
\pcauset[gray colors]{4,2,7,6,1,5,3}}
& \multirow{2}{5em}{%
\rcauset[gray colors]{4,2,7,6,1,5,3}{2/5}}
\\
- ~~(\lstinline§\tikzcausetsset{gray colors}§ activates the option)
-\\
+ (\lstinline§\tikzcausetsset{gray colors}§ activates the option)
+\\\midrule
\lstinline§\usepackage[blue]{causets}§ for blue causets
& \multirow{2}{5em}{%
\pcauset[blue colors]{4,2,7,6,1,5,3}}
& \multirow{2}{5em}{%
\rcauset[blue colors]{4,2,7,6,1,5,3}{2/5}}
\\
- ~~(\lstinline§\tikzcausetsset{blue colors}§ activates the option)
-\\
- \lstinline§\usepackage[neon]{causets}§ for brightly colored causets
-& \multirow{2}{5em}{%
+ (\lstinline§\tikzcausetsset{blue colors}§ activates the option)
+\\\midrule
+ \lstinline§\usepackage[neon]{causets}§ for brightly coloured causets
+& \multirow{3}{5em}{%
\pcauset[neon colors]{4,2,7,6,1,5,3}}
-& \multirow{2}{5em}{%
+& \multirow{3}{5em}{%
\rcauset[neon colors]{4,2,7,6,1,5,3}{2/5}}
\\
- ~~(\lstinline§\tikzcausetsset{neon colors}§ activates the option)
+ (\lstinline§\tikzcausetsset{neon colors}§ activates the option)
\\
- Details on color options are given in \autoref{sec:Colors}.
-\\\midrule
- \lstinline§\usepackage[spatially linked]{causets}§ shows dashed lines between spatially separated events (which is a secondary partial order for the causets drawn with \lstinline§\pcauset§). This option only affects the \lstinline§\pcauset§ and \lstinline§\rcauset§ commands, but not the \lstinline§\causet§ command.
+ Details on colour options are given in \autoref{sec:Colors}.
+\\\midrule\midrule
+ \lstinline§\usepackage[spatial]{causets}§ shows dashed lines between spatially separated events (which is a secondary partial order for the causets drawn with \lstinline§\pcauset§). This option only affects the \lstinline§\pcauset§ and \lstinline§\rcauset§ commands, but not the \lstinline§\causet§ command.
& \multirow{3}{5em}{%
\pcauset[spatially linked]{4,2,7,6,1,5,3}}
& \multirow{3}{5em}{%
\rcauset[spatially linked]{4,2,7,6,1,5,3}{2/5}}
\\
- ~~(\lstinline§\causetsDrawSpatialLinkstrue§ activates the option)
+ (\lstinline§\causetsDrawSpatialLinkstrue§ activates the option)
\\
- ~~(\lstinline§\causetsDrawSpatialLinksfalse§ deactivates the option)
+ (\lstinline§\causetsDrawSpatialLinksfalse§ deactivates the option)
\\\bottomrule
\end{longtable}
-By default, the links in a diagram created with the \lstinline§\causet§ command are interrupted if they hit another event (exactly in their center).
-Any such crossing of links over events can only be caused by the manually drawn links, explicitly given in the second argument of \lstinline§\causet§, but not with the links drawn by \lstinline§\pcauset§ or \lstinline§\rcauset§.
+By default, the links in a \lstinline§\causet§ diagram are interrupted if they cross over another event (exactly over the event centre).
+Any such crossing of links over events can only occur for the links explicitly specified for the \lstinline§\causet§ command, but not for the links drawn by \lstinline§\pcauset§ or \lstinline§\rcauset§.
This feature is activated by default (\lstinline§\causetsBreakLinkstrue§) and can be deactivated with \lstinline§\causetsBreakLinksfalse§, or with the option \lstinline§continuously linked§.
For example, here is a causet that embeds in 3-dimensional but not in 2-dimensional Minkowski spacetime.
-This causet has one event (8) in the center that is linked to events 7 and 9, but not to events 2 and 14, while the link from 2 to 14 crosses the event 8 in the center.
+This causet has one event (0) in the centre that is linked to events -3 and 3 but not to events -6 and 6, while a link from -6 to 6 crosses over it.
\begin{lstlisting}
-\usepackage[huge,labeled]{causets}
-\tikzcausetsset{labels={right=0.5ex}}
-... % ... \begin{document} ...
+\usepackage[larger]{causets}
+\tikzcausetsset{labels={right, position=east}, offset=-8}
+
+... \begin{document} ...
+
\causet[brokenly linked]{7,10,3,1,12,5,2,8,14,11,4,15,13,6,9} {1/2,1/12,2/4,2/14,3/4,3/5,4/6,4/15,5/6,5/8,6/9,7/8,7/10,8/9,8/11, 10/11,10/12,11/13,12/13,12/14,14/15}
\causet[continuously linked]{7,10,3,1,12,5,2,8,14,11,4,15,13,6,9} {1/2,1/12,2/4,2/14,3/4,3/5,4/6,4/15,5/6,5/8,6/9,7/8,7/10,8/9,8/11, 10/11,10/12,11/13,12/13,12/14,14/15}
\end{lstlisting}
-\causet[huge, labels={right=0.5ex}, brokenly linked]{7,10,3,1,12,5,2,8,14,11,4,15,13,6,9}{1/2,1/12,2/4,2/14,3/4,3/5,4/6,4/15,5/6,5/8,6/9,7/8,7/10,8/9,8/11,10/11,10/12,11/13,12/13,12/14,14/15}
-\causet[huge, labels={right=0.5ex}, continuously linked]{7,10,3,1,12,5,2,8,14,11,4,15,13,6,9}{1/2,1/12,2/4,2/14,3/4,3/5,4/6,4/15,5/6,5/8,6/9,7/8,7/10,8/9,8/11,10/11,10/12,11/13,12/13,12/14,14/15}
-
-Note that the option \lstinline§brokenly linked§ is not necessary if the default option has not been changed.
+\begin{center}
+ \causet[very large, labels={right, at=east}, offset=-8]{7,10,3,1,12,5,2,8,14,11,4,15,13,6,9}{1/2,1/12,2/4,2/14,3/4,3/5,4/6,4/15,5/6,5/8,6/9,7/8,7/10,8/9,8/11,10/11,10/12,11/13,12/13,12/14,14/15}
+ \hspace{1cm}
+ \causet[very large, labels={right, at=east}, continuously linked, offset=-8]{7,10,3,1,12,5,2,8,14,11,4,15,13,6,9}{1/2,1/12,2/4,2/14,3/4,3/5,4/6,4/15,5/6,5/8,6/9,7/8,7/10,8/9,8/11,10/11,10/12,11/13,12/13,12/14,14/15}
+\end{center}
-\section{Short Hand Macros}
+\section{Short hand macros}
\label{sec:ShortHandMacros}
The permutations and labels for causets can be switched on globally with the package options \lstinline§permutation§ and \lstinline§labeled§, or at any point in the document with the switches \\
-\lstinline§\causetsDrawPermutationtrue§ (same as the command \lstinline§\tikzcausetsset{show permutation}§ used in the preamble) and \lstinline§\causetsDrawLabelstrue§ (or \lstinline§\tikzcausetsset{labeled}§ used in the preamble), respectively.
+\lstinline§\causetsDrawPermutationtrue§ (same as the command \lstinline§\tikzcausetsset{show permutation}§) and \lstinline§\causetsDrawLabelstrue§ (or \lstinline§\tikzcausetsset{labeled}§), respectively.
-To show only single causets with either of these options, there exist short hand macros for all three main commands.
-Each main command can be followed by a capital letter \lstinline§P§ (to show the permutation), \lstinline§L§ (to show event labels), or \lstinline§X§ (to show both).
+To show only single causets with either of these options, there exist short hand macros for all three main commands.
+Each main command can be followed by a capital letter \lstinline§P§ (to show the permutation), \lstinline§L§ (to show event labels), or \lstinline§X§ (to show both).
\begin{lstlisting}
-\usepackage{causets}
-... % ... \begin{document} ...
Causets with permutations (and labels) \pcausetP{4,1,2,3}, \pcausetX{1,2,3,4}, \pcausetL{1,2,4,3}, and without any \pcauset{2,4,1,3}.
\end{lstlisting}
-Causets with permutations (and labels) \pcausetP{4,1,2,3}, \pcausetX{1,2,3,4}, \pcausetL{1,2,4,3}, and without any \pcauset{2,4,1,3}.
-These results are also obtained by using the optional parameter, for example:
-\begin{lstlisting}
-\usepackage{causets}
-... % ... \begin{document} ...
-Causets with permutations (and labels) \pcauset[permutation]{4,1,2,3}, \pcauset[permutation,labeled]{1,2,3,4}, \pcauset[labeled]{1,2,4,3}, and without any \pcauset{2,4,1,3}.
-\end{lstlisting}
+Causets with permutations (and labels) \pcausetP{4,1,2,3}, \pcausetX{1,2,3,4}, \pcausetL{1,2,4,3}, and without any \pcauset{2,4,1,3}.
-The optional argument of the main commands accepts any causets or TikZ keys to change the style of the causet.
-For example, the baseline can be moved with
+These results are also obtained by using the optional parameter, for example:
\begin{lstlisting}
-\pcauset[baseline=2mm]{2,4,5,1,3}
+Causets with permutations (and labels) \pcauset[permutation]{4,1,2,3}, \pcauset[permutation,labeled]{1,2,3,4}, \pcauset[labeled]{1,2,4,3}, and without any \pcauset{2,4,1,3}.
\end{lstlisting}
-such that the diagram is placed with its center at $2\mathrm{mm}$ below the text base, \pcauset[baseline=2mm]{2,4,5,1,3}.
-\vspace{0.5cm}
-There are a few short hand macros for small common causets as shown below.
+There are a few short hand macros for small common causets as shown here.
\begin{lstlisting}
\causetFence{1}, \causetFence{2}, \ldots, \causetFence{10},
\causetClosedFence{1}, \causetClosedFence{2}, \ldots, \causetClosedFence{10},
\causetCrown
\end{lstlisting}
-\causetFence{1}, \causetFence{2}, \ldots, \causetFence{10},
-\causetClosedFence{1}, \causetClosedFence{2}, \ldots, \causetClosedFence{10},
+\causetFence{1}, \causetFence{2}, \ldots, \causetFence{10},
+\causetClosedFence{1}, \causetClosedFence{2}, \ldots, \causetClosedFence{10},
\causetCrown
-\section{Changing Sizes (Esp. for Mathematical Expressions)}
-\label{sec:Sizes}
-Apart from the pre-defined sizes \lstinline§tiny§, \lstinline§small§, \lstinline§normal§, \lstinline§large§ and \lstinline§huge§, sizes can be specified in the optional argument of a single causet diagram or with \lstinline§\tikzcausetsset{...}§ for the current scope.
-Use the keys \vspace{-1ex}
-\begin{itemize}\itemsep=-1ex
- \item \lstinline§tile size=§\valuePH\ stores \valuePH\ in the macro \lstinline§\causetTileSize§ as the size of the tiles in the permutation
- \item \lstinline§region line width=§\valuePH\ stores \valuePH\ in the macro \lstinline§\causetRegionLine§ as the thickness for the line surrounding the permutation region
- \item \lstinline§grid line width=§\valuePH\ stores \valuePH\ in the macro \lstinline§\causetGridLine§ as the line thickness of the permutation grid
- \item \lstinline§event size=§\valuePH\ stores \valuePH\ in the macro \lstinline§\causetEventSize§ as the diameter of the events
- \item \lstinline§link width=§\valuePH\ stores \valuePH\ in the macro \lstinline§\causetLinkWidth§ as the link thickness
- \item \lstinline§broken link gap=§\valuePH\ stores \valuePH\ in the macro \lstinline§\causetBrokenLinkGap§ as the gap before and after an event that interrupts a link
- \item \lstinline§text scale=§\valuePH\ stores \valuePH\ in the macro \lstinline§\causetTextScale§ as the scaling factor of all the text labels (relative to the normal font size)
-\end{itemize}
+\section{Labeling and replacing events (for infinite causets)}
+\label{sec:LabelingReplacing}
+With version v1.3 of the package, it is possible to relabel and replace causet events.
+These features are useful for labelling events arbitrarily, and drawing diagrams of infinite causets using ellipsis.
-For example, the \lstinline§normal§ size is a pre-defined style with
+By default, all events get named and labeled by the integers given in the arguments of the commands.
+For example, \lstinline§\pcausetL{0,2,1}§ creates the diagram \pcausetL{0,2,1} where the event notes are named \lstinline§(E0)§, \lstinline§(E2)§, \lstinline§(E1)§, respectively, while the label nodes have the names \lstinline§(EL0)§, \lstinline§(EL2)§, \lstinline§(EL1)§.
+If the permutation is displayed as well, the $u$- and $v$-coordinate labels are the nodes \lstinline§(EUL§\PH\lstinline§)§ and \lstinline§(EVL§\PH\lstinline§)§, with \PH\ taking on the values $\{0, 2, 1 \}$.
+
+To offset the names of all causet events by the same amount, use the key-value pair \lstinline§offset=§\PH\ to adjust the naming and labelling of events and get distinct event names, while the same integers are used in the command arguments.
+Consider the following example.
\begin{lstlisting}
-\tikzcausetsset{normal/.style={tile size=0.90ex, region line width=0.06ex, grid line width=0.03ex, event size=0.48ex, link width=0.15ex, text scale=0.48}}
+\begin{align*}
+ \tikzcausetsset{large, labels={below=1pt, at=south}}
+ \cdots\quad
+ \pcausetP[offset=-12]{0,2,1,3}\quad\cdots\quad
+ \pcausetL{0,2,1,3}\quad\cdots\quad
+ \pcausetL[offset=12]{0,2,1,3}\quad\cdots
+\end{align*}
\end{lstlisting}
-However, if you want to draw a single diagram with your own sizes, use
+\vspace{-1em}
+\begin{align*}
+ \tikzcausetsset{large, labels={below=1pt, at=south}}
+ \cdots\quad
+ \pcausetP[offset=-12]{0,2,1,3}\quad\cdots\quad
+ \pcausetL{0,2,1,3}\quad\cdots\quad
+ \pcausetL[offset=12]{0,2,1,3}\quad\cdots
+\end{align*}
+Here, the three commands have the same integer argument \lstinline§{0,2,1,3}§, but the events are named with the specified offsets for the sub-causets, and the labels are adjusted accordingly.
+In this way, it will be possible to address the event (and label) nodes of the sub-causets distinctively within a larger TikZ picture.
+For more details on how to draw causets within a TikZ picture, see \autoref{sec:TikZ}.
+
+When you (only) want to change the labelling of events, add a slash and the new event label directly after the event integer in the first command argument.
+For example, the causet \pcauset{2,1,3} has six different labellings by (distinct) integers from the set $\{ 0, 1, 2 \}$,
+\pagebreak
+\begin{lstlisting}
+\begin{align}
+ \text{order-preserving:} &&
+ L_{\mathrm{op}} &=
+ \left\{
+ \pcausetL{1,0,2},
+ \pcausetL{1/0,0/1,2}
+ \right\}
+ , \\
+ \text{not order-preserving:} &&
+ L_{\mathrm{nop}} &=
+ \left\{
+ \pcauset{1/2,0/1,2/0},
+ \pcausetL{1,0/2,2/0},
+ \pcausetL{1/2,0,2/1},
+ \pcauset{1/0,0/2,2/1}
+ \right\}
+ .
+\end{align}
+\end{lstlisting}
+\vspace{-1em}
+\begin{align}
+ \text{order-preserving:} &&
+ L_{\mathrm{op}} &=
+ \left\{
+ \pcausetL{1,0,2},
+ \pcausetL{1/0,0/1,2}
+ \right\}
+ , \\
+ \text{not order-preserving:} &&
+ L_{\mathrm{nop}} &=
+ \left\{
+ \pcauset{1/2,0/1,2/0},
+ \pcausetL{1,0/2,2/0},
+ \pcausetL{1/2,0,2/1},
+ \pcauset{1/0,0/2,2/1}
+ \right\}
+ .
+\end{align}
+
+The replacing labels can be any text. It is recommended to write longer text labels in a \TeX\ group \lstinline§{...}§. Here is an example
\begin{lstlisting}
-\pcausetL[tile size=2.20ex, region line width=0.15ex, grid line width=0.06ex, event size=1.10ex, link width=0.35ex, text scale=1]{13,8,14,9,3,15,12,1,6,16,5,11,7,2,10,4}
+\pcauset[large]{2/$-\infty$,6,5,7,3/{Text and maths},4/-1}
\end{lstlisting}
-\pcausetL[tile size=2.20ex, region line width=0.15ex, grid line width=0.06ex, event size=1.10ex, link width=0.35ex, text scale=1]{13,8,14,9,3,15,12,1,6,16,5,11,7,2,10,4}
+\vspace{-0.5em}
+\begin{center}
+ \pcauset[large]{2/$-\infty$,6,5,7,3/{Text and maths},4/-1}
+\end{center}
-Changing sizes becomes important when you use causet diagrams in mathematical expression, where the size may be adjusted for indices or limits.
-For example:
+Notice that replaced labels will always be visible, even if labels are deactivated (\lstinline§\causetsDrawLabelsfalse§) as in this example.
+To change the style of the replaced labels, add the key-value pair
+\lstinline§replaced labels=§\PH, which extends the style of standard labels.
+
+Similarly to the replacement of labels, you can replace event nodes by adding yet another slash and the event node text after the event integer in the permutation of the command.
+This feature may have its main application for the representation of infinite causets, for example, the code
+\begin{lstlisting}
+% Define ellipsis rotated by #1 degrees:
+\newcommand{\rdots}[1][0]{\rotatebox{#1}{...}}
+...
+% Draw infinite causet with ellipsis
+\pcauset[large, replaced labels={below, at=south}, replaced events={text scale=1}]
+{-2/{$\downarrow$ continues infinitely $\downarrow$}/\rdots[90], -1,0,1,16,14,15,11,12,13,7,8,9,10, 2//\rdots[10],3,4//~,5,6//\rdots[-10]}
+\end{lstlisting}
+yields the diagram
+\begin{center}
+ \newcommand{\rdots}[1][0]{\rotatebox{#1}{...}}
+ \pcauset[large, replaced labels={below, at=south}, replaced events={text scale=1}]
+ {-2/{$\downarrow$ continues infinitely $\downarrow$}/\rdots[90], -1,0,1,16,14,15,11,12,13,7,8,9,10, 2//\rdots[10],3,4//~,5,6//\rdots[-10]}
+\end{center}
+Here, three events are replaced by ellipsis with different rotations, and one event is replaced by an empty node (\lstinline§~§).
+The style of the replaced events is specified via the key \lstinline§replaced labels=§\PH\ -- where \PH\ is \lstinline§{text scale=1}§ in this example.
+This example also shows how to relabel and replace simultaneously (see the bottom-most event).
+
+The style and the position of all event labels is set with \lstinline§labels=§\PH, while \lstinline§replaced labels=§\PH\ extends this style.
+As shown in the previous example, the position of labels is defined with a key word like \lstinline§left§, \lstinline§right§, \lstinline§above§, \lstinline§below§, etc.\ (see also the TikZ manual) relative to the position given by the key \lstinline§at=§\PH.
+The \lstinline§at§ key holds a coordinate of the event note.
+The default positioning is \lstinline§below left, at=south west§.
+
+In summary, the three main commands take the form
+\\[1ex]
+\lstinline§\pcauset{§\PH[index]\lstinline§/§\PH[label]\lstinline§/§\PH[event text]\lstinline§,...}§
+\\[1ex]
+\lstinline§\rcauset{§\PH[index]\lstinline§/§\PH[label]\lstinline§/§\PH[event text]\lstinline§,...}{§\PH[unlink from event]\lstinline§/§\PH[unlink to event]\lstinline§,...}§
+\\[1ex]
+\lstinline§\causet{§\PH[index]\lstinline§/§\PH[label]\lstinline§/§\PH[event text]\lstinline§,...}{§\PH[link from event]\lstinline§/§\PH[link to event]\lstinline§,...}§
+\\[1ex]
+The full notation for the short hand macros (see \autoref{sec:ShortHandMacros}) is similar.
+
+\section{Changing sizes and fonts (for mathematical expressions)}
+\label{sec:Sizes}
+The pre-defined size styles have the following scaling with respect to the normal size:\vspace{-1ex}
+\begin{itemize}\itemsep=-1ex
+ \item \lstinline§tiny§ is $\frac{1}{3}$ times the normal size
+ \item \lstinline§very small§ is $\frac{4}{9}$ times the normal size
+ \item \lstinline§small§ is $\frac{2}{3}$ times the normal size
+ \item \lstinline§large§ is $\frac{3}{2}$ times the normal size
+ \item \lstinline§very large§ is $\frac{9}{4}$ times the normal size
+ \item \lstinline§huge§ is $3$ times the normal size
+\end{itemize}
+Apart from the pre-defined sizes, a causet can be scaled to any size using \lstinline§size unit=§\PH\ (which is equal to the tile size, \lstinline§tile size=§\PH).
+The normal size unit has the value \lstinline§0.9ex§.
+
+I recommend to change the size of a causet when used in indices or limits for mathematical expression.
+For a (first level) sub-script in a summation, you may use the small size,
\begin{lstlisting}
\begin{equation}
\sum_{C \in \tikzcausetsset{small}
\left\{
- \pcauset{1,2,3},
- \;\pcauset{1,3,2,4},
- \;\pcauset{1,4,3,2,5},
- \;\pcauset{1,5,4,3,2,6}
+ \pcauset{1,2,3},\;
+ \pcauset{1,3,2,4},\;
+ \pcauset{1,4,3,2,5},\;
+ \pcauset{1,5,4,3,2,6}
\right\}}
- | C |
- = \left| \pcauset{1,2,3} \right|
- + \left| \pcauset{1,3,2,4} \right|
- + \left| \pcauset{1,4,3,2,5} \right|
- + \left| \pcauset{1,5,4,3,2,6} \right|
+ | C |
+ = \left| \pcauset{1,2,3} \right|
+ + \left| \pcauset{1,3,2,4} \right|
+ + \left| \pcauset{1,4,3,2,5} \right|
+ + \left| \pcauset{1,5,4,3,2,6} \right|
\end{equation}
\end{lstlisting}
\begin{equation}
\sum_{C \in \tikzcausetsset{small}
\left\{
- \pcauset{1,2,3},
- \;\pcauset{1,3,2,4},
- \;\pcauset{1,4,3,2,5},
- \;\pcauset{1,5,4,3,2,6}
+ \pcauset{1,2,3},
+ \;\pcauset{1,3,2,4},
+ \;\pcauset{1,4,3,2,5},
+ \;\pcauset{1,5,4,3,2,6}
\right\}}
- | C |
+ | C |
= \left| \pcauset{1,2,3} \right|
+ \left| \pcauset{1,3,2,4} \right|
+ \left| \pcauset{1,4,3,2,5} \right|
+ \left| \pcauset{1,5,4,3,2,6} \right|
\end{equation}
-\section{Changing Colors}
+Like any other options, sizes can also be specified in the optional argument of a single causet diagram or with \lstinline§\tikzcausetsset{...}§ for the current scope.
+
+If you need to set the sizes of individual components of a causet, use the keys \vspace{-1ex}
+\begin{itemize}\itemsep=-1ex
+ \item \lstinline§tile size=§\PH\ to store \PH\ in the macro \lstinline§\causetTileSize§ as the size of the tiles in the permutation (this is equivalent to setting the size unit),
+ \item \lstinline§region line width=§\PH\ to set the thickness for the line surrounding the permutation region,
+ \item \lstinline§grid line width=§\PH\ to set the line thickness of the permutation grid,
+ \item \lstinline§event size=§\PH\ to set the diameter of the events,
+ \item \lstinline§event outline=§\PH\ to set the thickness of the transparent line around the events,
+ \item \lstinline§link width=§\PH\ to set the link thickness, and
+ \item \lstinline§broken link gap=§\PH\ to set the link gap before and after an event that interrupts a link.
+\end{itemize}
+
+The text of all labels is sized independently to the other components of the causet diagrams.
+To adjust the text typesetting, use \vspace{-1ex}
+\begin{itemize}\itemsep=-1ex
+ \item \lstinline§text font=§\PH\ to set the font used for all the text labels -- for example, \lstinline§text font=\fontsize{13}{15.6}\selectfont§\ sets the font size to 13pt (and the baseline skip to 1.2 times this font size),
+ \item \lstinline§text scale=§\PH\ to set the scaling factor of all the text labels (relative to the font size).
+\end{itemize}
+The pre-defined size styles use the following font sizes, \vspace{-1ex}
+\begin{itemize}\itemsep=-1ex
+ \item \lstinline§tiny§ is typeset with \lstinline§\tiny§ (scaled by 0.30)
+ \item \lstinline§very small§ is typeset with \lstinline§\tiny§ (scaled by 0.40)
+ \item \lstinline§small§ is typeset with \lstinline§\scriptsize§ (scaled by 0.43)
+ \item \lstinline§normal§ is typeset with \lstinline§\footnotesize§ (scaled by 0.56)
+ \item \lstinline§large§ is typeset with \lstinline§\small§ (scaled by 0.75)
+ \item \lstinline§very large§ is typeset with \lstinline§\normalsize§ (scaled by 1.02)
+ \item \lstinline§huge§ is typeset with \lstinline§\Large§ (scaled by 0.97)
+\end{itemize}
+
+Below is an example for a diagram drawn with some sizes defined manually:
+\begin{lstlisting}
+\pcausetL[tile size=2ex, event size=1ex, link width=0.3ex, text scale=1]{13,8,14,9,3,15,12,1,6,16,5,11,7,2,10,4}
+\end{lstlisting}
+\begin{center}
+ \pcausetL[tile size=2ex, event size=1ex, link width=0.3ex, text scale=1]{13,8,14,9,3,15,12,1,6,16,5,11,7,2,10,4}
+\end{center}
+\vspace{1ex}
+
+\section{Changing colours}
\label{sec:Colors}
Colors can be set with the following keys: \vspace{-1ex}
\begin{itemize}\itemsep=-1ex
- \item \lstinline§region color=§\valuePH\ for the frame of the permutation grid
- \item \lstinline§grid color=§\valuePH\ for the lines of the permutation grid
- \item \lstinline§tile color=§\valuePH\ for the occupied tiles
- \item \lstinline§ulabel color=§\valuePH\ for the $u$ labels
- \item \lstinline§vlabel color=§\valuePH\ for the $v$ labels
- \item \lstinline§event color=§\valuePH\ for the events
- \item \lstinline§label color=§\valuePH\ for the event labels
- \item \lstinline§link color=§\valuePH\ for the links
- \item \lstinline§spatial link color=§\valuePH\ for the spatial links.
+ \item \lstinline§region color=§\PH\ (or \lstinline§region color=§\PH) for the frame of the permutation grid
+ \item \lstinline§grid color=§\PH\ (or \lstinline§grid color=§\PH) for the lines of the permutation grid
+ \item \lstinline§tile color=§\PH\ (or \lstinline§tile color=§\PH) for the occupied tiles
+ \item \lstinline§ulabel color=§\PH\ (or \lstinline§ulabel color=§\PH) for the $u$ labels
+ \item \lstinline§vlabel color=§\PH\ (or \lstinline§vlabel color=§\PH) for the $v$ labels
+ \item \lstinline§event color=§\PH\ (or \lstinline§event color=§\PH) for the events
+ \item \lstinline§label color=§\PH\ (or \lstinline§label color=§\PH) for the event labels
+ \item \lstinline§link color=§\PH\ (or \lstinline§link color=§\PH) for the links
+ \item \lstinline§spatial link color=§\PH\ (or \lstinline§spatial link color=§\PH) for the spatial links.
\end{itemize}
-When using any of these key-value pairs in an optional arguments of the causet macros, they apply to that diagram.
-To change colors within a scope or the entire document, use the \lstinline§\tikzcausetsset§ macro, for example
+When using any of these key-value pairs in an optional arguments of the causet macros, they apply to that diagram.
+To change colours within a scope or the entire document, use the \lstinline§\tikzcausetsset§ macro, for example
\begin{lstlisting}
\tikzcausetsset{event color=purple, link color=cyan}
\end{lstlisting}
-changes the event color to purple and the link color to cyan.
+changes the event colour to purple and the link colour to cyan.
-For the pre-defined color schemes, use the keys \lstinline§gray colors§ (default colors), \lstinline§black colors§ (only black and white), \lstinline§blue colors§ (blue color tones), or \lstinline§neon colors§ (bright colors).
-These keys set all the colors listed above to pre-defined values.
+For the pre-defined colour schemes, use the keys \lstinline§gray colors§ (or \lstinline§gray colors§, default), \lstinline§black colors§ (or \lstinline§black colors§, only black and white), \lstinline§blue colors§ (or \lstinline§blue colors§, blue colour tones), or \lstinline§neon colors§ (or \lstinline§neon colors§, bright colours).
+These keys set all the colours listed above to pre-defined values.
-\section{Standalone Causets}
+\section{Standalone causets}
\label{sec:Standalone}
-For any document that contains many (large) causet diagrams or the same causets that are used repeatedly, the compilation time can be reduced by putting the commands in external files using the \lstinline§standalone§ package.
+For any document that contains many (large) causet diagrams or the same causets that are used repeatedly, the compilation time can be reduced by placing the commands in external files using the \lstinline§standalone§ package.
-For example, create a file named \lstinline§mycauset.tex§ in the same directory as the main file with the following code:
+For example, create a file named \lstinline§mycauset.tex§ in the same directory as the main file with the following code:
\begin{lstlisting}
\documentclass[tikz]{standalone}
\usepackage{causets}
@@ -576,48 +777,47 @@ For example, create a file named \lstinline§mycauset.tex§ in the same directory
\pcauset{3,2,4,1}
\end{document}
\end{lstlisting}
-The compiled version is then included with the macro \lstinline§\causetfile{mycauset}§.
-The macro \lstinline§\causetfile[#1]{#2}§ also accepts one optional argument \lstinline§[#1]§ and redirects to
+The compiled version is then included with the macro \lstinline§\causetfile{mycauset}§.
+The macro \lstinline§\causetfile[#1]{#2}§ also accepts one optional argument \lstinline§[#1]§ and redirects to
\begin{lstlisting}
\includegraphics[#1]{\causetspath/#2}
\end{lstlisting}
-The macro \lstinline§\causetspath§ is pre-defined to \lstinline§.§ (the directory of the main \TeX\ file), but may be renewed to any desired directory with
+The macro \lstinline§\causetspath§ is pre-defined to \lstinline§.§ (the directory of the main \TeX\ file), but may be renewed to any desired directory with
\begin{lstlisting}
\renewcommand{\causetspath}{my_causet_directory}
\end{lstlisting}
-\clearpage
-\section{Advanced Style Changes}
-In the optional argument of the causet macros, you may use other TikZ options to change the output of the macros, for example:
+\section{Style changes in detail}
+In the optional argument of the causet macros, you may use other TikZ options to change the output of the macros, for example:
\begin{lstlisting}
\usepackage{causets}
-... % ... \begin{document} ...
+... \begin{document} ...
A labeled causet with red-framed semi-transparent labels, \pcausetL[labels={draw=red, fill=white, opacity=0.8, inner sep=1pt, scale=1.5}]{2,4,5,1,3}.
\end{lstlisting}
A labeled causet with red-framed semi-transparent labels, \pcausetL[labels={draw=red, fill=white, opacity=0.8, inner sep=1pt, scale=1.5}]{2,4,5,1,3}.
In the same way, it is possible to modify the existing styles of all parts of the diagrams, which means that the default drawing styles are extended by the options passed as value to these keys: \vspace{-1ex}
\begin{enumerate}\itemsep=-1ex
- \item \lstinline§region=§\valuePH\ shows the permutation (\lstinline§show permutation§) and appends to the style of the permutation frame,
- \item \lstinline§grid=§\valuePH\ shows the permutation (\lstinline§show permutation§) and appends to the style of the permutation grid,
- \item \lstinline§tiles=§\valuePH\ shows the permutation (\lstinline§show permutation§) and appends to the style of the occupied permutation tiles,
- \item \lstinline§events=§\valuePH\ appends to the style of the event nodes (graph vertices),
- \item \lstinline§links=§\valuePH\ shows the links (\lstinline§show links§) and appends to the style of the links (main graph edges),
- \item \lstinline§link starts=§\valuePH\ sets the starting line tip of each link,
- \item \lstinline§link ends=§\valuePH\ sets the ending line tip of each link,
- \item \lstinline§link pauses=§\valuePH\ sets the ending line tip of each link at an interruption,
- \item \lstinline§link resumes=§\valuePH\ sets the starting line tip of each link at an interruption,
+ \item \lstinline§region=§\PH\ shows the permutation (\lstinline§show permutation§) and appends to the style of the permutation frame,
+ \item \lstinline§grid=§\PH\ shows the permutation (\lstinline§show permutation§) and appends to the style of the permutation grid,
+ \item \lstinline§tiles=§\PH\ shows the permutation (\lstinline§show permutation§) and appends to the style of the occupied permutation tiles,
+ \item \lstinline§events=§\PH\ appends to the style of the event nodes (graph vertices),
+ \item \lstinline§links=§\PH\ shows the links (\lstinline§show links§) and appends to the style of the links (main graph edges),
+ \item \lstinline§link starts=§\PH\ sets the starting line tip of each link,
+ \item \lstinline§link ends=§\PH\ sets the ending line tip of each link,
+ \item \lstinline§link pauses=§\PH\ sets the ending line tip of each link at an interruption,
+ \item \lstinline§link resumes=§\PH\ sets the starting line tip of each link at an interruption,
\item \lstinline§cap links§ sets the starting and ending line tip of each link to a (reversed) cap,
\item \lstinline§arrow links§ sets the ending line tip of each link to a rounded, open, stealth arrow,
- \item \lstinline§spatial links=§\valuePH\ shows the spatial links (\lstinline§show spatial links§) and appends to the style of the spatial links (secondary graph edges),
- \item \lstinline§all labels=§\valuePH\ appends to the general style of all text labels (applies to the following three label types),
- \item \lstinline§labels=§\valuePH\ shows the event labels (\lstinline§show labels§) and appends to the style that applies only to the event labels,
- \item \lstinline§ulabels=§\valuePH\ shows the $u$ labels (\lstinline§show ulabels§) and appends to the style that applies only to the $u$ labels, and
- \item \lstinline§vlabels=§\valuePH\ shows the $v$ labels (\lstinline§show vlabels§) and appends to the style that applies only to the $v$ labels.
+ \item \lstinline§spatial links=§\PH\ shows the spatial links (\lstinline§show spatial links§) and appends to the style of the spatial links (secondary graph edges),
+ \item \lstinline§all labels=§\PH\ appends to the general style of all text labels (applies to the following three label types),
+ \item \lstinline§labels=§\PH\ shows the event labels (\lstinline§show labels§) and appends to the style that applies only to the event labels,
+ \item \lstinline§ulabels=§\PH\ shows the $u$ labels (\lstinline§show ulabels§) and appends to the style that applies only to the $u$ labels, and
+ \item \lstinline§vlabels=§\PH\ shows the $v$ labels (\lstinline§show vlabels§) and appends to the style that applies only to the $v$ labels.
\end{enumerate}
In order to manually define the full style of the parts in the diagram - not extending, but \emph{overwriting all} drawing options - set the style of the following keys: \vspace{-1ex}
\begin{enumerate}\itemsep=-1ex
- \item \lstinline§every causet§ for the general style of the causet diagram (like \lstinline§baseline§),
+ \item \lstinline§every causet§ for the general style of the causet diagram (like \lstinline§baseline§, see below),
\item \lstinline§every tile§ for the occupied permutation tiles,
\item \lstinline§every event§ for the event nodes (graph vertices),
\item \lstinline§every grid§ for the permutation grid,
@@ -629,70 +829,129 @@ In order to manually define the full style of the parts in the diagram - not ext
\item \lstinline§every spatial link§ for the spacelike separations, and
\item \lstinline§every label§ for the event labels.
\end{enumerate}
-With the macro \lstinline§\tikzcausetsset{...}§, any of these styles can also be set in the preamble of the document.
-So, for example,
+With the macro \lstinline§\tikzcausetsset{...}§, any of these styles can also be set in the preamble of the document.
+So, for example,
\begin{lstlisting}
\usepackage{causets}
\tikzcausetsset{events={rectangle}, links={-Triangle Cap[]}}
-... % ... \begin{document} ...
-\pcauset{2,4,5,1,3}
+... \begin{document} ...
+\pcauset[large]{2,4,5,1,3}
+\end{lstlisting}
+will generate all causets with square nodes as events and triangle caps on the future link ends, like \pcauset[large, events={rectangle}, links={-Triangle Cap[]}]{2,4,5,1,3}.
+\vspace{1ex}
+
+By default, causets are placed such that a pre-defined coordinate point falls on the text baseline, \lstinline§baseline=(baseline point)§.
+The baseline point is \lstinline§tile size§/$\sqrt{2}$ below the centre of the diagram.
+You may adjust the baseline as for any TikZ graphic, for example,
+\begin{lstlisting}
+\pcauset[baseline=2mm]{2,4,5,1,3}
\end{lstlisting}
-will generate all causets with square nodes as events and triangle caps on the future link ends, like \pcauset[events={rectangle}, links={-Triangle Cap[]}]{2,4,5,1,3}.
+places the diagram centre $2\mathrm{mm}$ below the text base, \pcauset[baseline=2mm]{2,4,5,1,3}.
+\vspace{1ex}
-\section{Using this Package with TikZ}
+\section{Using this package in TikZ pictures}
\label{sec:TikZ}
-Since the package is TikZ based, using a causet within a TikZ picture is simple.
-Each of the three main commands is based on a draw command in TikZ that has the same name but starts with \lstinline§\draw...§.
-The \lstinline§\draw§ macros, however, do not support an optional argument (since this can be specified directly in a TikZ picture) and they also do not have any short hand macros ending in \lstinline§P§, \lstinline§L§ or \lstinline§X§.
+Since the package is TikZ based, using a causet within a TikZ picture is simple.
+Each of the three main commands is based on a draw command in TikZ that has the same name but starts with \lstinline§\draw...§.
+The \lstinline§\draw§ macros, however, do not support an optional argument (since this can be specified directly in a TikZ picture) and they also do not have any short hand macros ending in \lstinline§P§, \lstinline§L§ or \lstinline§X§.
-The two following examples are given by external (standalone) TikZ graphics and included with \lstinline§\causetfile{...}§.
-More details on using causets in standalone files are given in \autoref{sec:Standalone}.
+The two following examples are given by external (standalone) TikZ graphics and included with \lstinline§\causetfile{...}§.
+More details on using causets in standalone files are given in \autoref{sec:Standalone}.
-Note that the output of the \lstinline§\draw§ macros has the point (0,0) in the center, so in order to shift it, we may enclose it in a TikZ scope, for example:
+Note that the output of the \lstinline§\draw§ macros has the point (0,0) in the centre, so in order to shift it, we may enclose it in a TikZ scope, for example:
\lstinputlisting{causet_tikz_example1.tex}
-\causetfile{causet_tikz_example1}
+\begin{center}
+ \causetfile{causet_tikz_example1}
+\end{center}
-Note that this example also shows how to use the event nodes that are generated by the \lstinline§\drawpcauset§ macro.
-The green arrow points to the node of the second causet event \lstinline§(E5)§.
-The causet events, event labels, $u$-axis labels, and $v$-axis lables are the nodes \lstinline§(Ei)§, \lstinline§(ELi)§, \lstinline§(EULi)§, and \lstinline§(EVLi)§, respectively, where $\smash{i \in [ 1, N ]}$ for a causet with $N$ events.
+Note that this example also shows how to use the event nodes that are generated by the \lstinline§\drawpcauset§ macro.
+The green arrow points to the node of the second causet event \lstinline§(E5)§.
+The causet events, event labels, $u$-axis labels, and $v$-axis lables are the nodes \lstinline§(Ei)§, \lstinline§(ELi)§, \lstinline§(EULi)§, and \lstinline§(EVLi)§, respectively, where $\smash{i \in [ 1, N ]}$ for a causet with $N$ events.
-It is also possible to use multiple causets in more complicated graphics, like a tree for example, but note that whenever a causet is actually a text of a node within a TikZ picture (like in the following), we need to use the \lstinline§\pcauset§ (\lstinline§\rcauset§ or \lstinline§\causet§) commands without the \lstinline§draw§ prefix again:
+It is also possible to use multiple causets in more complicated graphics, like a tree for example, but note that whenever a causet is actually a text of a node within a TikZ picture (like in the following), we need to use the \lstinline§\pcauset§ (\lstinline§\rcauset§ or \lstinline§\causet§) commands without the \lstinline§draw§ prefix again:
\lstinputlisting{causet_tikz_example2.tex}
-\hspace{-3.0ex}\causetfile{causet_tikz_example2}
+\hspace{-1.5ex}\causetfile{causet_tikz_example2}
-\clearpage
-\section{Updates}
-\subsection{Version 1.1}
+\noindent
+More examples can be found at \\
+\url{https://github.com/c-minz/LaTeX-causets/tree/main/examples}
+
+%\clearpage
+\section{Release notes}
+\tikzcausetsset{large, events={black!20}, links={black!10}, cap links, label color={black!30}}
+\subsection{v1.3, 2022-05-23}
\begin{itemize}\itemsep=-1ex
- \item All colors, size and style options have been moved to PGF keys in the path
+ \item \versioncauset{v1-3}{\pcauset[replaced labels={left=0.5ex, at=west}]{1,4,2,3/.3}}%
+ The numbers for the arguments of the causet commands may now be chosen from an interval $[ a, b ]$, where $a$ and $b$ do no longer have to be natural numbers but are any integers ($a \leq b$) including 0 and negative numbers to name and label the events of the causet.
+ \item The integers given in the arguments of the causet commands that name (and auto label) events may now be modified with \lstinline§offset=§\PH\ (0 by default) before the events are named and labeled with the given numbers.
+ \item All sizes are now scaled with respect to the normal size and the line thickness of the event outline has been corrected.
+ \item The following size macros are no longer supported: \\
+ \lstinline§\causetRegionLine§, \lstinline§\causetGridLine§, \lstinline§\causetEventSize§, \lstinline§\causetLinkWidth§, and \\ \lstinline§\causetBrokenLinkGap§.
+ The respective values are now stored in PGF keys and are measured with respect to the size unit (stored in \lstinline§\causetTileSize§).
+ \item For all labels in the diagram, the font size is now adjustable with \lstinline§text font=§\PH\ (additionally to \lstinline§text scale=§\PH), for example to set the font size to 20pt (and a baseline skip of 24pt), use
\begin{lstlisting}
-/tikz/causets/
+text font=\fontsize{20}{24}\selectfont
\end{lstlisting}
+ \item Event labels and the event nodes itself may now be replaced by user-defined text in order to label events manually or use symbols like \lstinline§...§ for representations of infinite causets.
+ \item The package options have been fixed, they are now all single word options.
+ \item The short hand macros \lstinline§\*causetL...§ now deactivate the permutation and \\ \lstinline§\*causetP...§ now deactivate labels (if activated previously).
\end{itemize}
-\subsection{Version 1.2}
+\subsection{v1.2, 2022-02-07}
\begin{itemize}\itemsep=-1ex
- \item The color option \lstinline§blue§ has been modified so that a diagram is now only colored in different shades of blue, gray and black.
- \item Every event label is now positioned relative to the center point of an event, so that the position of event labels can be modified with \lstinline§left=§\valuePH, \lstinline§right=§\valuePH, etc.
- \item Arrow tips may now be added to the start and end of links via the style settings \lstinline§link starts=§\valuePH\ and \lstinline§link ends=§\valuePH, or via the pre-defined styles \lstinline§cap links§ and \lstinline§arrow links§.
- \item By default, links drawn by the command \lstinline§\causet§ are now broken if they cross over an event.
-The style of the start and end of the link interruption are set with \lstinline§link pauses=§\valuePH\ and \lstinline§link resumes=§\valuePH.
+ \item \versioncauset{v1-2}{\pcauset{1,3,2}}%
+ The colour option \lstinline§blue§ has been modified so that a blue diagram is now only coloured in different shades of blue, gray and black.
+ \item Every event label is now positioned relative to the centre point of an event, so that the position of event labels can be modified with \lstinline§left=§\PH, \lstinline§right=§\PH, etc.
+ \item Arrow tips may now be added to the start and end of links via the style settings \lstinline§link starts=§\PH\ and \lstinline§link ends=§\PH, or via the pre-defined styles \lstinline§cap links§ and \lstinline§arrow links§.
+ \item By default, links drawn by the command \lstinline§\causet§ are now broken if they cross over an event.
+The style of the start and end of the link interruption are set with \lstinline§link pauses=§\PH\ and \lstinline§link resumes=§\PH.
\item Links between spacelike separated events are now also supported by the command \lstinline§\rcauset§.
- \item More details have been added to this manual, especially to \autoref{sec:PackageOptions}.
\end{itemize}
-\section{Bug Reports and Package Requests}
+\subsection{v1.1, 2020-12-15}
+\tikzcausetsset{link starts={}, link ends={}}
+\begin{itemize}\itemsep=-1ex
+ \item \versioncauset{v1-1}{\pcauset{1,2}}%
+ All colours, size and style options have been moved to PGF keys in the path
+\begin{lstlisting}
+/tikz/causets/
+\end{lstlisting}
+\end{itemize}
+
+\subsection{v1.0, 2020-11-08}
+\begin{itemize}\itemsep=-1ex
+ \item \versioncauset{v1-0}{\pcauset{1}}%
+ First release of the package \lstinline§causets§ on CTAN, \url{https://ctan.org/pkg/causets}, including all the main commands.
+\end{itemize}
+
+\noindent
+Older versions of the package are at \\
+\url{https://github.com/c-minz/LaTeX-causets/tree/main/previous_versions}
+
+\section{Bug reports and package requests}
\label{sec:PackageDevelopment}
-Problems with the package are reported here: \\
-\url{https://github.com/c-minz/LaTeX-causets/issues}
+To see reported problems, go to \url{https://github.com/c-minz/LaTeX-causets/issues}
If you have a problem when using the package or you would like to have another feature to be implemented, please write a message to \\
christoph(dot)minz(AT)gmail(dot)com\\
For reporting a bug, I much appreciated if you do the following:
\begin{itemize}\itemsep=-1ex
- \item Check the issues reported previously if your problem is already listed.
- \item Describe your problem including the errors and warning messages, information about the drivers and programs versions.
- \item Provide a minimal working test file (only a single \TeX\ file) that demonstrates the problem.
+ \item Check the issues reported previously if your problem is already listed.
+ \item Describe your problem including the errors and warning messages, information about the drivers and programs versions.
+ \item Provide a minimal, working test file (only a single \TeX\ file) that demonstrates the problem.
\end{itemize}
\end{document}
+
+%% Size testing:
+\documentclass[tikz,10pt]{standalone}
+\usepackage[blue]{causets}
+\begin{document}
+\pcauset[tiny]{1,3,2,4}
+\pcauset[very small]{1,3,2,4}
+\pcauset[small]{1,3,2,4}
+\pcauset{1,3,2,4}
+\pcauset[large]{1,3,2,4}
+\pcauset[very large]{1,3,2,4}
+\pcauset[huge]{1,3,2,4}
+\end{document}
diff --git a/graphics/pgf/contrib/pgf-umlcd/COPYING b/graphics/pgf/contrib/pgf-umlcd/COPYING
index 71917be32e..6d137c2a21 100644
--- a/graphics/pgf/contrib/pgf-umlcd/COPYING
+++ b/graphics/pgf/contrib/pgf-umlcd/COPYING
@@ -1,14 +1,11 @@
This file is part of pgf-umlcd.
-pgf-umlcd is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-pgf-umlcd is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with Foobar. If not, see <http://www.gnu.org/licenses/>. \ No newline at end of file
+Copyright 2009-2020 Yuan Xu
+
+pgf-umlcd is licensed under the terms of the The LaTeX Project Public License (LPPL) 1.3c, or
+alternatively under the terms of the General Public License (GPL) Version 2.
+
+The terms of each license can be found in the source repository:
+
+LaTeX Project Public License: doc/latex/pgf-umlcd/LICENSE-LPPL1.3c.txt
+General Public License 2: doc/latex/pgf-umlcd/LICENSE-GPL2.txt
diff --git a/graphics/pgf/contrib/pgf-umlcd/LICENSE-GPL2.txt b/graphics/pgf/contrib/pgf-umlcd/LICENSE-GPL2.txt
new file mode 100644
index 0000000000..d159169d10
--- /dev/null
+++ b/graphics/pgf/contrib/pgf-umlcd/LICENSE-GPL2.txt
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/graphics/pgf/contrib/pgf-umlcd/LICENSE-LPPL1.3c.txt b/graphics/pgf/contrib/pgf-umlcd/LICENSE-LPPL1.3c.txt
new file mode 100644
index 0000000000..2244313901
--- /dev/null
+++ b/graphics/pgf/contrib/pgf-umlcd/LICENSE-LPPL1.3c.txt
@@ -0,0 +1,416 @@
+The LaTeX Project Public License
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+LPPL Version 1.3c 2008-05-04
+
+Copyright 1999 2002-2008 LaTeX3 Project
+ Everyone is allowed to distribute verbatim copies of this
+ license document, but modification of it is not allowed.
+
+
+PREAMBLE
+========
+
+The LaTeX Project Public License (LPPL) is the primary license under
+which the LaTeX kernel and the base LaTeX packages are distributed.
+
+You may use this license for any work of which you hold the copyright
+and which you wish to distribute. This license may be particularly
+suitable if your work is TeX-related (such as a LaTeX package), but
+it is written in such a way that you can use it even if your work is
+unrelated to TeX.
+
+The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE',
+below, gives instructions, examples, and recommendations for authors
+who are considering distributing their works under this license.
+
+This license gives conditions under which a work may be distributed
+and modified, as well as conditions under which modified versions of
+that work may be distributed.
+
+We, the LaTeX3 Project, believe that the conditions below give you
+the freedom to make and distribute modified versions of your work
+that conform with whatever technical specifications you wish while
+maintaining the availability, integrity, and reliability of
+that work. If you do not see how to achieve your goal while
+meeting these conditions, then read the document `cfgguide.tex'
+and `modguide.tex' in the base LaTeX distribution for suggestions.
+
+
+DEFINITIONS
+===========
+
+In this license document the following terms are used:
+
+ `Work'
+ Any work being distributed under this License.
+
+ `Derived Work'
+ Any work that under any applicable law is derived from the Work.
+
+ `Modification'
+ Any procedure that produces a Derived Work under any applicable
+ law -- for example, the production of a file containing an
+ original file associated with the Work or a significant portion of
+ such a file, either verbatim or with modifications and/or
+ translated into another language.
+
+ `Modify'
+ To apply any procedure that produces a Derived Work under any
+ applicable law.
+
+ `Distribution'
+ Making copies of the Work available from one person to another, in
+ whole or in part. Distribution includes (but is not limited to)
+ making any electronic components of the Work accessible by
+ file transfer protocols such as FTP or HTTP or by shared file
+ systems such as Sun's Network File System (NFS).
+
+ `Compiled Work'
+ A version of the Work that has been processed into a form where it
+ is directly usable on a computer system. This processing may
+ include using installation facilities provided by the Work,
+ transformations of the Work, copying of components of the Work, or
+ other activities. Note that modification of any installation
+ facilities provided by the Work constitutes modification of the Work.
+
+ `Current Maintainer'
+ A person or persons nominated as such within the Work. If there is
+ no such explicit nomination then it is the `Copyright Holder' under
+ any applicable law.
+
+ `Base Interpreter'
+ A program or process that is normally needed for running or
+ interpreting a part or the whole of the Work.
+
+ A Base Interpreter may depend on external components but these
+ are not considered part of the Base Interpreter provided that each
+ external component clearly identifies itself whenever it is used
+ interactively. Unless explicitly specified when applying the
+ license to the Work, the only applicable Base Interpreter is a
+ `LaTeX-Format' or in the case of files belonging to the
+ `LaTeX-format' a program implementing the `TeX language'.
+
+
+
+CONDITIONS ON DISTRIBUTION AND MODIFICATION
+===========================================
+
+1. Activities other than distribution and/or modification of the Work
+are not covered by this license; they are outside its scope. In
+particular, the act of running the Work is not restricted and no
+requirements are made concerning any offers of support for the Work.
+
+2. You may distribute a complete, unmodified copy of the Work as you
+received it. Distribution of only part of the Work is considered
+modification of the Work, and no right to distribute such a Derived
+Work may be assumed under the terms of this clause.
+
+3. You may distribute a Compiled Work that has been generated from a
+complete, unmodified copy of the Work as distributed under Clause 2
+above, as long as that Compiled Work is distributed in such a way that
+the recipients may install the Compiled Work on their system exactly
+as it would have been installed if they generated a Compiled Work
+directly from the Work.
+
+4. If you are the Current Maintainer of the Work, you may, without
+restriction, modify the Work, thus creating a Derived Work. You may
+also distribute the Derived Work without restriction, including
+Compiled Works generated from the Derived Work. Derived Works
+distributed in this manner by the Current Maintainer are considered to
+be updated versions of the Work.
+
+5. If you are not the Current Maintainer of the Work, you may modify
+your copy of the Work, thus creating a Derived Work based on the Work,
+and compile this Derived Work, thus creating a Compiled Work based on
+the Derived Work.
+
+6. If you are not the Current Maintainer of the Work, you may
+distribute a Derived Work provided the following conditions are met
+for every component of the Work unless that component clearly states
+in the copyright notice that it is exempt from that condition. Only
+the Current Maintainer is allowed to add such statements of exemption
+to a component of the Work.
+
+ a. If a component of this Derived Work can be a direct replacement
+ for a component of the Work when that component is used with the
+ Base Interpreter, then, wherever this component of the Work
+ identifies itself to the user when used interactively with that
+ Base Interpreter, the replacement component of this Derived Work
+ clearly and unambiguously identifies itself as a modified version
+ of this component to the user when used interactively with that
+ Base Interpreter.
+
+ b. Every component of the Derived Work contains prominent notices
+ detailing the nature of the changes to that component, or a
+ prominent reference to another file that is distributed as part
+ of the Derived Work and that contains a complete and accurate log
+ of the changes.
+
+ c. No information in the Derived Work implies that any persons,
+ including (but not limited to) the authors of the original version
+ of the Work, provide any support, including (but not limited to)
+ the reporting and handling of errors, to recipients of the
+ Derived Work unless those persons have stated explicitly that
+ they do provide such support for the Derived Work.
+
+ d. You distribute at least one of the following with the Derived Work:
+
+ 1. A complete, unmodified copy of the Work;
+ if your distribution of a modified component is made by
+ offering access to copy the modified component from a
+ designated place, then offering equivalent access to copy
+ the Work from the same or some similar place meets this
+ condition, even though third parties are not compelled to
+ copy the Work along with the modified component;
+
+ 2. Information that is sufficient to obtain a complete,
+ unmodified copy of the Work.
+
+7. If you are not the Current Maintainer of the Work, you may
+distribute a Compiled Work generated from a Derived Work, as long as
+the Derived Work is distributed to all recipients of the Compiled
+Work, and as long as the conditions of Clause 6, above, are met with
+regard to the Derived Work.
+
+8. The conditions above are not intended to prohibit, and hence do not
+apply to, the modification, by any method, of any component so that it
+becomes identical to an updated version of that component of the Work as
+it is distributed by the Current Maintainer under Clause 4, above.
+
+9. Distribution of the Work or any Derived Work in an alternative
+format, where the Work or that Derived Work (in whole or in part) is
+then produced by applying some process to that format, does not relax or
+nullify any sections of this license as they pertain to the results of
+applying that process.
+
+10. a. A Derived Work may be distributed under a different license
+ provided that license itself honors the conditions listed in
+ Clause 6 above, in regard to the Work, though it does not have
+ to honor the rest of the conditions in this license.
+
+ b. If a Derived Work is distributed under a different license, that
+ Derived Work must provide sufficient documentation as part of
+ itself to allow each recipient of that Derived Work to honor the
+ restrictions in Clause 6 above, concerning changes from the Work.
+
+11. This license places no restrictions on works that are unrelated to
+the Work, nor does this license place any restrictions on aggregating
+such works with the Work by any means.
+
+12. Nothing in this license is intended to, or may be used to, prevent
+complete compliance by all parties with all applicable laws.
+
+
+NO WARRANTY
+===========
+
+There is no warranty for the Work. Except when otherwise stated in
+writing, the Copyright Holder provides the Work `as is', without
+warranty of any kind, either expressed or implied, including, but not
+limited to, the implied warranties of merchantability and fitness for a
+particular purpose. The entire risk as to the quality and performance
+of the Work is with you. Should the Work prove defective, you assume
+the cost of all necessary servicing, repair, or correction.
+
+In no event unless required by applicable law or agreed to in writing
+will The Copyright Holder, or any author named in the components of the
+Work, or any other party who may distribute and/or modify the Work as
+permitted above, be liable to you for damages, including any general,
+special, incidental or consequential damages arising out of any use of
+the Work or out of inability to use the Work (including, but not limited
+to, loss of data, data being rendered inaccurate, or losses sustained by
+anyone as a result of any failure of the Work to operate with any other
+programs), even if the Copyright Holder or said author or said other
+party has been advised of the possibility of such damages.
+
+
+MAINTENANCE OF THE WORK
+=======================
+
+The Work has the status `author-maintained' if the Copyright Holder
+explicitly and prominently states near the primary copyright notice in
+the Work that the Work can only be maintained by the Copyright Holder
+or simply that it is `author-maintained'.
+
+The Work has the status `maintained' if there is a Current Maintainer
+who has indicated in the Work that they are willing to receive error
+reports for the Work (for example, by supplying a valid e-mail
+address). It is not required for the Current Maintainer to acknowledge
+or act upon these error reports.
+
+The Work changes from status `maintained' to `unmaintained' if there
+is no Current Maintainer, or the person stated to be Current
+Maintainer of the work cannot be reached through the indicated means
+of communication for a period of six months, and there are no other
+significant signs of active maintenance.
+
+You can become the Current Maintainer of the Work by agreement with
+any existing Current Maintainer to take over this role.
+
+If the Work is unmaintained, you can become the Current Maintainer of
+the Work through the following steps:
+
+ 1. Make a reasonable attempt to trace the Current Maintainer (and
+ the Copyright Holder, if the two differ) through the means of
+ an Internet or similar search.
+
+ 2. If this search is successful, then enquire whether the Work
+ is still maintained.
+
+ a. If it is being maintained, then ask the Current Maintainer
+ to update their communication data within one month.
+
+ b. If the search is unsuccessful or no action to resume active
+ maintenance is taken by the Current Maintainer, then announce
+ within the pertinent community your intention to take over
+ maintenance. (If the Work is a LaTeX work, this could be
+ done, for example, by posting to comp.text.tex.)
+
+ 3a. If the Current Maintainer is reachable and agrees to pass
+ maintenance of the Work to you, then this takes effect
+ immediately upon announcement.
+
+ b. If the Current Maintainer is not reachable and the Copyright
+ Holder agrees that maintenance of the Work be passed to you,
+ then this takes effect immediately upon announcement.
+
+ 4. If you make an `intention announcement' as described in 2b. above
+ and after three months your intention is challenged neither by
+ the Current Maintainer nor by the Copyright Holder nor by other
+ people, then you may arrange for the Work to be changed so as
+ to name you as the (new) Current Maintainer.
+
+ 5. If the previously unreachable Current Maintainer becomes
+ reachable once more within three months of a change completed
+ under the terms of 3b) or 4), then that Current Maintainer must
+ become or remain the Current Maintainer upon request provided
+ they then update their communication data within one month.
+
+A change in the Current Maintainer does not, of itself, alter the fact
+that the Work is distributed under the LPPL license.
+
+If you become the Current Maintainer of the Work, you should
+immediately provide, within the Work, a prominent and unambiguous
+statement of your status as Current Maintainer. You should also
+announce your new status to the same pertinent community as
+in 2b) above.
+
+
+WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE
+======================================================
+
+This section contains important instructions, examples, and
+recommendations for authors who are considering distributing their
+works under this license. These authors are addressed as `you' in
+this section.
+
+Choosing This License or Another License
+----------------------------------------
+
+If for any part of your work you want or need to use *distribution*
+conditions that differ significantly from those in this license, then
+do not refer to this license anywhere in your work but, instead,
+distribute your work under a different license. You may use the text
+of this license as a model for your own license, but your license
+should not refer to the LPPL or otherwise give the impression that
+your work is distributed under the LPPL.
+
+The document `modguide.tex' in the base LaTeX distribution explains
+the motivation behind the conditions of this license. It explains,
+for example, why distributing LaTeX under the GNU General Public
+License (GPL) was considered inappropriate. Even if your work is
+unrelated to LaTeX, the discussion in `modguide.tex' may still be
+relevant, and authors intending to distribute their works under any
+license are encouraged to read it.
+
+A Recommendation on Modification Without Distribution
+-----------------------------------------------------
+
+It is wise never to modify a component of the Work, even for your own
+personal use, without also meeting the above conditions for
+distributing the modified component. While you might intend that such
+modifications will never be distributed, often this will happen by
+accident -- you may forget that you have modified that component; or
+it may not occur to you when allowing others to access the modified
+version that you are thus distributing it and violating the conditions
+of this license in ways that could have legal implications and, worse,
+cause problems for the community. It is therefore usually in your
+best interest to keep your copy of the Work identical with the public
+one. Many works provide ways to control the behavior of that work
+without altering any of its licensed components.
+
+How to Use This License
+-----------------------
+
+To use this license, place in each of the components of your work both
+an explicit copyright notice including your name and the year the work
+was authored and/or last substantially modified. Include also a
+statement that the distribution and/or modification of that
+component is constrained by the conditions in this license.
+
+Here is an example of such a notice and statement:
+
+ %% pig.dtx
+ %% Copyright 2005 M. Y. Name
+ %
+ % 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 in
+ % http://www.latex-project.org/lppl.txt
+ % and version 1.3 or later is part of all distributions of LaTeX
+ % version 2005/12/01 or later.
+ %
+ % This work has the LPPL maintenance status `maintained'.
+ %
+ % The Current Maintainer of this work is M. Y. Name.
+ %
+ % This work consists of the files pig.dtx and pig.ins
+ % and the derived file pig.sty.
+
+Given such a notice and statement in a file, the conditions
+given in this license document would apply, with the `Work' referring
+to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being
+generated from `pig.dtx' using `pig.ins'), the `Base Interpreter'
+referring to any `LaTeX-Format', and both `Copyright Holder' and
+`Current Maintainer' referring to the person `M. Y. Name'.
+
+If you do not want the Maintenance section of LPPL to apply to your
+Work, change `maintained' above into `author-maintained'.
+However, we recommend that you use `maintained', as the Maintenance
+section was added in order to ensure that your Work remains useful to
+the community even when you can no longer maintain and support it
+yourself.
+
+Derived Works That Are Not Replacements
+---------------------------------------
+
+Several clauses of the LPPL specify means to provide reliability and
+stability for the user community. They therefore concern themselves
+with the case that a Derived Work is intended to be used as a
+(compatible or incompatible) replacement of the original Work. If
+this is not the case (e.g., if a few lines of code are reused for a
+completely different task), then clauses 6b and 6d shall not apply.
+
+
+Important Recommendations
+-------------------------
+
+ Defining What Constitutes the Work
+
+ The LPPL requires that distributions of the Work contain all the
+ files of the Work. It is therefore important that you provide a
+ way for the licensee to determine which files constitute the Work.
+ This could, for example, be achieved by explicitly listing all the
+ files of the Work near the copyright notice of each file or by
+ using a line such as:
+
+ % This work consists of all files listed in manifest.txt.
+
+ in that place. In the absence of an unequivocal list it might be
+ impossible for the licensee to determine what is considered by you
+ to comprise the Work and, in such a case, the licensee would be
+ entitled to make reasonable conjectures as to which files comprise
+ the Work.
+
diff --git a/graphics/pgf/contrib/pgf-umlcd/README b/graphics/pgf/contrib/pgf-umlcd/README
deleted file mode 100644
index 5cc6fbf3a0..0000000000
--- a/graphics/pgf/contrib/pgf-umlcd/README
+++ /dev/null
@@ -1,3 +0,0 @@
-Some LaTeX macros for UML Class Diagrams.
-Home page of project: http://pgf-umlcd.googlecode.com/
-Please read pgf-umlcd-manual.pdf for more information.
diff --git a/graphics/pgf/contrib/pgf-umlcd/README.md b/graphics/pgf/contrib/pgf-umlcd/README.md
new file mode 100644
index 0000000000..6eff10fba2
--- /dev/null
+++ b/graphics/pgf/contrib/pgf-umlcd/README.md
@@ -0,0 +1,15 @@
+# pgf-umlcd
+
+![CI](https://github.com/pgf-tikz/pgf/workflows/CI/badge.svg)
+
+Some LaTeX macros for UML Class Diagrams.
+
+Please go to the official repository at https://github.com/pgf-tikz/pgf-umlcd
+or the official mailing list at https://tug.org/mailman/listinfo/pgf-tikz to
+submit bug reports, request new features, etc.
+
+Please read pgf-umlcd-manual.pdf for more information.
+
+## License
+
+pgf-umlcd is released under the terms of both the LPPL v1.3c and the GPL v2.
diff --git a/graphics/pgf/contrib/pgf-umlcd/RELEASE_NOTES.md b/graphics/pgf/contrib/pgf-umlcd/RELEASE_NOTES.md
new file mode 100644
index 0000000000..818c0d327f
--- /dev/null
+++ b/graphics/pgf/contrib/pgf-umlcd/RELEASE_NOTES.md
@@ -0,0 +1,12 @@
+# Bug fixes
+
+This release contains mostly bugfixes but also some grand internal restructuring
+of the package. However, the latter should not be visible to the end user. If
+you encounter breakages please raise an issue on GitHub.
+
+- Patch for multiple inheritance
+- Add color settings, thanks Maarten van Dessel
+- Add support for static classes analogue to abstract classes
+- Changed from above/below to auto in association et al. Added possibility of optional argument
+- Move anchor=north before this umlcd style
+- Start rewrite as a TikZ library
diff --git a/graphics/pgf/contrib/pgf-umlcd/demo/color.tex b/graphics/pgf/contrib/pgf-umlcd/demo/color.tex
new file mode 100644
index 0000000000..798f4ae141
--- /dev/null
+++ b/graphics/pgf/contrib/pgf-umlcd/demo/color.tex
@@ -0,0 +1,14 @@
+\renewcommand{\umltextcolor}{red}
+\renewcommand{\umlfillcolor}{green}
+\renewcommand{\umldrawcolor}{blue}
+
+\begin{tikzpicture}
+ \begin{class}[text width=8cm]{ClassName}{0,0}
+ \attribute{name : attribute type}
+ \attribute{name : attribute type = default value}
+
+ \operation{name(parameter list) : type of value returned}
+ % virtual operation
+ \operation[0]{name(parameters list) : type of value returned}
+ \end{class}
+\end{tikzpicture} \ No newline at end of file
diff --git a/graphics/pgf/contrib/pgf-umlcd/demo/multiple-inheritance.tex b/graphics/pgf/contrib/pgf-umlcd/demo/multiple-inheritance.tex
new file mode 100644
index 0000000000..d97c5140ef
--- /dev/null
+++ b/graphics/pgf/contrib/pgf-umlcd/demo/multiple-inheritance.tex
@@ -0,0 +1,16 @@
+\begin{tikzpicture}%[show background grid]
+ \begin{class}[text width = 2cm]{TArg}{0, 0}
+ \end{class}
+
+ \begin{class}[text width = 2cm]{TGroup}{5, 0}
+ \end{class}
+
+ \begin{class}[text width = 2cm]{TProgInit}{10, 0}
+ \end{class}
+
+ \begin{class}[text width = 2cm]{TProgram}{5, -2}
+ \inherit{TProgInit}
+ \inherit{TGroup}
+ \inherit{TArg}
+ \end{class}
+\end{tikzpicture}
diff --git a/graphics/pgf/contrib/pgf-umlcd/description.html b/graphics/pgf/contrib/pgf-umlcd/description.html
new file mode 100644
index 0000000000..d077a85ed2
--- /dev/null
+++ b/graphics/pgf/contrib/pgf-umlcd/description.html
@@ -0,0 +1,2 @@
+<p>Some LaTeX macros for UML Class Diagrams.<a data-cke-saved-href="/pkg/pgf" href="/pkg/pgf">pgf</a><br></p>
+
diff --git a/graphics/pgf/contrib/pgf-umlcd/pgf-umlcd-manual.pdf b/graphics/pgf/contrib/pgf-umlcd/pgf-umlcd-manual.pdf
index 7e6fea67e1..6f9d497a2f 100644
--- a/graphics/pgf/contrib/pgf-umlcd/pgf-umlcd-manual.pdf
+++ b/graphics/pgf/contrib/pgf-umlcd/pgf-umlcd-manual.pdf
Binary files differ
diff --git a/graphics/pgf/contrib/pgf-umlcd/pgf-umlcd-manual.tex b/graphics/pgf/contrib/pgf-umlcd/pgf-umlcd-manual.tex
index 17a6edc6fd..393d436b63 100644
--- a/graphics/pgf/contrib/pgf-umlcd/pgf-umlcd-manual.tex
+++ b/graphics/pgf/contrib/pgf-umlcd/pgf-umlcd-manual.tex
@@ -68,7 +68,7 @@ keywordstyle=\color{blue}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{Drawing UML Class Diagram by using \texttt{pgf-umlcd}}
\author{\href{mailto:xuyuan.cn@gmail.com}{Yuan Xu}}
-\date{\today{}~(v0.2.1)}
+\date{\today{}~(v0.3)}
\maketitle
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -112,6 +112,8 @@ The \lstinline|\umlnote| use the same syntax as tikz command
\subsection{Inheritance and implement}
\subsubsection{Inheritance}
\demo{inheritance}
+\subsubsection{Multiple Inheritance}
+\demo{multiple-inheritance}
\subsubsection{Implement an interface}
\demo{implement-interface}
@@ -132,6 +134,13 @@ The \lstinline|\umlnote| use the same syntax as tikz command
\subsection{Package}
\demo{package}
+\section{Customization}
+\subsection{Color settings}
+The color of digram is defined by \lstinline|\umltextcolor|, \lstinline|\umldrawcolor| and \lstinline|\umlfillcolor|, such as:
+
+\demo{color}
+
+
\section{Examples}
\subsection{Abstract Factory}
\example{abstract-factory}
@@ -140,7 +149,9 @@ The \lstinline|\umlnote| use the same syntax as tikz command
Many people contributed to \texttt{pgf-umlcd} by reporting problems,
suggesting various improvements or submitting code. Here is a list of
these people: \href{mailto:martin.quinson@loria.fr}{Martin Quinson},
-and \href{mailto:johannes_pieper@yahoo.de}{Johannes Pieper}.
+\href{mailto:johannes_pieper@yahoo.de}{Johannes Pieper},
+\href{mailto:lwghsh@gmail.com}{sh w},
+and \href{mailto:maartenvandessel@hotmail.com}{Maarten van Dessel}.
\end{document}
%%% Local Variables:
diff --git a/graphics/pgf/contrib/pgf-umlcd/pgf-umlcd.sty b/graphics/pgf/contrib/pgf-umlcd/pgf-umlcd.sty
index 0062909b8d..3d37e9b69e 100644
--- a/graphics/pgf/contrib/pgf-umlcd/pgf-umlcd.sty
+++ b/graphics/pgf/contrib/pgf-umlcd/pgf-umlcd.sty
@@ -1,353 +1,10 @@
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Start of pgf-umlcd.sty
-%
-% Some macros for UML Class Diagrams.
-% Home page of project: http://pgf-umlcd.googlecode.com/
-% Author: Xu Yuan <xu@informatik.hu-berlin.de>, Humboldt University, Berlin
-% Style from: http://www.ibm.com/developerworks/cn/rational/r-uml/
-%
-
+% SPDX-License-Identifier: GPL-2.0-only OR LPPL-1.3c
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{pgf-umlcd}[2011/10/01 v0.3dev Some LaTeX macros for
-UML Class Diagrams.]
+\ProvidesPackage{pgf-umlcd}[2022/05/22 v0.3 Some LaTeX macros for UML Class Diagrams.]
\RequirePackage{tikz}
+\usetikzlibrary{umlcd}
-\usetikzlibrary{arrows,shapes.multipart,backgrounds,fit}
-\tikzstyle{help lines}+=[blue!50,very thin,dashed]
-
-\newcommand{\umltextcolor}{black}
-\newcommand{\umldrawcolor}{purple}
-\newcommand{\umlfillcolor}{yellow!20}
-\tikzstyle{umlcolor}=[color=\umldrawcolor,fill=\umlfillcolor,text=\umltextcolor]
-\tikzstyle{umlcd style}=[umlcolor, >=angle 90]
-
-\tikzstyle{package}=[matrix, column sep=1mm, row sep=1cm, node distance=2cm]
-\tikzstyle{packagename}=[rectangle, minimum height=2em]
-
-\tikzstyle{umlcd style implement line}=[color=\umldrawcolor, open triangle 45-,dashed]
-\tikzstyle{objectline}=[color=\umldrawcolor, diamond->]
-\tikzstyle{umlcd style inherit line}=[color=\umldrawcolor, open triangle 45-]
-\tikzstyle{splitline}=[color=\umldrawcolor, dotted,font=\itshape]
-
-\tikzstyle{umlcd style class}=[rectangle split, rectangle split parts=3,
-every text node part/.style={text centered},
-draw, minimum height=2em, umlcolor, minimum width=2cm, text width=5cm,
-minimum height=1cm, node distance=2cm]
-
-
-\tikzstyle{umlcd style dashed line}=[color=\umldrawcolor, >=angle 90,dashed]
-
-\tikzstyle{umlcd style school}=[]
-\newif\ifschool\schoolfalse
-\DeclareOption{school}{\tikzstyle{umlcd style school}=[rounded corners] \schooltrue}
-\newif\ifsimplified\simplifiedfalse
-\DeclareOption{simplified}{\simplifiedtrue}
+\DeclareOption{school}{\tikzset{umlcd style school/.style={rounded corners}}\pgfumlcd@schooltrue}
+\DeclareOption{simplified}{\pgfumlcd@simplifiedtrue}
\ProcessOptions\relax
-
-
-% declare layers
-\pgfdeclarelayer{background}
-\pgfdeclarelayer{connectionlayers}
-\pgfsetlayers{background,connectionlayers,main}
-
-\newcounter{umlcdClassAttributesNum}
-\newcounter{umlcdClassOperationsNum}
-\newcounter{umlcdClassAbstractClassNum}
-\newcounter{umlcdClassInterfaceNum}
-\newcounter{umlcdClassSplitPartNum}
-
-\def\umlcdPackageFit{}
-
-\newenvironment{class}[3][]%
-{
-\begin{classAndInterfaceCommon}{#1}{#2}{#3}
-}%
-{\calcuateNumberOfParts{}
-\node[this umlcd style, anchor=north] (\umlcdClassName) at (\umlcdClassPos)
- {\textbf{\umlcdClassName}
-\insertAttributesAndOperations{}
-};
-
-\end{classAndInterfaceCommon}
-}
-
-\newenvironment{interface}[3][]%
-{
-\begin{classAndInterfaceCommon}{#1}{#2}{#3}
-}%
-{\calcuateNumberOfParts{}
-\node[this umlcd style, anchor=north] (\umlcdClassName) at (\umlcdClassPos)
- {$<<$interface$>>$ \\ \textbf{\umlcdClassName}
-\insertAttributesAndOperations{}
-};
-
-\end{classAndInterfaceCommon}
-}
-
-\newenvironment{abstractclass}[3][]%
-{
-\begin{classAndInterfaceCommon}{#1}{#2}{#3}
-}%
-{\calcuateNumberOfParts{}
-\node[this umlcd style, anchor=north] (\umlcdClassName) at (\umlcdClassPos)
- {$<<$abstract$>>$ \\ \textbf{\umlcdClassName}
-\insertAttributesAndOperations{}
-};
-
-\end{classAndInterfaceCommon}
-}
-
-% TODO: here the name of \umlcdClassName and \umlObjectName should be
-% switched, it is only for reusing \classAndInterfaceCommon at the
-% moment.
-\newenvironment{object}[3][]%
-{
-\begin{classAndInterfaceCommon}{#1}{#2}{#3}
-\def\@instanceOf{}
-\def\@@instanceOf{}
-}%
-{
- % customized
- \ifsimplified
- \calcuateNumberOfParts{}
- \else
- \ifnum\c@umlcdClassOperationsNum>0
- \setcounter{umlcdClassSplitPartNum}{3}
- \protected@xdef\umlcdSplitPart{3}
- \else
- \setcounter{umlcdClassSplitPartNum}{2}
- \protected@xdef\umlcdSplitPart{2}
- \fi
- \fi
-
- \ifx\@instanceOf\@@instanceOf
- \def\umldObjectName{\umlcdClassName}
- \else
- \def\umldObjectName{\umlcdClassName : \@instanceOf}
- \fi
-
-\node[this umlcd style, anchor=north, umlcd style school] (\umlcdClassName) at (\umlcdClassPos)
- { \ifschool
- \textbf{\umldObjectName}
- \else
- \underline{\textbf{\umldObjectName}}
- \fi
- \insertAttributesAndOperations{}
-};
-
-\end{classAndInterfaceCommon}
-}
-
-\newcommand*{\insertAttributesAndOperations}
-{
- \ifnum\c@umlcdClassSplitPartNum>1
- \nodepart{second}
- \fi
- \umlcdClassAttributes
- \ifnum\c@umlcdClassSplitPartNum>2
- \nodepart{third}
- \fi
- \umlcdClassOperations
-}
-
-\newcommand*{\calcuateNumberOfParts}
-{
- % calcuate the number of parts
- \ifsimplified
- \setcounter{umlcdClassSplitPartNum}{1}
- \ifnum\c@umlcdClassAttributesNum>0
- \stepcounter{umlcdClassSplitPartNum}
- \fi
- \ifnum\c@umlcdClassOperationsNum>0
- \stepcounter{umlcdClassSplitPartNum}
- \fi
- \else
- \setcounter{umlcdClassSplitPartNum}{3}% three parts by default
- \fi
-
- \protected@xdef\umlcdSplitPart{3}
- \ifnum\c@umlcdClassSplitPartNum=1
- \protected@xdef\umlcdSplitPart{1}
- \fi
- \ifnum\c@umlcdClassSplitPartNum=2
- \protected@xdef\umlcdSplitPart{2}
- \fi
-}
-
-\newenvironment*{classAndInterfaceCommon}[3]
-{
-\def\umlcdClassName{#2}%
-\def\umlcdClassPos{#3}
-\def\umlcdClassAttributes{}%
-\def\umlcdClassOperations{}%
-\def\umlcdClassAbstractClass{}%
-\def\umlcdClassInterface{}%
-\setcounter{umlcdClassAttributesNum}{0}%
-\setcounter{umlcdClassOperationsNum}{0}%
-\setcounter{umlcdClassAbstractClassNum}{0}%
-\setcounter{umlcdClassInterfaceNum}{0}%
-\tikzstyle{this umlcd style}=[umlcd style class, rectangle split
- parts=\umlcdSplitPart, #1]
-}%
-{
-%% connections
-\begin{pgfonlayer}{connectionlayers}
-\ifnum\c@umlcdClassAbstractClassNum>0
-\foreach \c in {\umlcdClassAbstractClass}{
- \draw [umlcd style inherit line] (\c) -- (\umlcdClassName);
-}
-\fi
-
-\ifnum\c@umlcdClassInterfaceNum>0
-\foreach \c in {\umlcdClassInterface}{
- \draw [umlcd style implement line] (\c) -- (\umlcdClassName);
-}
-\fi
-\end{pgfonlayer}
-
-%% add to fit
-\let\umlcdPackageFitOld\umlcdPackageFit
-\protected@xdef\umlcdPackageFit{\umlcdPackageFitOld (\umlcdClassName)}
-}
-
-\newcommand{\attribute}[1]{%
-\ifnum\c@umlcdClassAttributesNum=0
-\protected@xdef\umlcdClassAttributes{#1}
-\else
-\let\umlcdClassAttributesOld\umlcdClassAttributes
-\protected@xdef\umlcdClassAttributes{\umlcdClassAttributesOld \ \newline
- #1}
-\fi
-\stepcounter{umlcdClassAttributesNum}
-}
-
-\newcommand{\operation}[2][1]{%
-\stepcounter{umlcdClassOperationsNum}
-
-\def\virtualoperation{#2}
-\ifnum0=#1
-\def\virtualoperation{\textit{#2}}
-\fi
-
-\ifnum\c@umlcdClassOperationsNum=1
-\protected@xdef\umlcdClassOperations{\virtualoperation}
-\else
-\let\umlcdClassOperationsOld\umlcdClassOperations
-\protected@xdef\umlcdClassOperations{\umlcdClassOperationsOld \ \newline
- \virtualoperation}
-\fi
-}
-
-\newcommand{\inherit}[1]
-{
-\stepcounter{umlcdClassAbstractClassNum}
-\ifnum\c@umlcdClassAbstractClassNum=1
-\protected@xdef\umlcdClassAbstractClass{#1}
-\else
-\let\umlcdClassAbstractClassOld\umlcdClassAbstractClass
-\protected@xdef\umlcdClassAbstractClass{\umlcdClassAbstractClassOld,
- #1}
-\fi
-}
-
-\newcommand{\implement}[1]
-{
-\stepcounter{umlcdClassInterfaceNum}
-\ifnum\c@umlcdClassInterfaceNum=1
-\protected@xdef\umlcdClassInterface{#1}
-\else
-\let\umlcdClassInterfaceOld\umlcdClassInterface
-\protected@xdef\umlcdClassInterface{\umlcdClassInterfaceOld,
- #1}
-\fi
-}
-
-\newcommand{\instanceOf}[1]{\def\@instanceOf{#1}}
-
-\newcommand{\association}[6]{
-\draw [umlcd style] (#1) -- (#4)
-node[near start, above]{#2}
-node[near start, below]{#3}
-node[near end, above]{#5}
-node[near end, below]{#6};
-}
-
-\newcommand{\unidirectionalAssociation}[4]{
-\draw [umlcd style, ->] (#1) -- (#4)
-node[near end, above]{#2}
-node[near end, below]{#3};
-}
-
-\newcommand{\aggregation}[4]
-{
-\draw[umlcd style, open diamond->] (#1) -- (#4)
-node[near end, above]{#2}
-node[near end, below]{#3};
-}
-
-\newcommand{\composition}[4]
-{
-\draw[umlcd style, fill=\umldrawcolor, diamond->] (#1) -- (#4)
-node[near end, above]{#2}
-node[near end, below]{#3};
-}
-
-\newenvironment{package}[1]{
-\def\umlcdPackageFit{}
-\def\umlcdPackageName{#1}
-}{
- \begin{pgfonlayer}{background}
- \node[umlcd style, draw, inner sep=0.5cm, fit = \umlcdPackageFit] (\umlcdPackageName) {};
- \node[umlcd style, draw, outer ysep=-0.5, anchor=south west] (\umlcdPackageName caption) at
- (\umlcdPackageName.north west) {\umlcdPackageName};
- \end{pgfonlayer}
-}
-
-\newcommand{\switchUmlcdSchool}{
- \ifschool
- \tikzstyle{umlcd style school}=[]
- \schoolfalse
- \else
- \tikzstyle{umlcd style school}=[rounded corners]
- \schooltrue
- \fi
-}
-
-\pgfdeclareshape{umlcdnote}{
-\inheritsavedanchors[from=rectangle] % this is nearly a rectangle
-\inheritanchorborder[from=rectangle]
-\inheritanchor[from=rectangle]{center}
-\inheritanchor[from=rectangle]{north}
-\inheritanchor[from=rectangle]{south}
-\inheritanchor[from=rectangle]{west}
-\inheritanchor[from=rectangle]{east}
-% ... and possibly more
-\backgroundpath{% this is new
-% store lower right in xa/ya and upper right in xb/yb
-\southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y
-\northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y
-% compute corner of flipped page
-\pgf@xc=\pgf@xb \advance\pgf@xc by-10pt % this should be a parameter
-\pgf@yc=\pgf@yb \advance\pgf@yc by-10pt
-% construct main path
-\pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}}
-\pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@yb}}
-\pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yb}}
-\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yc}}
-\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@ya}}
-\pgfpathclose
-% add little corner
-\pgfpathmoveto{\pgfpoint{\pgf@xc}{\pgf@yb}}
-\pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yc}}
-\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yc}}
-\pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yc}}
-}
-}
-
-\newcommand{\umlnote}[1][]{
- \node[umlcd style, anchor=north, draw,shape=umlcdnote, text width=4cm, #1]
-}
-
-%%% End of pgf-umlcd.sty
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ No newline at end of file
diff --git a/graphics/pgf/contrib/pgf-umlcd/tikzlibraryumlcd.code.tex b/graphics/pgf/contrib/pgf-umlcd/tikzlibraryumlcd.code.tex
new file mode 100644
index 0000000000..63b05580f7
--- /dev/null
+++ b/graphics/pgf/contrib/pgf-umlcd/tikzlibraryumlcd.code.tex
@@ -0,0 +1,402 @@
+% SPDX-License-Identifier: GPL-2.0-only OR LPPL-1.3c
+
+\usetikzlibrary{arrows,shapes.multipart,backgrounds,fit}
+
+%
+% Utilities
+%
+
+\def\pgfumlcd@ifx#1#2{%
+ \ifx#1#2%
+ \expandafter\pgfutil@firstoftwo
+ \else
+ \expandafter\pgfutil@secondoftwo
+ \fi}
+
+\def\pgfumlcd@ifdim#1#2#3{%
+ \ifdim\dimexpr#1\relax#2\dimexpr#3\relax
+ \expandafter\pgfutil@firstoftwo
+ \else
+ \expandafter\pgfutil@secondoftwo
+ \fi}
+
+\def\pgfumlcd@ifnum#1#2#3{%
+ \ifnum\numexpr#1\relax#2\numexpr#3\relax
+ \expandafter\pgfutil@firstoftwo
+ \else
+ \expandafter\pgfutil@secondoftwo
+ \fi}
+
+\def\pgfumlcd@newif#1{%
+ \csname newif\expandafter\endcsname\csname ifpgfumlcd@#1\endcsname
+ \expandafter\def\csname pgfumlcd@if#1\expandafter\endcsname\expandafter{%
+ \csname ifpgfumlcd@#1\endcsname
+ \expandafter\pgfutil@firstoftwo
+ \else
+ \expandafter\pgfutil@secondoftwo
+ \fi}%
+}
+
+\expandafter\let\expandafter\pgfumlcd@xdef\csname\ifcsname protected@xdef\endcsname protected@\fi xdef\endcsname
+
+\def\umltextcolor{black}
+\def\umldrawcolor{purple}
+\def\umlfillcolor{yellow!20}
+
+\tikzset{%
+ help lines/.append style = {blue!50,very thin,dashed},
+ umlcolor/.style = {color=\umldrawcolor,fill=\umlfillcolor,text=\umltextcolor},
+ umlcd style/.style = {umlcolor, >=angle 90},
+ package/.style = {matrix, column sep=1mm, row sep=1cm, node distance=2cm},
+ packagename/.style = {rectangle, minimum height=2em},
+ umlcd style implement line/.style = {color=\umldrawcolor, open triangle 45-,dashed},
+ objectline/.style = {color=\umldrawcolor, diamond->},
+ umlcd style inherit line/.style = {color=\umldrawcolor, open triangle 45-},
+ splitline/.style = {color=\umldrawcolor, dotted,font=\pgfutil@font@itshape},
+ umlcd style class/.style = {rectangle split, rectangle split parts=3,
+ every text node part/.style={text centered},
+ draw, minimum height=2em, umlcolor, minimum width=2cm, text width=5cm,
+ minimum height=1cm, node distance=2cm},
+ umlcd style dashed line/.style = {color=\umldrawcolor, >=angle 90,dashed},
+ umlcd style school/.style = {},
+}
+
+\pgfumlcd@newif{school}
+\pgfumlcd@newif{simplified}
+
+% declare layers
+\pgfdeclarelayer{background}
+\pgfdeclarelayer{connectionlayers}
+\pgfsetlayers{background,connectionlayers,main}
+
+\newcount\pgfumlcd@ClassAttributesNum
+\newcount\pgfumlcd@ClassOperationsNum
+\newcount\pgfumlcd@ClassAbstractClassNum
+\newcount\pgfumlcd@ClassInterfaceNum
+\newcount\pgfumlcd@ClassSplitPartNum
+
+\def\pgfumlcd@PackageFit{}
+
+\def\pgfumlcd@class{\pgfutil@ifnextchar[{\pgfumlcd@class@}{\pgfumlcd@class@[]}}
+\def\pgfumlcd@class@[#1]#2#3{%
+ \pgfumlcd@classAndInterfaceCommon{#1}{#2}{#3}%
+}
+\def\endpgfumlcd@class{%
+ \pgfumlcd@calcuateNumberOfParts{}%
+ \node[anchor=north,this umlcd style] (\pgfumlcd@ClassName) at (\pgfumlcd@ClassPos) {%
+ {\pgfutil@font@bfseries\pgfumlcd@ClassName} % <-- explicit space
+ \pgfumlcd@insertAttributesAndOperations{}%
+ };%
+ \endpgfumlcd@classAndInterfaceCommon
+}
+
+\def\pgfumlcd@interface{\pgfutil@ifnextchar[{\pgfumlcd@interface@}{\pgfumlcd@interface@[]}}
+\def\pgfumlcd@interface@[#1]#2#3{%
+ \pgfumlcd@classAndInterfaceCommon{#1}{#2}{#3}%
+}
+\def\endpgfumlcd@interface{%
+ \pgfumlcd@calcuateNumberOfParts{}%
+ \node[anchor=north,this umlcd style] (\pgfumlcd@ClassName) at (\pgfumlcd@ClassPos) {%
+ $<<$interface$>>$\break
+ {\pgfutil@font@bfseries\pgfumlcd@ClassName} % <-- explicit space
+ \pgfumlcd@insertAttributesAndOperations{}%
+ };%
+ \endpgfumlcd@classAndInterfaceCommon
+}
+
+\def\pgfumlcd@abstractclass{\pgfutil@ifnextchar[{\pgfumlcd@abstractclass@}{\pgfumlcd@abstractclass@[]}}
+\def\pgfumlcd@abstractclass@[#1]#2#3{%
+ \pgfumlcd@classAndInterfaceCommon{#1}{#2}{#3}%
+}
+\def\endpgfumlcd@abstractclass{%
+ \pgfumlcd@calcuateNumberOfParts{}
+ \node[anchor=north,this umlcd style] (\pgfumlcd@ClassName) at (\pgfumlcd@ClassPos) {%
+ $<<$abstract$>>$\break
+ {\pgfutil@font@bfseries\pgfumlcd@ClassName} % <-- explicit space
+ \pgfumlcd@insertAttributesAndOperations{}%
+ };%
+ \endpgfumlcd@classAndInterfaceCommon
+}
+
+\def\pgfumlcd@staticclass{\pgfutil@ifnextchar[{\pgfumlcd@staticclass@}{\pgfumlcd@staticclass@[]}}
+\def\pgfumlcd@staticclass@[#1]#2#3{%
+ \pgfumlcd@classAndInterfaceCommon{#1}{#2}{#3}%
+}
+\def\endpgfumlcd@staticclass{%
+ \pgfumlcd@calcuateNumberOfParts{}
+ \node[anchor=north,this umlcd style] (\pgfumlcd@ClassName) at (\pgfumlcd@ClassPos) {%
+ $<<$static$>>$\break
+ {\pgfutil@font@bfseries\pgfumlcd@ClassName} % <-- explicit space
+ \pgfumlcd@insertAttributesAndOperations{}%
+ };%
+ \endpgfumlcd@classAndInterfaceCommon
+}
+
+% TODO: here the name of \pgfumlcd@ClassName and \umlObjectName should be
+% switched, it is only for reusing \classAndInterfaceCommon at the
+% moment.
+\def\pgfumlcd@object{\pgfutil@ifnextchar[{\pgfumlcd@object@}{\pgfumlcd@object@[]}}
+\def\pgfumlcd@object@[#1]#2#3{%
+ \pgfumlcd@classAndInterfaceCommon{#1}{#2}{#3}%
+ \def\pgfumlcd@@instanceOf{}
+}
+\def\endpgfumlcd@object{%
+ % customized
+ \pgfumlcd@ifsimplified{%
+ \pgfumlcd@calcuateNumberOfParts{}%
+ }{%
+ \pgfumlcd@ifnum{\pgfumlcd@ClassOperationsNum}{>}{0}{%
+ \pgfumlcd@ClassSplitPartNum=3
+ \pgfumlcd@xdef\pgfumlcd@SplitPart{3}%
+ }{%
+ \pgfumlcd@ClassSplitPartNum=2
+ \pgfumlcd@xdef\pgfumlcd@SplitPart{2}%
+ }%
+ }%
+ \pgfumlcd@ifx{\pgfumlcd@@instanceOf}{\pgfutil@empty}{%
+ \def\pgfumlcd@ObjectName{\pgfumlcd@ClassName}%
+ }{%
+ \def\pgfumlcd@ObjectName{\pgfumlcd@ClassName : \pgfumlcd@@instanceOf}%
+ }%
+ \node[anchor=north,this umlcd style,umlcd style school] (\pgfumlcd@ClassName) at (\pgfumlcd@ClassPos) {%
+ \pgfumlcd@ifschool{%
+ {\pgfutil@font@bfseries\pgfumlcd@ObjectName}%
+ }{%
+ \underline{\pgfutil@font@bfseries\pgfumlcd@ObjectName}%
+ } % <-- explicit space
+ \pgfumlcd@insertAttributesAndOperations{}%
+ };%
+ \endpgfumlcd@classAndInterfaceCommon
+}
+
+\def\pgfumlcd@insertAttributesAndOperations{%
+ \pgfumlcd@ifnum{\pgfumlcd@ClassSplitPartNum}{>}{1}{%
+ \nodepart{second}%
+ }{}%
+ \pgfumlcd@ClassAttributes
+ \pgfumlcd@ifnum{\pgfumlcd@ClassSplitPartNum}{>}{2}{%
+ \nodepart{third}%
+ }{}%
+ \pgfumlcd@ClassOperations
+}
+
+\def\pgfumlcd@calcuateNumberOfParts{%
+ % calcuate the number of parts
+ \pgfumlcd@ifsimplified{%
+ \pgfumlcd@ClassSplitPartNum=1
+ \pgfumlcd@ifnum{\pgfumlcd@ClassAttributesNum}{>}{0}{%
+ \advance\pgfumlcd@ClassSplitPartNum by 1
+ }{}%
+ \pgfumlcd@ifnum{\pgfumlcd@ClassOperationsNum}{>}{0}{%
+ \advance\pgfumlcd@ClassSplitPartNum by 1
+ }{}%
+ }{%
+ \pgfumlcd@ClassSplitPartNum=3 % three parts by default
+ }%
+ \pgfumlcd@xdef\pgfumlcd@SplitPart{3}
+ \pgfumlcd@ifnum{\pgfumlcd@ClassSplitPartNum}{=}{1}{%
+ \pgfumlcd@xdef\pgfumlcd@SplitPart{1}%
+ }{}%
+ \pgfumlcd@ifnum{\pgfumlcd@ClassSplitPartNum}{=}{2}{%
+ \pgfumlcd@xdef\pgfumlcd@SplitPart{2}%
+ }{}%
+}
+
+\def\pgfumlcd@classAndInterfaceCommon#1#2#3{%
+ \def\pgfumlcd@ClassName{#2}%
+ \def\pgfumlcd@ClassPos{#3}
+ \def\pgfumlcd@ClassAttributes{}%
+ \def\pgfumlcd@ClassOperations{}%
+ \def\pgfumlcd@ClassAbstractClass{}%
+ \def\pgfumlcd@ClassInterface{}%
+ \pgfumlcd@ClassAttributesNum=0
+ \pgfumlcd@ClassOperationsNum=0
+ \pgfumlcd@ClassAbstractClassNum=0
+ \pgfumlcd@ClassInterfaceNum=0
+ \tikzset{%
+ this umlcd style/.style={%
+ umlcd style class,%
+ rectangle split parts=\pgfumlcd@SplitPart,%
+ #1}%
+ }
+}%
+\def\endpgfumlcd@classAndInterfaceCommon{%
+ %% connections
+ \pgfonlayer{connectionlayers}%
+ \pgfumlcd@ifnum{\pgfumlcd@ClassAbstractClassNum}{>}{0}{%
+ \foreach \c in \pgfumlcd@ClassAbstractClass {%
+ \draw [umlcd style inherit line] (\c) -- (\pgfumlcd@ClassName);%
+ }%
+ }{}%
+ \pgfumlcd@ifnum{\pgfumlcd@ClassInterfaceNum}{>}{0}{%
+ \foreach \c in \pgfumlcd@ClassInterface {%
+ \draw [umlcd style implement line] (\c) -- (\pgfumlcd@ClassName);%
+ }%
+ }{}%
+ \endpgfonlayer
+ %% add to fit
+ \let\pgfumlcd@PackageFitOld\pgfumlcd@PackageFit
+ \pgfumlcd@xdef\pgfumlcd@PackageFit{\pgfumlcd@PackageFitOld (\pgfumlcd@ClassName)}%
+}
+
+\def\pgfumlcd@attribute#1{%
+ \pgfumlcd@ifnum{\pgfumlcd@ClassAttributesNum}{=}{0}{%
+ \pgfumlcd@xdef\pgfumlcd@ClassAttributes{#1}%
+ }{%
+ \let\pgfumlcd@ClassAttributesOld\pgfumlcd@ClassAttributes
+ \pgfumlcd@xdef\pgfumlcd@ClassAttributes{\pgfumlcd@ClassAttributesOld\break#1}%
+ }%
+ \advance\pgfumlcd@ClassAttributesNum by 1
+}
+
+\def\pgfumlcd@operation{\pgfutil@ifnextchar[{\pgfumlcd@operation@}{\pgfumlcd@operation@[1]}}
+\def\pgfumlcd@operation@[#1]#2{%
+ \advance\pgfumlcd@ClassOperationsNum by 1
+ \def\pgfumlcd@virtualoperation{#2}
+ \pgfumlcd@ifnum{0}{=}{#1}{%
+ \def\pgfumlcd@virtualoperation{{\pgfutil@font@itshape#2}}%
+ }{}%
+ \pgfumlcd@ifnum{\pgfumlcd@ClassOperationsNum}{=}{1}{%
+ \pgfumlcd@xdef\pgfumlcd@ClassOperations{\pgfumlcd@virtualoperation}%
+ }{%
+ \let\pgfumlcd@ClassOperationsOld\pgfumlcd@ClassOperations
+ \pgfumlcd@xdef\pgfumlcd@ClassOperations{\pgfumlcd@ClassOperationsOld\break\pgfumlcd@virtualoperation}%
+ }%
+}
+
+\def\pgfumlcd@inherit#1{%
+ \advance\pgfumlcd@ClassAbstractClassNum by 1
+ \pgfumlcd@ifnum{\pgfumlcd@ClassAbstractClassNum}{=}{1}{%
+ \pgfumlcd@xdef\pgfumlcd@ClassAbstractClass{#1}%
+ }{%
+ \let\pgfumlcd@ClassAbstractClassOld\pgfumlcd@ClassAbstractClass
+ \pgfumlcd@xdef\pgfumlcd@ClassAbstractClass{\pgfumlcd@ClassAbstractClassOld, #1}%
+ }%
+}
+
+\def\pgfumlcd@implement#1{%
+ \advance\pgfumlcd@ClassInterfaceNum by 1
+ \pgfumlcd@ifnum{\pgfumlcd@ClassInterfaceNum}{=}{1}{%
+ \pgfumlcd@xdef\pgfumlcd@ClassInterface{#1}
+ }{%
+ \let\pgfumlcd@ClassInterfaceOld\pgfumlcd@ClassInterface
+ \pgfumlcd@xdef\pgfumlcd@ClassInterface{\pgfumlcd@ClassInterfaceOld, #1}
+ }%
+}
+
+\def\pgfumlcd@instanceOf#1{\def\pgfumlcd@@instanceOf{#1}}
+
+\def\pgfumlcd@association{\pgfutil@ifnextchar[{\pgfumlcd@association@}{\pgfumlcd@association@[]}}
+\def\pgfumlcd@association@[#1]#2#3#4#5#6#7{%
+ \draw [umlcd style,#1] (#2) -- (#5)
+ node[near start, auto]{#3}
+ node[near start, auto, swap]{#4}
+ node[near end, auto]{#6}
+ node[near end, auto, swap]{#7};%
+}
+
+\def\pgfumlcd@unidirectionalAssociation{%
+ \pgfutil@ifnextchar[{\pgfumlcd@unidirectionalAssociation@}{\pgfumlcd@unidirectionalAssociation@[]}}
+\def\pgfumlcd@unidirectionalAssociation@[#1]#2#3#4#5{%
+ \draw [umlcd style,->,#1] (#2) -- (#5)
+ node[near end, auto]{#3}
+ node[near end, auto, swap]{#4};%
+}
+
+\def\pgfumlcd@aggregation{\pgfutil@ifnextchar[{\pgfumlcd@aggregation@}{\pgfumlcd@aggregation@[]}}
+\def\pgfumlcd@aggregation@[#1]#2#3#4#5{%
+ \draw[umlcd style,open diamond->,#1] (#2) -- (#5)
+ node[near end, auto]{#3}
+ node[near end, auto, swap]{#4};%
+}
+
+\def\pgfumlcd@composition{\pgfutil@ifnextchar[{\pgfumlcd@composition@}{\pgfumlcd@composition@[]}}
+\def\pgfumlcd@composition@[#1]#2#3#4#5{%
+ \draw[umlcd style,fill=\umldrawcolor,diamond->,#1] (#2) -- (#5)
+ node[near end, auto]{#3}
+ node[near end, auto, swap]{#4};%
+}
+
+\def\pgfumlcd@package#1{%
+ \def\pgfumlcd@PackageFit{}%
+ \def\pgfumlcd@PackageName{#1}%
+}
+\def\endpgfumlcd@package{%
+ \pgfonlayer{background}%
+ \node[umlcd style,draw,inner sep=0.5cm,fit=\pgfumlcd@PackageFit] (\pgfumlcd@PackageName) {};%
+ \node[umlcd style,draw,outer ysep=-0.5,anchor=south west] (\pgfumlcd@PackageName caption) at
+ (\pgfumlcd@PackageName.north west) {\pgfumlcd@PackageName};%
+ \endpgfonlayer
+}
+
+\def\switchUmlcdSchool{%
+ \pgfumlcd@ifschool{%
+ \tikzset{umlcd style school/.style={}}%
+ \pgfumlcd@schoolfalse
+ }{%
+ \tikzset{umlcd style school/.style = {rounded corners}}%
+ \pgfumlcd@schooltrue
+ }%
+}
+
+\pgfdeclareshape{umlcdnote}{%
+ \inheritsavedanchors[from=rectangle]% this is nearly a rectangle
+ \inheritanchorborder[from=rectangle]%
+ \inheritanchor[from=rectangle]{center}%
+ \inheritanchor[from=rectangle]{north}%
+ \inheritanchor[from=rectangle]{south}%
+ \inheritanchor[from=rectangle]{west}%
+ \inheritanchor[from=rectangle]{east}%
+ % ... and possibly more
+ \backgroundpath{% this is new
+ % store lower right in xa/ya and upper right in xb/yb
+ \southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y
+ \northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y
+ % compute corner of flipped page
+ \pgf@xc=\pgf@xb \advance\pgf@xc by-10pt % this should be a parameter
+ \pgf@yc=\pgf@yb \advance\pgf@yc by-10pt
+ % construct main path
+ \pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}}%
+ \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@yb}}%
+ \pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yb}}%
+ \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yc}}%
+ \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@ya}}%
+ \pgfpathclose
+ % add little corner
+ \pgfpathmoveto{\pgfpoint{\pgf@xc}{\pgf@yb}}%
+ \pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yc}}%
+ \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yc}}%
+ \pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yc}}%
+ }%
+}
+
+\def\pgfumlcd@umlnote{\pgfutil@ifnextchar[{\pgfumlcd@umlnote@}{\pgfumlcd@umlnote@[]}}
+\def\pgfumlcd@umlnote@[#1]{%
+ \node[anchor=north,draw,shape=umlcdnote,text width=4cm,umlcd style,#1]%
+}
+
+\tikzaddtikzonlycommandshortcutlet{\class}{\pgfumlcd@class}
+\tikzaddtikzonlycommandshortcutlet{\endclass}{\endpgfumlcd@class}
+\tikzaddtikzonlycommandshortcutlet{\interface}{\pgfumlcd@interface}
+\tikzaddtikzonlycommandshortcutlet{\endinterface}{\endpgfumlcd@interface}
+\tikzaddtikzonlycommandshortcutlet{\abstractclass}{\pgfumlcd@abstractclass}
+\tikzaddtikzonlycommandshortcutlet{\endabstractclass}{\endpgfumlcd@abstractclass}
+\tikzaddtikzonlycommandshortcutlet{\staticclass}{\pgfumlcd@staticclass}
+\tikzaddtikzonlycommandshortcutlet{\endstaticclass}{\endpgfumlcd@staticclass}
+\tikzaddtikzonlycommandshortcutlet{\object}{\pgfumlcd@object}
+\tikzaddtikzonlycommandshortcutlet{\endobject}{\endpgfumlcd@object}
+\tikzaddtikzonlycommandshortcutlet{\classAndInterfaceCommon}{\pgfumlcd@classAndInterfaceCommon}
+\tikzaddtikzonlycommandshortcutlet{\endclassAndInterfaceCommon}{\endpgfumlcd@classAndInterfaceCommon}
+\tikzaddtikzonlycommandshortcutlet{\package}{\pgfumlcd@package}
+\tikzaddtikzonlycommandshortcutlet{\endpackage}{\endpgfumlcd@package}
+
+\tikzaddtikzonlycommandshortcutlet{\attribute}{\pgfumlcd@attribute}
+\tikzaddtikzonlycommandshortcutlet{\operation}{\pgfumlcd@operation}
+\tikzaddtikzonlycommandshortcutlet{\inherit}{\pgfumlcd@inherit}
+\tikzaddtikzonlycommandshortcutlet{\implement}{\pgfumlcd@implement}
+\tikzaddtikzonlycommandshortcutlet{\instanceOf}{\pgfumlcd@instanceOf}
+\tikzaddtikzonlycommandshortcutlet{\association}{\pgfumlcd@association}
+\tikzaddtikzonlycommandshortcutlet{\unidirectionalAssociation}{\pgfumlcd@unidirectionalAssociation}
+\tikzaddtikzonlycommandshortcutlet{\aggregation}{\pgfumlcd@aggregation}
+\tikzaddtikzonlycommandshortcutlet{\composition}{\pgfumlcd@composition}
+\tikzaddtikzonlycommandshortcutlet{\umlnote}{\pgfumlcd@umlnote}