summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/adjustbox
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-11-02 22:50:17 +0000
committerKarl Berry <karl@freefriends.org>2011-11-02 22:50:17 +0000
commite5cd5f13085b6988a96d8e68ac5b703be949ad24 (patch)
tree2cf7695ce93ac8f0976f041a535a970285cf6c07 /Master/texmf-dist/tex/latex/adjustbox
parent96c440d077d6a277cf76ef07e3ef389647bd4e80 (diff)
adjustbox (1nov11)
git-svn-id: svn://tug.org/texlive/trunk@24464 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/adjustbox')
-rw-r--r--Master/texmf-dist/tex/latex/adjustbox/adjcalc.sty27
-rw-r--r--Master/texmf-dist/tex/latex/adjustbox/adjgrfx.sty27
-rw-r--r--Master/texmf-dist/tex/latex/adjustbox/adjpgf.def27
-rw-r--r--Master/texmf-dist/tex/latex/adjustbox/adjustbox.sty277
4 files changed, 230 insertions, 128 deletions
diff --git a/Master/texmf-dist/tex/latex/adjustbox/adjcalc.sty b/Master/texmf-dist/tex/latex/adjustbox/adjcalc.sty
index 6eec7f21017..d8bfb5db589 100644
--- a/Master/texmf-dist/tex/latex/adjustbox/adjcalc.sty
+++ b/Master/texmf-dist/tex/latex/adjustbox/adjcalc.sty
@@ -1,30 +1,3 @@
-%%
-%% This is file `adjcalc.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% adjustbox.dtx (with options: `adjcalc')
-%%
-%% 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.3c
-%% 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.3c or later is part of all distributions of LaTeX
-%% version 2008/05/04 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 adjustbox.dtx, adjustbox.ins,
-%% storebox.dtx and the derived files adjustbox.sty and storebox.sty.
-%%
\begingroup
\def\@tempa{adjcalc}
\expandafter
diff --git a/Master/texmf-dist/tex/latex/adjustbox/adjgrfx.sty b/Master/texmf-dist/tex/latex/adjustbox/adjgrfx.sty
index b06a15c801c..8b0afff8ffa 100644
--- a/Master/texmf-dist/tex/latex/adjustbox/adjgrfx.sty
+++ b/Master/texmf-dist/tex/latex/adjustbox/adjgrfx.sty
@@ -1,30 +1,3 @@
-%%
-%% This is file `adjgrfx.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% adjustbox.dtx (with options: `adjgrfx')
-%%
-%% 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.3c
-%% 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.3c or later is part of all distributions of LaTeX
-%% version 2008/05/04 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 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}
%%^^A \width, \height, \totalheight, \depth = size current at option execution (changes after every option) (initial: natural size)
diff --git a/Master/texmf-dist/tex/latex/adjustbox/adjpgf.def b/Master/texmf-dist/tex/latex/adjustbox/adjpgf.def
index e0224fbc28a..86e71e73067 100644
--- a/Master/texmf-dist/tex/latex/adjustbox/adjpgf.def
+++ b/Master/texmf-dist/tex/latex/adjustbox/adjpgf.def
@@ -1,30 +1,3 @@
-%%
-%% This is file `adjpgf.def',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% adjustbox.dtx (with options: `adjpgf.def')
-%%
-%% 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.3c
-%% 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.3c or later is part of all distributions of LaTeX
-%% version 2008/05/04 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 adjustbox.dtx, adjustbox.ins,
-%% storebox.dtx and the derived files adjustbox.sty and storebox.sty.
-%%
\RequirePackage{pgf}
\def\@clipbox#1#2#3#4#5{%
\@trimbox{#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 c3b14b2fc59..622fbb7995a 100644
--- a/Master/texmf-dist/tex/latex/adjustbox/adjustbox.sty
+++ b/Master/texmf-dist/tex/latex/adjustbox/adjustbox.sty
@@ -1,35 +1,27 @@
-%%
-%% This is file `adjustbox.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% adjustbox.dtx (with options: `adjustbox')
-%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 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.3c
+%% 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.3c or later is part of all distributions of LaTeX
-%% version 2008/05/04 or later.
-%%
+%% 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 adjustbox.dtx, adjustbox.ins,
-%% storebox.dtx and the derived files adjustbox.sty and storebox.sty.
-%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\ProvidesPackage{adjustbox}[2011/09/04 v0.6 Adjusting TeX boxes (trim, clip, ...)]
+%%
+%% This work consists of the files adjustbox.dtx, adjustbox.ins
+%% and the derived file adjustbox.sty.
+%%
+\ProvidesPackage{adjustbox}[%
+ 2011/10/30
+ v0.7
+ Adjusting TeX boxes (trim, clip, ...)]
\RequirePackage{xkeyval}
-
\def\adjbox@defaultunit{bp}
\DeclareOptionX<adjbox>{defaultunit}{%
\def\adjbox@defaultunit{#1}%
@@ -40,17 +32,14 @@
\def\adjbox@default{\adjsetlength}%
\fi
}
-
\def\adjbox@fam{adjbox}
\DeclareOptionX<adjbox>{export}{\def\adjbox@fam{Gin}}
\DeclareOptionX<adjbox>{patch}{\AtEndOfPackage{\RequirePackage{adjgrfx}}}
\DeclareOptionX<adjbox>{minimal}{\let\adjbox@maybeend\endinput}
-
\def\adjbox@driver{adj\Gin@driver}
\DeclareOptionX<adjbox>{pgf}{\def\adjbox@driver{adjpgf.def}}
\DeclareOptionX<adjbox>{PGF}{\def\adjbox@driver{adjpgf.def}\adjcalc@pgfmath}
\DeclareOptionX<adjbox>*{\PassOptionsToPackage\CurrentOption{graphicx}}
-
\let\adjbox@maybeend\relax
\input{adjcalc.sty}
\disable@keys{adjbox}{patch,export,PGF,minimal}
@@ -58,15 +47,53 @@
\RequirePackage{collectbox}[2011/08/22]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\newcommand*\adjustboxset{%
+ \@ifstar
+ {\adjbox@addkeysafter}%
+ {\adjbox@addkeysbefore}%
+}
+\def\adjbox@addkeysbefore#1{%
+ \ifx\@nnil#1\@nnil
+ \let\adjbox@keysbefore\@empty
+ \else
+ \expandafter\def\expandafter\adjbox@keysbefore\expandafter{\adjbox@keysbefore,#1}%
+ \let\adjbox@setkeys\adjbox@setkeys@ba
+ \fi
+}
+\let\adjbox@keysbefore\@empty
+\def\adjbox@addkeysafter#1{%
+ \begingroup
+ \def\@tempa{#1}%
+ \ifx\@tempa\@empty
+ \endgroup
+ \let\adjbox@keysafter\@empty
+ \else
+ \expandafter\expandafter
+ \expandafter\endgroup
+ \expandafter\expandafter
+ \expandafter\def
+ \expandafter\expandafter
+ \expandafter\adjbox@keysafter
+ \expandafter\expandafter
+ \expandafter{\expandafter\@tempa\expandafter,\adjbox@keysafter}%
+ \let\adjbox@setkeys\adjbox@setkeys@ba
+ \fi
+}
+\let\adjbox@keysafter\@empty
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\define@key{adjbox}{viewport}{%
- \let\Gin@viewport@code\adjbox@@viewport
- \let\adjustbox@@@\adjustbox@@@trimclip
- \adjbox@parse@v{#1}%
+ \def\adjustbox@@@{%
+ \adjbox@parse@v{#1}%
+ \adjbox@@viewport
+ \adjustbox@@@trimclip
+ }%
}
\define@key{adjbox}{trim}{%
- \let\Gin@viewport@code\adjbox@@trim
- \let\adjustbox@@@\adjustbox@@@trimclip
- \adjbox@parse@v{#1}%
+ \def\adjustbox@@@{%
+ \adjbox@parse@v{#1}%
+ \adjustbox@@@trimclip
+ }%
}
\def\adjustbox@@@trimclip{%
\Gin@viewport@code
@@ -110,7 +137,6 @@
\newdimen\adjbox@tlly
\newdimen\adjbox@turx
\newdimen\adjbox@tury
-\let\adjbox@@trim\relax
\def\adjbox@@viewport{%
%\advance\adjbox@tllx by -\z@
\advance\adjbox@tlly by \dp\collectedbox
@@ -164,6 +190,27 @@
\newcommand\adjustbox[1]{%
\collectboxcheckenv{adjustbox}%
\begingroup
+ \adjbox@setkeys{#1}%
+ \expandafter\expandafter\expandafter
+ \endgroup
+ \expandafter
+ \adjbox@collectbox\expandafter{\expandafter\adjustbox@\expandafter{\XKV@rm}}%
+}
+\let\adjbox@collectbox\@collectbox
+\def\adjbox@setkeys@ba{%
+ \expandafter\expandafter
+ \expandafter\adjbox@@setkeys@ba
+ \expandafter\expandafter
+ \expandafter{\expandafter\adjbox@keysbefore\expandafter}%
+ \expandafter{\adjbox@keysafter}%
+}
+\def\adjbox@@setkeys@ba#1#2#3{%
+ \setkeys*{ADJBOX}{#1,#3,#2}%
+}
+\def\adjbox@setkeys{%
+ \setkeys*{ADJBOX}%
+}
+\def\adjustbox@#1{%
\adjustbox@dimcmds
\let\Gin@esetsize\adjbox@esetsize
\@tempswatrue
@@ -171,9 +218,8 @@
\def\setlength{\adjsetlength}%
\setkeys{adjbox,Gin}{#1}%
\adjbox@esetsize
- \adjbox@collectbox{\the\toks@\endgroup}%
+ \the\toks@
}
-\let\adjbox@collectbox\@collectbox
\def\adjustbox@@@@{\adjustbox@@@}%
\def\adjbox@esetsize{%
\ifcase0%
@@ -198,6 +244,9 @@
\def\adjustbox@@@{%
\usebox\collectedbox
}
+\newcommand*\adjustimage[2]{%
+ \adjustbox{#1}{\includegraphics{#2}}%
+}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\@trimbox#1#2#3#4#5{%
@@ -733,15 +782,25 @@
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\define@key{adjbox}{minipage}{%
+\define@key{ADJBOX}{minipage}{%
\@ifnextchar[{%
- \adjbox@innerenv{minipage}%
+ \adjbox@minipage%
}{%
- \adjbox@innerenv{minipage}{{#1}}\@nnil%
+ \adjbox@minipage{{#1}}\@nnil%
\remove@to@nnil
}#1\@nnil
}
-\define@key{adjbox}{tabular}{%
+\def\adjbox@minipage#1\@nnil{%
+ \def\adjbox@collectbox##1{\collectbox@{\adjbox@set\begin{minipage}#1\adjbox@reset}{##1}{\end{minipage}}}%
+}
+\def\adjbox@set{%
+ \let\adjbox@origsetlength\setlength
+ \def\setlength{\adjsetlength}%
+}
+\def\adjbox@reset{%
+ \let\setlength\adjbox@origsetlength
+}
+\define@key{ADJBOX}{tabular}{%
\@ifnextchar[{%
\adjbox@tabular{tabular}%
}{%
@@ -756,10 +815,10 @@
\def\adjbox@collectbox##1{\collectbox@tab{#1}{#2}{}{##1}{}}%
\fi
}
-\define@key{adjbox}{tabular*}{%
+\define@key{ADJBOX}{tabular*}{%
\adjbox@tabular{tabular*}#1\@nnil
}
-\define@key{adjbox}{array}{%
+\define@key{ADJBOX}{array}{%
\@ifnextchar[{%
\adjbox@array%
}{%
@@ -774,7 +833,7 @@
\def\adjbox@collectbox##1{\collectbox@tab{array}{#1}{\(}{##1}{\)}}%
\fi
}
-\define@key{adjbox}{innerenv}{%
+\define@key{ADJBOX}{innerenv}{%
\@ifnextchar\bgroup{%
\adjbox@innerenv
}{%
@@ -785,13 +844,13 @@
\def\adjbox@innerenv#1#2\@nnil{%
\def\adjbox@collectbox##1{\collectbox@{\begin{#1}#2}{##1}{\end{#1}}}%
}%
-\define@key{adjbox}{innercode}{%
+\define@key{ADJBOX}{innercode}{%
\adjbox@innercode#1{}{}%
}
\def\adjbox@innercode#1#2{%
\def\adjbox@collectbox##1{\collectbox@{#1}{##1}{#2}}%
}%
-\define@key{adjbox}{env}{%
+\define@key{ADJBOX}{env}{%
\@ifnextchar\bgroup{%
\adjbox@addenv
}{%
@@ -861,7 +920,131 @@
\def\adjbox@bgimage#1#2#3\@nnil{%
\adjbox@Gin@add{\@collectbox{\@bgimagebox{#1}{#2}}}%
}
-
+\RequirePackage{storebox}
+\newcommand\splitbox[2]{%
+ \collectboxcheckenv{splitbox}%
+ \@collectbox{\@splitbox{#1}{#2}}%
+}
+\define@key\adjbox@fam{split}{%
+ \adjbox@Gin@Add{\@collectbox{\@splitbox#1}}%
+}
+\def\@splitbox#1#2{%
+ \ifstorebox
+ \storebox\splittedbox{\BOXCONTENT}%
+ \setbox\collectedbox\hbox{\usestorebox\splittedbox}%
+ \fi
+ \xdef\@tempa{#1}%
+ \xdef\@tempb{#2}%
+ \ifx\@tempa\Gin@exclamation
+ \@tempdima\maxdimen
+ \else
+ \adjsetlength\@tempdima\@tempa
+ \fi
+ \ifx\@tempb\Gin@exclamation
+ \Gin@nat@height\maxdimen
+ \else
+ \adjsetlength\Gin@nat@height\@tempb
+ \fi
+ \ifdim\@tempdima>\width
+ \@tempdima\width
+ \fi
+ \ifdim\Gin@nat@height>\totalheight
+ \Gin@nat@height\totalheight
+ \fi
+ \adjbox@tllx\z@
+ \adjbox@tlly\totalheight
+ \adjbox@turx\width
+ \adjbox@tury\z@
+ \advance\adjbox@tlly-\Gin@nat@height
+ \@@splitbox
+}
+\def\@@splitbox{%
+ \advance\adjbox@turx-\@tempdima
+ \@@@splitbox
+ \ifdim\adjbox@turx>\z@
+ \advance\adjbox@tllx+\@tempdima
+ \expandafter\@@splitbox
+ \else
+ \ifdim\adjbox@tlly<\splitbox@epsilon
+ \splitboxlastnewline
+ \else
+ \splitboxnewline
+ \adjbox@tllx\z@
+ \adjbox@turx\width
+ \advance\adjbox@tlly-\Gin@nat@height
+ \advance\adjbox@tury+\Gin@nat@height
+ \expandafter\expandafter
+ \expandafter\@@splitbox
+ \fi
+ \fi
+}
+\def\@@@splitbox{%
+ \begingroup
+ \setbox\collectedbox=\copy\collectedbox
+ \@clipbox\adjbox@tllx\adjbox@tlly\adjbox@turx\adjbox@tury\collectedbox
+ \splitboxcmd{\usebox\collectedbox}%
+ \endgroup
+}
+\def\@@@splitbox{%
+ \begingroup
+ \setbox\collectedbox=\copy\collectedbox
+ \@clipbox\adjbox@tllx\adjbox@tlly\adjbox@turx\adjbox@tury\collectedbox
+ \splitboxcmd{\usebox\collectedbox}%
+ \endgroup
+}
+\let\splitboxcmd\empty
+\newcommand\splitboxnewline{\\}
+\newcommand\splitboxlastnewline{\splitboxnewline}
+\def\splitbox@epsilon{100sp}
+\newcommand\pagebreakbox{%
+ \par\noindent
+ \collectboxcheckenv{pagebreakbox}%
+ \@collectbox{\@pagebreakbox}%
+}
+\define@key\adjbox@fam{pagebreak}[]{%
+ \adjbox@Gin@Add{\@collectbox{\@pagebreakbox}}%
+}
+\def\@pagebreakbox{%
+ \sbox\collectedbox{\raise\dp\collectedbox\hbox{\BOXCONTENT}}%
+ \ifstorebox
+ \storebox\splittedbox{\BOXCONTENT}%
+ \setbox\collectedbox\hbox{\usestorebox\splittedbox}%
+ \fi
+ \adjsetlength\adjbox@tlly
+ {\totalheight-\pagegoal+\pagetotal+\pagebreakboxoffset}%
+ \ifdim\adjbox@tlly>\z@
+ \begingroup
+ \setbox\collectedbox=\copy\collectedbox
+ \@clipbox\z@\adjbox@tlly\z@\z@\collectedbox
+ \BOXCONTENT
+ \endgroup
+ \par\noindent
+ \adjsetlength\adjbox@tury{\totalheight-\adjbox@tlly}%
+ \ifdim\adjbox@tlly>\textheight
+ \loop
+ \advance\adjbox@tlly-\textheight
+ \begingroup
+ \setbox\collectedbox=\copy\collectedbox
+ \@clipbox\z@\adjbox@tlly\z@\adjbox@tury\collectedbox
+ \BOXCONTENT
+ \endgroup
+ \advance\adjbox@tury\textheight
+ \par\noindent
+ \ifdim\adjbox@tlly>\textheight
+ \repeat
+ \@clipbox\z@\z@\z@\adjbox@tury\collectedbox
+ \BOXCONTENT
+ \else
+ \@clipbox\z@\z@\z@\adjbox@tury\collectedbox
+ \par\noindent
+ \BOXCONTENT
+ \fi
+ \else
+ \BOXCONTENT%
+ \fi
+ \par
+}
+\newcommand*\pagebreakboxoffset{\ht\strutbox}
\endinput
%%
%% End of file `adjustbox.sty'.