Hello, is there any command to test for write18/shell escape available in ConTeXt? In one of the LaTeX packages I saw: \newif\ifShellEscape ... \ifShellEscape \def\tmpfile{/tmp/w18-test-\the\year\the\month\the\day\the\time} \ifmiktex \immediate\write18{rem >"\tmpfile"} \else \immediate\write18{touch \tmpfile} \fi \ifmiktex \IfFileExists{\tmpfile.}{\ShellEscapetrue}{\ShellEscapefalse} \else \IfFileExists{\tmpfile}{\ShellEscapetrue}{\ShellEscapefalse} \fi \fi Thanks a lot, Mojca
On Tue, 26 Dec 2006, Mojca Miklavec wrote:
Hello,
is there any command to test for write18/shell escape available in ConTeXt?
\ifeof18 checks if write18 is disabled. I think that it is etex only. The next method is error prone, for a lot of reasons, the directory /tmp may not exist (atleast in Windows). A bit safer option may be $TEMP. I do not know of \ifmiktex switch, but I am sure TeXLive on windows will not set it to true.
In one of the LaTeX packages I saw:
\newif\ifShellEscape ... \ifShellEscape \def\tmpfile{/tmp/w18-test-\the\year\the\month\the\day\the\time} \ifmiktex \immediate\write18{rem >"\tmpfile"} \else \immediate\write18{touch \tmpfile} \fi \ifmiktex \IfFileExists{\tmpfile.}{\ShellEscapetrue}{\ShellEscapefalse} \else \IfFileExists{\tmpfile}{\ShellEscapetrue}{\ShellEscapefalse} \fi \fi
HTH, Aditya
On Tue, 26 Dec 2006, Mojca Miklavec wrote:
is there any command to test for write18/shell escape available in ConTeXt?
There is such a command in pdfTeX-1.40 but I don't remember the name (I think it's "\ifshellescape"). Cheers, Peter -- http://pmrb.free.fr/contact/
Am 2006-12-26 um 19:57 schrieb Peter Münster:
is there any command to test for write18/shell escape available in ConTeXt?
There is such a command in pdfTeX-1.40 but I don't remember the name (I think it's "\ifshellescape").
\ifeof18 From the t-lilypond sources: %D If \type{\ifeof18} creates an error for you, your pdfetex is too old. %D (\type{\ifeof18} checks whether \type{\write18} is disabled.) Greetlings from Lake Constance! Hraban --- http://www.fiee.net/texnique/ http://contextgarden.net http://www.cacert.org (I'm an assurer)
� wrote:
On Tue, 26 Dec 2006, Mojca Miklavec wrote:
is there any command to test for write18/shell escape available in ConTeXt?
There is such a command in pdfTeX-1.40 but I don't remember the name (I think it's "\ifshellescape"). Cheers, Peter
grep shellescape *.tex core-job.tex:\ifx\pdfshellescape\undefined \else core-job.tex: \chardef\systemcommandmode \ifcase\pdfshellescape \plusone \else \plustwo \fi
so \systemcommandmode is your friend -- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On 12/26/06, Hans Hagen wrote:
Peter Münster wrote:
On Tue, 26 Dec 2006, Mojca Miklavec wrote:
is there any command to test for write18/shell escape available in ConTeXt?
There is such a command in pdfTeX-1.40 but I don't remember the name (I think it's "\ifshellescape"). Cheers, Peter
grep shellescape *.tex core-job.tex:\ifx\pdfshellescape\undefined \else core-job.tex: \chardef\systemcommandmode \ifcase\pdfshellescape \plusone \else \plustwo \fi
so \systemcommandmode is your friend
Wait! So many alternatives that I'll have to create another function to choose one of them randomly ;) Thanks a lot, (I'll use \systemcommandmode then), Mojca
On 12/26/06, Hans Hagen wrote:
core-job.tex:\ifx\pdfshellescape\undefined \else core-job.tex: \chardef\systemcommandmode \ifcase\pdfshellescape \plusone \else \plustwo \fi
so \systemcommandmode is your friend
What exactly is the advantage of using \pdfshellescape over \ifeof18 as the basis of \systemcommandmode? The second one works in XeTeX as well while the first is only good for pdfTeX, but perhaps there are other reasons for using it. Thanks, Mojca
Mojca Miklavec wrote:
On 12/26/06, Hans Hagen wrote:
core-job.tex:\ifx\pdfshellescape\undefined \else core-job.tex: \chardef\systemcommandmode \ifcase\pdfshellescape \plusone \else \plustwo \fi
so \systemcommandmode is your friend
What exactly is the advantage of using \pdfshellescape over \ifeof18 as the basis of \systemcommandmode? The second one works in XeTeX as well while the first is only good for pdfTeX, but perhaps there are other reasons for using it.
write 18 is a hack and pdfshellescape a sane replacement in luatex it will probably be gone completely since there we have \directlua 0 { os.execute("...") } Hans
participants (6)
-
Aditya Mahajan
-
Hans Hagen
-
Henning Hraban Ramm
-
Martin Schröder
-
Mojca Miklavec
-
Peter Münster