5

When I do this...

\documentclass{minimal}
\usepackage[all]{xy}

\begin{document}
This text should come directly before the diagram.
\[ \xymatrix@ru{
\bullet \ar[rd] \ar[d] \\
\bullet \ar[r] \ar[rd] & \bullet \ar[rd] \ar[d] \\
& \bullet \ar[r] \ar[rd] & \bullet \ar[d] \\
& & \bullet
} \]
This text should come directly after the diagram.
\end{document}

... there is a bunch of empty space between the bottom of the diagram and the second line of text. When I remove the @ru, it becomes apparent that the rotated xymatrix is taking up the same amount of vertical space as the unrotated one, even though the rotated matrix is much smaller vertically.

Is this a bug, or a feature? Either way, how can I prevent this behavior?

3

It appears that Xy-pic is not able to compute the correct bounding box; however, there's another way to build the same diagrams: just use a "double spaced" matrix reducing the intercolumn and interrow space.

\documentclass{article}
\usepackage[all]{xy}

\begin{document}
This text should come directly before the diagram.
\[
\xymatrix@C-6pt@R-6pt{
 \bullet \ar[rr] \ar[rd] && \bullet \ar[rr] \ar[rd] && \bullet \ar[rd] \\
 & \bullet \ar[rr] \ar[ru] && \bullet \ar[rr] \ar[ru] && \bullet
}
\]
This text should come directly after the diagram.
\end{document}

enter image description here

Maybe \xymatrix@C-12pt@R-6pt is even better.

  • Thanks for the suggestion! I wanted to rotate the diagrams, rather than double-spacing them, because it would make the source code substantially more readable for me, and also make it easier to build larger diagrams out of the code for the smaller ones. In the end, I just decided to leave the diagrams unrotated: if you can't beat 'em, join 'em. – Vectornaut Dec 20 '12 at 7:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.