2017-01-13 50 views
0

请看下面的例子:tikzDevice不工作的基本的例子

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

一旦阴谋被创建,有很多的代码中的错误会产生,但接近尾声时出现错误:

("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' 

发生了什么事?

回答

0

有点晚了......

你应该在你的C:\Users\cgmil\AppData\Local\Temp\Rtmp6FouwP/情节的tikz代码.tex文件。只需更换的最后两行

\makeatletter 
\@@end 

通过

\end{document} 
\end{tikzpicture} 

然后编译文档。新的软件包将被安装,它应该可以工作。