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 --- .../texmf-dist/doc/latex/adjustbox/adjustbox.pdf | Bin 258702 -> 258720 bytes .../source/latex/adjustbox/adjustbox.dtx | 115 ++++++++++++++++++--- .../source/latex/adjustbox/adjustbox.ins | 8 +- 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 ++++++++++-- 7 files changed, 167 insertions(+), 36 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/adjustbox/adjustbox.pdf b/Master/texmf-dist/doc/latex/adjustbox/adjustbox.pdf index 30af267f008..e9183e92c75 100644 Binary files a/Master/texmf-dist/doc/latex/adjustbox/adjustbox.pdf and b/Master/texmf-dist/doc/latex/adjustbox/adjustbox.pdf differ diff --git a/Master/texmf-dist/source/latex/adjustbox/adjustbox.dtx b/Master/texmf-dist/source/latex/adjustbox/adjustbox.dtx index 829459b6486..aa7094a397a 100644 --- a/Master/texmf-dist/source/latex/adjustbox/adjustbox.dtx +++ b/Master/texmf-dist/source/latex/adjustbox/adjustbox.dtx @@ -25,7 +25,7 @@ % % \iffalse %<*driver> -\ProvidesFile{adjustbox.dtx}[2011/08/13 v0.5 DTX File] +\ProvidesFile{adjustbox.dtx}[2011/08/21 v0.5a DTX File] \expandafter\ifx\csname ifenglish\endcsname\relax \expandafter\newif\csname ifenglish\endcsname \englishtrue @@ -48,7 +48,7 @@ \MakeSpecialShortVerb\qverb\" %\AtBeginDocument{\MakeShortMacroArgs\`\relax} %\AtEndDocument{\DeleteShortVerb\`} -\usepackage{adjustbox} +\usepackage{adjustbox}[2011/08/21] \usepackage{tikz} \normalmarginpar @@ -186,6 +186,7 @@ % \changes{v0.3}{2011/03/20}{Bug fix for wrong baseline placed on the bottom} % \changes{v0.4}{2011/07/xx}{Added pdftex driver} % \changes{v0.5}{2011/08/13}{Added more macros and keys} +% \changes{v0.5a}{2011/08/21}{Fixed \Key{left} and \Key{right} keys. Fixed \Key{valign}'='t} % % \GetFileInfo{adjustbox.dtx} % @@ -967,9 +968,9 @@ % \adjustbox{valign=M}{\textcolor{red}{\rule{1em}{2em}\unskip}}\unskip % \adjustbox{valign=M}{\textcolor{green}{\rule{1em}{3em}\unskip}}\unskip % \adjustbox{valign=M}{\textcolor{blue}{\rule{1em}{1ex}\unskip}} & -% \adjustbox{valign=T}{\textcolor{red}{\rule{1em}{2em}\unskip}}\unskip -% \adjustbox{valign=T}{\textcolor{green}{\rule{1em}{3em}\unskip}}\unskip -% \adjustbox{valign=T}{\textcolor{blue}{\rule{1em}{1ex}\unskip}} & +% \adjustbox{valign=B}{\textcolor{red}{\rule{1em}{2em}\unskip}}\unskip +% \adjustbox{valign=B}{\textcolor{green}{\rule{1em}{3em}\unskip}}\unskip +% \adjustbox{valign=B}{\textcolor{blue}{\rule{1em}{1ex}\unskip}} & % Mxy \newline \mbox{\vr Mxy}\newline Mxy \\ % \midrule % \texttt{t} & \texttt{m} & \texttt{b} & Text \\ @@ -979,9 +980,9 @@ % \adjustbox{valign=m}{\textcolor{red}{\rule{1em}{2em}\unskip}}\unskip % \adjustbox{valign=m}{\textcolor{green}{\rule{1em}{3em}\unskip}}\unskip % \adjustbox{valign=m}{\textcolor{blue}{\rule{1em}{1ex}\unskip}} & -% \adjustbox{valign=t}{\textcolor{red}{\rule{1em}{2em}\unskip}}\unskip -% \adjustbox{valign=t}{\textcolor{green}{\rule{1em}{3em}\unskip}}\unskip -% \adjustbox{valign=t}{\textcolor{blue}{\rule{1em}{1ex}\unskip}} & +% \adjustbox{valign=b}{\textcolor{red}{\rule{1em}{2em}\unskip}}\unskip +% \adjustbox{valign=b}{\textcolor{green}{\rule{1em}{3em}\unskip}}\unskip +% \adjustbox{valign=b}{\textcolor{blue}{\rule{1em}{1ex}\unskip}} & % Mxy \newline \mbox{\vr Mxy}\newline Mxy \\ % \bottomrule % \end{tabular}} @@ -1249,7 +1250,7 @@ % \subsection{Package header, options and dependencies} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \begin{macrocode} -\ProvidesPackage{adjustbox}[2011/08/07 v0.5 Adjusting TeX boxes (trim, clip, ...)] +\ProvidesPackage{adjustbox}[2011/08/21 v0.5a Adjusting TeX boxes (trim, clip, ...)] % \end{macrocode} % % \begin{macrocode} @@ -1283,7 +1284,7 @@ % % \begin{macrocode} \RequirePackage{graphicx}[1999/02/16] -\RequirePackage{collectbox}[2011/08/06] +\RequirePackage{collectbox}[2011/08/11] % \end{macrocode} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -2123,7 +2124,7 @@ % \begin{macro}{\adjbox@valign@t} % \begin{macrocode} \def\adjbox@valign@t{% - \adjbox@Gin@Add{\@irsbox{\height+\adjboxvtop}[]}% + \adjbox@Gin@Add{\@irsbox{-\height+\adjboxvtop}[]}% } % \end{macrocode} % \end{macro} @@ -2177,12 +2178,45 @@ % \begin{key}{adjbox}{bgcolor} % \begin{macrocode} \define@key\adjbox@fam{bgcolor}{% - \adjbox@Gin@add{\colorbox{#1}}% + \@ifnextchar\bgroup{% + \adjbox@bgcolor + }{% + \adjbox@bgcolor{}{#1}% + }#1\@nnil } % \end{macrocode} % \end{key} % % +% \begin{macro}{\adjbox@bgcolor} +% \begin{macrocode} +\def\adjbox@bgcolor#1#2#3\@nnil{% + \adjbox@Gin@add{\@collectbox{\adjbox@@bgcolor{#1}{#2}}}% +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\adjbox@@bgcolor} +% \begin{macrocode} +\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 + }% +}% +% \end{macrocode} +% \end{macro} +% +% % \begin{key}{adjbox}{set height} % \begin{macrocode} \define@key\adjbox@fam{set height}{% @@ -2255,7 +2289,7 @@ % \begin{key}{adjbox}{left} % \begin{macrocode} \define@key\adjbox@fam{left}[\linewidth]{% - \adjbox@halign{#1}\hss\relax + \adjbox@halign{#1}\relax\hss } % \end{macrocode} % \end{key} @@ -2263,7 +2297,7 @@ % \begin{key}{adjbox}{right} % \begin{macrocode} \define@key\adjbox@fam{right}[\linewidth]{% - \adjbox@halign{#1}\relax\hss + \adjbox@halign{#1}\hss\relax } % \end{macrocode} % \end{key} @@ -2699,6 +2733,59 @@ % \end{macro} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% \subsection{New, experimental macros and keys} +% +% \begin{macro}{\bgimagebox} +% \begin{macrocode} +\newcommand*\bgimagebox[2][]{% + \collectboxcheckenv{bgimagebox}% + \@collectbox{\@bgimagebox{#1}{#2}}% +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@bgimagebox} +% \begin{macrocode} +\def\@bgimagebox#1#2{% + \mbox{% + \lower\depth\hbox{% + \edef\@tempa{\noexpand\includegraphics% + [#1,width=\the\width,totalheight=\the\totalheight]% + {#2}% + }% + \@tempa + }% + \hskip-\width% + \BOXCONTENT + }% +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{key}{adjbox}{bgimage} +% \begin{macrocode} +\define@key{adjbox}{bgimage}{% + \@ifnextchar\bgroup{% + \adjbox@bgimage + }{% + \adjbox@bgimage{}{#1}% + }#1\@nnil +} +% \end{macrocode} +% \end{key} +% +% +% \begin{macro}{\adjbox@bgimage} +% \begin{macrocode} +\def\adjbox@bgimage#1#2#3\@nnil{% + \adjbox@Gin@add{\@collectbox{\@bgimagebox{#1}{#2}}}% +} +% \end{macrocode} +% \end{macro} +% % \iffalse % % \fi diff --git a/Master/texmf-dist/source/latex/adjustbox/adjustbox.ins b/Master/texmf-dist/source/latex/adjustbox/adjustbox.ins index e458b4cbfcb..bae0b1316fb 100644 --- a/Master/texmf-dist/source/latex/adjustbox/adjustbox.ins +++ b/Master/texmf-dist/source/latex/adjustbox/adjustbox.ins @@ -18,9 +18,8 @@ This work has the LPPL maintenance status `maintained'. 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. \endpreamble \keepsilent @@ -31,7 +30,8 @@ adjgrfx.sty. \file{adjcalc.sty}{\from{adjustbox.dtx}{adjcalc}}% \file{adjgrfx.sty}{\from{adjustbox.dtx}{adjgrfx}}% \file{adjpgf.def}{\from{adjustbox.dtx}{adjpgf.def}}% - \file{adjustbox-de.tex}{\nopreamble\nopostamble\from{adjustbox.dtx}{de}}% + %\file{storebox.sty}{\from{storebox.dtx}{storebox}}% + %\file{adjustbox-de.tex}{\nopreamble\nopostamble\from{adjustbox.dtx}{de}}% } \obeyspaces 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