summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tools/shellesc.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-01-31 23:48:08 +0000
committerKarl Berry <karl@freefriends.org>2016-01-31 23:48:08 +0000
commit07aaa313db3abb8f932308307c9ca78bb1c3054d (patch)
treede018a29452c3b2131a23c228458012b15686e79 /Master/texmf-dist/tex/latex/tools/shellesc.sty
parent326c162a7ec8088d104101b4739c727d824ae5f7 (diff)
latex2e 2016/02/01
git-svn-id: svn://tug.org/texlive/trunk@39528 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tools/shellesc.sty')
-rw-r--r--Master/texmf-dist/tex/latex/tools/shellesc.sty100
1 files changed, 100 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/tools/shellesc.sty b/Master/texmf-dist/tex/latex/tools/shellesc.sty
new file mode 100644
index 00000000000..154e68b6a7f
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/tools/shellesc.sty
@@ -0,0 +1,100 @@
+%%
+%% This is file `shellesc.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% shellesc.dtx (with options: `package')
+%%
+%% This is a generated file.
+%%
+%% The source is maintained by the LaTeX Project team and bug
+%% reports for it can be opened at http://latex-project.org/bugs.html
+%% (but please observe conditions on bug reports sent to that address!)
+%%
+%%
+%% Copyright 1993-2016
+%% The LaTeX3 Project and any individual authors listed elsewhere
+%% in this file.
+%%
+%% This file was generated from file(s) of the Standard LaTeX `Tools Bundle'.
+%% --------------------------------------------------------------------------
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This file may only be distributed together with a copy of the LaTeX
+%% `Tools Bundle'. You may however distribute the LaTeX `Tools Bundle'
+%% without such generated files.
+%%
+%% The list of all files belonging to the LaTeX `Tools Bundle' is
+%% given in the file `manifest.txt'.
+%%
+%% Source File: shellesc.dtx
+%% Copyright 2015-2016 LaTeX3 project
+%%
+%% This file may be distributed under the terms of the LPPL.
+%% See README for details.
+\ifx\ProvidesPackage\undefined
+\def\next#1#2[#3]{\wlog{#2 #3}}
+\expandafter\next\fi
+\ProvidesPackage{shellesc}
+ [2015/12/05 v0.01 unified shell escape interface for LaTeX]
+\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 ensabled}
+\else
+ \PackageInfo {shellesc}{Restricted shell escape ensabled}
+\fi
+\ifx\lastsavedimageresourcepages\@undefined
+ \protected\def\ShellEscape{\immediate\write18 }
+\else
+ \protected\def\ShellEscape#1{%
+ \directlua{os.execute("\luaescapestring{#1}")}}
+\fi
+\ifx\lastsavedimageresourcepages\@undefined
+ \protected\def\ShellEscape{\relax\write18 }
+\else
+ \protected\def\DelayedShellEscape#1{%
+ \latelua{os.execute("\luaescapestring{#1}")}}
+\fi
+\ifx\lastsavedimageresourcepages\@undefined\expandafter\endinput\fi
+\directlua{%
+shellesc = shellesc or {}
+local function write_or_execute()
+ local s = token.scan_int()
+ if (s==18) then
+ tex.sprint(\the\numexpr\catcodetable@atletter\relax,
+ "\string\\ShellEscape ")
+ else
+ tex.sprint(\the\numexpr\catcodetable@atletter\relax,
+ "\string\\shellesc@write " .. s)
+ end
+end
+shellesc.write_or_execute=write_or_execute
+}
+\let\shellesc@write\write
+\protected\def\write{\directlua{shellesc.write_or_execute()}}
+\endinput
+%%
+%% End of file `shellesc.sty'.