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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A\ar@{-} [rr]  & & D\ar @{-}[r] & E\\
 L\ar @{-}[rrr]              &         &         & M \\
P\ar[rrr]\ar[uu]  & R\ar[ruu] & S & T\ar @{-}[uu]


This produces the following diagram :

Commutative  diagram

But, I would like to produce the diagram below :

Adjusted diagram

How can I do this using the package xypic?

share|improve this question
The line RP not shown here. The line RP will remain in the final diagram. – Soumitra Sen Apr 3 '13 at 4:33
Would you be willing to use another package? – Gonzalo Medina Apr 3 '13 at 4:39
If this package fails to do this, tell me another. – Soumitra Sen Apr 3 '13 at 4:42

Here is an xypic version of your second diagram.

Sample output




  (0,0)="P"; (0,2)="A" **@{-};
  (4,2)="E" **@{-}; (4,0)="T" **@{-}; "P" **@{-},
  (0,1)="L"; (4,1)="M" **@{-},
  (1.3,0)="R"; "R"+(0,0.1) **@{-},
  (3,0)="S"; "S"+(0,0.1) **@{-},
  (2.6,2)="D"; "D"-(0,0.1) **@{-},
  (2.2,0) *{>},


The first collection of commands draws the lines and provides some reference names for the points. The second collection prints the arrow and the labels. See the Reference Manual of xypic (or texdoc xyrefer on your computer) for more details. This is more helpful than the User Guide (texdoc xypic), which is mostly directed towards creation of so-called "commutative diagrams".

Note the syntax carefully. The line drawing operation **@{-} uses the last two points on a stack; it is followed by ; when we want to continue on from the last point, but by , when we need to start a completely new operation.

I guess you were also asking how to add arrows to this diagram, presumably from R to D, rather than R to P in the comment. One way would be

"R"; "D" **@{-} ?(.7)*\dir{>}

which places the arrow head .7 of the distance from R to D. A comparable construction could be used for the arrow on the bottom line.

share|improve this answer

I don't know xy well, but here's one possibility using TikZ:



\begin{tikzpicture}[node distance=1cm]
% coordinates for the points
\coordinate (A) ;
\coordinate[right = 2cm of A] (D) ;
\coordinate[right = of D] (E) ;
\coordinate[below = of A] (L) ;
\coordinate[below = of L] (P) ;
\coordinate[right = of P] (R) ;
\coordinate[right = 1.3cm of R] (S) ;
\coordinate[below = of E] (M);
\coordinate[below = of M] (T);
% join some points with straight line segments
\draw (R) -- (P) -- (L) -- (A) -- (D) -- (E) -- (M) -- (T) -- (S);
\draw (L) -- (M);
% draw the segment from R to S with arrow in the middle
\draw[postaction=decorate,decoration={markings,mark=at position 0.5 with {\arrow{>}}}] (R) -- (S);
% draw tick-marks at R,S and D
\draw (R) -- +(0,3pt);
\draw (S) -- +(0,3pt);
\draw (D) -- +(0,-3pt);
% place the labels
\foreach \coor/\posi in {R/below,P/below left,L/left,A/above left,D/above,E/above right,M/right,T/below right,S/below}
  \node[\posi] at (\coor) {\coor};


enter image description here

share|improve this answer
I have no idea about 'tikzpicture' could you please give me some reference book where I can get details esily about this package? Thank you. – Soumitra Sen Apr 3 '13 at 5:11
@SoumitraSen My answer contains the link to the package in CTAN; following this link you'll see another ones; amongst them, one to the PGF manual and the other, to a Minimal introduction to TikZ (I provided the links here, for your commodity). There's also TeXample.net with a gallery of examples. – Gonzalo Medina Apr 3 '13 at 5:20

Your Answer


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.