[XeTeX] Using MetaPost together with XeTeX

Evgenie Medvedev medvedev at project7.ru
Sat Jul 7 19:10:26 CEST 2007


Jonathan Kew wrote:

> I believe PGF/TikZ works in xetex/xdvipdfmx if you update the PGF  
> package to the latest version from CTAN; the version included with  
> TL2007 didn't recognize the xetex engine, so some extra tweaking was  
> needed to get it to work.

	Just in case anyone stumbles into the same pit and goes googling --
here's how I got my diagrams into XeLaTeX with PGF/TikZ without having
to program them manually, after creating them with the R language.

	1) Yes, the newest version of PGF package recognizes XeTeX and behaves
accordingly, no need to do anything except load it. For some reason, it
complains the driver doesn't support patterns, though.
	2) I have found that the best way to get proper PGF/TikZ graphics was
to export them in Xfig format and convert them to TikZ with the fig2pgf
utility which is available (in cvs only) from their sourceforge project
page. The conversion leaves a lot to be desired -- fig2pgf does not
handle rotated text, and the scale the conversion results in is iffy (I
suspect they mistook inches for centimeters in there somewhere.) but
since it results in readable TikZ commands, it's not too hard to fix
manually if your diagram does not contain too much rotated text, and it
scales easily. You also get the chance individually color and alter
elements and add more text where you like, so it's actually sort of a
bonus. After conversion, the text strings are still in the encoding they
had in Xfig, which probably isn't utf-8, but that is easy to fix as well.
	I'm not happy with how pie charts turned out, though, but well, pie
charts are so despised in R community that it's not surprising.

	That was quite a bit more hoops to jump than I was hoping for. I wish
there was a reasonable package to draw diagrams for TikZ, or a TikZ
driver for R, but alas, so far there isn't, and looks like there won't
be for a while...

-- 
Evgenie Medvedev


More information about the XeTeX mailing list