# [Xy-pic] xy-matrix and xy-pic

Ross Moore ross.moore at mq.edu.au
Mon May 7 00:11:41 CEST 2012

Hello Vasco,

On 05/05/2012, at 11:28 PM, Vasco Visser wrote:

> Hi Ross,
>
> Thanks a lot for your elaborate reply. I think that I am now able to
> create what I need.
>
> There are a few "exotic" things I would like to have. For example I am
> thinking of a custom arrow that is a double line arrow with a tip on
> one side on the upper line and a tip on the other side on the bottom
> line, the two lines should also cross each other halfway; somewhat
> like the shuffle symbol on media players.

This gives pretty much what you describe.
It requires creating some new directionals, based upon what
Xy-pic already provides, and a little knowledge of the internals.
Also, some playing around with the numbers was required, to get
it looking quite good.

It requires using double-lines that are a bit further apart
(by a factor of 1.8) than what Xy-pic usually uses, hence the
new directional  \dir{1.8=}  and the  \xydefcsname2  which
defines it, and the  \xyletcsnamecsname@  which allows
the short-cut to map to the definition.

>>> \newdir{_^>}{{}*!/^-0.6\jot/\dir^{>}*!/_-0.6\jot/\dir_{>}}
>>> \newdir{xx}{{}*=<1.2mm>[o]\dir{x}}
>>>
>>> \makeatletter
>>> \xydefcsname@{dir1.8{=}}{\line@ \double@{1.8\xydashh@}}
>>> \xyletcsnamecsname@{dir{1.8=}}{dir1.8{=}}
>>> \makeatother
>>>
>>>
>>> \begin{displaymath}
>>>  \xymatrix at R+1pc @C+1pc{
>>>    *++{A}
>>>    \ar@{{_^>}{1.8=}{_^>}}[r]|-*@{xx}
>>>    \ar@{{_^>}{1.8=}{_^>}}[d] |-*@{xx}
>>>    \ar@{{_^>}{1.8=}{_^>}}[dr] |-*@{xx}
>>>    & {C} \ar@{->}[d]
>>>    \\
>>>    {B} & {D}
>>>  }
>>> \end{displaymath}
>>>
>>> \begin{displaymath}
>>> \UseTips %{ams}
>>>  \xymatrix at R+1pc @C+1pc{
>>>    *++{A}
>>>     \ar@{{_^>}{1.8=}{_^>}}[r]|-*@{xx}
>>>    \ar@{{_^>}{1.8=}{_^>}}[d] |-*@{xx}
>>>    \ar@{{_^>}{1.8=}{_^>}}[dr] |-*@{xx}
>>>    & {C} \ar@{->}[d]
>>>    \\
>>>    {B} & {D}
>>>  }
>>> \end{displaymath}

-------------- next part --------------
A non-text attachment was scrubbed...
Name: texshop_image.jpeg
Type: image/jpeg
Size: 66864 bytes
Desc: not available
URL: <http://tug.org/pipermail/xy-pic/attachments/20120507/7659dfb9/attachment-0001.jpeg>
-------------- next part --------------

The cross-over (using \dir{xx} )  is placed just like any
other break in an arrow. It is really just a \dir{x} but with
some space allocated to put a gap in the arrow.

>
> Can you give me any pointers on creating a custom arrow type like this?

The harpoons don't quite match the line-ends on the diagonal
arrows. That may be a subtle bug in Xy-pic, not noticed before.
It happens also without  xypdf .
Kris ??

By studying the coding of the \dir{=}  directional,
you could make the double lines a bit farther apart, then
make the harpoons fit this extra width.

>
> Thanks again for your help. And, I must says that despite the learning
> curve that might be considered a little bit steep, Xy-pic is a really
> awesome typesetting tool! I already made some very nice diagrams with
> it.
>
> P.S. I came across a situation where a diagram wouldn't compile due to
> the line style of an arrow being '.'. Changing the line style to '-'
> made that it could compile. I think this might be a bug. I can't
> reproduce in a simple diagram, should I nevertheless file a bug report
> somewhere?
>
> Regards,
>
> Vasco

Hope this helps,

Ross

------------------------------------------------------------------------
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
------------------------------------------------------------------------