summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/standalone/standalone.cls
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/standalone/standalone.cls')
-rw-r--r--Master/texmf-dist/tex/latex/standalone/standalone.cls61
1 files changed, 54 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/latex/standalone/standalone.cls b/Master/texmf-dist/tex/latex/standalone/standalone.cls
index a60e7bf0fd5..a5d9474da06 100644
--- a/Master/texmf-dist/tex/latex/standalone/standalone.cls
+++ b/Master/texmf-dist/tex/latex/standalone/standalone.cls
@@ -1,4 +1,4 @@
-%% Copyright (C) 2011 by Martin Scharrer <martin@scharrer-online.de>
+%% Copyright (C) 2011-2012 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
@@ -12,13 +12,14 @@
%%
%% The Current Maintainer of this work is Martin Scharrer.
%%
-%% This work consists of the files <+name+>.dtx and <+name+>.ins
-%% and the derived filebase <+name+>.sty.
+%% This work consists of the files standalone.dtx and standalone.ins
+%% and the derived filebase standalone.sty, standalone.cls and
+%% standalone.cfg.
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{standalone}[%
- 2012/04/13
- v1.0b
+ 2012/05/05
+ v1.1
Class to compile TeX sub-files standalone]
\newif\ifstandalone
\standalonetrue
@@ -126,6 +127,9 @@
\sa@clsoption{border}{%
\sa@readborder#1 {} {} {} {} \@nnil
}
+\sa@clsoption{margin}{%
+ \sa@readborder#1 {} {} {} {} \@nnil
+}
\def\sa@boolean#1#2{%
\sa@boolorvalue{#1}{#2}%
{\ClassError{standalone}{Invalid value '#2' for boolean key '#1'}{}}%
@@ -313,6 +317,11 @@
\sa@clsoption{png}[]{%
\setkeys{standalone.cls/convert}{png,#1}%
}
+\sa@convertoption{realmainfile}[]{%
+ \RequirePackage{currfile-abspath}%
+ \getmainfile
+ \let\sa@convert@mainfile\themainfile
+}
\sa@convertoption{jpg}[]{%
\setkeys{standalone.cls/convert}{true,outext={.jpg}}%
}
@@ -378,7 +387,11 @@
\sa@convertoption{ghostscript}[]{%
\def\sa@convert@command{\gsexe\space -dSAFER -dBATCH -dNOPAUSE -sDEVICE=\gsdevice\space -r\density\space -sOutputFile=\outfile\space \infile}%
}
+\sa@convertvar{latexoptions}{ -shell-escape }
\sa@convertvar{subjobname}{\jobname}
+\sa@convertvar{mainfile}{\jobname}
+\sa@convertvar{quote}{}
+\let\sa@convert@quote\relax
\sa@convertvar{size}{}
\sa@convertvar{inname}{\subjobname}
\sa@convertvar{infile}{\inname\inext}
@@ -460,6 +473,35 @@
\AtBeginDocument{%
\disable@keys{standalone.cls}{multi}%
}
+\ifsa@convert
+\ifx\sa@convert@quote\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@convert@quote{"}
+\else
+\def\sa@convert@quote{'}
+\fi
+\fi
+\fi
\expandafter\expandafter\expandafter\LoadClass
\expandafter\expandafter\expandafter[%
\expandafter\@classoptionslist
@@ -751,7 +793,10 @@
}{%
\def\filemodbefore{}%
}}}}%
- \immediate\write18{\sa@convert@latex\space -jobname '\sa@convert@subjobname' '\noexpand\expandafter\def\noexpand\csname sa@internal@run\noexpand\endcsname{1}\noexpand\input{\jobname}'}%
+ \immediate\write18{\sa@convert@latex\space\sa@convert@latexoptions\space
+ -jobname \sa@convert@quote\sa@convert@subjobname\sa@convert@quote\space
+ \sa@convert@quote\string\expandafter\string\def\string\csname\space
+ sa@internal@run\string\endcsname{1}\string\input{\sa@convert@mainfile}\sa@convert@quote}%
\edef\sa@convert@precommand{\sa@convert@precommand}%
\ifx\sa@convert@precommand\@empty\else
\immediate\write18{\sa@convert@precommand}%
@@ -781,13 +826,14 @@
\sa@convert@failuremsg{standalone}{#1}{}%
\fi
\else
- \ClassInfo{standalone}{Conversion successful.}%
+ \typeout{Class standalone:^^JOutput written on \outfile.}%
\fi
\else
\sa@convert@failuremsg{standalone}{#1}{}%
\fi
}
\let\subjobname\sa@convert@subjobname
+\let\mainfile\sa@convert@mainfile
\let\infile\sa@convert@infile
\let\inext\sa@convert@inext
\let\inname\sa@convert@inname
@@ -800,6 +846,7 @@
\let\outname\sa@convert@outname
\let\outfile\sa@convert@outfile
\let\percent\@percentchar
+\let\quote\sa@convert@quote
\ifcase0%
\expandafter\ifx\csname pdfshellescape\endcsname\relax
\ifeof18 \else 3\fi