summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/adjustbox
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/adjustbox')
-rw-r--r--Master/texmf-dist/tex/latex/adjustbox/adjustbox.sty442
1 files changed, 266 insertions, 176 deletions
diff --git a/Master/texmf-dist/tex/latex/adjustbox/adjustbox.sty b/Master/texmf-dist/tex/latex/adjustbox/adjustbox.sty
index 7ce9d94a77e..b07f7d9c530 100644
--- a/Master/texmf-dist/tex/latex/adjustbox/adjustbox.sty
+++ b/Master/texmf-dist/tex/latex/adjustbox/adjustbox.sty
@@ -16,8 +16,8 @@
%% and the derived file adjustbox.sty.
%%
\ProvidesPackage{adjustbox}[%
- 2012/05/16
- v0.9
+ 2012/05/21
+ v1.0
Adjusting TeX boxes (trim, clip, ...)]
\RequirePackage{xkeyval}
\RequirePackage{adjcalc}
@@ -48,7 +48,10 @@
\ProcessOptionsX*<Adjbox>\relax
\RequirePackage{trimclip}
\RequirePackage{graphicx}[1999/02/16]
-\RequirePackage{collectbox}[2012/05/13]
+\RequirePackage{collectbox}[2012/05/17]
+\@ifpackagelater{collectbox}{2012/05/17}{}{%
+ \let\@Collectbox\@collectbox
+}
\newcommand*\adjustboxset{%
\@ifstar
{\adjbox@addkeysafter}%
@@ -123,6 +126,7 @@
\let\Depth\adjbox@Depth
\let\Totalheight\adjbox@Totalheight
\let\Gin@esetsize\adjbox@esetsize
+ \let\@collectbox\@Collectbox
\@tempswatrue
\toks@{{\adjustbox@content}}%
\def\setlength{\adjsetlength}%
@@ -169,12 +173,86 @@
\@tempswatrue
\adjbox@Gin@add
}
-\def\adjbox@Gin@sizeadd#1#2#3\relax{%
- \ifx\@nnil#3\@nnil
- \adjbox@Gin@add{#1{#2}{#2}}%
+\newcommand\newadjustboxkey{%
+ \@adjustboxkey\adjustbox@newkey
+}
+\newcommand\renewadjustboxkey{%
+ \@adjustboxkey\adjustbox@renewkey
+}
+\newcommand\provideadjustboxkey{%
+ \@adjustboxkey\adjustbox@providekey
+}
+\newcommand\defadjustboxkey{%
+ \@adjustboxkey\@secondoftwo
+}
+\def\@adjustboxkey#1{%
+ \@ifstar
+ {\@adjustboxkey@i#1*}%
+ {\@adjustboxkey@i#1\relax}%
+}
+\def\@adjustboxkey@i#1#2#3{%
+ \@ifnextchar{[}%
+ {\@adjustboxkey@ii#1#2{#3}}%
+ {\@adjustboxkey@ii#1#2{#3}[\@nnil]}%
+}
+\def\@adjustboxkey@ii#1#2#3[#4]#5{%
+ \ifx\@nnil#4\relax
+ \@adjustboxkey@iii#1#2{#3}{}{#5}%
+ \else
+ \@adjustboxkey@iii#1#2{#3}{[#4]}{#5}%
+ \fi
+}
+\def\@adjustboxkey@iii#1#2#3#4#5{%
+ #1{#3}{%
+ \ifx*#2\relax
+ \define@key\adjbox@fam{#3}#4{#5}%
\else
- \adjbox@Gin@add{#1{#2}{#3}}%
+ \define@key\adjbox@fam{#3}#4{%
+ \adjbox@Gin@Add{\@Collectbox{#5}}%
+ }%
\fi
+ }{}%
+}
+\def\define@adjboxkey#1#2{%
+ \define@key\adjbox@fam{#1}{%
+ \adjbox@Gin@Add{#2}%
+ }%
+}
+\def\define@adjboxkey@defvalue#1#2#3{%
+ \define@key\adjbox@fam{#1}[{#2}]{%
+ \adjbox@Gin@Add{#3}%
+ }%
+}
+\def\define@adjboxkey@novalue#1#2{%
+ \define@key\adjbox@fam{#1}[\@nil]{%
+ \adjbox@novalue{##1}%
+ \adjbox@Gin@Add{#2}%
+ }%
+}
+\def\adjbox@novalue#1{%
+ \ifx\@nil#1\else
+ \PackageWarning{adjustbox}{%
+ Key '\XKV@tkey' does not await a value.\MessageBreak
+ Given value will be ignored%
+ }%
+ \fi
+}
+\def\adjustbox@newkey#1#2{%
+ \@ifundefined{KV@\adjbox@fam @#1}{#2}{%
+ \PackageError{adjustbox}{Key '#1' already defined}{}%
+ }%
+}
+\def\adjustbox@renewkey#1{%
+ \@ifundefined{KV@\adjbox@fam @#1}{%
+ \PackageError{adjustbox}{Key '#1' undefined}{}%
+ }%
+}
+\def\adjustbox@providekey#1#2{%
+ \@ifundefined{KV@\adjbox@fam @#1}{#2}{}%
+}
+\def\adjbox@let@key#1#2#3{%
+ \expandafter\let\csname KV@#1@#2\expandafter\endcsname\csname KV@#1@#3\endcsname
+ \expandafter\let\csname KV@#1@#2@default\expandafter\endcsname\csname KV@#1@#3@default\endcsname
}
\define@key{adjbox}{viewport}{%
\def\adjustbox@content{%
@@ -187,9 +265,7 @@
}{#1}%
}%
}
-\define@key\adjbox@fam{Viewport}{%
- \adjbox@Gin@Add{\trimbox@s{#1}}%
-}
+\define@adjboxkey{Viewport}{\trimbox@s{#1}}%
\define@key{adjbox}{trim}{%
\def\adjustbox@content{%
\@trimclip{%
@@ -201,27 +277,13 @@
}{#1}%
}%
}
-\define@key\adjbox@fam{Trim}{%
- \adjbox@Gin@Add{\trimbox@{#1}}%
-}
-\define@key\adjbox@fam{Clip}{%
- \adjbox@Gin@Add{\clipbox@{#1}}%
-}
-\define@key\adjbox@fam{Clip*}{%
- \adjbox@Gin@Add{\clipbox@s{#1}}%
-}
-\define@key\adjbox@fam{margin}{%
- \adjbox@Gin@Add{\marginbox@{#1}}%
-}
-\define@key\adjbox@fam{margin*}{%
- \adjbox@Gin@Add{\marginbox@s{#1}}%
-}
-\define@key\adjbox@fam{padding}{%
- \adjbox@Gin@Add{\marginbox@{#1}}%
-}
-\define@key\adjbox@fam{padding*}{%
- \adjbox@Gin@Add{\marginbox@s{#1}}%
-}
+\define@adjboxkey{Trim}{\trimbox@{#1}}%
+\define@adjboxkey{Clip}{\clipbox@{#1}}
+\define@adjboxkey{Clip*}{\clipbox@s{#1}}
+\define@adjboxkey{margin}{\marginbox@{#1}}
+\define@adjboxkey{margin*}{\marginbox@s{#1}}
+\adjbox@let@key\adjbox@fam{padding}{margin}
+\adjbox@let@key\adjbox@fam{padding*}{margin*}
\define@key\adjbox@fam{scale}{%
\@ifnextchar\bgroup{%
\adjbox@scale@xy
@@ -248,62 +310,82 @@
}
\expandafter\let\csname KV@\adjbox@fam @rotate\endcsname\KV@Gin@angle
\def\adjbox@halign#1#2#3{%
- \Gin@esetsize
- \@tempswatrue
+ \@collectbox{\@adjbox@halign{#1}{#2}{#3}}%
+}
+\def\@adjbox@halign#1#2#3{%
+ \begingroup
\adjsetlength\@tempdima{#1}%
- \edef\@tempa{\leavevmode\hb@xt@\the\@tempdima}%
- \toks@\expandafter\expandafter\expandafter{\expandafter\@tempa\expandafter{\expandafter#2\the\toks@#3}}%
+ \leavevmode\hb@xt@\the\@tempdima{#2\BOXCONTENT#3}%
+ \endgroup
}
-\define@key\adjbox@fam{center}[\linewidth]{%
+\define@adjboxkey@defvalue{center}{\linewidth}{\adjbox@halign{#1}\hss\hss}
+\define@adjboxkey@defvalue{left}{\linewidth}{\adjbox@halign{#1}\relax\hss}
+\define@adjboxkey@defvalue{right}{\linewidth}{\adjbox@halign{#1}\hss\relax}
+\newcommand\centerbox[1][\linewidth]{%
+ \adjustbox@noindent
\adjbox@halign{#1}\hss\hss
}
-\define@key\adjbox@fam{left}[\linewidth]{%
+\newcommand\leftalignbox[1][\linewidth]{%
+ \adjustbox@noindent
\adjbox@halign{#1}\relax\hss
}
-\define@key\adjbox@fam{right}[\linewidth]{%
+\newcommand\rightalignbox[1][\linewidth]{%
+ \adjustbox@noindent
\adjbox@halign{#1}\hss\relax
}
-\define@key\adjbox@fam{outer}[\linewidth]{%
- \def\@tempa{\adjbox@halign{#1}}%
- \if@twoside
- \adjbox@ifoddpage
- {\@tempa\hss\relax}%
- {\@tempa\relax\hss}%
- \else
- \@tempa\hss\hss
- \fi
+\define@adjboxkey@defvalue{outer}{\linewidth}{%
+ \outersidebox[{#1}]%
}
-\define@key\adjbox@fam{inner}[\linewidth]{%
- \def\@tempa{\adjbox@halign{#1}}%
- \if@twoside
- \adjbox@ifoddpage
- {\@tempa\relax\hss}%
- {\@tempa\hss\relax}%
- \else
- \@tempa\hss\hss
- \fi
+\define@adjboxkey@defvalue{inner}{\linewidth}{%
+ \innersidebox[{#1}]%
}
-\def\adjbox@ifoddpage{%
- \begingroup
- \adjbox@checkoddpage
- \expandafter\endgroup
- \ifoddpage
- \expandafter\@firstoftwo
- \else
- \expandafter\@secondoftwo
- \fi
+\newcommand\outersidebox[1][\linewidth]{%
+ \collectboxcheckenv{outersidebox}%
+ \adjustbox@noindent
+ \adjbox@halign{#1}{%
+ \checkoddpage
+ \ifoddpageoroneside
+ \hss
+ \else
+ \relax
+ \fi
+ }{%
+ \ifoddpageoroneside
+ \relax
+ \else
+ \hss
+ \fi
+ }%
}
-\def\adjbox@checkoddpage{%
- \ifodd\c@page
- \oddpagetrue
- \else
- \oddpagefalse
- \fi
-}%
-\newif\ifoddpage
-\AtBeginDocument{%
- \@ifpackageloaded{changepage}{\let\adjbox@checkoddpage\checkoddpage}%
- {\@ifpackageloaded{chngpage}{\let\adjbox@checkoddpage\checkoddpage}{}}%
+\newcommand\innersidebox[1][\linewidth]{%
+ \collectboxcheckenv{innersidebox}%
+ \adjustbox@noindent
+ \adjbox@halign{#1}{%
+ \checkoddpage
+ \ifoddpageoroneside
+ \relax
+ \else
+ \hss
+ \fi
+ }{%
+ \ifoddpageoroneside
+ \hss
+ \else
+ \relax
+ \fi
+ }%
+}
+\IfFileExists{ifoddpage.sty}{%
+ \RequirePackage{ifoddpage}%
+}{%
+ \renewcommand\outersidebox[1][]{%
+ \PackageError{adjustbox}{%
+ The 'outer' and 'inner' keys as well as the\MessageBreak
+ \string\outersidebox\space and \string\innersidebox\space macros\MessageBreak
+ require the 'ifoddpage' package, which is not\MessageBreak
+ installed}{}%
+ }%
+ \let\innersidebox\outersidebox
}%
\define@key\adjbox@fam{raise}{%
\@ifnextchar\bgroup{%
@@ -315,11 +397,8 @@
\def\adjbox@raise#1#2#3#4\@nnil{%
\adjbox@Gin@Add{\adjbox@raisebox{#1}{#2}{#3}}%
}
-\define@key\adjbox@fam{valign}{%
- \csname adjbox@valign@#1\endcsname
-}
\def\adjbox@raisebox#1#2#3{%
- \collectbox{\adjbox@@raisebox{#1}{#2}{#3}}%
+ \@collectbox{\adjbox@@raisebox{#1}{#2}{#3}}%
}
\def\adjbox@@raisebox#1#2#3{%
\ifx\@nnil#1\@nnil
@@ -336,47 +415,42 @@
\adjsetlength\@tempdima{#3}%
\dp\@tempboxa\@tempdima
\fi
+ \leavevmode
\box\@tempboxa
}
+\define@key\adjbox@fam{valign}{%
+ \expandafter\adjbox@Gin@Add\expandafter{\csname adjbox@valign@#1\endcsname}%
+}
\def\adjboxvtop{\ht\strutbox}
\def\adjboxvcenter{1ex}
\def\adjboxvbottom{-\dp\strutbox}
\def\adjbox@valign@t{%
- \adjbox@Gin@Add{\adjbox@raisebox{-\height+\adjboxvtop}{}{}}%
+ \adjbox@raisebox{-\height+\adjboxvtop}{}{}%
}
\def\adjbox@valign@T{%
- \adjbox@Gin@Add{\adjbox@raisebox{-\height}{}{}}%
+ \adjbox@raisebox{-\height}{}{}%
}
\def\adjbox@valign@M{%
- \adjbox@Gin@Add{\adjbox@raisebox{.5\depth-.5\height}{}{}}%
+ \adjbox@raisebox{.5\depth-.5\height}{}{}%
}
\def\adjbox@valign@m{%
- \adjbox@Gin@Add{\adjbox@raisebox{.5\depth-.5\height+\adjboxvcenter}{}{}}%
-}
-\def\adjbox@valign@c{%
- \adjbox@Gin@Add{\@collectbox\adjbox@vcenter}%
+ \adjbox@raisebox{.5\depth-.5\height+\adjboxvcenter}{}{}%
}
-\def\adjbox@vcenter{%
+\def\adjbox@valign@c#1{%
\leavevmode
\hbox{%
- $\vcenter{\hbox{\BOXCONTENT}}\m@th$
+ $\vcenter{\hbox{#1}}\m@th$%
}%
}
\def\adjbox@valign@b{%
- \adjbox@Gin@Add{\adjbox@raisebox{\depth+\adjboxvbottom}{}{}}%
+ \adjbox@raisebox{\depth+\adjboxvbottom}{}{}%
}
\def\adjbox@valign@B{%
- \adjbox@Gin@Add{\adjbox@raisebox{\depth}{}{}}%
-}
-\define@key\adjbox@fam{set height}{%
- \adjbox@Gin@Add{\adjbox@raisebox{}{#1}{}}%
-}
-\define@key\adjbox@fam{set depth}{%
- \adjbox@Gin@Add{\adjbox@raisebox{}{}{#1}}%
-}
-\define@key\adjbox@fam{set vsize}{%
- \adjbox@Gin@Add{\adjbox@raisebox{}#1}%
+ \adjbox@raisebox{\depth}{}{}%
}
+\define@adjboxkey{set height}{\adjbox@raisebox{}{#1}{}}
+\define@adjboxkey{set depth}{\adjbox@raisebox{}{}{#1}}
+\define@adjboxkey{set vsize}{\adjbox@raisebox{}#1}
\define@key\adjbox@fam{vspace}{%
\adjbox@vskip#1 {} \@nnil{}%
}
@@ -390,42 +464,39 @@
\adjust@addcode{\par\vspace#4{#1}\noindent}{\par\vspace#4{#2}}%
\fi
}
-\define@key\adjbox@fam{min width}{%
- \adjbox@Gin@Add{\@minsizebox\height{#1}!}%
-}
-\define@key\adjbox@fam{max width}{%
- \adjbox@Gin@Add{\@maxsizebox\height{#1}!}%
-}
-\define@key\adjbox@fam{min height}{%
- \adjbox@Gin@Add{\@minsizebox\height!{#1}}%
-}
-\define@key\adjbox@fam{max height}{%
- \adjbox@Gin@Add{\@maxsizebox\height!{#1}}%
-}
-\define@key\adjbox@fam{min totalheight}{%
- \adjbox@Gin@Add{\@minsizebox\totalheight!{#1}}%
-}
-\define@key\adjbox@fam{max totalheight}{%
- \adjbox@Gin@Add{\@maxsizebox\totalheight!{#1}}%
+\define@adjboxkey{min width}{\@minsizebox\height{#1}!}
+\define@adjboxkey{max width}{\@maxsizebox\height{#1}!}
+\define@adjboxkey{min height}{\@minsizebox\height!{#1}}
+\define@adjboxkey{max height}{\@maxsizebox\height!{#1}}
+\define@adjboxkey{min totalheight}{\@minsizebox\totalheight!{#1}}
+\define@adjboxkey{max totalheight}{\@maxsizebox\totalheight!{#1}}
+\def\adjbox@Gin@sizeadd#1#2\@nnil{%
+ \@ifnextchar\bgroup{%
+ \adjbox@Gin@Add{#1#2}%
+ \remove@to@nnil
+ }{%
+ \adjbox@Gin@Add{#1{#2}{#2}}%
+ \remove@to@nnil
+ }#2\@nnil
}
\define@key\adjbox@fam{min size}{%
- \adjbox@Gin@sizeadd{\@minsizebox\height}#1\relax
+ \adjbox@Gin@sizeadd{\@minsizebox\height}#1\@nnil
}
\define@key\adjbox@fam{max size}{%
- \adjbox@Gin@sizeadd{\@maxsizebox\height}#1\relax
+ \adjbox@Gin@sizeadd{\@maxsizebox\height}#1\@nnil
}
\define@key\adjbox@fam{min totalsize}{%
- \adjbox@Gin@sizeadd{\@minsizebox\totalheight}#1\relax
+ \adjbox@Gin@sizeadd{\@minsizebox\totalheight}#1\@nnil
}
\define@key\adjbox@fam{max totalsize}{%
- \adjbox@Gin@sizeadd{\@maxsizebox\totalheight}#1\relax
+ \adjbox@Gin@sizeadd{\@maxsizebox\totalheight}#1\@nnil
}
-\define@key\adjbox@fam{warn width}[\linewidth]{%
- \adjust@addcode{\@collectbox{%
+\define@adjboxkey@defvalue{warn width}{\linewidth}{\@Collectbox{\adjbox@warnwidth{#1}}}
+\def\adjbox@warnwidth#1{%
\@tempdima=#1\relax
- \ifdim\width>\@tempdima
- \advance\@tempdima by -\width
- \@tempdima=-\@tempdima
+ \advance\@tempdima by -\width
+ \@tempdima=-\@tempdima
+ \ifdim\@tempdima>\hfuzz
\typeout{Overfull \string\hbox\space (\the\@tempdima\space too wide) in adjustbox at
\ifnum\adjbox@line=\inputlineno
line \adjbox@line
@@ -435,7 +506,6 @@
}%
\fi
\BOXCONTENT
- }}{}%
}
\newcommand*\minsizebox{%
\collectboxcheckenv{minsizebox}%
@@ -520,7 +590,7 @@
}
\def\adjbox@frame#1#2 #3 #4 #5\relax{%
\adjbox@Gin@Add{%
- \@collectbox{#1\adjbox@@frame{}{#2}{#3}{#4}}%
+ \@Collectbox{#1\adjbox@@frame{}{#2}{#3}{#4}}%
}%
\remove@to@nnil
}
@@ -534,7 +604,7 @@
}
\def\adjbox@cframe#1#2 #3 #4 #5 #6\relax{%
\adjbox@Gin@Add{%
- \@collectbox{#1\adjbox@@frame{\color{#2}}{#3}{#4}{#5}}%
+ \@Collectbox{#1\adjbox@@frame{\color{#2}}{#3}{#4}{#5}}%
}%
\remove@to@nnil
}
@@ -667,14 +737,14 @@
}
\def\adjbox@bgcolor#1#2#3\@nnil{%
\ifx\@nnil#1\@nnil
- \adjbox@Gin@add{\@collectbox{\adjbox@@bgcolor{\color{#2}}}}%
+ \adjbox@Gin@add{\@Collectbox{\adjbox@@bgcolor{\color{#2}}}}%
\else
- \adjbox@Gin@add{\@collectbox{\adjbox@@bgcolor{\color[#1]{#2}}}}%
+ \adjbox@Gin@add{\@Collectbox{\adjbox@@bgcolor{\color[#1]{#2}}}}%
\fi
}
\define@key\adjbox@fam{bgcolor*}{%
\adjbox@checkcolor
- \adjbox@Gin@add{\@collectbox{\adjbox@@bgcolor{#1}}}%
+ \adjbox@Gin@add{\@Collectbox{\adjbox@@bgcolor{#1}}}%
}
\def\adjbox@@bgcolor#1{%
\mbox{%
@@ -711,7 +781,7 @@
}#1\@nnil
}
\def\adjbox@bgimage#1#2#3\@nnil{%
- \adjbox@Gin@add{\@collectbox{\@bgimagebox{#1}{#2}}}%
+ \adjbox@Gin@add{\@Collectbox{\@bgimagebox{#1}{#2}}}%
}
\define@key\adjbox@fam{lap}{%
\@ifnextchar\bgroup{%
@@ -895,6 +965,15 @@
\def\adjbox@label{\label{#1}}%
}
\let\adjbox@label\@empty
+\chardef\adjbox@caption@pos=11
+\define@key\adjbox@fam{captionabove}{%
+ \chardef\adjbox@caption@pos=1
+ \csname KV@\adjbox@fam @caption\endcsname{#1}%
+}
+\define@key\adjbox@fam{captionbelow}{%
+ \chardef\adjbox@caption@pos=0
+ \csname KV@\adjbox@fam @caption\endcsname{#1}%
+}
\define@key\adjbox@fam{caption}{%
\@ifnextchar{[}{%
\adjbox@def@caption
@@ -910,47 +989,66 @@
}
\let\adjbox@caption\@empty
\define@key\adjbox@fam{figure}[]{%
- \Gin@esetsize
- \@tempswafalse
\let\adjustbox@noindent\relax
\ifx\@nnil#1\@nnil
- \expandafter\expandafter\expandafter\adjbox@figure
- \expandafter\expandafter\expandafter{\expandafter\adjbox@caption\adjbox@label}{}%
+ \adjbox@addfloat{figure}{\begin{figure}}{}{\end{figure}}%
\else
- \expandafter\expandafter\expandafter\adjbox@figure
- \expandafter\expandafter\expandafter{\expandafter\adjbox@caption\adjbox@label}{[#1]}%
+ \adjbox@addfloat{figure}{\begin{figure}}{[{#1}]}{\end{figure}}%
\fi
}
-\def\adjbox@figure#1#2{%
- \def\@tempa{\begin{figure}#2}%
- \toks@\expandafter\expandafter\expandafter{\expandafter\@tempa\the\toks@#1\end{figure}}%
-}
\define@key\adjbox@fam{float}{%
\let\adjustbox@noindent\relax
\@ifnextchar\bgroup{%
\adjbox@float
}{%
- \adjbox@float{#1}\@nnil
+ \adjbox@float{#1}{}\@nnil
\remove@to@nnil
}#1\@nnil
}
-\def\adjbox@float{%
- \expandafter\expandafter
- \expandafter\adjbox@@float\expandafter\expandafter\expandafter{\expandafter\adjbox@caption\adjbox@label}%
-}
-\def\adjbox@@float#1#2#3\@nnil{%
- \adjust@addcode{\begin{#2}#3}{#1\end{#2}}%
+\def\adjbox@float#1#2\@nnil{%
+ \adjbox@addfloat{#1}{\begin{#1}}{#2}{\end{#1}}%
}
\define@key\adjbox@fam{nofloat}[figure]{%
- \def\@tempa{\adjust@addcode{\adjnofloat{#1}}}%
- \expandafter\expandafter\expandafter
- \@tempa\expandafter\expandafter\expandafter{\expandafter\adjbox@caption\adjbox@label\endadjnofloat}%
+ \adjbox@addfloat{#1}{\adjnofloat}{{#1}}{\endadjnofloat}%
+}
+\def\adjbox@caption@table@pos{1}
+\def\adjbox@addfloat#1#2#3#4{%
+ \ifnum\adjbox@caption@pos>10
+ \chardef\adjbox@caption@pos=0\csname adjbox@caption@#1@pos\endcsname\relax
+ \fi
+ \ifcase\adjbox@caption@pos
+ \def\@tempa{\adjust@addcode{#2#3}}%
+ \expandafter\expandafter\expandafter\@tempa
+ \expandafter\expandafter\expandafter{\expandafter\adjbox@caption\adjbox@label#4}%
+ \else
+ \def\@tempa##1{\adjust@addcode{#2#3\adjbox@captionabove##1}}%
+ \expandafter\expandafter\expandafter\@tempa
+ \expandafter\expandafter\expandafter
+ {\expandafter\adjbox@caption\adjbox@label}{#4}%
+ \fi
+}
+\@ifpackageloaded{caption}{%
+ \let\adjbox@captionabove\relax
+}{%
+ \def\adjbox@captionabove{%
+ \begingroup
+ \edef\@tempa{\endgroup
+ \abovecaptionskip=\the\belowcaptionskip\relax
+ \belowcaptionskip=\the\abovecaptionskip\relax
+ }%
+ \@tempa
+ }%
+ \AtBeginDocument{%
+ \@ifpackageloaded{caption}{%
+ \global\let\adjbox@captionabove\relax
+ }{}%
+ }%
}
\newenvironment{adjnofloat}[1]{%
\trivlist
\def\@captype{#1}%
+ \parindent\z@
\item\relax
- \leavevmode
}{%
\endtrivlist
}
@@ -974,38 +1072,32 @@
\box\collectedbox
\endgroup
}
-\define@key\adjbox@fam{gobble}[]{%
- \let\adjustbox@noindent\relax
- \adjbox@Gin@Add{\@collectbox{}}%
-}
-\define@key\adjbox@fam{discard}[]{%
+\define@key\adjbox@fam{gobble}[\@nil]{%
+ \adjbox@novalue{#1}%
\let\adjustbox@noindent\relax
- \adjbox@Gin@Add{\@collectbox{}}%
-}
-\define@key\adjbox@fam{content}{%
- \adjbox@Gin@Add{\@collectbox{#1}}%
-}
-\define@key\adjbox@fam{gstore}{%
- \adjbox@Gin@Add{\global\@collectboxto{#1}{\BOXCONTENT}}%
+ \adjbox@Gin@Add{\@Collectbox{}}%
}
+\adjbox@let@key\adjbox@fam{discard}{gobble}%
+\define@adjboxkey{content}{\@Collectbox{#1}}%
+\define@adjboxkey{gstore}{\global\@collectboxto{#1}{\BOXCONTENT}}
\define@key\adjbox@fam{gstore*}{%
\let\adjustbox@noindent\relax
- \adjbox@Gin@Add{\global\@collectboxto{#1}{}}%
+ \adjbox@Gin@Add{\global\sbox{#1}}%
}
\define@key{adjbox}{gstore width}{%
- \adjbox@Gin@Add{\@collectbox{\global#1=\width\BOXCONTENT}}%
+ \adjbox@Gin@Add{\@Collectbox{\global#1=\width\BOXCONTENT}}%
}
\define@key{adjbox}{gstore depth}{%
- \adjbox@Gin@Add{\@collectbox{\global#1=\depth\BOXCONTENT}}%
+ \adjbox@Gin@Add{\@Collectbox{\global#1=\depth\BOXCONTENT}}%
}
\define@key{adjbox}{gstore height}{%
- \adjbox@Gin@Add{\@collectbox{\global#1=\height\BOXCONTENT}}%
+ \adjbox@Gin@Add{\@Collectbox{\global#1=\height\BOXCONTENT}}%
}
\define@key{adjbox}{gstore totalheight}{%
- \adjbox@Gin@Add{\@collectbox{\global#1=\totalheight\BOXCONTENT}}%
+ \adjbox@Gin@Add{\@Collectbox{\global#1=\totalheight\BOXCONTENT}}%
}
\define@key{adjbox}{gstore sizes}{%
- \adjbox@Gin@Add{\@collectbox{\adjbox@gstore@sizes#1\relax\relax\relax\relax\@nnil\BOXCONTENT}}%
+ \adjbox@Gin@Add{\@Collectbox{\adjbox@gstore@sizes#1\relax\relax\relax\relax\@nnil\BOXCONTENT}}%
}
\def\adjbox@gstore@sizes#1#2#3#4#5\@nnil{%
\ifx\relax#1\relax\else
@@ -1026,9 +1118,7 @@
\collectboxcheckenv{splitbox}%
\@collectbox{\@splitbox{#1}{#2}}%
}
-\define@key\adjbox@fam{split}{%
- \adjbox@Gin@Add{\@collectbox{\@splitbox#1}}%
-}
+\define@adjboxkey{split}{\@Collectbox{\@splitbox#1}}
\def\@splitbox#1#2{%
\ifstorebox
\storebox\splittedbox{\BOXCONTENT}%
@@ -1103,7 +1193,7 @@
\@collectbox{\@pagebreakbox}%
}
\define@key\adjbox@fam{pagebreak}[]{%
- \adjbox@Gin@Add{\@collectbox{\@pagebreakbox}}%
+ \adjbox@Gin@Add{\@Collectbox{\@pagebreakbox}}%
}
\def\@pagebreakbox{%
\sbox\collectedbox{\raise\dp\collectedbox\hbox{\BOXCONTENT}}%