8

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 ?

6
  • 1
    Welcome to TeX.SE. Commented Oct 26, 2012 at 4:41
  • I guess the answer here might help you:tex.stackexchange.com/questions/42958/…
    – Mafra
    Commented Oct 26, 2012 at 13:13
  • 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
    Commented Oct 26, 2012 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
    Commented Oct 27, 2012 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
    Commented Oct 28, 2012 at 7:32

1 Answer 1

2

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .