From 9562128503e3bb590d215ae1c6470f83b8f57b24 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 24 Aug 2011 00:11:12 +0000 Subject: adjustbox (22aug11) git-svn-id: svn://tug.org/texlive/trunk@23673 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/adjustbox/adjcalc.sty | 5 +- Master/texmf-dist/tex/latex/adjustbox/adjgrfx.sty | 5 +- Master/texmf-dist/tex/latex/adjustbox/adjpgf.def | 5 +- .../texmf-dist/tex/latex/adjustbox/adjustbox.sty | 65 +++++++++++++++++++--- 4 files changed, 62 insertions(+), 18 deletions(-) (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/adjustbox/adjcalc.sty b/Master/texmf-dist/tex/latex/adjustbox/adjcalc.sty index 47e512f3aba..6eec7f21017 100644 --- a/Master/texmf-dist/tex/latex/adjustbox/adjcalc.sty +++ b/Master/texmf-dist/tex/latex/adjustbox/adjcalc.sty @@ -22,9 +22,8 @@ %% %% The Current Maintainer of this work is Martin Scharrer. %% -%% This work consists of the files adjustbox.dtx and adjustbox.ins -%% and the derived files adjustbox.sty, adjcalc.sty, adjpgf.def and -%% adjgrfx.sty. +%% This work consists of the files adjustbox.dtx, adjustbox.ins, +%% storebox.dtx and the derived files adjustbox.sty and storebox.sty. %% \begingroup \def\@tempa{adjcalc} diff --git a/Master/texmf-dist/tex/latex/adjustbox/adjgrfx.sty b/Master/texmf-dist/tex/latex/adjustbox/adjgrfx.sty index 215159e1fda..b06a15c801c 100644 --- a/Master/texmf-dist/tex/latex/adjustbox/adjgrfx.sty +++ b/Master/texmf-dist/tex/latex/adjustbox/adjgrfx.sty @@ -22,9 +22,8 @@ %% %% The Current Maintainer of this work is Martin Scharrer. %% -%% This work consists of the files adjustbox.dtx and adjustbox.ins -%% and the derived files adjustbox.sty, adjcalc.sty, adjpgf.def and -%% adjgrfx.sty. +%% This work consists of the files adjustbox.dtx, adjustbox.ins, +%% storebox.dtx and the derived files adjustbox.sty and storebox.sty. %% \ProvidesPackage{adjgrfx}[2011/07/28 v0.1 Patches to graphicx used by adjustbox] \RequirePackage{graphicx} diff --git a/Master/texmf-dist/tex/latex/adjustbox/adjpgf.def b/Master/texmf-dist/tex/latex/adjustbox/adjpgf.def index e4b3e3b6d94..e0224fbc28a 100644 --- a/Master/texmf-dist/tex/latex/adjustbox/adjpgf.def +++ b/Master/texmf-dist/tex/latex/adjustbox/adjpgf.def @@ -22,9 +22,8 @@ %% %% The Current Maintainer of this work is Martin Scharrer. %% -%% This work consists of the files adjustbox.dtx and adjustbox.ins -%% and the derived files adjustbox.sty, adjcalc.sty, adjpgf.def and -%% adjgrfx.sty. +%% This work consists of the files adjustbox.dtx, adjustbox.ins, +%% storebox.dtx and the derived files adjustbox.sty and storebox.sty. %% \RequirePackage{pgf} \def\@clipbox#1#2#3#4#5{% diff --git a/Master/texmf-dist/tex/latex/adjustbox/adjustbox.sty b/Master/texmf-dist/tex/latex/adjustbox/adjustbox.sty index 9cb704520bf..97e2d82fca6 100644 --- a/Master/texmf-dist/tex/latex/adjustbox/adjustbox.sty +++ b/Master/texmf-dist/tex/latex/adjustbox/adjustbox.sty @@ -22,13 +22,12 @@ %% %% The Current Maintainer of this work is Martin Scharrer. %% -%% This work consists of the files adjustbox.dtx and adjustbox.ins -%% and the derived files adjustbox.sty, adjcalc.sty, adjpgf.def and -%% adjgrfx.sty. +%% This work consists of the files adjustbox.dtx, adjustbox.ins, +%% storebox.dtx and the derived files adjustbox.sty and storebox.sty. %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\ProvidesPackage{adjustbox}[2011/08/07 v0.5 Adjusting TeX boxes (trim, clip, ...)] +\ProvidesPackage{adjustbox}[2011/08/21 v0.5a Adjusting TeX boxes (trim, clip, ...)] \RequirePackage{xkeyval} \def\adjbox@defaultunit{bp} @@ -56,7 +55,7 @@ \input{adjcalc.sty} \disable@keys{adjbox}{patch,export,PGF,minimal} \RequirePackage{graphicx}[1999/02/16] -\RequirePackage{collectbox}[2011/08/06] +\RequirePackage{collectbox}[2011/08/11] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \define@key{adjbox}{viewport}{% @@ -506,7 +505,7 @@ \def\adjboxvcenter{1ex} \def\adjboxvbottom{-\dp\strutbox} \def\adjbox@valign@t{% - \adjbox@Gin@Add{\@irsbox{\height+\adjboxvtop}[]}% + \adjbox@Gin@Add{\@irsbox{-\height+\adjboxvtop}[]}% } \def\adjbox@valign@T{% \adjbox@Gin@Add{\@irsbox{-\height}[]}% @@ -524,8 +523,29 @@ \adjbox@Gin@Add{\@irsbox{\depth}[]}% } \define@key\adjbox@fam{bgcolor}{% - \adjbox@Gin@add{\colorbox{#1}}% + \@ifnextchar\bgroup{% + \adjbox@bgcolor + }{% + \adjbox@bgcolor{}{#1}% + }#1\@nnil +} +\def\adjbox@bgcolor#1#2#3\@nnil{% + \adjbox@Gin@add{\@collectbox{\adjbox@@bgcolor{#1}{#2}}}% } +\def\adjbox@@bgcolor#1#2{% + \mbox{% + \hbox{% + \ifx\@nnil#1\@nnil + \color{#2}% + \else + \color[#1]{#2}% + \fi + \vrule\@width\width\@height\height\@depth\depth + }% + \hskip-\width + \BOXCONTENT + }% +}% \define@key\adjbox@fam{set height}{% \adjbox@Gin@Add{\@irsbox\z@[{#1}]}% } @@ -559,10 +579,10 @@ \adjbox@halign{#1}\hss\hss } \define@key\adjbox@fam{left}[\linewidth]{% - \adjbox@halign{#1}\hss\relax + \adjbox@halign{#1}\relax\hss } \define@key\adjbox@fam{right}[\linewidth]{% - \adjbox@halign{#1}\relax\hss + \adjbox@halign{#1}\hss\relax } \define@key\adjbox@fam{outer}[\linewidth]{% \def\@tempa{\adjbox@halign{#1}}% @@ -784,6 +804,33 @@ \toks@\expandafter\expandafter\expandafter{\expandafter\@tempa\expandafter{\the\toks@}#2}% }% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\newcommand*\bgimagebox[2][]{% + \collectboxcheckenv{bgimagebox}% + \@collectbox{\@bgimagebox{#1}{#2}}% +} +\def\@bgimagebox#1#2{% + \mbox{% + \lower\depth\hbox{% + \edef\@tempa{\noexpand\includegraphics% + [#1,width=\the\width,totalheight=\the\totalheight]% + {#2}% + }% + \@tempa + }% + \hskip-\width% + \BOXCONTENT + }% +} +\define@key{adjbox}{bgimage}{% + \@ifnextchar\bgroup{% + \adjbox@bgimage + }{% + \adjbox@bgimage{}{#1}% + }#1\@nnil +} +\def\adjbox@bgimage#1#2#3\@nnil{% + \adjbox@Gin@add{\@collectbox{\@bgimagebox{#1}{#2}}}% +} \endinput %% %% End of file `adjustbox.sty'. -- cgit v1.2.3