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.cls65
1 files changed, 63 insertions, 2 deletions
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