[OS X TeX] Re: graphics with xelatex

Jonathan Kew jonathan_kew at sil.org
Sat Jul 14 23:08:30 CEST 2007

On 14 Jul 2007, at 8:10 pm, Manuel Souto Pico wrote:

> Hi,
> I decided to give tikz a chance but, not surprisingly!, I can even get
> a simple axis done.
> I started with the simplest example I could find and wrote a  
> document like:
> %!TEX TS-program = xelatex (percetange, admiration, etc.)
> %!TEX encoding = UTF-8 Unicode
> \documentclass{article} % say
> \usepackage{tikz}
> \begin{document}
> \begin{tikzpicture}
> \draw (-1.5,0) -- (1.5,0);
> \draw (0,-1.5) -- (0,1.5);
> \end{tikzpicture}.
> \end{document}
> If I compile it with LaTeX I can get the intended graphic. But I use
> XeLaTeX (compiling with TeXShop, without opening the terminal) and
> only get two scattered dots. I need to use XeLaTeX because my document
> contains many examples in Arabic and other non-Latin scripts.
> Jonathan mentioned I should use the xdvipdfmx output driver. I'm not
> sure how to do this.

Yes, you'll need to use xdvipdfmx, rather than (the default) xdv2pdf.  
If you have a new TeXShop installation, there may be a "XeLaTeX- 
xdvipdfmx.engine" file in the Inactive folder within ~Library/TeXShop/ 
Engines; move it to the main Engines folder. But if not, you can  
create one by duplicating the XeLaTeX.engine file, then editing it  
and inserting

   -output-driver="xdvipdfmx -q -E"

into the xelatex command line, before the "$1" that represents the  
input file name.

Then you can select this engine in TeXShop to process your document.

> If not, what is missing in my document?
> Btw, I've downloaded the packages xkeyval, fp, (x)ifthen and xcolor
> and unzipped them to my /Users/me/Library/texmf/tex/latex directory.

You might also need to get the latest version of PGF (the underlying  
graphics package TikZ uses), as the version included in TeX Live 2007  
(and presumably other distributions based on the same source) does  
not recognize xetex. It's possible to get it to work, but the easiest  
solution is to use the newest version of PGF.

The next version of the various distributions should have more of  
this stuff working "out of the box", I trust.



------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/

More information about the macostex-archives mailing list