# resizing width of a commutative diagram

I have too large diagram and I want to resize the box width, but I keep on having a compilation error missing } inserted }

\documentclass{article}
\usepackage{amsmath}
\usepackage{xcolor}
\usepackage[all,cmtip,color]{xy}
\nc{\conv}[1][]{\mathop{\circ}\limits_{#1}}
\nc{\muhom}{\mu hom}
\begin{document}


\resizebox{width}{!}{
&&\xymatrix{
(\muhom(F_{1},F_{2})\conv\muhom(G_{1},G_{2}))\circ\muhom(H_{1},H_{2})\ar[d]_-{\sim}\ar[r]&\muhom(F_{1}\conv G_{1},F_{2}\conv G_{2})\circ\muhom(H_{1},H_{2})\ar[r]&\muhom((F_{1}\conv G_{1})\conv H_{1},(F_{2}\conv G_{2})\conv H_{2})\ar[d]^-{\sim}\\
\muhom(F_{1},F_{2})\conv(\muhom(G_{1},G_{2})\circ\muhom(H_{1},H_{2}))\ar[r]&\muhom(F_{1},F_{2})\circ\muhom(G_{1}\conv H_{1},G_{2}\conv H_{2})\ar[r]&\muhom(F_{1}\conv (G_{1}\conv H_{1}),F_{2}\conv (G_{2}\conv H_{2}))\\
}
}
\end{document}


Someone has an idea? Or is it possible to deal with large diagram in order to fit their width in the document?

• Hello user2478159, welcome to tex.sx. Your MWE is a MnWE. What does \nc? I guess \newcommand, but it really should work right away, to reproduce your error. – MaestroGlanz Jan 3 at 14:39
• Can it be vertical? – Sigur Jan 3 at 16:17
• Delete && also. – Sigur Jan 3 at 16:17
• I think what you want is \mu_{\hom(F_{1},F_{2})}, right? Or should be \mu\hom(F_{1},F_{2})? – Sigur Jan 3 at 16:20

You might resize it, but it will become unreadable. It's less terrible if you transpose it.

I redefined your \conv and \muhom commands.

\documentclass{article}
\usepackage{amsmath}
\usepackage{xcolor,graphicx}
\usepackage[all,cmtip,color]{xy}

\usepackage{showframe} % just for the picture

\newcommand{\conv}[1][]{%
\mathbin{%
\mathop{\circ}%
\if\relax\detokenize{#1}\relax\limits_{#1}\fi
}%
}
\newcommand{\muhom}{\operatorname{\mu{\hom}}}

\begin{document}

$\resizebox{\displaywidth}{!}{% \xymatrix{ (\muhom(F_{1},F_{2})\conv\muhom(G_{1},G_{2}))\circ\muhom(H_{1},H_{2}) \ar[d]_-{\sim} \ar[r] & \muhom(F_{1}\conv G_{1},F_{2}\conv G_{2})\circ\muhom(H_{1},H_{2}) \ar[r] & \muhom((F_{1}\conv G_{1})\conv H_{1},(F_{2}\conv G_{2})\conv H_{2}) \ar[d]^-{\sim} \\ \muhom(F_{1},F_{2})\conv(\muhom(G_{1},G_{2})\circ\muhom(H_{1},H_{2})) \ar[r] & \muhom(F_{1},F_{2})\circ\muhom(G_{1}\conv H_{1},G_{2}\conv H_{2}) \ar[r] & \muhom(F_{1}\conv (G_{1}\conv H_{1}),F_{2}\conv (G_{2}\conv H_{2})) }% }$

$\resizebox{\displaywidth}{!}{% \xymatrix@C-6pt{ (\muhom(F_{1},F_{2})\conv\muhom(G_{1},G_{2}))\circ\muhom(H_{1},H_{2}) \ar[r]_-{\sim} \ar[d] & \muhom(F_{1},F_{2})\conv(\muhom(G_{1},G_{2})\circ\muhom(H_{1},H_{2})) \ar[d] \\ \muhom(F_{1}\conv G_{1},F_{2}\conv G_{2})\circ\muhom(H_{1},H_{2}) \ar[d] & \muhom(F_{1},F_{2})\circ\muhom(G_{1}\conv H_{1},G_{2}\conv H_{2}) \ar[d] \\ \muhom((F_{1}\conv G_{1})\conv H_{1},(F_{2}\conv G_{2})\conv H_{2}) \ar[r]^-{\sim} & \muhom(F_{1}\conv (G_{1}\conv H_{1}),F_{2}\conv (G_{2}\conv H_{2})) }}$

\end{document}


Here is a (working) starting point. If you insert a 3rd column, the diagram should be smaller (and probably unreadable) to fit in line width.

\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx} % <-- to use resizebox
\usepackage[all,cmtip]{xy}
%\newcommand{\conv}[1][]{\mathop{\circ}\limits_{#1}}
\newcommand{\muhom}[1]{\mu_{\hom(#1_{1},#1_{2})}}
\begin{document}
$\resizebox{\linewidth}{!}{% \xymatrix{ ( \muhom{F}\circ \muhom{G} ) \circ \muhom{H} \ar[r]^-{\sim} \ar[d] & \muhom{F}\circ ( \muhom{G} \circ \muhom{H} ) \ar[d] \\ \mu_{\hom{(F_1\circ G_1, F_2\circ G_2)}} \circ \muhom{H} \ar[r]^-{\sim} & \muhom{F}\circ \mu_{\hom{(G_1\circ H_1, G_2\circ H_2)}} }}$
\end{document}