Problem with Tikz and options(DecOut=',') #760

jan-glx opened this Issue Jan 30, 2013 · 1 comment


None yet
2 participants

jan-glx commented Jan 30, 2013

When changing the decimal sign in R to ",", plotting to a tikz device is possible using standard plot function but not using ggplot.

Building the tikz dictionary (before changing the decimal separator) by plotting using ggplot2 solves the problem.

Even through it could also be a tikz bug please try to fix or at least warn the user as I spent more than an hour trying to find a solution. Thanks for providing this great tool!

Minimal Examples:

options(OutDec = ",")
tikz('example.tex',standAlone = TRUE, width = 5,height = 5)


options(OutDec = ",")
\caption{I need comma as decimal point.\label{fig:example}}

in either case the error is:

(C:\Users\Jan\AppData\Roaming\MiKTeX\2.8\tex\generic\pgf\basiclayer\pgfcoregraphic Fehler in getMetricsFromLatex(TeXMetrics) : 
TeX was unable to calculate metrics for the following string or character:


Common reasons for failure include:
  * The string contains a character which is special to LaTeX unless
    escaped properly, such as % or $.
  * The string makes use of LaTeX commands provided by a package and
    the tikzDevice was not told to load the package.

The contents of the LaTeX log of the aborted run have been printed above,
it may contain additional details as to why the metric calculation failed.

hadley commented Feb 24, 2014

Weird, sorry about that.

hadley closed this Feb 24, 2014

krlmlr referenced this issue in yihui/tikzDevice Feb 25, 2014


Weird issue when setting OutDec option #57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment