# pstricks and beamer - problem maybe with xcolor?

While creating beamer slides in our comporate design (which forced me using own colors) I got the following problem:
Having a PS-Tricks image within a frame seems to collide with my own color setted up for the foreground text.
Compiling works fine (latex and further dvips) - but running ps2pdf oder viewing the Postscript file results in the following error:

Error: /undefined in XC@mytext
Operand stack:

Execution stack:
%interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval-
-   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   fa
lse   1   %stopped_push   1910   1   3   %oparray_pop   1909   1   3   %oparray_
pop   1893   1   3   %oparray_pop   1787   1   3   %oparray_pop   --nostringval-
-   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringv
al--   2   %stopped_push   --nostringval--
Dictionary stack:
--dict:1159/1684(ro)(G)--   --dict:0/20(G)--   --dict:142/200(L)--   --dict:1
75/300(L)--
Current allocation mode is local
Last OS error: No such file or directory
Current file position is 149367
MiKTeX GPL Ghostscript  9.00: Unrecoverable error, exit code 1


I think there seems to be a problem with my color "mytext" - but I do not know, how to solve that.
My minimal example for reproduction is

\documentclass{beamer}
\DefineNamedColor{named}{mytext}{RGB}{144,132,118}
\setbeamercolor{normal text}{fg=mytext}
\usepackage{pst-all}%,auto-pst-pdf
\begin{document}
\begin{frame}
\begin{pspicture}(-4,-4)(4,4)
\pscircle*(-2,2){0.5}
\end{pspicture}\par%
Toll
\end{frame}
\end{document}


The problem occurs using MikTeX on Win* or TeXlive on Linux...

-

This is not a beamer problem. I get the same error with article. \DefineNamedColor is a command from the old color.sty and I would say there is somewhere a bug in the adaption of xcolor (or you are using it not correctly). The problem disappears if one use the genuine xcolor command:

\documentclass{beamer}
%\DefineNamedColor{named}{mytext}{RGB}{144,132,118}
\definecolor{mytext}{RGB}{144,132,118}
\setbeamercolor{normal text}{fg=mytext}
\usepackage{pst-all}%,auto-pst-pdf
\begin{document}
\begin{frame}
\begin{pspicture}(-4,-4)(4,4)
\pscircle*(-2,2){0.5}
\end{pspicture}\par%
Toll
\end{frame}
\end{document}

-
for the named colors you need the prologue option of xcolor –  Herbert Oct 11 '11 at 12:03
@Ulrike Fischer - this works - thanks. At Herbert - even without the prologue Ulrikes change did it. –  Bastian Ebeling Oct 11 '11 at 14:02

the beamer package has lots of buggy things. Try this:

\PassOptionsToPackage{prologue}{xcolor}%%%%%%%% <===
\documentclass{beamer}
\DefineNamedColor{named}{mytext}{RGB}{144,132,118}
\setbeamercolor{normal text}{fg=mytext}
\usepackage{pst-all}%,auto-pst-pdf
\begin{document}
\begin{frame}
\begin{pspicture}(-4,-4)(4,4)
\pscircle*(-2,2){0.5}
\end{pspicture}\par%
Toll
\end{frame}
\end{document}


However, you can use xelatex, too. It has'nt that problem.

-
Thank you Herbert for your help. I personally selected Ulrikes way as my solution. But additionally - even xelatex wasn't able to build that pdf... (on my different maschines) - does it with you? –  Bastian Ebeling Oct 11 '11 at 14:05