Closed aserenko closed 4 years ago
Thanks for the report -- I don't think that this can be implemented without write18 as it requires to test whether an external file can be created. Any suggestions appreciated though!
Oh, another related question: what if \write18 is enabled but gnuplottex is given options noshell, subfolder
?
In this case, it still tries to create the subfolder but complains about \tmpfile
undefined:
https://github.com/larskotthoff/gnuplottex/blob/90a25d624218d14e67547ecdab6975bd00909e26/gnuplottex.dtx#L693
Do you think the definition of \tmpfile
should be moved outside of \ifShellEscape
, or maybe the other way round, the subfolder checking code should be conditioned on \ifShellEscape
?
Ah yes, this should be conditioned on shell escape being enabled.
Sorry for a possibly silly question, but why can't we just say
\immediate\openout\tmpfiledescriptor=\gnuplottex/\tmpfile
\immediate\write\tmpfiledescriptor{test}
\immediate\closeout\tmpfiledescriptor
instead of those \write18 in lines 712 and 715? I mean, in those lines we just check if gnuplottex/ is accessible, while shell escape is a totally unrelated check performed earlier.
Also, what is the purpose of the dot here? https://github.com/larskotthoff/gnuplottex/blob/90a25d624218d14e67547ecdab6975bd00909e26/gnuplottex.dtx#L700 I am not that experienced in latex, but I fail to find it anywhere else in \IfFileExists commands.
That last one is probably a typo. To test whether the directory is accessible, we need shell escape enabled to see if we can create files there.
I've just pushed a fix for this -- sorry it took so long. Could you check whether this works for you please? I'll make a new release then.
New release on CTAN -- please reopen if any issues remain.
Checking write access to the subfolder is currently implemented involving
\write18
. Thus, in the environment with shell escape disabled, it falls back to not using the subfolder even if the latter exists. This contradicts the warning wording "You'll need to create the folder yourself", because creating the folder manually won't be of any help in such a case.I believe it would be much better, if possible, to implement lines https://github.com/larskotthoff/gnuplottex/blob/90a25d624218d14e67547ecdab6975bd00909e26/gnuplottex.dtx#L712 and https://github.com/larskotthoff/gnuplottex/blob/90a25d624218d14e67547ecdab6975bd00909e26/gnuplottex.dtx#L715 in some way without \write18. My use case, which I believe to be quite natural, is to disable shell-escape when one wants to use pre-generated figures to save time (and I do it by passing
--no-shell-escape
tolatex
rather than by changingshell
option in\include{gnuplottex}
back and forth).