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

  • Does it have to be with xy-pic or would you be willing to use another package? – Gonzalo Medina Feb 22 '14 at 4:26
  • I don't know other. So xy-pic will be better for me. – Soumitra Sen Feb 22 '14 at 4:34
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

  • @SoumitraSen You're welcome! Glad I could help! – Gonzalo Medina Feb 22 '14 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} 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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