[luatex] How to detect option '--shell-escape'?

Andreas Scherer andreas_tex at freenet.de
Sat Oct 7 15:37:42 CEST 2023


Thanks, David, for the pointer to 'shellesc.sty'. (Unlike 'iftex.sty', 
it can't be '\input' in pöain TeX.)

In 'pwebmac.tex' I reduced the code to

   \chardef\pdfshellescape
     \directlua{tex.sprint((status.shell_escape or os.execute()) .. " ")}

for LuaTeX and it works nicely further below in

   \ifpdflua \makebookmarks % added in Version 4.5
     \ifnum\pdfshellescape=1 {\let\\=\BS % count the @<named sections@>
       \global\countD=\input{|grep -c -e '\\:\\X' \jobname.tex}} \fi\fi

Cheers,
Andreas


More information about the luatex mailing list.