0

考虑以下示例:

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'

这是怎么回事?

4

1 回答 1

0

有点晚了...

你应该有一个 .tex 文件,其中包含你的情节的 tikz 代码C:\Users\cgmil\AppData\Local\Temp\Rtmp6FouwP/。只需替换最后两行

\makeatletter
\@@end

经过

\end{document}
\end{tikzpicture}

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

于 2017-06-29T00:14:24.893 回答