# Draw dots at the beginning and at the end of an arrow with xypic

I want to draw the following figure :

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 :

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

\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}


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}


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}


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

Here's another solution made with xypic arrows only.

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}

-