Non-Commutative Squares (NCSq) is a SATySFi package for drawing rectangular diagrams.
- Draw a rectangular diagram by specifying a matrix of cells. The layout of the source code is closed to the intended diagram.
- Arrows automatically stretch to match long labels and large objects.
- A variety of styles of arrow head, tail and body in arbitrary combination.
- Parallel arrows.
Using Satyrographos:
$ opam install satysfi-ncsq
$ opam install satysfi-ncsq-doc # for documentation
$ satyrographos install
In preamble:
@require: ncsq/ncsq
The NCSq
module provides a block command +cd
, an inline command \cd
, and a math command \cd-m
.
All of them receive a rectangular array of cells and draw a diagram.
+NCSq.cd(open NCSq in [
[object ${A}; arrow ?:${f} right; object ${B}];
[arrow ?*?:${g} down; empty; arrow ?:${h} down];
[object ${C}; arrow ?*?:${k} right; object ${D}];
]);
For such a simple diagram, a helper package ncsq/easy-cd
provides simpler syntax.
+EasyCD.cd[
${| A | f | B |};
${| g | | h |};
${| C | k | D |};
];
See docs/ncsq-example.saty for details and further examples.