Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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'.

share|improve this question
    
Does it have to be with xy-pic or would you be willing to use another package? –  Gonzalo Medina Feb 22 at 4:26
    
I don't know other. So xy-pic will be better for me. –  Soumitra Sen Feb 22 at 4:34

2 Answers 2

up vote 9 down vote accepted
\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

share|improve this answer
    
Thank you @ GonzaloMedina. +1 for you. –  Soumitra Sen Feb 22 at 4:37
    
@SoumitraSen You're welcome! Glad I could help! –  Gonzalo Medina Feb 22 at 4:40
    
@karlkoeller Thanks for the edit! –  Gonzalo Medina Feb 22 at 14:26

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} 
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.