summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-03-26 21:16:38 +0000
committerKarl Berry <karl@freefriends.org>2018-03-26 21:16:38 +0000
commit1b9c31dfc4a61ac2077b6f069dcdb74f4d0d6bb2 (patch)
treeb038df69d48c4a0d12b7c2bdaa5ae4721d1d867d /Master/texmf-dist/source/latex
parent82b00f8ff627ca67a518482f47510e1fc574766f (diff)
standalone (26mar18)
git-svn-id: svn://tug.org/texlive/trunk@47136 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r--Master/texmf-dist/source/latex/standalone/standalone.dtx88
1 files changed, 46 insertions, 42 deletions
diff --git a/Master/texmf-dist/source/latex/standalone/standalone.dtx b/Master/texmf-dist/source/latex/standalone/standalone.dtx
index 30884fd6d9a..e2b20a99e83 100644
--- a/Master/texmf-dist/source/latex/standalone/standalone.dtx
+++ b/Master/texmf-dist/source/latex/standalone/standalone.dtx
@@ -26,10 +26,10 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{standalone.dtx}[%
%<=*DATE>
- 2018/03/24
+ 2018/03/26
%<=/DATE>
%<=*VERSION>
- v1.3
+ v1.3a
%<=/VERSION>
DTX file of the standalone bundle]
\documentclass[a4paper,11pt]{ydoc}
@@ -90,6 +90,10 @@
% \changes{v1.1b}{2012/09/15}{Fixed issue with 'subpreambles' for Beamer documents.}
% \changes{v1.2}{2012/12/31}{Fixed build issue with MiKTeX due to incorrect quoting character.}
% \changes{v1.3}{2018/03/24}{Several fixes for new driver and LuaTeX versions. Other minor fixes in bundle and manual.}
+% \changes{v1.3a}{2018/03/26}{Improved shellescape code to ensure compatibility with all current LaTeX formats.
+% Added loading of LuaTeX compatibility packages.
+% Changed filemodedate code to support LuaTeX.
+% Fixes for option combination multi,convert.}
%
% \GetFileInfo{\jobname.dtx}
%
@@ -208,7 +212,7 @@
% \section{Bug reports, feature requests and other feedback}
% Bug reports, feature requests and other feedback about the \cls{standalone} bundle can be sent to the author
% either by email to \href{mailto:martin@scharrer-online.de?subject=standalone:%20}{martin@scharrer-online.de}
-% or using the issue tracker for the bundle under \href{https://bitbucket.org/martin_scharrer/standalone/issues}.
+% or using the issue tracker for the bundle under \url{https://bitbucket.org/martin_scharrer/standalone/issues}.
% Bug reports should include the used version of \cls{standalone} as well as the used \LaTeX\ format (|pdflatex|, |latex|, |xelatex|, etc.) and distribution including its version.
% Usually a minimal example which recreate the issue is immensely helpful in analysing and solving any bug.
% Please look for existing related issue tickets first and check the FAQ/troubleshooting in \autoref{sec:classfaq} first.
@@ -2077,6 +2081,13 @@
\fi
% \end{macrocode}
%
+% Load Lua\LaTeX{} compatibility packages.
+% \begin{macrocode}
+\ifluatex
+\RequirePackage{luatex85}
+\RequirePackage{pdftexcmds}
+\fi
+% \end{macrocode}
%
% Set correct quoting character for conversion option if none was set.
% \begin{macrocode}
@@ -2597,16 +2608,16 @@
% \begin{macrocode}
\def\sa@convert#1{%
\IfFileExists{\outfile}{%
- \edef\filemodbefore{\csname pdffilemoddate\endcsname{\outfile}}%
+ \edef\filemodbefore{\csname pdf\ifluatex @\fi filemoddate\endcsname{\outfile}}%
}{%
\IfFileExists{\outname\outext}{%
- \edef\filemodbefore{\csname pdffilemoddate\endcsname{\outname\outext}}%
+ \edef\filemodbefore{\csname pdf\ifluatex @\fi filemoddate\endcsname{\outname\outext}}%
}{%
\IfFileExists{\outname-0\outext}{%
- \edef\filemodbefore{\csname pdffilemoddate\endcsname{\outname-0\outext}}%
+ \edef\filemodbefore{\csname pdf\ifluatex @\fi filemoddate\endcsname{\outname-0\outext}}%
}{%
\IfFileExists{\outname-1\outext}{%
- \edef\filemodbefore{\csname pdffilemoddate\endcsname{\outname-1\outext}}%
+ \edef\filemodbefore{\csname pdf\ifluatex @\fi filemoddate\endcsname{\outname-1\outext}}%
}{%
\def\filemodbefore{}%
}}}}%
@@ -2617,7 +2628,7 @@
\@tempswafalse
\ifx\@tempa\@tempb
\@tempswatrue
- \edef\infile@filemodbefore{\csname pdffilemoddate\endcsname{\infile}}%
+ \edef\infile@filemodbefore{\csname pdf\ifluatex @\fi filemoddate\endcsname{\infile}}%
\else
\global\let\sa@convert@stop\relax
\fi
@@ -2626,6 +2637,7 @@
\sa@convert@quote\string\expandafter\string\def\string\csname\space
sa@internal@run\string\endcsname{1}\string\input{\sa@convert@mainfile}\sa@convert@quote}%
%
+ \def\sa@multi@numpages{0}%
\begingroup
\IfFileExists{\sa@convert@subjobname.aux}{\@tempswatrue}{\@tempswafalse}%
\if@tempswa
@@ -2646,28 +2658,26 @@
\fi
\endgroup
%
- \setcounter{sapage}{\sa@multi@numpages}%
- \addtocounter{sapage}\sa@convert@pageoffset
- \ifnum\c@sapage=\z@
+ \@tempcnta\sa@multi@numpages\relax
+ \advance\@tempcnta\sa@convert@pageoffset\relax
+ \ifnum\@tempcnta=\z@
\def\sa@multi@pagemark{}%
\edef\sa@lastoutfile{\outfile}%
\else
- \@tempcnta\z@
- \loop\ifnum\value{sapage}>0
- \advance\@tempcnta\@ne
- \divide\c@sapage by 10\relax
+ \@tempcntb\z@
+ \loop\ifnum\@tempcnta>0
+ \advance\@tempcntb\@ne
+ \divide\@tempcnta by 10\relax
\repeat
- \edef\sa@multi@pagemark{-\percent0\the\@tempcnta d}%
+ \edef\sa@multi@pagemark{-\percent0\the\@tempcntb d}%
\begingroup
- \setcounter{sapage}{\sa@multi@numpages}%
- \addtocounter{sapage}\sa@convert@pageoffset
- \def\sa@multi@pagemark{-\arabic{sapage}}%
+ \def\sa@multi@pagemark{-\the\@tempcnta}%
\xdef\sa@lastoutfile{\outfile}%
\endgroup
\fi
%
\if@tempswa
- \edef\infile@filemodafter{\csname pdffilemoddate\endcsname{\infile}}%
+ \edef\infile@filemodafter{\csname pdf\ifluatex @\fi filemoddate\endcsname{\infile}}%
\ifx\infile@filemodbefore\infile@filemodafter
\global\let\sa@convert@stop\relax
\fi
@@ -2681,9 +2691,9 @@
\ShellEscape{\sa@convert@command}%
\@tempswafalse
\IfFileExists{\sa@lastoutfile}{%
- \edef\filemodafter{\csname pdffilemoddate\endcsname{\sa@lastoutfile}}%
+ \edef\filemodafter{\csname pdf\ifluatex @\fi filemoddate\endcsname{\sa@lastoutfile}}%
\ifx\filemodbefore\filemodafter
- \expandafter\ifx\csname pdffilemoddate\endcsname\relax\else
+ \expandafter\ifx\csname pdf\ifluatex @\fi filemoddate\endcsname\relax\else
\sa@convert@failuremsg{standalone}{#1}{}%
\fi
\else
@@ -2717,26 +2727,19 @@
%
%
% \begin{macrocode}
-\ifcase0%
+\edef\sa@shellescape{%
+ \ifluatex
+ \directlua{tex.write(status.shell_escape or 2)}%
+ \else\ifxetex
+ \the\shellescape
+ \else
\expandafter\ifx\csname pdfshellescape\endcsname\relax
- \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
- \else 3\fi
- \else\the\pdfshellescape\fi
-\relax% 0
+ 0%
+ \else
+ \the\pdfshellescape
+ \fi\fi\fi
+}%
+\ifcase\sa@shellescape\relax% 0
\sa@convert@failuremsg
{standalone}{Shell escape disabled! Cannot convert file '\infile'.}{}%
\global\let\sa@convert@stop\relax
@@ -2745,7 +2748,8 @@
There might be something wrong with your\MessageBreak
conversation software or the file permissions!}%
\else% 2 or 3
- \sa@convert{Conversion failed! Please ensure that shell escape\MessageBreak is enabled (e.g. use '-shell-escape').}%
+ \sa@convert{Conversion failed! Please ensure that shell escape\MessageBreak
+ is enabled (e.g. use '-shell-escape').}%
\fi
\endgroup
% \end{macrocode}