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.sty22
1 files changed, 15 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/latex/storebox/storebox.sty b/Master/texmf-dist/tex/latex/storebox/storebox.sty
index 9de1791cad4..1562a41bbeb 100644
--- a/Master/texmf-dist/tex/latex/storebox/storebox.sty
+++ b/Master/texmf-dist/tex/latex/storebox/storebox.sty
@@ -13,17 +13,19 @@
%% 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.
+%% and the derived filebase storebox.sty and storebox-pgf.sty.
%%
\ProvidesPackage{storebox}[%
- 2011/10/21
- v1.1
+ 2011/12/21
+ v1.3a
Store and reuse boxes in a file size efficient way]
\DeclareOption{disable}{\let\ifstorebox\iffalse}
\DeclareOption{enable}{\let\ifstorebox\iftrue}
+\DeclareOption{immediate}{\let\storebox@immediate\immediate}
+\DeclareOption{delayed}{\let\storebox@immediate\relax}
+\ExecuteOptions{delayed}
\ProcessOptions*
-\edef\@tempa{\@ptionlist{\@currname.\@currext}}
-\ifx\@tempa\empty
+\expandafter\ifx\csname ifstorebox\endcsname\relax
\RequirePackage{ifpdf}
\expandafter\let\csname ifstorebox\expandafter\endcsname\csname ifpdf\endcsname
\fi
@@ -42,7 +44,10 @@
\ifstorebox
\def\@storebox#1{%
\begingroup
- \@collectboxto\collectedbox{\pdfxform\collectedbox\endgroup\mathchardef#1=\pdflastxform}%
+ \@collectboxto\collectedbox{%
+ \storebox@immediate\pdfxform resources {\the\pdfpageresources}\collectedbox
+ \endgroup\mathchardef#1=\pdflastxform
+ }%
}
\def\@storebox@env#1{%
\edef\@tempa{%
@@ -66,7 +71,7 @@
\def\@storebox@env@end{%
\edef\@tempa{%
\egroup
- \pdfxform\collectedbox
+ \immediate\pdfxform resources {\the\pdfpageresources}\collectedbox
\endgroup
\mathchardef\expandafter\noexpand\the@storebox=\pdflastxform
}%
@@ -78,6 +83,9 @@
\newcommand*\usestorebox[1]{%
\mbox{\pdfrefxform#1}%
}
+\AtBeginDocument{%
+ \@ifpackageloaded{pgf}{\RequirePackage{storebox-pgf}{}}%
+}
\else
\def\@storebox#1{\@collectboxto{#1}{}}
\def\@storebox@env{%