Skip to content
This repository has been archived by the owner on Sep 23, 2018. It is now read-only.

TikZ device not calculating metrics, producing errors #71

Open
ntguardian opened this issue Feb 7, 2017 · 0 comments
Open

TikZ device not calculating metrics, producing errors #71

ntguardian opened this issue Feb 7, 2017 · 0 comments

Comments

@ntguardian
Copy link

Consider the following example:

library(tikzDevice)
tikz("test.tex")
plot(1:10)
dev.off()

An error will be produced once the plot is created, with a lot of code but near the end the error appears:

("C:\ProgramError in getMetricsFromLatex(TeXMetrics, verbose = verbose) : 
TeX was unable to calculate metrics for the following string
or character:

    m

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.
In addition: Warning messages:
1: In readLines(texLog) :
  incomplete final line found on 'C:\Users\cgmil\AppData\Local\Temp\Rtmp6FouwP/tikzStringWidthCalc.log'
2: In readLines(texLog) :
  incomplete final line found on 'C:\Users\cgmil\AppData\Local\Temp\Rtmp6FouwP/tikzStringWidthCalc.log'

There are other examples from websites and the tikzDevice vignette that are not working; sometimes they point to the string/character "m", sometimes a mysterious number like "36".

All of this is on a machine I bought on Sunday, so my version of all these packages should presumably be the most recent version. What's going on?

I noticed that I do not have this problem on my work computer, where I installed this package today. So here is the session information for the installation with which I'm having the problem.

R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

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

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

other attached packages:
[1] tikzDevice_0.10-1

loaded via a namespace (and not attached):
[1] tools_3.3.2  filehash_2.3 grid_3.3.2  
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant