Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connections
Warning: mysqli::query(): Couldn't fetch mysqli in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\index.php on line 66
Article <va8lge$1j9de$1@solani.org>
Deutsch   English   Français   Italiano  
<va8lge$1j9de$1@solani.org>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!feeds.phibee-telecom.net!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: Ulrich D i e z <ud.usenetcorrespondence@web.de>
Newsgroups: comp.text.tex
Subject: Re: [LaTeX] How to tell the user that the document wasn't compiled
 with -shell-escape flag?
Date: Fri, 23 Aug 2024 02:35:25 +0200
Message-ID: <va8lge$1j9de$1@solani.org>
References: <e232066edde4e56c00ea54acc8608b61eca65278.camel@tilde.green>
 <Status-20240822205836@ram.dialup.fu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 23 Aug 2024 00:35:26 -0000 (UTC)
Injection-Info: solani.org;
	logging-data="1680814"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.9.0
Cancel-Lock: sha1:ZPRHpgTCKJ5/Lkzrb52NgyeCJPY=
X-User-ID: eJwNycEBwEAEBMCWOOxKOUfov4RkvhMGRdMR8NhY5VSW2nNC9g8Sxdtc95TXOwV2p2dPJkv7AxQ7EQ8=
In-Reply-To: <Status-20240822205836@ram.dialup.fu-berlin.de>
Content-Language: de-DE
Bytes: 3481
Lines: 85

Stefan Ram wrote:

> Annada Behera <segfault@tilde.green> wrote or quoted:
>>Anybody has any idea how that can be done. Thank you.
> 
>   Lately, the newer versions of "shellesc" (like since 2020?)

shellesc.dtx says the command \ShellEscapeStatus is a TeX <number>
quantity of the kind \chardef-token and was introduced in
version v1.0a of the shellesc package, released 2019/10/13 .

\ShellEscapeStatus is defined by the following lines:

\chardef\ShellEscapeStatus
  \ifx\pdfshellescape\@undefined
    \ifx\shellescape\@undefined
      \ifx\directlua\@undefined
        \z@
      \else
        \directlua{%
          tex.sprint((status.shell_escape or os.execute()) .. " ")}
      \fi
    \else
      \shellescape
    \fi
  \else
    \pdfshellescape
  \fi

You also find an example for querying which does with \ifcase:

\ifcase\ShellEscapeStatus
  \PackageWarning{shellesc}{Shell escape disabled}
\or
  \PackageInfo   {shellesc}{Unrestricted shell escape enabled}
\else
  \PackageInfo   {shellesc}{Restricted shell escape enabled}
\fi

>   are said to define "ShellEscapeStatus." So, you could totally
>   do something like this:
> 
> \usepackage{shellesc}
> 
> \ifnum\ShellEscapeStatus=1 \else
> \PackageError{mypackage}{use shell escape}{or else}
> \fi

If you neither want to load the package nor want to define the
chardef-token you can do s.th. like

\makeatletter
\ifcase
  \ifx\pdfshellescape\@undefined
    \ifx\shellescape\@undefined
      \ifx\directlua\@undefined
        \z@
      \else
        \directlua{%
          tex.sprint((status.shell_escape or os.execute()) .. " ")}
      \fi
    \else
      \shellescape
    \fi
  \else
    \pdfshellescape
  \fi
  \PackageWarning{shellesc}{Shell escape disabled}
\or
  \PackageInfo   {shellesc}{Unrestricted shell escape enabled}
\else
  \PackageInfo   {shellesc}{Restricted shell escape enabled}
\fi
\makeatother

>   But since I'm rocking an older version, I can't check this out
>   myself!

For checking out you can
- look at the documentation of most recent releases of packages at CTAN.
- test with a rathher recent TeX Live release via Overleaf -
  https://de.overleaf.com/
- try the test page (https://texlive.net/run) of the
  The TeXLive.net Server,  https://texlive.net/ .

Ulrich