> ## Documentation Index
> Fetch the complete documentation index at: https://resources.latex-cloud-studio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Draw Commutative Diagrams with XY-pic

> Create commutative diagrams in LaTeX using XY-pic syntax for category theory and algebra notes.

XY-pic is commonly used for commutative diagrams in algebra and category theory.

## Basic Setup

```latex xypic-basic.tex theme={null}
\usepackage[all]{xy}

\[
\xymatrix{
A \ar[r]^f \ar[d]_g & B \ar[d]^h \\
C \ar[r]_k & D
}
\]
```

## Arrow Labels and Curves

```latex xypic-arrows.tex theme={null}
\[
\xymatrix{
X \ar@/^/[r]^{\alpha} \ar@/_/[r]_{\beta} & Y
}
\]
```

## Related Pages

* [TikZ diagrams](/learn/latex/how-to/tikz-diagrams)
* [Circuits notation](/learn/latex/specialized-notation/circuits)
