Open dflvunoooooo opened 7 months ago
Thanks for your report -- when I try to run your code I get
(./gnuplottex/test-gnuplottex-fig1.tex
! Undefined control sequence.
l.82 \definecolor
{tbcol}{rgb}{1,1,1}%
How exactly are you compiling this, and what's your TeX installation?
Thank you for your quick answer. I am using texlive with texstudio and compiling with XeLatex and shell escape for gnuplottex on linux. Otherwise there is nothing special.
I don't see, where the error regarding a color is coming from.
Edit: Ah, wait a minute. Even more minimalistic:
\documentclass{scrreport}
\usepackage[siunitx, subfolder]{gnuplottex}
\begin{document}
\begin{figure}
\centering
\begin{gnuplot}[terminal=cairolatex]
plot sin(x) title "$\sin(x)$"
\end{gnuplot}
\caption{This is a simple example using the cairolatex-terminal.}
\label{pic:cairolatex}
\end{figure}
\end{document}
Ok, it works if I include the xcolor
package and exclude the siunitx
option, which caused another error. Then everything works fine and the plot is produced.
Are you running this on Linux, Windows, Mac OS?
If I add the xcolor
option like this usepackage[xcolor]{gnuplottex}
, it raises the error Unknown option "xcolor" for package "gnuplottex". \ProcessOptions\relax
. I didn't have an error for siunitx.
I run it under linux. Here is a picture of all three created files.
Ah, ok, I needed to include a space in the file name. I can reproduce the bug.
It looks like the conversion of the figure actually works, just the check whether the file exists fails. There's multiple levels of quoting going on here and I'm not sure how to fix this. For now, I'd recommend to simply not have spaces in your file names.
And xcolor
is a separate package, not an option.
xcolor
is a package and you mentioned that. I miss read that.
Yes, it is working if no spaces are used in the filename.
Edit: It is working if I rename both files with the "" in the name and remove those. So the problem seems to be, that the filename is not recognised because of the "". Do you know where they are added?
The quotes are added automatically by TeX. And yes, the problem is just handling the quoting at different levels in the code.
For references, I solved it in my project via this solution in my project https://github.com/leo-colisson/robust-externalize , not sure if you got the same issue: https://tex.stackexchange.com/questions/418670/avoid-quotation-marks-when-using-jobname-or-currfilename
If there is a space in the Latex document containing the gnuplottex code, the figure will be created but not displayed in Latex. Maybe because the created pdf and tex files from gnuplottex contain " in them.
A minimalistic example in a file named
test empty.tex
: