TikZ commutative diagram examples
Contents
Three diagrams: a universal property, the universal property of the tensor product (both from Martin Thoma) and the thermodynamic ensembles with the transforms between their potentials (from Janosh Riebesell). All three are drawn with plain TikZ nodes and arrows rather than with the tikz-cd package.
For new commutative diagrams, tikz-cd is usually simpler: you type the objects in a matrix and the arrows between them. See the commutative diagrams guide.
The figures

Thermodynamic ensembles and transforms
Commutative diagrams
MIT licence, © Janosh Riebesell and contributors · janosh/diagrams
Open in the TikZ editor
Commutative diagram: universal property
Commutative diagrams
MIT licence, © Martin Thoma · MartinThoma/LaTeX-examples
Open in the TikZ editor
Tensor product universal property
Commutative diagrams
MIT licence, © Martin Thoma · MartinThoma/LaTeX-examples
Open in the TikZ editor
Using these figures
Every figure keeps its own licence: MIT or CC0 1.0, both of which allow use, change and sharing, commercial use included. The MIT licence asks that its copyright and permission notice go with copies of the code, so each figure’s code starts with its source, author and licence; keep those lines when you reuse it. The full licence texts are on the sources and licences page.
“Open in the TikZ editor” loads the figure’s complete document into the free TikZ editor, where it is typeset with TeX Live 2026 and you can change it and download a PNG. To compile it on your own computer, save the code as a .tex file and run pdfLaTeX (or the engine the tile names) on it; LabCanvas changed the files only where needed to make each one compile on its own, as its first lines say.