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'm trying to write the diagrams of the isomorphism theorems, and I'm having problems. Some objects are too wide, and some arrows too short. Currently I have

$$\xymatrix{A\ar[r]^\pi\ar[d]_\rho & A/C\ar[d]_\tau\ar@{-->}[dl]_\sigma\\
                A/B\ar@{-->}[r]^\theta  & (A/C)/(B/C)\\}\hspace{-4mm}$$
$$\xymatrix{A\ar[r]^\rho\ar[d]_\iota\ar[dr]_\varphi & A/(A\cap N)\ar@{-->}[d]_\theta\\
                A\,N\ar[r]^\pi  & A\,N/N\\}$$

which produces

enter image description here

instead of

enter image description here.

Notice that the problem is the position of (A/C)/(B/C) and A/(A\cap N): both should be positioned more to the right (left justified), so that all arrows were more or less equally long.

How can I specify the length of arrows and position/justification of objects? I'm using \usepackage[all]{xy}.

share|improve this question
    
thanks for the points which enabled me to post the pics. –  Leon Lampret Apr 23 '11 at 20:54
add comment

2 Answers

up vote 5 down vote accepted

You can use the \mathrlap feature of mathtools:

\documentclass[a4paper]{article}
\usepackage[all,pdf,cmtip]{xy}
\usepackage{mathtools}
\begin{document}
\[
\xymatrix{A\ar[r]^\pi\ar[d]_\rho & 
            A/C\ar[d]_\tau\ar@{-->}[dl]_\sigma\\
          A/B\ar@{-->}[r]^\theta  & (A/C)\mathrlap{/(B/C)}}
\]
\[
\xymatrix{A\ar[r]^\rho\ar[d]_\iota\ar[dr]^\varphi &
            A/(A\mathrlap{{}\cap N)}\ar@{-->}[d]_\theta\\
          AN\ar[r]^\pi  & AN/N}
\]
\end{document}

You are lucky that the big objects are in the final column.

share|improve this answer
    
Yes, this works! Thank you :). Is there also a way to lengthen the vertical arrows, so that the diagram would have a more suare-like and less rectangle-like shape? –  Leon Lampret Apr 24 '11 at 12:05
1  
With \xymatrix@R+12pt{...} you add 12pt to the length of the vertical arrows. In order to get alignment of the entries, add \mathstrut to each one; if no entry is too big, this effectively gives them the same height. –  egreg Apr 24 '11 at 13:20
    
great, thank you very much –  Leon Lampret Apr 24 '11 at 14:15
add comment

You can shift a node to the right be preceding it by *+[r] and then enclosing the node in braces. Here's how your examples would look:

\documentclass{article}
\usepackage[all,cmtip]{xy}
\begin{document}

\begin{displaymath}
  \xymatrix{
    A\ar[r]^\pi\ar[d]_\rho
    & A/C\ar[d]_\tau\ar@{-->}[dl]_\sigma\\
    A/B\ar@{-->}[r]^\theta
    & *+[r]{(A/C)/(B/C)}
  }%\hspace{-4mm}
\end{displaymath}
\begin{displaymath}
  \xymatrix{
    A\ar[r]^\rho\ar[d]_\iota\ar[dr]_\varphi
    & *+[r]{A/(A\cap N)} \ar@{-->}[d]_\theta\\
    A\,N\ar[r]^\pi
    & A\,N/N}
\end{displaymath}

\end{document}

That produces:enter image description here

share|improve this answer
    
is there a way to make the top A/C and bottom A/C in (A/C)/(B/C) aligned? Also, is there a way to lengthen the vertical arrows, so that the diagram would have a more suare-like and less rectangle-like shape? –  Leon Lampret Apr 24 '11 at 9:59
1  
@Leon Lampret, for the alignement try : *+[r]{A/C} –  Matsaya Apr 24 '11 at 14:12
1  
@Leon Lampret: For the alignment, as @Matsaya suggests, make that node *+[r]{A/C}. To lengthen the vertical arrows, set the row spacing to whatever you like with @R=length before the opening brace of the xymatrix, as in \xymatrix@R=8ex{ {A} \ar[r]^{\pi}.... (You can also set the column spacing with @C=length in between the \xymatrix and the opening brace.) –  Phil Hirschhorn Apr 24 '11 at 15:31
    
thanks, good advice –  Leon Lampret Apr 24 '11 at 22:38
add comment

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.