TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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 '12 at 3:03
Thanks a lot! Sorry if that was a stupid question, I just couldn't seem to find anything about it. – Xander Flood Jul 12 '12 at 3:21

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.