我正在尝试在Mac OS X系统中使用R tikzDevice
程序包来启用PDF报告中的可点击图像。为此,我使用此处包含的答案How to have a clickable picture in a PDF created using pictureGrob?的代码进行自我控制,我运行此操作将预期的png图像放在正确的位置:
library(tikzDevice)
tikz("annotation.tex",width=4,height=4, standAlone = TRUE,
packages = c(getOption('tikzLatexPackages'),
"\\usepackage{hyperref}",
"\\usetikzlibrary{positioning}")
)
tg <- tikzNodeGrob(x = 0.5, y = 0.5, name = 'google',
content='\\href{http://www.google.com}{\\includegraphics[width=1in]{google.png}}',
units = "native")
qplot(1:10, 1:10) +
annotation_custom(grob = tg, xmin=3,xmax=3,ymin=5,ymax=5)
dev.off()
然而,我收到以下错误:
Measuring dimensions of: \char77
Error in system(latexCmd, intern = T, ignore.stderr = T) :
error in running command
但不知道实际的错误是什么。