似乎与新版本的knitr
和/或tikzDevice
和/或存在冲突R
。无论如何,我不能让它工作了。
这是一个MWE:
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{tikz}
<<setup, include=FALSE, cache=FALSE>>=
library(knitr)
opts_chunk$set(fig.path='figure/graphics-',
cache.path='cache/graphics-',
fig.align='center',
dev='tikz'
)
@
\begin{document}
blop
<<>>=
plot(1:10)
@
\end{document}
这将返回错误:
Quitting from lines 21-22 (testTikz.Rnw) Error in
tikzDevice::tikz(..., packages = c("\n\\nonstopmode\n", packages, :
unused argument (verbose = FALSE) Calls: knit ... chunk_device ->
dev_new -> do.call -> <Anonymous> -> <Anonymous>
Execution halted
我正在使用 R 版本 3.3.1、knitr_1.14 和 tikzDevice_0.8.1
编辑
我通过knitr
在 github 上分叉 repo 来修改tikz_dev
函数以删除verbose
参数。我现在收到以下错误:
Error in (function (file = ifelse(onefile, "./Rplots.tex", "./Rplot%03d.tex"), :
Graphics API version mismatch
Calls: knit ... do.call -> <Anonymous> -> do.call -> <Anonymous> -> .External