如果使用以下 Sweave (R/LaTeX) 代码创建 pdf 文档,则在图的左上角会有文本pdf 2;请注意,这不是嵌入的,png但实际上是您可以突出显示的文本。
在.Rnw:
\begin{figure}[htb]
    \centering
<<fig=FALSE,echo=FALSE>>=
    png("test0.png",width=4,height=4,units='in',res=1200)
    plot(1)
    dev.off()
@
    \includegraphics{test0.png}
    \caption{Demonstration}
\end{figure}
然后在R:
Sweave("report.Rnw") ; texi2pdf("report.tex")
我该如何解决?
我R在 Ubuntu 上使用的是最新版本。