[XeTeX] tikz incompatible with xcolor's option dvipsnames ?

Jonathan Kew jonathan_kew at sil.org
Sat Aug 4 10:01:23 CEST 2007


On 3 Aug 2007, at 8:54 pm, Manuel Souto Pico wrote:

> Hi,
>
> There seems to be an incompatibility between the lines
>
> \usepackage[usenames,dvipsnames]{xcolor}
>
> and
>
> \usepackage{tikz}
>
> I could get colors like RedBrick until I started using the package
> tikz. Does this happen to everyone?
>
> I compile my document with TeXShop with the command XeLaTeX-xdvipdfmx.
> A simplified document in which this problem happens is here:
>
> %!TEX TS-program = xelatex (percetange, admiration, etc.)
> %!TEX encoding = UTF-8 Unicode
> \documentclass[a4paper,10pt,oneside]{report}
> \usepackage[usenames,dvipsnames]{xcolor}
> \usepackage{tikz}  % incompatible with %\usepackage 
> [usenames,dvipsnames]{color}
> \newcommand\target[1]{\fcolorbox{red}{white}{#1}} % red!50
> %%% FONTS
> \usepackage{fontspec}% provides font selecting commands
> \usepackage{xunicode}% provides unicode character macros
> \usepackage{xltxtra} % provides some fixes/extras
> \setromanfont{Palatino}%Times Roman}
>
> \begin{document}
> \target{red box}		
> \end{document}

I believe the problem is that PGF (the graphics layer below TiKZ)  
doesn't recognize xetex automatically. Your example works for me if I  
add the line

   \def\pgfsysdriver{pgfsys-dvipdfm.def}

before loading the TiKZ package; this explicitly sets the driver for it.

I tried this using TeX Live; since the TL release, PGF has been  
updated and the latest release should work automatically with xetex.  
So another option would be to update your packages.

(I also note that you're running an older release of xetex, and have  
a number of packages installed in a local texmf tree; it may be that  
updating to a newer distribution overall would be worthwhile.)

JK



More information about the XeTeX mailing list