[Tikzdevice-bugs] tikzDevice character metric error

Chris Hoefler hoeflerb at brandeis.edu
Fri Jan 29 01:17:21 CET 2010


Hello,

I have just started using tikzDevice to output R plots for inclusion in 
a latex document. The output looks very good. Nice package!

I've stumbled into a problem, though. I'm trying to include this axis label:

title(ylab = "\\ce{k_{obs}} (\\si{\\per\\second})")

When I do this, running the script gives me this error:

In getMetricsFromLatex(TeXMetrics) : NAs introduced by coercion

I've narrowed down the problem to the \ce{} command, which comes from 
the mhchem package for typesetting chemical formulas. If I encapsulate 
the string in a math environment ($...$), it works fine. So I'm not sure 
what the problem is; it may be a bug.

I can work around this by using this label instead:

title(ylab="$\\textrm{k}_\\textrm{obs}$ (\\si{\\per\\second})")

The result is almost identical, but not quite. Any thoughts on how to 
solve this?


Thanks,
Chris


More information about the Tikzdevice-bugs mailing list