Xy-pic — Typesetting Graphs and Diagrams in TeX

Xy-pic is a package for typesetting graphs and diagrams using the principle of logical composition of visual components. It is structured as several modules, each defining a mnemonic plain text notation for a particular kind of graphical object or structure. Example objects are arrows, curves, frames, and colouring/rotation on drivers that support it; these can be organised in matrix, directed graph, path, polygon, knot, and 2-cell structure (a more complete list of the features is given below).

Xy-pic works with most formats, including all variants of LaTeX, AMS-TeX, and plain TeX, and has been used to typeset complicated diagrams from many application areas including category theory, automata theory, algebra, neural networks, topology (knots and braids), database theory, chemistry, and genealogy.

Xy-pic has been designed with great care to allow the style of pictures to match well with the exquisite quality of the surrounding TeX typeset material.


You can get Xy-pic from CTAN or directly from the SourceForge development project home, however, chances are that Xy-pic is already included with your TeX installation (for TeX Live, for example, Xy-pic is part of the pictures bundle).

Xy-pic was conceived by Kristoffer Høgsbro Rose, the present version is the result of several years of collaboration with Ross Moore with essential contributions from George Necula, Jeremy Gibbons, Daniel Müllner, and Alex Perlis, and with many suggestions from more than two decades of users.

Xy-pic is © by its authors as free software.


Xy-pic is structured as a kernel and several orthogonal modules called options, each defining a custom notation for a particular kind of graphical object or structure.

These (combinable) logical composition structures are available:

The following visual component objects can be used:


The official Xy-pic documentation, updated with each release, consists of the following four documents. In addition there are several tutorials on Xy-pic.

If you know of other tutorials, interesting papers, or instructive examples, that can be shared, then please drop a note to the mailing list!

Help and Support

Help and support on Xy-pic matters, as well as announcement of new versions, etc., is provided by the Xy-pic mailing list, graciously hosted by TUG.

* PostScript and PDF are trademarks of Adobe, Inc.

Kristoffer Høgsbro Rose