Drawing the snake lemma
A quick tutorial by example.
I quite like the Wikipedia snake lemma figure. Let’s recreate it in Sagitta.
We’ll start by making each row of the diagram. SPC on an empty cell creates a vertex. If a vertex is already selected, SPC also draws an arrow from it to the new vertex. Pressing SPC and → alternately a few times gives a sequence of bullets. Let’s make four:
We could either fill in their labels now or wait until later.
One way is to hit TAB repeatedly, which cycles through the unlabelled vertices and arrows so that we can edit their labels.
If we didn’t use TAB cycling, we could select arrows for labelling by / plus whatever code the arrow got assigned (usually, the letters of its endpoints concatenated).
Here, the arrow we need to label \(g\) got assigned SD.
Next, ESC clears the selection, and we build the rest of the objects in rows.
When it’s time to connect the rows together, we clear our selection, press SPC on the source vertex, and then SPC on the target.
If we loaded a custom macros.tex file, we could’ve defined \coker as \operatorname{coker}, but for this quick example, we’ll write it directly.
With most everything but the connecting morphism done, we have:
Because we want our connecting morphism \(d\) to cut right through the middle of the diagram, we should move half the diagram down to clear some space. We’ll select the seven lower vertices with rectangle select: C-SPC on one corner and C-SPC on the opposite corner collect everything in between:
We could also use / with a space-separated list, or even hold Shift and move our cursor over each cell. Once everything is selected, C-↓ moves the whole selection down:
Now we’ll make the trickiest morphism of the diagram! Creating an arrow the usual way between \(\ker c\) and \(\operatorname{coker} a\) isn’t enough, since it’ll cut across the diagram centre inelegantly. We create the arrow, select it, and move the cursor two cells right of \(\ker c\). Hitting k adds that cell to the arrow’s route as a checkpoint (pressing k again would remove it).
We add the rest of the checkpoints the same way.
In the original Wikipedia image, the connecting morphism lies over the arrows in the middle. With the connecting morphism still selected, we can just hit x to let it cross over:
Nearly there, but the labels are all wonky: \(a\), \(b\), and \(c\) are hidden underneath the connecting morphism! We select each arrow in turn, hit P, and shift the label position along the arrow using the arrow keys. Let’s do the same for the connecting morphism, and make sure the label renders along the outside of the arrow by hitting A for label alignment and then r for right. Finally, we hide the grid with # and enjoy!
I’ll just save it to a file with C-s and put it in my very cool paper on the snake lemma.
There’s more complete documentation in the manual.
This walkthrough was written against Sagitta v0.4.1. Expect major changes until v1.0.0.