# Minipage compatible with xy matrix? What may be an alternative fix?

I have a minimal working environment below.

It fails to be compiled.

Is the minipage compatible with xy matrix? What may be an alternative fix?

Thanks for the help!

\documentclass[14pt]{article}

\usepackage[all, knot]{xy}
\def \Z{\mathbb{Z}}

\begin{document}

\xymatrix{
&\omega\\
\begin{minipage}[c]{5in}
1
\end{minipage}\ar[ru]&\\
}

\xymatrix{
&\omega\\
\begin{minipage}[c]{5in}
$\Delta=\Z$:\\
$\boxed{\delta}$
\end{minipage}\ar[ru]\ar[rd]&\\
&\begin{minipage}[c]{5in}
$b=\Z$:\\
$\boxed{\delta(g,h)}$
\end{minipage}\\
}

\end{document}


p.s. I may really need the 5 inch comment, since there is a long line of equation needs to be inserted there, like:

\begin{minipage}[c]{5in}
abcdefghijklmnopqrstuvwxyz\end{minipage}


There are two issues: one is that Xy-pic is not able to cope with cells so big as five inches.

However, I don't think you need a wide minipage, but rather an array; remember to brace it so as not to confuse Xy-pic.

\documentclass{article}
\usepackage{amsmath,amssymb,array}
\usepackage[all,cmtip]{xy}

\newcommand{\Z}{\mathbb{Z}}

\begin{document}

\xymatrix{
& \omega\\
{\begin{array}{@{}l@{}}
\Delta=\Z{:}\\
\boxed{\delta}
\end{array}}\ar[ru]\ar[rd]&\\
&{\begin{array}{@{}l@{}}
b=\Z{:}\\
\boxed{\delta(g,h)}
\end{array}}
}

\end{document}


• thanks!, may I also ask, what if I may really need the 5 inch comment, since there is a long line of equation needs to be inserted there, like: \begin{minipage}[c]{5in} abcdefghijklmnopqrstuvwxyz\end{minipage} – annie heart Nov 22 '18 at 18:05
• @annieheart As I said, five inches is too much for Xy-pic. I don't think that minipage is the right tool anyway. – egreg Nov 22 '18 at 18:16
• Can you explain the meaning of "\begin{array}{@{}l@{}}" ? thanks! – annie heart Nov 23 '18 at 0:14
• @annieheart It builds a one left aligned column array with no padding on either side. It's the math mode analog of tabular. – egreg Nov 23 '18 at 0:18
• thanks! happy thanks giving. How do I make your arrow \ar as the doublelinearrow like \Longrightarrow ? – annie heart Nov 23 '18 at 0:28

An alternative with tikz-cd.

\documentclass[14pt]{article}
\usepackage{tikz-cd,amsmath,amssymb}
\def\Z{\mathbb{Z}}
\begin{document}
\begin{tikzcd}[minimum width=8em]
&\hspace{-1.5cm} \omega \\
\begin{matrix} \Delta=\Z\!\!: & \\ \boxed{\delta} & \end{matrix}
\arrow[xshift=-4ex,yshift=1ex]{rd}\arrow[xshift=-4ex,yshift=1ex]{ru}& \\
[1.5em] & \hspace{-1cm}\begin{matrix} b=\Z\!\!: & \\ \boxed{\delta(g,h)} & \end{matrix}
\end{tikzcd}
\end{document}


My version with xy (xy-pic, xymatrix) package. The lines are still straight by filling in the code that I enter below.

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools,amssymb}
\usepackage[all]{xy}
\begin{document}

\xymatrix@R=0pc@C=5pc{
&  \,\omega  & \\
\Delta=\mathbb{Z}\mkern-4mu: \ar[ur]\ar[dr] &   & \\
\fbox{$\delta$}  &  {\begin{aligned}
b=\mathbb{Z}\mkern-4mu: \\
\,\fbox{$\delta(g,h)$}
\end{aligned}}
}
\end{document}