[Xy-pic] curve coloring

Ross Moore ross at ics.mq.edu.au
Wed Jun 14 03:06:59 CEST 2006


Hello Chris,

On 14/06/2006, at 4:45 AM, Christopher K. Storm Jr wrote:

> Greetings,
>
> I have what I hope is an easy question which is proving quite  
> vexing.  I'm trying to color a curve.
>
> My document headers that pertain to xypic and color are
>
> \usepackage[dvips, ps, all, color, rotate]{xy}
> \xyoption{arc}
> \usepackage[usenames]{color}
>
> I'm using TexShop on MacOSX and am set to typeset to TeX and  
> GhostScript.

In that case, it's best to use the full PostScript back-end,
and (optionally) load the 'rotate' extension for rotation
and scaling features.

\usepackage[dvips, ps, all, color, rotate]{xy}


> "A"; "B" **\crv{ (-8, 40) & (8, 40) };
> "A"; "B" **\crv{ (-8, -40) & (8, -40) };

You can apply modifiers to \crv <object>s, just like any other:

"A"; "B" **[red]\crv{ (-8, 40) & (8, 40) };
"A"; "B" **[blue][thicker][thicker]\crv{ (-8, -40) & (8, -40) };


Also, while this kind of nesting of \xy ... \endxy works,

> (75, 0)*++{\xy
> (0,20)*{\bullet}="v1"+(1, 3)*{v_1};
> (10,0)*{\bullet}="v2"+(1, 3)*{v_2};
> (0,-20)*{\bullet}="v3"+(1, -3)*{v_3};
> (30,0)*{\bullet}="v4"+(2, 2)*{v_4};
> {\ar@{-}@[red] "v1"; "v2"};
> {\ar@{-}@[red] "v1"; "v3"};
> {\ar@{-} "v1"; "v4"};
> {\ar@{-}@[red] "v2"; "v3"};
> {\ar@{-} "v2"; "v4"};
> {\ar@{-} "v3"; "v4"};
> \endxy}= "y";

  ... it is better to use the \xybox{...}  <object>

(75, 0)*!C++\xybox{%
   (0,20)*{\bullet}="v1"+(1, 3)*{v_1};
   (10,0)*{\bullet}="v2"+(1, 3)*{v_2};
   (0,-20)*{\bullet}="v3"+(1, -3)*{v_3};
   ...
   ... }

because you can then apply modifiers that will
apply to everything within the \xybox .

(75, 0)*!C++[blue][thicker]\xybox{%
   (0,20)*{\bullet}="v1"+(1, 3)*{v_1};
   (10,0)*{\bullet}="v2"+(1, 3)*{v_2};


> {\ar@{->} "x"; "y"};
> \endxy
> \]
>
> The red for the arrows comes out quite nicely.  Is it possible to  
> make the curves in the first half also turn red?  If not, are there  
> any suggestions for work arounds?

Explained above.

>
> Thank you and best,
> Chris Storm

Hope this helps,

	Ross Moore

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




More information about the xy-pic mailing list