summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/storebox/storebox.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/storebox/storebox.sty')
-rw-r--r--Master/texmf-dist/tex/latex/storebox/storebox.sty99
1 files changed, 99 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/storebox/storebox.sty b/Master/texmf-dist/tex/latex/storebox/storebox.sty
new file mode 100644
index 00000000000..4666417a38b
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/storebox/storebox.sty
@@ -0,0 +1,99 @@
+%% Copyright (C) 2011 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
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Martin Scharrer.
+%%
+%% This work consists of the files storebox.dtx and storebox.ins
+%% and the derived filebase storebox.sty.
+%%
+\ProvidesPackage{storebox}[%
+ 2011/09/22
+ v1.0
+ Store and reuse boxes in a file size efficient way]
+\DeclareOption{disable}{\let\ifstorebox\iffalse}
+\DeclareOption{enable}{\let\ifstorebox\iftrue}
+\ProcessOptions*
+\edef\@tempa{\@ptionlist{\@currname.\@currext}}
+\ifx\@tempa\empty
+ \RequirePackage{ifpdf}
+ \expandafter\let\csname ifstorebox\expandafter\endcsname\csname ifpdf\endcsname
+\fi
+\RequirePackage{collectbox}[2011/08/04]
+\newcommand*\storebox{%
+ \collectboxcheckenv{storebox}%
+ \ifcollectboxenv
+ \endgroup
+ \expandafter\@storebox@env
+ \else
+ \expandafter\@storebox
+ \fi
+}
+\ifstorebox
+\def\@storebox#1{%
+ \begingroup
+ \@collectboxto\collectedbox{\pdfxform\collectedbox\endgroup\mathchardef#1=\pdflastxform}%
+}
+\def\@storebox@env#1{%
+ \edef\@tempa{%
+ \setbox\collectedbox\hbox\bgroup%
+ \def\noexpand\@tempa{\noexpand#1}%
+ }%
+ \@tempa
+ \begingroup
+ \aftergroup\@storebox@env@end
+ \@endpefalse
+ \color@setgroup
+ \begingroup
+ \def\@currenvir{storebox\empty}%
+ \ignorespaces
+}
+\def\@storebox@env@end{%
+ \edef\@tempa{%
+ \egroup
+ \pdfxform\collectedbox
+ \endgroup
+ \mathchardef\expandafter\noexpand\@tempa=\pdflastxform
+ }%
+ \@tempa
+}
+\def\endstorebox{%
+ \unskip
+ \endgroup
+ \color@endgroup
+}
+\newcommand*\newstorebox[1]{%
+ \@ifdefinable{#1}{\let#1\relax}%
+}
+\newcommand*\usestorebox[1]{%
+ \mbox{\pdfrefxform#1}%
+}
+\else
+\def\@storebox#1{\@collectboxto{#1}{}}
+\def\@storebox@env{%
+ \edef\@currenvir{\@currenvir\noexpand\noexpand\noexpand\empty}%
+ \lrbox
+}
+\def\endstorebox{%
+ \endlrbox
+ \edef\@currenvir{\@currenvir}%
+}
+\@ifdefinable\newstorebox{%
+\let\newstorebox\newsavebox
+}
+\@ifdefinable\usestorebox{%
+\let\usestorebox\usebox
+}
+\fi
+
+\endinput
+%%
+%% End of file `storebox.sty'.