[pstricks] pstricks and color revisited (with xypic)

Alan Ristow ristow at ece.gatech.edu
Fri Jan 4 20:46:32 CET 2008


Jonny Smith wrote:
> Hi,
> 
>       a - To use the standard `color' or `xcolor' package with PSTricks, you
> must load the `pstricks.sty' package, which interface the two packages,
> loading them in the right order, and overriding some small parts of
> PSTricks to allow it to use the `color' or `xcolor' package system for
> specifying color. We STRONGLY recommend that you use this way today.
> pstricks.sty loads by default the xcolor package, but there is an option
> "noxcolor". If you are a LaTeX user then load _always_ first the
> pstricks.sty package.
> 
>       b - Don't try to load the `color' or `xcolor' package if you use
> `pstricks.sty' or `pst-all' (it is already loaded in the correct order).
> 
> I'm not sure if I understood this right so I did
> 
> \documentclass{minimal}
> 
> \usepackage{pstricks}

This will automatically load xcolor instead of color -- item (a) above 
is trying to explain that you need to use the noxcolor option here.

> \usepackage{pst-grad}
> \usepackage[usenames]{color}

This is redundant, since pstricks has already loaded xcolor (or color) 
at this point. This is explained in item (b).

> \usepackage[dvips,all,color]{xy}

Try changing your \usepackage statements to the following:

\usepackage[noxcolor,usenames]{pstricks}
\usepackage{pst-grad}
\usepackage[dvips,all,color]{xy}

With this, pstricks will load color instead of xcolor and pass the 
usenames option on to color.

There are still other problems with your code:

> \definecolor{Ofont}{rgb}{0,0,0.8}
> 
> \begin{document}
> 
> \newxyColor{lightblue}{0.8 0.85 1}{rgb}{}
> 
> \psset{linestyle=none,fillstyle=gradient,gradmidpoint=0,gradend=yellow!40}

The color package will not recognize yellow!40 as a valid color choice 
-- that is xcolor syntax. If you really need a 40% yellow then you will 
have to define a custom color.

> \centering
> \xy (0,-20)*+<1.5pt>[<40pt>]{
>         \begin{pspicture}(-2.5,-1.25)(2.5,1.25)
>           \psellipse[gradbegin=blue!40,GradientScale=2](2.5,1.25)

Here also, color will not recognize blue!40 as a valid color.

>         \end{pspicture}
>         \begin{pspicture}(3,4)
>           
> \pspolygon[gradbegin=black,GradientPos={(-1,1)},GradientScale=2](0,0)(1,3)(3,2)(1.5,2)(2,0.5)
>         \end{pspicture}
> };
> (0,-30)*++[F**:lightblue:<10pt>]{
> {\color{Ofont}
>         - X   & = & Y

I had to remove both "&" characters from this line to make your code 
compile. I am utterly unfamiliar with xypic, so I cannot possibly say 
why this is the case.

Hope that helps.

Alan



More information about the PSTricks mailing list