summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/standalone/standalone.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-03-25 21:25:52 +0000
committerKarl Berry <karl@freefriends.org>2018-03-25 21:25:52 +0000
commit4aa51574f9198035e1261f69c6873f7dc0ea5789 (patch)
treeb20c48dc114e9fa815fbfd111b421bb5cbc11bb4 /Master/texmf-dist/tex/latex/standalone/standalone.sty
parent7797b94583f26cd24bfa620b9579bf7d83352ca8 (diff)
standalone (25mar18)
git-svn-id: svn://tug.org/texlive/trunk@47110 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/standalone/standalone.sty')
-rw-r--r--Master/texmf-dist/tex/latex/standalone/standalone.sty54
1 files changed, 37 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/latex/standalone/standalone.sty b/Master/texmf-dist/tex/latex/standalone/standalone.sty
index 362b68a4795..785289a87d2 100644
--- a/Master/texmf-dist/tex/latex/standalone/standalone.sty
+++ b/Master/texmf-dist/tex/latex/standalone/standalone.sty
@@ -1,4 +1,4 @@
-%% Copyright (C) 2011-2012 by Martin Scharrer <martin@scharrer-online.de>
+%% Copyright (C) 2011-2017 by Martin Scharrer <martin@scharrer-online.de>
%% ---------------------------------------------------------------------------
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
@@ -19,8 +19,8 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{standalone}[%
- 2015/07/15
- v1.2
+ 2018/03/24
+ v1.3
Package to include TeX sub-files with preambles]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\@ifundefined{ifstandalone}{%
@@ -37,6 +37,17 @@
\@ifundefined{IfStandalone}{%
\let\IfStandalone\@secondoftwo
}{}
+\expandafter\ifx\csname ShellEscape\endcsname\relax
+ \IfFileExists{shellesc.sty}{
+ \RequirePackage{shellesc}
+ \@ifpackagelater{shellesc}{2016/04/29}{
+ }{
+ \protected\def\ShellEscape{\immediate\write18 }
+ }
+ }{
+ \protected\def\ShellEscape{\immediate\write18 }
+ }
+\fi
\expandafter\ifx\csname ifluatex\endcsname\relax
\IfFileExists{ifluatex.sty}{
\RequirePackage{ifluatex}
@@ -539,7 +550,8 @@
\else
\begingroup
\setbox\@tempboxa\hbox{%
- \InputIfFileExists{\jobname.sta}{}{\PackageInfo{standalone}{STA file not found!}{}{}}%
+ \makeatother
+ \InputIfFileExists{\jobname.sta}{}{\PackageInfo{standalone}{STA file not found!}{}{}}%
}%
\endgroup
@@ -773,6 +785,9 @@
\advance\sa@internal\m@ne
\ifnum\sa@internal=0
\endsa@boxit
+ \ifx\sa@requestedpage\@empty
+\let\sa@requestedpage\sa@allpages
+ \fi
\ifx\sa@requestedpage\sa@allpages
\usebox\sa@box
\else
@@ -937,16 +952,7 @@
\expandafter\endgroup
\expandafter\@tempa\expandafter{\sa@subfile@options}%
\sa@atendofclass
- \ifpdf
- \ifx\GPT@page\@empty\else
- \let\sa@requestedpage\GPT@page
- \fi
- \else
- \ifxetex
- \ifx\Gin@XeTeX@page\@empty\else
- \let\sa@requestedpage\Gin@XeTeX@page
- \fi
- \fi\fi
+ \let\sa@requestedpage\Gin@page
\sa@pagenum\z@
\sa@beginbox
\@ifundefined{KOMAClassName}{%
@@ -1087,7 +1093,21 @@
\fi
}
\def\sa@buildgraphic#1{%
- \ifeof18
+ \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
\PackageError{standalone}{Shell escape needed to create graphic! Use the '-shell-escape' option.}{}%
\else
\begingroup
@@ -1099,9 +1119,9 @@
\let\buildjobname\sa@build@jobname
\sa@setquote
\let\quote\sa@build@quote
- \immediate\write18{\sa@build@command}%
+ \ShellEscape{\sa@build@command}%
\ifx\sa@build@postcommand\@empty\else
- \immediate\write18{\sa@build@postcommand}%
+ \ShellEscape{\sa@build@postcommand}%
\fi
\IfFileExists{\outfile}{%
\edef\filemodafter{\csname pdffilemoddate\endcsname{\outfile}}%