daqana / tikzDevice

A R package for producing graphics output as PGF/TikZ code for use in TeX documents.
https://daqana.github.io/tikzDevice
132 stars 26 forks source link

\pgfError in getMetricsFromLatex() #134

Closed felixhaass closed 8 years ago

felixhaass commented 8 years ago

I'm running into errors similar to #46 but without using knitr(), while executing the following code in a clean environment:

library(tikzDevice)

tikz("testtikz.tex")
plot(1)

This throws a pretty long error message, which ends in

("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\pgf\basiclayer\pgfcorepathusage
.code.tex"
File: pgfcorepathusage.code.tex 2014/11/02  (rcs-revision 1.24)
\pgf@shorten@end@additional=\dimen132
\pgfError in getMetricsFromLatex(TeXMetrics, verbose = verbose) : 
TeX was unable to calculate metrics for the following string
or character:

    m

... and then the usual bits about common reasons for failure etc. (which are clearly not the case, given the most simple plot(1) command.

Now, I've installed the latest tikzDevice version from GitHub, updated MikTeX, but to no avail.

Can you replicate this error? Any ideas?

Here is my sessionInfo()

R version 3.2.3 (2015-12-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252   
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C                   
[5] LC_TIME=German_Germany.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] tikzDevice_0.9

loaded via a namespace (and not attached):
[1] tools_3.2.3  filehash_2.3 grid_3.2.3  
felixhaass commented 8 years ago

Sorry. I was too fast. Installing the preview package in MikTeX resolved the issue (as per http://stackoverflow.com/questions/21542556/r-plot-using-tikzdevice-in-latex-document-with-knitr#comment32666598_21542556). Closing this.