summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-04-13 22:12:38 +0000
committerKarl Berry <karl@freefriends.org>2012-04-13 22:12:38 +0000
commita4f01148777f706bc0182da96daaebf2e7224c96 (patch)
tree36aca06a5845290f16e97eae64f7511457387191 /Master/texmf-dist/source/latex
parentebfea0e090398fb8c7a2c20a969250bf026efbee (diff)
standalone 1.0b (13apr12)
git-svn-id: svn://tug.org/texlive/trunk@25951 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r--Master/texmf-dist/source/latex/standalone/standalone.dtx101
1 files changed, 99 insertions, 2 deletions
diff --git a/Master/texmf-dist/source/latex/standalone/standalone.dtx b/Master/texmf-dist/source/latex/standalone/standalone.dtx
index 512188ed8da..5901d00fffa 100644
--- a/Master/texmf-dist/source/latex/standalone/standalone.dtx
+++ b/Master/texmf-dist/source/latex/standalone/standalone.dtx
@@ -25,10 +25,10 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{standalone.dtx}[%
%<=*DATE>
- 2012/04/10
+ 2012/04/13
%<=/DATE>
%<=*VERSION>
- v1.0a
+ v1.0b
%<=/VERSION>
DTX file of the standalone bundle]
\documentclass[a4paper,11pt]{ydoc}
@@ -1194,10 +1194,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
% \end{macrocode}
%
% The \cs{ifstandalonebeamer} switch is in the user-level.
@@ -1307,6 +1309,17 @@
% \end{key}
%
%
+% \begin{key}{standalone.cls}{ignoreempty}
+% Boolean to control if empty boxes/pages should be ignored.
+% This is intended mostly for the \opt{multi} option and currently only works with \opt{crop} but not with \opt{preview}.
+% \begin{macrocode}
+\sa@clsoption{ignoreempty}[true]{%
+ \sa@boolean{ignoreempty}{#1}%
+}
+% \end{macrocode}
+% \end{key}
+%
+%
% \begin{key}{standalone.cls}{multi}
% Boolean to control if multiple pages are used.
% \begin{macrocode}
@@ -1317,6 +1330,62 @@
% \end{key}
%
%
+% \begin{key}{standalone.cls}{math}
+% Boolean to control if multiple pages are used.
+% \begin{macrocode}
+\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}
+% \end{macrocode}
+% \end{key}
+%
+% \begin{macro}{\sa@math}
+% Enables a simple support for multiple math equations.
+% Displaymath is typeset as in-text math but with \cs{displaystyle} in effect.
+% This allows \Macro\(, \Macro\), \Macro\[ and \Macro\] as well as \env{math} and \env{displaymath}.
+% To simply typeset multiple equations two environments \env{multimath} and \env{multidisplaymath}
+% are defined which use \Macro\\ as a delimiter. Every equation will be placed on a tight page on its own.
+% To allow a trailing \Macro\\ the \opt{ignoreempty} is automatically enabled.
+% \begin{macrocode}
+\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
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
% \begin{key}{standalone.cls}{varwidth}
% Boolean to control if \pkg{varwidth} package should be used.
% If so the content will be placed in a \env{varwidth} environment to avoid extending it to the full line width if a
@@ -1595,6 +1664,23 @@
% \end{macrocode}
% \end{key}
%
+% \begin{key}{standalone.cls/convert}{command}
+% \begin{macrocode}
+\sa@convertoption{command}{%
+ \def\sa@convert@command{#1}%
+}
+% \end{macrocode}
+% \end{key}
+%
+% \begin{key}{standalone.cls/convert}{pdf2svg}
+% \begin{macrocode}
+\sa@convertoption{pdf2svg}[]{%
+ \def\sa@convert@command{pdf2svg \infile\space\outfile}%
+ \sa@convertvar{outext}{.svg}
+}
+% \end{macrocode}
+% \end{key}
+%
% \begin{key}{standalone.cls/convert}{imagemagick}
% \begin{macrocode}
\sa@convertoption{imagemagick}[]{%
@@ -2002,6 +2088,16 @@
% using the output format dependent \Macro\sa@placebox macro.
% \begin{macrocode}
\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{%
% \end{macrocode}
% add left border
@@ -2030,6 +2126,7 @@
\hskip\sa@border@right
}%
\sa@placebox
+ \fi
}
% \end{macrocode}
% \end{macro}