texlive[51052] Master/texmf-dist: grabbox (8may19)
commits+karl at tug.org
commits+karl at tug.org
Wed May 8 23:17:54 CEST 2019
Revision: 51052
http://tug.org/svn/texlive?view=revision&revision=51052
Author: karl
Date: 2019-05-08 23:17:53 +0200 (Wed, 08 May 2019)
Log Message:
-----------
grabbox (8may19)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/grabbox/README.md
trunk/Master/texmf-dist/doc/latex/grabbox/grabbox.pdf
trunk/Master/texmf-dist/source/latex/grabbox/grabbox.dtx
trunk/Master/texmf-dist/tex/latex/grabbox/grabbox.sty
Modified: trunk/Master/texmf-dist/doc/latex/grabbox/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/grabbox/README.md 2019-05-08 21:17:11 UTC (rev 51051)
+++ trunk/Master/texmf-dist/doc/latex/grabbox/README.md 2019-05-08 21:17:53 UTC (rev 51052)
@@ -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 @@
The package provides
- - `\grabbox<*>{<register>}[<pre>]{<mode>}[<post>]{<next>}`: grab the
+ - `\grabbox<*>[<prepre>]{<register>}[<pre>]{<mode>}[<post>]{<next>}`: grab the
next argument as a box in `<mode>` (`\hbox`, `\vbox` or `\vtop`) and save it
in box `<register>`. After the box is saved execute `<next>`. Inside of the
- box one can inject `<pre>` before the contents and `<post>` after them. If
- the star is not given spaces are stripped from the start and the end of the
- box.
+ box one can inject `<prepre>` and `<pre>` before the contents and `<post>`
+ after them. If the star is not given spaces are stripped from the start and
+ the end of the box.
Modified: trunk/Master/texmf-dist/doc/latex/grabbox/grabbox.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/grabbox/grabbox.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/grabbox/grabbox.dtx 2019-05-08 21:17:11 UTC (rev 51051)
+++ trunk/Master/texmf-dist/source/latex/grabbox/grabbox.dtx 2019-05-08 21:17:53 UTC (rev 51052)
@@ -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 @@
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 @@
\end{document}
%</driver>
%<*pkg>
-\newcommand*\grabbox at date{2018-12-29}
-\newcommand*\grabbox at version{1.3}
+\newcommand*\grabbox at date{2019-05-08}
+\newcommand*\grabbox at version{1.4}
\ProvidesPackage{grabbox}
[%
\grabbox at date\space v\grabbox at version\space utilities to get an argument as
@@ -177,6 +177,18 @@
% 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 @@
{%
\grabbox at def#1##1{\def#2{##1}\grabbox at opt#3#4}%
}
-\long\def\grabbox at afterelsefi#1\else#2\fi{\fi#1}
-\long\def\grabbox at afterfi#1\fi{\fi#1}
\grabbox at def\grabbox at opt#1#2%
{%
\@ifnextchar[
@@ -342,19 +352,6 @@
{%
\ifhmode\unskip\fi
}
-\grabbox at def\grabbox at unpack
- {%
- \begingroup
- \edef\grabbox at test{\grabbox at type}%
- \expandafter\ifx\grabbox at test\hbox
- \endgroup
- \grabbox at afterelsefi\unhbox
- \else
- \endgroup
- \grabbox at afterfi\unvbox
- \fi
- \grabbox at name
- }
\grabbox at def\grabbox
{%
\@ifstar
@@ -373,6 +370,21 @@
\afterassignment\grabbox at intermediate
\setbox\grabbox at name\grabbox at type
}
+\grabbox at def\@grabbox
+ {%
+ \@ifstar
+ {\@grabbox at spaces@true\@grabbox at a}
+ {\@grabbox at spaces@false\@grabbox at a}%
+ }
+\grabbox at ldef\@grabbox at a#1#2#3#4#5%
+ {%
+ \def\grabbox at into@prepre{#1}%
+ \def\grabbox at name {#2}%
+ \def\grabbox at into@pre {#3}%
+ \def\grabbox at type {#4}%
+ \def\grabbox at into@post {#5}%
+ \grabbox at d
+ }
\grabbox at def\grabbox at intermediate
{%
\grabbox at into@prepre
Modified: trunk/Master/texmf-dist/tex/latex/grabbox/grabbox.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/grabbox/grabbox.sty 2019-05-08 21:17:11 UTC (rev 51051)
+++ trunk/Master/texmf-dist/tex/latex/grabbox/grabbox.sty 2019-05-08 21:17:53 UTC (rev 51052)
@@ -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 at date{2018-12-29}
-\newcommand*\grabbox at version{1.3}
+\newcommand*\grabbox at date{2019-05-08}
+\newcommand*\grabbox at version{1.4}
\ProvidesPackage{grabbox}
[%
\grabbox at date\space v\grabbox at version\space utilities to get an argument as
@@ -50,8 +50,6 @@
{%
\grabbox at def#1##1{\def#2{##1}\grabbox at opt#3#4}%
}
-\long\def\grabbox at afterelsefi#1\else#2\fi{\fi#1}
-\long\def\grabbox at afterfi#1\fi{\fi#1}
\grabbox at def\grabbox at opt#1#2%
{%
\@ifnextchar[
@@ -77,19 +75,6 @@
{%
\ifhmode\unskip\fi
}
-\grabbox at def\grabbox at unpack
- {%
- \begingroup
- \edef\grabbox at test{\grabbox at type}%
- \expandafter\ifx\grabbox at test\hbox
- \endgroup
- \grabbox at afterelsefi\unhbox
- \else
- \endgroup
- \grabbox at afterfi\unvbox
- \fi
- \grabbox at name
- }
\grabbox at def\grabbox
{%
\@ifstar
@@ -108,6 +93,21 @@
\afterassignment\grabbox at intermediate
\setbox\grabbox at name\grabbox at type
}
+\grabbox at def\@grabbox
+ {%
+ \@ifstar
+ {\@grabbox at spaces@true\@grabbox at a}
+ {\@grabbox at spaces@false\@grabbox at a}%
+ }
+\grabbox at ldef\@grabbox at a#1#2#3#4#5%
+ {%
+ \def\grabbox at into@prepre{#1}%
+ \def\grabbox at name {#2}%
+ \def\grabbox at into@pre {#3}%
+ \def\grabbox at type {#4}%
+ \def\grabbox at into@post {#5}%
+ \grabbox at d
+ }
\grabbox at def\grabbox at intermediate
{%
\grabbox at into@prepre
More information about the tex-live-commits
mailing list