DiagramTeX Open DiagramTeX

DiagramTeX/tikz-cd editor

Commutative diagrams for LaTeX

tikz-cd editor: draw the diagram, copy the LaTeX

Type objects into a grid, drag arrows between them, then label, bend or restyle each arrow. DiagramTeX writes the tikz-cd code as you go, ready to paste into Overleaf or any LaTeX document.

Open the editor Open this example
The tikz-cd editor: objects and arrow styles on the left, a commutative cube with crossing arrows on a grid, and the tikz-cd code on the right
The tikz-cd editor: objects and arrow styles on the left, the diagram in the middle, the tikz-cd code on the right.

How to draw a commutative diagram

  1. Add a CD block: open DiagramTeX, click the cube on the left rail, pick CD and click the canvas. Double-click the block to open its editor.
  2. Add objects: select a cell and type its LaTeX, or drop one from the palette.
  3. Draw arrows: pick an arrow style in the palette, then drag from cell to cell.
  4. Label or bend an arrow: select it and use the panel. Add Label puts a second label on it; Reverse swaps its ends.
  5. Copy the code: press Done, then CtrlE (⌘E on a Mac) and Copy.

Example: A commutative cube with crossing arrows

This is the code DiagramTeX writes for the commutative diagram in the picture above. The first line names the packages to load.

tikz-cd snippetOpen it in DiagramTeX and edit it
% Requires: \usepackage{tikz} \usepackage{tikz-cd}
\begin{tikzpicture}[x=1cm, y=1cm]
  \node at (3.82,-3.86) {\pgfinterruptpicture%
  \begin{tikzcd}[row sep=scriptsize,column sep=scriptsize]
  & P \arrow[dl,"p_1"'] \arrow[rr,"q_1"] \arrow[dd,"u" near start] & & B \arrow[dl,"g"] \arrow[dd,"v"] \\
  A \arrow[rr,crossing over,"f" near end] \arrow[dd,"w"'] & & C \\
  & P' \arrow[dl,"p_2"'] \arrow[rr,"q_2" near start] & & B' \arrow[dl,"g'"] \\
  A' \arrow[rr,"f'"'] & & C' \arrow[from=uu,crossing over,"x" near start]
  \end{tikzcd}%
  \endpgfinterruptpicture};
\end{tikzpicture}

What the editor does

Questions

Is it free?
Yes. DiagramTeX is free and open source (GNU AGPLv3), with no account, no paid tier and no ads. The code it writes for you is yours to use however you like.
Does it work with Overleaf?
Yes. Copy the code into your project and add \usepackage{tikz-cd}. The LaTeX dialog can also download a .zip to upload to Overleaf.
Is my diagram uploaded anywhere?
No. DiagramTeX runs in your browser and keeps your files there. Once it has loaded, it also works offline.

Other editors