# Commutative diagrams with tikz-cd

> Draw commutative diagrams with tikz-cd: the tikzcd grid, \arrow directions, labels, arrow styles, pullbacks, exact sequences, snake lemma and editors.

URL: https://www.labcanvas.com/tikz/commutative-diagrams

Updated 2026-11-22. Pictures typeset with TeX Live 2026 and PGF 3.1.12; each is made from the code under it, in a standalone document with the preamble lines shown. Code on this page: CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0/), copy freely. Try any snippet in the TikZ editor: https://www.labcanvas.com/tools/tikz-editor

## Quick answer

Load `\usepackage{tikz-cd}` and write the diagram as a grid inside `\begin{tikzcd} … \end{tikzcd}`: `&` separates columns and `\\` rows, as in a table, and every cell is in math mode. In a cell, `\arrow[r, "f"]` (or the shorter `\ar`) draws an arrow to the cell one step to the right with the label *f*; the letters `r`, `l`, `d`, `u` combine, so `\arrow[dr]` goes one down and one right. Options set the style: `hook`, `two heads`, `dashed`, `Rightarrow`, `equal`, `bend left`, `shift left`, `crossing over`.

![Commutative square: A to B labelled f on top, A to C labelled g on the left, B to D labelled h on the right, C to D labelled k at the bottom.](https://www.labcanvas.com/tikz-snippets/commutative-diagrams/square.webp)

*A commutative square: arrows with \arrow[r] and \arrow[d], labels in quotes*

Preamble: `\usepackage{tikz}`, `\usepackage{tikz-cd}`

```latex
\begin{tikzcd}
  A \arrow[r, "f"] \arrow[d, "g"'] & B \arrow[d, "h"] \\
  C \arrow[r, "k"'] & D
\end{tikzcd}
```

## The tikzcd environment: cells, rows and columns

tikz-cd (by Augusto Stoffel; version 1.0 of 2021-05-04 is the current one, in TeX Live and MiKTeX) is loaded with `\usepackage{tikz-cd}`, or with `\usetikzlibrary{cd}` after TikZ: the package, the `tikzcd` environment and the `cd` library are the same thing. Internally a diagram is a TikZ `matrix of nodes` plus one path per arrow, so TikZ options work inside it.

- Cells are separated by `&` and rows by `\\`. Leave cells empty (but keep their `&`) to place objects on a grid, as in the triangle below. Do not end the last row with `\\`: tikz-cd adds it itself.
- Spacing: `row sep` and `column sep` take `tiny`, `small`, `scriptsize`, `normal`, `large`, `huge` (rows 0.45em to 3.6em, columns 0.6em to 4.8em; normal is 1.8em and 2.4em) or any length; `sep=` sets both. Extra space between two particular columns or rows goes in brackets: `&[3em]`, `\\[1.5em]`.
- Options for one cell go at its start between bars: `|[alias=Z, red]| C`; for all cells use `cells={nodes={…}}`. Cells are in math mode; `math mode=false` switches that off for text diagrams.
- `\tikzcdset{…}` sets options for all diagrams. Because the separations are reset at the start of every diagram, change a size there with `\tikzcdset{row sep/normal=1cm}` rather than `row sep=1cm`.

![Commutative triangle: A at bottom left, B at the top, C at bottom right; arrows f from A to B, g from B to C, and g∘f from A to C along the bottom.](https://www.labcanvas.com/tikz-snippets/commutative-diagrams/triangle.webp)

*A triangle on a 2 × 3 grid with empty cells and column sep=small*

Preamble: `\usepackage{tikz}`, `\usepackage{tikz-cd}`

```latex
\begin{tikzcd}[column sep=small]
  & B \arrow[dr, "g"] & \\
  A \arrow[ur, "f"] \arrow[rr, "g \circ f"'] & & C
\end{tikzcd}
```

## Arrows: \arrow, \ar and their targets

`\arrow[⟨options⟩]` and its synonym `\ar` go in the cell where the arrow starts. The target is given by a string of the letters `r`, `l`, `d`, `u` (right, left, down, up), one letter per step: `rr` skips a column, `dl` goes diagonally down-left. Other options are any keys a TikZ `\path` accepts, plus the tikz-cd styles below.

Instead of a direction you can name both ends with `from=` and `to=`, as a cell `row-column` (`to=2-3`), a direction relative to the current cell (`from=uu`) or the name of a node or alias. That lets you write all the arrows after the objects, which is the style graphical editors export, and draw an arrow later than its source cell (arrows are drawn in the order they are read, which matters for `crossing over`).

Old documents use `\arrow{r}{f}` (direction and label in braces) and shortcuts such as `\rar`, `\dar` and `\drar`; they still work, but the quotes syntax above is the current one.

## Labels and their positions

A label is text in double quotes among the options: `\arrow[r, "f"]`. It is typeset in `\scriptstyle` and placed on the left of the arrow’s direction, which is above an arrow going right and to the right of an arrow going down. Then:

- `"g"'`: an apostrophe after the closing quote moves the label to the other side (it is TikZ’s `swap`).
- `"f" near start`, `near end`, `very near start`, `pos=0.3`: position along the arrow; an arrow can have several labels.
- `"\eta" description`: on the arrow, with a white background that cuts the line. `"\sim" marking`: on the arrow without background, for symbols such as / or ∘ crossing the arrow.
- Options after the label apply to it alone: `"a" red`, `"b"' blue`. Put text and options in braces when they contain a comma: `"{(x,y)}"`, `"f"{above, near end}`.
- `labels={…}` on the diagram adds options to every label, e.g. `labels={inner sep=1ex}` for more distance from the arrows.

![Three rows of arrows: labels above and below; labels phi near the start and psi near the end; eta drawn on the arrow; a tilde on the arrow; a red label above and a blue label below.](https://www.labcanvas.com/tikz-snippets/commutative-diagrams/labels.webp)

*Label positions: default, swapped, near start/end, description, marking, coloured*

Preamble: `\usepackage{tikz}`, `\usepackage{tikz-cd}`

```latex
\begin{tikzcd}[column sep=huge]
  A \arrow[r, "f"] & B \arrow[r, "g"'] & C \\
  D \arrow[r, "\phi" near start, "\psi" near end] & E \arrow[r, "\eta" description] & F \\
  G \arrow[r, "\sim" marking] & H \arrow[r, "a" red, "b"' blue] & I
\end{tikzcd}
```

## Arrow styles: hook, two heads, dashed, Rightarrow, equal

tikz-cd names its arrow styles after what they look like or after the TeX command that makes the same arrow (without the backslash). They draw arrow tips that match Computer Modern, the default math font:

| Kind | Styles |
| --- | --- |
| Basic | to head, rightarrow (the default), leftarrow, leftrightarrow, Rightarrow, Leftarrow, Leftrightarrow |
| From a bar | maps to, mapsto, mapsfrom, Mapsto, Mapsfrom |
| Hook (inclusions) | hook, hook', hookrightarrow, hookleftarrow |
| Tail (monos) | tail, rightarrowtail, leftarrowtail |
| Two heads (epis) | two heads, twoheadrightarrow, twoheadleftarrow |
| Harpoons | harpoon, harpoon', rightharpoonup, rightharpoondown, leftharpoonup, leftharpoondown |
| Dashed | dashed, dashrightarrow, dashleftarrow |
| Squiggly | squiggly, rightsquigarrow, leftsquigarrow, leftrightsquigarrow (need \usetikzlibrary{decorations.pathmorphing}) |
| No tip | no head, no tail, dash, equal (double line, no tips; equals is accepted too) |

Styles that change different ends combine: `\arrow[r, tail, two heads, dashed]`. Plain TikZ keys work as well: `dotted`, `thick`, `red`, `line width=…`. If your document uses another math font, set `\tikzcdset{arrow style=math font}` (tips made from the font’s own arrow glyphs) or `arrow style=tikz` (TikZ’s arrows.meta tips, which follow `>`) in the preamble.

![Two columns of arrows between dots: hook, tail, Rightarrow, mapsto, no head on the left; two heads, dashed, equal, squiggly, harpoon on the right.](https://www.labcanvas.com/tikz-snippets/commutative-diagrams/arrow-styles.webp)

*Ten arrow styles of tikz-cd, each labelled with its option name*

Preamble: `\usepackage{tikz}`, `\usepackage{tikz-cd}`, `\usetikzlibrary{decorations.pathmorphing}`

```latex
\begin{tikzcd}[column sep=large, row sep=small]
  \bullet \arrow[r, hook, "\mathtt{hook}"] & \bullet &
  \bullet \arrow[r, two heads, "\mathtt{two\ heads}"] & \bullet \\
  \bullet \arrow[r, tail, "\mathtt{tail}"] & \bullet &
  \bullet \arrow[r, dashed, "\mathtt{dashed}"] & \bullet \\
  \bullet \arrow[r, Rightarrow, "\mathtt{Rightarrow}"] & \bullet &
  \bullet \arrow[r, equal, "\mathtt{equal}"] & \bullet \\
  \bullet \arrow[r, mapsto, "\mathtt{mapsto}"] & \bullet &
  \bullet \arrow[r, squiggly, "\mathtt{squiggly}"] & \bullet \\
  \bullet \arrow[r, no head, "\mathtt{no\ head}"] & \bullet &
  \bullet \arrow[r, harpoon, "\mathtt{harpoon}"] & \bullet
\end{tikzcd}
```

## Curved, parallel and looping arrows

- `bend left` / `bend right` curve an arrow (by 30° unless you give an angle, as in `bend left=50`); `in=`, `out=` and `controls` give finer control.
- `shift left` / `shift right` move an arrow sideways, by 0.56ex by default, which is right for a pair of parallel arrows. A number without unit multiplies that default: `shift left=2` for the outer arrows of a triple. `xshift`, `yshift` and `shift={…}` move arrows in fixed directions.
- `loop right` (or `loop above`, …) draws an arrow from a cell to itself.
- `start anchor`, `end anchor` and `shorten=` adjust where an arrow begins and ends.

![E to A labelled e, then two parallel arrows f and g from A to B; separately, two curved arrows u and v from X to Y and a loop on Y labelled 1_Y.](https://www.labcanvas.com/tikz-snippets/commutative-diagrams/parallel-arrows.webp)

*Parallel arrows with shift left/right, bent arrows and a loop*

Preamble: `\usepackage{tikz}`, `\usepackage{tikz-cd}`

```latex
\begin{tikzcd}
  E \arrow[r, "e"] & A \arrow[r, shift left, "f"] \arrow[r, shift right, "g"'] & B
  &[3em] X \arrow[r, bend left, "u"] \arrow[r, bend right, "v"'] & Y \arrow[loop right, "1_Y"]
\end{tikzcd}
```

## 2-cells: arrows between arrows

For a natural transformation between two parallel functors, give each curved arrow an empty label with a name, `""{name=U, below}`, and draw a `Rightarrow` `from=U` `to=D`. The empty labels are nodes on the arrows that the double arrow can start and end at; while placing them, add `draw=red` to see where they are. Use `shorten=…` on the 2-cell if it should stop short of the arrows.

![Two curved arrows F (above) and G (below) from C to D, with a vertical double arrow alpha from the upper to the lower arrow.](https://www.labcanvas.com/tikz-snippets/commutative-diagrams/two-cell.webp)

*A natural transformation: a Rightarrow between two named, bent arrows*

Preamble: `\usepackage{tikz}`, `\usepackage{tikz-cd}`

```latex
\begin{tikzcd}[column sep=huge]
  \mathcal{C}
    \arrow[r, bend left=50, "F", ""{name=U, below}]
    \arrow[r, bend right=50, "G"', ""{name=D}]
  & \mathcal{D}
  \arrow[Rightarrow, from=U, to=D, "\alpha"]
\end{tikzcd}
```

## Pullbacks, pushouts and phantom arrows

A `phantom` arrow is invisible, but its labels are drawn, centred on the arrow and in full `\textstyle`. That is how symbols go where there is no cell: the pullback corner is a phantom arrow from the pullback to the opposite corner with the label `"\lrcorner"` placed `very near start` (`\lrcorner` and `\ulcorner` come from `amssymb`). For a pushout put `"\ulcorner"` `very near end` on the phantom arrow that ends at the pushout. The same trick puts ≅ or a 2-cell label in the middle of a square.

The universal arrow is dashed with a `description` label; its text `{(x,y)}` is in braces because of the comma.

![Pullback square X ×_Z Y, X, Y, Z with arrows p, q, f, g and a corner mark inside; from T, curved arrows x and y and a dashed arrow (x,y) into X ×_Z Y.](https://www.labcanvas.com/tikz-snippets/commutative-diagrams/pullback.webp)

*Pullback with the corner symbol (phantom arrow) and a dashed universal arrow*

Preamble: `\usepackage{tikz}`, `\usepackage{tikz-cd}`, `\usepackage{amssymb}`

```latex
\begin{tikzcd}
  T \arrow[drr, bend left, "x"] \arrow[ddr, bend right, "y"']
    \arrow[dr, dashed, "{(x,y)}" description] & & \\
  & X \times_Z Y \arrow[r, "p"] \arrow[d, "q"']
    \arrow[dr, phantom, "\lrcorner", very near start] & X \arrow[d, "f"] \\
  & Y \arrow[r, "g"'] & Z
\end{tikzcd}
```

## Exact sequences

A sequence is a one-row diagram. One-row diagrams are aligned on their baseline, so they sit correctly in an equation or a line of text. Use `hook` for the injection and `two heads` for the surjection if you want to show them; `column sep=small` tightens long sequences.

![The sequence 0 → A → B → C → 0, with a hooked arrow f from A to B and a two-headed arrow g from B to C.](https://www.labcanvas.com/tikz-snippets/commutative-diagrams/exact-sequence.webp)

*A short exact sequence with hook and two heads*

Preamble: `\usepackage{tikz}`, `\usepackage{tikz-cd}`

```latex
\begin{tikzcd}
  0 \arrow[r] & A \arrow[r, hook, "f"] & B \arrow[r, two heads, "g"] & C \arrow[r] & 0
\end{tikzcd}
```

## The snake lemma: an arrow with its own path

An arrow is drawn with TikZ’s `to` operation, so `to path={…}` can replace the straight line with any route. Inside it, `\tikztostart` and `\tikztotarget` are the two cells and `\tikztonodes` is where the labels go. For the connecting map δ:

- A phantom arrow from *A* down to *A′* with the label `""{coordinate, name=Z, pos=.7}` makes a point between the two middle rows; `\\[1.5em]` gives that gap more room.
- The two zeros get names with `|[alias=R]| 0` and `|[alias=L]| 0`, so the path can pass outside them.
- The arrow is written in the last cell with `from=1-4, to=4-2`, so it is drawn after the vertical arrows, and `crossing over` cuts a gap in them where δ passes.

![Four rows: kernels, A B C 0, 0 A′ B′ C′, cokernels, with vertical maps a, b, c; a rounded arrow δ runs from ker c around the right, across the middle and down the left to coker a.](https://www.labcanvas.com/tikz-snippets/commutative-diagrams/snake-lemma.webp)

*The snake lemma: the connecting map δ drawn with to path and crossing over*

Preamble: `\usepackage{tikz}`, `\usepackage{tikz-cd}`

```latex
\begin{tikzcd}
  & \ker a \arrow[r] \arrow[d, hook] & \ker b \arrow[r] \arrow[d, hook]
    & \ker c \arrow[d, hook] & \\
  & A \arrow[r, "f"] \arrow[d, "a"] \arrow[d, phantom, ""{coordinate, name=Z, pos=.7}]
    & B \arrow[r, "g"] \arrow[d, "b"] & C \arrow[r] \arrow[d, "c"] & |[alias=R]| 0 \\[1.5em]
  |[alias=L]| 0 \arrow[r] & A' \arrow[r, "f'"] \arrow[d, two heads]
    & B' \arrow[r, "g'"] \arrow[d, two heads] & C' \arrow[d, two heads] & \\
  & \mathrm{coker}\,a \arrow[r] & \mathrm{coker}\,b \arrow[r] & \mathrm{coker}\,c &
  % drawn last (from=...) so that it crosses over the vertical arrows
  \arrow[from=1-4, to=4-2, crossing over, rounded corners, "\delta"',
    to path={-| ([xshift=1.5ex]R.east) |- (Z) [near end]\tikztonodes
             -| ([xshift=-1.5ex]L.west) |- (\tikztotarget)}]
\end{tikzcd}
```

## Three-dimensional diagrams: crossing over

`crossing over` first draws a thick line in the background colour under the arrow, so the arrow seems to pass in front of the ones it crosses. Arrows are drawn in the order they are read, so an arrow that must pass in front of a later one has to be postponed: in the cube, the front edge *B* → *D* is written in the cell of *D* as `\arrow[from=uu, crossing over]`. The gap is `crossing over clearance` wide (1.5ex); on a coloured background (a Beamer theme, a coloured box), set `\tikzcdset{background color=…}` to match, since that colour is also used by `description` labels.

![A cube with vertices A′, B′, C′, D′ at the back and A, B, C, D at the front; the front edges A→B and B→D are drawn with gaps in the back edges they cross.](https://www.labcanvas.com/tikz-snippets/commutative-diagrams/crossing-over.webp)

*A commutative cube: front edges cross over the back edges*

Preamble: `\usepackage{tikz}`, `\usepackage{tikz-cd}`

```latex
\begin{tikzcd}[row sep=scriptsize, column sep=scriptsize]
  & A' \arrow[rr] \arrow[dl] \arrow[dd] & & B' \arrow[dl] \arrow[dd] \\
  A \arrow[rr, crossing over] \arrow[dd] & & B \\
  & C' \arrow[rr] \arrow[dl] & & D' \arrow[dl] \\
  C \arrow[rr] & & D \arrow[from=uu, crossing over]
\end{tikzcd}
```

## Diagrams in equations, in text and in Beamer

A `tikzcd` is typeset in math mode but is not centred by itself: put it in `\[ … \]` or in an `equation` environment. tikz-cd sets `baseline=0pt` so that the equation number is placed correctly next to multi-row diagrams. In running text, the `cramped` style removes some of the white space around the cells; for a single labelled arrow, `\xrightarrow{f}` (amsmath) is usually better.

TikZ makes `&` an active character inside matrices, which fails when the diagram is read as the argument of another command: a Beamer frame, `\fbox`, a footnote, a macro of your own. Either give the frame the `[fragile]` option, or write the diagram with `\begin{tikzcd}[ampersand replacement=\&]` and `\&` between the cells. Ampersand replacement is also needed for a matrix (`pmatrix`) inside a cell or label.

![A paragraph with a commutative square displayed in the centre and numbered (1) on the right, followed by text containing a small arrow A → B.](https://www.labcanvas.com/tikz-snippets/commutative-diagrams/in-equation.webp)

*A numbered diagram in an equation environment and a cramped one-row diagram in text*

Preamble: `\usepackage{tikz}`, `\usepackage{tikz-cd}`

```latex
% the minipage stands in for your text column
\begin{minipage}{7.8cm}
  A displayed diagram is numbered like any equation:
  \begin{equation}
    \begin{tikzcd}
      A \arrow[r, "f"] \arrow[d, "g"'] & B \arrow[d, "h"] \\
      C \arrow[r, "k"'] & D
    \end{tikzcd}
  \end{equation}
  and a cramped one-row diagram
  \begin{tikzcd}[cramped, sep=small] A \arrow[r] & B \end{tikzcd}
  sits in the text.
\end{minipage}
```

## tikz-cd editors: quiver and the LabCanvas TikZ editor

[quiver](https://q.uiver.app) (q.uiver.app, by varkor) is a free graphical editor for commutative and pasting diagrams: you place objects on a grid and drag arrows with the mouse or the keyboard, and it exports LaTeX code for tikz-cd (also Typst code for the fletcher package, and HTML to embed). The export starts with a comment holding a link that reopens the diagram in quiver, writes all arrows after the objects with `from=` and `to=`, and draws pullback corners as a `\lrcorner` label on an arrow with `draw=none`, as below. Simple exports like this one compile with tikz-cd alone (plus amssymb for the corner), but quiver asks you to load its own package, `\usepackage{quiver}` ([quiver on CTAN](https://ctan.org/pkg/quiver), version 1.7.0, in TeX Live), which loads tikz-cd, amssymb and the TikZ libraries that its curved arrows of fixed height, shortened arrows, squiggly and triple arrows need. TeX Live releases can lag behind the website; if an export uses a style your quiver.sty lacks, get the current file from quiver.

The [LabCanvas TikZ editor](https://www.labcanvas.com/tools/tikz-editor) works on the code instead: paste a `tikzcd` environment (or a quiver export) and it is typeset with TeX Live as you type, with tikz-cd already loaded, so you can adjust labels, spacing and styles by hand and see the result at once. It renders with the same TeX Live as the pictures on this page.

![Commutative square A, B, C, D with arrows f, g, h, k and a small corner symbol near A inside the square.](https://www.labcanvas.com/tikz-snippets/commutative-diagrams/from-to.webp)

*The same square written the way quiver exports it: from=/to= cells and a corner label*

Preamble: `\usepackage{tikz}`, `\usepackage{tikz-cd}`, `\usepackage{amssymb}`

```latex
% https://q.uiver.app/#q=WzAsNCxbMCwwLCJBIl0sWzEsMCwiQiJdLFswLDEsIkMiXSxbMSwxLCJEIl0sWzAsMSwiZiJdLFswLDIsImciLDJdLFsxLDMsImgiXSxbMiwzLCJrIiwyXSxbMCwzLCIiLDEseyJzdHlsZSI6eyJuYW1lIjoiY29ybmVyIn19XV0=
\begin{tikzcd}
	A & B \\
	C & D
	\arrow["f", from=1-1, to=1-2]
	\arrow["g"', from=1-1, to=2-1]
	\arrow["h", from=1-2, to=2-2]
	\arrow["k"', from=2-1, to=2-2]
	\arrow["\lrcorner"{anchor=center, pos=0.125}, draw=none, from=1-1, to=2-2]
\end{tikzcd}
```

## Common errors and how to fix them

| LaTeX says (or you see) | Cause and fix |
| --- | --- |
| LaTeX Error: Environment tikzcd undefined. | Load the package: `\usepackage{tikz-cd}` in the preamble (or `\usetikzlibrary{cd}` after `\usepackage{tikz}`). |
| Package pgf Error: No shape named `tikz@f@1-1-3' is known. | An arrow points to a cell that does not exist (here row 1, column 3): too many `r`/`d` letters, a missing `&`, or a `to=` beyond the grid. Empty cells still need their `&`. |
| Package pgfkeys Error: I do not know the key '/tikz/y)"' and I am going to ignore it. | A comma inside a label splits the option list. Put the label text in braces: `"{(x,y)}"`. |
| Undefined control sequence. \pgf@matrix@last@nextcell@options | The diagram is inside a macro argument or a Beamer frame, where `&` cannot become active. Use `\begin{frame}[fragile]`, or `ampersand replacement=\&` with `\&` between cells. (The tikz-cd manual shows the older wording “Single ampersand used with wrong catcode”.) |
| Argument of \language@active@arg" has an extra }. | babel has made `"` (or another character) active, as ngerman does, which breaks the quotes syntax of labels. Add `\usetikzlibrary{babel}` to the preamble. |
| Package tikz-cd Error: You need to say \usetikzlibrary{decorations.pathmorphing} to use squiggly arrows. | Add that line to the preamble; `squiggly` and the `…squigarrow` styles need it. |
| Undefined control sequence (at \lrcorner or \ulcorner) | The corner symbols come from amssymb: add `\usepackage{amssymb}`. |

## Frequently asked questions

### How do I draw a commutative diagram in LaTeX?

With the tikz-cd package: `\usepackage{tikz-cd}`, then the objects in a `tikzcd` grid (`&` between columns, `\\` between rows) and `\arrow[r, "f"]` in a cell for an arrow to the right labelled f. Put the diagram in `\[ … \]` to centre it.

### Is it tikzcd, tikz-cd or tikz cd?

All three mean the same thing: the package is called tikz-cd (`\usepackage{tikz-cd}`), the environment is `tikzcd`, and the TikZ library is `cd` (`\usetikzlibrary{cd}`).

### Is there a visual editor for tikz-cd?

Yes: quiver (q.uiver.app) is a free graphical editor that exports tikz-cd code (use `\usepackage{quiver}` for curved and shortened arrows). To edit and preview the code itself, paste it into the LabCanvas TikZ editor, which typesets tikz-cd with TeX Live as you type.

### How do I put a label in the middle of an arrow?

Add `description` after the label, `\arrow[r, "f" description]`: the label sits on the arrow with a background that cuts the line. `marking` does the same without the background.

### How do I draw the pullback symbol?

Add a phantom arrow from the pullback to the opposite corner with the corner as its label: `\arrow[dr, phantom, "\lrcorner", very near start]`, with `\usepackage{amssymb}` for `\lrcorner`.

### How do I make the diagram bigger or smaller?

Change the spacing: `\begin{tikzcd}[row sep=large, column sep=huge]`, or `sep=small` for both; any length such as `column sep=3em` also works. Labels and objects keep the font size of the surrounding math.

## References

- [tikz-cd package on CTAN (v1.0, 2021-05-04)](https://ctan.org/pkg/tikz-cd)
- [tikz-cd manual (PDF on CTAN)](https://mirrors.ctan.org/graphics/pgf/contrib/tikz-cd/tikz-cd-doc.pdf)
- [tikz-cd manual, §1.2 Inserting arrows and §1.3 Changing arrow tips (HTML)](https://tikz.dev/tikz-cd/getting-started#sec-1.2)
- [tikz-cd manual, §2.1 General options (row sep, column sep, cells, cramped)](https://tikz.dev/tikz-cd/diagram-options#sec-2.1)
- [tikz-cd manual, §2.3 Absolute placement of arrows (from, to)](https://tikz.dev/tikz-cd/diagram-options#sec-2.3)
- [tikz-cd manual, §2.4 Phantom arrows](https://tikz.dev/tikz-cd/diagram-options#sec-2.4)
- [tikz-cd manual, §2.5 Fine-tuning the placement of arrows (shift left, shorten)](https://tikz.dev/tikz-cd/diagram-options#sec-2.5)
- [tikz-cd manual, §2.6 Three-dimensional diagrams (crossing over)](https://tikz.dev/tikz-cd/diagram-options#sec-2.6)
- [tikz-cd manual, §2.7 Options for labels (description, marking)](https://tikz.dev/tikz-cd/diagram-options#sec-2.7)
- [tikz-cd manual, §3.2 Tweaking to paths and §3.4 Issues with active characters](https://tikz.dev/tikz-cd/advanced-usage#sec-3.2)
- [PGF/TikZ manual, §17.10.4 The Quotes Syntax](https://tikz.dev/tikz-shapes#sec-17.10.4)
- [PGF/TikZ manual, §20.3.2 Setting and Adjusting Column and Row Spacing](https://tikz.dev/tikz-matrices#sec-20.3.2)
- [quiver, a graphical tikz-cd editor](https://q.uiver.app/)
- [quiver.sty on CTAN (v1.7.0, 2026-07-27)](https://ctan.org/pkg/quiver)

## More TikZ guides

- [TikZ: what it is and how to use it in LaTeX](https://www.labcanvas.com/tikz): What TikZ (PGF/TikZ) is and how to use it in LaTeX: the minimal document, libraries, coordinates, a first figure in steps, Overleaf and TeX Live.
- [TikZ arrows: arrow tips, sizes, curves and labels](https://www.labcanvas.com/tikz/arrows): All TikZ arrow tips in one rendered table, arrows.meta sizing (length, width, scale, open, round), and curved, labelled, thick, block and squiggly arrows.
- [The tikzpicture environment: options, scaling and centring](https://www.labcanvas.com/tikz/tikzpicture): The tikzpicture environment: its options, scale vs transform shape vs \resizebox, centring it in a figure with a caption, and inline TikZ with baseline.
- [TikZ lines: dashed, dotted, thickness and line width](https://www.labcanvas.com/tikz/lines): TikZ lines: dashed and dotted styles with their exact patterns, ultra thin to ultra thick widths, dash pattern, caps and joins, double lines, grids.
- [TikZ examples: 179 figures with code, by field](https://www.labcanvas.com/tikz/examples): A gallery of 179 TikZ and pgfplots figures with their full code, from open-source collections (MIT or CC0): physics, maths, machine learning, plots, diagrams.
- [The PGF/TikZ manual: where to find it and which part to read](https://www.labcanvas.com/tikz/manual): Where the official PGF/TikZ manual is (CTAN PDF, texdoc tikz, the tikz.dev HTML edition), which version it describes, and which section to read for each task.
