# How to write in math environment in \xy matrix

I want to write $\alpha$ in place of a in Z[a] and Z as set of integer symbol. But when I'm trying it in math environment using $ symbol it is giving error. Please Help. \begin{displaymath} \xymatrixcolsep{4.5pc} \hspace{-1.75cm} \xymatrix{ & & Z[x] \ar[dl] \ar[dr] & \\ & Z[a] \ar[dr] & & Z[m] \ar[dl] \\ & & Z/NZ & & } \end{displaymath}  • It is in math mode displaymath. Just type \alpha. – Sigur Apr 8 '17 at 13:20 • For the set of integers, usually we use \mathbb{Z} from amsfonts package. – Sigur Apr 8 '17 at 13:46 ## 1 Answer First of all, you are adding unnecessary column on the left. Your diagram requires only 3 columns. The \xymatrix{} requires a math mode, that is, should be used within $ $ (inline) or  (displayed) (or equivalently, within equation* or equation environment). So, you don't need (in fact, you can not) use $ \$ inside any matrix entry. Just type as you want: \alpha.

Finally, to denote integers set, usually we use \mathbb{} font from amsfonts package.

Extra tip: you can control the distance between columns/rows in the diagram using @C<distance> or @R<distance>. For example, @C4.5pc.

Full code

\documentclass{report}
\usepackage{amsfonts}
\usepackage{xypic}

\begin{document}
$\xymatrix@C4.5pc{ & \mathbb{Z}[x] \ar[dl] \ar[dr] & \\ \mathbb{Z}[\alpha] \ar[dr] & & \mathbb{Z}[m] \ar[dl] \\ & \mathbb{Z}/N\mathbb{Z} }$
\end{document}
`