New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tikz plot fails when using includegraphics{} with local file #198
Comments
Thanks for a the report. As a workaround you can put the image into a directory where TeX will look for input. Which TeX distribution do you use? I am using TeX Live and putting |
thanks for considering this. This isn't really a workable workaround for me, as the code I'm fixing is used in a workflow that's being run by people with very different setups - they won't all have the same TeX setup. I'm wondering if there's some way that's not terribly unwieldy to allow an optional argument specifying external resources (files etc.) that will need to be copied to the TeX working directory ... ?? |
Such an optional argument should be possible. Downside is that it has to go through the C code for the graphics device. I can think of another TeX based solution, though: Temporarily set library(tikzDevice)
tex_inputs <- Sys.getenv("TEXINPUTS")
Sys.setenv(TEXINPUTS = paste(getwd(), tex_inputs, sep = .Platform$path.sep))
tikz("crown.tex")
plot(0:1,0:1,type="n")
text(0.5,0.5,"\\includegraphics[width=15pt]{crown.png}")
dev.off()
Sys.setenv(TEXINPUTS = tex_inputs) I have tested this on TeX Live and expect it to work on derived distributions (MacTeX, ProTeXt, TinyTeX). And MikTeX seems to support this, too: https://docs.miktex.org/manual/localadditions.html I will have to do some further testing, but something like this could accompany the |
thanks for the workaround, working for me! |
3eb8ad8 made tikz do its processing in a temporary directory. Unfortunately, this breaks my workflow, which used
\includegraphics{}
to include a local file. I'm trying to think of a workaround (I don't want to give an absolute path name ...) (Proximal problem is ingetMetricsFromLatex
: maybe you would want to consider expurgating this comment?)To run this example, save the attached PNG as
crown.png
in the working directory ...This works in tikzDevice 0.12, but not in 0.12.3 ...
The text was updated successfully, but these errors were encountered: