# xypic: How to typeset the dashed line in this diagram?

I use xypics for diagrams, but I don't know how to put the dashed line in the diagram below. Search didn't find much. Can anybody here help?

• I believe that the only possibility is to insert a new column from the first line to the last one, without entries. – Sigur Feb 8 '13 at 23:08

Here's a way to do it without putting an extra column into the diagram. The dashed line is again inserted as a dashed arrow with no head or tail, i.e., \ar@{--}, but we'll specify both the source and the target of the arrow. In addition, both the source and the target of the arrow will be displaced from one of the nodes. The actual specification of the dashed line is

\ar@{--}[]+<3.5em,0em>;[dddd]+<3.5em,0em>

Note the semicolon; that means that the source is the thing before it and the target is the thing after it. The source is thus []+<3.5em,0em>. Since [] denotes the current node, the source is the point 3.5em to the right and 0em down from the current node.

Similarly, the target of the arrow is [dddd]+<3.5em,0em>, which means the point 3.5em to the right and 0em down from the node [dddd].

Here's a complete latex file:

\documentclass{article}
\usepackage[cmtip,all]{xy}
\begin{document}
\thispagestyle{empty}
\begin{displaymath}
\xymatrix  {
&& 0\ar[d] \ar@{--}[]+<3.5em,0em>;[dddd]+<3.5em,0em>
& 0\ar[d]
&  0\ar[d]\\
& 0\ar[d] \ar[r]
& \Gamma^n\Omega^1 \ar[d] \ar[r]^-{d}
& \Gamma^{n-1}\Omega^1\otimes\Omega^1\ar[d] \ar[r]^{d}
& \Gamma^{n-2}\Omega^1\otimes\Omega^2 \ar[d] \ar[r]
& \cdots   \\
0 \ar[r]
& A\ar[d]_{Id} \ar[r]^{d^1}
& P^n\ar[d] \ar[r]^-{D}
& P^{n-1}\otimes \Omega^1\ar[d] \ar[r]^{D}
& P^{n-2}\otimes \Omega^2\ar[d] \ar[r] & \cdots \\
0 \ar[r]
& A\ar[d]_{Id} \ar[r]^{d^1}
& P^{n-1}\ar[d] \ar[r]^-{D}
& P^{n-2}\otimes \Omega^1\ar[d] \ar[r]^{D}
& P^{n-3}\otimes \Omega^2\ar[d] \ar[r]
& \cdots \\
& 0
& 0
& 0
& 0
}
\end{displaymath}
\end{document}


It produces

• Nice. Is there also a way to specify 3.5em as half the column width? – bodo Feb 9 '13 at 7:20
• @canaaerus: Sorry, I don't know how to refer to the column width, except for the command that can set it. I found the 3.5em by trial and error. – Phil Hirschhorn Feb 9 '13 at 14:05

I believe that the only possibility is to insert a new column from the first line to the last one, without entries.

You can control the space between columns changing the value 2em.

Probably it is not possible to change the space only for some columns.

$\xymatrix@C=2em@R=2em{ & & 0\ar[d] & \ar@{--}[dddd] & 0\ar[d] & 0\ar[d] & & \\ & 0\ar[d] \ar[r] & \Gamma^n\Omega^1 \ar[d] \ar[rr]^{d} && \Gamma^{n-1}\Omega^1\otimes\Omega^1\ar[d] \ar[r]^{d}& \Gamma^{n-2}\Omega^1\otimes\Omega^2 \ar[d] \ar[r]& \cdots \\ 0 \ar[r] & A\ar[d]_{Id} \ar[r]^{d^1} & P^n\ar[d] \ar[rr]^{D} && P^{n-1}\otimes \Omega^1\ar[d] \ar[r]^{D} & P^{n-2}\otimes \Omega^2\ar[d] \ar[r] & \cdots \\ 0 \ar[r] & A\ar[d]_{Id} \ar[r]^{d^1} & P^{n-1}\ar[d] \ar[rr]^{D} && P^{n-2}\otimes \Omega^1\ar[d] \ar[r]^{D} & P^{n-3}\otimes \Omega^2\ar[d] \ar[r] & \cdots \\ & 0 & 0 && 0 & 0 & }$


• Great. That @C=1em is for columns? is there a similar thing that controls vertical arrows? – h__ Feb 8 '13 at 23:19
• Use @R= for rows. – Sigur Feb 8 '13 at 23:21
• Just write in sequence: @C=1cm@R=2cm for example. – Sigur Feb 8 '13 at 23:25
• Say I want to set @C=5em@R=5em globally, what do I do? – h__ Feb 8 '13 at 23:25
• I don't know. I guess that you have to set up one by one. You have to adjust each matrix at once. – Sigur Feb 8 '13 at 23:27

You can use \save \restore in matrix. For example:

\xymatrix{ ..... &  \save "1,1";"1,2" **@{} ?(0.5) ;p+/d/ ?!{"2,1";"2,2"} **@{--} \restore}


Detailed code description follows:

• "1,1";"1,2" **@{} draws empty line from element "1,1" to element "1,2".
• ?(0.5) moves c to the middle of the empty line.
• ;p+/d/ set up p-c to down direction
• ?!{"2,1";"2,2"} moves point c to the intersection of p-c and line "2,1";"2,2"
• **@{--} draws dashed line

You should not forget to insert \shorthandoff{"} in LaTeX.