我在LaTeX文档中安装了用于颜色语法的pgfSweave
包,但是当涉及到LaTeX依赖时,我搁浅了。我通过MikTeX的pgf
和相信安装了Package Manager (Admin)
软件包是最新的(我在MiKTeX安装文件夹的包文件夹中查看过,但是我没有看到任何版本号)。我错过了什么?
> library(pgfSweave)
Loading required package: stashR
Loading required package: filehash
filehash: Simple key-value database (2.1-1 2010-10-04)
A Set of Tools for Administering SHared Repositories (0.3-3 2009-03-26)
Loading required package: highlight
Loading required package: tools
Loading required package: codetools
Loading required package: parser
Loading required package: Rcpp
Loading required package: optparse
Loading required package: getopt
Loading required package: formatR
tikzDevice: A Device for R Graphics Output in PGF/TikZ Format (v0.5.3)
Checking for a LaTeX compiler...
A working LaTeX compiler was found by checking:
The PATH using the command pdflatex
Global option tikzLatex set to:
C:\PROGRA~2\MIKTEX~1.9\miktex\bin\pdflatex.exe
MiKTeX-pdfTeX 2.9.4052 (1.40.11) (MiKTeX 2.9)
Copyright (C) 1982 D. E. Knuth, (C) 1996-2006 Han The Thanh
Error : .onLoad failed in loadNamespace() for 'pgfSweave', details:
call: requirePGFVersion("2.10")
error: PGF >= 2.10 is required to use pgfSweave
In addition: Warning message:
running command 'C:\PROGRA~2\MIKTEX~1.9\miktex\bin\pdflatex.exe -interaction=batchmode -output-directory C:\Users\romunov\AppData\Local\Temp\Rtmply4jAb test-for-pgf.tex' had status 1
Error: package/namespace load failed for 'pgfSweave'
答案 0 :(得分:5)
在MikTex存储库中,使用的版本显然是2.00。可以下载最新版本2.10 here。安装说明可以在...\pgf_2.10.tds\doc\generic\pgf
下的zip文件中包含的手册中找到。
如果您根据安装说明移动整个文件夹。归结为将相关的gpf文件夹从zip文件中的目录结构复制到miktex安装中的目录结构。最好是尝试符合TDS的安装,在其中用miktex安装文件夹替换安装说明中的texmf/
。
不要忘记通过miktex设置应用程序刷新FNDB(文件名数据库)。
或者,您可以卸载pgf软件包并将解压缩的目录树放在Tex可以找到的位置。再次,不要忘记刷新FNDB。请注意,安装的pgf包将在MikTex目录树的不同位置包含文件夹。因此,不要只将您找到的所有内容粘贴到目录系统中找到的一个文件夹中。
编辑:
要了解tex发行版中加载的pgf版本,请尝试使用以下小文档:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\pgfversion
\end{document}