[Xy-pic] (no subject)

Ross Moore ross.moore at mq.edu.au
Thu Feb 24 22:57:49 CET 2011


Hello Jeremy,

On 25/02/2011, at 7:49 AM, Jeremy J Graveline wrote:

> I recently started using xy-pic in my lecture notes, but I can't seem to figure out how to horizontally align entries in an xymatrix.  I thought that '**[r]' would align the entry 'right', while '**[l]' would align the entry 'left'.  However, this doesn't seem to be the case with the following code (where I would like the 'xymatrix' and the 'array' to essentially have the same horizontal column alignment) ...
> 
> \documentclass[english]{article}
> 
> \usepackage[all]{xy}
> 
> \begin{document}
> 
> \[
> \xymatrix{
> A \times B & **[l] C \\
> **[r] D & E \times F
> }
> \]

** is wrong, as this introduces a <connection>, not an <object>.
The [l] and [r] have nothing to do with alignments.
For this you want !L  and !R .

Try the following solutions:

\[
\xymatrix{
*!R{A \times B}& *!L{C} \\
*!R{D} & *!L{E \times F}
}
\]

\[
\xymatrix @R=4pt @C=0pt{
*!R{A \times B}& *!L{C} \\
*!R{D} & *!L{E \times F}
}
\]

\[
\xymatrix{
*!R=0{A \times B}& *!L=0{C} \\
*!R=0{D} & *!L=0{E \times F}
}
\]

\[
\xymatrix{
A \times B & C\phantom{\times E} \\
\relax\phantom{E\times}D & E \times F
}
\]


Adjust the @R= and @L=  amounts to adjust
the space between rows and columns.
Negative lengths can be used too.



Hope this helps,

	Ross


> 
> \[
> \begin{array}{rl}
> A \times B &  C \\
> D & E \times F
> \end{array}
> \]
> 
> \end{document}
> 
> Any guidance would be very much appreciated.
> 
> 
> 
> _______________________________________________
> xy-pic mailing list
> http://tug.org/mailman/listinfo/xy-pic

------------------------------------------------------------------------
Ross Moore                                       ross.moore at mq.edu.au 
Mathematics Department                           office: E7A-419      
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------






More information about the xy-pic mailing list