Sharpie / RTikZDevice

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

Fontsize fixes still not able to cope with all ggplot2 plots. #1

Closed Sharpie closed 14 years ago

Sharpie commented 14 years ago

The changes implemented in the fontsize branch provide better handling of string widths-- especially in ggplot2 graphics. However I just noticed an issue with the placement of exponents arising from ggplot2 scales such as:

plot_x_log10()

I still need to make a test case the definitively isolates this problem.

Sharpie commented 14 years ago

Interesting note:

The current published version of tikzDevice, which does not have formal support for fontsize parameters, renders these exponents just fine.

Sharpie commented 14 years ago

Did a quick check-- this problem is not appearing using default tikz() calls-- i.e. article document class 11pt Computer Modern.

It was noticed using a memoir document set in 12pt mathpazo. Two possibilities:

  1. This is a very devious bug that morphs behavior along with fonts and document classes.
  2. It was a dumb user error where the package author didn't tell tikzDevice that he was typesetting a memoir document using 12pt mathpazo.

I'm betting on # 2.

Sharpie commented 14 years ago

Ok, it was a subtle error in my Sweave document.

Apparently setting tikzDocumentDeclaration to [12pt,Article]{memoir} and tikzLatexPackages to mathpazo did not fully reproduce the font settings in my custom homework class. Having tikzDevice load the homework class fixed the problem.

This means that in this case there was nothing wrong with tikzDevice.