todonotes icon indicating copy to clipboard operation
todonotes copied to clipboard

Conflicts with parameter -shell-escape

Open lukbukkit opened this issue 1 year ago • 2 comments

Hello,

This package sadly does not work if the parameter -shell-escape is passed to the LaTeX compiler. I've appended one of its error logs. Someone on StackOverflow had a similar issue: https://stackoverflow.com/q/55837846.

Is it possible to exclude the package's figures by default from \tikzexternalize? There is a workaround redefining the \todo command to achieve this manually: https://tex.stackexchange.com/a/50343.

Best wishes, Lukas

===== 'mode=convert with system call': Invoking 'pdflatex -shell-escape -halt-o
n-error -interaction=batchmode -jobname "gfxcompiled/Thesis-figure9" "\def\tikz
externalrealjob{Thesis}\input{Thesis}"' ========
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex)
 \write18 enabled.
entering extended mode
system returned with code 256

! Package tikz Error: Sorry, the system call 'pdflatex -shell-escape -halt-on-e
rror -interaction=batchmode -jobname "gfxcompiled/Thesis-figure9" "\def\tikzext
ernalrealjob{Thesis}\input{Thesis}"' did NOT result in a usable output file 'gf
xcompiled/Thesis-figure9' (expected one of .pdf:.jpg:.jpeg:.png:). Please verif
y that you have enabled system calls. For pdflatex, this is 'pdflatex -shell-es
cape'. Sometimes it is also named 'write 18' or something like that. Or maybe t
he command simply failed? Error messages can be found in 'gfxcompiled/Thesis-fi
gure9.log'. If you continue now, I'll try to typeset the picture.

See the tikz package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.89 ...ew section, Feedback would be appreciated}


! Package pgf Error: No shape named `inText' is known.

See the pgf package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.89 ...ew section, Feedback would be appreciated}


! Package pgf Error: No shape named `inText' is known.

See the pgf package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.89 ...ew section, Feedback would be appreciated}


! Package pgf Error: No shape named `inText' is known.

See the pgf package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.89 ...ew section, Feedback would be appreciated}


! Package pgf Error: No shape named `inText' is known.

See the pgf package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.89 ...ew section, Feedback would be appreciated}


! Package pgf Error: No shape named `inNote' is known.

See the pgf package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.89 ...ew section, Feedback would be appreciated}


! Package pgf Error: No shape named `inText' is known.

See the pgf package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.89 ...ew section, Feedback would be appreciated}


! Package pgf Error: No shape named `inNote' is known.

See the pgf package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.89 ...ew section, Feedback would be appreciated}

lukbukkit avatar Apr 07 '23 11:04 lukbukkit

Thanks for the bug report. I have tried to recreate the issue with the following minimal example. The code below works with --shell-escape, but fails if line four is enabled (it is currently commented out). I assume that your issue looks something like this?

\documentclass{article}
\usepackage{todonotes}
\usetikzlibrary{external}
% \tikzexternalize[prefix=pics/]

\begin{document}
Hello world!
\todo{Test}
\end{document}

By introducing the workaround suggested in section 1.8.12 in the documentation, the following solution is found which works on my computer together with --shell-escape.

\documentclass{article}
\usepackage{todonotes}
\usetikzlibrary{external}
\tikzexternalize[prefix=pics/]

\newcommand{\ruggedtodo}[2][]{\tikzexternaldisable\todo[#1]{#2}\tikzexternalenable}

\begin{document}
Hello world!
\ruggedtodo{Test}
\end{document}

henrikmidtiby avatar Apr 07 '23 14:04 henrikmidtiby

Yes that's exactly the issue. Would it be feasable to enable this behavior by default and add a option to disable it if required? I wasn't smart enough to search the manual and I guess other might run into the same problem.

lukbukkit avatar Apr 10 '23 15:04 lukbukkit