I'm trying to use xy-pic in LyX to create diagrams and using this tutorial. It says on page 3 to go Layout->Document->Preamble to enable the xy-pic package. However, there is no "Layout" menu on my LyX installation. There is a "Document" menu, but it doesn't contain any option "Preamble."

When I type \xymatrix, the command appears in the autocomplete list. However, when I type \ar within the \xymatrix context to create an arrow, it does not appear. \ar causes compile errors, and both \ar and \xymatrix cause compile errors when used in an evil red text context (between dollar signs) rather than a LyX math context.

I'm using LyX 2.0.1 on a Mac OSX Lion machine. This issue has been a problem in the past as well, but I haven't been able to find any information on it. Any ideas?

  • I think you should update your version of LyX to 2.0.4. Then you can edit your preamble (Document > Settings > LaTeX Preamble) and include the text \usepackage{xypic}.
    – Werner
    Jul 12, 2012 at 3:03
  • Thanks a lot! Sorry if that was a stupid question, I just couldn't seem to find anything about it. Jul 12, 2012 at 3:21

1 Answer 1


Go to Document > Settings > LaTeX Preamble and in there you can type \usepackage[all]{xy}

Note that it doesn't matter whether you have 2.0.4 or 2.0.1 for this particular point but you might as well upgrade.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .