From a4f01148777f706bc0182da96daaebf2e7224c96 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Fri, 13 Apr 2012 22:12:38 +0000
Subject: standalone 1.0b (13apr12)

git-svn-id: svn://tug.org/texlive/trunk@25951 c570f23f-e606-0410-a88d-b1316a301751
---
 .../texmf-dist/tex/latex/standalone/standalone.cls | 65 +++++++++++++++++++++-
 1 file changed, 63 insertions(+), 2 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/standalone/standalone.cls')

diff --git a/Master/texmf-dist/tex/latex/standalone/standalone.cls b/Master/texmf-dist/tex/latex/standalone/standalone.cls
index d418be0450a..a60e7bf0fd5 100644
--- a/Master/texmf-dist/tex/latex/standalone/standalone.cls
+++ b/Master/texmf-dist/tex/latex/standalone/standalone.cls
@@ -17,8 +17,8 @@
 %%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesClass{standalone}[%
-    2012/04/10
-    v1.0a
+    2012/04/13
+    v1.0b
     Class to compile TeX sub-files standalone]
 \newif\ifstandalone
 \standalonetrue
@@ -112,10 +112,12 @@
 \newif\ifsa@multi
 \newif\ifsa@varwidth
 \newif\ifsa@ignorerest
+\newif\ifsa@ignoreempty
 \newif\ifsa@tikz
 \newif\ifsa@pstricks
 \newif\ifsa@convert
 \newif\ifsa@float
+\newif\ifsa@math
 \let\sa@beamertrue\standalonebeamertrue
 \let\sa@beamerfalse\standalonebeamerfalse
 \def\sa@clsoption{%
@@ -165,9 +167,50 @@
 \sa@clsoption{ignorerest}[true]{%
     \sa@boolean{ignorerest}{#1}%
 }
+\sa@clsoption{ignoreempty}[true]{%
+    \sa@boolean{ignoreempty}{#1}%
+}
 \sa@clsoption{multi}[true]{%
     \sa@boolorvalue{multi}{#1}{\sa@multitrue\AtBeginDocument{\standaloneenv{#1}}}%
 }
+\sa@clsoption{math}[true]{%
+    \sa@boolean{math}{#1}%
+    \ifsa@math
+        \setkeys{standalone.cls}{multi=true,ignoreempty=true,border=0.50001bp}%
+    \fi
+}
+\AtBeginDocument{\ifsa@math\sa@math\fi}
+\def\sa@math{%
+    \standaloneenv{math}%
+    \def\({\begingroup\math}%
+    \def\){\endmath\endgroup}%
+    \def\[{\(\displaystyle}%
+    \def\]{\)}%
+    \def\displaymath{\math\displaystyle}%
+    \def\enddisplaymath{\endmath}%
+    \newcommand*\multimathsep{%
+        \endmath
+        \math
+        \let\\\multimathsep
+    }%
+    \newenvironment{multimath}{%
+        \math
+        \let\\\multimathsep
+    }{%
+        \endmath
+    }%
+    \newcommand*\multidisplaymathsep{%
+        \endmath
+        \math\displaystyle
+        \let\\\multidisplaymathsep
+    }%
+    \newenvironment{multidisplaymath}{%
+        \math\displaystyle
+        \let\\\multidisplaymathsep
+    }{%
+        \endmath
+    }%
+}
 \sa@clsoption{varwidth}[true]{%
     \sa@boolorvalue{varwidth}{#1}{\sa@varwidthtrue\def\sa@width{#1}}%
     \ifsa@varwidth
@@ -322,6 +365,13 @@
 }
 \@namedef{sa@gsdevice@.jpg}{jpeg}%
 \@namedef{sa@gsdevice@.png}{png16m}%
+\sa@convertoption{command}{%
+    \def\sa@convert@command{#1}%
+}
+\sa@convertoption{pdf2svg}[]{%
+    \def\sa@convert@command{pdf2svg \infile\space\outfile}%
+    \sa@convertvar{outext}{.svg}
+}
 \sa@convertoption{imagemagick}[]{%
     \def\sa@convert@command{\convertexe\space -density \density\space \infile\space \ifx\size\empty\else -resize \size\fi\space -quality 90 \outfile}%
 }
@@ -553,6 +603,16 @@
     }%
 \fi
 \def\sa@handlebox{%
+    \ifcase
+        0%
+        \ifsa@ignoreempty
+            \ifdim\wd\sa@box=\z@
+            \ifdim\ht\sa@box=\z@
+            \ifdim\dp\sa@box=\z@
+                1%
+            \fi\fi\fi
+        \fi
+    \relax
     \sbox\sa@box{%
         \hskip\sa@border@left
         \@tempdima=\ht\sa@box
@@ -566,6 +626,7 @@
         \hskip\sa@border@right
     }%
     \sa@placebox
+    \fi
 }
 \ifcase0%
     \ifpdf\else\ifluatex\else\ifxetex\else 1\fi\fi\fi
-- 
cgit v1.2.3

