# LaTeX code for commutative diagram

Kindly provide me LaTeX code for this and if possible the circles in each of the boxes saying the diagram is commutative.

For one commutative diagram I have the code

\xymatrixrowsep{10mm}
\xymatrixcolsep{10mm}
\xymatrix{
\mathcal{F}(U) \ar[r] & \mathcal{G}(U) \\
\mathcal{F}(V) \ar[u] \ar[r] & \ar[u] \mathcal{G}(V)
}


This is not the code for any part of above diagram, but I am comfortable with this kind of code.

Please see if you can give code which generalizes the code that I have.

That script letters are:

\mathcal{F},\mathcal{G}.

• @T.Verron I have edited the question.. – user43645 Jan 11 '17 at 13:24
• And I deleted my comment as soon as I noticed (and it is not my downvote). Your question could be improved by identifying which parts of the diagram you know how to write (and providing the code for it), and explaining your difficulties with the remaining parts. – T. Verron Jan 11 '17 at 13:27
• @T.Verron : I took picture in my tab and uploaded it with stack exchange app.. As i am not comfortable in writing in tab i have edited here... I got your downvote in less than 2 minutes, – user43645 Jan 11 '17 at 13:30
• More generally, questions should revolve around a specific problem and their answers should be helpful for others too. Questions reading as "Just do it for me" are generally incompatible with this format. – T. Verron Jan 11 '17 at 13:31

Just make a matrix with four rows, and empty cells where appropriate.

\documentclass{article}
\usepackage[all]{xy}

\begin{document}
\xymatrixrowsep{2mm} % I modified this
\xymatrixcolsep{10mm}
\xymatrix{
\mathcal{F}(U) \ar[dd] \ar[dr] & & \mathcal{F}(V) \ar[ld] \ar[dd]\\
& \mathcal{F}(W) \ar[dd] & \\
\mathcal{G}(U) \ar[dr]  &  & \mathcal{G}(V) \ar[ld]\\
& \mathcal{G}(W) &
}
\end{document}


As egreg mentions in a comment, you can use the cmtip package option to get arrow tips like standard Computer Modern arrows, and \xymatrix@R=2mm@10mm{..} to keep row and column spacing settings local to the diagram:

\documentclass{article}
\usepackage[all,cmtip]{xy} % cmtip tp get standard computer modern arrow tips
\begin{document}
\xymatrix@R=2mm@C=10mm{% keep row and column space local to this diagram
\mathcal{F}(U) \ar[dd] \ar[dr] & & \mathcal{F}(V) \ar[ld] \ar[dd]\\
& \mathcal{F}(W) \ar[dd] & \\
\mathcal{G}(U) \ar[dr]  &  & \mathcal{G}(V) \ar[ld]\\
& \mathcal{G}(W) &
}
\end{document}


Here is a solution using the package tikz-cd.

\documentclass[border=1mm,varwidth]{standalone}
\usepackage{tikz-cd}
\usepackage{mathrsfs}
\begin{document}
\paragraph{Step 1:} Position the nodes in a matrix

\begin{tikzcd}
\mathscr{F}(U)   &                & \mathscr{F}(V) \\
& \mathscr{F}(W) &                \\
\mathscr{G}(U)   &                & \mathscr{G}(V) \\
& \mathscr{G}(W) &
\end{tikzcd}