diff options
Diffstat (limited to 'graphics/pgf/contrib/pmdraw')
29 files changed, 7528 insertions, 0 deletions
diff --git a/graphics/pgf/contrib/pmdraw/README.md b/graphics/pgf/contrib/pmdraw/README.md new file mode 100644 index 0000000000..dfc3e2924d --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/README.md @@ -0,0 +1,74 @@ +pmdraw +====== + +*README V1.4 2024-06-02* + +<!-- + +*------------------------------* +|6````````````````````````````5| +|`````____````____`````````````| +|````|MFMF\ /MFMF|````````````| +|````|MF|MF\/MF|MF|````````````| +|````|MF|\MFMF/|MF|_______`````| +|````|MF|``````|MFMFMFMFMF|````| +|````|MF|``````|MF|````````````| +|````|MF|``````|MF|___`````````| +|``````````````|MFMFMF|````````| +|``````````````|MF|````````````| +|``````````````|MF|````````````| +|``````````````|MF|````````````| +|4````````````````````````````1| +*------------------------------* +--> + +The `pmdraw` package allows you to draw elements of the diagram monoids, commonly referred to as diagrams. The package provides a lot of +flexibility to draw most diagrams and can be customised as needed. + +The package makes use of the `tikz` and `keyval` packages. + + +Usage +----- + +The usage of the package requires some basic understanding of +partition diagrams as well as the interface used. Please read the +manual for a complete explanation. + + +Contact +------- + +If you discover a bug, please be so kind and send me a minimum working +example of the bug in action and I will work on fixing it. My details +are <matthias.ypg37@slmail.me>. + + +Author +------- + +- Matthias Fresacher + + +License +------- + +Copyright 2023-10-16 (original release) & 2024, Matthias Fresacher + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3 +of this license or (at your option) any later version. +The latest version of this license is found via +<http://www.latex-project.org/lppl.txt>. + +This work has the LPPL maintenance status `maintained`. + +The Current Maintainer of this work is Matthias Fresacher. + + +Contents +------- + +This work consists of the files `pmdraw.sty`, `pmdraw.tex` and the +examples in the folder `examples`, in addition to the derived file +`pmdraw.pdf`.
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/examples/example-1.tex b/graphics/pgf/contrib/pmdraw/examples/example-1.tex new file mode 100644 index 0000000000..402c418a15 --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/examples/example-1.tex @@ -0,0 +1,36 @@ +%!TEX root = ../pmdraw.tex + +% *------------------------------* +% |4````````````````````````````8| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |1````````````````````````````8| +% *------------------------------* + +\pmdBrick[ % Options + degree=5, + levels top=4, + levels bottom=3 +]{ % Upper non transversal edges + {1}{2} + {3}{4} + [level=2]{2}{4} + [level=3]{2}{5} + [level=4]{1}{5} +}{ % Lower non transversal edges + {1}{2} + {3}{4} + [level=2]{2}{4} + [level=3]{2}{5} +}{ % Transversal edges + \pmdEmpty +}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/examples/example-10.tex b/graphics/pgf/contrib/pmdraw/examples/example-10.tex new file mode 100644 index 0000000000..01d1502f32 --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/examples/example-10.tex @@ -0,0 +1,37 @@ +%!TEX root = ../pmdraw.tex + +% *------------------------------* +% |6````````````````````````````8| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |2````````````````````````````8| +% *------------------------------* + +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=17 + ]{ % Upper non transversal edges + \pmdEmpty + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + [height=1.75]{11}{1} + [height=1.5]{12}{2} + [height=1.25]{13}{3} + [height=1]{14}{4} + [height=0.75]{15}{5} + [height=0.5]{16}{6} + [height=0.25]{17}{7} + } + } +}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/examples/example-11.tex b/graphics/pgf/contrib/pmdraw/examples/example-11.tex new file mode 100644 index 0000000000..9729320f40 --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/examples/example-11.tex @@ -0,0 +1,37 @@ +%!TEX root = ../pmdraw.tex + +% *------------------------------* +% |4````````````````````````````8| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |8````````````````````````````3| +% *------------------------------* + +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=14 + ]{ % Upper non transversal edges + \pmdEmpty + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + [height=1.75]{11}{1} + [height=1.25]{12}{2} + [height=0.75]{13}{3} + [height=0.25]{14}{4} + [height=0.5]{1}{11} + [height=1]{2}{12} + [height=1.5]{3}{13} + } + } +}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/examples/example-12.tex b/graphics/pgf/contrib/pmdraw/examples/example-12.tex new file mode 100644 index 0000000000..f21946849f --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/examples/example-12.tex @@ -0,0 +1,101 @@ +%!TEX root = ../pmdraw.tex + +% *------------------------------* +% |6````````````````````````````7| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |2````````````````````````````4| +% *------------------------------* + +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=16, + row sep=3, % Must be before levels key + levels=3, + vertices options={ + \fill[red] (#1,#2) circle (.5); + }, + edges upper={very thick}, + edges transversal={red,very thick}, + brace={ + left=1, + right=4, + label={4}, + options={ + \draw [ + red, + very thick, + decorate, + decoration={calligraphic brace,mirror,amplitude=6pt} + ] (#1-0.17,-0.5) -- (#2+0.17,-0.5) node[pos=0.5,below=6pt]{\(#3\)}; + } + } + ]{ % Upper non transversal edges + {4}{5} + [ % Options + options={ + \draw[blue] (#1,3) arc (180:270:\pmdraw{edgeHeight}); % Draw left arch + \draw[blue] (#1+\pmdraw{edgeHeight},3-\pmdraw{edgeHeight}) -- (#2-\pmdraw{edgeHeight},3-\pmdraw{edgeHeight}); % Draw straight line + \draw[blue] (#2-\pmdraw{edgeHeight},3-\pmdraw{edgeHeight}) arc (270:360:\pmdraw{edgeHeight}); % Draw right arc + } + ]{4}{6} + [level=2]{4}{7} + [level=3]{4}{8} + }{ % Lower non transversal edges + {4}{5} + [ + options={ + \draw[green] (#1,0) arc (180:90:\pmdraw{edgeHeight}); % Draw left arch + \draw[green] (#1+\pmdraw{edgeHeight},\pmdraw{edgeHeight}) -- (#2-\pmdraw{edgeHeight},\pmdraw{edgeHeight}); % Draw straight line + \draw[green] (#2-\pmdraw{edgeHeight},\pmdraw{edgeHeight}) arc (90:0:\pmdraw{edgeHeight}); % Draw right arc + } + ]{4}{6} + [level=2]{4}{7} + [level=3]{4}{8} + } + { % Transversal edges + [height=1.75]{11}{1} + [height=1.25]{12}{2} + [height=0.75]{13}{3} + [height=0.25]{14}{4} + [height=0.5]{1}{11} + [height=1]{2}{12} + [height=1.5]{3}{13} + [ + options={ + \draw[dashed] (#1, 3) -- (#2, 0); % Draw straight line + } + ]{16}{16} + {15}{15} + } + } + { % Brick 2 + [ % Options + degree=14, + row sep=3, % Must be before levels key + levels=3 + ]{ % Upper non transversal edges + \pmdEmpty + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + [height=1.75]{11}{1} + [height=1.25]{12}{2} + [height=0.75]{13}{3} + [height=0.25]{14}{4} + [height=0.5]{1}{11} + [height=1]{2}{12} + [height=1.5]{3}{13} + } + } +}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/examples/example-13.tex b/graphics/pgf/contrib/pmdraw/examples/example-13.tex new file mode 100644 index 0000000000..c3a189e202 --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/examples/example-13.tex @@ -0,0 +1,126 @@ +%!TEX root = ../pmdraw.tex + +% *------------------------------* +% |8````````````````````````````7| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |2````````````````````````````8| +% *------------------------------* + +\pmdProduct +[ % Options + row sep=3, + diagram sep=2, + dots options={ + \draw (#1,#2) node[red] {\(\dots\dots\)}; + } +]{ % Added edges + {1}{3} + {7}{11} + {18}{21} +}{ % Top Diagram + { % Brick 1 + [ % Options + degree top=3, + degree bottom=4 + ]{ % Upper non transversal edges + \pmdEmpty + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{2} + {2}{3} + {3}{4} + {7}{1} + } + }{ % Brick 2 + [ % Options + degree top=7, + blank bottom=1, + degree bottom=5, + levels=2 + ]{ % Upper non transversal edges + [level=2]{3}{16} + {4}{5} + {6}{7} + }{ % Lower non transversal edges + {3}{4} + {5}{6} + }{ % Transversal edges + {1}{2} + } + }{ % Brick 3 + [ % Options + blank top=3, + degree top=5, + blank bottom=4, + degree bottom=4, + levels=2 + ]{ % Upper non transversal edges + {4}{5} + {6}{7} + }{ % Lower non transversal edges + {5}{6} + {7}{8} + }{ % Transversal edges + \pmdEmpty + } + } +}{ % Bottom Diagram + { % Brick 1 + [ % Options + degree top=3, + degree bottom=4 + ]{ % Upper non transversal edges + \pmdEmpty + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{2} + {2}{3} + {3}{4} + [height=1.5]{7}{1} + } + }{ % Brick 2 + [ % Options + degree top=7, + blank bottom=1, + degree bottom=5, + levels=2 + ]{ % Upper non transversal edges + [level=2]{3}{16} + {4}{5} + {6}{7} + }{ % Lower non transversal edges + {3}{4} + {5}{6} + }{ % Transversal edges + {1}{2} + } + }{ % Brick 3 + [ % Options + blank top=3, + degree top=5, + blank bottom=4, + degree bottom=4, + levels=2 + ]{ % Upper non transversal edges + {4}{5} + {6}{7} + }{ % Lower non transversal edges + {5}{6} + {7}{8} + }{ % Transversal edges + \pmdEmpty + } + } +}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/examples/example-14.tex b/graphics/pgf/contrib/pmdraw/examples/example-14.tex new file mode 100644 index 0000000000..0ad77f546d --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/examples/example-14.tex @@ -0,0 +1,76 @@ +%!TEX root = ../pmdraw.tex + +% *------------------------------* +% |6````````````````````````````2| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |4````````````````````````````1| +% *------------------------------* + +\pmdDiagram +[ % Options + row sep=3, + diagram sep=2, + dots options={ + \draw (#1,#2) node[red] {\(\mid\)}; + } +]{ + { % Brick 1 + [ % Options + degree top=3, + degree bottom=4 + ]{ % Upper non transversal edges + \pmdEmpty + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{2} + {2}{3} + {3}{4} + {7}{1} + } + }{ % Brick 2 + [ % Options + degree top=7, + blank bottom=1, + degree bottom=5, + levels=2 + ]{ % Upper non transversal edges + [level=2]{3}{16} + {4}{5} + {6}{7} + }{ % Lower non transversal edges + {3}{4} + {5}{6} + }{ % Transversal edges + {1}{2} + } + }{ % Brick 3 + [ % Options + blank top=-1, + degree top=9, + blank bottom=4, + degree bottom=4, + levels=2 + ]{ % Upper non transversal edges + {0}{1} + {2}{3} + {4}{5} + {6}{7} + }{ % Lower non transversal edges + {5}{6} + {7}{8} + }{ % Transversal edges + \pmdEmpty + } + } +}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/examples/example-15.tex b/graphics/pgf/contrib/pmdraw/examples/example-15.tex new file mode 100644 index 0000000000..672965eb13 --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/examples/example-15.tex @@ -0,0 +1,76 @@ +%!TEX root = ../pmdraw.tex + +% *------------------------------* +% |3````````````````````````````7| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |1````````````````````````````6| +% *------------------------------* + +\pmdDiagram +[ % Options + row sep=3, + diagram sep=2, + dots options={ + \draw (#1,#2) node {}; + } +]{ + { % Brick 1 + [ % Options + degree top=3, + degree bottom=4 + ]{ % Upper non transversal edges + \pmdEmpty + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{2} + {2}{3} + {3}{4} + {7}{1} + } + }{ % Brick 2 + [ % Options + degree top=7, + blank bottom=1, + degree bottom=5, + levels=2 + ]{ % Upper non transversal edges + [level=2]{3}{16} + {4}{5} + {6}{7} + }{ % Lower non transversal edges + {3}{4} + {5}{6} + }{ % Transversal edges + {1}{2} + } + }{ % Brick 3 + [ % Options + blank top=-1, + degree top=9, + blank bottom=4, + degree bottom=4, + levels=2 + ]{ % Upper non transversal edges + {0}{1} + {2}{3} + {4}{5} + {6}{7} + }{ % Lower non transversal edges + {5}{6} + {7}{8} + }{ % Transversal edges + \pmdEmpty + } + } +}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/examples/example-16.tex b/graphics/pgf/contrib/pmdraw/examples/example-16.tex new file mode 100644 index 0000000000..efacb4d246 --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/examples/example-16.tex @@ -0,0 +1,127 @@ +%!TEX root = ../pmdraw.tex + +% *------------------------------* +% |3````````````````````````````0| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |1````````````````````````````9| +% *------------------------------* + +\pmdProduct +[ % options + row sep=3, + diagram sep=2, + dots options={ + \draw (#1,#2) node[red] {\(\dots\dots\)}; + }, + edges added={dashed,blue} +]{ % Added edges + {1}{3} + {7}{11} + {18}{21} +}{ % Top Diagram + { % Brick 1 + [ % Options + degree top=3, + degree bottom=4 + ]{ % Upper non transversal edges + \pmdEmpty + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{2} + {2}{3} + {3}{4} + {7}{1} + } + }{ % Brick 2 + [ % Options + degree top=7, + blank bottom=1, + degree bottom=5, + levels=2 + ]{ % Upper non transversal edges + [level=2]{3}{16} + {4}{5} + {6}{7} + }{ % Lower non transversal edges + {3}{4} + {5}{6} + }{ % Transversal edges + {1}{2} + } + }{ % Brick 3 + [ % Options + blank top=3, + degree top=5, + blank bottom=4, + degree bottom=4, + levels=2 + ]{ % Upper non transversal edges + {4}{5} + {6}{7} + }{ % Lower non transversal edges + {5}{6} + {7}{8} + }{ % Transversal edges + \pmdEmpty + } + } +}{ % Bottom Diagram + { % Brick 1 + [ % Options + degree top=3, + degree bottom=4 + ]{ % Upper non transversal edges + \pmdEmpty + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{2} + {2}{3} + {3}{4} + [height=1.5]{7}{1} + } + }{ % Brick 2 + [ % Options + degree top=7, + blank bottom=1, + degree bottom=5, + levels=2 + ]{ % Upper non transversal edges + [level=2]{3}{16} + {4}{5} + {6}{7} + }{ % Lower non transversal edges + {3}{4} + {5}{6} + }{ % Transversal edges + {1}{2} + } + }{ % Brick 3 + [ % Options + blank top=3, + degree top=5, + blank bottom=4, + degree bottom=4, + levels=2 + ]{ % Upper non transversal edges + {4}{5} + {6}{7} + }{ % Lower non transversal edges + {5}{6} + {7}{8} + }{ % Transversal edges + \pmdEmpty + } + } +}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/examples/example-17.tex b/graphics/pgf/contrib/pmdraw/examples/example-17.tex new file mode 100644 index 0000000000..97c6052f8a --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/examples/example-17.tex @@ -0,0 +1,70 @@ +%!TEX root = ../pmdraw.tex + +% *------------------------------* +% |9````````````````````````````0| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |7````````````````````````````0| +% *------------------------------* + +\pmdDiagram[grid]{ + { % Brick 1 + [ % Options + degree=2, + brace node=red, + edges transversal=blue, + brace={ + left=1, + right=4, + label={p - 1} + } + ]{ % Upper non transversal edges + \pmdEmpty + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + } + { % Brick 2 + [ % Options + degree top=6, + degree bottom=5, + dots node=blue, + edges upper=red, + edges lower=green, + edges transversal=blue + ]{ % Upper non transversal edges + {3}{4} + {5}{6} + }{ % Lower non transversal edges + {2}{3} + {4}{5} + }{ % Transversal edges + [height=1]{2}{10} + {1}{1} + } + }{ % Brick 3 + [ % Options + degree top=2, + blank top=1, + degree bottom=3 + ]{ % Upper non transversal edges + {2}{3} + }{ % Lower non transversal edges + {1}{2} + }{ % Transversal edges + \pmdEmpty + } + } +}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/examples/example-18.tex b/graphics/pgf/contrib/pmdraw/examples/example-18.tex new file mode 100644 index 0000000000..2d1014a1cb --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/examples/example-18.tex @@ -0,0 +1,52 @@ +%!TEX root = ../pmdraw.tex + +% *------------------------------* +% |8````````````````````````````0| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |4````````````````````````````0| +% *------------------------------* + +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=5, + levels top=1, + levels bottom=1, + labels, + labels top node={red,above=16pt} + ]{ % Upper non transversal edges + [height=1.1]{2}{5} + }{ % Lower non transversal edges + [height=0.3]{2}{5} + }{ % Transversal edges + {1}{1} + } + }{ % Brick 2 + [ % Options + degree=2, + levels top=1, + levels bottom=1, + labels, + labels bottom options={ + \draw (#1,#2) node[below=6pt] {\(#3''\)}; + }, + labels bottom start=6 + ]{ % Upper non transversal edges + {1}{2} + }{ % Lower non transversal edges + {1}{2} + }{ % Transversal edges + {1}{2} + } + } +}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/examples/example-19.tex b/graphics/pgf/contrib/pmdraw/examples/example-19.tex new file mode 100644 index 0000000000..32c24bcf23 --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/examples/example-19.tex @@ -0,0 +1,53 @@ +%!TEX root = ../pmdraw.tex + +% *------------------------------* +% |7````````````````````````````6| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |7````````````````````````````3| +% *------------------------------* + +\pmdDiagram[grid]{ + { % Brick 1 + [ % Options + degree=5, + levels top=1, + levels bottom=1, + labels, + labels top node={red,above=16pt} + ]{ % Upper non transversal edges + [height=1.1]{2}{5} + }{ % Lower non transversal edges + [height=0.3]{2}{5} + }{ % Transversal edges + {1}{1} + } + }{ % Brick 2 + [ % Options + degree=2, + levels top=1, + levels bottom=1, + labels, + labels bottom options={ + \draw (#1,#2) node[below=6pt] {\(#3''\)}; + }, + labels bottom start=6, + labels top start=-4 + ]{ % Upper non transversal edges + {1}{2} + }{ % Lower non transversal edges + {1}{2} + }{ % Transversal edges + {1}{2} + } + } +}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/examples/example-2.tex b/graphics/pgf/contrib/pmdraw/examples/example-2.tex new file mode 100644 index 0000000000..c80de8e5a3 --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/examples/example-2.tex @@ -0,0 +1,39 @@ +%!TEX root = ../pmdraw.tex + +% *------------------------------* +% |0````````````````````````````5| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |0````````````````````````````3| +% *------------------------------* + +\pmdBrick[ % Options + blank top=2, + degree top=5, + blank bottom=1, + degree bottom=4, + levels top=4, + levels bottom=3 +]{ % Upper non transversal edges + {3}{4} + {5}{6} + [level=2]{4}{6} + [level=3]{4}{7} + [level=4]{3}{7} +}{ % Lower non transversal edges + {1}{2} + {3}{4} + [level=2]{2}{4} + [level=3]{2}{5} +}{ % Transversal edges + \pmdEmpty +}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/examples/example-20.tex b/graphics/pgf/contrib/pmdraw/examples/example-20.tex new file mode 100644 index 0000000000..8d0bc25cb3 --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/examples/example-20.tex @@ -0,0 +1,171 @@ +%!TEX root = ../pmdraw.tex + +% *------------------------------* +% |0````````````````````````````9| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |3````````````````````````````8| +% *------------------------------* + +\usetikzlibrary{patterns} + +\newcommand{\blockStyles}{ + \tikzstyle{typeI} = [ + very thick, + rounded corners=5pt, + red, + preaction={fill, red!3} + ] + \tikzstyle{typeT} = [ + very thick, + rounded corners=5pt, + dash pattern={on 7.5pt off 2.5pt}, + green, + preaction={fill, green!3} + ] + \tikzstyle{typeB} = [ + very thick, + rounded corners=5pt, + dash pattern={on 2.5pt off 2.5pt}, + blue, + preaction={fill, blue!3} + ] + \tikzstyle{typeO} = [ + very thick, + rounded corners=5pt, + dash pattern={on 2.5pt off 2.5pt on 7.5pt off 2.5pt}, + orange, + preaction={fill, orange!3} + ] + \tikzstyle{typeU} = [ + very thick, + rounded corners=5pt, + dash pattern={on 2.5pt off 2.5pt on 2.5pt off 2.5pt on 7.5pt off 2.5pt}, + violet, + preaction={fill, violet!3} + ] + \tikzstyle{typeN} = [ + very thick, + rounded corners=5pt, + dash pattern={on 7.5pt off 2.5pt on 7.5pt off 2.5pt on 2.5pt off 2.5pt}, + yellow, + preaction={fill, yellow!3} + ] +} + +\pmdProduct[ % Options + decorate before={ + \blockStyles + \draw[typeI] (0.6, 2.4) -- (1.4, 2.4) -- (1.4, 0.7) -- (3.4, 0.7) -- (3.4, -3.4) -- (2.6, -3.4) -- (2.6, -1.7) -- (0.6, -1.7) -- cycle; + \draw[typeT] (1.6, 1.3) rectangle (3.4, 2.4); + \draw[typeB] (0.6, -3.4) rectangle (2.4, -2.3); + } +]{ % Added edges + {1}{3} +}{ % Top Diagram + { % Brick 1 + [ % Options + degree=3 + ]{ % Upper non transversal edges + {2}{3} + }{ % Lower non transversal edges + {2}{3} + }{ % Transversal edges + {1}{1} + } + } +}{ % Bottom Diagram + { % Brick 1 + [ % Options + degree=3 + ]{ % Upper non transversal edges + {1}{2} + }{ % Lower non transversal edges + {1}{2} + }{ % Transversal edges + {3}{3} + } + } +} +\hspace{5em} +\pmdProduct[ % Options + decorate before={ + \blockStyles + \draw[typeI] (0.6, 2.4) -- (1.4, 2.4) -- (1.4, 0.7) -- (10.4, 0.7) -- (10.4, -3.4) -- (9.6, -3.4) -- (9.6, -1.7) -- (0.6, -1.7) -- cycle; + \foreach \x in {0,2,7} { + \begin{scope}[shift={(\x,0)}] + \draw[typeT] (1.6, 1.3) rectangle (3.4, 2.4); + \end{scope} + } + \foreach \x in {0,2,4,7} { + \begin{scope}[shift={(\x,0)}] + \draw[typeB] (0.6, -3.4) rectangle (2.4, -2.3); + \end{scope} + } + } +]{ % Added edges + {1}{5} + {9}{10} +}{ % Top Diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non transversal edges + {2}{3} + {4}{5} + }{ % Lower non transversal edges + {2}{3} + {4}{5} + }{ % Transversal edges + {1}{1} + } + }{ % Brick 2 + [ % Options + blank top=2, + degree top=2, + blank bottom=2, + degree bottom=2 + ]{ % Upper non transversal edges + {3}{4} + }{ % Lower non transversal edges + {3}{4} + }{ % Transversal edges + \pmdEmpty + } + } +}{ % Bottom Diagram + { % Brick 1 + [ % Options + degree=6 + ]{ % Upper non transversal edges + {1}{2} + {3}{4} + {5}{6} + }{ % Lower non transversal edges + {1}{2} + {3}{4} + {5}{6} + }{ % Transversal edges + \pmdEmpty + } + }{ % Brick 2 + [ % Options + degree=3 + ]{ % Upper non transversal edges + {1}{2} + }{ % Lower non transversal edges + {1}{2} + }{ % Transversal edges + {3}{3} + } + } +}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/examples/example-21.tex b/graphics/pgf/contrib/pmdraw/examples/example-21.tex new file mode 100644 index 0000000000..e4bd9556cc --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/examples/example-21.tex @@ -0,0 +1,183 @@ +%!TEX root = ../pmdraw.tex + +% *------------------------------* +% |8````````````````````````````7| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |7````````````````````````````3| +% *------------------------------* + +\usetikzlibrary{patterns} + +\newcommand{\blockStyles}{ + \tikzstyle{typeI} = [ + very thick, + rounded corners=5pt, + red, + preaction={fill, red!3} + ] + \tikzstyle{typeT} = [ + very thick, + rounded corners=5pt, + dash pattern={on 7.5pt off 2.5pt}, + green, + preaction={fill, green!3} + ] + \tikzstyle{typeB} = [ + very thick, + rounded corners=5pt, + dash pattern={on 2.5pt off 2.5pt}, + blue, + preaction={fill, blue!3} + ] + \tikzstyle{typeO} = [ + very thick, + rounded corners=5pt, + dash pattern={on 2.5pt off 2.5pt on 7.5pt off 2.5pt}, + orange, + preaction={fill, orange!3} + ] + \tikzstyle{typeU} = [ + very thick, + rounded corners=5pt, + dash pattern={on 2.5pt off 2.5pt on 2.5pt off 2.5pt on 7.5pt off 2.5pt}, + violet, + preaction={fill, violet!3} + ] + \tikzstyle{typeN} = [ + very thick, + rounded corners=5pt, + dash pattern={on 7.5pt off 2.5pt on 7.5pt off 2.5pt on 2.5pt off 2.5pt}, + yellow, + preaction={fill, yellow!3} + ] +} + +\pmdProduct[ % Options + decorate before={ + \blockStyles + \draw[typeO] (0.6, -1.9) rectangle (4.4, 0.7); + \foreach \x in {0,2} { + \begin{scope}[shift={(\x,0)}] + \draw[typeB] (0.6, -3.4) rectangle (2.4, -2.3); + \draw[typeT] (0.6, 1.3) rectangle (2.4, 2.4); + \end{scope} + } + } +]{ % Added edges + {1}{4} +}{ % Top Diagram + { % Brick 1 + [ % Options + degree=4 + ]{ % Upper non transversal edges + {1}{2} + {3}{4} + }{ % Lower non transversal edges + {1}{2} + {3}{4} + }{ % Transversal edges + \pmdEmpty + } + } +}{ % Bottom Diagram + { % Brick 1 + [ % Options + degree=4, + levels top=2 + ]{ % Upper non transversal edges + [level=2]{1}{4} + {2}{3} + }{ % Lower non transversal edges + {1}{2} + {3}{4} + }{ % Transversal edges + \pmdEmpty + } + } +} +\hspace{5em} +\pmdProduct[ % Options + decorate before={ + \blockStyles + \draw[typeO] (0.6, -1.9) rectangle (11.4, 0.7); + \foreach \x in {0,2,4,7,9} { + \begin{scope}[shift={(\x,0)}] + \draw[typeB] (0.6, -3.4) rectangle (2.4, -2.3); + \draw[typeT] (0.6, 1.3) rectangle (2.4, 2.4); + \end{scope} + } + } +]{ % Added edges + {1}{5} + {9}{11} +}{ % Top Diagram + { % Brick 1 + [ % Options + degree=6 + ]{ % Upper non transversal edges + {1}{2} + {3}{4} + {5}{6} + }{ % Lower non transversal edges + {1}{2} + {3}{4} + {5}{6} + }{ % Transversal edges + \pmdEmpty + } + }{ % Brick 2 + [ % Options + degree=4 + ]{ % Upper non transversal edges + {1}{2} + {3}{4} + }{ % Lower non transversal edges + {1}{2} + {3}{4} + }{ % Transversal edges + \pmdEmpty + } + } +}{ % Bottom Diagram + { % Brick 1 + [ % Options + degree top=5, + levels top=2, + degree bottom=6 + ]{ % Upper non transversal edges + [level=2]{1}{11} + {2}{3} + {4}{5} + }{ % Lower non transversal edges + {1}{2} + {3}{4} + {5}{6} + }{ % Transversal edges + \pmdEmpty + } + }{ % Brick 2 + [ % Options + blank top=1, + degree top=3, + degree bottom=4, + levels top=2 + ]{ % Upper non transversal edges + {2}{3} + }{ % Lower non transversal edges + {1}{2} + {3}{4} + }{ % Transversal edges + \pmdEmpty + } + } +}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/examples/example-22.tex b/graphics/pgf/contrib/pmdraw/examples/example-22.tex new file mode 100644 index 0000000000..c7aa5c4cba --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/examples/example-22.tex @@ -0,0 +1,179 @@ +%!TEX root = ../pmdraw.tex + +% *------------------------------* +% |7````````````````````````````9| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |6````````````````````````````5| +% *------------------------------* + +\usetikzlibrary{patterns} + +\newcommand{\blockStyles}{ + \tikzstyle{typeI} = [ + very thick, + rounded corners=5pt, + red, + preaction={fill, red!3} + ] + \tikzstyle{typeT} = [ + very thick, + rounded corners=5pt, + dash pattern={on 7.5pt off 2.5pt}, + green, + preaction={fill, green!3} + ] + \tikzstyle{typeB} = [ + very thick, + rounded corners=5pt, + dash pattern={on 2.5pt off 2.5pt}, + blue, + preaction={fill, blue!3} + ] + \tikzstyle{typeO} = [ + very thick, + rounded corners=5pt, + dash pattern={on 2.5pt off 2.5pt on 7.5pt off 2.5pt}, + orange, + preaction={fill, orange!3} + ] + \tikzstyle{typeU} = [ + very thick, + rounded corners=5pt, + dash pattern={on 2.5pt off 2.5pt on 2.5pt off 2.5pt on 7.5pt off 2.5pt}, + violet, + preaction={fill, violet!3} + ] + \tikzstyle{typeN} = [ + very thick, + rounded corners=5pt, + dash pattern={on 7.5pt off 2.5pt on 7.5pt off 2.5pt on 2.5pt off 2.5pt}, + yellow, + preaction={fill, yellow!3} + ] +} + +\pmdProduct[ % Options + decorate before={ + \blockStyles + \draw[typeU] (0.6, 2.4) -- (1.4, 2.4) -- (1.4, 0.7) -- (3.6, 0.7) -- (3.6, 2.4) -- (4.4, 2.4) -- (4.4, -1.7) -- (0.6, -1.7) -- cycle; + \draw[typeT] (1.6, 1.3) rectangle (3.4, 2.4); + \foreach \x in {0,2} { + \begin{scope}[shift={(\x,0)}] + \draw[typeB] (0.6, -3.4) rectangle (2.4, -2.3); + \end{scope} + } + } +]{ % Added edges + {1}{4} +}{ % Top Diagram + { % Brick 1 + [ % Options + degree=4 + ]{ % Upper non transversal edges + {2}{3} + }{ % Lower non transversal edges + {2}{3} + }{ % Transversal edges + {1}{1} + {4}{4} + } + } +}{ % Bottom Diagram + { % Brick 1 + [ % Options + degree=4 + ]{ % Upper non transversal edges + {1}{2} + {3}{4} + }{ % Lower non transversal edges + {1}{2} + {3}{4} + }{ % Transversal edges + \pmdEmpty + } + } +} +\hspace{5em} +\pmdProduct[ % Options + decorate before={ + \blockStyles + \draw[typeU] (0.6, 2.4) -- (1.4, 2.4) -- (1.4, 0.7) -- (10.6, 0.7) -- (10.6, 2.4) -- (11.4, 2.4) -- (11.4, -1.7) -- (0.6, -1.7) -- cycle; + \foreach \x in {0,2,4,7,9} { + \begin{scope}[shift={(\x,0)}] + \draw[typeB] (0.6, -3.4) rectangle (2.4, -2.3); + \end{scope} + } + \foreach \x in {1,3,8} { + \begin{scope}[shift={(\x,0)}] + \draw[typeT] (0.6, 1.3) rectangle (2.4, 2.4); + \end{scope} + } + } +]{ % Added edges + {1}{5} + {9}{11} +}{ % Top Diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non transversal edges + {2}{3} + {4}{5} + }{ % Lower non transversal edges + {2}{3} + {4}{5} + }{ % Transversal edges + {1}{1} + } + }{ % Brick 2 + [ % Options + blank top=2, + blank bottom=2, + degree=3 + ]{ % Upper non transversal edges + {3}{4} + }{ % Lower non transversal edges + {3}{4} + }{ % Transversal edges + {5}{5} + } + } +}{ % Bottom Diagram + { % Brick 1 + [ % Options + degree=6 + ]{ % Upper non transversal edges + {1}{2} + {3}{4} + {5}{6} + }{ % Lower non transversal edges + {1}{2} + {3}{4} + {5}{6} + }{ % Transversal edges + \pmdEmpty + } + }{ % Brick 2 + [ % Options + degree=4 + ]{ % Upper non transversal edges + {1}{2} + {3}{4} + }{ % Lower non transversal edges + {1}{2} + {3}{4} + }{ % Transversal edges + \pmdEmpty + } + } +}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/examples/example-23.tex b/graphics/pgf/contrib/pmdraw/examples/example-23.tex new file mode 100644 index 0000000000..d2ae85c4e7 --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/examples/example-23.tex @@ -0,0 +1,179 @@ +%!TEX root = ../pmdraw.tex + +% *------------------------------* +% |6````````````````````````````5| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |4````````````````````````````3| +% *------------------------------* + +\usetikzlibrary{patterns} + +\newcommand{\blockStyles}{ + \tikzstyle{typeI} = [ + very thick, + rounded corners=5pt, + red, + preaction={fill, red!3} + ] + \tikzstyle{typeT} = [ + very thick, + rounded corners=5pt, + dash pattern={on 7.5pt off 2.5pt}, + green, + preaction={fill, green!3} + ] + \tikzstyle{typeB} = [ + very thick, + rounded corners=5pt, + dash pattern={on 2.5pt off 2.5pt}, + blue, + preaction={fill, blue!3} + ] + \tikzstyle{typeO} = [ + very thick, + rounded corners=5pt, + dash pattern={on 2.5pt off 2.5pt on 7.5pt off 2.5pt}, + orange, + preaction={fill, orange!3} + ] + \tikzstyle{typeU} = [ + very thick, + rounded corners=5pt, + dash pattern={on 2.5pt off 2.5pt on 2.5pt off 2.5pt on 7.5pt off 2.5pt}, + violet, + preaction={fill, violet!3} + ] + \tikzstyle{typeN} = [ + very thick, + rounded corners=5pt, + dash pattern={on 7.5pt off 2.5pt on 7.5pt off 2.5pt on 2.5pt off 2.5pt}, + yellow, + preaction={fill, yellow!3} + ] +} + +\pmdProduct[ % Options + decorate before={ + \blockStyles + \draw[typeN] (0.6, -3.4) -- (1.4, -3.4) -- (1.4, -1.7) -- (3.6, -1.7) -- (3.6, -3.4) -- (4.4, -3.4) -- (4.4, 0.7) -- (0.6, 0.7) -- cycle; + \draw[typeB] (1.6, -3.4) rectangle (3.4, -2.3); + \foreach \x in {0,2} { + \begin{scope}[shift={(\x,0)}] + \draw[typeT] (0.6, 1.3) rectangle (2.4, 2.4); + \end{scope} + } + } +]{ % Added edges + {1}{4} +}{ % Top Diagram + { % Brick 1 + [ % Options + degree=4 + ]{ % Upper non transversal edges + {1}{2} + {3}{4} + }{ % Lower non transversal edges + {1}{2} + {3}{4} + }{ % Transversal edges + \pmdEmpty + } + } +}{ % Bottom Diagram + { % Brick 1 + [ % Options + degree=4 + ]{ % Upper non transversal edges + {2}{3} + }{ % Lower non transversal edges + {2}{3} + }{ % Transversal edges + {1}{1} + {4}{4} + } + } +} +\hspace{5em} +\pmdProduct[ % Options + decorate before={ + \blockStyles + \draw[typeN] (0.6, -3.4) -- (1.4, -3.4) -- (1.4, -1.7) -- (10.6, -1.7) -- (10.6, -3.4) -- (11.4, -3.4) -- (11.4, 0.7) -- (0.6, 0.7) -- cycle; + \foreach \x in {0,2,4,7,9} { + \begin{scope}[shift={(\x,0)}] + \draw[typeT] (0.6, 1.3) rectangle (2.4, 2.4); + \end{scope} + } + \foreach \x in {1,3,8} { + \begin{scope}[shift={(\x,0)}] + \draw[typeB] (0.6, -3.4) rectangle (2.4, -2.3); + \end{scope} + } + } +]{ % Added edges + {1}{5} + {9}{11} +}{ % Top Diagram + { % Brick 1 + [ % Options + degree=6 + ]{ % Upper non transversal edges + {1}{2} + {3}{4} + {5}{6} + }{ % Lower non transversal edges + {1}{2} + {3}{4} + {5}{6} + }{ % Transversal edges + \pmdEmpty + } + }{ % Brick 2 + [ % Options + degree=4 + ]{ % Upper non transversal edges + {1}{2} + {3}{4} + }{ % Lower non transversal edges + {1}{2} + {3}{4} + }{ % Transversal edges + \pmdEmpty + } + } +}{ % Bottom Diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non transversal edges + {2}{3} + {4}{5} + }{ % Lower non transversal edges + {2}{3} + {4}{5} + }{ % Transversal edges + {1}{1} + } + }{ % Brick 2 + [ % Options + blank top=2, + blank bottom=2, + degree=3 + ]{ % Upper non transversal edges + {3}{4} + }{ % Lower non transversal edges + {3}{4} + }{ % Transversal edges + {5}{5} + } + } +}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/examples/example-24.tex b/graphics/pgf/contrib/pmdraw/examples/example-24.tex new file mode 100644 index 0000000000..7b93adc805 --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/examples/example-24.tex @@ -0,0 +1,160 @@ +%!TEX root = ../pmdraw.tex + +% *------------------------------* +% |6```````````````````````````0| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |9````````````````````````````8| +% *------------------------------* + +\pmdProduct[ % Options + decorate after={ + \draw (1, 2) node[above=6pt] {\( x \)\strut}; + \draw (2, 2) node[above=6pt] {\( y \)\strut}; + } +]{ % Added edges + {1}{3} +}{ % Top diagram + { % Brick 1 + [ + degree=3 + ]{ % Upper non transversal edges + {1}{2} + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + \pmdEmpty + } + } +}{ % Bottom diagram + { % Brick 1 + [ + degree=3 + ]{ % Upper non transversal edges + \pmdEmpty + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + \pmdEmpty + } + } +} +\hspace{2em} +\pmdProduct[ % Options + decorate after={ + \draw (1, 2) node[above=6pt] {\( x \)}; + \draw (1, 0) node[left=6pt] {\( y \)}; + \draw (1, -1) node[left=6pt] {\( j''' \)}; + \draw (1, -3) node[left=6pt] {\( z \)}; + } +]{ % Added edges + {1}{3} +}{ % Top diagram + { % Brick 1 + [ + degree=3 + ]{ % Upper non transversal edges + \pmdEmpty + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + } + } +}{ % Bottom diagram + { % Brick 1 + [ + degree=3 + ]{ % Upper non transversal edges + \pmdEmpty + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + } + } +} +\hspace{2em} +\pmdProduct[ % Options + decorate after={ + \draw (1, 2) node[above=6pt] {\( x \)}; + \draw (1, 0) node[left=6pt] {\( y \)}; + \draw (1, -1) node[left=6pt] {\( j''' \)}; + \draw (2, -1) node[below=4pt] {\( z \)}; + \draw (2, 0) node[above right=0pt] {\( k'' \)}; + \draw (2, 2) node[above=6pt] {\( w \)}; + } +]{ % Added edges + {1}{3} +}{ % Top diagram + { % Brick 1 + [ + degree=3 + ]{ % Upper non transversal edges + \pmdEmpty + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + } +}{ % Bottom diagram + { % Brick 1 + [ + degree=3 + ]{ % Upper non transversal edges + {1}{2} + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + \pmdEmpty + } + } +} +\hspace{2em} +\pmdProduct[ % Options + decorate after={ + \draw (1, 2) node[above=6pt] {\( x \)}; + \draw (1, 0) node[left=6pt] {\( y \)}; + \draw (1, -1) node[left=6pt] {\( j''' \)}; + \draw (2, -1) node[below=4pt] {\( z \)}; + \draw (2, 0) node[above=4pt] {\( k'' \)}; + \draw (3, 0) node[above=4pt] {\( w \)}; + } +]{ % Added edges + {1}{4} +}{ % Top diagram + { % Brick 1 + [ + degree=4 + ]{ % Upper non transversal edges + \pmdEmpty + }{ % Lower non transversal edges + {2}{3} + }{ % Transversal edges + {1}{1} + } + } +}{ % Bottom diagram + { % Brick 1 + [ + degree=4 + ]{ % Upper non transversal edges + {1}{2} + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + \pmdEmpty + } + } +}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/examples/example-25.tex b/graphics/pgf/contrib/pmdraw/examples/example-25.tex new file mode 100644 index 0000000000..bea76db2f3 --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/examples/example-25.tex @@ -0,0 +1,63 @@ +%!TEX root = ../pmdraw.tex + +% *------------------------------* +% |9````````````````````````````1| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |4````````````````````````````2| +% *------------------------------* + +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=5, + brace={ + left=4, + right=7, + label={p - 3} + } + ]{ % Upper non transversal edges + \pmdEmpty + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{2} + {2}{3} + {3}{1} + {4}{4} + {5}{5} + } + } + { % Brick 2 + [ % Options + degree=5 + ]{ % Upper non transversal edges + {2}{3} + {4}{5} + }{ % Lower non transversal edges + {2}{3} + {4}{5} + }{ % Transversal edges + {1}{1} + } + }{ % Brick 3 + [ % Options + degree=2 + ]{ % Upper non transversal edges + {1}{2} + }{ % Lower non transversal edges + {1}{2} + }{ % Transversal edges + \pmdEmpty + } + } +}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/examples/example-3.tex b/graphics/pgf/contrib/pmdraw/examples/example-3.tex new file mode 100644 index 0000000000..09a5256eac --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/examples/example-3.tex @@ -0,0 +1,53 @@ +%!TEX root = ../pmdraw.tex + +% *------------------------------* +% |6````````````````````````````2| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |9````````````````````````````4| +% *------------------------------* + +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=5, + levels top=4, + levels bottom=3 + ]{ % Upper non transversal edges + {1}{2} + {3}{4} + [level=2]{2}{4} + [level=3]{2}{5} + [level=4]{1}{5} + [level=3]{5}{7} + }{ % Lower non transversal edges + {1}{2} + {3}{4} + [level=2]{2}{4} + [level=3]{2}{5} + }{ % Transversal edges + {1}{1} + } + }{ % Brick 2 + [ % Options + degree=4 + ]{ % Upper non transversal edges + {1}{2} + {3}{4} + }{ % Lower non transversal edges + {1}{2} + }{ % Transversal edges + {1}{2} + {3}{4} + } + } +}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/examples/example-4.tex b/graphics/pgf/contrib/pmdraw/examples/example-4.tex new file mode 100644 index 0000000000..bbbf5bd819 --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/examples/example-4.tex @@ -0,0 +1,77 @@ +%!TEX root = ../pmdraw.tex + +% *------------------------------* +% |1````````````````````````````1| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |8````````````````````````````3| +% *------------------------------* + +\pmdDiagram{ + { % Brick 1 + [ % Options + degree top=3, + degree bottom=4, + brace={ + left=2, + right=7, + label={p} + } + ]{ % Upper non transversal edges + \pmdEmpty + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{2} + {2}{3} + {3}{4} + {7}{1} + } + }{ % Brick 2 + [ % Options + degree top=7, + blank bottom=1, + degree bottom=5, + levels=2, + brace={ + left=4, + right=12, + label={q}, + above + } + ]{ % Upper non transversal edges + [level=2]{3}{13} + {4}{5} + {6}{7} + }{ % Lower non transversal edges + {3}{4} + {5}{6} + }{ % Transversal edges + {1}{2} + } + }{ % Brick 3 + [ % Options + degree top=5, + blank bottom=1, + degree bottom=4, + levels=2 + ]{ % Upper non transversal edges + {1}{2} + {3}{4} + }{ % Lower non transversal edges + {2}{3} + {4}{5} + }{ % Transversal edges + \pmdEmpty + } + } +}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/examples/example-5.tex b/graphics/pgf/contrib/pmdraw/examples/example-5.tex new file mode 100644 index 0000000000..e7a9c63e96 --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/examples/example-5.tex @@ -0,0 +1,118 @@ +%!TEX root = ../pmdraw.tex + +% *------------------------------* +% |1````````````````````````````2| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |2````````````````````````````8| +% *------------------------------* + +\pmdProduct{ % Added edges + {1}{3} + {7}{11} + {15}{18} +}{ % Top Diagram + { % Brick 1 + [ % Options + degree top=3, + degree bottom=4 + ]{ % Upper non transversal edges + \pmdEmpty + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{2} + {2}{3} + {3}{4} + {7}{1} + } + }{ % Brick 2 + [ % Options + degree top=7, + blank bottom=1, + degree bottom=5, + levels=2 + ]{ % Upper non transversal edges + [level=2]{3}{13} + {4}{5} + {6}{7} + }{ % Lower non transversal edges + {3}{4} + {5}{6} + }{ % Transversal edges + {1}{2} + } + }{ % Brick 3 + [ % Options + degree top=5, + blank bottom=1, + degree bottom=4, + levels=2 + ]{ % Upper non transversal edges + {1}{2} + {3}{4} + }{ % Lower non transversal edges + {2}{3} + {4}{5} + }{ % Transversal edges + \pmdEmpty + } + } +}{ % Bottom Diagram + { % Brick 1 + [ % Options + degree top=3, + degree bottom=4 + ]{ % Upper non transversal edges + \pmdEmpty + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{2} + {2}{3} + {3}{4} + {7}{1} + } + }{ % Brick 2 + [ % Options + degree top=7, + blank bottom=1, + degree bottom=5, + levels=2, + no dots + ]{ % Upper non transversal edges + [level=2]{3}{13} + {4}{5} + {6}{7} + }{ % Lower non transversal edges + {3}{4} + {5}{6} + }{ % Transversal edges + {1}{2} + } + }{ % Brick 3 + [ % Options + degree top=5, + blank bottom=1, + degree bottom=4, + levels=2 + ]{ % Upper non transversal edges + {1}{2} + {3}{4} + }{ % Lower non transversal edges + {2}{3} + {4}{5} + }{ % Transversal edges + \pmdEmpty + } + } +}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/examples/example-6.tex b/graphics/pgf/contrib/pmdraw/examples/example-6.tex new file mode 100644 index 0000000000..18a47a794c --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/examples/example-6.tex @@ -0,0 +1,55 @@ +%!TEX root = ../pmdraw.tex + +% *------------------------------* +% |4````````````````````````````5| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |1````````````````````````````9| +% *------------------------------* + +\pmdProduct[ % Options + decorate after={ + \draw[very thick,red,rounded corners=5pt] (0.6, -3.4) rectangle (1.4, 2.4); + } +]{ % Added edges + {1}{4} +}{ % Top Diagram + { % Brick 1 + [ % Options + degree=4 + ]{ % Upper non transversal edges + \pmdEmpty + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + {3}{3} + {4}{4} + } + } +}{ % Bottom Diagram + { % Brick 1 + [ % Options + degree=4 + ]{ % Upper non transversal edges + \pmdEmpty + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + {3}{3} + {4}{4} + } + } +}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/examples/example-7.tex b/graphics/pgf/contrib/pmdraw/examples/example-7.tex new file mode 100644 index 0000000000..171bf113a4 --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/examples/example-7.tex @@ -0,0 +1,63 @@ +%!TEX root = ../pmdraw.tex + +% *------------------------------* +% |3````````````````````````````6| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |3````````````````````````````2| +% *------------------------------* + +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=2, + brace={ + left=1, + right=4, + label={p} + } + ]{ % Upper non transversal edges + \pmdEmpty + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + }{ % Brick 2 + [ % Options + degree top=5, + degree bottom=6 + ]{ % Upper non transversal edges + {2}{3} + {4}{5} + }{ % Lower non transversal edges + {3}{4} + {5}{6} + }{ % Transversal edges + [height=1]{10}{2} + {1}{1} + } + }{ % Brick 3 + [ % Options + degree top=3, + blank bottom=1, + degree bottom=2 + ]{ % Upper non transversal edges + {1}{2} + }{ % Lower non transversal edges + {2}{3} + }{ % Transversal edges + \pmdEmpty + } + } +}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/examples/example-8.tex b/graphics/pgf/contrib/pmdraw/examples/example-8.tex new file mode 100644 index 0000000000..6ed2f2cf5c --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/examples/example-8.tex @@ -0,0 +1,63 @@ +%!TEX root = ../pmdraw.tex + +% *------------------------------* +% |0````````````````````````````7| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |7````````````````````````````9| +% *------------------------------* + +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=2, + brace={ + left=1, + right=4, + label={p} + } + ]{ % Upper non transversal edges + \pmdEmpty + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + }{ % Brick 2 + [ % Options + degree top=6, + degree bottom=5 + ]{ % Upper non transversal edges + {3}{4} + {5}{6} + }{ % Lower non transversal edges + {2}{3} + {4}{5} + }{ % Transversal edges + [height=1]{2}{10} + {1}{1} + } + }{ % Brick 3 + [ % Options + degree top=2, + blank top=1, + degree bottom=3 + ]{ % Upper non transversal edges + {2}{3} + }{ % Lower non transversal edges + {1}{2} + }{ % Transversal edges + \pmdEmpty + } + } +}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/examples/example-9.tex b/graphics/pgf/contrib/pmdraw/examples/example-9.tex new file mode 100644 index 0000000000..8e7d87023f --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/examples/example-9.tex @@ -0,0 +1,37 @@ +%!TEX root = ../pmdraw.tex + +% *------------------------------* +% |1````````````````````````````1| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |7````````````````````````````4| +% *------------------------------* + +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=17 + ]{ % Upper non transversal edges + \pmdEmpty + }{ % Lower non transversal edges + \pmdEmpty + }{ % Transversal edges + [height=0.25]{1}{11} + [height=0.5]{2}{12} + [height=0.75]{3}{13} + [height=1]{4}{14} + [height=1.25]{5}{15} + [height=1.5]{6}{16} + [height=1.75]{7}{17} + } + } +}
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/pmdraw.pdf b/graphics/pgf/contrib/pmdraw/pmdraw.pdf Binary files differnew file mode 100644 index 0000000000..1cc4de9135 --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/pmdraw.pdf diff --git a/graphics/pgf/contrib/pmdraw/pmdraw.sty b/graphics/pgf/contrib/pmdraw/pmdraw.sty new file mode 100644 index 0000000000..36f506b51f --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/pmdraw.sty @@ -0,0 +1,1544 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{pmdraw}[2024-06-02 v1.4 pmdraw] + +% *------------------------------* +% |7````````````````````````````4| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |3````````````````````````````4| +% *------------------------------* + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% Required packages % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% \RequirePackage{datetime} +\RequirePackage{keyval} +\RequirePackage{tikz} +\usetikzlibrary{math,decorations.pathreplacing,calligraphy,backgrounds} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% Internal control and option commands % +% - loosely ordered alphabetically % +% - includes default values where appropriate % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\newcommand{\pmdraw@braceLabel}{}% Label of brace + +\newcommand{\pmdraw@diagSep}{1}% Vertical separation between bottom row of top diagram and top row of bottom diagram in product diagram + +\newcommand{\pmdraw@drawAedgesOptions}{}% Draw options for added edges in product diagram +\newcommand{\pmdraw@drawAedges}[2]{% Draws added edges in product diagram from #1 vertex to #2 vertex, assumes #1<#2 + \@ifclassloaded{beamer}{% If in beamer + \uncover<\pmdraw@edgesAddedUncover>{% Uncovers added edges + \foreach \x in {#1,...,#2} {% For each vertex in range + \ifnum\value{pmdraw@ifEdgesAdded}=0% If drawing added edges + \draw[dotted,thick,apply style/.expand once=\pmdraw@drawAedgesOptions] (\x,0) -- (\x,-\pmdraw@diagSep);% Draw concatenation edge + \else% If hiding top vertices + \phantom{% + \draw[dotted,thick,apply style/.expand once=\pmdraw@drawAedgesOptions] (\x,0) -- (\x,-\pmdraw@diagSep);% Draw concatenation edge + }% + \fi% + }% + }% + }{% If not in beamer + \foreach \x in {#1,...,#2} {% For each vertex in range + \ifnum\value{pmdraw@ifEdgesAdded}=0% If drawing added edges + \draw[dotted,thick,apply style/.expand once=\pmdraw@drawAedgesOptions] (\x,0) -- (\x,-\pmdraw@diagSep);% Draw concatenation edge + \else% If hiding top vertices + \phantom{% + \draw[dotted,thick,apply style/.expand once=\pmdraw@drawAedgesOptions] (\x,0) -- (\x,-\pmdraw@diagSep);% Draw concatenation edge + }% + \fi% + }% + }% + \pmdraw@AedgesLoop% Restart for loop +} + +\newcommand{\pmdraw@drawBraceDrawOptions}{}% Draw options for brace +\newcommand{\pmdraw@drawBraceNodeOptions}{}% Node options for brace +\newcommand{\pmdraw@drawBraceDefault}[3]{% Draws brace a brace starting from #1 vertex to #2 vertex with label #3, assumes #1<#2 - DEFAULT + \ifnum\pmdraw@ifProdDiag=1% If drawing a product diagram or if placing brace above diagram + \draw[ + very thick, + decorate, + decoration={calligraphic brace,amplitude=6pt}, + apply style/.expand once=\pmdraw@drawBraceDrawOptions + ] (#1-0.17,\pmdraw@rowSep+0.5) -- (#2+0.17,\pmdraw@rowSep+0.5) + node[ + pos=0.5, + above=6pt, + apply style/.expand once=\pmdraw@drawBraceNodeOptions + ] {\(#3\)};% Draw brace on top of diagram + \else% If not drawing a product diagram or if placing brace below diagram + \draw[ + very thick, + decorate, + decoration={calligraphic brace,mirror,amplitude=6pt}, + apply style/.expand once=\pmdraw@drawBraceDrawOptions + ] (#1-0.17,-0.5) -- (#2+0.17,-0.5) + node[ + pos=0.5, + below=6pt, + apply style/.expand once=\pmdraw@drawBraceNodeOptions + ] {\(#3\)};% Draw brace on bottom of diagram + \fi% +} +\let\pmdraw@drawBrace\pmdraw@drawBraceDefault% Draws brace a brace starting from #1 vertex to #2 vertex with label #3, assumes #1<#2 + +\newcommand{\pmdraw@drawDotsDrawOptions}{}% Draw options for dots between bricks +\newcommand{\pmdraw@drawDotsNodeOptions}{}% Node options for dots between bricks +\newcommand{\pmdraw@drawDotsDefault}[2]{% Draws dots between bricks at (#1,#2) - DEFAULT + \draw[apply style/.expand once=\pmdraw@drawDotsDrawOptions] (#1,#2) node[apply style/.expand once=\pmdraw@drawDotsNodeOptions] {\(\dots\)};% +} +\let\pmdraw@drawDots\pmdraw@drawDotsDefault% Draws dots between bricks at (#1,#2) + +\newcommand{\pmdraw@drawEdgeDrawOptions}{}% Draw options for edge + +\newcommand{\pmdraw@drawLabelBDrawOptions}{}% Draw options for label of a vertex in bottom row +\newcommand{\pmdraw@drawLabelBNodeOptions}{}% Node options for label of a vertex in bottom row +\newcommand{\pmdraw@drawLabelBottomDefault}[3]{% For bottom row, draws the label #3 for a vertex at (#1,#2) - DEFAULT + \draw[apply style/.expand once=\pmdraw@drawLabelBDrawOptions] (#1,#2) node[below=6pt,apply style/.expand once=\pmdraw@drawLabelBNodeOptions] {\(#3'\)};% +} +\let\pmdraw@drawLabelBottom\pmdraw@drawLabelBottomDefault% For bottom row, draws the label #3 for a vertex at (#1,#2) + +\newcommand{\pmdraw@drawLabelTDrawOptions}{}% Draw options for label of a vertex in top row +\newcommand{\pmdraw@drawLabelTNodeOptions}{}% Node options for label of a vertex in top row +\newcommand{\pmdraw@drawLabelTopDefault}[3]{% For top row, draws the label #3 for a vertex at (#1,#2) - DEFAULT + \draw[apply style/.expand once=\pmdraw@drawLabelTDrawOptions] (#1,#2) node[above=6pt,apply style/.expand once=\pmdraw@drawLabelTNodeOptions] {\(#3\)};% +} +\let\pmdraw@drawLabelTop\pmdraw@drawLabelTopDefault% For top row, draws the label #3 for a vertex at (#1,#2) + +\newcommand{\pmdraw@drawLedgesDrawOptions}{}% Draw options for lower non-transversal edges +\newcommand{\pmdraw@drawLedgesDrawDefault}[2]{% Draws lower non-transversal edge from #1 vertex to #2 vertex, assumes #1<#2 - DEFAULT + \draw[apply style/.expand once=\pmdraw@drawLedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#1,0) arc (180:90:\pmdraw{edgeHeight});% Draw left arch + \draw[apply style/.expand once=\pmdraw@drawLedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#1+\pmdraw{edgeHeight},\pmdraw{edgeHeight}) -- (#2-\pmdraw{edgeHeight},\pmdraw{edgeHeight});% Draw straight line + \draw[apply style/.expand once=\pmdraw@drawLedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#2-\pmdraw{edgeHeight},\pmdraw{edgeHeight}) arc (90:0:\pmdraw{edgeHeight});% Draw right arc + \renewcommand{\pmdraw@drawEdgeDrawOptions}{}% Reset draw options for edge +} +\let\pmdraw@drawLedgesDraw\pmdraw@drawLedgesDrawDefault% Draws lower non-transversal edge from #1 vertex to #2 vertex, assumes #1<#2 + +\newcommand{\pmdraw@drawNoLabelBa}{-1}% 1st vertex to skip label in bottom row +\newcommand{\pmdraw@drawNoLabelBb}{-1}% 2nd vertex to skip label in bottom row +\newcommand{\pmdraw@drawNoLabelBc}{-1}% 3rd vertex to skip label in bottom row +\newcommand{\pmdraw@drawNoLabelBd}{-1}% 4th vertex to skip label in bottom row +\newcommand{\pmdraw@drawNoLabelBe}{-1}% 5th vertex to skip label in bottom row +\newcommand{\pmdraw@drawNoLabelBf}{-1}% 6th vertex to skip label in bottom row +\newcommand{\pmdraw@drawNoLabelBg}{-1}% 7th vertex to skip label in bottom row +\newcommand{\pmdraw@drawNoLabelBh}{-1}% 8th vertex to skip label in bottom row +\newcommand{\pmdraw@drawNoLabelBi}{-1}% 9th vertex to skip label in bottom row +\newcommand{\pmdraw@drawNoLabelTa}{-1}% 1st vertex to skip label in top row +\newcommand{\pmdraw@drawNoLabelTb}{-1}% 2nd vertex to skip label in top row +\newcommand{\pmdraw@drawNoLabelTc}{-1}% 3rd vertex to skip label in top row +\newcommand{\pmdraw@drawNoLabelTd}{-1}% 4th vertex to skip label in top row +\newcommand{\pmdraw@drawNoLabelTe}{-1}% 5th vertex to skip label in top row +\newcommand{\pmdraw@drawNoLabelTf}{-1}% 6th vertex to skip label in top row +\newcommand{\pmdraw@drawNoLabelTg}{-1}% 7th vertex to skip label in top row +\newcommand{\pmdraw@drawNoLabelTh}{-1}% 8th vertex to skip label in top row +\newcommand{\pmdraw@drawNoLabelTi}{-1}% 9th vertex to skip label in top row + +\newcommand{\pmdraw@drawNoVertexBa}{-1}% 1st vertex to skip in bottom row +\newcommand{\pmdraw@drawNoVertexBb}{-1}% 2nd vertex to skip in bottom row +\newcommand{\pmdraw@drawNoVertexBc}{-1}% 3rd vertex to skip in bottom row +\newcommand{\pmdraw@drawNoVertexBd}{-1}% 4th vertex to skip in bottom row +\newcommand{\pmdraw@drawNoVertexBe}{-1}% 5th vertex to skip in bottom row +\newcommand{\pmdraw@drawNoVertexBf}{-1}% 6th vertex to skip in bottom row +\newcommand{\pmdraw@drawNoVertexBg}{-1}% 7th vertex to skip in bottom row +\newcommand{\pmdraw@drawNoVertexBh}{-1}% 8th vertex to skip in bottom row +\newcommand{\pmdraw@drawNoVertexBi}{-1}% 9th vertex to skip in bottom row +\newcommand{\pmdraw@drawNoVertexTa}{-1}% 1st vertex to skip in top row +\newcommand{\pmdraw@drawNoVertexTb}{-1}% 2nd vertex to skip in top row +\newcommand{\pmdraw@drawNoVertexTc}{-1}% 3rd vertex to skip in top row +\newcommand{\pmdraw@drawNoVertexTd}{-1}% 4th vertex to skip in top row +\newcommand{\pmdraw@drawNoVertexTe}{-1}% 5th vertex to skip in top row +\newcommand{\pmdraw@drawNoVertexTf}{-1}% 6th vertex to skip in top row +\newcommand{\pmdraw@drawNoVertexTg}{-1}% 7th vertex to skip in top row +\newcommand{\pmdraw@drawNoVertexTh}{-1}% 8th vertex to skip in top row +\newcommand{\pmdraw@drawNoVertexTi}{-1}% 9th vertex to skip in top row + +\newcommand{\pmdraw@drawTedgesDrawOptions}{}% Draw options for transversal edges +\newcommand{\pmdraw@drawTedgesDrawDefault}[2]{% Draws transversal edge from #1 vertex in top row to #2 vertex in bottom row - DEFAULT + \ifnum\pmdraw@ifTedgeHorizontal=0% If drawing a straight line edge + \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#1,\pmdraw@rowSep) -- (#2,0);% Draw straight line + \else% If transversal edge is drawn horizontally + \ifnum#1>#2% If edge goes from top right to bottom left + \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#2,0) arc (180:90:\pmdraw{Tlevel});% Draw bottom arch + \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#2+\pmdraw{Tlevel},\pmdraw{Tlevel}) -- (#1-\pmdraw@rowSep+\pmdraw{Tlevel}, \pmdraw{Tlevel});% Draw straight line + \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#1-\pmdraw@rowSep+\pmdraw{Tlevel},\pmdraw{Tlevel}) arc (270:360:{\pmdraw@rowSep-\pmdraw{Tlevel}});% Draw top arc + \else% If edge goes from top left to bottom right + \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#2,0) arc (0:90:\pmdraw{Tlevel});% Draw bottom arch + \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#2-\pmdraw{Tlevel},\pmdraw{Tlevel}) -- (#1+\pmdraw@rowSep-\pmdraw{Tlevel}, \pmdraw{Tlevel});% Draw straight line + \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#1+\pmdraw@rowSep-\pmdraw{Tlevel},\pmdraw{Tlevel}) arc (270:180:{\pmdraw@rowSep-\pmdraw{Tlevel}});% Draw top arc + \fi% + \renewcommand{\pmdraw@ifTedgeHorizontal}{0}% Reset flag to default + \fi% + \renewcommand{\pmdraw@drawEdgeDrawOptions}{}% Reset draw options for edge +} +\let\pmdraw@drawTedgesDraw\pmdraw@drawTedgesDrawDefault% Draws transversal edge from #1 vertex in top row to #2 vertex in bottom row + +\newcommand{\pmdraw@drawUedgesDrawOptions}{}% Draw options for upper non-transversal edges +\newcommand{\pmdraw@drawUedgesDrawDefault}[2]{% Draws upper non-transversal edge from #1 vertex to #2 vertex, assumes #1<#2 - DEFAULT + \draw[apply style/.expand once=\pmdraw@drawUedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#1,\pmdraw@rowSep) arc (180:270:\pmdraw{edgeHeight});% Draw left arch + \draw[apply style/.expand once=\pmdraw@drawUedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#1+\pmdraw{edgeHeight},\pmdraw@rowSep-\pmdraw{edgeHeight}) -- (#2-\pmdraw{edgeHeight},\pmdraw@rowSep-\pmdraw{edgeHeight});% Draw straight line + \draw[apply style/.expand once=\pmdraw@drawUedgesDrawOptions,apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#2-\pmdraw{edgeHeight},\pmdraw@rowSep-\pmdraw{edgeHeight}) arc (270:360:\pmdraw{edgeHeight});% Draw right arc + \renewcommand{\pmdraw@drawEdgeDrawOptions}{}% Reset draw options for edge +} +\let\pmdraw@drawUedgesDraw\pmdraw@drawUedgesDrawDefault% Draws upper non-transversal edge from #1 vertex to #2 vertex, assumes #1<#2 + +\newcommand{\pmdraw@drawVertexOptions}{}% Draw options for vertices +\newcommand{\pmdraw@drawVertex}[2]{% Draws a vertex at (#1,#2) + \fill[apply style/.expand once=\pmdraw@drawVertexOptions] (#1,#2) circle (.17);% +} + +\newcommand{\pmdraw@edgeUncover}{1-}% Sets the uncover options of edge +\newcommand{\pmdraw@edgesAddedUncover}{1-}% Sets the uncover options of added edges +\newcommand{\pmdraw@edgesUncover}{1-}% Sets the uncover options of edges + +\newcommand{\pmdraw@hookAfterBrick}{}% Hook after drawing a brick +\newcommand{\pmdraw@hookAfterDiagram}{}% Hook after drawing a diagram +\newcommand{\pmdraw@hookBeforeBrick}{}% Hook before drawing a brick +\newcommand{\pmdraw@hookBeforeDiagram}{}% Hook before drawing a diagram + +\newcommand{\pmdraw@ifDiagWDots}{0}% Boolean if drawing a diagram with dots +\newcommand{\pmdraw@ifEdgesFirst}{0}% Boolean if drawing edges before vertices +\newcommand{\pmdraw@ifGrid}{0}% Boolean if displaying helper grid +\newcommand{\pmdraw@ifLabelsB}{0}% Boolean if displaying labels for vertices in bottom row +\newcommand{\pmdraw@ifLabelsT}{0}% Boolean if displaying labels for vertices in top row +\newcommand{\pmdraw@ifProdDiag}{0}% Boolean if drawing a product diagram +\newcommand{\pmdraw@ifTedgesFirst}{0}% Boolean if drawing transversal edges before non-transversal edges +\newcommand{\pmdraw@ifTedgeHorizontal}{0}% Boolean if transversal edge is drawn horizontally + +\newcommand{\pmdraw@NTedgesHeight}{-1000}% Height of non-transversal edges if manually set, a value of -1000 sets height automatically + +\newcommand{\pmdraw@reset}{% Resets user keys and other flags to default values after drawing diagram + \renewcommand{\pmdraw@diagSep}{1}% Resets vertical space between product diagrams + \renewcommand{\pmdraw@drawAedgesOptions}{}% Resets draw options for added edges in product diagram + \let\pmdraw@drawDots\pmdraw@drawDotsDefault% Resets drawing of dots between bricks + \renewcommand{\pmdraw@edgesAddedUncover}{1-}% Resets the uncover options of added edges + \renewcommand{\pmdraw@hookAfterDiagram}{}% Clears hook after drawing a diagram + \renewcommand{\pmdraw@hookBeforeDiagram}{}% Clears hook before drawing a diagram + \renewcommand{\pmdraw@ifGrid}{0}% Hides grid + \renewcommand{\pmdraw@ifDiagWDots}{0}% Reset if drawing a diagram with dots + \renewcommand{\pmdraw@rowSep}{2}% Resets vertical separation between rows of vertices in brick + \renewcommand{\pmdraw@tikz}{}% Resets tikz options + \renewcommand{\pmdraw@vertexSep}{0}% Resets vertical space between product diagrams + \setcounter{pmdraw@blankB}{0}% Resets number of blank vertices in bottom row to the left of brick + \setcounter{pmdraw@blankT}{0}% Resets number of blank vertices in top row to the left of brick + \setcounter{pmdraw@bottomShift}{0}% Resets shift on right end of bottom row of brick + \setcounter{pmdraw@topShift}{0}% Resets shift on right end of top row of brick + \setcounter{pmdraw@ifDiagWDotsFirst}{1}% Reset if drawing first brick of diagram + \setcounter{pmdraw@ifEdgesAdded}{0}% Resets boolean if hiding added edges +} + +\newcommand{\pmdraw@rowSep}{2}% Vertical separation between rows of vertices in brick + +\newcommand{\pmdraw@tikz}{}% Tikz options + +\newcommand{\pmdraw@verticesBottomUncover}{1-}% Sets the uncover options of bottom vertices +\newcommand{\pmdraw@verticesTopUncover}{1-}% Sets the uncover options of top vertices + +\newcommand{\pmdraw@vertexSep}{0}% Vertical separation between bottom row of top diagram and top row of bottom diagram in product diagram not for added edges + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% Counters % +% - loosely ordered alphabetically % +% - includes default values where appropriate % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\newcounter{pmdraw@blankB}% Number of blank vertices in bottom row to the left of brick +\newcounter{pmdraw@blankT}% Number of blank vertices in top row to the left of brick + +\newcounter{pmdraw@bottomTotal}% Size of bottom row of brick +\newcounter{pmdraw@bottomShift}% Shift on right end of bottom row of brick + +\newcounter{pmdraw@braceL}% Left starting vertex of brace +\newcounter{pmdraw@braceR}% Right terminating vertex of brace + +\newcounter{pmdraw@brickShift}% Shift required for bricks after dots in diagram with dots + +\newcounter{pmdraw@degreeB}% Degree (number of vertices) of bottom row of brick +\newcounter{pmdraw@degreeT}% Degree (number of vertices) of top row of brick + +\newcounter{pmdraw@ifDiagWDotsFirst}% In drawing with dots, boolean if drawing first brick of diagram +\setcounter{pmdraw@ifDiagWDotsFirst}{1} + +\newcounter{pmdraw@ifEdge}% Boolean if hiding edge +\setcounter{pmdraw@ifEdge}{0} +\newcounter{pmdraw@ifEdgesAdded}% Boolean if hiding added edges +\setcounter{pmdraw@ifEdgesAdded}{0} +\newcounter{pmdraw@ifEdges}% Boolean if hiding edges +\setcounter{pmdraw@ifEdges}{0} + +\newcounter{pmdraw@ifVerticesBottom}% Boolean if hiding bottom row of vertices +\setcounter{pmdraw@ifVerticesBottom}{0} +\newcounter{pmdraw@ifVerticesTop}% Boolean if hiding top row of vertices +\setcounter{pmdraw@ifVerticesTop}{0} + +\newcounter{pmdraw@labelStartB}% Starting value of labels of vertices in bottom row +\setcounter{pmdraw@labelStartB}{1} +\newcounter{pmdraw@labelStartT}% Starting value of labels of vertices in top row +\setcounter{pmdraw@labelStartT}{1} + +\newcounter{pmdraw@NTlevel}% Level corresponding to a height for a non-transversal edge + +\newcounter{pmdraw@topTotal}% Size of top row of brick +\newcounter{pmdraw@topShift}% Shift on right end of top row of brick + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% Keys for bricks % +% - ordered as per manual % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% To pass draw options to \draw command +% Verbatim copy from: +% https://tex.stackexchange.com/a/64237 +\tikzset{apply style/.code={\tikzset{#1}}} + +\define@key{pmdraw@brick}{degree}{% Sets degree (number of vertices per row) of diagram + \setcounter{pmdraw@degreeB}{#1}% Sets degree (number of vertices per row) for bottom row + \setcounter{pmdraw@degreeT}{#1}% Sets degree (number of vertices per row) for top row +} +\define@key{pmdraw@brick}{degree bottom}{% Sets degree (number of vertices per row) for bottom row + \setcounter{pmdraw@degreeB}{#1}% +} +\define@key{pmdraw@brick}{degree top}{% Sets degree (number of vertices per row) for top row + \setcounter{pmdraw@degreeT}{#1}% +} + +\define@key{pmdraw@brick}{blank bottom}{% Sets the number of blank vertices on left of bottom row + \setcounter{pmdraw@blankB}{#1}% +} +\define@key{pmdraw@brick}{blank top}{% Sets the number of blank vertices on left of top row + \setcounter{pmdraw@blankT}{#1}% +} + +\define@key{pmdraw@brick}{row sep}{% Sets vertical separation between rows of vertices in brick + \renewcommand{\pmdraw@rowSep}{#1}% +} + +\define@key{pmdraw@brick}{vertices}{% Sets the draw options of vertices + \renewcommand{\pmdraw@drawVertexOptions}{#1}% +} +\define@key{pmdraw@brick}{no vertex bottom 1}{% Sets 1st vertex to skip in bottom row + \renewcommand{\pmdraw@drawNoVertexBa}{#1}% +} +\define@key{pmdraw@brick}{no vertex bottom 2}{% Sets 2nd vertex to skip in bottom row + \renewcommand{\pmdraw@drawNoVertexBb}{#1}% +} +\define@key{pmdraw@brick}{no vertex bottom 3}{% Sets 3rd vertex to skip in bottom row + \renewcommand{\pmdraw@drawNoVertexBc}{#1}% +} +\define@key{pmdraw@brick}{no vertex bottom 4}{% Sets 4th vertex to skip in bottom row + \renewcommand{\pmdraw@drawNoVertexBd}{#1}% +} +\define@key{pmdraw@brick}{no vertex bottom 5}{% Sets 5th vertex to skip in bottom row + \renewcommand{\pmdraw@drawNoVertexBe}{#1}% +} +\define@key{pmdraw@brick}{no vertex bottom 6}{% Sets 6th vertex to skip in bottom row + \renewcommand{\pmdraw@drawNoVertexBf}{#1}% +} +\define@key{pmdraw@brick}{no vertex bottom 7}{% Sets 7th vertex to skip in bottom row + \renewcommand{\pmdraw@drawNoVertexBg}{#1}% +} +\define@key{pmdraw@brick}{no vertex bottom 8}{% Sets 8th vertex to skip in bottom row + \renewcommand{\pmdraw@drawNoVertexBh}{#1}% +} +\define@key{pmdraw@brick}{no vertex bottom 9}{% Sets 9th vertex to skip in bottom row + \renewcommand{\pmdraw@drawNoVertexBi}{#1}% +} +\define@key{pmdraw@brick}{no vertex top 1}{% Sets 1st vertex to skip in top row + \renewcommand{\pmdraw@drawNoVertexTa}{#1}% +} +\define@key{pmdraw@brick}{no vertex top 2}{% Sets 2nd vertex to skip in top row + \renewcommand{\pmdraw@drawNoVertexTb}{#1}% +} +\define@key{pmdraw@brick}{no vertex top 3}{% Sets 3rd vertex to skip in top row + \renewcommand{\pmdraw@drawNoVertexTc}{#1}% +} +\define@key{pmdraw@brick}{no vertex top 4}{% Sets 4th vertex to skip in top row + \renewcommand{\pmdraw@drawNoVertexTd}{#1}% +} +\define@key{pmdraw@brick}{no vertex top 5}{% Sets 5th vertex to skip in top row + \renewcommand{\pmdraw@drawNoVertexTe}{#1}% +} +\define@key{pmdraw@brick}{no vertex top 6}{% Sets 6th vertex to skip in top row + \renewcommand{\pmdraw@drawNoVertexTf}{#1}% +} +\define@key{pmdraw@brick}{no vertex top 7}{% Sets 7th vertex to skip in top row + \renewcommand{\pmdraw@drawNoVertexTg}{#1}% +} +\define@key{pmdraw@brick}{no vertex top 8}{% Sets 8th vertex to skip in top row + \renewcommand{\pmdraw@drawNoVertexTh}{#1}% +} +\define@key{pmdraw@brick}{no vertex top 9}{% Sets 9th vertex to skip in top row + \renewcommand{\pmdraw@drawNoVertexTi}{#1}% +} + +\define@key{pmdraw@brick}{vertices options}{% Sets the draw command of vertices + \renewcommand{\pmdraw@drawVertex}[2]{#1}% +} + +\define@key{pmdraw@brick}{labels}[]{% Draws labels for vertices + \renewcommand{\pmdraw@ifLabelsB}{1}% + \renewcommand{\pmdraw@ifLabelsT}{1}% +} +\define@key{pmdraw@brick}{labels bottom}[]{% Draws labels for bottom vertices + \renewcommand{\pmdraw@ifLabelsB}{1}% +} +\define@key{pmdraw@brick}{labels top}[]{% Draws labels for top vertices + \renewcommand{\pmdraw@ifLabelsT}{1}% +} + +\define@key{pmdraw@brick}{labels start}{% Sets starting number for vertex labels + \setcounter{pmdraw@labelStartT}{#1}% + \setcounter{pmdraw@labelStartB}{#1}% +} +\define@key{pmdraw@brick}{labels bottom start}{% Sets starting number for bottom vertex labels + \setcounter{pmdraw@labelStartB}{#1}% +} +\define@key{pmdraw@brick}{labels top start}{% Sets starting number for top vertex labels + \setcounter{pmdraw@labelStartT}{#1}% +} + +\define@key{pmdraw@brick}{no label bottom 1}{% Sets 1st label to skip in bottom row + \renewcommand{\pmdraw@drawNoLabelBa}{#1}% +} +\define@key{pmdraw@brick}{no label bottom 2}{% Sets 2nd label to skip in bottom row + \renewcommand{\pmdraw@drawNoLabelBb}{#1}% +} +\define@key{pmdraw@brick}{no label bottom 3}{% Sets 3rd label to skip in bottom row + \renewcommand{\pmdraw@drawNoLabelBc}{#1}% +} +\define@key{pmdraw@brick}{no label bottom 4}{% Sets 4th label to skip in bottom row + \renewcommand{\pmdraw@drawNoLabelBd}{#1}% +} +\define@key{pmdraw@brick}{no label bottom 5}{% Sets 5th label to skip in bottom row + \renewcommand{\pmdraw@drawNoLabelBe}{#1}% +} +\define@key{pmdraw@brick}{no label bottom 6}{% Sets 6th label to skip in bottom row + \renewcommand{\pmdraw@drawNoLabelBf}{#1}% +} +\define@key{pmdraw@brick}{no label bottom 7}{% Sets 7th label to skip in bottom row + \renewcommand{\pmdraw@drawNoLabelBg}{#1}% +} +\define@key{pmdraw@brick}{no label bottom 8}{% Sets 8th label to skip in bottom row + \renewcommand{\pmdraw@drawNoLabelBh}{#1}% +} +\define@key{pmdraw@brick}{no label bottom 9}{% Sets 9th label to skip in bottom row + \renewcommand{\pmdraw@drawNoLabelBi}{#1}% +} +\define@key{pmdraw@brick}{no label top 1}{% Sets 1st label to skip in top row + \renewcommand{\pmdraw@drawNoLabelTa}{#1}% +} +\define@key{pmdraw@brick}{no label top 2}{% Sets 2nd label to skip in top row + \renewcommand{\pmdraw@drawNoLabelTb}{#1}% +} +\define@key{pmdraw@brick}{no label top 3}{% Sets 3rd label to skip in top row + \renewcommand{\pmdraw@drawNoLabelTc}{#1}% +} +\define@key{pmdraw@brick}{no label top 4}{% Sets 4th label to skip in top row + \renewcommand{\pmdraw@drawNoLabelTd}{#1}% +} +\define@key{pmdraw@brick}{no label top 5}{% Sets 5th label to skip in top row + \renewcommand{\pmdraw@drawNoLabelTe}{#1}% +} +\define@key{pmdraw@brick}{no label top 6}{% Sets 6th label to skip in top row + \renewcommand{\pmdraw@drawNoLabelTf}{#1}% +} +\define@key{pmdraw@brick}{no label top 7}{% Sets 7th label to skip in top row + \renewcommand{\pmdraw@drawNoLabelTg}{#1}% +} +\define@key{pmdraw@brick}{no label top 8}{% Sets 8th label to skip in top row + \renewcommand{\pmdraw@drawNoLabelTh}{#1}% +} +\define@key{pmdraw@brick}{no label top 9}{% Sets 9th label to skip in top row + \renewcommand{\pmdraw@drawNoLabelTi}{#1}% +} + +\define@key{pmdraw@brick}{labels bottom draw}{% Sets the draw options for labels of bottom vertices + \renewcommand{\pmdraw@drawLabelBDrawOptions}{#1}% +} +\define@key{pmdraw@brick}{labels bottom node}{% Sets the node options for labels of bottom vertices + \renewcommand{\pmdraw@drawLabelBNodeOptions}{#1}% +} +\define@key{pmdraw@brick}{labels top draw}{% Sets the draw options for labels of top vertices + \renewcommand{\pmdraw@drawLabelTDrawOptions}{#1}% +} +\define@key{pmdraw@brick}{labels top node}{% Sets the node options for labels of top vertices + \renewcommand{\pmdraw@drawLabelTNodeOptions}{#1}% +} + +\define@key{pmdraw@brick}{labels bottom options}{% Sets the draw command of labels of bottom vertices + \renewcommand{\pmdraw@drawLabelBottom}[3]{#1}% +} +\define@key{pmdraw@brick}{labels top options}{% Sets the draw command of labels of top vertices + \renewcommand{\pmdraw@drawLabelTop}[3]{#1}% +} + +\define@key{pmdraw@brick}{no dots}[]{% Does not draw dots in bricks + \setcounter{pmdraw@ifDiagWDotsFirst}{1}% +} + +\define@key{pmdraw@brick}{dots draw}{% Sets the draw options for drawing of dots + \renewcommand{\pmdraw@drawDotsDrawOptions}{#1}% +} +\define@key{pmdraw@brick}{dots node}{% Sets the node options for drawing of dots + \renewcommand{\pmdraw@drawDotsNodeOptions}{#1}% +} + +\define@key{pmdraw@brick}{vertices bottom phantom}[]{% Does not draw bottom vertices + \setcounter{pmdraw@ifVerticesBottom}{1}% +} +\define@key{pmdraw@brick}{vertices top phantom}[]{% Does not draw top vertices + \setcounter{pmdraw@ifVerticesTop}{1}% +} + +\define@key{pmdraw@brick}{vertices bottom uncover}{% Sets the uncover options of bottom vertices + \renewcommand{\pmdraw@verticesBottomUncover}{#1}% +} +\define@key{pmdraw@brick}{vertices top uncover}{% Sets the uncover options of top vertices + \renewcommand{\pmdraw@verticesTopUncover}{#1}% +} + +\define@key{pmdraw@brick}{levels}[1]{% Sets number of horizontal levels for non-transversal edges and evenly spaces them + \tikzmath{% + \pmdraw{edgeSepU} = (0.5*\pmdraw@rowSep)/(#1 + 1);% Calculates vertical separation between each edge + \pmdraw{edgeSepL} = \pmdraw{edgeSepU};% Calculates vertical separation between each edge + }% +} +\define@key{pmdraw@brick}{levels bottom}{% Sets number of horizontal levels for lower non-transversal edges and evenly spaces them + \tikzmath{% + \pmdraw{edgeSepL} = (0.5*\pmdraw@rowSep)/(#1 + 1);% Calculates vertical separation between each edge + }% +} +\define@key{pmdraw@brick}{levels top}{% Sets number of horizontal levels for upper non-transversal edges and evenly spaces them + \tikzmath{% + \pmdraw{edgeSepU} = (0.5*\pmdraw@rowSep)/(#1 + 1);% Calculates vertical separation between each edge + }% +} + +\define@key{pmdraw@brick}{levels sep}{% Sets vertical separation of horizontal levels for non-transversal edges + \tikzmath{% + \pmdraw{edgeSepU} = #1;% + \pmdraw{edgeSepL} = \pmdraw{edgeSepU};% + }% +} +\define@key{pmdraw@brick}{levels sep bottom}{% Sets vertical separation of lower horizontal levels for non-transversal edges + \tikzmath{% + \pmdraw{edgeSepL} = #1;% + }% +} +\define@key{pmdraw@brick}{levels sep top}{% Sets vertical separation of upper horizontal levels for non-transversal edges + \tikzmath{% + \pmdraw{edgeSepU} = #1;% + }% +} + +\define@key{pmdraw@brick}{edges}{% Sets the draw options of all edges + \renewcommand{\pmdraw@drawUedgesDrawOptions}{#1}% + \renewcommand{\pmdraw@drawLedgesDrawOptions}{#1}% + \renewcommand{\pmdraw@drawTedgesDrawOptions}{#1}% +} +\define@key{pmdraw@brick}{edges non-transversal}{% Sets the draw options of non-transversal edges + \renewcommand{\pmdraw@drawUedgesDrawOptions}{#1}% + \renewcommand{\pmdraw@drawLedgesDrawOptions}{#1}% +} +\define@key{pmdraw@brick}{edges upper}{% Sets the draw options of upper non-transversal edges + \renewcommand{\pmdraw@drawUedgesDrawOptions}{#1}% +} +\define@key{pmdraw@brick}{edges lower}{% Sets the draw options of lower non-transversal edges + \renewcommand{\pmdraw@drawLedgesDrawOptions}{#1}% +} +\define@key{pmdraw@brick}{edges transversal}{% Sets the draw options of transversal edges + \renewcommand{\pmdraw@drawTedgesDrawOptions}{#1}% +} + +\define@key{pmdraw@brick}{edges first}[]{% Draws edges before vertices + \renewcommand{\pmdraw@ifEdgesFirst}{1}% +} +\define@key{pmdraw@brick}{transversals first}[]{% Draws transversal edges before non-transversal edges + \renewcommand{\pmdraw@ifTedgesFirst}{1}% +} + +\define@key{pmdraw@brick}{edges phantom}[]{% Does not draw edges + \setcounter{pmdraw@ifEdges}{1}% +} + +\define@key{pmdraw@brick}{edges uncover}{% Sets the uncover options of edges + \renewcommand{\pmdraw@edgesUncover}{#1}% +} + +\define@key{pmdraw@brick}{brace}{% Draws a brace + \setkeys{pmdraw@brace}{#1}% Processes details of brace + \pmdraw@drawBrace{\value{pmdraw@braceL}}{\value{pmdraw@braceR}}{\pmdraw@braceLabel}% Draws brace + \let\pmdraw@drawBrace\pmdraw@drawBraceDefault% Resets brace options if changed +} + +\define@key{pmdraw@brick}{brace draw}{% Sets the draw options for drawing of brace + \renewcommand{\pmdraw@drawBraceDrawOptions}{#1}% +} +\define@key{pmdraw@brick}{brace node}{% Sets the node options for drawing of brace + \renewcommand{\pmdraw@drawBraceNodeOptions}{#1}% +} + +\define@key{pmdraw@brick}{decorate before}{% Hook for decorations before brick is drawn + \renewcommand{\pmdraw@hookBeforeBrick}{#1}% +} +\define@key{pmdraw@brick}{decorate after}{% Hook for decorations after brick is drawn + \renewcommand{\pmdraw@hookAfterBrick}{#1}% +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% Keys for edges % +% - ordered as per manual % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\define@key{pmdraw@NTedges}{level}{% Sets level of non-transversal edge + \setcounter{pmdraw@NTlevel}{#1}% +} +\define@key{pmdraw@NTedges}{height}{% Sets manual height of non-transversal edge + \renewcommand{\pmdraw@NTedgesHeight}{#1}% +} +\define@key{pmdraw@NTedges}{edge draw}{% Sets the draw options for drawing of edge + \renewcommand{\pmdraw@drawEdgeDrawOptions}{#1}% +} +\define@key{pmdraw@NTedges}{options}{% Sets the draw command of non-transversal edge + \renewcommand{\pmdraw@drawUedgesDraw}[2]{#1}% + \renewcommand{\pmdraw@drawLedgesDraw}[2]{#1}% +} +\define@key{pmdraw@NTedges}{phantom}[]{% Does not draw edge + \setcounter{pmdraw@ifEdge}{1}% +} +\define@key{pmdraw@NTedges}{uncover}{% Sets the uncover options of edge + \renewcommand{\pmdraw@edgeUncover}{#1}% +} +\define@key{pmdraw@Tedges}{height}{% Sets manual height of transversal edge + \tikzmath{% + \pmdraw{Tlevel} = #1;% + }% + \renewcommand{\pmdraw@ifTedgeHorizontal}{1}% Flags manual height +} +\define@key{pmdraw@Tedges}{edge draw}{% Sets the draw options for drawing of edge + \renewcommand{\pmdraw@drawEdgeDrawOptions}{#1}% +} +\define@key{pmdraw@Tedges}{options}{% Sets the draw command of transversal edge + \renewcommand{\pmdraw@drawTedgesDraw}[2]{#1}% +} +\define@key{pmdraw@Tedges}{phantom}[]{% Does not draw edge + \setcounter{pmdraw@ifEdge}{1}% +} +\define@key{pmdraw@Tedges}{uncover}{% Sets the uncover options of edge + \renewcommand{\pmdraw@edgeUncover}{#1}% +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% Keys for brace % +% - ordered as per manual % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\define@key{pmdraw@brace}{left}{% Sets starting position of brace + \setcounter{pmdraw@braceL}{#1}% +} +\define@key{pmdraw@brace}{right}{% Sets terminating position of brace + \setcounter{pmdraw@braceR}{#1}% +} +\define@key{pmdraw@brace}{label}{% Sets label of brace + \renewcommand{\pmdraw@braceLabel}{#1}% +} +\define@key{pmdraw@brace}{above}[]{% Set flag to draw brace above diagram + \renewcommand{\pmdraw@ifProdDiag}{1}% +} +\define@key{pmdraw@brace}{options}{% Sets the draw command of brace + \renewcommand{\pmdraw@drawBrace}[3]{#1}% +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% Keys for diagrams and product diagrams % +% - ordered as per manual % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\define@key{pmdraw@diagram}{row sep}{% Sets vertical separation between rows of vertices in diagram + \renewcommand{\pmdraw@rowSep}{#1}% +} +\define@key{pmdraw@diagram}{tikz}{% Sets the tikz options + \renewcommand{\pmdraw@tikz}{#1}% +} +\define@key{pmdraw@diagram}{dots options}{% Sets the draw command of dots between bricks + \renewcommand{\pmdraw@drawDots}[2]{#1}% +} +\define@key{pmdraw@diagram}{grid}[]{% Flag for drawing coordinate grid + \renewcommand{\pmdraw@ifGrid}{1}% +} +\define@key{pmdraw@diagram}{decorate before}{% Hook before drawing diagrams + \renewcommand{\pmdraw@hookBeforeDiagram}{#1}% +} +\define@key{pmdraw@diagram}{decorate after}{% Hook after drawing diagrams + \renewcommand{\pmdraw@hookAfterDiagram}{#1}% +} + +\define@key{pmdraw@diagram}{diagram sep}{% Sets vertical separation between bottom row of top diagram and top row of bottom diagram in product diagram + \renewcommand{\pmdraw@diagSep}{#1}% +} +\define@key{pmdraw@diagram}{vertex sep}{% Sets vertical separation between bottom row of top diagram and top row of bottom diagram in product diagram not for added edges + \renewcommand{\pmdraw@vertexSep}{#1}% +} +\define@key{pmdraw@diagram}{edges added}{% Sets the draw options for drawing of added edges in product diagram + \renewcommand{\pmdraw@drawAedgesOptions}{#1}% +} +\define@key{pmdraw@diagram}{edges added phantom}[]{% Does not draw added edges + \setcounter{pmdraw@ifEdgesAdded}{1}% +} +\define@key{pmdraw@diagram}{edges added uncover}{% Sets the uncover options of added edges + \renewcommand{\pmdraw@edgesAddedUncover}{#1}% +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% User commands % +% - loosely ordered alphabetically % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\newcommand{\pmdBrick}[4][]{% Draws brick + % #1 Options + % #2 Upper non-transversal edges, as list [<options>]{<left vertex>}{<right vertex>}, eg [level=1]{2}{3} + % #3 Lower non-transversal edges, as list [<options>]{<left vertex>}{<right vertex>}, eg [level=1]{2}{3} + % #4 Transversals, as list [<options>]{<upper vertex>}{<lower vertex>}, eg [level=1]{2}{3} + \pmdDiagram{{[#1]{#2}{#3}{#4}}}% Uses complete diagram method to draw brick +} + +\newcommand{\pmdDiagram}[2][]{% Draws diagram + % #1 Options + % #2 List of bricks + \setkeys{pmdraw@diagram}{#1}% Processes options + \renewcommand{\pmdraw@ifDiagWDots}{1}% Flags that diagram has dots + \setcounter{pmdraw@brickShift}{0}% Reset shifting of individual bricks + \ifmmode% If drawing diagram in a maths equation + \,% Add space + \ifnum\pmdraw@ifGrid=1% If displaying helper grid + \begin{tikzpicture}[scale=.5,baseline=0.405cm,show grid=true,apply style/.expand once=\pmdraw@tikz]% + \else% If not displaying helper grid + \begin{tikzpicture}[scale=.5,baseline=0.405cm,apply style/.expand once=\pmdraw@tikz]% + \fi% + \pmdraw@hookBeforeDiagram% Hook before drawing diagrams + \pmdraw@bricksLoop% Commences loop for each brick to be drawn + #2% + \pmdEmpty% Terminates loop + \pmdraw@hookAfterDiagram% Hook after drawing diagrams + \end{tikzpicture}% + \,% Add space + \else% If drawing diagram in normal text + \raisebox{0.5cm}{% Raise diagram so bottom row is on text baseline + \ifnum\pmdraw@ifGrid=1% If displaying helper grid + \begin{tikzpicture}[scale=.5,baseline=0.405cm,show grid=true,apply style/.expand once=\pmdraw@tikz]% + \else% If not displaying helper grid + \begin{tikzpicture}[scale=.5,baseline=0.405cm,apply style/.expand once=\pmdraw@tikz]% + \fi% + \pmdraw@hookBeforeDiagram% Hook before drawing diagrams + \pmdraw@bricksLoop% Commences loop for each brick to be drawn + #2% + \pmdEmpty% Terminates loop + \pmdraw@hookAfterDiagram% Hook after drawing diagrams + \end{tikzpicture}% + }% + \fi% + \pmdraw@reset% Resets user keys and other flags to default values +} + +\newcommand{\pmdEmpty}{}% Indicates no edges, internally halts input loops, always is = {} + +\newcommand{\pmdProduct}[4][]{% Draws product diagram + % #1 Options + % #2 List of added edges + % #3 Top diagram as list of bricks + % #4 Bottom diagram as list of bricks + \setkeys{pmdraw@diagram}{#1}% Processes options + \ifmmode% If drawing diagram in a maths equation + \,% Add space + \ifnum\pmdraw@ifGrid=1% If displaying helper grid + \begin{tikzpicture}[scale=.5,baseline=-.3475cm,show grid=true,apply style/.expand once=\pmdraw@tikz]% + \else% If not displaying helper grid + \begin{tikzpicture}[scale=.5,baseline=-.3475cm,apply style/.expand once=\pmdraw@tikz]% + \fi% + \pmdraw@hookBeforeDiagram% Hook before drawing diagrams + \pmdraw@AedgesLoop% Commences loop for added edges to be drawn + #2% + \pmdEmpty% Terminates loop + \renewcommand{\pmdraw@ifDiagWDots}{1}% Flags that diagram has dot + \renewcommand{\pmdraw@ifProdDiag}{1}% Flags that diagram is product + \setcounter{pmdraw@brickShift}{0}% Reset shifting of individual bricks + \pmdraw@bricksLoop% Commences loop for each brick to be drawn + #3% + \pmdEmpty% Terminates loop + \renewcommand{\pmdraw@ifProdDiag}{0}% Resets flag that diagram is product + \setcounter{pmdraw@ifDiagWDotsFirst}{1}% Reset if drawing first brick of diagram + \setcounter{pmdraw@brickShift}{0}% Reset shifting of individual bricks + \begin{scope}[shift={(0,-\pmdraw@diagSep-\pmdraw@rowSep-\pmdraw@vertexSep)}]% Shift coordinates to be underneath top diagram + \pmdraw@bricksLoop% Commences loop for each brick to be drawn + #4% + \pmdEmpty% Terminates loop + \renewcommand{\pmdraw@ifDiagWDots}{0}% Reset if drawing a diagram with dots + \setcounter{pmdraw@ifDiagWDotsFirst}{1}% Reset if drawing first brick of diagram + \end{scope}% + \pmdraw@hookAfterDiagram% Hook after drawing diagrams + \end{tikzpicture}% + \,% Add space + \else% If drawing diagram in normal text + \raisebox{2cm}{% Raise diagram so bottom row is on text baseline + \ifnum\pmdraw@ifGrid=1% If displaying helper grid + \begin{tikzpicture}[scale=.5,baseline=0.405cm,show grid=true,apply style/.expand once=\pmdraw@tikz]% + \else% If not displaying helper grid + \begin{tikzpicture}[scale=.5,baseline=0.405cm,apply style/.expand once=\pmdraw@tikz]% + \fi% + \pmdraw@hookBeforeDiagram% Hook before drawing diagrams + \pmdraw@AedgesLoop% Commences loop for added edges to be drawn + #2% + \pmdEmpty% Terminates loop + \renewcommand{\pmdraw@ifDiagWDots}{1}% Flags that diagram has dot + \renewcommand{\pmdraw@ifProdDiag}{1}% Flags that diagram is product + \setcounter{pmdraw@brickShift}{0}% Reset shifting of individual bricks + \pmdraw@bricksLoop% Commences loop for each brick to be drawn + #3% + \pmdEmpty% Terminates loop + \renewcommand{\pmdraw@ifProdDiag}{0}% Resets flag that diagram is products + \setcounter{pmdraw@ifDiagWDotsFirst}{1}% Reset if drawing first brick of diagram + \setcounter{pmdraw@brickShift}{0}% Reset shifting of individual bricks + \begin{scope}[shift={(0,-\pmdraw@diagSep-\pmdraw@rowSep-\pmdraw@vertexSep)}]% Shift coordinates to be underneath top diagram + \pmdraw@bricksLoop% Commences loop for each brick to be drawn + #4% + \pmdEmpty% Terminates loop + \renewcommand{\pmdraw@ifDiagWDots}{0}% Reset if drawing a diagram with dots + \setcounter{pmdraw@ifDiagWDotsFirst}{1}% Reset if drawing first brick of diagram + \end{scope}% + \pmdraw@hookAfterDiagram% Hook after drawing diagrams diagram + \end{tikzpicture}% + }% + \fi% + \pmdraw@reset% Resets user keys and other flags to default values +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% For loop commands % +% - loosely ordered alphabetically % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\newcommand{\pmdraw@AedgesLoop}{% Starts loop for added edges in product diagram + \@ifnextchar\pmdEmpty{}{% If not at end of list + \pmdraw@drawAedges% Draw each edge + }% +} +\newcommand{\pmdraw@bricksLoop}{% Starts loop to iterate over each brick in diagram + \@ifnextchar\pmdEmpty{}{% If not at end of list + \pmdraw@drawBrickInit% Draw each brick + }% +} +\newcommand{\pmdraw@LedgesLoop}{% Starts loop for lower non-transversal edges + \@ifnextchar\pmdEmpty{}{% If not at end of list + \pmdraw@drawLedges% Draw each edge + }% +} +\newcommand{\pmdraw@TedgesLoop}{% Starts loop for transversal edges + \@ifnextchar\pmdEmpty{}{% If not at end of list + \pmdraw@drawTedges% Draw each edge + }% +} +\newcommand{\pmdraw@UedgesLoop}{% Starts loop for upper non-transversal edges + \@ifnextchar\pmdEmpty{}{% If not at end of list + \pmdraw@drawUedges% Draw each edge + }% +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% Draw commands % +% - loosely ordered alphabetically % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\newcommand{\pmdraw@drawBottomVertices}{% Draws bottom row of vertices + \setcounter{pmdraw@bottomTotal}{\value{pmdraw@blankB}}% Store size of bottom row of vertices + \addtocounter{pmdraw@bottomTotal}{\value{pmdraw@degreeB}}% Store size of bottom row of vertices + \ifnum\value{pmdraw@ifDiagWDotsFirst}=1% If drawing first brick of diagram + \setcounter{pmdraw@ifDiagWDotsFirst}{0}% Mark that first brick has been drawn + \else% If not drawing first brick of diagram + \pmdraw@drawDots{0.5*\value{pmdraw@topShift}+0.5*\value{pmdraw@blankT}}{\pmdraw@rowSep}% Draw upper dots + \pmdraw@drawDots{0.5*\value{pmdraw@bottomShift}+0.5*\value{pmdraw@blankB}}{0}% Draw lower dots + \fi% + \ifnum\value{pmdraw@topTotal}>\value{pmdraw@bottomTotal}% If top row is longer than bottom row + \ifnum\pmdraw@ifDiagWDots=1% If drawing a diagram with dots + \addtocounter{pmdraw@brickShift}{\value{pmdraw@topTotal}}% Keep track of size of diagram + % Store shifts + \setcounter{pmdraw@topShift}{-\value{pmdraw@topTotal}}% + \addtocounter{pmdraw@topShift}{\value{pmdraw@topTotal}}% + \setcounter{pmdraw@bottomShift}{-\value{pmdraw@topTotal}}% + \addtocounter{pmdraw@bottomShift}{\value{pmdraw@bottomTotal}}% + \else% If drawing a diagram without dots + \setcounter{pmdraw@brickShift}{\value{pmdraw@topTotal}}% Keep track of size of diagram + \fi% + \else% If bottom row is longer than top row + \ifnum\pmdraw@ifDiagWDots=1% If drawing a diagram with dots + \addtocounter{pmdraw@brickShift}{\value{pmdraw@bottomTotal}}% Keep track of size of diagram + % Store shifts + \setcounter{pmdraw@topShift}{-\value{pmdraw@bottomTotal}}% + \addtocounter{pmdraw@topShift}{\value{pmdraw@topTotal}}% + \setcounter{pmdraw@bottomShift}{-\value{pmdraw@bottomTotal}}% + \addtocounter{pmdraw@bottomShift}{\value{pmdraw@bottomTotal}}% + \else% If drawing a diagram without dots + \setcounter{pmdraw@brickShift}{\value{pmdraw@bottomTotal}}% Keep track of size of diagram + \fi% + \fi% + \foreach \x in {1,...,\value{pmdraw@degreeB}} {% For each vertex in row + \ifnum\pmdraw@drawNoVertexBa=\x\else% If not skipping vertex + \ifnum\pmdraw@drawNoVertexBb=\x\else% If not skipping vertex + \ifnum\pmdraw@drawNoVertexBc=\x\else% If not skipping vertex + \ifnum\pmdraw@drawNoVertexBd=\x\else% If not skipping vertex + \ifnum\pmdraw@drawNoVertexBe=\x\else% If not skipping vertex + \ifnum\pmdraw@drawNoVertexBf=\x\else% If not skipping vertex + \ifnum\pmdraw@drawNoVertexBg=\x\else% If not skipping vertex + \ifnum\pmdraw@drawNoVertexBh=\x\else% If not skipping vertex + \ifnum\pmdraw@drawNoVertexBi=\x\else% If not skipping vertex + \pmdraw@drawVertex{\x + \value{pmdraw@blankB}}{0}% Draw lower vertex + \fi% + \fi% + \fi% + \fi% + \fi% + \fi% + \fi% + \fi% + \fi% + \ifnum\pmdraw@drawNoLabelBa=\x\else% If not skipping label + \ifnum\pmdraw@drawNoLabelBb=\x\else% If not skipping label + \ifnum\pmdraw@drawNoLabelBc=\x\else% If not skipping label + \ifnum\pmdraw@drawNoLabelBd=\x\else% If not skipping label + \ifnum\pmdraw@drawNoLabelBe=\x\else% If not skipping label + \ifnum\pmdraw@drawNoLabelBf=\x\else% If not skipping label + \ifnum\pmdraw@drawNoLabelBg=\x\else% If not skipping label + \ifnum\pmdraw@drawNoLabelBh=\x\else% If not skipping label + \ifnum\pmdraw@drawNoLabelBi=\x\else% If not skipping label + \ifnum\pmdraw@ifLabelsB=1% If drawing labels + \pmdraw@drawLabelBottom{\x + \value{pmdraw@blankT}}{0}{\thepmdraw@labelStartB}% Draw label + \fi% + \fi% + \fi% + \fi% + \fi% + \fi% + \fi% + \fi% + \fi% + \fi% + \stepcounter{pmdraw@labelStartB}% Update label counter + }% +} +\newcommand{\pmdraw@drawBrickInit}[1]{% Initialises the drawing of a brick + \ifnum\value{pmdraw@ifDiagWDotsFirst}=0% If not drawing first brick in diagram + \stepcounter{pmdraw@brickShift}% Makes space for dots to left of current brick + \fi% + \begin{scope}[shift={(\value{pmdraw@brickShift},0)}]% Shift brick to the right of already drawn bricks + \pmdraw@drawBrick#1% Draw brick + \end{scope}% + \pmdraw@bricksLoop% Restart for loop +} +\newcommand{\pmdraw@drawBrick}[4][]{% Draws a brick + % #1 Options + % #2 Upper non-transversal edges, as list [<options>]{<left vertex>}{<right vertex>}, eg [level=1]{2}{3} + % #3 Lower non-transversal edges, as list [<options>]{<left vertex>}{<right vertex>}, eg [level=1]{2}{3} + % #4 Transversals, as list [<options>]{<upper vertex>}{<lower vertex>}, eg [level=1]{2}{3} + \setkeys{pmdraw@brick}{levels,#1}% Processes options and set default levels + \pmdraw@hookBeforeBrick% Hook before drawing brick + \ifnum\pmdraw@ifEdgesFirst=0% If drawing vertices first + \@ifclassloaded{beamer}{% If in beamer + \uncover<\pmdraw@verticesTopUncover>{% Uncovers top vertices + \ifnum\value{pmdraw@ifVerticesTop}=0% If drawing top vertices + \pmdraw@drawTopVertices% Draw base diagram + \else% If hiding top vertices + \phantom{% + \pmdraw@drawTopVertices% Draw base diagram + }% + \fi% + }% + \uncover<\pmdraw@verticesBottomUncover>{% Uncovers bottom vertices + \ifnum\value{pmdraw@ifVerticesBottom}=0% If drawing bottom vertices + \pmdraw@drawBottomVertices% Draw base diagram + \else% If hiding top vertices + \phantom{% + \pmdraw@drawBottomVertices% Draw base diagram + }% + \fi% + }% + \uncover<\pmdraw@edgesUncover>{% Uncovers edges + \ifnum\value{pmdraw@ifEdges}=0% If drawing edges + \ifnum\pmdraw@ifTedgesFirst=0% If drawing non-transversals first + \pmdraw@UedgesLoop% Draws upper edges + #2% + \pmdEmpty% + \pmdraw@LedgesLoop% Draws lower edges + #3% + \pmdEmpty% + \pmdraw@TedgesLoop% Draws transversals + #4% + \pmdEmpty% + \else% If drawing transversal first + \pmdraw@TedgesLoop% Draws transversals + #4% + \pmdEmpty% + \pmdraw@UedgesLoop% Draws upper edges + #2% + \pmdEmpty% + \pmdraw@LedgesLoop% Draws lower edges + #3% + \pmdEmpty% + \fi% + \else% If hiding edges + \phantom{% + \ifnum\pmdraw@ifTedgesFirst=0% If drawing non-transversals first + \pmdraw@UedgesLoop% Draws upper edges + #2% + \pmdEmpty% + \pmdraw@LedgesLoop% Draws lower edges + #3% + \pmdEmpty% + \pmdraw@TedgesLoop% Draws transversals + #4% + \pmdEmpty% + \else% If drawing transversal first + \pmdraw@TedgesLoop% Draws transversals + #4% + \pmdEmpty% + \pmdraw@UedgesLoop% Draws upper edges + #2% + \pmdEmpty% + \pmdraw@LedgesLoop% Draws lower edges + #3% + \pmdEmpty% + \fi% + }% + \fi% + }% + }{% If not in beamer + \ifnum\value{pmdraw@ifVerticesTop}=0% If drawing top vertices + \pmdraw@drawTopVertices% Draw base diagram + \else% If hiding top vertices + \phantom{% + \pmdraw@drawTopVertices% Draw base diagram + }% + \fi% + \ifnum\value{pmdraw@ifVerticesBottom}=0% If drawing bottom vertices + \pmdraw@drawBottomVertices% Draw base diagram + \else% If hiding top vertices + \phantom{% + \pmdraw@drawBottomVertices% Draw base diagram + }% + \fi% + \ifnum\value{pmdraw@ifEdges}=0% If drawing edges + \ifnum\pmdraw@ifTedgesFirst=0% If drawing non-transversals first + \pmdraw@UedgesLoop% Draws upper edges + #2% + \pmdEmpty% + \pmdraw@LedgesLoop% Draws lower edges + #3% + \pmdEmpty% + \pmdraw@TedgesLoop% Draws transversals + #4% + \pmdEmpty% + \else% If drawing transversal first + \pmdraw@TedgesLoop% Draws transversals + #4% + \pmdEmpty% + \pmdraw@UedgesLoop% Draws upper edges + #2% + \pmdEmpty% + \pmdraw@LedgesLoop% Draws lower edges + #3% + \pmdEmpty% + \fi% + \else% If hiding edges + \phantom{% + \ifnum\pmdraw@ifTedgesFirst=0% If drawing non-transversals first + \pmdraw@UedgesLoop% Draws upper edges + #2% + \pmdEmpty% + \pmdraw@LedgesLoop% Draws lower edges + #3% + \pmdEmpty% + \pmdraw@TedgesLoop% Draws transversals + #4% + \pmdEmpty% + \else% If drawing transversal first + \pmdraw@TedgesLoop% Draws transversals + #4% + \pmdEmpty% + \pmdraw@UedgesLoop% Draws upper edges + #2% + \pmdEmpty% + \pmdraw@LedgesLoop% Draws lower edges + #3% + \pmdEmpty% + \fi% + }% + \fi% + }% + \else% If drawing edges first + \@ifclassloaded{beamer}{% If in beamer + \uncover<\pmdraw@edgesUncover>{% Uncovers edges + \ifnum\value{pmdraw@ifEdges}=0% If drawing edges + \ifnum\pmdraw@ifTedgesFirst=0% If drawing non-transversals first + \pmdraw@UedgesLoop% Draws upper edges + #2% + \pmdEmpty% + \pmdraw@LedgesLoop% Draws lower edges + #3% + \pmdEmpty% + \pmdraw@TedgesLoop% Draws transversals + #4% + \pmdEmpty% + \else% If drawing transversal first + \pmdraw@TedgesLoop% Draws transversals + #4% + \pmdEmpty% + \pmdraw@UedgesLoop% Draws upper edges + #2% + \pmdEmpty% + \pmdraw@LedgesLoop% Draws lower edges + #3% + \pmdEmpty% + \fi% + \else% If hiding edges + \phantom{% + \ifnum\pmdraw@ifTedgesFirst=0% If drawing non-transversals first + \pmdraw@UedgesLoop% Draws upper edges + #2% + \pmdEmpty% + \pmdraw@LedgesLoop% Draws lower edges + #3% + \pmdEmpty% + \pmdraw@TedgesLoop% Draws transversals + #4% + \pmdEmpty% + \else% If drawing transversal first + \pmdraw@TedgesLoop% Draws transversals + #4% + \pmdEmpty% + \pmdraw@UedgesLoop% Draws upper edges + #2% + \pmdEmpty% + \pmdraw@LedgesLoop% Draws lower edges + #3% + \pmdEmpty% + \fi% + }% + \fi% + }% + \uncover<\pmdraw@verticesTopUncover>{% Uncovers top vertices + \ifnum\value{pmdraw@ifVerticesTop}=0% If drawing top vertices + \pmdraw@drawTopVertices% Draw base diagram + \else% If hiding top vertices + \phantom{% + \pmdraw@drawTopVertices% Draw base diagram + }% + \fi% + }% + \uncover<\pmdraw@verticesBottomUncover>{% Uncovers bottm vertices + \ifnum\value{pmdraw@ifVerticesBottom}=0% If drawing bottom vertices + \pmdraw@drawBottomVertices% Draw base diagram + \else% If hiding top vertices + \phantom{% + \pmdraw@drawBottomVertices% Draw base diagram + }% + \fi% + }% + }{% If not in beamer + \ifnum\value{pmdraw@ifEdges}=0% If drawing edges + \ifnum\pmdraw@ifTedgesFirst=0% If drawing non-transversals first + \pmdraw@UedgesLoop% Draws upper edges + #2% + \pmdEmpty% + \pmdraw@LedgesLoop% Draws lower edges + #3% + \pmdEmpty% + \pmdraw@TedgesLoop% Draws transversals + #4% + \pmdEmpty% + \else% If drawing transversal first + \pmdraw@TedgesLoop% Draws transversals + #4% + \pmdEmpty% + \pmdraw@UedgesLoop% Draws upper edges + #2% + \pmdEmpty% + \pmdraw@LedgesLoop% Draws lower edges + #3% + \pmdEmpty% + \fi% + \else% If hiding edges + \phantom{% + \ifnum\pmdraw@ifTedgesFirst=0% If drawing non-transversals first + \pmdraw@UedgesLoop% Draws upper edges + #2% + \pmdEmpty% + \pmdraw@LedgesLoop% Draws lower edges + #3% + \pmdEmpty% + \pmdraw@TedgesLoop% Draws transversals + #4% + \pmdEmpty% + \else% If drawing transversal first + \pmdraw@TedgesLoop% Draws transversals + #4% + \pmdEmpty% + \pmdraw@UedgesLoop% Draws upper edges + #2% + \pmdEmpty% + \pmdraw@LedgesLoop% Draws lower edges + #3% + \pmdEmpty% + \fi% + }% + \fi% + \ifnum\value{pmdraw@ifVerticesTop}=0% If drawing top vertices + \pmdraw@drawTopVertices% Draw base diagram + \else% If hiding top vertices + \phantom{% + \pmdraw@drawTopVertices% Draw base diagram + }% + \fi% + \ifnum\value{pmdraw@ifVerticesBottom}=0% If drawing bottom vertices + \pmdraw@drawBottomVertices% Draw base diagram + \else% If hiding top vertices + \phantom{% + \pmdraw@drawBottomVertices% Draw base diagram + }% + \fi% + }% + \fi% + \pmdraw@hookAfterBrick% Hook after drawing brick + % Resets user keys and other flags to default values + \renewcommand{\pmdraw@drawBraceDrawOptions}{}% + \renewcommand{\pmdraw@drawBraceNodeOptions}{}% + \renewcommand{\pmdraw@drawDotsDrawOptions}{}% + \renewcommand{\pmdraw@drawDotsNodeOptions}{}% + \renewcommand{\pmdraw@drawLabelBDrawOptions}{}% + \renewcommand{\pmdraw@drawLabelBNodeOptions}{}% + \renewcommand{\pmdraw@drawLabelTDrawOptions}{}% + \renewcommand{\pmdraw@drawLabelTNodeOptions}{}% + \renewcommand{\pmdraw@drawLedgesDrawOptions}{}% + \renewcommand{\pmdraw@drawNoLabelBa}{-1}% + \renewcommand{\pmdraw@drawNoLabelBb}{-1}% + \renewcommand{\pmdraw@drawNoLabelBc}{-1}% + \renewcommand{\pmdraw@drawNoLabelBd}{-1}% + \renewcommand{\pmdraw@drawNoLabelBe}{-1}% + \renewcommand{\pmdraw@drawNoLabelBf}{-1}% + \renewcommand{\pmdraw@drawNoLabelBg}{-1}% + \renewcommand{\pmdraw@drawNoLabelBh}{-1}% + \renewcommand{\pmdraw@drawNoLabelBi}{-1}% + \renewcommand{\pmdraw@drawNoLabelTa}{-1}% + \renewcommand{\pmdraw@drawNoLabelTb}{-1}% + \renewcommand{\pmdraw@drawNoLabelTc}{-1}% + \renewcommand{\pmdraw@drawNoLabelTd}{-1}% + \renewcommand{\pmdraw@drawNoLabelTe}{-1}% + \renewcommand{\pmdraw@drawNoLabelTf}{-1}% + \renewcommand{\pmdraw@drawNoLabelTg}{-1}% + \renewcommand{\pmdraw@drawNoLabelTh}{-1}% + \renewcommand{\pmdraw@drawNoLabelTi}{-1}% + \renewcommand{\pmdraw@drawNoVertexBa}{-1}% + \renewcommand{\pmdraw@drawNoVertexBb}{-1}% + \renewcommand{\pmdraw@drawNoVertexBc}{-1}% + \renewcommand{\pmdraw@drawNoVertexBd}{-1}% + \renewcommand{\pmdraw@drawNoVertexBe}{-1}% + \renewcommand{\pmdraw@drawNoVertexBf}{-1}% + \renewcommand{\pmdraw@drawNoVertexBg}{-1}% + \renewcommand{\pmdraw@drawNoVertexBh}{-1}% + \renewcommand{\pmdraw@drawNoVertexBi}{-1}% + \renewcommand{\pmdraw@drawNoVertexTa}{-1}% + \renewcommand{\pmdraw@drawNoVertexTb}{-1}% + \renewcommand{\pmdraw@drawNoVertexTc}{-1}% + \renewcommand{\pmdraw@drawNoVertexTd}{-1}% + \renewcommand{\pmdraw@drawNoVertexTe}{-1}% + \renewcommand{\pmdraw@drawNoVertexTf}{-1}% + \renewcommand{\pmdraw@drawNoVertexTg}{-1}% + \renewcommand{\pmdraw@drawNoVertexTh}{-1}% + \renewcommand{\pmdraw@drawNoVertexTi}{-1}% + \renewcommand{\pmdraw@drawTedgesDrawOptions}{}% + \renewcommand{\pmdraw@drawUedgesDrawOptions}{}% + \renewcommand{\pmdraw@drawVertexOptions}{}% + \renewcommand{\pmdraw@hookBeforeBrick}{}% + \renewcommand{\pmdraw@hookAfterBrick}{}% + \renewcommand{\pmdraw@ifEdgesFirst}{0}% + \renewcommand{\pmdraw@ifLabelsB}{0}% + \renewcommand{\pmdraw@ifLabelsT}{0}% + \renewcommand{\pmdraw@ifTedgesFirst}{0}% + \renewcommand{\pmdraw@edgesUncover}{1-}% + \renewcommand{\pmdraw@verticesBottomUncover}{1-}% + \renewcommand{\pmdraw@verticesTopUncover}{1-}% + \let\pmdraw@drawLabelBottom\pmdraw@drawLabelBottomDefault% + \let\pmdraw@drawLabelTop\pmdraw@drawLabelTopDefault% + \let\pmdraw@drawLabelBottom\pmdraw@drawLabelBottomDefault% + \setcounter{pmdraw@blankB}{0}% + \setcounter{pmdraw@blankT}{0}% + \setcounter{pmdraw@labelStartB}{1}% + \setcounter{pmdraw@labelStartT}{1}% + \setcounter{pmdraw@ifEdges}{0}% + \setcounter{pmdraw@ifVerticesBottom}{0}% + \setcounter{pmdraw@ifVerticesTop}{0}% +} +\newcommand{\pmdraw@drawLedges}[3][]{% Draws lower non-transversal edge, #1 options, #2 L vertex, #3 R vertex + \setcounter{pmdraw@NTlevel}{1}% Store default level of edge + \setkeys{pmdraw@NTedges}{#1}% Processes options + \ifdim\pmdraw@NTedgesHeight pt=-1000pt% If using default heights + \tikzmath{% + \pmdraw{edgeHeight}=\value{pmdraw@NTlevel}*\pmdraw{edgeSepL};% Calculates height based on level of edge + }% + \else% If using manual heights + \tikzmath{% + \pmdraw{edgeHeight}=\pmdraw@NTedgesHeight;% Set manual height + }% + \fi% + \@ifclassloaded{beamer}{% If in beamer + \uncover<\pmdraw@edgeUncover>{% Uncovers edge + \ifnum\value{pmdraw@ifEdge}=0% If drawing edge + \pmdraw@drawLedgesDraw{#2}{#3}% Draw edge + \else% If hiding edge + \phantom{% + \pmdraw@drawLedgesDraw{#2}{#3}% Draw edge + }% + \fi% + }% + }{% If not in beamer + \ifnum\value{pmdraw@ifEdge}=0% If drawing edge + \pmdraw@drawLedgesDraw{#2}{#3}% Draw edge + \else% If hiding edge + \phantom{% + \pmdraw@drawLedgesDraw{#2}{#3}% Draw edge + }% + \fi% + }% + % Resets user keys and other flags to default values + \renewcommand{\pmdraw@NTedgesHeight}{-1000}% + \renewcommand{\pmdraw@edgeUncover}{1-}% + \setcounter{pmdraw@ifEdge}{0}% + \let\pmdraw@drawLedgesDraw\pmdraw@drawLedgesDrawDefault% + \pmdraw@LedgesLoop% Restart for loop +} +\newcommand{\pmdraw@drawTedges}[3][]{% Draws transversal edge, #1 options, #2 upper vertex, #3 lower vertex + \setkeys{pmdraw@Tedges}{#1}% Processes options + \@ifclassloaded{beamer}{% If in beamer + \uncover<\pmdraw@edgeUncover>{% Uncovers edge + \ifnum\value{pmdraw@ifEdge}=0% If drawing edge + \pmdraw@drawTedgesDraw{#2}{#3}% Draw edge + \else% If hiding edge + \phantom{% + \pmdraw@drawTedgesDraw{#2}{#3}% Draw edge + }% + \fi% + }% + }{% If not in beamer + \ifnum\value{pmdraw@ifEdge}=0% If drawing edge + \pmdraw@drawTedgesDraw{#2}{#3}% Draw edge + \else% If hiding edge + \phantom{% + \pmdraw@drawTedgesDraw{#2}{#3}% Draw edge + }% + \fi% + }% + % Resets user keys and other flags to default values + \renewcommand{\pmdraw@edgeUncover}{1-}% + \setcounter{pmdraw@ifEdge}{0}% + \let\pmdraw@drawTedgesDraw\pmdraw@drawTedgesDrawDefault% + \pmdraw@TedgesLoop% Restart for loop +} +\newcommand{\pmdraw@drawTopVertices}{% Draws top row of vertices + \setcounter{pmdraw@topTotal}{\value{pmdraw@blankT}}% Store size of top row of vertices + \addtocounter{pmdraw@topTotal}{\value{pmdraw@degreeT}}% Store size of top row of vertices + \foreach \x in {1,...,\value{pmdraw@degreeT}} {% For each vertex in row + \ifnum\pmdraw@drawNoVertexTa=\x\else% If not skipping vertex + \ifnum\pmdraw@drawNoVertexTb=\x\else% If not skipping vertex + \ifnum\pmdraw@drawNoVertexTc=\x\else% If not skipping vertex + \ifnum\pmdraw@drawNoVertexTd=\x\else% If not skipping vertex + \ifnum\pmdraw@drawNoVertexTe=\x\else% If not skipping vertex + \ifnum\pmdraw@drawNoVertexTf=\x\else% If not skipping vertex + \ifnum\pmdraw@drawNoVertexTg=\x\else% If not skipping vertex + \ifnum\pmdraw@drawNoVertexTh=\x\else% If not skipping vertex + \ifnum\pmdraw@drawNoVertexTi=\x\else% If not skipping vertex + \pmdraw@drawVertex{\x + \value{pmdraw@blankT}}{\pmdraw@rowSep}% Draw upper vertex + \fi% + \fi% + \fi% + \fi% + \fi% + \fi% + \fi% + \fi% + \fi% + \ifnum\pmdraw@drawNoLabelTa=\x\else% If not skipping label + \ifnum\pmdraw@drawNoLabelTb=\x\else% If not skipping label + \ifnum\pmdraw@drawNoLabelTc=\x\else% If not skipping label + \ifnum\pmdraw@drawNoLabelTd=\x\else% If not skipping label + \ifnum\pmdraw@drawNoLabelTe=\x\else% If not skipping label + \ifnum\pmdraw@drawNoLabelTf=\x\else% If not skipping label + \ifnum\pmdraw@drawNoLabelTg=\x\else% If not skipping label + \ifnum\pmdraw@drawNoLabelTh=\x\else% If not skipping label + \ifnum\pmdraw@drawNoLabelTi=\x\else% If not skipping label + \ifnum\pmdraw@ifLabelsT=1% If drawing labels + \pmdraw@drawLabelTop{\x + \value{pmdraw@blankT}}{\pmdraw@rowSep}{\thepmdraw@labelStartT}% Draw label + \fi% + \fi% + \fi% + \fi% + \fi% + \fi% + \fi% + \fi% + \fi% + \fi% + \stepcounter{pmdraw@labelStartT}% Update label counter + }% +} +\newcommand{\pmdraw@drawUedges}[3][]{% Draws upper non-transversal edge, #1 options, #2 L vertex, #3 R vertex + \setcounter{pmdraw@NTlevel}{1}% Store default level of edge + \setkeys{pmdraw@NTedges}{#1}% Processes options + \ifdim\pmdraw@NTedgesHeight pt=-1000pt% If using default heights + \tikzmath{% + \pmdraw{edgeHeight}=\value{pmdraw@NTlevel}*\pmdraw{edgeSepU};% Calculates height based on level of edge + }% + \else% If using manual heights + \tikzmath{% + \pmdraw{edgeHeight}=\pmdraw@rowSep-\pmdraw@NTedgesHeight;% Set manual height + }% + \fi% + \@ifclassloaded{beamer}{% If in beamer + \uncover<\pmdraw@edgeUncover>{% Uncovers edge + \ifnum\value{pmdraw@ifEdge}=0% If drawing edge + \pmdraw@drawUedgesDraw{#2}{#3}% Draw edge + \else% If hiding edge + \phantom{% + \pmdraw@drawUedgesDraw{#2}{#3}% Draw edge + }% + \fi% + }% + }{% If not in beamer + \ifnum\value{pmdraw@ifEdge}=0% If drawing edge + \pmdraw@drawUedgesDraw{#2}{#3}% Draw edge + \else% If hiding edge + \phantom{% + \pmdraw@drawUedgesDraw{#2}{#3}% Draw edge + }% + \fi% + }% + % Resets user keys and other flags to default values + \renewcommand{\pmdraw@NTedgesHeight}{-1000}% + \renewcommand{\pmdraw@edgeUncover}{1-}% + \setcounter{pmdraw@ifEdge}{0}% + \let\pmdraw@drawLedgesDraw\pmdraw@drawLedgesDrawDefault% + \let\pmdraw@drawUedgesDraw\pmdraw@drawUedgesDrawDefault% + \pmdraw@UedgesLoop% Restart for loop +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% Grid creation % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% This is a verbatim copy of: +% https://tex.stackexchange.com/a/467908 + +\newif\if@showgrid@grid +\newif\if@showgrid@left +\newif\if@showgrid@right +\newif\if@showgrid@below +\newif\if@showgrid@above +\tikzset{% + every show grid/.style={}, + show grid/.style={execute at end picture={\@showgrid{grid=true,#1}}},% + show grid/.default={true}, + show grid/.cd, + labels/.style={font={\sffamily\small},help lines}, + xlabels/.style={}, + ylabels/.style={}, + keep bb/.code={\useasboundingbox (current bounding box.south west) rectangle (current bounding box.north west);}, + true/.style={left,below}, + false/.style={left=false,right=false,above=false,below=false,grid=false}, + none/.style={left=false,right=false,above=false,below=false}, + all/.style={left=true,right=true,above=true,below=true}, + grid/.is if=@showgrid@grid, + left/.is if=@showgrid@left, + right/.is if=@showgrid@right, + below/.is if=@showgrid@below, + above/.is if=@showgrid@above, + false, +} + +\def\@showgrid#1{% + \begin{scope}[every show grid,show grid/.cd,#1] + \if@showgrid@grid + \begin{pgfonlayer}{background} + \draw [help lines] + (current bounding box.south west) grid + (current bounding box.north east); +% + \pgfpointxy{1}{1}% + \edef\xs{\the\pgf@x}% + \edef\ys{\the\pgf@y}% + \pgfpointanchor{current bounding box}{south west} + \edef\xa{\the\pgf@x}% + \edef\ya{\the\pgf@y}% + \pgfpointanchor{current bounding box}{north east} + \edef\xb{\the\pgf@x}% + \edef\yb{\the\pgf@y}% + \pgfmathtruncatemacro\xbeg{ceil(\xa/\xs)} + \pgfmathtruncatemacro\xend{floor(\xb/\xs)} + \if@showgrid@below + \foreach \X in {\xbeg,...,\xend} { + \node [below,show grid/labels,show grid/xlabels] at (\X,\ya) {\X}; + } + \fi + \if@showgrid@above + \foreach \X in {\xbeg,...,\xend} { + \node [above,show grid/labels,show grid/xlabels] at (\X,\yb) {\X}; + } + \fi + \pgfmathtruncatemacro\ybeg{ceil(\ya/\ys)} + \pgfmathtruncatemacro\yend{floor(\yb/\ys)} + \if@showgrid@left + \foreach \Y in {\ybeg,...,\yend} { + \node [left,show grid/labels,show grid/ylabels] at (\xa,\Y) {\Y}; + } + \fi + \if@showgrid@right + \foreach \Y in {\ybeg,...,\yend} { + \node [right,show grid/labels,show grid/ylabels] at (\xb,\Y) {\Y}; + } + \fi + \end{pgfonlayer} + \fi + \end{scope} +} +\tikzset{every show grid/.style={show grid/keep bb}}% Keep the original bounding box! + +\endinput
\ No newline at end of file diff --git a/graphics/pgf/contrib/pmdraw/pmdraw.tex b/graphics/pgf/contrib/pmdraw/pmdraw.tex new file mode 100644 index 0000000000..b4111bcff2 --- /dev/null +++ b/graphics/pgf/contrib/pmdraw/pmdraw.tex @@ -0,0 +1,3679 @@ +\documentclass{ltxdoc} + +% *------------------------------* +% |6````````````````````````````2| +% |`````____````____`````````````| +% |````|MFMF\ /MFMF|````````````| +% |````|MF|MF\/MF|MF|````````````| +% |````|MF|\MFMF/|MF|_______`````| +% |````|MF|``````|MFMFMFMFMF|````| +% |````|MF|``````|MF|````````````| +% |````|MF|``````|MF|___`````````| +% |``````````````|MFMFMF|````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |``````````````|MF|````````````| +% |3````````````````````````````0| +% *------------------------------* + +\usepackage{pmdraw} +\usepackage{xcolor} +\usepackage{fancyvrb} +\usepackage{hyperref} + +\begin{document} + +\hypersetup{colorlinks, linkcolor=blue, urlcolor=blue} + +\title{The \textsf{pmdraw} package\thanks{This document + corresponds to \textsf{pmdraw}~v1.4, 2024-06-02.}} +\author{Matthias Fresacher \\ \texttt{matthias.ypg37@slmail.me}} + +\maketitle + +\begin{abstract} +The \texttt{pmdraw} package allows you to draw elements of the diagram monoids, commonly referred to as diagrams. The package provides a lot of flexibility to draw most diagrams and can be customised as needed. +\end{abstract} + +\tableofcontents + +\newpage +\section{Introduction} + +\subsection{Motivation} + +Diagram monoids and their closely related algebras are well studied objects with applications in theoretical physics and representation theory in mathematics. The elements of these monoids are called diagrams because they can be drawn graphically as a graph following certain conventions. + +My PhD thesis examines properties of these diagram monoids and hence I needed to draw a large number of diagrams in a neat and consistent way. This thesis work formed the basis of this package with only customisability and the manual needed to be added to complete this package. + +\subsection{Acknowledgments} + +Most importantly, I thank James East, my PhD supervisor for allowing me to get a little sidetracked in my PhD research and develop and publish this package rather than work on my thesis like I should have. + +This package has at its core the basic drawing macro of a diagram as used by James East and Nik Ru\v{s}kuc in their 2022 publication {\it Classification of congruences of twisted partition monoids} in Advances in Mathematics. I thank them both for allowing me to build on their work. + +I thank everybody that has helped me proof read, spot bugs, provide feedback, suggest improvements or has otherwise contributed to this package. Those that are happy to be named are (in chronological order): +\begin{itemize} + \item Nik Ru\v{s}kuc +\end{itemize} + +This package heavily uses commands that can accept an arbitrary number of arguments as inputs. I thank \texttt{egreg} for their template upon which my commands are based (\url{https://tex.stackexchange.com/a/72915}). + +As this was my first time using keys, I thank David Carlisle for their very helpful example (\url{https://tex.stackexchange.com/a/542555}). + +As it turns out, passing my keys to the \verb`\draw` command of \texttt{tikz} is a little more tricky than one might expect. I thank Andrew Stacey for their solution (\url{https://tex.stackexchange.com/a/64237}). + +I thank Partha~D.~for their ready to use out of the box macro for adding grid lines to a \texttt{tikz} drawing (\url{https://tex.stackexchange.com/a/467908}). + +I also thank everybody on \url{https://tex.stackexchange.com} who has answered a questions or solved a problem. There are too many to list you all. Thank you. + +\section{Bugs and known problems} + +\subsection{Bugs} + +If you discover a bug, please be so kind and send me a minimum working example of the bug in action and I will work on fixing it. + +I would like this package to be as perfect as it can be but I will need your help with this as there simply are too many keys to test every combination or use case. + +The following are a list of currently known bugs that will be addressed: +\begin{enumerate} + \item When the radius of the arc for non-transversal edges is too large compared to the distance between the two nodes, the arcs overlap. The current solution is to manually specify a \texttt{level} or \texttt{height} that makes the arcs smaller. + \item Baseline adjustments are hard coded so when changing \texttt{scale}, \texttt{row sep} or text size, for example, the vertical position of diagrams is likely to be incorrect. The current solution is to manually adjust the \texttt{baseline} within the \texttt{tikz} key. + \item In a product diagram, if \texttt{row sep} is used in the bottom diagram, the spacing between diagrams is incorrect. +\end{enumerate} + +\subsection{Incompatibilities} + +The following are a list of known problems or incompatibilities that are not scheduled to be resolved anytime soon: +\begin{enumerate} + \item None at the moment +\end{enumerate} + +\section{Usage} + +To use the package, one must understand that all diagrams are created from a basic building block called a brick. + +\subsection{Bricks} + +\DescribeMacro{brick} +A \texttt{brick} is a diagram that contains no dots. For example, +\begin{center} + \pmdBrick[ % Options + degree=5 + ]{ % Upper non-transversal edges + {1}{2} + {2}{5} + }{ % Lower non-transversal edges + {1}{2} + {3}{4} + }{ % Transversal edges + {1}{1} + {3}{4} + } +\end{center} +is a brick whilst +\begin{center} + \pmdDiagram{ + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + {2}{3} + {4}{5} + }{ % Lower non-transversal edges + {2}{3} + {4}{5} + }{ % Transversal edges + {1}{1} + } + }{ % Brick 2 + [ % Options + degree=2 + ]{ % Upper non-transversal edges + {1}{2} + }{ % Lower non-transversal edges + {1}{2} + }{ % Transversal edges + \pmdEmpty + } + } + } +\end{center} +is not a brick. +\DescribeMacro{<brick>} +The syntax for a brick contains four components and is as follows: +\begin{center} + \texttt{<brick>~=~[<options>]\{<Uedges>\}\{<Ledges>\}\{<Tedges>\}} +\end{center} +where +\DescribeMacro{brick/<options>} +the \texttt{<options>} are described in Section~\ref{sec: brick/options}. + +\DescribeMacro{<Uedges>} +is a list of upper non-transversal edges. An upper non-transversal edges has three components \texttt{<Uedges>~=~[<options>]\{<Svertex>\}\{<Tvertex>\}} where +\DescribeMacro{Uedges/<options>}\DescribeMacro{Ledges/<options>} +the \texttt{<options>} are described in Section~\ref{sec: NT edge/options}, +\DescribeMacro{<Svertex>} +\texttt{\{<Svertex>\}} is the starting vertex and +\DescribeMacro{<Tvertex>} +\texttt{\{<Tvertex>\}} is the terminating vertex of the edge. Both \texttt{\{<Svertex>\}} and \texttt{\{<Tvertex>\}} are a \( x \)-coordinate and it is assumed that \( \texttt{\{<Svertex>\}} < \texttt{\{<Tvertex>\}} \). + +\DescribeMacro{list} +A \texttt{list} of upper non-transversal edges is simply each upper non-transversal edge written after the other. For example a list with one upper non-transversal edges is +\begin{verbatim} + {1}{2} +\end{verbatim} +whilst one with three upper non-transversal edges may be +\begin{verbatim} + {1}{2}[level=1]{3}{4}{5}{6} +\end{verbatim} +For ease of reading this will coded as +\begin{verbatim} + {1}{2} + [level=1]{3}{4} + {5}{6} +\end{verbatim} +\DescribeMacro{\pmdEmpty} +Should a list be empty, the command \verb`\pmdEmpty` should be used. + +\DescribeMacro{<Ledges>} +is a list of lower non-transversal edges. A lower non-transversal edges has the same three components as an upper non-transversal edge, namely \texttt{<Ledges>~=~[<options>]\{<Svertex>\}\{<Tvertex>\}}. + +\DescribeMacro{<Tedges>} +is a list of transversal edges. A transversal edges has three components \texttt{<Tedges>~=~[<options>]\{<Tvertex>\}\{<Bvertex>\}} where +\DescribeMacro{Tedges/<options>} +the \texttt{<options>} are described in Section~\ref{sec: T edge/options}, +\DescribeMacro{<Tvertex>} +\texttt{\{<Tvertex>\}} is the top vertex and +\DescribeMacro{<Bvertex>} +\texttt{\{<Bvertex>\}} is the bottom vertex of the edge. Both \texttt{\{<Tvertex>\}} and \texttt{\{<Bvertex>\}} are a \( x \)-coordinate. + +An example \texttt{<brick>} and the resultant diagram is: +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5 +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} + {4}{5} +}{ % Transversal edges + \pmdEmpty +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree=5 +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} + {4}{5} +}{ % Transversal edges + \pmdEmpty +} + \end{minipage} + \end{minipage}% +\end{center} + +\subsection{Draw commands} + +This package has three draw commands. + +\DescribeMacro{\pmdBrick} +draws a brick and has the syntax \verb`\pmdBrick<brick>`. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5 +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} + {4}{5} +}{ % Transversal edges + \pmdEmpty +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree=5 +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} + {4}{5} +}{ % Transversal edges + \pmdEmpty +} + \end{minipage} + \end{minipage}% +\end{center} + +\DescribeMacro{\pmdDiagram} +draws arbitrarily many bricks separated by dots and has the syntax +\begin{verbatim} +\pmdDiagram[<options>]{<bricks>} +\end{verbatim} +where +\DescribeMacro{diagram/<options>} +the \texttt{<options>} are described in Section~\ref{sec: diagram/options} and +\DescribeMacro{<bricks>} +\texttt{<bricks>} is a list of \texttt{<brick>}-s, with each brick enclosed in curly brackets. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=2, + brace={ + left=1, + right=4, + label={n} + } + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + }{ % Brick 2 + [ % Options + degree=1 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + } + } +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=2, + brace={ + left=1, + right=4, + label={n} + } + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + }{ % Brick 2 + [ % Options + degree=1 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + } + } +} +\end{center} + +It should be noted that \verb`\pmdBrick` is simply a wrapper for a single brick that calls \verb`\pmdDiagram` with no diagram options. This means that, for example, the \texttt{grid} key is not available for \verb`\pmdBrick` and \verb`\pmdDiagram` must be used instead to access the \texttt{grid} key. + +For edges that go across multiple bricks, know that the coordinate positions of the vertices extends infinitely in both directions. If using default settings, the dots between bricks occupies one vertex position. To help with counting and identifying the correct coordinate position, the \texttt{grid} flag may also be used, see Section~\ref{sec: diagram/options all}. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=3, + brace={ + left=2, + right=6, + label={n} + } + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{6} + {3}{5} + } + }{ % Brick 2 + [ % Options + degree=2 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{-1} + {2}{-2} + } + } +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=3, + brace={ + left=2, + right=6, + label={n} + } + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{6} + {3}{5} + } + }{ % Brick 2 + [ % Options + degree=2 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{-1} + {2}{-2} + } + } +} +\end{center} + +\DescribeMacro{\pmdProduct} +draws two diagrams on top of each other as is the case during multiplication or concatenation and has the syntax +\begin{verbatim} +\pmdProduct[<options>]{<Aedges>}{<Tbricks>}{<Bbricks>} +\end{verbatim} +where +\DescribeMacro{diagram/<options>} +the \texttt{<options>} are described in Section~\ref{sec: diagram/options}. + +\DescribeMacro{<Aedges>} +is a list of edges that are added during the concatenation process. An added edge has two components, namely \texttt{<Aedges>~=~\{<Svertex>\}\{<Tvertex>\}}, where \texttt{\{<Svertex>\}} is the starting vertex and \texttt{\{<Tvertex>\}} is the terminating vertex of the collection of added edges. Both \texttt{\{<Svertex>\}} and \texttt{\{<Tvertex>\}} are a \( x \)-coordinate and it is assumed that \( \texttt{\{<Svertex>\}} < \texttt{\{<Tvertex>\}} \). + +\DescribeMacro{<Tbricks>} +is a list of bricks that correspond to the top diagram, with each brick enclosed in curly brackets. + +\DescribeMacro{<Bbricks>} +is a list of bricks that correspond to the bottom diagram, with each brick enclosed in curly brackets. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdProduct{ % Added edges + {1}{5} + {7}{8} +}{ % Top diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + {3}{3} + {4}{4} + {5}{5} + } + }{ % Brick 2 + [ % Options + degree=2 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + } +}{ % Bottom diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + {2}{3} + {4}{5} + }{ % Lower non-transversal edges + {2}{3} + {4}{5} + }{ % Transversal edges + {1}{1} + } + }{ % Brick 2 + [ % Options + degree=2 + ]{ % Upper non-transversal edges + {1}{2} + }{ % Lower non-transversal edges + {1}{2} + }{ % Transversal edges + \pmdEmpty + } + } +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdProduct{ % Added edges + {1}{5} + {7}{8} +}{ % Top diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + {3}{3} + {4}{4} + {5}{5} + } + }{ % Brick 2 + [ % Options + degree=2 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + } +}{ % Bottom diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + {2}{3} + {4}{5} + }{ % Lower non-transversal edges + {2}{3} + {4}{5} + }{ % Transversal edges + {1}{1} + } + }{ % Brick 2 + [ % Options + degree=2 + ]{ % Upper non-transversal edges + {1}{2} + }{ % Lower non-transversal edges + {1}{2} + }{ % Transversal edges + \pmdEmpty + } + } +} +\end{center} + +\subsection{Brick options} \label{sec: brick/options} + +The following are all of the keys that are available for bricks. + +\subsubsection{Vertex options} + +\DescribeMacro{degree} +specifies the degree, that is, the number of vertices in the top and bottom row of the diagram. Must be a positive integer and must be provided unless using \texttt{degree top} and \texttt{degree bottom}. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5 +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree=5 +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} + \end{minipage} + \end{minipage}% +\end{center} + +\DescribeMacro{degree top} \DescribeMacro{degree bottom} +specifies the degree, that is, the number of vertices in the top (bottom) row of the diagram. Must be a positive integer and must be provided as a pair \texttt{degree top} and \texttt{degree bottom}. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree top=5, + degree bottom=4 +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree top=5, + degree bottom=4 +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} + \end{minipage} + \end{minipage}% +\end{center} + +\DescribeMacro{blank top} \DescribeMacro{blank bottom} +specifies the number of blank vertices to the left of the top (bottom) row of the diagram. Default is zero. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + blank top=1, + degree top=4, + degree bottom=5 +]{ % Upper non-transversal edges + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {3}{4} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + blank top=1, + degree top=4, + degree bottom=5 +]{ % Upper non-transversal edges + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {3}{4} +} + \end{minipage} + \end{minipage}% +\end{center} + +It should also be noted that the \texttt{blank top} and \texttt{blank bottom} can also be used to create more space between bricks and the dots between bricks by setting a large number. Likewise if set to \( -1 \) and the dots is redefined to not draw, the space between bricks can be removed altogether. See Examples~13-15. + +\DescribeMacro{row sep} +specifies the vertical separation between rows of vertices. Default is two. If using edge options such as \texttt{levels}, \texttt{row sep} must be given before \texttt{levels}. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5, + row sep=4 +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree=5, + row sep=4 +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} + \end{minipage} + \end{minipage}% +\end{center} + +\DescribeMacro{vertices} +passes through options to the \verb`\draw` command of vertices. The default is no argument. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5, + vertices=blue +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree=5, + vertices=blue +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} + \end{minipage} + \end{minipage}% +\end{center} + +\DescribeMacro{no vertex bottom 1} +\DescribeMacro{ \vdots} +\DescribeMacro{no vertex bottom 9} +\DescribeMacro{no vertex top 1} +\DescribeMacro{ \vdots} +\DescribeMacro{no vertex top 9} +specifies a vertex that is not drawn. Any of the nine available keys can be used in any order. It can be used to draw single vertices that are different to the others. If more than nine vertices need to be excluded, simply draw multiple bricks next to each other. The default is no argument. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5, + no vertex top 1=2, + no vertex top 2=3, + no vertex bottom 1=4, + decorate after={ + \fill[red] (4,0) circle (.1); + } +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdBrick[ % Options + degree=5, + no vertex top 1=2, + no vertex top 2=3, + no vertex bottom 1=4, + decorate after={ + \fill[red] (4,0) circle (.1); + } +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{center} + +\DescribeMacro{vertices options} +allows for the redefinition of the command that draws the vertices. It has two arguments, the \( x \) and \( y \)-position of the vertex. The default is +\begin{verbatim} +\fill[apply style/.expand once=\pmdraw@drawVertexOptions] (#1,#2) circle (.17); +\end{verbatim} +An example use is +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5, + vertices options={ + \draw[very thick] (#1,#2) circle (.25); + } +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdBrick[ % Options + degree=5, + vertices options={ + \draw[very thick] (#1,#2) circle (.25); + } +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{center} + +\DescribeMacro{labels}\DescribeMacro{labels top}\DescribeMacro{labels bottom} +flags that allow for the drawing of labels for the vertices. Use \texttt{labels} for labels on both the top and bottom or set individually. The default is no labels. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5, + labels bottom +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree=5, + labels bottom +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} + \end{minipage} + \end{minipage}% +\end{center} + +\DescribeMacro{labels start}\DescribeMacro{labels top start}\DescribeMacro{labels bottom start} +sets the starting value of the labels for the vertices. The default is one. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5, + labels, + labels top start=3, + labels bottom start=-2 +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree=5, + labels, + labels top start=3, + labels bottom start=-2 +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} + \end{minipage} + \end{minipage}% +\end{center} + +\DescribeMacro{no labels bottom 1} +\DescribeMacro{ \vdots} +\DescribeMacro{no labels bottom 9} +\DescribeMacro{no labels top 1} +\DescribeMacro{ \vdots} +\DescribeMacro{no labels top 9} +specifies a vertex for which no label is drawn. Any of the nine available keys can be used in any order. It can be used to insert single unique labels that are different to the others. If more than nine labels need to be excluded, simply draw multiple bricks next to each other. The default is no argument. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5, + labels, + no label top 1=2, + no label top 2=3, + no label bottom 1=4, + decorate after={ + \draw (3,2) node[above=6pt,red] {\(x\)}; + } +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdBrick[ % Options + degree=5, + labels, + no label top 1=2, + no label top 2=3, + no label bottom 1=4, + decorate after={ + \draw (3,2) node[above=6pt,red] {\(x\)}; + } +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{center} + +\DescribeMacro{labels top draw}\DescribeMacro{labels top node}\DescribeMacro{labels bottom draw}\DescribeMacro{labels bottom node} +passes through options to the \verb`\draw` and \verb`node` command of the labels of vertices. The default is no argument. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5, + labels, + labels top node=red, + labels bottom node={right=2pt} +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdBrick[ % Options + degree=5, + labels, + labels top node=red, + labels bottom node={right=2pt} +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{center} + +\DescribeMacro{labels top options}\DescribeMacro{labels bottom options} +allows for the redefinition of the command that draws the labels of the vertices. They have three arguments, the \( x \) and \( y \)-position of the vertex and the label value. The default for the top is +\begin{verbatim} +\draw[apply style/.expand once=\pmdraw@drawLabelTDrawOptions] (#1,#2) + node[above=6pt,apply style/.expand once=\pmdraw@drawLabelTNodeOptions] {\(#3\)}; +\end{verbatim} +and for the bottom +\begin{verbatim} +\draw[apply style/.expand once=\pmdraw@drawLabelBDrawOptions] (#1,#2) + node[below=6pt,apply style/.expand once=\pmdraw@drawLabelBNodeOptions] {\(#3'\)}; +\end{verbatim} +An example use is +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5, + labels, + labels bottom options={ + \draw (#1,#2) node[below=6pt,blue] {\(#3''\)}; + } +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdBrick[ % Options + degree=5, + labels, + labels bottom options={ + \draw (#1,#2) node[below=6pt,blue] {\(#3''\)}; + } +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{center} + +\DescribeMacro{no dots} +The \texttt{no dots} flag removes the drawing of dots to the left of the current brick in diagrams. Default is to draw dots except for the first brick. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=2, + brace={ + left=1, + right=4, + label={n} + } + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + }{ % Brick 2 + [ % Options + degree=1, + no dots + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + } + } +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=2, + brace={ + left=1, + right=4, + label={n} + } + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + }{ % Brick 2 + [ % Options + degree=1, + no dots + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + } + } +} +\end{center} + + +\DescribeMacro{dots draw}\DescribeMacro{dots node} +passes through options to the \verb`\draw` and \verb`node` command of the dots. The default is no argument. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=2, + brace={ + left=1, + right=4, + label={n} + } + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + }{ % Brick 2 + [ % Options + degree=1, + dots node=red + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + } + } +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=2, + brace={ + left=1, + right=4, + label={n} + } + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + }{ % Brick 2 + [ % Options + degree=1, + dots node=red + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + } + } +} +\end{center} + +\DescribeMacro{vertices top phantom}\DescribeMacro{vertices bottom phantom} +These flags allow for all of the top or bottom vertices to be hidden using the \texttt{phantom} command. Simply wraps the vertex drawing macros with a \texttt{phantom} command. This hiding will also apply to the labels of that row (top or bottom) of vertices. To only hide a selected number of vertices, use seperate bricks. The default is false. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5, + vertices top phantom, +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree=5, + vertices top phantom +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} + \end{minipage} + \end{minipage}% +\end{center} + +\DescribeMacro{vertices top uncover}\DescribeMacro{vertices bottom uncover} +allows for all of the top or bottom vertices to be uncovered in a \texttt{beamer} presentation using the command \verb`\uncover<n->{text}`. Simply passes the slide uncover information \verb`<n->` to the embedded \texttt{uncover} command within the vertex drawing macros. This uncover will also apply to the labels of that row (top or bottom) of vertices. To only uncover a selected number of vertices, use seperate bricks. The default is~\texttt{1-}. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5, + vertices top uncover={2,4-7,9-}, + vertices bottom uncover={3-} +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree=5, + vertices top uncover={2,4-7,9-}, + vertices bottom uncover={3-} +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} + \end{minipage} + \end{minipage}% +\end{center} + + +\subsubsection{Edge options} + +These options should be read in conjunction with Section~\ref{sec: edge/options}. + +\DescribeMacro{levels} +specifies how many horizontal levels there are for non-transversal edges. Default is one. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5, + levels=3 +]{ % Upper non-transversal edges + [level=3]{1}{5} + [level=2]{1}{4} + [level=1]{2}{3} +}{ % Lower non-transversal edges + [level=3]{1}{5} + [level=2]{1}{4} + [level=1]{2}{3} +}{ % Transversal edges + \pmdEmpty +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree=5, + levels=3 +]{ % Upper non-transversal edges + [level=3]{1}{5} + [level=2]{1}{4} + [level=1]{2}{3} +}{ % Lower non-transversal edges + [level=3]{1}{5} + [level=2]{1}{4} + [level=1]{2}{3} +}{ % Transversal edges + \pmdEmpty +} + \end{minipage} + \end{minipage}% +\end{center} + +\DescribeMacro{levels top} \DescribeMacro{levels bottom} +specifies how many horizontal levels there are for upper (lower) non-transversal edges. Default is one. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5, + levels top=3, + levels bottom=2 +]{ % Upper non-transversal edges + [level=3]{1}{5} + [level=2]{1}{4} + [level=1]{2}{3} +}{ % Lower non-transversal edges + [level=2]{1}{4} + [level=1]{2}{3} +}{ % Transversal edges + \pmdEmpty +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree=5, + levels top=3, + levels bottom=2 +]{ % Upper non-transversal edges + [level=3]{1}{5} + [level=2]{1}{4} + [level=1]{2}{3} +}{ % Lower non-transversal edges + [level=2]{1}{4} + [level=1]{2}{3} +}{ % Transversal edges + \pmdEmpty +} + \end{minipage} + \end{minipage}% +\end{center} + +\DescribeMacro{levels sep} +specifies the vertical separation between horizontal levels for non-transversal edges. Default is evenly spaced within the space available for the given number of \texttt{levels}. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5, + levels=3, + levels sep=0.3 +]{ % Upper non-transversal edges + [level=3]{1}{5} + [level=2]{1}{4} + [level=1]{2}{3} +}{ % Lower non-transversal edges + [level=3]{1}{5} + [level=2]{1}{4} + [level=1]{2}{3} +}{ % Transversal edges + \pmdEmpty +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree=5, + levels=3, + levels sep=0.3 +]{ % Upper non-transversal edges + [level=3]{1}{5} + [level=2]{1}{4} + [level=1]{2}{3} +}{ % Lower non-transversal edges + [level=3]{1}{5} + [level=2]{1}{4} + [level=1]{2}{3} +}{ % Transversal edges + \pmdEmpty +} + \end{minipage} + \end{minipage}% +\end{center} + +\DescribeMacro{levels sep top} \DescribeMacro{levels sep bottom} +specifies the vertical separation between horizontal levels for upper (lower) non-transversal edges. Default is evenly spaced within the space available for the given number of \texttt{levels}. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5, + levels=3, + levels sep top=0.4, + levels sep bottom=0.15 +]{ % Upper non-transversal edges + [level=3]{1}{5} + [level=2]{1}{4} + [level=1]{2}{3} +}{ % Lower non-transversal edges + [level=3]{1}{5} + [level=2]{1}{4} + [level=1]{2}{3} +}{ % Transversal edges + \pmdEmpty +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree=5, + levels=3, + levels sep top=0.4, + levels sep bottom=0.15 +]{ % Upper non-transversal edges + [level=3]{1}{5} + [level=2]{1}{4} + [level=1]{2}{3} +}{ % Lower non-transversal edges + [level=3]{1}{5} + [level=2]{1}{4} + [level=1]{2}{3} +}{ % Transversal edges + \pmdEmpty +} + \end{minipage} + \end{minipage}% +\end{center} + +\DescribeMacro{edges}\DescribeMacro{edges non-transversal}\DescribeMacro{edges upper}\DescribeMacro{edges lower}\DescribeMacro{edges transversal} +pass through options to the \verb`\draw` command of their respective edge types. The default is no argument. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5, + edges upper=blue, + edges lower={red, dotted, very thick}, + edges transversal=dashed +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdBrick[ % Options + degree=5, + edges upper=blue, + edges lower={red, dotted, very thick}, + edges transversal=dashed +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{center} + +\DescribeMacro{edges first} +flag ensures edges are drawn before vertices. The default is vertices are drawn first. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5, + edges lower={red, very thick}, + edges first +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree=5, + edges lower={red, very thick}, + edges first +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} + \end{minipage} + \end{minipage}% +\end{center} + +\DescribeMacro{transversals first} +flag ensures transversal edges are drawn before non-transversal edges. The default is non-transversal edges are drawn first. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5, + edges lower={red, very thick}, + transversals first +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree=5, + edges lower={red, very thick}, + transversals first +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} + \end{minipage} + \end{minipage}% +\end{center} + +\DescribeMacro{edges phantom} +This flag allows for all edges to be hidden using the \texttt{phantom} command. Simply wraps the edge drawing macros with a \texttt{phantom} command. The default is false. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5, + edges phantom +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree=5, + edges phantom +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} + \end{minipage} + \end{minipage}% +\end{center} + +\DescribeMacro{edges uncover} +allows for all edges to be uncovered in a \texttt{beamer} presentation using the command \verb`\uncover<n->{text}`. Simply passes the slide uncover information \verb`<n->` to the embedded \texttt{uncover} command within the edge drawing macros. The default is~\texttt{1-}. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5, + edges uncover={2,4-7,9-} +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree=5, + edges uncover={2,4-7,9-} +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} + \end{minipage} + \end{minipage}% +\end{center} + +\subsubsection{Brace} + +\DescribeMacro{brace} +specifies instructions for the drawing of a brace with the brace keys. These are described in Section~\ref{sec: brace}. The default is no brace is drawn. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=2, + brace={ + left=1, + right=4, + label={n} + } + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + }{ % Brick 2 + [ % Options + degree=1 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + } + } +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=2, + brace={ + left=1, + right=4, + label={n} + } + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + }{ % Brick 2 + [ % Options + degree=1 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + } + } +} +\end{center} + +\DescribeMacro{brace draw}\DescribeMacro{brace node} +passes through options to the \verb`\draw` and \verb`node` command of the brace. Must be given before the \texttt{brace} key. The default is no argument. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=2, + brace draw=thin, + brace node={pos=0.25}, + brace={ + left=1, + right=4, + label={n} + } + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + }{ % Brick 2 + [ % Options + degree=1 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + } + } +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=2, + brace draw=thin, + brace node={pos=0.25}, + brace={ + left=1, + right=4, + label={n} + } + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + }{ % Brick 2 + [ % Options + degree=1 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + } + } +} +\end{center} + +\subsubsection{Decorations} + +\DescribeMacro{decorate before}\DescribeMacro{decorate after} +provides a hook to draw additional \texttt{tikz} elements before and after the brick is drawn. The default is empty. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5, + decorate after={ + \draw[ + very thick, + red, + rounded corners=5pt + ] (0.6, -0.4) rectangle (1.4, 2.4); + } +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdBrick[ % Options + degree=5, + decorate after={ + \draw[ + very thick, + red, + rounded corners=5pt + ] (0.6, -0.4) rectangle (1.4, 2.4); + } +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{center} + +These hooks can also be used for more sophisticated manipulation of diagrams be inserting not just \texttt{tikz} elements but arbitrary code before and after draw a brick. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=4 + ]{ % Upper non-transversal edges + {2}{3} + }{ % Lower non-transversal edges + {2}{3} + }{ % Transversal edges + {1}{1} + {4}{4} + } + }{ % Brick 2 + [ % Options + degree=3, + decorate before={\begin{scope}[red,shift={(1,1)},rotate=30]}, + decorate after={\end{scope}} + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{2} + {2}{3} + {3}{1} + } + } +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=4 + ]{ % Upper non-transversal edges + {2}{3} + }{ % Lower non-transversal edges + {2}{3} + }{ % Transversal edges + {1}{1} + {4}{4} + } + }{ % Brick 2 + [ % Options + degree=3, + decorate before={\begin{scope}[red,shift={(1,1)},rotate=30]}, + decorate after={\end{scope}} + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{2} + {2}{3} + {3}{1} + } + } +} +\end{center} + +\subsubsection{Drawing order} \label{sec: order} + +For clarity, this is the default drawing order for a brick: +\begin{enumerate} + \item \texttt{decorate before} + \item Top row of vertices + \item Bottom row of vertices + \item Upper non-transversal edges + \item Lower non-transversal edges + \item Transversal edges + \item \texttt{decorate after} +\end{enumerate} + +This order can be altered using the \texttt{edges first} and \texttt{transversals first} flags. + +For the drawing order of a diagram and product diagram, see the \texttt{decorate before} and \texttt{decorate after} keys in Section~\ref{sec: diagram/options all}. + +\subsection{Edge options} \label{sec: edge/options} + +\subsubsection{Non-transversal edge options} \label{sec: NT edge/options} + +\DescribeMacro{level} +specifies the horizontal level of a non-transversal edges. Default is one. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5, + levels=3 +]{ % Upper non-transversal edges + [level=3]{1}{5} + [level=2]{1}{4} + [level=1]{2}{3} +}{ % Lower non-transversal edges + [level=3]{1}{5} + [level=2]{1}{4} + [level=1]{2}{3} +}{ % Transversal edges + \pmdEmpty +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree=5, + levels=3 +]{ % Upper non-transversal edges + [level=3]{1}{5} + [level=2]{1}{4} + [level=1]{2}{3} +}{ % Lower non-transversal edges + [level=3]{1}{5} + [level=2]{1}{4} + [level=1]{2}{3} +}{ % Transversal edges + \pmdEmpty +} + \end{minipage} + \end{minipage}% +\end{center} + +\DescribeMacro{height} +specifies a manually set horizontal height of a non-transversal edges. Default is to use levels. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5 +]{ % Upper non-transversal edges + {1}{5} + [height=1.75]{1}{4} +}{ % Lower non-transversal edges + [height=1.25]{1}{5} + {1}{4} +}{ % Transversal edges + \pmdEmpty +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree=5 +]{ % Upper non-transversal edges + {1}{5} + [height=1.75]{1}{4} +}{ % Lower non-transversal edges + [height=1.25]{1}{5} + {1}{4} +}{ % Transversal edges + \pmdEmpty +} + \end{minipage} + \end{minipage}% +\end{center} + +\DescribeMacro{edge draw} +passes through options to the \verb`\draw` command of the edge. The default is no argument. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5 +]{ % Upper non-transversal edges + {1}{2} + [edge draw=red]{2}{3} + {4}{5} + }{ % Lower non-transversal edges + [edge draw=dotted]{1}{2} + {3}{4} +}{ % Transversal edges + \pmdEmpty +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree=5 +]{ % Upper non-transversal edges + {1}{2} + [edge draw=red]{2}{3} + {4}{5} +}{ % Lower non-transversal edges + [edge draw=dotted]{1}{2} + {3}{4} +}{ % Transversal edges + \pmdEmpty +} + \end{minipage} + \end{minipage}% +\end{center} + +\DescribeMacro{options} +allows for the redefinition of the command that draws the non-transversal edge. It has two arguments, the start and end \( x \)-position of the edge. The default for an upper non-transversal is +\begin{verbatim} + \draw[apply style/.expand once=\pmdraw@drawUedgesDrawOptions, + apply style/.expand once=\pmdraw@drawEdgeDrawOptions] + (#1,\pmdraw@rowSep) arc (180:270:\pmdraw{edgeHeight});% Draw left arch + \draw[apply style/.expand once=\pmdraw@drawUedgesDrawOptions, + apply style/.expand once=\pmdraw@drawEdgeDrawOptions] + (#1+\pmdraw{edgeHeight},\pmdraw@rowSep-\pmdraw{edgeHeight}) + -- (#2-\pmdraw{edgeHeight},\pmdraw@rowSep-\pmdraw{edgeHeight}); + % Draw straight line + \draw[apply style/.expand once=\pmdraw@drawUedgesDrawOptions, + apply style/.expand once=\pmdraw@drawEdgeDrawOptions] + (#2-\pmdraw{edgeHeight},\pmdraw@rowSep-\pmdraw{edgeHeight}) + arc (270:360:\pmdraw{edgeHeight});% Draw right arc + \renewcommand{\pmdraw@drawEdgeDrawOptions}{}% Reset draw options for edge +\end{verbatim} +and for a lower non-transversal +\begin{verbatim} + \draw[apply style/.expand once=\pmdraw@drawLedgesDrawOptions, + apply style/.expand once=\pmdraw@drawEdgeDrawOptions] + (#1,0) arc (180:90:\pmdraw{edgeHeight});% Draw left arch + \draw[apply style/.expand once=\pmdraw@drawLedgesDrawOptions, + apply style/.expand once=\pmdraw@drawEdgeDrawOptions] + (#1+\pmdraw{edgeHeight},\pmdraw{edgeHeight}) + -- (#2-\pmdraw{edgeHeight},\pmdraw{edgeHeight});% Draw straight line + \draw[apply style/.expand once=\pmdraw@drawLedgesDrawOptions, + apply style/.expand once=\pmdraw@drawEdgeDrawOptions] + (#2-\pmdraw{edgeHeight},\pmdraw{edgeHeight}) + arc (90:0:\pmdraw{edgeHeight});% Draw right arc + \renewcommand{\pmdraw@drawEdgeDrawOptions}{}% Reset draw options for edge +\end{verbatim} +An example use is +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5 +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + [options={ + \draw[blue, very thick] (#1,0) -- (#2,0); + }]{1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdBrick[ % Options + degree=5 +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + [options={ + \draw[blue, very thick] (#1,0) -- (#2,0); + }]{1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{center} + +\DescribeMacro{phantom} +This flag allows for the edge to be hidden using the \texttt{phantom} command. Simply wraps the edge drawing macros with a \texttt{phantom} command. The default is false. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5 +]{ % Upper non-transversal edges + [phantom]{1}{2} + {2}{5} +}{ % Lower non-transversal edges + [phantom]{1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree=5 +]{ % Upper non-transversal edges + [phantom]{1}{2} + {2}{5} +}{ % Lower non-transversal edges + [phantom]{1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} + \end{minipage} + \end{minipage}% +\end{center} + +\DescribeMacro{uncover} +allows for that edge to be uncovered in a \texttt{beamer} presentation using the command \verb`\uncover<n->{text}`. Simply passes the slide uncover information \verb`<n->` to the embedded \texttt{uncover} command within the edge drawing macros. This uncover is nested inside the \texttt{edges uncover} and hence the limitations of nested uncovers are present here. For example, an individual edge will not uncover until the \texttt{edges uncover} has been uncovered. In such instances only use individual uncovers for each edge. The default is~\texttt{1-}. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5 +]{ % Upper non-transversal edges + [uncover={2,4-7,9-}]{1}{2} + {2}{5} +}{ % Lower non-transversal edges + [uncover={3-}]{1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree=5 +]{ % Upper non-transversal edges + [uncover={2,4-7,9-}]{1}{2} + {2}{5} +}{ % Lower non-transversal edges + [uncover={3-}]{1}{2} + {3}{4} +}{ % Transversal edges + {1}{1} + {3}{4} +} + \end{minipage} + \end{minipage}% +\end{center} + +\subsubsection{Transversal edge options} \label{sec: T edge/options} + +\DescribeMacro{height} +draws transversal edges with a horizontal component and specifies the manually set horizontal height of the transversal edges. Default is to use non-horizontal transversal edges. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdDiagram{ + { % Brick 1 + [ % Options + degree top=5, + degree bottom=6 + ]{ % Upper non-transversal edges + {2}{3} + {4}{5} + }{ % Lower non-transversal edges + {3}{4} + {5}{6} + }{ % Transversal edges + [height=1]{10}{2} + {1}{1} + } + }{ % Brick 2 + [ % Options + degree top=3, + blank bottom=1, + degree bottom=2 + ]{ % Upper non-transversal edges + {1}{2} + }{ % Lower non-transversal edges + {2}{3} + }{ % Transversal edges + \pmdEmpty + } + } +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdDiagram{ + { % Brick 1 + [ % Options + degree top=5, + degree bottom=6 + ]{ % Upper non-transversal edges + {2}{3} + {4}{5} + }{ % Lower non-transversal edges + {3}{4} + {5}{6} + }{ % Transversal edges + [height=1]{10}{2} + {1}{1} + } + }{ % Brick 2 + [ % Options + degree top=3, + blank bottom=1, + degree bottom=2 + ]{ % Upper non-transversal edges + {1}{2} + }{ % Lower non-transversal edges + {2}{3} + }{ % Transversal edges + \pmdEmpty + } + } +} +\end{center} + +\DescribeMacro{edge draw} +passes through options to the \verb`\draw` command of the edge. The default is no argument. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5 +]{ % Upper non-transversal edges + {1}{2} + }{ % Lower non-transversal edges + {4}{5} + {3}{4} +}{ % Transversal edges + [edge draw=red]{1}{1} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree=5 +]{ % Upper non-transversal edges + {1}{2} +}{ % Lower non-transversal edges + {4}{5} + {3}{4} +}{ % Transversal edges + [edge draw=red]{1}{1} + {3}{2} + [edge draw=dashed]{4}{5} +} + \end{minipage} + \end{minipage}% +\end{center} + +\DescribeMacro{options} +allows for the redefinition of the command that draws the transversal edge. It has two arguments, the \( x \)-position of the edge in the top row of vertices and the \( x \)-position of the edge in the bottom row of vertices. The default is +\begin{verbatim} + \ifnum\pmdraw@ifTedgeHorizontal=0% If drawing a straight line edge + \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions, + apply style/.expand once=\pmdraw@drawEdgeDrawOptions] + (#1,\pmdraw@rowSep) -- (#2,0);% Draw straight line + \else% If transversal edge is drawn horizontally + \ifnum#1>#2% If edge goes from top right to bottom left + \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions, + apply style/.expand once=\pmdraw@drawEdgeDrawOptions] (#2,0) arc + (180:90:\pmdraw{Tlevel});% Draw bottom arch + \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions, + apply style/.expand once=\pmdraw@drawEdgeDrawOptions] + (#2+\pmdraw{Tlevel},\pmdraw{Tlevel}) -- + (#1-\pmdraw@rowSep+\pmdraw{Tlevel}, \pmdraw{Tlevel});% Draw straight line + \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions, + apply style/.expand once=\pmdraw@drawEdgeDrawOptions] + (#1-\pmdraw@rowSep+\pmdraw{Tlevel},\pmdraw{Tlevel}) arc + (270:360:{\pmdraw@rowSep-\pmdraw{Tlevel}});% Draw top arc + \else% If edge goes from top left to bottom right + \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions, + apply style/.expand once=\pmdraw@drawEdgeDrawOptions] + (#2,0) arc (0:90:\pmdraw{Tlevel});% Draw bottom arch + \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions, + apply style/.expand once=\pmdraw@drawEdgeDrawOptions] + (#2-\pmdraw{Tlevel},\pmdraw{Tlevel}) -- + (#1+\pmdraw@rowSep-\pmdraw{Tlevel}, \pmdraw{Tlevel});% Draw straight line + \draw[apply style/.expand once=\pmdraw@drawTedgesDrawOptions, + apply style/.expand once=\pmdraw@drawEdgeDrawOptions] + (#1+\pmdraw@rowSep-\pmdraw{Tlevel},\pmdraw{Tlevel}) arc + (270:180:{\pmdraw@rowSep-\pmdraw{Tlevel}});% Draw top arc + \fi% + \renewcommand{\pmdraw@ifTedgeHorizontal}{0}% Reset flag to default + \fi% + \renewcommand{\pmdraw@drawEdgeDrawOptions}{}% Reset draw options for edge +\end{verbatim} +An example use is +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdDiagram{ + { % Brick 1 + [ % Options + degree top=5, + degree bottom=6 + ]{ % Upper non-transversal edges + {2}{3} + {4}{5} + }{ % Lower non-transversal edges + {3}{4} + {5}{6} + }{ % Transversal edges + [options={ + \draw (#2,0) -- (#2+1,1); % Draw bottom line + \draw (#2+1,1) -- (#1-1, 1); % Draw straight line + \draw (#1-1,1) -- (#1,2); % Draw top line + }]{10}{2} + {1}{1} + } + }{ % Brick 2 + [ % Options + degree top=3, + blank bottom=1, + degree bottom=2 + ]{ % Upper non-transversal edges + {1}{2} + }{ % Lower non-transversal edges + {2}{3} + }{ % Transversal edges + \pmdEmpty + } + } +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdDiagram{ + { % Brick 1 + [ % Options + degree top=5, + degree bottom=6 + ]{ % Upper non-transversal edges + {2}{3} + {4}{5} + }{ % Lower non-transversal edges + {3}{4} + {5}{6} + }{ % Transversal edges + [options={ + \draw (#2,0) -- (#2+1,1); % Draw bottom line + \draw (#2+1,1) -- (#1-1, 1); % Draw straight line + \draw (#1-1,1) -- (#1,2); % Draw top line + }]{10}{2} + {1}{1} + } + }{ % Brick 2 + [ % Options + degree top=3, + blank bottom=1, + degree bottom=2 + ]{ % Upper non-transversal edges + {1}{2} + }{ % Lower non-transversal edges + {2}{3} + }{ % Transversal edges + \pmdEmpty + } + } +} +\end{center} + +\DescribeMacro{phantom} +This flag allows for the edge to be hidden using the \texttt{phantom} command. Simply wraps the edge drawing macros with a \texttt{phantom} command. The default is false. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5 +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + [phantom]{1}{1} + {3}{4} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree=5 +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + [phantom]{1}{1} + {3}{4} +} + \end{minipage} + \end{minipage}% +\end{center} + +\DescribeMacro{uncover} +allows for that edge to be uncovered in a \texttt{beamer} presentation using the command \verb`\uncover<n->{text}`. Simply passes the slide uncover information \verb`<n->` to the embedded \texttt{uncover} command within the edge drawing macros. This uncover is nested inside the \texttt{edges uncover} and hence the limitations of nested uncovers are present here. For example, an individual edge will not uncover until the \texttt{edges uncover} has been uncovered. In such instances only use individual uncovers for each edge. The default is~\texttt{1-}. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdBrick[ % Options + degree=5 +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + [uncover={2,4-7,9-}]{1}{1} + {3}{4} +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} +\pmdBrick[ % Options + degree=5 +]{ % Upper non-transversal edges + {1}{2} + {2}{5} +}{ % Lower non-transversal edges + {1}{2} + {3}{4} +}{ % Transversal edges + [uncover={2,4-7,9-}]{1}{1} + {3}{4} +} + \end{minipage} + \end{minipage}% +\end{center} + +\subsection{Brace} \label{sec: brace} + +\DescribeMacro{brick/brace} +As part of a diagram, it may be useful to draw a brace. The options of a brace are as follows: + +\DescribeMacro{left}\DescribeMacro{right} +specifies the \( x \)-position of the start/left and end/right of the brace. Both must be provided. + +\DescribeMacro{label} +specifies the label to be printed with the brace. Default is empty. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=2, + brace={ + left=1, + right=4, + label={n} + } + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + }{ % Brick 2 + [ % Options + degree=1 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + } + } +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=2, + brace={ + left=1, + right=4, + label={n} + } + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + }{ % Brick 2 + [ % Options + degree=1 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + } + } +} +\end{center} + +\DescribeMacro{above} +The \texttt{above} flag draws the brace above the diagram. Default is below. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=2, + brace={ + left=1, + right=4, + label={n}, + above + } + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + }{ % Brick 2 + [ % Options + degree=1 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + } + } +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=2, + brace={ + left=1, + right=4, + label={n}, + above + } + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + }{ % Brick 2 + [ % Options + degree=1 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + } + } +} +\end{center} + +\DescribeMacro{options} +allows for the redefinition of the command that draws the brace. It has three arguments, the \( x \)-position start and end of the brace, as well as the label of the brace. The default is +\begin{verbatim} + \ifnum\pmdraw@ifProdDiag=1 % If drawing a product diagram + % or if placing brace above diagram + \draw[ + very thick, + decorate, + decoration={calligraphic brace,amplitude=6pt}, + apply style/.expand once=\pmdraw@drawBraceDrawOptions + ] (#1-0.17,\pmdraw@rowSep+0.5) -- (#2+0.17,\pmdraw@rowSep+0.5) + node[ + pos=0.5, + above=6pt, + apply style/.expand once=\pmdraw@drawBraceNodeOptions + ] {\(#3\)}; % Draw brace on top of diagram + \else % If not drawing a product diagram or if placing brace below diagram + \draw[ + very thick, + decorate, + decoration={calligraphic brace,mirror,amplitude=6pt}, + apply style/.expand once=\pmdraw@drawBraceDrawOptions + ] (#1-0.17,-0.5) -- (#2+0.17,-0.5) + node[ + pos=0.5, + below=6pt, + apply style/.expand once=\pmdraw@drawBraceNodeOptions + ] {\(#3\)}; % Draw brace on bottom of diagram + \fi% +\end{verbatim} +it should be noted that the flag \verb`\pmdraw@ifProdDiag` is both used for when drawing a product diagram but also when placing the brace above the diagram as this clearly must be the default for the top diagram in a product diagram. +An example use is +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=2, + brace={ + left=1, + right=4, + label={n}, + options={ + \draw[ + red, + very thick, + decorate, + decoration={calligraphic brace,mirror,amplitude=6pt} + ] (#1-0.17,-0.5) -- (#2+0.17,-0.5) + node[pos=0.25,below=6pt]{\(#3\)}; + } + } + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + }{ % Brick 2 + [ % Options + degree=1 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + } + } +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdDiagram{ + { % Brick 1 + [ % Options + degree=2, + brace={ + left=1, + right=4, + label={n}, + options={ + \draw[ + red, + very thick, + decorate, + decoration={calligraphic brace,mirror,amplitude=6pt} + ] (#1-0.17,-0.5) -- (#2+0.17,-0.5) + node[pos=0.25,below=6pt]{\(#3\)}; + } + } + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + }{ % Brick 2 + [ % Options + degree=1 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + } + } +} +\end{center} + +\subsection{Diagram options} \label{sec: diagram/options} + +\subsubsection{For all (product) diagrams} \label{sec: diagram/options all} + +The following options can be used for both diagrams (\verb`\pmdDiagram`) and product diagrams (\verb`\pmdProduct`). + +\DescribeMacro{row sep} +same as \texttt{row sep} option in bricks but applied to all bricks within (product) diagram. + +\DescribeMacro{tikz} +passes through options to \texttt{tikz} environment. Specifically, the options in \verb`\begin{tikzpicture}[<options>]`. The default is no argument. However there are some default options passed to \texttt{tikz} automatically. These are an adjustment to the \texttt{baseline} depending on the current typesetting mode and a \texttt{grid} key if the grid is activated. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdDiagram[ % Options + tikz={scale=2} +]{ + { % Brick 1 + [ % Options + degree=2, + brace={ + left=1, + right=4, + label={n} + } + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + }{ % Brick 2 + [ % Options + degree=1 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + } + } +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdDiagram[ % Options + tikz={scale=2} +]{ + { % Brick 1 + [ % Options + degree=2, + brace={ + left=1, + right=4, + label={n} + } + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + }{ % Brick 2 + [ % Options + degree=1 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + } + } +} +\end{center} + +\DescribeMacro{dots options} +allows for the redefinition of the command that draws dots between bricks. It has two arguments, the \( x \) and \( y \)-position of the dots. The default is +\begin{verbatim} + \draw[apply style/.expand once=\pmdraw@drawDotsDrawOptions] + (#1,#2) node[apply style/.expand once=\pmdraw@drawDotsNodeOptions] {\(\dots\)}; +\end{verbatim} +An example use is +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdDiagram[ % Options + dots options={ + \draw[red] (#1,#2) node {\(\dots\dots\)}; + } +]{ + { % Brick 1 + [ % Options + degree=2, + brace={ + left=1, + right=5, + label={n} + } + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + }{ % Brick 2 + [ % Options + degree=1, + blank top=1, + blank bottom=1 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {2}{2} + } + } +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdDiagram[ % Options + dots options={ + \draw[red] (#1,#2) node {\(\dots\dots\)}; + } +]{ + { % Brick 1 + [ % Options + degree=2, + brace={ + left=1, + right=5, + label={n} + } + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + } + }{ % Brick 2 + [ % Options + degree=1, + blank top=1, + blank bottom=1 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {2}{2} + } + } +} +\end{center} + +\DescribeMacro{grid} +As it can get confusing where things are drawn and the different coordinate scopes between all the bricks and diagrams, the \texttt{grid} flag draws the base coordinate grid that the first drawn brick is based on. This should help with all coordinate related inquiries. Default is no grid. + +It should be noted that the \texttt{grid} key is not available for \verb`\pmdBrick` and \verb`\pmdDiagram` must be used instead when needing a grid for a single brick only. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdDiagram[ % Options + grid +]{ + { % Brick 1 + [ % Options + degree top=5, + degree bottom=6, + ]{ % Upper non-transversal edges + {2}{3} + {4}{5} + }{ % Lower non-transversal edges + {3}{4} + {5}{6} + }{ % Transversal edges + [height=1]{10}{2} + {1}{1} + } + }{ % Brick 2 + [ % Options + degree top=3, + blank bottom=1, + degree bottom= + ]{ % Upper non-transversal edges + {1}{2} + }{ % Lower non-transversal edges + {2}{3} + }{ % Transversal edges + \pmdEmpty + } + } +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdDiagram[ % Options + grid +]{ + { % Brick 1 + [ % Options + degree top=5, + degree bottom=6 + ]{ % Upper non-transversal edges + {2}{3} + {4}{5} + }{ % Lower non-transversal edges + {3}{4} + {5}{6} + }{ % Transversal edges + [height=1]{10}{2} + {1}{1} + } + }{ % Brick 2 + [ % Options + degree top=3, + blank bottom=1, + degree bottom=2 + ]{ % Upper non-transversal edges + {1}{2} + }{ % Lower non-transversal edges + {2}{3} + }{ % Transversal edges + \pmdEmpty + } + } +} +\end{center} + +\DescribeMacro{decorate before}\DescribeMacro{decorate after} +same as \texttt{decorate before} and \texttt{decorate after} in bricks but these are drawn before (after) all bricks are drawn. For clarity, this is default drawing order for a diagram: +\begin{enumerate} + \item \texttt{diagram/decorate before} + \item Brick loop: + \begin{enumerate} + \item \texttt{brick/decorate before} + \item Draws brick + \item \texttt{brick/decorate after} + \end{enumerate} + \item \texttt{diagram/decorate after} +\end{enumerate} +And this is default drawing order for a product diagram: +\begin{enumerate} + \item \texttt{diagram/decorate before} + \item Draws added edges + \item Top diagram: + \begin{enumerate} + \item Brick loop: + \begin{enumerate} + \item \texttt{brick/decorate before} + \item Draws brick + \item \texttt{brick/decorate after} + \end{enumerate} + \end{enumerate} + \item Bottom diagram: + \begin{enumerate} + \item Brick loop: + \begin{enumerate} + \item \texttt{brick/decorate before} + \item Draws brick + \item \texttt{brick/decorate after} + \end{enumerate} + \end{enumerate} + \item \texttt{diagram/decorate after} +\end{enumerate} + +For the drawing order of a brick see Section~\ref{sec: order}. + +\subsubsection{For product diagrams only} + +The following options can only be used for product diagrams (\verb`\pmdProduct`). + +\DescribeMacro{diagram sep} +specifies the vertical separation between the bottom row of vertices in top diagram and the top row of vertices in bottom diagram. Also controls the length of the added edges. Default is one. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdProduct[ % Options + diagram sep=2 +]{ % Added edges + {1}{5} +}{ % Top diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + {3}{3} + {4}{4} + {5}{5} + } + } +}{ % Bottom diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + {2}{3} + {4}{5} + }{ % Lower non-transversal edges + {2}{3} + {4}{5} + }{ % Transversal edges + {1}{1} + } + } +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdProduct[ % Options + diagram sep=2 +]{ % Added edges + {1}{5} +}{ % Top diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + {3}{3} + {4}{4} + {5}{5} + } + } +}{ % Bottom diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + {2}{3} + {4}{5} + }{ % Lower non-transversal edges + {2}{3} + {4}{5} + }{ % Transversal edges + {1}{1} + } + } +} +\end{center} + +\DescribeMacro{vertex sep} +increases the vertical separation between the bottom row of vertices in top diagram and the top row of vertices in bottom diagram without altering the length of the added edges. Useful for things when adjusting the \texttt{row sep} of the bottom diagram for example. Default is zero. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdProduct[ % Options + vertex sep=1 +]{ % Added edges + {1}{5} +}{ % Top diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + {3}{3} + {4}{4} + {5}{5} + } + } +}{ % Bottom diagram + { % Brick 1 + [ % Options + degree=5, + row sep=3 + ]{ % Upper non-transversal edges + {2}{3} + {4}{5} + }{ % Lower non-transversal edges + {2}{3} + {4}{5} + }{ % Transversal edges + {1}{1} + } + } +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdProduct[ % Options + vertex sep=1 +]{ % Added edges + {1}{5} +}{ % Top diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + {3}{3} + {4}{4} + {5}{5} + } + } +}{ % Bottom diagram + { % Brick 1 + [ % Options + degree=5, + row sep=3 + ]{ % Upper non-transversal edges + {2}{3} + {4}{5} + }{ % Lower non-transversal edges + {2}{3} + {4}{5} + }{ % Transversal edges + {1}{1} + } + } +} +\end{center} + +\DescribeMacro{edges added} +passes through options to the \verb`\draw` command of the added edges. The default is no argument. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdProduct[ % Options + edges added={red,very thick} +]{ % Added edges + {1}{5} +}{ % Top diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + {3}{3} + {4}{4} + {5}{5} + } + } +}{ % Bottom diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + {2}{3} + {4}{5} + }{ % Lower non-transversal edges + {2}{3} + {4}{5} + }{ % Transversal edges + {1}{1} + } + } +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdProduct[ % Options + edges added={red,very thick} +]{ % Added edges + {1}{5} +}{ % Top diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + {3}{3} + {4}{4} + {5}{5} + } + } +}{ % Bottom diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + {2}{3} + {4}{5} + }{ % Lower non-transversal edges + {2}{3} + {4}{5} + }{ % Transversal edges + {1}{1} + } + } +} +\end{center} + +\DescribeMacro{edges added phantom} +This flag allows for the added edges to be hidden using the \texttt{phantom} command. Simply wraps the edge drawing macros with a \texttt{phantom} command. The default is false. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdProduct[ % Options + edges added phantom +]{ % Added edges + {1}{5} +}{ % Top diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + {3}{3} + {4}{4} + {5}{5} + } + } +}{ % Bottom diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + {2}{3} + {4}{5} + }{ % Lower non-transversal edges + {2}{3} + {4}{5} + }{ % Transversal edges + {1}{1} + } + } +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdProduct[ % Options + edges added phantom +]{ % Added edges + {1}{5} +}{ % Top diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + {3}{3} + {4}{4} + {5}{5} + } + } +}{ % Bottom diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + {2}{3} + {4}{5} + }{ % Lower non-transversal edges + {2}{3} + {4}{5} + }{ % Transversal edges + {1}{1} + } + } +} +\end{center} + +\DescribeMacro{edges added uncover} +allows for the added edges to be uncovered in a \texttt{beamer} presentation using the command \verb`\uncover<n->{text}`. Simply passes the slide uncover information \verb`<n->` to the embedded \texttt{uncover} command within the added edge drawing macros. The default is~\texttt{1-}. +\begin{center} + \begin{minipage}{\dimexpr0.85\textwidth-2\fboxrule-2\fboxsep\relax} + \begin{minipage}[c]{0.4\linewidth} +\begin{verbatim} +\pmdProduct[ % Options + edges added uncover={2,4-7,9-} +]{ % Added edges + {1}{5} +}{ % Top diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + {3}{3} + {4}{4} + {5}{5} + } + } +}{ % Bottom diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + {2}{3} + {4}{5} + }{ % Lower non-transversal edges + {2}{3} + {4}{5} + }{ % Transversal edges + {1}{1} + } + } +} +\end{verbatim} + \end{minipage} + \hfill + \begin{minipage}[c]{0.4\linewidth} + \end{minipage} + \end{minipage}% +\end{center} +\begin{center} +\pmdProduct[ % Options + edges added uncover={2,4-7,9-} +]{ % Added edges + {1}{5} +}{ % Top diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + \pmdEmpty + }{ % Lower non-transversal edges + \pmdEmpty + }{ % Transversal edges + {1}{1} + {2}{2} + {3}{3} + {4}{4} + {5}{5} + } + } +}{ % Bottom diagram + { % Brick 1 + [ % Options + degree=5 + ]{ % Upper non-transversal edges + {2}{3} + {4}{5} + }{ % Lower non-transversal edges + {2}{3} + {4}{5} + }{ % Transversal edges + {1}{1} + } + } +} +\end{center} + +\section{Future features/work} + +I have attempted to make most use cases easy to use with dedicated functionality that does not require significant \LaTeX\ knowledge whilst at the same time provide more advanced interfaces to allow for hopefully almost complete customisability for those who put in the effort. + +Having said that, please do let me know if there are features or improvements you will like to see added. + +The following are some of the aims for the future for this package: +\begin{enumerate} + \item Fix bugs. + \item Add warning and error messages to log. + \item Allow all brick keys to work as diagram keys that apply to all bricks in a diagram. This will require setting up a flag for each key so that the diagram key sets the brick key but the brick key is not reset after drawing the first brick. This process also will need to be able to handle when a single brick has a custom special different key value and that this is reset to the digram key value and not the global default key value. + \item Allow appropriate diagram keys to work as brick keys. Notably the \texttt{grid} key. + \item The creation of user profiles that allows for fast and efficient setting of default key values that are different to the package defaults. Hence within a diagram, there can be a number of different diagram styles that can be accessed with one command. That is, in the options for a diagram, have this profile key. + \item Have global settings so that all diagrams in a document have the specified options. + \item Allow for adjusting the horizontal spacing of vertices. Need to think about making that a simple scale factor so that integer interface for edge positions is the same but then hooks will have very messy coordinates or keep it as absolute coordinates with messy edges. Alternatively, do both, allowing the user to choose which option to do and somehow distinguish between the two in the background. + \item Create \texttt{pmdMirror} command that mirrors all upper non-transversals into lower non-transversals. + \item Create \texttt{invert} key for bricks, diagrams and product diagrams that inverts everything. Probably easiest done with a \texttt{scope} environment around everything and \texttt{yscale=-1}. + \item For product diagram, have interface where you input diagram instead of bricks so that you have access to diagram options. + \item Create a transversal edge key \texttt{identity} so that all edges in between the two values are straight vertical edges. Thus eliminating the need to write out each edge manually. + \item Create \texttt{shift} key for edges that shifts horizontal position. + \item Decouple the uncover of labels from \texttt{vertices top uncover}/\texttt{vertices bottom uncover}. + \item Decouple the phantom of labels from \texttt{vertices top phantom}/\texttt{vertices bottom phantom}. +\end{enumerate} + +\section{Examples} + +This section is simply a collection of example diagrams. The code for them can be found in the \texttt{examples} folder. Perhaps you will find them useful as a starting point for your diagrams or to see what this package is capable of. + +\usetikzlibrary{patterns} + +\foreach \example in {1,...,25}{ + \paragraph{Example~\example} + \begin{center} + \input{examples/example-\example} + \end{center} +} + +\end{document}
\ No newline at end of file |