[Xy-pic] right-justification of entries in xymatrix?
Ross Moore
ross at ics.mq.edu.au
Mon Aug 11 23:58:38 CEST 2008
Hi Roger,
On 12/08/2008, at 6:38 AM, Roger Hart wrote:
> Dear Ross,
>
> Please forgive me for again troubling you, and for contacting you
> directly, but I have what I hope might be a very quick question
> about xymatrix that I've not been able to solve.
>
> I'm now trying to create a website explaining early Chinese
> solutions to linear algebra problems. I am of course using xymatrix
> to add arrows to the matrices.
>
> The Chinese matrices need to be right-justified, that is, the right-
> hand edge of the entries in each column need to be in a line. I've
> tried to use the @*[l] command:
No. Xy-pic doesn't recognise that...
>
> \xymatrix @*[l] {
> {\two~} & {\zero~} & {\zero~} & {\zero~} \\
> {\Sixty~\Zero~} & {\zero~} & {\zero~} \\
> {\fbox{\ten~\four~\sixty~\eight~\eighty~\zero~\zero~\zero~\zero~
> \zero~\zero~\zero~}} & {\twenty~\zero~} & {\zero~} \\
> }
... but the \everyentry macro should help:
{\def\everyentry{\hfill}
\xymatrix @*[l] {
{\two~} & {\zero~} & {\zero~} & {\zero~} \\
{\Sixty~\Zero~} & {\zero~} & {\zero~} \\
{\fbox{\ten~\four~\sixty~\eight~\eighty~\zero~\zero~\zero~\zero~
\zero~\zero~\zero~}} & {\twenty~\zero~} & {\zero~} \\
}}
>
> Unfortunately for my purposes, xymatrix first creates the column,
> then shifts the entries to the left, leaving a large space. I was
> wondering if there was a way to justify entries on the right, and
> still keep the space between the columns small? I've also
> experimented quite a bit but I've not found any solution.
>
> If it helps, the page I'm having trouble with is
>
> http://uts.cc.utexas.edu/~rhart/cgi-bin/determinants-dev.pl
>
> If you choose problem 23, and go to step 1, 2, 3 ..., you can
> perhaps better see what I mean.
Neat.
Nice application of Xy-pic.
Can you make it applicable to score-keeping for the Olympics?
:-)
>
> Again, my apologies for again bothering you,
>
> Roger
Cheers,
Ross
------------------------------------------------------------------------
Ross Moore ross at maths.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