summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/adjustbox
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-09-05 23:28:46 +0000
committerKarl Berry <karl@freefriends.org>2011-09-05 23:28:46 +0000
commitb75ddb92b4bc5135cdf583ff71bd1dc29ba48ba6 (patch)
tree949199f8550a7d762b667964b02b608d83b4fa8d /Master/texmf-dist/source/latex/adjustbox
parentbe746844a55d323ecd877e3d621544c8ad8b32e4 (diff)
adjustbox (5sep11)
git-svn-id: svn://tug.org/texlive/trunk@23831 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/adjustbox')
-rw-r--r--Master/texmf-dist/source/latex/adjustbox/adjustbox.dtx114
1 files changed, 99 insertions, 15 deletions
diff --git a/Master/texmf-dist/source/latex/adjustbox/adjustbox.dtx b/Master/texmf-dist/source/latex/adjustbox/adjustbox.dtx
index aa7094a397a..855ad15f342 100644
--- a/Master/texmf-dist/source/latex/adjustbox/adjustbox.dtx
+++ b/Master/texmf-dist/source/latex/adjustbox/adjustbox.dtx
@@ -187,6 +187,7 @@
% \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}
+% \changes{v0.6}{2011/09/04}{Added tabular support.}
%
% \GetFileInfo{adjustbox.dtx}
%
@@ -1143,7 +1144,10 @@
% \end{example}
%
% \subsection{Minipage or other inner Environment}
-% The following keys will overwrite each other and only defined for \env{adjustbox} but do not apply for \Macro\includegraphics.
+% The following keys set the way the content is processed before it is stored it in a box.
+% These keys will overwrite each other and only the latest used key will take effect.
+% Because they affect the inner content directly their order relative to other, normal keys is not meaningful.
+% Also they are only defined for \env{adjustbox} but do not apply for \Macro\includegraphics.
% Because they are therefore only used inside a mandatory argument and never in an optional these keys allow for optional bracket arguments.
%
% \DescribeKey{minipage}'='<width>
@@ -1178,10 +1182,35 @@
% \end{examplecode}
% \end{examples}
%
+% \DescribeKey{tabular}'='[<position>]{<column specification>}
+% \DescribeKey{tabular*}'='[<position>]{<width>}{<column specification>}
+% \DescribeKey{array}'='[<position>]{<column specification>}
+% Places the content in a \env{tabular}, \env{tabular*} or \env{array} environment, respectively.
+% These keys require different implementations for macro (\Macro\adjustbox) and environment mode (\env{adjustbox} environment) in order to insert
+% the end code correctly. Note that the environment mode is more efficient and fully stable, while the macro mode requires the last row to end with
+% an explicit |\\| (which can be followed by \Macro\hline or any other macro which uses \Macro\noalign internally). In macro mode the |\\| is internally redefined
+% to check for the closing brace. While this was successful tested for normal usages it might still cause issues with unusual or complicated cases.
+%
+% \begin{examples}
+% \begin{examplecode}
+% \adjustbox{tabular=lll}{%
+% \hline
+% A & B & C \\\hline
+% a & b & c \\\hline
+% }
+% \end{examplecode}
+% \begin{examplecode}
+% \begin{adjustbox}{tabular=lll}
+% A & B & C \\
+% a & b & c
+% \end{adjustbox}
+% \end{examplecode}
+% \end{examples}
+%
+%
% \DescribeKey{innerenv}'='<environment name>
% \DescribeKey{innerenv}'='{<environment name>}<environment options>
-% Wraps the inner content in the given \meta{environment} before it is stored as horizontal box. Only one inner environment can be used
-% and further uses of this key will overwrite previous ones as well as any \Key{minipage} and \Key{innercode} key.
+% Wraps the inner content in the given \meta{environment} before it is stored as horizontal box.
% It should be kept in mind that there is some internal code between the begin of the environment and the content. For this reason
% a \env{tabular}, \env{innerenv} or similar environment will not work here, because that code will be taken as part of the first cell.
%
@@ -1194,8 +1223,7 @@
%
%
% \DescribeKey{innercode}'='{<begin code>}{<end code>}
-% Places the given code before and after the inner content before it is stored as horizontal box. Only one set of inner code can be used
-% and further uses of this key will overwrite previous ones as well as any \Key{minipage} and \Key{innerenv} key.
+% Places the given code before and after the inner content before it is stored as horizontal box.
%
% \begin{example}
% \begin{examplecode}
@@ -1250,7 +1278,7 @@
% \subsection{Package header, options and dependencies}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \begin{macrocode}
-\ProvidesPackage{adjustbox}[2011/08/21 v0.5a Adjusting TeX boxes (trim, clip, ...)]
+\ProvidesPackage{adjustbox}[2011/09/04 v0.6 Adjusting TeX boxes (trim, clip, ...)]
% \end{macrocode}
%
% \begin{macrocode}
@@ -1284,7 +1312,7 @@
%
% \begin{macrocode}
\RequirePackage{graphicx}[1999/02/16]
-\RequirePackage{collectbox}[2011/08/11]
+\RequirePackage{collectbox}[2011/08/22]
% \end{macrocode}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -2606,6 +2634,69 @@
% \end{key}
%
%
+% \begin{key}{adjbox}{tabular}
+% \begin{macrocode}
+\define@key{adjbox}{tabular}{%
+ \@ifnextchar[{%
+ \adjbox@tabular{tabular}%
+ }{%
+ \adjbox@tabular{tabular}{{#1}}\@nnil%
+ \remove@to@nnil
+ }#1\@nnil
+}
+% \end{macrocode}
+% \end{key}
+%
+%
+% \begin{macro}{\adjbox@tabular}
+% \begin{macrocode}
+\def\adjbox@tabular#1#2\@nnil{%
+ \ifcollectboxenv
+ \adjbox@innerenv{#1}{#2}\@nnil
+ \else
+ \def\adjbox@collectbox##1{\collectbox@tab{#1}{#2}{}{##1}{}}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{key}{adjbox}{tabular*}
+% \begin{macrocode}
+\define@key{adjbox}{tabular*}{%
+ \adjbox@tabular{tabular*}#1\@nnil
+}
+% \end{macrocode}
+% \end{key}
+%
+%
+% \begin{key}{adjbox}{array}
+% \begin{macrocode}
+\define@key{adjbox}{array}{%
+ \@ifnextchar[{%
+ \adjbox@array%
+ }{%
+ \adjbox@array{{#1}}\@nnil%
+ \remove@to@nnil
+ }#1\@nnil
+}
+% \end{macrocode}
+% \end{key}
+%
+%
+% \begin{macro}{\adjbox@array}
+% \begin{macrocode}
+\def\adjbox@array#1\@nnil{%
+ \ifcollectboxenv
+ \adjbox@innercode{\(\begin{array}#1}{\end{array}\)}%
+ \else
+ \def\adjbox@collectbox##1{\collectbox@tab{array}{#1}{\(}{##1}{\)}}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
% \begin{key}{adjbox}{innerenv}
% \begin{macrocode}
\define@key{adjbox}{innerenv}{%
@@ -2636,13 +2727,6 @@
% \end{macrocode}
% \end{key}
%
-% \begin{macro}{\adjbox@innerenv}
-% \begin{macrocode}
-\def\adjbox@innerenv#1#2\@nnil{%
- \def\adjbox@collectbox##1{\collectbox@{\begin{#1}#2}{##1}{\end{#1}}}%
-}%
-% \end{macrocode}
-% \end{macro}
%
% \begin{macro}{\adjbox@innercode}
% \begin{macrocode}
@@ -2785,7 +2869,7 @@
}
% \end{macrocode}
% \end{macro}
-%
+
% \iffalse
%</adjustbox>
% \fi