summaryrefslogtreecommitdiff
path: root/graphics/pmdraw
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-11-08 03:02:04 +0000
committerNorbert Preining <norbert@preining.info>2023-11-08 03:02:04 +0000
commitdada699771828d1aa3c78ecf55a2131e5f5799f3 (patch)
tree454888fc413a3cff3d4aec62d5950c02446c364e /graphics/pmdraw
parent02646b6e89ef69971235e0c883e86fd746955e2b (diff)
CTAN sync 202311080302
Diffstat (limited to 'graphics/pmdraw')
-rw-r--r--graphics/pmdraw/README.md73
-rw-r--r--graphics/pmdraw/examples/example-1.tex36
-rw-r--r--graphics/pmdraw/examples/example-10.tex37
-rw-r--r--graphics/pmdraw/examples/example-11.tex37
-rw-r--r--graphics/pmdraw/examples/example-12.tex101
-rw-r--r--graphics/pmdraw/examples/example-13.tex126
-rw-r--r--graphics/pmdraw/examples/example-14.tex76
-rw-r--r--graphics/pmdraw/examples/example-15.tex76
-rw-r--r--graphics/pmdraw/examples/example-16.tex127
-rw-r--r--graphics/pmdraw/examples/example-17.tex70
-rw-r--r--graphics/pmdraw/examples/example-18.tex52
-rw-r--r--graphics/pmdraw/examples/example-19.tex53
-rw-r--r--graphics/pmdraw/examples/example-2.tex39
-rw-r--r--graphics/pmdraw/examples/example-20.tex171
-rw-r--r--graphics/pmdraw/examples/example-21.tex183
-rw-r--r--graphics/pmdraw/examples/example-22.tex179
-rw-r--r--graphics/pmdraw/examples/example-23.tex179
-rw-r--r--graphics/pmdraw/examples/example-24.tex160
-rw-r--r--graphics/pmdraw/examples/example-25.tex63
-rw-r--r--graphics/pmdraw/examples/example-3.tex53
-rw-r--r--graphics/pmdraw/examples/example-4.tex77
-rw-r--r--graphics/pmdraw/examples/example-5.tex118
-rw-r--r--graphics/pmdraw/examples/example-6.tex55
-rw-r--r--graphics/pmdraw/examples/example-7.tex63
-rw-r--r--graphics/pmdraw/examples/example-8.tex63
-rw-r--r--graphics/pmdraw/examples/example-9.tex37
-rw-r--r--graphics/pmdraw/pmdraw.pdfbin0 -> 376051 bytes
-rw-r--r--graphics/pmdraw/pmdraw.sty903
-rw-r--r--graphics/pmdraw/pmdraw.tex2811
29 files changed, 6018 insertions, 0 deletions
diff --git a/graphics/pmdraw/README.md b/graphics/pmdraw/README.md
new file mode 100644
index 0000000000..a2feb8f4e5
--- /dev/null
+++ b/graphics/pmdraw/README.md
@@ -0,0 +1,73 @@
+pmdraw
+======
+
+<!--
+*------------------------------*
+|0````````````````````````````5|
+|`````____````____`````````````|
+|````|MFMF\ /MFMF|````````````|
+|````|MF|MF\/MF|MF|````````````|
+|````|MF|\MFMF/|MF|_______`````|
+|````|MF|``````|MFMFMFMFMF|````|
+|````|MF|``````|MF|````````````|
+|````|MF|``````|MF|___`````````|
+|``````````````|MFMFMF|````````|
+|``````````````|MF|````````````|
+|``````````````|MF|````````````|
+|``````````````|MF|````````````|
+|3````````````````````````````8|
+*------------------------------*
+-->
+
+
+The `pmdraw` package allows you to draw elements of the Partition
+Monoids, commonly referred to diagrams. The package provides a lot of
+flexibility to draw most diagrams and can be customised as needed.
+
+The package makes use of the `tikz` and `keyval` packages.
+
+
+Usage
+-----
+
+The usage of the package requires some basic understanding of
+partition diagrams as well as the interface used. Please read the
+manual for a complete explanation.
+
+
+Contact
+-------
+
+If you discover a bug, please be so kind and send me a minimum working
+example of the bug in action and I will work on fixing it. My details
+are <matthias.ypg37@slmail.me>.
+
+
+Author
+-------
+
+- Matthias Fresacher
+
+
+License
+-------
+
+Copyright 2023-10-16 Matthias Fresacher
+
+This work may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3
+of this license or (at your option) any later version.
+The latest version of this license is found via
+<http://www.latex-project.org/lppl.txt>.
+
+This work has the LPPL maintenance status `maintained`.
+
+The Current Maintainer of this work is Matthias Fresacher.
+
+
+Contents
+-------
+
+This work consists of the files `pmdraw.sty`, `pmdraw.tex` and the
+examples in the folder `examples`, in addition to the derived file
+`pmdraw.pdf`.
diff --git a/graphics/pmdraw/examples/example-1.tex b/graphics/pmdraw/examples/example-1.tex
new file mode 100644
index 0000000000..74ee80e96b
--- /dev/null
+++ b/graphics/pmdraw/examples/example-1.tex
@@ -0,0 +1,36 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |`````````````````````````````x|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````````````````````|
+% *------------------------------*
+
+\pmdBrick[ % Options
+ degree=5,
+ levels top=4,
+ levels bottom=3
+]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ [level=2]{2}{4}
+ [level=3]{2}{5}
+ [level=4]{1}{5}
+}{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ [level=2]{2}{4}
+ [level=3]{2}{5}
+}{ % Transversal edges
+ \pmdEmpty
+} \ No newline at end of file
diff --git a/graphics/pmdraw/examples/example-10.tex b/graphics/pmdraw/examples/example-10.tex
new file mode 100644
index 0000000000..ae6535244e
--- /dev/null
+++ b/graphics/pmdraw/examples/example-10.tex
@@ -0,0 +1,37 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |`````````````````````````````x|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````````````````````|
+% *------------------------------*
+
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=17
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ [height=1.75]{11}{1}
+ [height=1.5]{12}{2}
+ [height=1.25]{13}{3}
+ [height=1]{14}{4}
+ [height=0.75]{15}{5}
+ [height=0.5]{16}{6}
+ [height=0.25]{17}{7}
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pmdraw/examples/example-11.tex b/graphics/pmdraw/examples/example-11.tex
new file mode 100644
index 0000000000..84c6ae8a93
--- /dev/null
+++ b/graphics/pmdraw/examples/example-11.tex
@@ -0,0 +1,37 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |`````````````````````````````x|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````````````````````|
+% *------------------------------*
+
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=14
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ [height=1.75]{11}{1}
+ [height=1.25]{12}{2}
+ [height=0.75]{13}{3}
+ [height=0.25]{14}{4}
+ [height=0.5]{1}{11}
+ [height=1]{2}{12}
+ [height=1.5]{3}{13}
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pmdraw/examples/example-12.tex b/graphics/pmdraw/examples/example-12.tex
new file mode 100644
index 0000000000..2e72dc7519
--- /dev/null
+++ b/graphics/pmdraw/examples/example-12.tex
@@ -0,0 +1,101 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |`````````````````````````````x|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````````````````````|
+% *------------------------------*
+
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=16,
+ row sep=3, % Must be before levels key
+ levels=3,
+ vertices options={
+ \fill[red] (#1,#2) circle (.5);
+ },
+ edges upper={very thick},
+ edges transversal={red,very thick},
+ brace={
+ left=1,
+ right=4,
+ label={4},
+ options={
+ \draw [
+ red,
+ very thick,
+ decorate,
+ decoration={calligraphic brace,mirror,amplitude=6pt}
+ ] (#1-0.17,-0.5) -- (#2+0.17,-0.5) node[pos=0.5,below=6pt]{\(#3\)};
+ }
+ }
+ ]{ % Upper non transversal edges
+ {4}{5}
+ [ % Options
+ options={
+ \draw[blue] (#1,3) arc (180:270:\pmdraw{edgeHeight}); % Draw left arch
+ \draw[blue] (#1+\pmdraw{edgeHeight},3-\pmdraw{edgeHeight}) -- (#2-\pmdraw{edgeHeight},3-\pmdraw{edgeHeight}); % Draw straight line
+ \draw[blue] (#2-\pmdraw{edgeHeight},3-\pmdraw{edgeHeight}) arc (270:360:\pmdraw{edgeHeight}); % Draw right arc
+ }
+ ]{4}{6}
+ [level=2]{4}{7}
+ [level=3]{4}{8}
+ }{ % Lower non transversal edges
+ {4}{5}
+ [
+ options={
+ \draw[green] (#1,0) arc (180:90:\pmdraw{edgeHeight}); % Draw left arch
+ \draw[green] (#1+\pmdraw{edgeHeight},\pmdraw{edgeHeight}) -- (#2-\pmdraw{edgeHeight},\pmdraw{edgeHeight}); % Draw straight line
+ \draw[green] (#2-\pmdraw{edgeHeight},\pmdraw{edgeHeight}) arc (90:0:\pmdraw{edgeHeight}); % Draw right arc
+ }
+ ]{4}{6}
+ [level=2]{4}{7}
+ [level=3]{4}{8}
+ }
+ { % Transversal edges
+ [height=1.75]{11}{1}
+ [height=1.25]{12}{2}
+ [height=0.75]{13}{3}
+ [height=0.25]{14}{4}
+ [height=0.5]{1}{11}
+ [height=1]{2}{12}
+ [height=1.5]{3}{13}
+ [
+ options={
+ \draw[dashed] (#1, 3) -- (#2, 0); % Draw straight line
+ }
+ ]{16}{16}
+ {15}{15}
+ }
+ }
+ { % Brick 2
+ [ % Options
+ degree=14,
+ row sep=3, % Must be before levels key
+ levels=3
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ [height=1.75]{11}{1}
+ [height=1.25]{12}{2}
+ [height=0.75]{13}{3}
+ [height=0.25]{14}{4}
+ [height=0.5]{1}{11}
+ [height=1]{2}{12}
+ [height=1.5]{3}{13}
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pmdraw/examples/example-13.tex b/graphics/pmdraw/examples/example-13.tex
new file mode 100644
index 0000000000..716e8b1165
--- /dev/null
+++ b/graphics/pmdraw/examples/example-13.tex
@@ -0,0 +1,126 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |`````````````````````````````x|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````````````````````|
+% *------------------------------*
+
+\pmdProduct
+[ % Options
+ row sep=3,
+ diagram sep=2,
+ dots options={
+ \draw (#1,#2) node[red] {\(\dots\dots\)};
+ }
+]{ % Added edges
+ {1}{3}
+ {7}{11}
+ {18}{21}
+}{ % Top Diagram
+ { % Brick 1
+ [ % Options
+ degree top=3,
+ degree bottom=4
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{2}
+ {2}{3}
+ {3}{4}
+ {7}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=7,
+ blank bottom=1,
+ degree bottom=5,
+ levels=2
+ ]{ % Upper non transversal edges
+ [level=2]{3}{16}
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ {1}{2}
+ }
+ }{ % Brick 3
+ [ % Options
+ blank top=3,
+ degree top=5,
+ blank bottom=4,
+ degree bottom=4,
+ levels=2
+ ]{ % Upper non transversal edges
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {5}{6}
+ {7}{8}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}{ % Bottom Diagram
+ { % Brick 1
+ [ % Options
+ degree top=3,
+ degree bottom=4
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{2}
+ {2}{3}
+ {3}{4}
+ [height=1.5]{7}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=7,
+ blank bottom=1,
+ degree bottom=5,
+ levels=2
+ ]{ % Upper non transversal edges
+ [level=2]{3}{16}
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ {1}{2}
+ }
+ }{ % Brick 3
+ [ % Options
+ blank top=3,
+ degree top=5,
+ blank bottom=4,
+ degree bottom=4,
+ levels=2
+ ]{ % Upper non transversal edges
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {5}{6}
+ {7}{8}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pmdraw/examples/example-14.tex b/graphics/pmdraw/examples/example-14.tex
new file mode 100644
index 0000000000..72d2b8ead0
--- /dev/null
+++ b/graphics/pmdraw/examples/example-14.tex
@@ -0,0 +1,76 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |`````````````````````````````x|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````````````````````|
+% *------------------------------*
+
+\pmdDiagram
+[ % Options
+ row sep=3,
+ diagram sep=2,
+ dots options={
+ \draw (#1,#2) node[red] {\(\mid\)};
+ }
+]{
+ { % Brick 1
+ [ % Options
+ degree top=3,
+ degree bottom=4
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{2}
+ {2}{3}
+ {3}{4}
+ {7}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=7,
+ blank bottom=1,
+ degree bottom=5,
+ levels=2
+ ]{ % Upper non transversal edges
+ [level=2]{3}{16}
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ {1}{2}
+ }
+ }{ % Brick 3
+ [ % Options
+ blank top=-1,
+ degree top=9,
+ blank bottom=4,
+ degree bottom=4,
+ levels=2
+ ]{ % Upper non transversal edges
+ {0}{1}
+ {2}{3}
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {5}{6}
+ {7}{8}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pmdraw/examples/example-15.tex b/graphics/pmdraw/examples/example-15.tex
new file mode 100644
index 0000000000..bed21df510
--- /dev/null
+++ b/graphics/pmdraw/examples/example-15.tex
@@ -0,0 +1,76 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |`````````````````````````````x|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````````````````````|
+% *------------------------------*
+
+\pmdDiagram
+[ % Options
+ row sep=3,
+ diagram sep=2,
+ dots options={
+ \draw (#1,#2) node {};
+ }
+]{
+ { % Brick 1
+ [ % Options
+ degree top=3,
+ degree bottom=4
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{2}
+ {2}{3}
+ {3}{4}
+ {7}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=7,
+ blank bottom=1,
+ degree bottom=5,
+ levels=2
+ ]{ % Upper non transversal edges
+ [level=2]{3}{16}
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ {1}{2}
+ }
+ }{ % Brick 3
+ [ % Options
+ blank top=-1,
+ degree top=9,
+ blank bottom=4,
+ degree bottom=4,
+ levels=2
+ ]{ % Upper non transversal edges
+ {0}{1}
+ {2}{3}
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {5}{6}
+ {7}{8}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pmdraw/examples/example-16.tex b/graphics/pmdraw/examples/example-16.tex
new file mode 100644
index 0000000000..4a5f4f90bb
--- /dev/null
+++ b/graphics/pmdraw/examples/example-16.tex
@@ -0,0 +1,127 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |`````````````````````````````x|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````````````````````|
+% *------------------------------*
+
+\pmdProduct
+[ % options
+ row sep=3,
+ diagram sep=2,
+ dots options={
+ \draw (#1,#2) node[red] {\(\dots\dots\)};
+ },
+ edges added={dashed,blue}
+]{ % Added edges
+ {1}{3}
+ {7}{11}
+ {18}{21}
+}{ % Top Diagram
+ { % Brick 1
+ [ % Options
+ degree top=3,
+ degree bottom=4
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{2}
+ {2}{3}
+ {3}{4}
+ {7}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=7,
+ blank bottom=1,
+ degree bottom=5,
+ levels=2
+ ]{ % Upper non transversal edges
+ [level=2]{3}{16}
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ {1}{2}
+ }
+ }{ % Brick 3
+ [ % Options
+ blank top=3,
+ degree top=5,
+ blank bottom=4,
+ degree bottom=4,
+ levels=2
+ ]{ % Upper non transversal edges
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {5}{6}
+ {7}{8}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}{ % Bottom Diagram
+ { % Brick 1
+ [ % Options
+ degree top=3,
+ degree bottom=4
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{2}
+ {2}{3}
+ {3}{4}
+ [height=1.5]{7}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=7,
+ blank bottom=1,
+ degree bottom=5,
+ levels=2
+ ]{ % Upper non transversal edges
+ [level=2]{3}{16}
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ {1}{2}
+ }
+ }{ % Brick 3
+ [ % Options
+ blank top=3,
+ degree top=5,
+ blank bottom=4,
+ degree bottom=4,
+ levels=2
+ ]{ % Upper non transversal edges
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {5}{6}
+ {7}{8}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pmdraw/examples/example-17.tex b/graphics/pmdraw/examples/example-17.tex
new file mode 100644
index 0000000000..8b23ff0903
--- /dev/null
+++ b/graphics/pmdraw/examples/example-17.tex
@@ -0,0 +1,70 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |`````````````````````````````x|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````````````````````|
+% *------------------------------*
+
+\pmdDiagram[grid]{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace node=red,
+ edges transversal=blue,
+ brace={
+ left=1,
+ right=4,
+ label={p - 1}
+ }
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }
+ { % Brick 2
+ [ % Options
+ degree top=6,
+ degree bottom=5,
+ dots node=blue,
+ edges upper=red,
+ edges lower=green,
+ edges transversal=blue
+ ]{ % Upper non transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Lower non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ [height=1]{2}{10}
+ {1}{1}
+ }
+ }{ % Brick 3
+ [ % Options
+ degree top=2,
+ blank top=1,
+ degree bottom=3
+ ]{ % Upper non transversal edges
+ {2}{3}
+ }{ % Lower non transversal edges
+ {1}{2}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pmdraw/examples/example-18.tex b/graphics/pmdraw/examples/example-18.tex
new file mode 100644
index 0000000000..136fd35d72
--- /dev/null
+++ b/graphics/pmdraw/examples/example-18.tex
@@ -0,0 +1,52 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |`````````````````````````````x|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````````````````````|
+% *------------------------------*
+
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=5,
+ levels top=1,
+ levels bottom=1,
+ labels,
+ labels top node={red,above=16pt}
+ ]{ % Upper non transversal edges
+ [height=1.1]{2}{5}
+ }{ % Lower non transversal edges
+ [height=0.3]{2}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=2,
+ levels top=1,
+ levels bottom=1,
+ labels,
+ labels bottom options={
+ \draw (#1,#2) node[below=6pt] {\(#3''\)};
+ },
+ labels bottom start=6
+ ]{ % Upper non transversal edges
+ {1}{2}
+ }{ % Lower non transversal edges
+ {1}{2}
+ }{ % Transversal edges
+ {1}{2}
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pmdraw/examples/example-19.tex b/graphics/pmdraw/examples/example-19.tex
new file mode 100644
index 0000000000..14b31e8211
--- /dev/null
+++ b/graphics/pmdraw/examples/example-19.tex
@@ -0,0 +1,53 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |`````````````````````````````x|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````````````````````|
+% *------------------------------*
+
+\pmdDiagram[grid]{
+ { % Brick 1
+ [ % Options
+ degree=5,
+ levels top=1,
+ levels bottom=1,
+ labels,
+ labels top node={red,above=16pt}
+ ]{ % Upper non transversal edges
+ [height=1.1]{2}{5}
+ }{ % Lower non transversal edges
+ [height=0.3]{2}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=2,
+ levels top=1,
+ levels bottom=1,
+ labels,
+ labels bottom options={
+ \draw (#1,#2) node[below=6pt] {\(#3''\)};
+ },
+ labels bottom start=6,
+ labels top start=-4
+ ]{ % Upper non transversal edges
+ {1}{2}
+ }{ % Lower non transversal edges
+ {1}{2}
+ }{ % Transversal edges
+ {1}{2}
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pmdraw/examples/example-2.tex b/graphics/pmdraw/examples/example-2.tex
new file mode 100644
index 0000000000..3b72c7bf01
--- /dev/null
+++ b/graphics/pmdraw/examples/example-2.tex
@@ -0,0 +1,39 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |`````````````````````````````x|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````````````````````|
+% *------------------------------*
+
+\pmdBrick[ % Options
+ blank top=2,
+ degree top=5,
+ blank bottom=1,
+ degree bottom=4,
+ levels top=4,
+ levels bottom=3
+]{ % Upper non transversal edges
+ {3}{4}
+ {5}{6}
+ [level=2]{4}{6}
+ [level=3]{4}{7}
+ [level=4]{3}{7}
+}{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ [level=2]{2}{4}
+ [level=3]{2}{5}
+}{ % Transversal edges
+ \pmdEmpty
+} \ No newline at end of file
diff --git a/graphics/pmdraw/examples/example-20.tex b/graphics/pmdraw/examples/example-20.tex
new file mode 100644
index 0000000000..f6f179ff5a
--- /dev/null
+++ b/graphics/pmdraw/examples/example-20.tex
@@ -0,0 +1,171 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |`````````````````````````````x|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````````````````````|
+% *------------------------------*
+
+\usetikzlibrary{patterns}
+
+\newcommand{\blockStyles}{
+ \tikzstyle{typeI} = [
+ very thick,
+ rounded corners=5pt,
+ red,
+ preaction={fill, red!3}
+ ]
+ \tikzstyle{typeT} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 7.5pt off 2.5pt},
+ green,
+ preaction={fill, green!3}
+ ]
+ \tikzstyle{typeB} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 2.5pt off 2.5pt},
+ blue,
+ preaction={fill, blue!3}
+ ]
+ \tikzstyle{typeO} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 2.5pt off 2.5pt on 7.5pt off 2.5pt},
+ orange,
+ preaction={fill, orange!3}
+ ]
+ \tikzstyle{typeU} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 2.5pt off 2.5pt on 2.5pt off 2.5pt on 7.5pt off 2.5pt},
+ violet,
+ preaction={fill, violet!3}
+ ]
+ \tikzstyle{typeN} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 7.5pt off 2.5pt on 7.5pt off 2.5pt on 2.5pt off 2.5pt},
+ yellow,
+ preaction={fill, yellow!3}
+ ]
+}
+
+\pmdProduct[ % Options
+ decorate before={
+ \blockStyles
+ \draw[typeI] (0.6, 2.4) -- (1.4, 2.4) -- (1.4, 0.7) -- (3.4, 0.7) -- (3.4, -3.4) -- (2.6, -3.4) -- (2.6, -1.7) -- (0.6, -1.7) -- cycle;
+ \draw[typeT] (1.6, 1.3) rectangle (3.4, 2.4);
+ \draw[typeB] (0.6, -3.4) rectangle (2.4, -2.3);
+ }
+]{ % Added edges
+ {1}{3}
+}{ % Top Diagram
+ { % Brick 1
+ [ % Options
+ degree=3
+ ]{ % Upper non transversal edges
+ {2}{3}
+ }{ % Lower non transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}{ % Bottom Diagram
+ { % Brick 1
+ [ % Options
+ degree=3
+ ]{ % Upper non transversal edges
+ {1}{2}
+ }{ % Lower non transversal edges
+ {1}{2}
+ }{ % Transversal edges
+ {3}{3}
+ }
+ }
+}
+\hspace{5em}
+\pmdProduct[ % Options
+ decorate before={
+ \blockStyles
+ \draw[typeI] (0.6, 2.4) -- (1.4, 2.4) -- (1.4, 0.7) -- (10.4, 0.7) -- (10.4, -3.4) -- (9.6, -3.4) -- (9.6, -1.7) -- (0.6, -1.7) -- cycle;
+ \foreach \x in {0,2,7} {
+ \begin{scope}[shift={(\x,0)}]
+ \draw[typeT] (1.6, 1.3) rectangle (3.4, 2.4);
+ \end{scope}
+ }
+ \foreach \x in {0,2,4,7} {
+ \begin{scope}[shift={(\x,0)}]
+ \draw[typeB] (0.6, -3.4) rectangle (2.4, -2.3);
+ \end{scope}
+ }
+ }
+]{ % Added edges
+ {1}{5}
+ {9}{10}
+}{ % Top Diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ blank top=2,
+ degree top=2,
+ blank bottom=2,
+ degree bottom=2
+ ]{ % Upper non transversal edges
+ {3}{4}
+ }{ % Lower non transversal edges
+ {3}{4}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}{ % Bottom Diagram
+ { % Brick 1
+ [ % Options
+ degree=6
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ {5}{6}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=3
+ ]{ % Upper non transversal edges
+ {1}{2}
+ }{ % Lower non transversal edges
+ {1}{2}
+ }{ % Transversal edges
+ {3}{3}
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pmdraw/examples/example-21.tex b/graphics/pmdraw/examples/example-21.tex
new file mode 100644
index 0000000000..3c97be7e11
--- /dev/null
+++ b/graphics/pmdraw/examples/example-21.tex
@@ -0,0 +1,183 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |`````````````````````````````x|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````````````````````|
+% *------------------------------*
+
+\usetikzlibrary{patterns}
+
+\newcommand{\blockStyles}{
+ \tikzstyle{typeI} = [
+ very thick,
+ rounded corners=5pt,
+ red,
+ preaction={fill, red!3}
+ ]
+ \tikzstyle{typeT} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 7.5pt off 2.5pt},
+ green,
+ preaction={fill, green!3}
+ ]
+ \tikzstyle{typeB} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 2.5pt off 2.5pt},
+ blue,
+ preaction={fill, blue!3}
+ ]
+ \tikzstyle{typeO} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 2.5pt off 2.5pt on 7.5pt off 2.5pt},
+ orange,
+ preaction={fill, orange!3}
+ ]
+ \tikzstyle{typeU} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 2.5pt off 2.5pt on 2.5pt off 2.5pt on 7.5pt off 2.5pt},
+ violet,
+ preaction={fill, violet!3}
+ ]
+ \tikzstyle{typeN} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 7.5pt off 2.5pt on 7.5pt off 2.5pt on 2.5pt off 2.5pt},
+ yellow,
+ preaction={fill, yellow!3}
+ ]
+}
+
+\pmdProduct[ % Options
+ decorate before={
+ \blockStyles
+ \draw[typeO] (0.6, -1.9) rectangle (4.4, 0.7);
+ \foreach \x in {0,2} {
+ \begin{scope}[shift={(\x,0)}]
+ \draw[typeB] (0.6, -3.4) rectangle (2.4, -2.3);
+ \draw[typeT] (0.6, 1.3) rectangle (2.4, 2.4);
+ \end{scope}
+ }
+ }
+]{ % Added edges
+ {1}{4}
+}{ % Top Diagram
+ { % Brick 1
+ [ % Options
+ degree=4
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}{ % Bottom Diagram
+ { % Brick 1
+ [ % Options
+ degree=4,
+ levels top=2
+ ]{ % Upper non transversal edges
+ [level=2]{1}{4}
+ {2}{3}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}
+\hspace{5em}
+\pmdProduct[ % Options
+ decorate before={
+ \blockStyles
+ \draw[typeO] (0.6, -1.9) rectangle (11.4, 0.7);
+ \foreach \x in {0,2,4,7,9} {
+ \begin{scope}[shift={(\x,0)}]
+ \draw[typeB] (0.6, -3.4) rectangle (2.4, -2.3);
+ \draw[typeT] (0.6, 1.3) rectangle (2.4, 2.4);
+ \end{scope}
+ }
+ }
+]{ % Added edges
+ {1}{5}
+ {9}{11}
+}{ % Top Diagram
+ { % Brick 1
+ [ % Options
+ degree=6
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ {5}{6}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=4
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}{ % Bottom Diagram
+ { % Brick 1
+ [ % Options
+ degree top=5,
+ levels top=2,
+ degree bottom=6
+ ]{ % Upper non transversal edges
+ [level=2]{1}{11}
+ {2}{3}
+ {4}{5}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }{ % Brick 2
+ [ % Options
+ blank top=1,
+ degree top=3,
+ degree bottom=4,
+ levels top=2
+ ]{ % Upper non transversal edges
+ {2}{3}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pmdraw/examples/example-22.tex b/graphics/pmdraw/examples/example-22.tex
new file mode 100644
index 0000000000..1f551db62b
--- /dev/null
+++ b/graphics/pmdraw/examples/example-22.tex
@@ -0,0 +1,179 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |`````````````````````````````x|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````````````````````|
+% *------------------------------*
+
+\usetikzlibrary{patterns}
+
+\newcommand{\blockStyles}{
+ \tikzstyle{typeI} = [
+ very thick,
+ rounded corners=5pt,
+ red,
+ preaction={fill, red!3}
+ ]
+ \tikzstyle{typeT} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 7.5pt off 2.5pt},
+ green,
+ preaction={fill, green!3}
+ ]
+ \tikzstyle{typeB} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 2.5pt off 2.5pt},
+ blue,
+ preaction={fill, blue!3}
+ ]
+ \tikzstyle{typeO} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 2.5pt off 2.5pt on 7.5pt off 2.5pt},
+ orange,
+ preaction={fill, orange!3}
+ ]
+ \tikzstyle{typeU} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 2.5pt off 2.5pt on 2.5pt off 2.5pt on 7.5pt off 2.5pt},
+ violet,
+ preaction={fill, violet!3}
+ ]
+ \tikzstyle{typeN} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 7.5pt off 2.5pt on 7.5pt off 2.5pt on 2.5pt off 2.5pt},
+ yellow,
+ preaction={fill, yellow!3}
+ ]
+}
+
+\pmdProduct[ % Options
+ decorate before={
+ \blockStyles
+ \draw[typeU] (0.6, 2.4) -- (1.4, 2.4) -- (1.4, 0.7) -- (3.6, 0.7) -- (3.6, 2.4) -- (4.4, 2.4) -- (4.4, -1.7) -- (0.6, -1.7) -- cycle;
+ \draw[typeT] (1.6, 1.3) rectangle (3.4, 2.4);
+ \foreach \x in {0,2} {
+ \begin{scope}[shift={(\x,0)}]
+ \draw[typeB] (0.6, -3.4) rectangle (2.4, -2.3);
+ \end{scope}
+ }
+ }
+]{ % Added edges
+ {1}{4}
+}{ % Top Diagram
+ { % Brick 1
+ [ % Options
+ degree=4
+ ]{ % Upper non transversal edges
+ {2}{3}
+ }{ % Lower non transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ {1}{1}
+ {4}{4}
+ }
+ }
+}{ % Bottom Diagram
+ { % Brick 1
+ [ % Options
+ degree=4
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}
+\hspace{5em}
+\pmdProduct[ % Options
+ decorate before={
+ \blockStyles
+ \draw[typeU] (0.6, 2.4) -- (1.4, 2.4) -- (1.4, 0.7) -- (10.6, 0.7) -- (10.6, 2.4) -- (11.4, 2.4) -- (11.4, -1.7) -- (0.6, -1.7) -- cycle;
+ \foreach \x in {0,2,4,7,9} {
+ \begin{scope}[shift={(\x,0)}]
+ \draw[typeB] (0.6, -3.4) rectangle (2.4, -2.3);
+ \end{scope}
+ }
+ \foreach \x in {1,3,8} {
+ \begin{scope}[shift={(\x,0)}]
+ \draw[typeT] (0.6, 1.3) rectangle (2.4, 2.4);
+ \end{scope}
+ }
+ }
+]{ % Added edges
+ {1}{5}
+ {9}{11}
+}{ % Top Diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ blank top=2,
+ blank bottom=2,
+ degree=3
+ ]{ % Upper non transversal edges
+ {3}{4}
+ }{ % Lower non transversal edges
+ {3}{4}
+ }{ % Transversal edges
+ {5}{5}
+ }
+ }
+}{ % Bottom Diagram
+ { % Brick 1
+ [ % Options
+ degree=6
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ {5}{6}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=4
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pmdraw/examples/example-23.tex b/graphics/pmdraw/examples/example-23.tex
new file mode 100644
index 0000000000..016bee3c5c
--- /dev/null
+++ b/graphics/pmdraw/examples/example-23.tex
@@ -0,0 +1,179 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |`````````````````````````````x|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````````````````````|
+% *------------------------------*
+
+\usetikzlibrary{patterns}
+
+\newcommand{\blockStyles}{
+ \tikzstyle{typeI} = [
+ very thick,
+ rounded corners=5pt,
+ red,
+ preaction={fill, red!3}
+ ]
+ \tikzstyle{typeT} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 7.5pt off 2.5pt},
+ green,
+ preaction={fill, green!3}
+ ]
+ \tikzstyle{typeB} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 2.5pt off 2.5pt},
+ blue,
+ preaction={fill, blue!3}
+ ]
+ \tikzstyle{typeO} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 2.5pt off 2.5pt on 7.5pt off 2.5pt},
+ orange,
+ preaction={fill, orange!3}
+ ]
+ \tikzstyle{typeU} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 2.5pt off 2.5pt on 2.5pt off 2.5pt on 7.5pt off 2.5pt},
+ violet,
+ preaction={fill, violet!3}
+ ]
+ \tikzstyle{typeN} = [
+ very thick,
+ rounded corners=5pt,
+ dash pattern={on 7.5pt off 2.5pt on 7.5pt off 2.5pt on 2.5pt off 2.5pt},
+ yellow,
+ preaction={fill, yellow!3}
+ ]
+}
+
+\pmdProduct[ % Options
+ decorate before={
+ \blockStyles
+ \draw[typeN] (0.6, -3.4) -- (1.4, -3.4) -- (1.4, -1.7) -- (3.6, -1.7) -- (3.6, -3.4) -- (4.4, -3.4) -- (4.4, 0.7) -- (0.6, 0.7) -- cycle;
+ \draw[typeB] (1.6, -3.4) rectangle (3.4, -2.3);
+ \foreach \x in {0,2} {
+ \begin{scope}[shift={(\x,0)}]
+ \draw[typeT] (0.6, 1.3) rectangle (2.4, 2.4);
+ \end{scope}
+ }
+ }
+]{ % Added edges
+ {1}{4}
+}{ % Top Diagram
+ { % Brick 1
+ [ % Options
+ degree=4
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}{ % Bottom Diagram
+ { % Brick 1
+ [ % Options
+ degree=4
+ ]{ % Upper non transversal edges
+ {2}{3}
+ }{ % Lower non transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ {1}{1}
+ {4}{4}
+ }
+ }
+}
+\hspace{5em}
+\pmdProduct[ % Options
+ decorate before={
+ \blockStyles
+ \draw[typeN] (0.6, -3.4) -- (1.4, -3.4) -- (1.4, -1.7) -- (10.6, -1.7) -- (10.6, -3.4) -- (11.4, -3.4) -- (11.4, 0.7) -- (0.6, 0.7) -- cycle;
+ \foreach \x in {0,2,4,7,9} {
+ \begin{scope}[shift={(\x,0)}]
+ \draw[typeT] (0.6, 1.3) rectangle (2.4, 2.4);
+ \end{scope}
+ }
+ \foreach \x in {1,3,8} {
+ \begin{scope}[shift={(\x,0)}]
+ \draw[typeB] (0.6, -3.4) rectangle (2.4, -2.3);
+ \end{scope}
+ }
+ }
+]{ % Added edges
+ {1}{5}
+ {9}{11}
+}{ % Top Diagram
+ { % Brick 1
+ [ % Options
+ degree=6
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ {5}{6}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=4
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}{ % Bottom Diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ blank top=2,
+ blank bottom=2,
+ degree=3
+ ]{ % Upper non transversal edges
+ {3}{4}
+ }{ % Lower non transversal edges
+ {3}{4}
+ }{ % Transversal edges
+ {5}{5}
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pmdraw/examples/example-24.tex b/graphics/pmdraw/examples/example-24.tex
new file mode 100644
index 0000000000..a4169912f7
--- /dev/null
+++ b/graphics/pmdraw/examples/example-24.tex
@@ -0,0 +1,160 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |`````````````````````````````x|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````````````````````|
+% *------------------------------*
+
+\pmdProduct[ % Options
+ decorate after={
+ \draw (1, 2) node[above=6pt] {\( x \)\strut};
+ \draw (2, 2) node[above=6pt] {\( y \)\strut};
+ }
+]{ % Added edges
+ {1}{3}
+}{ % Top diagram
+ { % Brick 1
+ [
+ degree=3
+ ]{ % Upper non transversal edges
+ {1}{2}
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [
+ degree=3
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}
+\hspace{2em}
+\pmdProduct[ % Options
+ decorate after={
+ \draw (1, 2) node[above=6pt] {\( x \)};
+ \draw (1, 0) node[left=6pt] {\( y \)};
+ \draw (1, -1) node[left=6pt] {\( j''' \)};
+ \draw (1, -3) node[left=6pt] {\( z \)};
+ }
+]{ % Added edges
+ {1}{3}
+}{ % Top diagram
+ { % Brick 1
+ [
+ degree=3
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [
+ degree=3
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\hspace{2em}
+\pmdProduct[ % Options
+ decorate after={
+ \draw (1, 2) node[above=6pt] {\( x \)};
+ \draw (1, 0) node[left=6pt] {\( y \)};
+ \draw (1, -1) node[left=6pt] {\( j''' \)};
+ \draw (2, -1) node[below=4pt] {\( z \)};
+ \draw (2, 0) node[above right=0pt] {\( k'' \)};
+ \draw (2, 2) node[above=6pt] {\( w \)};
+ }
+]{ % Added edges
+ {1}{3}
+}{ % Top diagram
+ { % Brick 1
+ [
+ degree=3
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [
+ degree=3
+ ]{ % Upper non transversal edges
+ {1}{2}
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}
+\hspace{2em}
+\pmdProduct[ % Options
+ decorate after={
+ \draw (1, 2) node[above=6pt] {\( x \)};
+ \draw (1, 0) node[left=6pt] {\( y \)};
+ \draw (1, -1) node[left=6pt] {\( j''' \)};
+ \draw (2, -1) node[below=4pt] {\( z \)};
+ \draw (2, 0) node[above=4pt] {\( k'' \)};
+ \draw (3, 0) node[above=4pt] {\( w \)};
+ }
+]{ % Added edges
+ {1}{4}
+}{ % Top diagram
+ { % Brick 1
+ [
+ degree=4
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [
+ degree=4
+ ]{ % Upper non transversal edges
+ {1}{2}
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pmdraw/examples/example-25.tex b/graphics/pmdraw/examples/example-25.tex
new file mode 100644
index 0000000000..b3ae92b546
--- /dev/null
+++ b/graphics/pmdraw/examples/example-25.tex
@@ -0,0 +1,63 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |`````````````````````````````x|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````````````````````|
+% *------------------------------*
+
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=5,
+ brace={
+ left=4,
+ right=7,
+ label={p - 3}
+ }
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{2}
+ {2}{3}
+ {3}{1}
+ {4}{4}
+ {5}{5}
+ }
+ }
+ { % Brick 2
+ [ % Options
+ degree=5
+ ]{ % Upper non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }{ % Brick 3
+ [ % Options
+ degree=2
+ ]{ % Upper non transversal edges
+ {1}{2}
+ }{ % Lower non transversal edges
+ {1}{2}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pmdraw/examples/example-3.tex b/graphics/pmdraw/examples/example-3.tex
new file mode 100644
index 0000000000..5654553405
--- /dev/null
+++ b/graphics/pmdraw/examples/example-3.tex
@@ -0,0 +1,53 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |`````````````````````````````x|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````````````````````|
+% *------------------------------*
+
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=5,
+ levels top=4,
+ levels bottom=3
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ [level=2]{2}{4}
+ [level=3]{2}{5}
+ [level=4]{1}{5}
+ [level=3]{5}{7}
+ }{ % Lower non transversal edges
+ {1}{2}
+ {3}{4}
+ [level=2]{2}{4}
+ [level=3]{2}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=4
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Lower non transversal edges
+ {1}{2}
+ }{ % Transversal edges
+ {1}{2}
+ {3}{4}
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pmdraw/examples/example-4.tex b/graphics/pmdraw/examples/example-4.tex
new file mode 100644
index 0000000000..953fec4e42
--- /dev/null
+++ b/graphics/pmdraw/examples/example-4.tex
@@ -0,0 +1,77 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |`````````````````````````````x|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````````````````````|
+% *------------------------------*
+
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree top=3,
+ degree bottom=4,
+ brace={
+ left=2,
+ right=7,
+ label={p}
+ }
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{2}
+ {2}{3}
+ {3}{4}
+ {7}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=7,
+ blank bottom=1,
+ degree bottom=5,
+ levels=2,
+ brace={
+ left=4,
+ right=12,
+ label={q},
+ above
+ }
+ ]{ % Upper non transversal edges
+ [level=2]{3}{13}
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ {1}{2}
+ }
+ }{ % Brick 3
+ [ % Options
+ degree top=5,
+ blank bottom=1,
+ degree bottom=4,
+ levels=2
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Lower non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pmdraw/examples/example-5.tex b/graphics/pmdraw/examples/example-5.tex
new file mode 100644
index 0000000000..5e5f7529d8
--- /dev/null
+++ b/graphics/pmdraw/examples/example-5.tex
@@ -0,0 +1,118 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |`````````````````````````````x|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````````````````````|
+% *------------------------------*
+
+\pmdProduct{ % Added edges
+ {1}{3}
+ {7}{11}
+ {15}{18}
+}{ % Top Diagram
+ { % Brick 1
+ [ % Options
+ degree top=3,
+ degree bottom=4
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{2}
+ {2}{3}
+ {3}{4}
+ {7}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=7,
+ blank bottom=1,
+ degree bottom=5,
+ levels=2
+ ]{ % Upper non transversal edges
+ [level=2]{3}{13}
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ {1}{2}
+ }
+ }{ % Brick 3
+ [ % Options
+ degree top=5,
+ blank bottom=1,
+ degree bottom=4,
+ levels=2
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Lower non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}{ % Bottom Diagram
+ { % Brick 1
+ [ % Options
+ degree top=3,
+ degree bottom=4
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{2}
+ {2}{3}
+ {3}{4}
+ {7}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=7,
+ blank bottom=1,
+ degree bottom=5,
+ levels=2,
+ no dots
+ ]{ % Upper non transversal edges
+ [level=2]{3}{13}
+ {4}{5}
+ {6}{7}
+ }{ % Lower non transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ {1}{2}
+ }
+ }{ % Brick 3
+ [ % Options
+ degree top=5,
+ blank bottom=1,
+ degree bottom=4,
+ levels=2
+ ]{ % Upper non transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Lower non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pmdraw/examples/example-6.tex b/graphics/pmdraw/examples/example-6.tex
new file mode 100644
index 0000000000..6061318eb2
--- /dev/null
+++ b/graphics/pmdraw/examples/example-6.tex
@@ -0,0 +1,55 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |`````````````````````````````x|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````````````````````|
+% *------------------------------*
+
+\pmdProduct[ % Options
+ decorate after={
+ \draw[very thick,red,rounded corners=5pt] (0.6, -3.4) rectangle (1.4, 2.4);
+ }
+]{ % Added edges
+ {1}{4}
+}{ % Top Diagram
+ { % Brick 1
+ [ % Options
+ degree=4
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ {3}{3}
+ {4}{4}
+ }
+ }
+}{ % Bottom Diagram
+ { % Brick 1
+ [ % Options
+ degree=4
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ {3}{3}
+ {4}{4}
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pmdraw/examples/example-7.tex b/graphics/pmdraw/examples/example-7.tex
new file mode 100644
index 0000000000..50d66775ca
--- /dev/null
+++ b/graphics/pmdraw/examples/example-7.tex
@@ -0,0 +1,63 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |`````````````````````````````x|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````````````````````|
+% *------------------------------*
+
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={p}
+ }
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=5,
+ degree bottom=6
+ ]{ % Upper non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ [height=1]{10}{2}
+ {1}{1}
+ }
+ }{ % Brick 3
+ [ % Options
+ degree top=3,
+ blank bottom=1,
+ degree bottom=2
+ ]{ % Upper non transversal edges
+ {1}{2}
+ }{ % Lower non transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pmdraw/examples/example-8.tex b/graphics/pmdraw/examples/example-8.tex
new file mode 100644
index 0000000000..61e9ef6457
--- /dev/null
+++ b/graphics/pmdraw/examples/example-8.tex
@@ -0,0 +1,63 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |`````````````````````````````x|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````````````````````|
+% *------------------------------*
+
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={p}
+ }
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=6,
+ degree bottom=5
+ ]{ % Upper non transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Lower non transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ [height=1]{2}{10}
+ {1}{1}
+ }
+ }{ % Brick 3
+ [ % Options
+ degree top=2,
+ blank top=1,
+ degree bottom=3
+ ]{ % Upper non transversal edges
+ {2}{3}
+ }{ % Lower non transversal edges
+ {1}{2}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pmdraw/examples/example-9.tex b/graphics/pmdraw/examples/example-9.tex
new file mode 100644
index 0000000000..39d5cc3319
--- /dev/null
+++ b/graphics/pmdraw/examples/example-9.tex
@@ -0,0 +1,37 @@
+%!TEX root = ../pmdraw.tex
+
+% *------------------------------*
+% |`````````````````````````````x|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````````````````````|
+% *------------------------------*
+
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=17
+ ]{ % Upper non transversal edges
+ \pmdEmpty
+ }{ % Lower non transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ [height=0.25]{1}{11}
+ [height=0.5]{2}{12}
+ [height=0.75]{3}{13}
+ [height=1]{4}{14}
+ [height=1.25]{5}{15}
+ [height=1.5]{6}{16}
+ [height=1.75]{7}{17}
+ }
+ }
+} \ No newline at end of file
diff --git a/graphics/pmdraw/pmdraw.pdf b/graphics/pmdraw/pmdraw.pdf
new file mode 100644
index 0000000000..4f598dde7e
--- /dev/null
+++ b/graphics/pmdraw/pmdraw.pdf
Binary files differ
diff --git a/graphics/pmdraw/pmdraw.sty b/graphics/pmdraw/pmdraw.sty
new file mode 100644
index 0000000000..9799aa628b
--- /dev/null
+++ b/graphics/pmdraw/pmdraw.sty
@@ -0,0 +1,903 @@
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{pmdraw}[2023-11-08 v1.0 pmdraw]
+
+% *------------------------------*
+% |4````````````````````````````9|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |9````````````````````````````6|
+% *------------------------------*
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% Required packages %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% \RequirePackage{datetime}
+\RequirePackage{keyval}
+\RequirePackage{tikz}
+\usetikzlibrary{math,decorations.pathreplacing,calligraphy,backgrounds}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% Internal control and option commands %
+% - loosely ordered alphabetically %
+% - includes default values where appropriate %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\newcommand{\pmdraw@braceLabel}{} % Label of brace
+
+\newcommand{\pmdraw@diagSep}{1} % Vertical separation between bottom row of top diagram and top row of bottom diagram in product diagram
+
+\newcommand{\pmdraw@drawAedgesOptions}{} % Draw options for added edges in product diagram
+\newcommand{\pmdraw@drawAedges}[2]{ % Draws added edges in product diagram from #1 vertex to #2 vertex, assumes #1<#2
+ \foreach \x in {#1,...,#2} { % For each vertex in range
+ \draw[dotted,thick,apply style/.expand once=\pmdraw@drawAedgesOptions] (\x,0) -- (\x,-\pmdraw@diagSep); % Draw concatenation edge
+ }
+ \pmdraw@AedgesLoop % Restart for loop
+}
+
+\newcommand{\pmdraw@drawBraceDrawOptions}{} % Draw options for brace
+\newcommand{\pmdraw@drawBraceNodeOptions}{} % Node options for brace
+\newcommand{\pmdraw@drawBraceDefault}[3]{ % Draws brace a brace starting from #1 vertex to #2 vertex with label #3, assumes #1<#2 - DEFAULT
+ \ifnum\pmdraw@ifProdDiag=1 % If drawing a product diagram or if placing brace above diagram
+ \draw[
+ very thick,
+ decorate,
+ decoration={calligraphic brace,amplitude=6pt},
+ apply style/.expand once=\pmdraw@drawBraceDrawOptions
+ ] (#1-0.17,\pmdraw@rowSep+0.5) -- (#2+0.17,\pmdraw@rowSep+0.5)
+ node[
+ pos=0.5,
+ above=6pt,
+ apply style/.expand once=\pmdraw@drawBraceNodeOptions
+ ] {\(#3\)}; % Draw brace on top of diagram
+ \else % If not drawing a product diagram or if placing brace below diagram
+ \draw[
+ very thick,
+ decorate,
+ decoration={calligraphic brace,mirror,amplitude=6pt},
+ apply style/.expand once=\pmdraw@drawBraceDrawOptions
+ ] (#1-0.17,-0.5) -- (#2+0.17,-0.5)
+ node[
+ pos=0.5,
+ below=6pt,
+ apply style/.expand once=\pmdraw@drawBraceNodeOptions
+ ] {\(#3\)}; % Draw brace on bottom of diagram
+ \fi%
+}
+\let\pmdraw@drawBrace\pmdraw@drawBraceDefault % Draws brace a brace starting from #1 vertex to #2 vertex with label #3, assumes #1<#2
+
+\newcommand{\pmdraw@drawDotsDrawOptions}{} % Draw options for dots between bricks
+\newcommand{\pmdraw@drawDotsNodeOptions}{} % Node options for dots between bricks
+\newcommand{\pmdraw@drawDotsDefault}[2]{ % Draws dots between bricks at (#1,#2) - DEFAULT
+ \draw[apply style/.expand once=\pmdraw@drawDotsDrawOptions] (#1,#2) node[apply style/.expand once=\pmdraw@drawDotsNodeOptions] {\(\dots\)};
+}
+\let\pmdraw@drawDots\pmdraw@drawDotsDefault % Draws dots between bricks at (#1,#2)
+
+\newcommand{\pmdraw@drawLabelBDrawOptions}{} % Draw options for label of a vertex in bottom row
+\newcommand{\pmdraw@drawLabelBNodeOptions}{} % Node options for label of a vertex in bottom row
+\newcommand{\pmdraw@drawLabelBottomDefault}[3]{ % For bottom row, draws the label #3 for a vertex at (#1,#2) - DEFAULT
+ \draw[apply style/.expand once=\pmdraw@drawLabelBDrawOptions] (#1,#2) node[below=6pt,apply style/.expand once=\pmdraw@drawLabelBNodeOptions] {\(#3'\)};
+}
+\let\pmdraw@drawLabelBottom\pmdraw@drawLabelBottomDefault % For bottom row, draws the label #3 for a vertex at (#1,#2)
+
+\newcommand{\pmdraw@drawLabelTDrawOptions}{} % Draw options for label of a vertex in top row
+\newcommand{\pmdraw@drawLabelTNodeOptions}{} % Node options for label of a vertex in top row
+\newcommand{\pmdraw@drawLabelTopDefault}[3]{ % For top row, draws the label #3 for a vertex at (#1,#2) - DEFAULT
+ \draw[apply style/.expand once=\pmdraw@drawLabelTDrawOptions] (#1,#2) node[above=6pt,apply style/.expand once=\pmdraw@drawLabelTNodeOptions] {\(#3\)};
+}
+\let\pmdraw@drawLabelTop\pmdraw@drawLabelTopDefault % For top row, draws the label #3 for a vertex at (#1,#2)
+
+\newcommand{\pmdraw@drawLedgesDrawOptions}{} % Draw options for lower non-transversal edges
+\newcommand{\pmdraw@drawLedgesDrawDefault}[2]{ % Draws lower non-transversal edge from #1 vertex to #2 vertex, assumes #1<#2 - DEFAULT
+ \draw[apply style/.expand once=\pmdraw@drawLedgesDrawOptions] (#1,0) arc (180:90:\pmdraw{edgeHeight}); % Draw left arch
+ \draw[apply style/.expand once=\pmdraw@drawLedgesDrawOptions] (#1+\pmdraw{edgeHeight},\pmdraw{edgeHeight}) -- (#2-\pmdraw{edgeHeight},\pmdraw{edgeHeight}); % Draw straight line
+ \draw[apply style/.expand once=\pmdraw@drawLedgesDrawOptions] (#2-\pmdraw{edgeHeight},\pmdraw{edgeHeight}) arc (90:0:\pmdraw{edgeHeight}); % Draw right arc
+}
+\let\pmdraw@drawLedgesDraw\pmdraw@drawLedgesDrawDefault % Draws lower non-transversal edge from #1 vertex to #2 vertex, assumes #1<#2
+
+\newcommand{\pmdraw@drawTedgesDrawOptions}{} % Draw options for transversal edges
+\newcommand{\pmdraw@drawTedgesDrawDefault}[2]{ % Draws transversal edge from #1 vertex in top row to #2 vertex in bottom row - DEFAULT
+ \ifnum\pmdraw@ifTedgeHorizontal=0 % If drawing a straight line edge
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions] (#1,\pmdraw@rowSep) -- (#2,0); % Draw straight line
+ \else % If transversal edge is drawn horizontally
+ \ifnum#1>#2 % If edge goes from top right to bottom left
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions] (#2,0) arc (180:90:\pmdraw{Tlevel}); % Draw bottom arch
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions] (#2+\pmdraw{Tlevel},\pmdraw{Tlevel}) -- (#1-\pmdraw@rowSep+\pmdraw{Tlevel}, \pmdraw{Tlevel}); % Draw straight line
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions] (#1-\pmdraw@rowSep+\pmdraw{Tlevel},\pmdraw{Tlevel}) arc (270:360:{\pmdraw@rowSep-\pmdraw{Tlevel}}); % Draw top arc
+ \else % If edge goes from top left to bottom right
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions] (#2,0) arc (0:90:\pmdraw{Tlevel}); % Draw bottom arch
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions] (#2-\pmdraw{Tlevel},\pmdraw{Tlevel}) -- (#1+\pmdraw@rowSep-\pmdraw{Tlevel}, \pmdraw{Tlevel}); % Draw straight line
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions] (#1+\pmdraw@rowSep-\pmdraw{Tlevel},\pmdraw{Tlevel}) arc (270:180:{\pmdraw@rowSep-\pmdraw{Tlevel}}); % Draw top arc
+ \fi%
+ \renewcommand{\pmdraw@ifTedgeHorizontal}{0} % Reset flag to default
+ \fi%
+}
+\let\pmdraw@drawTedgesDraw\pmdraw@drawTedgesDrawDefault % Draws transversal edge from #1 vertex in top row to #2 vertex in bottom row
+
+\newcommand{\pmdraw@drawUedgesDrawOptions}{} % Draw options for upper non-transversal edges
+\newcommand{\pmdraw@drawUedgesDrawDefault}[2]{ % Draws upper non-transversal edge from #1 vertex to #2 vertex, assumes #1<#2 - DEFAULT
+ \draw[apply style/.expand once=\pmdraw@drawUedgesDrawOptions] (#1,\pmdraw@rowSep) arc (180:270:\pmdraw{edgeHeight}); % Draw left arch
+ \draw[apply style/.expand once=\pmdraw@drawUedgesDrawOptions] (#1+\pmdraw{edgeHeight},\pmdraw@rowSep-\pmdraw{edgeHeight}) -- (#2-\pmdraw{edgeHeight},\pmdraw@rowSep-\pmdraw{edgeHeight}); % Draw straight line
+ \draw[apply style/.expand once=\pmdraw@drawUedgesDrawOptions] (#2-\pmdraw{edgeHeight},\pmdraw@rowSep-\pmdraw{edgeHeight}) arc (270:360:\pmdraw{edgeHeight}); % Draw right arc
+}
+\let\pmdraw@drawUedgesDraw\pmdraw@drawUedgesDrawDefault % Draws upper non-transversal edge from #1 vertex to #2 vertex, assumes #1<#2
+
+\newcommand{\pmdraw@drawVertexOptions}{} % Draw options for vertices
+\newcommand{\pmdraw@drawVertex}[2]{ % Draws a vertex at (#1,#2)
+ \fill[apply style/.expand once=\pmdraw@drawVertexOptions] (#1,#2) circle (.17);
+}
+
+\newcommand{\pmdraw@hookAfterBrick}{} % Hook after drawing a brick
+\newcommand{\pmdraw@hookAfterDiagram}{} % Hook after drawing a diagram
+\newcommand{\pmdraw@hookBeforeBrick}{} % Hook before drawing a brick
+\newcommand{\pmdraw@hookBeforeDiagram}{} % Hook before drawing a diagram
+
+\newcommand{\pmdraw@ifDiagWDots}{0} % Boolean if drawing a diagram with dots
+\newcommand{\pmdraw@ifEdgesFirst}{0} % Boolean if drawing edges before vertices
+\newcommand{\pmdraw@ifGrid}{0} % Boolean if displaying helper grid
+\newcommand{\pmdraw@ifLabelsB}{0} % Boolean if displaying labels for vertices in bottom row
+\newcommand{\pmdraw@ifLabelsT}{0} % Boolean if displaying labels for vertices in top row
+\newcommand{\pmdraw@ifProdDiag}{0} % Boolean if drawing a product diagram
+\newcommand{\pmdraw@ifTedgesFirst}{0} % Boolean if drawing transversal edges before non-transversal edges
+\newcommand{\pmdraw@ifTedgeHorizontal}{0} % Boolean if transversal edge is drawn horizontally
+
+\newcommand{\pmdraw@NTedgesHeight}{-1000} % Height of non-transversal edges if manually set, a value of -1000 sets height automatically
+
+\newcommand{\pmdraw@reset}{% Resets user keys and other flags to default values after drawing diagram
+ \renewcommand{\pmdraw@diagSep}{1}% Resets vertical space between product diagrams
+ \renewcommand{\pmdraw@drawAedgesOptions}{}% Resets draw options for added edges in product diagram
+ \let\pmdraw@drawDots\pmdraw@drawDotsDefault% Resets drawing of dots between bricks
+ \renewcommand{\pmdraw@hookAfterDiagram}{}% Clears hook after drawing a diagram
+ \renewcommand{\pmdraw@hookBeforeDiagram}{}% Clears hook before drawing a diagram
+ \renewcommand{\pmdraw@ifGrid}{0}% Hides grid
+ \renewcommand{\pmdraw@ifDiagWDots}{0}% Reset if drawing a diagram with dots
+ \renewcommand{\pmdraw@rowSep}{2}% Resets vertical separation between rows of vertices in brick
+ \setcounter{pmdraw@blankB}{0}% Resets number of blank vertices in bottom row to the left of brick
+ \setcounter{pmdraw@blankT}{0}% Resets number of blank vertices in top row to the left of brick
+ \setcounter{pmdraw@bottomShift}{0}% Resets shift on right end of bottom row of brick
+ \setcounter{pmdraw@topShift}{0}% Resets shift on right end of top row of brick
+ \setcounter{pmdraw@ifDiagWDotsFirst}{1}% Reset if drawing first brick of diagram
+}
+
+\newcommand{\pmdraw@rowSep}{2} % Vertical separation between rows of vertices in brick
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% Counters %
+% - loosely ordered alphabetically %
+% - includes default values where appropriate %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\newcounter{pmdraw@blankB} % Number of blank vertices in bottom row to the left of brick
+\newcounter{pmdraw@blankT} % Number of blank vertices in top row to the left of brick
+
+\newcounter{pmdraw@bottomTotal} % Size of bottom row of brick
+\newcounter{pmdraw@bottomShift} % Shift on right end of bottom row of brick
+
+\newcounter{pmdraw@braceL} % Left starting vertex of brace
+\newcounter{pmdraw@braceR} % Right terminating vertex of brace
+
+\newcounter{pmdraw@brickShift} % Shift required for bricks after dots in diagram with dots
+
+\newcounter{pmdraw@degreeB} % Degree (number of vertices) of bottom row of brick
+\newcounter{pmdraw@degreeT} % Degree (number of vertices) of top row of brick
+
+\newcounter{pmdraw@ifDiagWDotsFirst} % In drawing with dots, boolean if drawing first brick of diagram
+\setcounter{pmdraw@ifDiagWDotsFirst}{1}
+
+\newcounter{pmdraw@labelStartB} % Starting value of labels of vertices in bottom row
+\setcounter{pmdraw@labelStartB}{1}
+\newcounter{pmdraw@labelStartT} % Starting value of labels of vertices in top row
+\setcounter{pmdraw@labelStartT}{1}
+
+\newcounter{pmdraw@NTlevel} % Level corresponding to a height for a non-transversal edge
+
+\newcounter{pmdraw@topTotal} % Size of top row of brick
+\newcounter{pmdraw@topShift} % Shift on right end of top row of brick
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% Keys for bricks %
+% - ordered as per manual %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% To pass draw options to \draw command
+% Verbatim copy from:
+% https://tex.stackexchange.com/a/64237
+\tikzset{apply style/.code={\tikzset{#1}}}
+
+\define@key{pmdraw@brick}{degree}{ % Sets degree (number of vertices per row) of diagram
+ \setcounter{pmdraw@degreeB}{#1} % Sets degree (number of vertices per row) for bottom row
+ \setcounter{pmdraw@degreeT}{#1} % Sets degree (number of vertices per row) for top row
+}
+\define@key{pmdraw@brick}{degree bottom}{ % Sets degree (number of vertices per row) for bottom row
+ \setcounter{pmdraw@degreeB}{#1}
+}
+\define@key{pmdraw@brick}{degree top}{ % Sets degree (number of vertices per row) for top row
+ \setcounter{pmdraw@degreeT}{#1}
+}
+
+\define@key{pmdraw@brick}{blank bottom}{ % Sets the number of blank vertices on left of bottom row
+ \setcounter{pmdraw@blankB}{#1}
+}
+\define@key{pmdraw@brick}{blank top}{ % Sets the number of blank vertices on left of top row
+ \setcounter{pmdraw@blankT}{#1}
+}
+
+\define@key{pmdraw@brick}{row sep}{ % Sets vertical separation between rows of vertices in brick
+ \renewcommand{\pmdraw@rowSep}{#1}
+}
+
+\define@key{pmdraw@brick}{vertices}{ % Sets the draw options of vertices
+ \renewcommand{\pmdraw@drawVertexOptions}{#1}
+}
+\define@key{pmdraw@brick}{vertices options}{ % Sets the draw command of vertices
+ \renewcommand{\pmdraw@drawVertex}[2]{#1}
+}
+
+\define@key{pmdraw@brick}{labels}[]{ % Draws labels for vertices
+ \renewcommand{\pmdraw@ifLabelsB}{1}
+ \renewcommand{\pmdraw@ifLabelsT}{1}
+}
+\define@key{pmdraw@brick}{labels bottom}[]{ % Draws labels for bottom vertices
+ \renewcommand{\pmdraw@ifLabelsB}{1}
+}
+\define@key{pmdraw@brick}{labels top}[]{ % Draws labels for top vertices
+ \renewcommand{\pmdraw@ifLabelsT}{1}
+}
+
+\define@key{pmdraw@brick}{labels start}{ % Sets starting number for vertex labels
+ \setcounter{pmdraw@labelStartT}{#1}
+ \setcounter{pmdraw@labelStartB}{#1}
+}
+\define@key{pmdraw@brick}{labels bottom start}{ % Sets starting number for bottom vertex labels
+ \setcounter{pmdraw@labelStartB}{#1}
+}
+\define@key{pmdraw@brick}{labels top start}{ % Sets starting number for top vertex labels
+ \setcounter{pmdraw@labelStartT}{#1}
+}
+
+\define@key{pmdraw@brick}{labels bottom draw}{ % Sets the draw options for labels of bottom vertices
+ \renewcommand{\pmdraw@drawLabelBDrawOptions}{#1}
+}
+\define@key{pmdraw@brick}{labels bottom node}{ % Sets the node options for labels of bottom vertices
+ \renewcommand{\pmdraw@drawLabelBNodeOptions}{#1}
+}
+\define@key{pmdraw@brick}{labels top draw}{ % Sets the draw options for labels of top vertices
+ \renewcommand{\pmdraw@drawLabelTDrawOptions}{#1}
+}
+\define@key{pmdraw@brick}{labels top node}{ % Sets the node options for labels of top vertices
+ \renewcommand{\pmdraw@drawLabelTNodeOptions}{#1}
+}
+
+\define@key{pmdraw@brick}{labels bottom options}{ % Sets the draw command of labels of bottom vertices
+ \renewcommand{\pmdraw@drawLabelBottom}[3]{#1}
+}
+\define@key{pmdraw@brick}{labels top options}{ % Sets the draw command of labels of bottom vertices
+ \renewcommand{\pmdraw@drawLabelTop}[3]{#1}
+}
+
+\define@key{pmdraw@brick}{no dots}[]{ % Does not draw dots in bricks
+ \setcounter{pmdraw@ifDiagWDotsFirst}{1}
+}
+
+\define@key{pmdraw@brick}{dots draw}{ % Sets the draw options for drawing of dots
+ \renewcommand{\pmdraw@drawDotsDrawOptions}{#1}
+}
+\define@key{pmdraw@brick}{dots node}{ % Sets the node options for drawing of dots
+ \renewcommand{\pmdraw@drawDotsNodeOptions}{#1}
+}
+
+
+\define@key{pmdraw@brick}{levels}[1]{ % Sets number of horizontal levels for non-transversal edges and evenly spaces them
+ \tikzmath{
+ \pmdraw{edgeSepU} = (0.5*\pmdraw@rowSep)/(#1 + 1); % Calculates vertical separation between each edge
+ \pmdraw{edgeSepL} = \pmdraw{edgeSepU}; % Calculates vertical separation between each edge
+ }
+}
+\define@key{pmdraw@brick}{levels bottom}{ % Sets number of horizontal levels for lower non-transversal edges and evenly spaces them
+ \tikzmath{
+ \pmdraw{edgeSepL} = (0.5*\pmdraw@rowSep)/(#1 + 1); % Calculates vertical separation between each edge
+ }
+}
+\define@key{pmdraw@brick}{levels top}{ % Sets number of horizontal levels for upper non-transversal edges and evenly spaces them
+ \tikzmath{
+ \pmdraw{edgeSepU} = (0.5*\pmdraw@rowSep)/(#1 + 1); % Calculates vertical separation between each edge
+ }
+}
+
+\define@key{pmdraw@brick}{levels sep}{ % Sets vertical separation of horizontal levels for non-transversal edges
+ \tikzmath{
+ \pmdraw{edgeSepU} = #1;
+ \pmdraw{edgeSepL} = \pmdraw{edgeSepU};
+ }
+}
+\define@key{pmdraw@brick}{levels sep bottom}{ % Sets vertical separation of lower horizontal levels for non-transversal edges
+ \tikzmath{
+ \pmdraw{edgeSepL} = #1;
+ }
+}
+\define@key{pmdraw@brick}{levels sep top}{ % Sets vertical separation of upper horizontal levels for non-transversal edges
+ \tikzmath{
+ \pmdraw{edgeSepU} = #1;
+ }
+}
+
+\define@key{pmdraw@brick}{edges}{ % Sets the draw options of all edges
+ \renewcommand{\pmdraw@drawUedgesDrawOptions}{#1}
+ \renewcommand{\pmdraw@drawLedgesDrawOptions}{#1}
+ \renewcommand{\pmdraw@drawTedgesDrawOptions}{#1}
+}
+\define@key{pmdraw@brick}{edges non-transversal}{ % Sets the draw options of non-transversal edges
+ \renewcommand{\pmdraw@drawUedgesDrawOptions}{#1}
+ \renewcommand{\pmdraw@drawLedgesDrawOptions}{#1}
+}
+\define@key{pmdraw@brick}{edges upper}{ % Sets the draw options of upper non-transversal edges
+ \renewcommand{\pmdraw@drawUedgesDrawOptions}{#1}
+}
+\define@key{pmdraw@brick}{edges lower}{ % Sets the draw options of lower non-transversal edges
+ \renewcommand{\pmdraw@drawLedgesDrawOptions}{#1}
+}
+\define@key{pmdraw@brick}{edges transversal}{ % Sets the draw options of transversal edges
+ \renewcommand{\pmdraw@drawTedgesDrawOptions}{#1}
+}
+
+\define@key{pmdraw@brick}{edges first}[]{ % Draws edges before vertices
+ \renewcommand{\pmdraw@ifEdgesFirst}{1}
+}
+\define@key{pmdraw@brick}{transversals first}[]{ % Draws transversal edges before non-transversal edges
+ \renewcommand{\pmdraw@ifTedgesFirst}{1}
+}
+
+\define@key{pmdraw@brick}{brace}{ % Draws a brace
+ \setkeys{pmdraw@brace}{#1} % Processes details of brace
+ \pmdraw@drawBrace{\value{pmdraw@braceL}}{\value{pmdraw@braceR}}{\pmdraw@braceLabel} % Draws brace
+ \let\pmdraw@drawBrace\pmdraw@drawBraceDefault % Resets brace options if changed
+}
+
+\define@key{pmdraw@brick}{brace draw}{ % Sets the draw options for drawing of brace
+ \renewcommand{\pmdraw@drawBraceDrawOptions}{#1}
+}
+\define@key{pmdraw@brick}{brace node}{ % Sets the node options for drawing of brace
+ \renewcommand{\pmdraw@drawBraceNodeOptions}{#1}
+}
+
+\define@key{pmdraw@brick}{decorate before}{ % Hook for decorations before brick is drawn
+ \renewcommand{\pmdraw@hookBeforeBrick}{#1}
+}
+\define@key{pmdraw@brick}{decorate after}{ % Hook for decorations after brick is drawn
+ \renewcommand{\pmdraw@hookAfterBrick}{#1}
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% Keys for edges %
+% - ordered as per manual %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\define@key{pmdraw@NTedges}{level}{ % Sets level of non-transversal edge
+ \setcounter{pmdraw@NTlevel}{#1}
+}
+\define@key{pmdraw@NTedges}{height}{ % Sets manual height of non-transversal edge
+ \renewcommand{\pmdraw@NTedgesHeight}{#1}
+}
+\define@key{pmdraw@NTedges}{options}{ % Sets the draw command of non-transversal edge
+ \renewcommand{\pmdraw@drawUedgesDraw}[2]{#1}
+ \renewcommand{\pmdraw@drawLedgesDraw}[2]{#1}
+}
+
+\define@key{pmdraw@Tedges}{height}{ % Sets manual height of transversal edge
+ \tikzmath{
+ \pmdraw{Tlevel} = #1;
+ }
+ \renewcommand{\pmdraw@ifTedgeHorizontal}{1} % Flags manual height
+}
+\define@key{pmdraw@Tedges}{options}{ % Sets the draw command of transversal edge
+ \renewcommand{\pmdraw@drawTedgesDraw}[2]{#1}
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% Keys for brace %
+% - ordered as per manual %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\define@key{pmdraw@brace}{left}{ % Sets starting position of brace
+ \setcounter{pmdraw@braceL}{#1}
+}
+\define@key{pmdraw@brace}{right}{ % Sets terminating position of brace
+ \setcounter{pmdraw@braceR}{#1}
+}
+\define@key{pmdraw@brace}{label}{ % Sets label of brace
+ \renewcommand{\pmdraw@braceLabel}{#1}
+}
+\define@key{pmdraw@brace}{above}[]{ % Set flag to draw brace above diagram
+ \renewcommand{\pmdraw@ifProdDiag}{1}
+}
+\define@key{pmdraw@brace}{options}{ % Sets the draw command of brace
+ \renewcommand{\pmdraw@drawBrace}[3]{#1}
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% Keys for diagrams and product diagrams %
+% - ordered as per manual %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\define@key{pmdraw@diagram}{row sep}{ % Sets vertical separation between rows of vertices in diagram
+ \renewcommand{\pmdraw@rowSep}{#1}
+}
+\define@key{pmdraw@diagram}{dots options}{ % Sets the draw command of dots between bricks
+ \renewcommand{\pmdraw@drawDots}[2]{#1}
+}
+\define@key{pmdraw@diagram}{grid}[]{ % Flag for drawing coordinate grid
+ \renewcommand{\pmdraw@ifGrid}{1}
+}
+\define@key{pmdraw@diagram}{decorate before}{ % Hook before drawing diagrams
+ \renewcommand{\pmdraw@hookBeforeDiagram}{#1}
+}
+\define@key{pmdraw@diagram}{decorate after}{ % Hook after drawing diagrams
+ \renewcommand{\pmdraw@hookAfterDiagram}{#1}
+}
+
+\define@key{pmdraw@diagram}{diagram sep}{ % Sets vertical separation between bottom row of top diagram and top row of bottom diagram in product diagram
+ \renewcommand{\pmdraw@diagSep}{#1}
+}
+\define@key{pmdraw@diagram}{edges added}{ % Sets the draw options for drawing of added edges in product diagram
+ \renewcommand{\pmdraw@drawAedgesOptions}{#1}
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% User commands %
+% - loosely ordered alphabetically %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\newcommand{\pmdBrick}[4][]{ % Draws brick
+ % #1 Options
+ % #2 Upper non-transversal edges, as list [<options>]{<left vertex>}{<right vertex>}, eg [level=1]{2}{3}
+ % #3 Lower non-transversal edges, as list [<options>]{<left vertex>}{<right vertex>}, eg [level=1]{2}{3}
+ % #4 Transversals, as list [<options>]{<upper vertex>}{<lower vertex>}, eg [level=1]{2}{3}
+ \pmdDiagram{{[#1]{#2}{#3}{#4}}} % Uses complete diagram method to draw brick
+}
+
+\newcommand{\pmdDiagram}[2][]{% Draws diagram
+ % #1 Options
+ % #2 List of bricks
+ \setkeys{pmdraw@diagram}{#1}% Processes options
+ \renewcommand{\pmdraw@ifDiagWDots}{1}% Flags that diagram has dots
+ \setcounter{pmdraw@brickShift}{0}% Reset shifting of individual bricks
+ \ifmmode% If drawing diagram in a maths equation
+ \,% Add space
+ \ifnum\pmdraw@ifGrid=1% If displaying helper grid
+ \begin{tikzpicture}[scale=.5,baseline=0.405cm,show grid=true]%
+ \else% If not displaying helper grid
+ \begin{tikzpicture}[scale=.5,baseline=0.405cm]%
+ \fi%
+ \pmdraw@hookBeforeDiagram% Hook before drawing diagrams
+ \pmdraw@bricksLoop% Commences loop for each brick to be drawn
+ #2%
+ \pmdEmpty% Terminates loop
+ \pmdraw@hookAfterDiagram% Hook after drawing diagrams
+ \end{tikzpicture}%
+ \,% Add space
+ \else% If drawing diagram in normal text
+ \raisebox{0.5cm}{% Raise diagram so bottom row is on text baseline
+ \ifnum\pmdraw@ifGrid=1% If displaying helper grid
+ \begin{tikzpicture}[scale=.5,baseline=0.405cm,show grid=true]%
+ \else% If not displaying helper grid
+ \begin{tikzpicture}[scale=.5,baseline=0.405cm]%
+ \fi%
+ \pmdraw@hookBeforeDiagram% Hook before drawing diagrams
+ \pmdraw@bricksLoop% Commences loop for each brick to be drawn
+ #2%
+ \pmdEmpty% Terminates loop
+ \pmdraw@hookAfterDiagram% Hook after drawing diagrams
+ \end{tikzpicture}%
+ }%
+ \fi%
+ \pmdraw@reset% Resets user keys and other flags to default values
+}
+
+\newcommand{\pmdEmpty}{} % Indicates no edges, internally halts input loops, always is = {}
+
+\newcommand{\pmdProduct}[4][]{% Draws product diagram
+ % #1 Options
+ % #2 List of added edges
+ % #3 Top diagram as list of bricks
+ % #4 Bottom diagram as list of bricks
+ \setkeys{pmdraw@diagram}{#1}% Processes options
+ \ifmmode% If drawing diagram in a maths equation
+ \,% Add space
+ \ifnum\pmdraw@ifGrid=1% If displaying helper grid
+ \begin{tikzpicture}[scale=.5,baseline=-.3475cm,show grid=true]%
+ \else% If not displaying helper grid
+ \begin{tikzpicture}[scale=.5,baseline=-.3475cm]%
+ \fi%
+ \pmdraw@hookBeforeDiagram% Hook before drawing diagrams
+ \pmdraw@AedgesLoop% Commences loop for added edges to be drawn
+ #2%
+ \pmdEmpty% Terminates loop
+ \renewcommand{\pmdraw@ifDiagWDots}{1}% Flags that diagram has dot
+ \renewcommand{\pmdraw@ifProdDiag}{1}% Flags that diagram is product
+ \setcounter{pmdraw@brickShift}{0}% Reset shifting of individual bricks
+ \pmdraw@bricksLoop% Commences loop for each brick to be drawn
+ #3%
+ \pmdEmpty% Terminates loop
+ \renewcommand{\pmdraw@ifProdDiag}{0}% Resets flag that diagram is product
+ \setcounter{pmdraw@ifDiagWDotsFirst}{1}% Reset if drawing first brick of diagram
+ \setcounter{pmdraw@brickShift}{0}% Reset shifting of individual bricks
+ \begin{scope}[shift={(0,-\pmdraw@diagSep-\pmdraw@rowSep)}]% Shift coordinates to be underneath top diagram
+ \pmdraw@bricksLoop% Commences loop for each brick to be drawn
+ #4%
+ \pmdEmpty% Terminates loop
+ \renewcommand{\pmdraw@ifDiagWDots}{0}% Reset if drawing a diagram with dots
+ \setcounter{pmdraw@ifDiagWDotsFirst}{1}% Reset if drawing first brick of diagram
+ \end{scope}%
+ \pmdraw@hookAfterDiagram% Hook after drawing diagrams
+ \end{tikzpicture}%
+ \,% Add space
+ \else% If drawing diagram in normal text
+ \raisebox{2cm}{% Raise diagram so bottom row is on text baseline
+ \ifnum\pmdraw@ifGrid=1% If displaying helper grid
+ \begin{tikzpicture}[scale=.5,baseline=0.405cm,show grid=true]%
+ \else% If not displaying helper grid
+ \begin{tikzpicture}[scale=.5,baseline=0.405cm]%
+ \fi%
+ \pmdraw@hookBeforeDiagram% Hook before drawing diagrams
+ \pmdraw@AedgesLoop% Commences loop for added edges to be drawn
+ #2%
+ \pmdEmpty% Terminates loop
+ \renewcommand{\pmdraw@ifDiagWDots}{1}% Flags that diagram has dot
+ \renewcommand{\pmdraw@ifProdDiag}{1}% Flags that diagram is product
+ \setcounter{pmdraw@brickShift}{0}% Reset shifting of individual bricks
+ \pmdraw@bricksLoop% Commences loop for each brick to be drawn
+ #3%
+ \pmdEmpty% Terminates loop
+ \renewcommand{\pmdraw@ifProdDiag}{0}% Resets flag that diagram is products
+ \setcounter{pmdraw@ifDiagWDotsFirst}{1}% Reset if drawing first brick of diagram
+ \setcounter{pmdraw@brickShift}{0}% Reset shifting of individual bricks
+ \begin{scope}[shift={(0,-\pmdraw@diagSep-\pmdraw@rowSep)}]% Shift coordinates to be underneath top diagram
+ \pmdraw@bricksLoop% Commences loop for each brick to be drawn
+ #4%
+ \pmdEmpty% Terminates loop
+ \renewcommand{\pmdraw@ifDiagWDots}{0}% Reset if drawing a diagram with dots
+ \setcounter{pmdraw@ifDiagWDotsFirst}{1}% Reset if drawing first brick of diagram
+ \end{scope}%
+ \pmdraw@hookAfterDiagram% Hook after drawing diagrams diagram
+ \end{tikzpicture}%
+ }%
+ \fi%
+ \pmdraw@reset% Resets user keys and other flags to default values
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% For loop commands %
+% - loosely ordered alphabetically %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\newcommand{\pmdraw@AedgesLoop}{% Starts loop for added edges in product diagram
+ \@ifnextchar\pmdEmpty{}{% If not at end of list
+ \pmdraw@drawAedges% Draw each edge
+ }
+}
+\newcommand{\pmdraw@bricksLoop}{% Starts loop to iterate over each brick in diagram
+ \@ifnextchar\pmdEmpty{}{% If not at end of list
+ \pmdraw@drawBrickInit% Draw each brick
+ }
+}
+\newcommand{\pmdraw@LedgesLoop}{% Starts loop for lower non-transversal edges
+ \@ifnextchar\pmdEmpty{}{% If not at end of list
+ \pmdraw@drawLedges% Draw each edge
+ }
+}
+\newcommand{\pmdraw@TedgesLoop}{% Starts loop for transversal edges
+ \@ifnextchar\pmdEmpty{}{% If not at end of list
+ \pmdraw@drawTedges% Draw each edge
+ }
+}
+\newcommand{\pmdraw@UedgesLoop}{% Starts loop for upper non-transversal edges
+ \@ifnextchar\pmdEmpty{}{% If not at end of list
+ \pmdraw@drawUedges% Draw each edge
+ }
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% Draw commands %
+% - loosely ordered alphabetically %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\newcommand{\pmdraw@drawBottomVertices}{% Draws bottom row of vertices
+ \setcounter{pmdraw@bottomTotal}{\value{pmdraw@blankB}}% Store size of bottom row of vertices
+ \addtocounter{pmdraw@bottomTotal}{\value{pmdraw@degreeB}}% Store size of bottom row of vertices
+ \ifnum\value{pmdraw@ifDiagWDotsFirst}=1% If drawing first brick of diagram
+ \setcounter{pmdraw@ifDiagWDotsFirst}{0}% Mark that first brick has been drawn
+ \else% If not drawing first brick of diagram
+ \pmdraw@drawDots{0.5*\value{pmdraw@topShift}+0.5*\value{pmdraw@blankT}}{\pmdraw@rowSep}% Draw upper dots
+ \pmdraw@drawDots{0.5*\value{pmdraw@bottomShift}+0.5*\value{pmdraw@blankB}}{0}% Draw lower dots
+ \fi%
+ \ifnum\value{pmdraw@topTotal}>\value{pmdraw@bottomTotal}% If top row is longer than bottom row
+ \ifnum\pmdraw@ifDiagWDots=1% If drawing a diagram with dots
+ \addtocounter{pmdraw@brickShift}{\value{pmdraw@topTotal}}% Keep track of size of diagram
+ % Store shifts
+ \setcounter{pmdraw@topShift}{-\value{pmdraw@topTotal}}%
+ \addtocounter{pmdraw@topShift}{\value{pmdraw@topTotal}}%
+ \setcounter{pmdraw@bottomShift}{-\value{pmdraw@topTotal}}%
+ \addtocounter{pmdraw@bottomShift}{\value{pmdraw@bottomTotal}}%
+ \else% If drawing a diagram without dots
+ \setcounter{pmdraw@brickShift}{\value{pmdraw@topTotal}}% Keep track of size of diagram
+ \fi%
+ \else% If bottom row is longer than top row
+ \ifnum\pmdraw@ifDiagWDots=1% If drawing a diagram with dots
+ \addtocounter{pmdraw@brickShift}{\value{pmdraw@bottomTotal}}% Keep track of size of diagram
+ % Store shifts
+ \setcounter{pmdraw@topShift}{-\value{pmdraw@bottomTotal}}%
+ \addtocounter{pmdraw@topShift}{\value{pmdraw@topTotal}}%
+ \setcounter{pmdraw@bottomShift}{-\value{pmdraw@bottomTotal}}%
+ \addtocounter{pmdraw@bottomShift}{\value{pmdraw@bottomTotal}}%
+ \else% If drawing a diagram without dots
+ \setcounter{pmdraw@brickShift}{\value{pmdraw@bottomTotal}}% Keep track of size of diagram
+ \fi%
+ \fi%
+ \foreach \x in {1,...,\value{pmdraw@degreeB}} {% For each vertex in row
+ \pmdraw@drawVertex{\x + \value{pmdraw@blankB}}{0}% Draw lower vertex
+ \ifnum\pmdraw@ifLabelsB=1% If drawing labels
+ \pmdraw@drawLabelBottom{\x + \value{pmdraw@blankT}}{0}{\thepmdraw@labelStartB}% Draw label
+ \stepcounter{pmdraw@labelStartB}% Update label counter
+ \fi
+ }%
+}
+\newcommand{\pmdraw@drawBrickInit}[1]{% Initialises the drawing of a brick
+ \ifnum\value{pmdraw@ifDiagWDotsFirst}=0% If not drawing first brick in diagram
+ \stepcounter{pmdraw@brickShift}% Makes space for dots to left of current brick
+ \fi%
+ \begin{scope}[shift={(\value{pmdraw@brickShift},0)}]% Shift brick to the right of already drawn bricks
+ \pmdraw@drawBrick#1% Draw brick
+ \end{scope}%
+ \pmdraw@bricksLoop% Restart for loop
+}
+\newcommand{\pmdraw@drawBrick}[4][]{% Draws a brick
+ % #1 Options
+ % #2 Upper non-transversal edges, as list [<options>]{<left vertex>}{<right vertex>}, eg [level=1]{2}{3}
+ % #3 Lower non-transversal edges, as list [<options>]{<left vertex>}{<right vertex>}, eg [level=1]{2}{3}
+ % #4 Transversals, as list [<options>]{<upper vertex>}{<lower vertex>}, eg [level=1]{2}{3}
+ \setkeys{pmdraw@brick}{levels,#1}% Processes options and set default levels
+ \pmdraw@hookBeforeBrick% Hook before drawing brick
+ \ifnum\pmdraw@ifEdgesFirst=0% If drawing vertices first
+ \pmdraw@drawTopVertices% Draw base diagram
+ \pmdraw@drawBottomVertices% Draw base diagram
+ \ifnum\pmdraw@ifTedgesFirst=0% If drawing non-transversals first
+ \pmdraw@UedgesLoop% Draws upper edges
+ #2%
+ \pmdEmpty%
+ \pmdraw@LedgesLoop% Draws lower edges
+ #3%
+ \pmdEmpty%
+ \pmdraw@TedgesLoop% Draws transversals
+ #4%
+ \pmdEmpty%
+ \else% If drawing transversal first
+ \pmdraw@TedgesLoop% Draws transversals
+ #4%
+ \pmdEmpty%
+ \pmdraw@UedgesLoop% Draws upper edges
+ #2%
+ \pmdEmpty%
+ \pmdraw@LedgesLoop% Draws lower edges
+ #3%
+ \pmdEmpty%
+ \fi%
+ \else % If drawing edges first
+ \ifnum\pmdraw@ifTedgesFirst=0% If drawing non-transversals first
+ \pmdraw@UedgesLoop% Draws upper edges
+ #2%
+ \pmdEmpty%
+ \pmdraw@LedgesLoop% Draws lower edges
+ #3%
+ \pmdEmpty%
+ \pmdraw@TedgesLoop% Draws transversals
+ #4%
+ \pmdEmpty%
+ \else% If drawing transversal first
+ \pmdraw@TedgesLoop% Draws transversals
+ #4%
+ \pmdEmpty%
+ \pmdraw@UedgesLoop% Draws upper edges
+ #2%
+ \pmdEmpty%
+ \pmdraw@LedgesLoop% Draws lower edges
+ #3%
+ \pmdEmpty%
+ \fi%
+ \pmdraw@drawTopVertices% Draw base diagram
+ \pmdraw@drawBottomVertices% Draw base diagram
+ \fi%
+ \pmdraw@hookAfterBrick% Hook after drawing brick
+ % Resets user keys and other flags to default values
+ \renewcommand{\pmdraw@drawBraceDrawOptions}{}%
+ \renewcommand{\pmdraw@drawBraceNodeOptions}{}%
+ \renewcommand{\pmdraw@drawDotsDrawOptions}{}%
+ \renewcommand{\pmdraw@drawDotsNodeOptions}{}%
+ \renewcommand{\pmdraw@drawLabelBDrawOptions}{}%
+ \renewcommand{\pmdraw@drawLabelBNodeOptions}{}%
+ \renewcommand{\pmdraw@drawLabelTDrawOptions}{}%
+ \renewcommand{\pmdraw@drawLabelTNodeOptions}{}%
+ \renewcommand{\pmdraw@drawLedgesDrawOptions}{}%
+ \renewcommand{\pmdraw@drawTedgesDrawOptions}{}%
+ \renewcommand{\pmdraw@drawUedgesDrawOptions}{}%
+ \renewcommand{\pmdraw@drawVertexOptions}{}%
+ \renewcommand{\pmdraw@hookBeforeBrick}{}%
+ \renewcommand{\pmdraw@hookAfterBrick}{}%
+ \renewcommand{\pmdraw@ifEdgesFirst}{0}%
+ \renewcommand{\pmdraw@ifLabelsB}{0}%
+ \renewcommand{\pmdraw@ifLabelsT}{0}%
+ \renewcommand{\pmdraw@ifTedgesFirst}{0}%
+ \let\pmdraw@drawLabelBottom\pmdraw@drawLabelBottomDefault%
+ \let\pmdraw@drawLabelTop\pmdraw@drawLabelTopDefault%
+ \let\pmdraw@drawLabelBottom\pmdraw@drawLabelBottomDefault%
+ \setcounter{pmdraw@blankB}{0}%
+ \setcounter{pmdraw@blankT}{0}%
+ \setcounter{pmdraw@labelStartB}{1}%
+ \setcounter{pmdraw@labelStartT}{1}%
+}
+\newcommand{\pmdraw@drawLedges}[3][]{% Draws lower non-transversal edge, #1 options, #2 L vertex, #3 R vertex
+ \setcounter{pmdraw@NTlevel}{1}% Store default level of edge
+ \setkeys{pmdraw@NTedges}{#1}% Processes options
+ \ifdim\pmdraw@NTedgesHeight pt=-1000pt% If using default heights
+ \tikzmath{%
+ \pmdraw{edgeHeight}=\value{pmdraw@NTlevel}*\pmdraw{edgeSepL};% Calculates height based on level of edge
+ }%
+ \else% If using manual heights
+ \tikzmath{%
+ \pmdraw{edgeHeight}=\pmdraw@NTedgesHeight;% Set manual height
+ }%
+ \fi%
+ \pmdraw@drawLedgesDraw{#2}{#3}% Draw edge
+ % Resets user keys and other flags to default values
+ \renewcommand{\pmdraw@NTedgesHeight}{-1000}%
+ \let\pmdraw@drawLedgesDraw\pmdraw@drawLedgesDrawDefault%
+ \pmdraw@LedgesLoop% Restart for loop
+}
+\newcommand{\pmdraw@drawTedges}[3][]{% Draws transversal edge, #1 options, #2 upper vertex, #3 lower vertex
+ \setkeys{pmdraw@Tedges}{#1}% Processes options
+ \pmdraw@drawTedgesDraw{#2}{#3}% Draw edge
+ \let\pmdraw@drawTedgesDraw\pmdraw@drawTedgesDrawDefault% Resets user keys and other flags to default values
+ \pmdraw@TedgesLoop% Restart for loop
+}
+\newcommand{\pmdraw@drawTopVertices}{% Draws top row of vertices
+ \setcounter{pmdraw@topTotal}{\value{pmdraw@blankT}}% Store size of top row of vertices
+ \addtocounter{pmdraw@topTotal}{\value{pmdraw@degreeT}}% Store size of top row of vertices
+ \foreach \x in {1,...,\value{pmdraw@degreeT}} {% For each vertex in row
+ \pmdraw@drawVertex{\x + \value{pmdraw@blankT}}{\pmdraw@rowSep}% Draw upper vertex
+ \ifnum\pmdraw@ifLabelsT=1% If drawing labels
+ \pmdraw@drawLabelTop{\x + \value{pmdraw@blankT}}{\pmdraw@rowSep}{\thepmdraw@labelStartT}% Draw label
+ \stepcounter{pmdraw@labelStartT}% Update label counter
+ \fi
+ }%
+}
+\newcommand{\pmdraw@drawUedges}[3][]{% Draws upper non-transversal edge, #1 options, #2 L vertex, #3 R vertex
+ \setcounter{pmdraw@NTlevel}{1}% Store default level of edge
+ \setkeys{pmdraw@NTedges}{#1}% Processes options
+ \ifdim\pmdraw@NTedgesHeight pt=-1000pt% If using default heights
+ \tikzmath{
+ \pmdraw{edgeHeight}=\value{pmdraw@NTlevel}*\pmdraw{edgeSepU};% Calculates height based on level of edge
+ }
+ \else% If using manual heights
+ \tikzmath{
+ \pmdraw{edgeHeight}=\pmdraw@rowSep-\pmdraw@NTedgesHeight;% Set manual height
+ }
+ \fi%
+ \pmdraw@drawUedgesDraw{#2}{#3}% Draw edge
+ % Resets user keys and other flags to default values
+ \renewcommand{\pmdraw@NTedgesHeight}{-1000}%
+ \let\pmdraw@drawLedgesDraw\pmdraw@drawLedgesDrawDefault%
+ \let\pmdraw@drawUedgesDraw\pmdraw@drawUedgesDrawDefault%
+ \pmdraw@UedgesLoop% Restart for loop
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% Grid creation %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% This is a verbatim copy of:
+% https://tex.stackexchange.com/a/467908
+
+\newif\if@showgrid@grid
+\newif\if@showgrid@left
+\newif\if@showgrid@right
+\newif\if@showgrid@below
+\newif\if@showgrid@above
+\tikzset{%
+ every show grid/.style={},
+ show grid/.style={execute at end picture={\@showgrid{grid=true,#1}}},%
+ show grid/.default={true},
+ show grid/.cd,
+ labels/.style={font={\sffamily\small},help lines},
+ xlabels/.style={},
+ ylabels/.style={},
+ keep bb/.code={\useasboundingbox (current bounding box.south west) rectangle (current bounding box.north west);},
+ true/.style={left,below},
+ false/.style={left=false,right=false,above=false,below=false,grid=false},
+ none/.style={left=false,right=false,above=false,below=false},
+ all/.style={left=true,right=true,above=true,below=true},
+ grid/.is if=@showgrid@grid,
+ left/.is if=@showgrid@left,
+ right/.is if=@showgrid@right,
+ below/.is if=@showgrid@below,
+ above/.is if=@showgrid@above,
+ false,
+}
+
+\def\@showgrid#1{%
+ \begin{scope}[every show grid,show grid/.cd,#1]
+ \if@showgrid@grid
+ \begin{pgfonlayer}{background}
+ \draw [help lines]
+ (current bounding box.south west) grid
+ (current bounding box.north east);
+%
+ \pgfpointxy{1}{1}%
+ \edef\xs{\the\pgf@x}%
+ \edef\ys{\the\pgf@y}%
+ \pgfpointanchor{current bounding box}{south west}
+ \edef\xa{\the\pgf@x}%
+ \edef\ya{\the\pgf@y}%
+ \pgfpointanchor{current bounding box}{north east}
+ \edef\xb{\the\pgf@x}%
+ \edef\yb{\the\pgf@y}%
+ \pgfmathtruncatemacro\xbeg{ceil(\xa/\xs)}
+ \pgfmathtruncatemacro\xend{floor(\xb/\xs)}
+ \if@showgrid@below
+ \foreach \X in {\xbeg,...,\xend} {
+ \node [below,show grid/labels,show grid/xlabels] at (\X,\ya) {\X};
+ }
+ \fi
+ \if@showgrid@above
+ \foreach \X in {\xbeg,...,\xend} {
+ \node [above,show grid/labels,show grid/xlabels] at (\X,\yb) {\X};
+ }
+ \fi
+ \pgfmathtruncatemacro\ybeg{ceil(\ya/\ys)}
+ \pgfmathtruncatemacro\yend{floor(\yb/\ys)}
+ \if@showgrid@left
+ \foreach \Y in {\ybeg,...,\yend} {
+ \node [left,show grid/labels,show grid/ylabels] at (\xa,\Y) {\Y};
+ }
+ \fi
+ \if@showgrid@right
+ \foreach \Y in {\ybeg,...,\yend} {
+ \node [right,show grid/labels,show grid/ylabels] at (\xb,\Y) {\Y};
+ }
+ \fi
+ \end{pgfonlayer}
+ \fi
+ \end{scope}
+}
+\tikzset{every show grid/.style={show grid/keep bb}}% Keep the original bounding box!
+
+\endinput \ No newline at end of file
diff --git a/graphics/pmdraw/pmdraw.tex b/graphics/pmdraw/pmdraw.tex
new file mode 100644
index 0000000000..a3c9a93fb7
--- /dev/null
+++ b/graphics/pmdraw/pmdraw.tex
@@ -0,0 +1,2811 @@
+\documentclass{ltxdoc}
+
+% *------------------------------*
+% |2````````````````````````````7|
+% |`````____````____`````````````|
+% |````|MFMF\ /MFMF|````````````|
+% |````|MF|MF\/MF|MF|````````````|
+% |````|MF|\MFMF/|MF|_______`````|
+% |````|MF|``````|MFMFMFMFMF|````|
+% |````|MF|``````|MF|````````````|
+% |````|MF|``````|MF|___`````````|
+% |``````````````|MFMFMF|````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |``````````````|MF|````````````|
+% |8````````````````````````````2|
+% *------------------------------*
+
+\usepackage{pmdraw}
+\usepackage{xcolor}
+\usepackage{fancyvrb}
+\usepackage{hyperref}
+
+\begin{document}
+
+\hypersetup{colorlinks, linkcolor=blue, urlcolor=blue}
+
+\title{The \textsf{pmdraw} package\thanks{This document
+ corresponds to \textsf{pmdraw}~v1.0, 2023-11-08.}}
+\author{Matthias Fresacher \\ \texttt{matthias.ypg37@slmail.me}}
+
+\maketitle
+
+\begin{abstract}
+The \texttt{pmdraw} package allows you to draw elements of the Partition Monoids, commonly referred to diagrams. The package provides a lot of flexibility to draw most diagrams and can be customised as needed.
+\end{abstract}
+
+\tableofcontents
+
+\newpage
+\section{Introduction}
+
+\subsection{Motivation}
+
+Partition monoids and their closely related algebras are well studied objects with applications in theoretical physics and representation theory in mathematics. The elements of these monoids are called diagrams because they can be drawn graphically as a graph following certain conventions.
+
+My PhD thesis examines properties of these partition monoids and hence I needed to draw a large number of diagrams in a neat and consistent way. This thesis work formed the basis of this package with only customisability and the manual needed to be added to complete this package.
+
+\subsection{Acknowledgments}
+
+Most importantly, I thank James East, my PhD supervisor for allowing me to get a little sidetracked in my PhD research and develop and publish this package rather than work on my thesis like I should have.
+
+This package has at its core the basic drawing macro of a diagram as used by James East and Nik Ru\v{s}kuc in their 2022 publication {\it Classification of congruences of twisted partition monoids} in Advances in Mathematics. I thank them both for allowing me to build on their work.
+
+I thank everybody that has helped me proof read, spot bugs, provide feedback, suggest improvements or has otherwise contributed to this package. Those that are happy to be named are (in chronological order):
+\begin{itemize}
+ \item Nik Ru\v{s}kuc
+\end{itemize}
+
+This package heavily uses commands that can accept an arbitrary number of arguments as inputs. I thank \texttt{egreg} for their template upon which my commands are based (\url{https://tex.stackexchange.com/a/72915}).
+
+As this was my first time using keys, I thank David Carlisle for their very helpful example (\url{https://tex.stackexchange.com/a/542555}).
+
+As it turns out, passing my keys to the \verb`\draw` command of \texttt{tikz} is a little more tricky than one might expect. I thank Andrew Stacey for their solution (\url{https://tex.stackexchange.com/a/64237}).
+
+I thank Partha~D.~for their ready to use out of the box macro for adding grid lines to a \texttt{tikz} drawing (\url{https://tex.stackexchange.com/a/467908}).
+
+I also thank everybody on \url{https://tex.stackexchange.com} who has answered a questions or solved a problem. There are too many to list you all. Thank you.
+
+\section{Bugs and known problems}
+
+\subsection{Bugs}
+
+If you discover a bug, please be so kind and send me a minimum working example of the bug in action and I will work on fixing it.
+
+I would like this package to be as perfect as it can be but I will need your help with this as there simply are too many keys to test every combination or use case.
+
+The following are a list of currently known bugs that will be addressed:
+\begin{enumerate}
+ \item None at the moment
+\end{enumerate}
+
+\subsection{Incompatibilities}
+
+The following are a list of known problems or incompatibilities that are not scheduled to be resolved anytime soon:
+\begin{enumerate}
+ \item None at the moment
+\end{enumerate}
+
+\section{Usage}
+
+To use the package, one must understand that all diagrams are created from a basic building block called a brick.
+
+\subsection{Bricks}
+
+\DescribeMacro{brick}
+A \texttt{brick} is a diagram that contains no dots. For example,
+\begin{center}
+ \pmdBrick[ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+ }{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+ }{ % Transversal edges
+ {1}{1}
+ {3}{4}
+ }
+\end{center}
+is a brick whilst
+\begin{center}
+ \pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=2
+ ]{ % Upper non-transversal edges
+ {1}{2}
+ }{ % Lower non-transversal edges
+ {1}{2}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+ }
+\end{center}
+is not a brick.
+\DescribeMacro{<brick>}
+The syntax for a brick contains four components and is as follows:
+\begin{center}
+ \texttt{<brick>~=~[<options>]\{<Uedges>\}\{<Ledges>\}\{<Tedges>\}}
+\end{center}
+where
+\DescribeMacro{brick/<options>}
+the \texttt{<options>} are described in Section~\ref{sec: brick/options}.
+
+\DescribeMacro{<Uedges>}
+is a list of upper non-transversal edges. An upper non-transversal edges has three components \texttt{<Uedges>~=~[<options>]\{<Svertex>\}\{<Tvertex>\}} where
+\DescribeMacro{Uedges/<options>}\DescribeMacro{Ledges/<options>}
+the \texttt{<options>} are described in Section~\ref{sec: NT edge/options},
+\DescribeMacro{<Svertex>}
+\texttt{\{<Svertex>\}} is the starting vertex and
+\DescribeMacro{<Tvertex>}
+\texttt{\{<Tvertex>\}} is the terminating vertex of the edge. Both \texttt{\{<Svertex>\}} and \texttt{\{<Tvertex>\}} are a \( x \)-coordinate and it is assumed that \( \texttt{\{<Svertex>\}} < \texttt{\{<Tvertex>\}} \).
+
+\DescribeMacro{list}
+A \texttt{list} of upper non-transversal edges is simply each upper non-transversal edge written after the other. For example a list with one upper non-transversal edges is
+\begin{verbatim}
+ {1}{2}
+\end{verbatim}
+whilst one with three upper non-transversal edges may be
+\begin{verbatim}
+ {1}{2}[level=1]{3}{4}{5}{6}
+\end{verbatim}
+For ease of reading this will coded as
+\begin{verbatim}
+ {1}{2}
+ [level=1]{3}{4}
+ {5}{6}
+\end{verbatim}
+\DescribeMacro{\pmdEmpty}
+Should a list be empty, the command \verb`\pmdEmpty` should be used.
+
+\DescribeMacro{<Ledges>}
+is a list of lower non-transversal edges. A lower non-transversal edges has the same three components as an upper non-transversal edge, namely \texttt{<Ledges>~=~[<options>]\{<Svertex>\}\{<Tvertex>\}}.
+
+\DescribeMacro{<Tedges>}
+is a list of transversal edges. A transversal edges has three components \texttt{<Tedges>~=~[<options>]\{<Tvertex>\}\{<Bvertex>\}} where
+\DescribeMacro{Tedges/<options>}
+the \texttt{<options>} are described in Section~\ref{sec: T edge/options},
+\DescribeMacro{<Tvertex>}
+\texttt{\{<Tvertex>\}} is the top vertex and
+\DescribeMacro{<Bvertex>}
+\texttt{\{<Bvertex>\}} is the bottom vertex of the edge. Both \texttt{\{<Tvertex>\}} and \texttt{\{<Bvertex>\}} are a \( x \)-coordinate.
+
+An example \texttt{<brick>} and the resultant diagram is:
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+ {4}{5}
+}{ % Transversal edges
+ \pmdEmpty
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+ {4}{5}
+}{ % Transversal edges
+ \pmdEmpty
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\subsection{Draw commands}
+
+This package has three draw commands.
+
+\DescribeMacro{\pmdBrick}
+draws a brick and has the syntax \verb`\pmdBrick<brick>`.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+ {4}{5}
+}{ % Transversal edges
+ \pmdEmpty
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+ {4}{5}
+}{ % Transversal edges
+ \pmdEmpty
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{\pmdDiagram}
+draws arbitrarily many bricks separated by dots and has the syntax
+\begin{verbatim}
+\pmdDiagram[<options>]{<bricks>}
+\end{verbatim}
+where
+\DescribeMacro{diagram/<options>}
+the \texttt{<options>} are described in Section~\ref{sec: diagram/options} and
+\DescribeMacro{<bricks>}
+\texttt{<bricks>} is a list of \texttt{<brick>}-s, with each brick enclosed in curly brackets.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{center}
+
+It should be noted that \verb`\pmdBrick` is simply a wrapper for a single brick that calls \verb`\pmdDiagram` with no diagram options. This means that, for example, the \texttt{grid} key is not available for \verb`\pmdBrick` and \verb`\pmdDiagram` must be used instead to access the \texttt{grid} key.
+
+For edges that go across multiple bricks, know that the coordinate positions of the vertices extends infinitely in both directions. If using default settings, the dots between bricks occupies one vertex position. To help with counting and identifying the correct coordinate position, the \texttt{grid} flag may also be used, see Section~\ref{sec: diagram/options all}.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=3,
+ brace={
+ left=2,
+ right=6,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{6}
+ {3}{5}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=2
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{-1}
+ {2}{-2}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=3,
+ brace={
+ left=2,
+ right=6,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{6}
+ {3}{5}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=2
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{-1}
+ {2}{-2}
+ }
+ }
+}
+\end{center}
+
+\DescribeMacro{\pmdProduct}
+draws two diagrams on top of each other as is the case during multiplication or concatenation and has the syntax
+\begin{verbatim}
+\pmdProduct[<options>]{<Aedges>}{<Tbricks>}{<Bbricks>}
+\end{verbatim}
+where
+\DescribeMacro{diagram/<options>}
+the \texttt{<options>} are described in Section~\ref{sec: diagram/options}.
+
+\DescribeMacro{<Aedges>}
+is a list of edges that are added during the concatenation process. An added edge has two components, namely \texttt{<Aedges>~=~\{<Svertex>\}\{<Tvertex>\}}, where \texttt{\{<Svertex>\}} is the starting vertex and \texttt{\{<Tvertex>\}} is the terminating vertex of the collection of added edges. Both \texttt{\{<Svertex>\}} and \texttt{\{<Tvertex>\}} are a \( x \)-coordinate and it is assumed that \( \texttt{\{<Svertex>\}} < \texttt{\{<Tvertex>\}} \).
+
+\DescribeMacro{<Tbricks>}
+is a list of bricks that correspond to the top diagram, with each brick enclosed in curly brackets.
+
+\DescribeMacro{<Bbricks>}
+is a list of bricks that correspond to the bottom diagram, with each brick enclosed in curly brackets.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdProduct{ % Added edges
+ {1}{5}
+ {7}{8}
+}{ % Top diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ {3}{3}
+ {4}{4}
+ {5}{5}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=2
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=2
+ ]{ % Upper non-transversal edges
+ {1}{2}
+ }{ % Lower non-transversal edges
+ {1}{2}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdProduct{ % Added edges
+ {1}{5}
+ {7}{8}
+}{ % Top diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ {3}{3}
+ {4}{4}
+ {5}{5}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=2
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=2
+ ]{ % Upper non-transversal edges
+ {1}{2}
+ }{ % Lower non-transversal edges
+ {1}{2}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}
+\end{center}
+
+\subsection{Brick options} \label{sec: brick/options}
+
+The following are all of the keys that are available for bricks.
+
+\subsubsection{Vertex options}
+
+\DescribeMacro{degree}
+specifies the degree, that is, the number of vertices in the top and bottom row of the diagram. Must be a positive integer and must be provided unless using \texttt{degree top} and \texttt{degree bottom}.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{degree top} \DescribeMacro{degree bottom}
+specifies the degree, that is, the number of vertices in the top (bottom) row of the diagram. Must be a positive integer and must be provided as a pair \texttt{degree top} and \texttt{degree bottom}.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree top=5,
+ degree bottom=4
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree top=5,
+ degree bottom=4
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{blank top} \DescribeMacro{blank bottom}
+specifies the number of blank vertices to the left of the top (bottom) row of the diagram. Default is zero.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ blank top=1,
+ degree top=4,
+ degree bottom=5
+]{ % Upper non-transversal edges
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ blank top=1,
+ degree top=4,
+ degree bottom=5
+]{ % Upper non-transversal edges
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+It should also be noted that the \texttt{blank top} and \texttt{blank bottom} can also be used to create more space between bricks and the dots between bricks by setting a large number. Likewise if set to \( -1 \) and the dots is redefined to not draw, the space between bricks can be removed altogether. See Examples~13-15.
+
+\DescribeMacro{row sep}
+specifies the vertical separation between rows of vertices. Default is two.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ row sep=4
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ row sep=4
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{vertices}
+passes through options to the \verb`\draw` command of vertices. The default is no argument.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ vertices=blue
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ vertices=blue
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{vertices options}
+allows for the redefinition of the command that draws the vertices. It has two arguments, the \( x \) and \( y \)-position of the vertex. The default is
+\begin{verbatim}
+\fill[apply style/.expand once=\pmdraw@drawVertexOptions] (#1,#2) circle (.17);
+\end{verbatim}
+An example use is
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ vertices options={
+ \draw[very thick] (#1,#2) circle (.25);
+ }
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdBrick[ % Options
+ degree=5,
+ vertices options={
+ \draw[very thick] (#1,#2) circle (.25);
+ }
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{center}
+
+\DescribeMacro{labels}\DescribeMacro{labels top}\DescribeMacro{labels bottom}
+flags that allow for the drawing of labels for the vertices. Use \texttt{labels} for labels on both the top and bottom or set individually. The default is no labels.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ labels bottom
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ labels bottom
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{labels start}\DescribeMacro{labels top start}\DescribeMacro{labels bottom start}
+sets the starting value of the labels for the vertices. The default is one.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ labels,
+ labels top start=3,
+ labels bottom start=-2
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ labels,
+ labels top start=3,
+ labels bottom start=-2
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{labels top draw}\DescribeMacro{labels top node}\DescribeMacro{labels bottom draw}\DescribeMacro{labels bottom node}
+passes through options to the \verb`\draw` and \verb`node` command of the labels of vertices. The default is no argument.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ labels,
+ labels top node=red,
+ labels bottom node={right=2pt}
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdBrick[ % Options
+ degree=5,
+ labels,
+ labels top node=red,
+ labels bottom node={right=2pt}
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{center}
+
+\DescribeMacro{labels top options}\DescribeMacro{labels bottom options}
+allows for the redefinition of the command that draws the labels of the vertices. They have three arguments, the \( x \) and \( y \)-position of the vertex and the label value. The default for the top is
+\begin{verbatim}
+\draw[apply style/.expand once=\pmdraw@drawLabelTDrawOptions] (#1,#2)
+ node[above=6pt,apply style/.expand once=\pmdraw@drawLabelTNodeOptions] {\(#3\)};
+\end{verbatim}
+and for the bottom
+\begin{verbatim}
+\draw[apply style/.expand once=\pmdraw@drawLabelBDrawOptions] (#1,#2)
+ node[below=6pt,apply style/.expand once=\pmdraw@drawLabelBNodeOptions] {\(#3'\)};
+\end{verbatim}
+An example use is
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ labels,
+ labels bottom options={
+ \draw (#1,#2) node[below=6pt,blue] {\(#3''\)};
+ }
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdBrick[ % Options
+ degree=5,
+ labels,
+ labels bottom options={
+ \draw (#1,#2) node[below=6pt,blue] {\(#3''\)};
+ }
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{center}
+
+\DescribeMacro{no dots}
+The \texttt{no dots} flag removes the drawing of dots to the left of the current brick in diagrams. Default is to draw dots except for the first brick.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1,
+ no dots
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1,
+ no dots
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{center}
+
+
+\DescribeMacro{dots draw}\DescribeMacro{dots node}
+passes through options to the \verb`\draw` and \verb`node` command of the dots. The default is no argument.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1,
+ dots node=red
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1,
+ dots node=red
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{center}
+
+\subsubsection{Edge options}
+
+These options should be read in conjunction with Section~\ref{sec: edge/options}.
+
+\DescribeMacro{levels}
+specifies how many horizontal levels there are for non-transversal edges. Default is one.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ levels=3
+]{ % Upper non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Lower non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Transversal edges
+ \pmdEmpty
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ levels=3
+]{ % Upper non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Lower non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Transversal edges
+ \pmdEmpty
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{levels top} \DescribeMacro{levels bottom}
+specifies how many horizontal levels there are for upper (lower) non-transversal edges. Default is one.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ levels top=3,
+ levels bottom=2
+]{ % Upper non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Lower non-transversal edges
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Transversal edges
+ \pmdEmpty
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ levels top=3,
+ levels bottom=2
+]{ % Upper non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Lower non-transversal edges
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Transversal edges
+ \pmdEmpty
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{levels sep}
+specifies the vertical separation between horizontal levels for non-transversal edges. Default is evenly spaced within the space available for the given number of \texttt{levels}.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ levels=3,
+ levels sep=0.3
+]{ % Upper non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Lower non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Transversal edges
+ \pmdEmpty
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ levels=3,
+ levels sep=0.3
+]{ % Upper non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Lower non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Transversal edges
+ \pmdEmpty
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{levels sep top} \DescribeMacro{levels sep bottom}
+specifies the vertical separation between horizontal levels for upper (lower) non-transversal edges. Default is evenly spaced within the space available for the given number of \texttt{levels}.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ levels=3,
+ levels sep top=0.4,
+ levels sep bottom=0.15
+]{ % Upper non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Lower non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Transversal edges
+ \pmdEmpty
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ levels=3,
+ levels sep top=0.4,
+ levels sep bottom=0.15
+]{ % Upper non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Lower non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Transversal edges
+ \pmdEmpty
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{edges}\DescribeMacro{edges non-transversal}\DescribeMacro{edges upper}\DescribeMacro{edges lower}\DescribeMacro{edges transversal}
+pass through options to the \verb`\draw` command of their respective edge types. The default is no argument.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ edges upper=blue,
+ edges lower={red, dotted, very thick},
+ edges transversal=dashed
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdBrick[ % Options
+ degree=5,
+ edges upper=blue,
+ edges lower={red, dotted, very thick},
+ edges transversal=dashed
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{center}
+
+\DescribeMacro{edges first}
+flag ensures edges are drawn before vertices. The default is vertices are drawn first.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ edges lower={red, very thick},
+ edges first
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ edges lower={red, very thick},
+ edges first
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{transversals first}
+flag ensures transversal edges are drawn before non-transversal edges. The default is non-transversal edges are drawn first.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ edges lower={red, very thick},
+ transversals first
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ edges lower={red, very thick},
+ transversals first
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\subsubsection{Brace}
+
+\DescribeMacro{brace}
+specifies instructions for the drawing of a brace with the brace keys. These are described in Section~\ref{sec: brace}. The default is no brace is drawn.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{center}
+
+\DescribeMacro{brace draw}\DescribeMacro{brace node}
+passes through options to the \verb`\draw` and \verb`node` command of the brace. Must be given before the \texttt{brace} key. The default is no argument.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace draw=thin,
+ brace node={pos=0.25},
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace draw=thin,
+ brace node={pos=0.25},
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{center}
+
+\subsubsection{Decorations}
+
+\DescribeMacro{decorate before}\DescribeMacro{decorate after}
+provides a hook to draw additional \texttt{tikz} elements before and after the brick is drawn. The default is empty.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ decorate after={
+ \draw[
+ very thick,
+ red,
+ rounded corners=5pt
+ ] (0.6, -0.4) rectangle (1.4, 2.4);
+ }
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdBrick[ % Options
+ degree=5,
+ decorate after={
+ \draw[
+ very thick,
+ red,
+ rounded corners=5pt
+ ] (0.6, -0.4) rectangle (1.4, 2.4);
+ }
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ {1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{center}
+
+These hooks can also be used for more sophisticated manipulation of diagrams be inserting not just \texttt{tikz} elements but arbitrary code before and after draw a brick.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=4
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ {1}{1}
+ {4}{4}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=3,
+ decorate before={\begin{scope}[red,shift={(1,1)},rotate=30]},
+ decorate after={\end{scope}}
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{2}
+ {2}{3}
+ {3}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=4
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ {1}{1}
+ {4}{4}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=3,
+ decorate before={\begin{scope}[red,shift={(1,1)},rotate=30]},
+ decorate after={\end{scope}}
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{2}
+ {2}{3}
+ {3}{1}
+ }
+ }
+}
+\end{center}
+
+\subsubsection{Drawing order} \label{sec: order}
+
+For clarity, this is the default drawing order for a brick:
+\begin{enumerate}
+ \item \texttt{decorate before}
+ \item Top row of vertices
+ \item Bottom row of vertices
+ \item Upper non-transversal edges
+ \item Lower non-transversal edges
+ \item Transversal edges
+ \item \texttt{decorate after}
+\end{enumerate}
+
+This order can be altered using the \texttt{edges first} and \texttt{transversals first} flags.
+
+For the drawing order of a diagram and product diagram, see the \texttt{decorate before} and \texttt{decorate after} keys in Section~\ref{sec: diagram/options all}.
+
+\subsection{Edge options} \label{sec: edge/options}
+
+\subsubsection{non-transversal edge options} \label{sec: NT edge/options}
+
+\DescribeMacro{level}
+specifies the horizontal level of a non-transversal edges. Default is one.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5,
+ levels=3
+]{ % Upper non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Lower non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Transversal edges
+ \pmdEmpty
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5,
+ levels=3
+]{ % Upper non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Lower non-transversal edges
+ [level=3]{1}{5}
+ [level=2]{1}{4}
+ [level=1]{2}{3}
+}{ % Transversal edges
+ \pmdEmpty
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{height}
+specifies a manually set horizontal height of a non-transversal edges. Default is to use levels.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{5}
+ [height=1.75]{1}{4}
+}{ % Lower non-transversal edges
+ [height=1.25]{1}{5}
+ {1}{4}
+}{ % Transversal edges
+ \pmdEmpty
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{5}
+ [height=1.75]{1}{4}
+}{ % Lower non-transversal edges
+ [height=1.25]{1}{5}
+ {1}{4}
+}{ % Transversal edges
+ \pmdEmpty
+}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+
+\DescribeMacro{options}
+allows for the redefinition of the command that draws the non-transversal edge. It has two arguments, the start and end \( x \)-position of the edge. The default for an upper non-transversal is
+\begin{verbatim}
+ \draw[apply style/.expand once=\pmdraw@drawUedgesDrawOptions]
+ (#1,\pmdraw@rowSep) arc (180:270:\pmdraw{edgeHeight}); % Draw left arch
+ \draw[apply style/.expand once=\pmdraw@drawUedgesDrawOptions]
+ (#1+\pmdraw{edgeHeight},\pmdraw@rowSep-\pmdraw{edgeHeight})
+ -- (#2-\pmdraw{edgeHeight},\pmdraw@rowSep-\pmdraw{edgeHeight}); % Draw straight line
+ \draw[apply style/.expand once=\pmdraw@drawUedgesDrawOptions]
+ (#2-\pmdraw{edgeHeight},\pmdraw@rowSep-\pmdraw{edgeHeight})
+ arc (270:360:\pmdraw{edgeHeight}); % Draw right arc
+\end{verbatim}
+and for a lower non-transversal
+\begin{verbatim}
+ \draw[apply style/.expand once=\pmdraw@drawLedgesDrawOptions]
+ (#1,0) arc (180:90:\pmdraw{edgeHeight}); % Draw left arch
+ \draw[apply style/.expand once=\pmdraw@drawLedgesDrawOptions]
+ (#1+\pmdraw{edgeHeight},\pmdraw{edgeHeight})
+ -- (#2-\pmdraw{edgeHeight},\pmdraw{edgeHeight}); % Draw straight line
+ \draw[apply style/.expand once=\pmdraw@drawLedgesDrawOptions]
+ (#2-\pmdraw{edgeHeight},\pmdraw{edgeHeight})
+ arc (90:0:\pmdraw{edgeHeight}); % Draw right arc
+\end{verbatim}
+An example use is
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ [options={
+ \draw[blue, very thick] (#1,0) -- (#2,0);
+ }]{1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdBrick[ % Options
+ degree=5
+]{ % Upper non-transversal edges
+ {1}{2}
+ {2}{5}
+}{ % Lower non-transversal edges
+ [options={
+ \draw[blue, very thick] (#1,0) -- (#2,0);
+ }]{1}{2}
+ {3}{4}
+}{ % Transversal edges
+ {1}{1}
+ {3}{4}
+}
+\end{center}
+
+\subsubsection{Transversal edge options} \label{sec: T edge/options}
+
+\DescribeMacro{height}
+draws transversal edges with a horizontal component and specifies the manually set horizontal height of the transversal edges. Default is to use non-horizontal transversal edges.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree top=5,
+ degree bottom=6
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ [height=1]{10}{2}
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=3,
+ blank bottom=1,
+ degree bottom=2
+ ]{ % Upper non-transversal edges
+ {1}{2}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree top=5,
+ degree bottom=6
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ [height=1]{10}{2}
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=3,
+ blank bottom=1,
+ degree bottom=2
+ ]{ % Upper non-transversal edges
+ {1}{2}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}
+\end{center}
+
+\DescribeMacro{options}
+allows for the redefinition of the command that draws the transversal edge. It has two arguments, the \( x \)-position of the edge in the top row of vertices and the \( x \)-position of the edge in the bottom row of vertices. The default is
+\begin{verbatim}
+ \ifnum\pmdraw@ifTedgeHorizontal=0 % If drawing a straight line edge
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions]
+ (#1,\pmdraw@rowSep) -- (#2,0); % Draw straight line
+ \else % If transversal edge is drawn horizontally
+ \ifnum#1>#2 % If edge goes from top right to bottom left
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions]
+ (#2,0) arc (180:90:\pmdraw{Tlevel}); % Draw bottom arch
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions]
+ (#2+\pmdraw{Tlevel},\pmdraw{Tlevel})
+ -- (#1-\pmdraw@rowSep+\pmdraw{Tlevel}, \pmdraw{Tlevel}); % Draw straight line
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions]
+ (#1-\pmdraw@rowSep+\pmdraw{Tlevel},\pmdraw{Tlevel})
+ arc (270:360:{\pmdraw@rowSep-\pmdraw{Tlevel}}); % Draw top arc
+ \else % If edge goes from top left to bottom right
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions]
+ (#2,0) arc (0:90:\pmdraw{Tlevel}); % Draw bottom arch
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions]
+ (#2-\pmdraw{Tlevel},\pmdraw{Tlevel})
+ -- (#1+\pmdraw@rowSep-\pmdraw{Tlevel}, \pmdraw{Tlevel}); % Draw straight line
+ \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions]
+ (#1+\pmdraw@rowSep-\pmdraw{Tlevel},\pmdraw{Tlevel})
+ arc (270:180:{\pmdraw@rowSep-\pmdraw{Tlevel}}); % Draw top arc
+ \fi%
+ \renewcommand{\pmdraw@ifTedgeHorizontal}{0} % Reset flag to default
+ \fi%
+\end{verbatim}
+An example use is
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree top=5,
+ degree bottom=6
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ [options={
+ \draw (#2,0) -- (#2+1,1); % Draw bottom line
+ \draw (#2+1,1) -- (#1-1, 1); % Draw straight line
+ \draw (#1-1,1) -- (#1,2); % Draw top line
+ }]{10}{2}
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=3,
+ blank bottom=1,
+ degree bottom=2
+ ]{ % Upper non-transversal edges
+ {1}{2}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree top=5,
+ degree bottom=6
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ [options={
+ \draw (#2,0) -- (#2+1,1); % Draw bottom line
+ \draw (#2+1,1) -- (#1-1, 1); % Draw straight line
+ \draw (#1-1,1) -- (#1,2); % Draw top line
+ }]{10}{2}
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=3,
+ blank bottom=1,
+ degree bottom=2
+ ]{ % Upper non-transversal edges
+ {1}{2}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}
+\end{center}
+
+
+\subsection{Brace} \label{sec: brace}
+
+\DescribeMacro{brick/brace}
+As part of a diagram, it may be useful to draw a brace. The options of a brace are as follows:
+
+\DescribeMacro{left}\DescribeMacro{right}
+specifies the \( x \)-position of the start/left and end/right of the brace. Both must be provided.
+
+\DescribeMacro{label}
+specifies the label to be printed with the brace. Default is empty.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{center}
+
+\DescribeMacro{above}
+The \texttt{above} flag draws the brace above the diagram. Default is below.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n},
+ above
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n},
+ above
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{center}
+
+\DescribeMacro{options}
+allows for the redefinition of the command that draws the brace. It has three arguments, the \( x \)-position start and end of the brace, as well as the label of the brace. The default is
+\begin{verbatim}
+ \ifnum\pmdraw@ifProdDiag=1 % If drawing a product diagram
+ % or if placing brace above diagram
+ \draw[
+ very thick,
+ decorate,
+ decoration={calligraphic brace,amplitude=6pt},
+ apply style/.expand once=\pmdraw@drawBraceDrawOptions
+ ] (#1-0.17,\pmdraw@rowSep+0.5) -- (#2+0.17,\pmdraw@rowSep+0.5)
+ node[
+ pos=0.5,
+ above=6pt,
+ apply style/.expand once=\pmdraw@drawBraceNodeOptions
+ ] {\(#3\)}; % Draw brace on top of diagram
+ \else % If not drawing a product diagram or if placing brace below diagram
+ \draw[
+ very thick,
+ decorate,
+ decoration={calligraphic brace,mirror,amplitude=6pt},
+ apply style/.expand once=\pmdraw@drawBraceDrawOptions
+ ] (#1-0.17,-0.5) -- (#2+0.17,-0.5)
+ node[
+ pos=0.5,
+ below=6pt,
+ apply style/.expand once=\pmdraw@drawBraceNodeOptions
+ ] {\(#3\)}; % Draw brace on bottom of diagram
+ \fi%
+\end{verbatim}
+it should be noted that the flag \verb`\pmdraw@ifProdDiag` is both used for when drawing a product diagram but also when placing the brace above the diagram as this clearly must be the default for the top diagram in a product diagram.
+An example use is
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n},
+ options={
+ \draw[
+ red,
+ very thick,
+ decorate,
+ decoration={calligraphic brace,mirror,amplitude=6pt}
+ ] (#1-0.17,-0.5) -- (#2+0.17,-0.5)
+ node[pos=0.25,below=6pt]{\(#3\)};
+ }
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=4,
+ label={n},
+ options={
+ \draw[
+ red,
+ very thick,
+ decorate,
+ decoration={calligraphic brace,mirror,amplitude=6pt}
+ ] (#1-0.17,-0.5) -- (#2+0.17,-0.5)
+ node[pos=0.25,below=6pt]{\(#3\)};
+ }
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{center}
+
+\subsection{Diagram options} \label{sec: diagram/options}
+
+\subsubsection{For all (product) diagrams} \label{sec: diagram/options all}
+
+The following options can be used for both diagrams (\verb`\pmdDiagram`) and product diagrams (\verb`\pmdProduct`).
+
+\DescribeMacro{row sep}
+same as \texttt{row sep} option in bricks but applied to all bricks within (product) diagram.
+
+\DescribeMacro{dots options}
+allows for the redefinition of the command that draws dots between bricks. It has two arguments, the \( x \) and \( y \)-position of the dots. The default is
+\begin{verbatim}
+ \draw[apply style/.expand once=\pmdraw@drawDotsDrawOptions]
+ (#1,#2) node[apply style/.expand once=\pmdraw@drawDotsNodeOptions] {\(\dots\)};
+\end{verbatim}
+An example use is
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram[ % Options
+ dots options={
+ \draw[red] (#1,#2) node {\(\dots\dots\)};
+ }
+]{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=5,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1,
+ blank top=1,
+ blank bottom=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {2}{2}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram[ % Options
+ dots options={
+ \draw[red] (#1,#2) node {\(\dots\dots\)};
+ }
+]{
+ { % Brick 1
+ [ % Options
+ degree=2,
+ brace={
+ left=1,
+ right=5,
+ label={n}
+ }
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree=1,
+ blank top=1,
+ blank bottom=1
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {2}{2}
+ }
+ }
+}
+\end{center}
+
+\DescribeMacro{grid}
+As it can get confusing where things are drawn and the different coordinate scopes between all the bricks and diagrams, the \texttt{grid} flag draws the base coordinate grid that the first drawn brick is based on. This should help with all coordinate related inquiries. Default is no grid.
+
+It should be noted that the \texttt{grid} key is not available for \verb`\pmdBrick` and \verb`\pmdDiagram` must be used instead when needing a grid for a single brick only.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdDiagram[ % Options
+ grid
+]{
+ { % Brick 1
+ [ % Options
+ degree top=5,
+ degree bottom=6,
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ [height=1]{10}{2}
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=3,
+ blank bottom=1,
+ degree bottom=
+ ]{ % Upper non-transversal edges
+ {1}{2}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdDiagram[ % Options
+ grid
+]{
+ { % Brick 1
+ [ % Options
+ degree top=5,
+ degree bottom=6
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {3}{4}
+ {5}{6}
+ }{ % Transversal edges
+ [height=1]{10}{2}
+ {1}{1}
+ }
+ }{ % Brick 2
+ [ % Options
+ degree top=3,
+ blank bottom=1,
+ degree bottom=2
+ ]{ % Upper non-transversal edges
+ {1}{2}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ }{ % Transversal edges
+ \pmdEmpty
+ }
+ }
+}
+\end{center}
+
+\DescribeMacro{decorate before}\DescribeMacro{decorate after}
+same as \texttt{decorate before} and \texttt{decorate after} in bricks but these are drawn before (after) all bricks are drawn. For clarity, this is default drawing order for a diagram:
+\begin{enumerate}
+ \item \texttt{diagram/decorate before}
+ \item Brick loop:
+ \begin{enumerate}
+ \item \texttt{brick/decorate before}
+ \item Draws brick
+ \item \texttt{brick/decorate after}
+ \end{enumerate}
+ \item \texttt{diagram/decorate after}
+\end{enumerate}
+And this is default drawing order for a product diagram:
+\begin{enumerate}
+ \item \texttt{diagram/decorate before}
+ \item Draws added edges
+ \item Top diagram:
+ \begin{enumerate}
+ \item Brick loop:
+ \begin{enumerate}
+ \item \texttt{brick/decorate before}
+ \item Draws brick
+ \item \texttt{brick/decorate after}
+ \end{enumerate}
+ \end{enumerate}
+ \item Bottom diagram:
+ \begin{enumerate}
+ \item Brick loop:
+ \begin{enumerate}
+ \item \texttt{brick/decorate before}
+ \item Draws brick
+ \item \texttt{brick/decorate after}
+ \end{enumerate}
+ \end{enumerate}
+ \item \texttt{diagram/decorate after}
+\end{enumerate}
+
+For the drawing order of a brick see Section~\ref{sec: order}.
+
+\subsubsection{For product diagrams only}
+
+The following options can only be used for product diagrams (\verb`\pmdProduct`).
+
+\DescribeMacro{diagram sep}
+specifies the vertical separation between the bottom row of vertices in top diagram and the top row of vertices in bottom diagram. Default is one.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdProduct[ % Options
+ diagram sep=2
+]{ % Added edges
+ {1}{5}
+}{ % Top diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ {3}{3}
+ {4}{4}
+ {5}{5}
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdProduct[ % Options
+ diagram sep=2
+]{ % Added edges
+ {1}{5}
+}{ % Top diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ {3}{3}
+ {4}{4}
+ {5}{5}
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{center}
+
+\DescribeMacro{edges added}
+passes through options to the \verb`\draw` command of the added edges. The default is no argument.
+\begin{center}
+ \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax}
+ \begin{minipage}[c]{0.4\linewidth}
+\begin{verbatim}
+\pmdProduct[ % Options
+ edges added={red,very thick}
+]{ % Added edges
+ {1}{5}
+}{ % Top diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ {3}{3}
+ {4}{4}
+ {5}{5}
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{verbatim}
+ \end{minipage}
+ \hfill
+ \begin{minipage}[c]{0.4\linewidth}
+ \end{minipage}
+ \end{minipage}%
+\end{center}
+\begin{center}
+\pmdProduct[ % Options
+ edges added={red,very thick}
+]{ % Added edges
+ {1}{5}
+}{ % Top diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ \pmdEmpty
+ }{ % Lower non-transversal edges
+ \pmdEmpty
+ }{ % Transversal edges
+ {1}{1}
+ {2}{2}
+ {3}{3}
+ {4}{4}
+ {5}{5}
+ }
+ }
+}{ % Bottom diagram
+ { % Brick 1
+ [ % Options
+ degree=5
+ ]{ % Upper non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Lower non-transversal edges
+ {2}{3}
+ {4}{5}
+ }{ % Transversal edges
+ {1}{1}
+ }
+ }
+}
+\end{center}
+
+\section{Future features/work}
+
+I have attempted to make most use cases easy to use with dedicated functionality that does not require significant \LaTeX\ knowledge whilst at the same time provide more advanced interfaces to allow for hopefully almost complete customisability for those who put in the effort.
+
+Having said that, please do let me know if there are features or improvements you will like to see added.
+
+The following are some of the aims for the future for this package:
+\begin{enumerate}
+ \item Fix bugs.
+ \item Add warning and error messages to log.
+ \item Allow all brick keys to work as diagram keys that apply to all bricks in a diagram. This will require setting up a flag for each key so that the diagram key sets the brick key but the brick key is not reset after drawing the first brick. This process also will need to be able to handle when a single brick has a custom special different key value and that this is reset to the digram key value and not the global default key value.
+ \item Allow appropriate diagram keys to work as brick keys. Notably the \texttt{grid} key.
+ \item Create a \texttt{tikz} key for passing options to the \texttt{tikz} environment. Have as an example a different scale for diagram.
+ \item The creation of user profiles that allows for fast and efficient setting of default key values that are different to the package defaults. Hence within a diagram, there can be a number of differetn diagram styles that can be accessed with one command.
+ \item Allow for adjusting the horizontal spacing of vertices. Need to think about making that a simple scale factor so that integer interface for edge positions is the same but then hooks will have very messy coordinates or keep it as absolute coordinates with messy edges. Alternatively, do both, allowing the user to choose which option to do and somehow distinguish between the two in the background.
+\end{enumerate}
+
+\section{Examples}
+
+This section is simply a collection of example diagrams. The code for them can be found in the \texttt{examples} folder. Perhaps you will find them useful as a starting point for your diagrams or to see what this package is capable of.
+
+\usetikzlibrary{patterns}
+
+\foreach \example in {1,...,25}{
+ \paragraph{Example~\example}
+ \begin{center}
+ \input{examples/example-\example}
+ \end{center}
+}
+
+\end{document} \ No newline at end of file