summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/tools
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-11-06 22:12:38 +0000
committerKarl Berry <karl@freefriends.org>2019-11-06 22:12:38 +0000
commit7c55167ecf36309f45793303eea23651cb983f12 (patch)
tree11c014344f975231c0cb0ed300b892849a481db8 /Master/texmf-dist/source/latex/tools
parent7b810bfb3e61d6cd1564c490490d6d005dd64813 (diff)
l2e (6nov19)
git-svn-id: svn://tug.org/texlive/trunk@52656 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/tools')
-rw-r--r--Master/texmf-dist/source/latex/tools/shellesc.dtx82
-rw-r--r--Master/texmf-dist/source/latex/tools/varioref.dtx9
-rw-r--r--Master/texmf-dist/source/latex/tools/xr.dtx2
3 files changed, 78 insertions, 15 deletions
diff --git a/Master/texmf-dist/source/latex/tools/shellesc.dtx b/Master/texmf-dist/source/latex/tools/shellesc.dtx
index 061ea4457ca..46f2343b016 100644
--- a/Master/texmf-dist/source/latex/tools/shellesc.dtx
+++ b/Master/texmf-dist/source/latex/tools/shellesc.dtx
@@ -20,7 +20,7 @@
%<driver> \ProvidesFile{shellesc.drv}
% \fi
% \ProvidesFile{shellesc.dtx}
- [2016/06/07 v0.02b unified shell escape interface for LaTeX]
+ [2019/10/17 v1.0b unified shell escape interface for LaTeX]
%
% \iffalse
%<*driver>
@@ -36,10 +36,15 @@
% \title{The \textsf{shellesc} Package\thanks{This file
% has version number \fileversion, last
% revised \filedate.}}
-% \author{LaTeX3 project}
+% \author{\LaTeX3 project}
% \date{\filedate}
+%
+%
% \maketitle
%
+% \vspace*{-\baselineskip}
+% \enlargethispage{\baselineskip}
+%
% \changes{v0.1b}{2016/02/02}{Doc typo fixes (JB)}
% \changes{v0.2a}{2016/06/07}{Improve use with plain TeX}
% \section{Introduction}
@@ -57,7 +62,7 @@
% so a command to remove a file on a unix-like system could be
% specified using \verb|\ShellEscape{rm file.txt}| (or \verb|del| in
% windows). Note that by default system access is not allowed and
-% latex will typically need to be called with the \verb|--shell-escape|
+% \LaTeX\ will typically need to be called with the \verb|--shell-escape|
% command line option.
%
% The package may be used with standard \texttt{latex} or
@@ -76,6 +81,9 @@
% (\verb|\latelua|). This package provides \verb|\DelayedShellEscape|
% as a common syntax for this use.
%
+% The shell escape status may be queried by checking the integer (chardef)
+% command \verb|\ShellEscapeStatus|, 0 (disabled) 1 (enabled) 2 (restricted).
+%
% To aid porting existing documents to Lua\TeX~0.87 this package does
% overload the \verb|\write| command so that
% \verb|\write18{rm file.txt}|
@@ -95,12 +103,25 @@
%<*package>
% \end{macrocode}
%
+% \changes{v1.0b}{2019/10/17}{Catcode protection}
+% \begin{macrocode}
+\chardef\shellesc@quotecat\catcode`\"
+\chardef\shellesc@underscorecat\catcode`\_
+\@makeother\"
+\@makeother\_
+% \end{macrocode}
+%
% \subsection{Status Check}
%
%
-% \changes{v0.2a}{2016/06/07}{spelling in messages}
+% \subsection{The shellesc package interface}
+%
+% \begin{macro}{\ShellEscapeStatus}
+% \changes{v1.0a}{2019/10/13}{Command Introduced}
+% Integer value with meanings 0 (shell escape disabled), 1 (shell escape allowed), 2 (Restricted shell escape).
+%
% \begin{macrocode}
-\ifcase
+\chardef\ShellEscapeStatus
\ifx\pdfshellescape\@undefined
\ifx\shellescape\@undefined
\ifx\directlua\@undefined
@@ -115,6 +136,12 @@
\else
\pdfshellescape
\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v0.2a}{2016/06/07}{spelling in messages}
+% \begin{macrocode}
+\ifcase\ShellEscapeStatus
\PackageWarning{shellesc}{Shell escape disabled}
\or
\PackageInfo {shellesc}{Unrestricted shell escape enabled}
@@ -123,9 +150,9 @@
\fi
% \end{macrocode}
%
-% \subsection{The shellesc package interface}
%
% \begin{macro}{\ShellEscape}
+% \changes{v1.0a}{2019/10/13}{Lua logging for gh/195}
% Execute the supplied tokens as a system dependent command, assuming
% such execution is allowed.
% \begin{macrocode}
@@ -135,14 +162,14 @@
%
% \begin{macrocode}
\else
- \protected\def\ShellEscape#1{%
- \directlua{os.execute("\luaescapestring{#1}")}}
+ \protected\def\ShellEscape{\directlua\ShellEscape@Lua}
\fi
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\DelayedShellEscape}
% \changes{v0.1c}{2016/04/29}{Define \cs{DelayedShellEscape} not \cs{ShellEscape}(UF)}
+% \changes{v1.0a}{2019/10/13}{Lua logging for gh/195}
% Execute the supplied tokens as a system dependent command, when this
% node is shipped out with the completed page, assuming
% such execution is allowed.
@@ -153,14 +180,38 @@
%
% \begin{macrocode}
\else
- \protected\def\DelayedShellEscape#1{%
- \latelua{os.execute("\luaescapestring{#1}")}}
+ \protected\def\DelayedShellEscape{\latelua\ShellEscape@Lua}
\fi
% \end{macrocode}
% \end{macro}
%
%
%
+% \begin{macro}{\ShellEscape@Lua}
+% \changes{v1.0a}{2019/10/13}{loging for gh/195}
+% Shared Lua code for \verb|\DelayedShellEscape| and \verb|\ShellEscape|.
+% \begin{macrocode}
+\ifx\directlua\@undefined\else
+\protected\def\ShellEscape@Lua#1{{%
+local status, msg = os.execute("\luaescapestring{#1}")%
+if status == nil then
+ texio.write_nl("log",%
+ "runsystem(" .. "\luaescapestring{#1}"%
+ .. ")...(" .. msg .. ")\string\n")
+ elseif status == 0 then
+ texio.write_nl("log",%
+ "runsystem(" .. "\luaescapestring{#1}"%
+ .. ")...executed\string\n")
+ else
+ texio.write_nl("log",%
+ "runsystem(" .. "\luaescapestring{#1}"%
+ .. ")...failed " .. (msg or "") .. "\string\n")
+ end
+}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{The write18 package interface}
%
% In web2c based engines other than Lua\TeX, |\write18| may be used
@@ -189,7 +240,11 @@
%
% Stop at this point if not a recent Lua\TeX.
% \begin{macrocode}
-\ifx\lastsavedimageresourcepages\@undefined\expandafter\endinput\fi
+\ifx\lastsavedimageresourcepages\@undefined
+ \catcode`\"\shellesc@quotecat
+ \catcode`\_\shellesc@underscorecat
+ \expandafter\endinput
+\fi
% \end{macrocode}
%
% \begin{macrocode}
@@ -233,7 +288,10 @@ shellesc.write_or_execute=write_or_execute
\protected\def\write{\directlua{shellesc.write_or_execute()}}
% \end{macrocode}
%
-%
+% \begin{macrocode}
+\catcode`\"\shellesc@quotecat
+\catcode`\"\shellesc@underscorecat
+% \end{macrocode}
%
% \begin{macrocode}
%</package>
diff --git a/Master/texmf-dist/source/latex/tools/varioref.dtx b/Master/texmf-dist/source/latex/tools/varioref.dtx
index 049bd0d55ea..b8392c76f27 100644
--- a/Master/texmf-dist/source/latex/tools/varioref.dtx
+++ b/Master/texmf-dist/source/latex/tools/varioref.dtx
@@ -40,7 +40,7 @@
%<package>\DeclareCurrentRelease{}{2019-10-01}
%<package>
%<package>\ProvidesPackage{varioref}
-%<package> [2019/09/08 v1.6b package for extended references (FMi)]
+%<package> [2019/11/05 v1.6c package for extended references (FMi)]
% \fi
%
%%
@@ -730,7 +730,7 @@
% workflow uses pdf\TeX{} the Arabic letters can't be displayed
% easily, so you will see missing glyphs below. To see the real
% letters you have to look at the source or package file.
-% \changes{v1.6b}{2019/09/8}{Option arabic added}
+% \changes{v1.6b}{2019/09/08}{Option arabic added}
% \begin{allowtofu}
% \begin{macrocode}
\DeclareOption{arabic}
@@ -1642,16 +1642,21 @@
% \end{macro}
%
% \begin{macro}{\vref@space}
+% \begin{macro}{\vref@maybe@space}
% \changes{v1.4a}{2002/03/06}{Default added}
% A default for |\vref@space|. This isn't really needed except in
% the case that somebody has hooked into the \pkg{varioref}
% interfaces at a lower level (which isn't really supported,
% but\ldots). So giving a default will prevent an error message in
% that case (and should hopefully produce the same behavior as before).
+% \changes{v1.6c}{2019/11/05}{Support (mis)use of internal interface by
+% fancyref (sx/515106)}
% \begin{macrocode}
\let\vref@space\space
+\let\vref@maybe@space\space
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@vpageref}
% More parsing\ldots
diff --git a/Master/texmf-dist/source/latex/tools/xr.dtx b/Master/texmf-dist/source/latex/tools/xr.dtx
index 417a98c1c1e..97c4c68084e 100644
--- a/Master/texmf-dist/source/latex/tools/xr.dtx
+++ b/Master/texmf-dist/source/latex/tools/xr.dtx
@@ -86,7 +86,7 @@
%
% As first suggested in Enrico Gregorio's |xcite| package, the current version
% also allows |\cite| to reference |\bibitem| in the external document.
-% For fcompatibility with |xcite|, |\externalcitedocument| is made available
+% For compatibility with |xcite|, |\externalcitedocument| is made available
% as an alias for |\externaldocument|
%
% \StopEventually{}