How to troubleshoot a tikzDevice error in running command?

342 Views Asked by At

I'm trying to use the R tikzDevice package in a Mac OS X system to enable clickable images in a PDF report. To that end I use the code of the answer How to have a clickable picture in a PDF created using pictureGrob? included here for self-containment, I run this putting the expected png image in the correct place:

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()

However, I then get the following error:

Measuring dimensions of: \char77
Error in system(latexCmd, intern = T, ignore.stderr = T) : 
   error in running command

But no idea what the actual error is.

0

There are 0 best solutions below