tikzcd snippets for VS Code
For writing LaTeX documents, I use(d to use) VS Code together with the latex-workshop extension.
One thing I particularly like about VS Code is its built-in support for snippets and how easy it is to implement your own.
As there aren't any extensions in the marketplace providing snippets for commutative diagrams, I implemented some using tikz-cd on my own:
This is what using the snippets looks like:
Result:
I cycle through the preselected X, Y, S, T by pressing tab, which makes it very convenient to change the objects' names appearing in the diagram.
In case you want to try it for yourself, I packaged the whole thing and published it as the snippets-tikzcd extension.
To install the extension, simply go to File ⟶ Preferences ⟶ Extensions, search for snippets-tikzcd and install.
If you for some reason dislike using the marketplace, you can also find the plugin in the versions folder of this GitHub repository.
## supported diagrams
Here's the kinds of diagrams the extension currently supports:
- (pushout/pullback)
square trianglecube- (short/split/long) exact
sequenceand thesnake - equalizers and reflexive parallel
pair - (augmented) (co-)
simplicialobjects adjunctionand naturaltransformation
Read the above as trigger triggers the drop-down menu to select all the varieties of diagrams of shape trigger (as in the demo).
Note that, in the future, the above list might not be comprehensive anymore if I end up adding some other diagrams. I'll try to always keep the information on the overview page of the extension up-to-date.
## contributing
If you'd like to have other types of diagrams supported or have anything else to report, either contact me or submit a pull request at the GitHub repo.
Enjoy!