# Can \usepackage{color} and \input tikz work together in Plain TeX/eplain?

I use Plain TeX and Eplain. In my document I'm using both the color and url packages inside the \beginpackages..\endpackages block. Just now I tried adding \input tikz.tex (as the TikZ manual states) to the document and got the error:

Package pgfbase: Error! Unsupported color model '. Sorry.


over and over. The document's colors were all wrong (indeed, they were gone) and the document looked terrible.

I figured that the color package somehow conflicted so I removed that and disabled the hyperlinks I was using which automatically introduce color.

Is there any way to get the color package with Eplain and TikZ to play nicely together? I'd rather not disable hyperlinks.

Here's a sample input file, as requested.

\input eplain
\beginpackages
\usepackage{url}
\usepackage{color}
\endpackages
\hlopts{}

\input tikz

\definexref{anchor}{display}{type} Hi there. This refers to the \ref{anchor}.

\bye


This file will produce the warning above and also produce odd-looking PDF output. Without the \input tikz it should look normal.

-
It's hard to tell without at least a small example of code. – egreg Jan 31 '12 at 17:27
@egreg, added one. – EfForEffort Jan 31 '12 at 20:49

Set the colors after loading tikz; moreover use the following pattern:

\input eplain
\beginpackages
\usepackage{url}
\usepackage{color}
\endpackages

\input tikz

\definecolor{urlcolor}{rgb}{.2,.4,.6}
\hlopts{colormodel=,color=urlcolor}

\definexref{anchor}{display}{type} Hi there. This refers to the \ref{anchor}.

\bye


Using

\hlopts{colormodel=rgb,color={.2,.4,.6}}


(that according to the docs should work) breaks tikz. Remember that tikz` supports only the rgb and gray color models.

-
Thanks, @egreg, this works great! How could I have figured out the solution to this problem? I don't know much about colors; maybe I should start there. – EfForEffort Feb 1 '12 at 1:38
@D.Bueno I just tried to figure out what was happening and the usual strategy of moving things around. – egreg Feb 1 '12 at 9:16