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 am working with the following code:

\documentclass[12pt,letterpaper]{article}
\usepackage[all]{xy}
\begin{document}

\[
\xymatrix
{
                &   A \ar[dd]_{\pi_A}                                   \\
                &   &   **[r] G(A) = G(B)=Z\oplus Z\oplus Z\oplus Z     \\
**[l] 4\beta+ f(\beta) + g(\beta) = &   B \ar[dd]_{\pi_B}               \\
                &   &   **[r] F(B) = F(C)                               \\
**[l] \gamma=   &   C
}
\]
\end{document}

This code creates the following diagram:

enter image description here

It looks pretty good, except that I would like the left-most column to be much closer, almost touching the center column, and also for the right-most column to be much closer, but maybe an inch or so away from the center column.

If I change the line \xymatrix to \xymatrix@C=-45pt, I get something pretty good, but this solution seems very ad-hoc to me. I think that the issue is that the column alignment is keeping the centerline of the column the same, and keeping the column widths the same, and aligning the entries to flush right (or left) along this centerline, rather than flush right (or left) in the space allotted to the column.

share|improve this question
add comment

1 Answer 1

up vote 5 down vote accepted

Would this be better?

\[
\hphantom{4\beta+ f(\beta) + g(\beta) ={}}
\xymatrix@R+1pc
{
A \ar[d]_{\pi_A}^{\qquad\textstyle G(A) = G(B)=Z\oplus Z\oplus Z\oplus Z} \\
\llap{$4\beta+ f(\beta) + g(\beta) ={}$}B \ar[d]_{\pi_B}^{\qquad\textstyle F(B) = F(C)} \\
\llap{$\gamma={}$}C
}
\]

enter image description here

share|improve this answer
    
beautiful... thanks! –  Andrey Aug 25 '12 at 18:20
    
I have work-arounds for this issue, but maybe you have a clean solution: Because of the \llaps, the figure does not center properly: it thinks its "center" is to the right of where it should be. Any ideas? –  Andrey Aug 25 '12 at 19:05
    
@Andrey I've added an \hphantom to keep the centering –  egreg Aug 25 '12 at 19:30
    
The solution I ended up using was to \rlap the \qquad and text on the right side as well. Thanks for your help! –  Andrey Aug 25 '12 at 20:43
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.