Sharpie / RTikZDevice

A R package for producing graphics output as PGF/TikZ code for use in TeX documents.
32 stars 37 forks source link

Support for the LuaTeX engine #28

Closed Sharpie closed 12 years ago

Sharpie commented 13 years ago

Now that XeTeX is officially supported by the tikzDevice. It should be easy to add support for LuaTeX as it is also Unicode-based and can use many of the advanced font handling packages available to XeTeX.

A key difference between XeTeX and LuaTeX is that XeTeX is DVI-based (routing it's output through xdvipdfmx) and therefore cannot use some packages that require a direct route to PDF. On the other hand, LuaTeX is the official sucessor to PdfTeX and therefore renders directly to PDF.

Sharpie commented 12 years ago

Done and checked on Windows, OS X, Linux and Solaris 11. MikTeX is still a bit flaky as they just added LuaTeX in the last release and they keep releasing updates that break it. In particular, the MikTeX fontspec seems buggy when used with LuaTeX.

Worth noting is that LuaTeX supports UTF8 just like XeTeX but it can do a lot of things that XeTeX cannot because XeTeX routes DVI through xdvipdfmx instead of generating PDF directly. In particular, TikZ transparency does not work under XeTeX.

kljohann commented 12 years ago

Thanks! With R's support for variables containing unicode and unicode-math this makes looking at R code that much nicer. I did some quick tests using a recent TeXLive, ggplot2 and RTikzDevice HEAD. All I had to do was to add "\\usepackage{amsmath}\n\\usepackage{unicode-math}\n", "\\setmathfont{XITS Math}\n" to tikzLualatexPackages.

Sharpie commented 12 years ago

Glad to hear LuaLaTeX is working for you!

Note that build 0.6.2-63-38eca21 is available from R-forge and installing it may be easier than building from HEAD. This version contains all the LuaLaTeX enhancements and is pretty much a release candidate for 0.7.0 which will show up on CRAN in the next few weeks once I am done fiddling with the documentation.