summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/standalone/standalone.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/standalone/standalone.sty')
-rw-r--r--Master/texmf-dist/tex/latex/standalone/standalone.sty69
1 files changed, 54 insertions, 15 deletions
diff --git a/Master/texmf-dist/tex/latex/standalone/standalone.sty b/Master/texmf-dist/tex/latex/standalone/standalone.sty
index 15c9d4dcf99..362b68a4795 100644
--- a/Master/texmf-dist/tex/latex/standalone/standalone.sty
+++ b/Master/texmf-dist/tex/latex/standalone/standalone.sty
@@ -19,8 +19,8 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{standalone}[%
- 2012/09/15
- v1.1b
+ 2015/07/15
+ v1.2
Package to include TeX sub-files with preambles]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\@ifundefined{ifstandalone}{%
@@ -38,48 +38,48 @@
\let\IfStandalone\@secondoftwo
}{}
\expandafter\ifx\csname ifluatex\endcsname\relax
- \IfFileExists{ifluatex.sty}{\@firstoftwo}{\@secondoftwo}{%
+ \IfFileExists{ifluatex.sty}{
\RequirePackage{ifluatex}
}{
\begingroup
\expandafter\ifx\csname directlua\endcsname\relax
\endgroup
- \expandafter\let\csname ifluatex\expandafter\endcsname\csname iffalse\endcsname
+ \global\expandafter\let\csname ifluatex\expandafter\endcsname\csname iffalse\endcsname
\else
\endgroup
- \expandafter\let\csname ifluatex\expandafter\endcsname\csname iftrue\endcsname
+ \global\expandafter\let\csname ifluatex\expandafter\endcsname\csname iftrue\endcsname
\fi
}
\fi
\expandafter\ifx\csname ifpdf\endcsname\relax
- \IfFileExists{ifpdf.sty}{\@firstoftwo}{\@secondoftwo}{%
+ \IfFileExists{ifpdf.sty}{
\RequirePackage{ifpdf}
}{
\begingroup
\expandafter\ifx\csname pdfoutput\endcsname\relax
\endgroup
- \expandafter\let\csname ifpdf\expandafter\endcsname\csname iffalse\endcsname
+ \global\expandafter\let\csname ifpdf\expandafter\endcsname\csname iffalse\endcsname
\else
\endgroup
\ifnum\pdfoutput<1
- \expandafter\let\csname ifpdf\expandafter\endcsname\csname iffalse\endcsname
+ \global\expandafter\let\csname ifpdf\expandafter\endcsname\csname iffalse\endcsname
\else
- \expandafter\let\csname ifpdf\expandafter\endcsname\csname iftrue\endcsname
+ \global\expandafter\let\csname ifpdf\expandafter\endcsname\csname iftrue\endcsname
\fi
\fi
}
\fi
\expandafter\ifx\csname ifxetex\endcsname\relax
- \IfFileExists{ifxetex.sty}{\@firstoftwo}{\@secondoftwo}{%
+ \IfFileExists{ifxetex.sty}{
\RequirePackage{ifxetex}
}{
\begingroup
\expandafter\ifx\csname XeTeXrevision\endcsname\relax
\endgroup
- \expandafter\let\csname ifxetex\expandafter\endcsname\csname iffalse\endcsname
+ \global\expandafter\let\csname ifxetex\expandafter\endcsname\csname iffalse\endcsname
\else
\endgroup
- \expandafter\let\csname ifxetex\expandafter\endcsname\csname iftrue\endcsname
+ \global\expandafter\let\csname ifxetex\expandafter\endcsname\csname iftrue\endcsname
\fi
}
\fi
@@ -204,6 +204,9 @@
\sa@pkgoption{extension}{%
\def\sa@graphicext{#1}%
}
+\sa@pkgoption{build}[]{%
+ \setkeys{standalone.sty/build}{#1}%
+}
\def\sa@buildvar#1#2{%
\define@key{standalone.sty/build}{#1}{%
\@namedef{sa@build@#1}{##1}%
@@ -212,8 +215,10 @@
}
\sa@buildvar{jobname}{\file}
\sa@buildvar{latex}{}
+\sa@buildvar{quote}{}
+\let\sa@build@quote\relax
\sa@buildvar{latexoptions}{%
- -interaction=batchmode -shell-escape -jobname '\buildjobname'
+ -interaction=batchmode -shell-escape -jobname \quote\buildjobname\quote
}
\sa@buildvar{command}{%
\latex\space\latexoptions\space\file
@@ -234,10 +239,42 @@
\else
\def\sa@graphicext{.eps}
\def\sa@build@latex{latex}
- \def\sa@build@postcommand{dvips -o '\file.eps' '\file.dvi'}
+ \def\sa@build@postcommand{dvips -o \quote\file.eps\quote\space \quote\file.dvi\quote}
\fi\fi
\ProcessOptionsX*<standalone.sty>\relax
\disable@keys{standalone.sty}{subpreambles,print,sort}
+\def\sa@setquote{%
+ \ifx\sa@build@quote\relax
+ \expandafter\ifx\csname sa@convert@quote\endcsname\relax
+ \begingroup
+ \@tempswafalse
+ \expandafter\ifx\csname pdftexbanner\endcsname\relax
+ \@tempswatrue
+ \else
+ \def\MiKTeX{MiKTeX}
+ \@onelevel@sanitize\MiKTeX
+ \expandafter\def\expandafter\testmiktex\expandafter##\expandafter1\MiKTeX##2\relax{%
+ \ifx\empty##2\empty
+ \@tempswafalse
+ \else
+ \@tempswatrue
+ \fi
+ }
+ \expandafter\expandafter
+ \expandafter\testmiktex\expandafter\pdftexbanner\MiKTeX\relax\relax
+ \fi
+ \expandafter
+ \endgroup
+ \if@tempswa
+ \def\sa@build@quote{"}
+ \else
+ \def\sa@build@quote{'}
+ \fi
+ \else
+ \let\sa@build@quote\sa@convert@quote
+ \fi
+ \fi
+}
\ifsa@printsubpreambles
\ifsa@sortsubpreambles\else
\@ifundefined{sa@percent}{%
@@ -1044,7 +1081,7 @@
}%
{%
\PackageInfo{standalone}%
- {#3.tex file newer then #2}%
+ {generated file #2 newer then source file #3.tex}%
\includegraphics[#1]{#2}%
}%
\fi
@@ -1060,6 +1097,8 @@
\let\latex\sa@build@latex
\let\latexoptions\sa@build@latexoptions
\let\buildjobname\sa@build@jobname
+ \sa@setquote
+ \let\quote\sa@build@quote
\immediate\write18{\sa@build@command}%
\ifx\sa@build@postcommand\@empty\else
\immediate\write18{\sa@build@postcommand}%