6

I want to draw the following figure :

enter image description here

I have compiled with following code to get it :

\documentclass{book}
\usepackage[all]{xypic}
\begin{document}
 $\xymatrix{\vdots && \vdots \\
 \downarrow && \downarrow\\
A \ar[rr] && B\\
\downarrow && \downarrow \\
\vdots && \vdots}$
\end{document}

which produces :

enter image description here

How can I draw my desired diagram with 'xypic'.

2
  • Does it have to be with xy-pic or would you be willing to use another package? Commented Feb 22, 2014 at 4:26
  • I don't know other. So xy-pic will be better for me. Commented Feb 22, 2014 at 4:34

2 Answers 2

9
\documentclass{book}
\usepackage[all]{xy}
\begin{document}
 $\xymatrix{\vdots\ar[d] && \vdots\ar[d] \\
A \ar[rr]\ar[d] && B\ar[d]\\
\vdots && \vdots}$
\end{document}

enter image description here

Since \vdots inserts some space at the top, the previous version looks "uneven"; here's the same diagram with a modified version of \vdots to prevent too much spacing at the top:

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

\makeatletter
\DeclareRobustCommand{\tvdots}{%
  \vbox{\baselineskip4\p@\lineskiplimit\z@\kern0\p@\hbox{.}\hbox{.}\hbox{.}}}
\makeatother

\begin{document}
 $\xymatrix{\tvdots\ar[d] && \tvdots\ar[d] \\
A \ar[rr]\ar[d] && B\ar[d]\\
\tvdots && \tvdots}$
\end{document}

enter image description here

The same diagram with tikz-cd:

\documentclass{book}
\usepackage{tikz-cd}

\makeatletter
\DeclareRobustCommand{\tvdots}{%
  \vbox{\baselineskip4\p@\lineskiplimit\z@\kern0\p@\hbox{.}\hbox{.}\hbox{.}}}
\makeatother

\begin{document}
 \begin{tikzcd}
\tvdots\ar{d} && \tvdots\ar{d} \\
A \ar{rr}\ar{d} && B\ar{d} \\
\tvdots && \tvdots
\end{tikzcd}
\end{document}

enter image description here

1
  • @SoumitraSen You're welcome! Glad I could help! Commented Feb 22, 2014 at 4:40
5

Here's another solution made with xypic arrows only.

enter image description here

Code:

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

\begin{document}
 \[
 \xymatrix{
   \ar@{.}[d] && \ar@{.}[d] \\
   \ar[d] && \ar[d] \\
   A \ar[rr]\ar[d] && B\ar[d]\\
   \ar@{.}[d] && \ar@{.}[d] \\
    &&
   }
 \]
\end{document} 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .