# commutative diagram without arrow code

I am new to LaTeX. It will be helpful if someone gives me a simple LaTeX code for the following diagram

The problem here is: I know the code for commuting diagrams like this only when there is the horizontal arrow. But in this diagram there is no horizontal arrow.

• Show us your code and then we can adopt it. Did you checked the user guide? This is a very simple diagram. ctan.org/pkg/xypic – Sigur Apr 17 '15 at 17:58
• Well, I can see distinctly one horizontal arrow. – Bernard Apr 17 '15 at 18:01

Arrows are optional. Don't forget the cmtip option, as the standard arrow tips of Xy-pic are really horrible.

\documentclass{article}

\usepackage{amsmath}
\usepackage[all,cmtip]{xy}

\begin{document}

\begin{gather}
\begin{gathered}
\xymatrix{
V \ar[d] \ar[r]           & W \ar[d] \\
\mathcal{C}(G,K)^m \ar[r] & \mathcal{C}(G,K)^n
}
\end{gathered}
\\
\begin{gathered}
\xymatrix{
V \ar[d]                  & W \ar[d] \\
\mathcal{C}(G,K)^m \ar[r] & \mathcal{C}(G,K)^n
}
\end{gathered}
\\
\begin{gathered}
\xymatrix{
V \ar[d]           & W \ar[d] \\
\mathcal{C}(G,K)^m & \mathcal{C}(G,K)^n
}
\end{gathered}
\end{gather}

\end{document}


The gathered environment is used to center the diagrams with respect to the equation number. If no number is wanted, it's not necessary.

Here are two possibilities, with pst-node and with tikz-cd:

\documentclass[pdf]{article}
\usepackage{mathtools}
\usepackage{pst-node}
\usepackage{tikz-cd}
\newcommand{\dvarprojlim}[1]{\mathop{\mathstrut\varprojlim\limits_{#1}}}

\begin{document}

\texttt{psmatrix solution: }
$\psset{arrows=->, arrowinset=0.25, linewidth=0.6pt, nodesep=3pt,mnode =R, rowsep=1cm, colsep = 1cm} \begin{psmatrix} %%% nodes V & W\\% \mathcal C(G; K)^m & \mathcal C(G; K)^n %%% horizontal arrows \ncline{2,1}{2,2} %%% vertical arrows \ncline{1,1}{2,1}\ncline{1,2}{2,2} \end{psmatrix}$
\vskip 1cm

\texttt{tikz-cd solution: }
$\begin{tikzcd}\ V \arrow{d}& W\arrow{d} \\% \mathcal C(G; K)^m \arrow{r}& \mathcal C(G; K)^n \end{tikzcd}$

\end{document}


Two different maneers of doing it with MetaPost, using the boxes and MetaObj package respectively, and producing the same result. Included in a LuaLaTeX program via the luamplib package for typesetting convenience.

\documentclass[border=2mm, multi=mplibcode]{standalone}
\usepackage{luamplib}
\mplibtextextlabel{enable}
\begin{document}
\begin{mplibcode}
input boxes
beginfig(1);
boxit.V("$V$");
boxit.W("$W$");
boxit.Cm("$\mathcal{C}(G;K)^m$");
boxit.Cn("$\mathcal{C}(G;K)^n$");
Cn.w - Cm.e = (cm, 0);
V.s - Cm.n = (0, cm) = W.s - Cn.n;
drawunboxed(V, W, Cm, Cn);
drawarrow V.s -- Cm.n;
drawarrow W.s -- Cn.n;
drawarrow Cm.e -- Cn.w;
endfig;
\end{mplibcode}

\begin{mplibcode}
input metaobj
beginfig(1);
mat = new_Matrix_(2,2)(
new_Box_("$V$")("framed(false)"),
new_Box_("$W$")("framed(false)"),
new_Box_("$\mathcal{C}(G;K)^m$")("framed(false)"),
new_Box_("$\mathcal{C}(G;K)^n$")("framed(false)"))
("hsep(1cm)", "vsep(1cm)");
mcline.Obj(mat)(1,1, 2,1);
mcline.Obj(mat)(1,2, 2,2);
mcline.Obj(mat)(2,1, 2,2);
Obj(mat).c = origin;
draw_Obj(mat);
endfig;
\end{mplibcode}
\end{document}