[Xy-pic] Background colour

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


Hello Damjan,

On 23/02/2011, at 4:42 PM, Damjan Perenic wrote:

> On Tue, Feb 22, 2011 at 1:46 AM, Daniel Müllner
> <nospamplease at stanford.edu> wrote:
>> Hi Damjan,
>> 
>> currently, the xypdf driver cannot vary the line thickness. In fact, support
>> for Xy-pic's "line" extension is the last piece that is missing for
>> completeness. I simply haven't had the time to implement it, but I am
>> definitely planning to add this.
>> 
>> For now, I am afraid that I must recommend the PostScript driver if you need
>> lines of different widths in your diagrams.
> 
> Is it possible to "frame" an arrow? Then I could make an invisible
> line with coloured frame. For lines (not arrows) this would work.
> 
> I experimented with \ar@{-}@[F-][r] but could not get the results I wanted.

An \ar does not produce an <object> but a <connection>, which is
a way of drawing a line/curve/arrow/... that in some sense represents
a connection between two <objects>.

A frame, on the other hand, is a <decoration> that can be applied to
an <object>. 

Read the Xy-pic Reference Manual, (in a file  xyrefer.pdf , 
that should have been distributed with your TeX installation)
to understand the principles on which Xy-pic is constructed.
This will help you understand better what can, and cannot, be done.


Now maybe the following coding is relevant to what you want to do.


>>> \documentclass[11pt]{article}
>>> \usepackage[ps,dvips,all,line,color]{xy}
>>> \begin{document}
>>> 
>>> \xymatrix{
>>>  A & B \\
>>>  C\ar@{-}@[yellow]@[thicker]@[butt]@[thicker]@[thicker]@[thicker]@[thicker][ur]
>>>    \ar@[red][ur] & D
>>> }
>>> 
>>> \xymatrix{
>>>  A & B \\
>>>  C\ar@{-}@[yellow]@[thicker]@[roundcap]@[thicker]@[thicker]@[thicker]@[thicker][ur]
>>>    \ar@[red][ur] & D
>>> }
>>> 
>>> \xymatrix{
>>>  A & B \\
>>>  C\ar@{-}@[yellow]@[thicker]@[projcap]@[thicker]@[thicker]@[thicker]@[thicker][ur]
>>>    \ar@[red][ur] & D
>>> }
>>> 
>>> \end{document}  

The result is shown in the attached image.




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


Make sure that you process this using TeX+DVI mode, rather
than using pdf-(La)TeX as the processing engine.

This draws first a wide coloured line as an arrow with no tips, 
over which you then draw the (coloured) arrow that you want framed.
Thus the first arrow drawn serves as a background for the second one.

Note that you may want to choose the line-cap for the wide line,
else you can get an overlap with the objects being connected.


> 
> Damjan


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





More information about the xy-pic mailing list