From dc27dfcd77b6a8654d149e1821c03289d7aa359a Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 8 May 2019 21:17:53 +0000 Subject: grabbox (8may19) git-svn-id: svn://tug.org/texlive/trunk@51052 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/grabbox/README.md | 10 ++--- Master/texmf-dist/doc/latex/grabbox/grabbox.pdf | Bin 351524 -> 352249 bytes Master/texmf-dist/source/latex/grabbox/grabbox.dtx | 50 +++++++++++++-------- Master/texmf-dist/tex/latex/grabbox/grabbox.sty | 36 +++++++-------- 4 files changed, 54 insertions(+), 42 deletions(-) diff --git a/Master/texmf-dist/doc/latex/grabbox/README.md b/Master/texmf-dist/doc/latex/grabbox/README.md index aaad6d4708b..13e3c3d157c 100644 --- a/Master/texmf-dist/doc/latex/grabbox/README.md +++ b/Master/texmf-dist/doc/latex/grabbox/README.md @@ -1,6 +1,6 @@ grabbox: utilities to get an argument as a box -Copyright (C) 2018 by Jonathan P. Spratte +Copyright (C) 2018-2019 by Jonathan P. Spratte This package may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this license or (at @@ -11,9 +11,9 @@ file The package provides - - `\grabbox<*>{}[
]{}[]{}`: grab the
+ - `\grabbox<*>[]{}[
]{}[]{}`: grab the
    next argument as a box in `` (`\hbox`, `\vbox` or `\vtop`) and save it
    in box ``. After the box is saved execute ``. Inside of the
-   box one can inject `
` before the contents and `` after them. If
-   the star is not given spaces are stripped from the start and the end of the
-   box.
+   box one can inject `` and `
` before the contents and ``
+   after them. If the star is not given spaces are stripped from the start and
+   the end of the box.
diff --git a/Master/texmf-dist/doc/latex/grabbox/grabbox.pdf b/Master/texmf-dist/doc/latex/grabbox/grabbox.pdf
index 405b2acd1f0..2334281d4dc 100644
Binary files a/Master/texmf-dist/doc/latex/grabbox/grabbox.pdf and b/Master/texmf-dist/doc/latex/grabbox/grabbox.pdf differ
diff --git a/Master/texmf-dist/source/latex/grabbox/grabbox.dtx b/Master/texmf-dist/source/latex/grabbox/grabbox.dtx
index 98e02ed13b1..c8205a36b79 100644
--- a/Master/texmf-dist/source/latex/grabbox/grabbox.dtx
+++ b/Master/texmf-dist/source/latex/grabbox/grabbox.dtx
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-% File: grabbox.dtx Copyright (C) 2018 Jonathan P. Spratte
+% File: grabbox.dtx Copyright (C) 2018-2019 Jonathan P. Spratte
 %
 % It may be distributed and/or modified under the conditions of the LaTeX
 % Project Public License (LPPL), either version 1.3c of this license or (at your
@@ -26,7 +26,7 @@ Released under the LaTeX Project Public License v1.3c or later
 See http://www.latex-project.org/lppl.txt
 --------------------------------------------------------------
 
-Copyright (C) 2018 Jonathan P. Spratte
+Copyright (C) 2018-2019 Jonathan P. Spratte
 
 This  work may be  distributed and/or  modified under  the conditions  of the
 LaTeX Project Public License (LPPL),  either version 1.3c  of this license or
@@ -77,8 +77,8 @@ and the derived files           grabbox.pdf and
 \end{document}
 %
 %<*pkg>
-\newcommand*\grabbox@date{2018-12-29}
-\newcommand*\grabbox@version{1.3}
+\newcommand*\grabbox@date{2019-05-08}
+\newcommand*\grabbox@version{1.4}
 \ProvidesPackage{grabbox}
   [%
     \grabbox@date\space v\grabbox@version\space utilities to get an argument as
@@ -177,6 +177,18 @@ and the derived files           grabbox.pdf and
 %   bunch of temporary macros), it is of course not expandable and defined
 %   \cs{protected}.
 %
+% \begin{function}{\@grabbox}
+%   \begin{syntax}
+%     \cs{@grabbox}\meta{*}\marg{inject pre pre}\ignorespaces^^A
+%       \marg{box register}\marg{inject pre}\marg{box type}\ignorespaces^^A
+%       \marg{inject post}\marg{afterwards}
+%   \end{syntax}
+%   This is a variant of \cs{grabbox} that should be faster because it doesn't
+%   parse for optional arguments. Instead every argument is mandatory except for
+%   the star, just leave the arguments empty if you'd otherwise not use the
+%   corresponding optional argument in \cs{grabbox}.
+% \end{function}
+%
 % \section{Useless Example!}
 %
 % First we need to reserve us a box register for this example:
@@ -315,8 +327,6 @@ and the derived files           grabbox.pdf and
   {%
     \grabbox@def#1##1{\def#2{##1}\grabbox@opt#3#4}%
   }
-\long\def\grabbox@afterelsefi#1\else#2\fi{\fi#1}
-\long\def\grabbox@afterfi#1\fi{\fi#1}
 \grabbox@def\grabbox@opt#1#2%
   {%
     \@ifnextchar[
@@ -342,19 +352,6 @@ and the derived files           grabbox.pdf and
   {%
     \ifhmode\unskip\fi
   }
-\grabbox@def\grabbox@unpack
-  {%
-    \begingroup
-    \edef\grabbox@test{\grabbox@type}%
-    \expandafter\ifx\grabbox@test\hbox
-      \endgroup
-      \grabbox@afterelsefi\unhbox
-    \else
-      \endgroup
-      \grabbox@afterfi\unvbox
-    \fi
-    \grabbox@name
-  }
 \grabbox@def\grabbox
   {%
     \@ifstar
@@ -373,6 +370,21 @@ and the derived files           grabbox.pdf and
     \afterassignment\grabbox@intermediate
     \setbox\grabbox@name\grabbox@type
   }
+\grabbox@def\@grabbox
+  {%
+    \@ifstar
+      {\@grabbox@spaces@true\@grabbox@a}
+      {\@grabbox@spaces@false\@grabbox@a}%
+  }
+\grabbox@ldef\@grabbox@a#1#2#3#4#5%
+  {%
+    \def\grabbox@into@prepre{#1}%
+    \def\grabbox@name       {#2}%
+    \def\grabbox@into@pre   {#3}%
+    \def\grabbox@type       {#4}%
+    \def\grabbox@into@post  {#5}%
+    \grabbox@d
+  }
 \grabbox@def\grabbox@intermediate
   {%
     \grabbox@into@prepre
diff --git a/Master/texmf-dist/tex/latex/grabbox/grabbox.sty b/Master/texmf-dist/tex/latex/grabbox/grabbox.sty
index e5ab5339c60..72da0c9ce26 100644
--- a/Master/texmf-dist/tex/latex/grabbox/grabbox.sty
+++ b/Master/texmf-dist/tex/latex/grabbox/grabbox.sty
@@ -13,7 +13,7 @@
 %% See http://www.latex-project.org/lppl.txt
 %% --------------------------------------------------------------
 %% 
-%% Copyright (C) 2018 Jonathan P. Spratte
+%% Copyright (C) 2018-2019 Jonathan P. Spratte
 %% 
 %% This  work may be  distributed and/or  modified under  the conditions  of the
 %% LaTeX Project Public License (LPPL),  either version 1.3c  of this license or
@@ -29,8 +29,8 @@
 %% and the derived files           grabbox.pdf and
 %%                                 grabbox.sty.
 %% 
-\newcommand*\grabbox@date{2018-12-29}
-\newcommand*\grabbox@version{1.3}
+\newcommand*\grabbox@date{2019-05-08}
+\newcommand*\grabbox@version{1.4}
 \ProvidesPackage{grabbox}
   [%
     \grabbox@date\space v\grabbox@version\space utilities to get an argument as
@@ -50,8 +50,6 @@
   {%
     \grabbox@def#1##1{\def#2{##1}\grabbox@opt#3#4}%
   }
-\long\def\grabbox@afterelsefi#1\else#2\fi{\fi#1}
-\long\def\grabbox@afterfi#1\fi{\fi#1}
 \grabbox@def\grabbox@opt#1#2%
   {%
     \@ifnextchar[
@@ -77,19 +75,6 @@
   {%
     \ifhmode\unskip\fi
   }
-\grabbox@def\grabbox@unpack
-  {%
-    \begingroup
-    \edef\grabbox@test{\grabbox@type}%
-    \expandafter\ifx\grabbox@test\hbox
-      \endgroup
-      \grabbox@afterelsefi\unhbox
-    \else
-      \endgroup
-      \grabbox@afterfi\unvbox
-    \fi
-    \grabbox@name
-  }
 \grabbox@def\grabbox
   {%
     \@ifstar
@@ -108,6 +93,21 @@
     \afterassignment\grabbox@intermediate
     \setbox\grabbox@name\grabbox@type
   }
+\grabbox@def\@grabbox
+  {%
+    \@ifstar
+      {\@grabbox@spaces@true\@grabbox@a}
+      {\@grabbox@spaces@false\@grabbox@a}%
+  }
+\grabbox@ldef\@grabbox@a#1#2#3#4#5%
+  {%
+    \def\grabbox@into@prepre{#1}%
+    \def\grabbox@name       {#2}%
+    \def\grabbox@into@pre   {#3}%
+    \def\grabbox@type       {#4}%
+    \def\grabbox@into@post  {#5}%
+    \grabbox@d
+  }
 \grabbox@def\grabbox@intermediate
   {%
     \grabbox@into@prepre
-- 
cgit v1.2.3