# tikz and colorboxes in plain tex

I recently discovered that I could use tikz in my plain tex documents using \input tikz. I'm happy with it and began to experiment the drawing of some pictures. But, when trying to compile some documents, I discovered that all the \colorbox were now fill with black. The following example gives a black rectangle instead of a gray one with "some text" written in it :

\input eplain

\beginpackages\usepackage{color}\endpackages

\input tikz

\colorbox{gray}{some text}

\bye

Is this a known problem ? Is there a way to get back \colorbox working properly with tikz ?

-
–  Peter Grill Oct 26 '12 at 4:41
Thanks for your help. I saw this answer befor posting my own question. I don't use the url package and all colors I use are rgb or gray. In fact, tikz does work correctly, but it breaks the \colorbox that become all black. –  Raphaël Oct 26 '12 at 18:25
I'm not answering your question again, but if you just want to have the colored text you can use just tikz and forget about loading color.tex. With tikz only you use: \color{gray}{some text} –  Mafra Oct 27 '12 at 13:56
Of course I understand that I can replace \colorbox with tikz pictures, but I don't know how to do for now. As I'm a complete novice in tikz I which I could stick with my old macros for a while and then introduce tikz as soon as I can do it. –  Raphaël Oct 28 '12 at 7:32

I found a way to avoid the conflict, so that you can keep using the color package (since you didn't like my suggestion of using only tikz and using \color{}{} instead of \colorbox{}{})

Simply load it with the "xdvi" option like this: \usepackage[xdvi]{color}

I'm not sure why using the xdvi option "fixes" the problem. I stopped investigating the theoretical reasons after discovering this workaround :-)

\input eplain

\beginpackages\usepackage[xdvi]{color}\endpackages

\input tikz

\colorbox{gray}{some text}

% if not loading color package and using only tikz use this
%\color{gray}{some text}

\bye
-