summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/grabbox
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-12-30 22:12:59 +0000
committerKarl Berry <karl@freefriends.org>2018-12-30 22:12:59 +0000
commitf415e2c9d5a865727094a8bca5778bc3de7225ce (patch)
tree841883ce56206ad009dadc71779299fd4b4ecb6e /Master/texmf-dist/tex/latex/grabbox
parentfd0e6a66494a3aa9c7e6c66896ba52e83550804e (diff)
grabbox (30dec18)
git-svn-id: svn://tug.org/texlive/trunk@49546 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/grabbox')
-rw-r--r--Master/texmf-dist/tex/latex/grabbox/grabbox.sty61
1 files changed, 33 insertions, 28 deletions
diff --git a/Master/texmf-dist/tex/latex/grabbox/grabbox.sty b/Master/texmf-dist/tex/latex/grabbox/grabbox.sty
index c7eb787ae35..e5ab5339c60 100644
--- a/Master/texmf-dist/tex/latex/grabbox/grabbox.sty
+++ b/Master/texmf-dist/tex/latex/grabbox/grabbox.sty
@@ -29,39 +29,54 @@
%% and the derived files grabbox.pdf and
%% grabbox.sty.
%%
-\newcommand*\grabbox@date{2018-11-29}
-\newcommand*\grabbox@version{1.2}
+\newcommand*\grabbox@date{2018-12-29}
+\newcommand*\grabbox@version{1.3}
\ProvidesPackage{grabbox}
[%
\grabbox@date\space v\grabbox@version\space utilities to get an argument as
a box%
]
\@ifdefinable{\if@grabbox@spaces@}{\newif\if@grabbox@spaces@}
-
-\@ifdefinable{\grabbox@def}{\long\def\grabbox@def#1#2#{\grabbox@def@a{#1}{#2}}}
+\@ifdefinable{\grabbox@def}
+ {\long\def\grabbox@def#1#2#{\grabbox@def@a{}#1{#2}}}
+\@ifdefinable{\grabbox@ldef}
+ {\long\def\grabbox@ldef#1#2#{\grabbox@def@a\long#1{#2}}}
\@ifdefinable{\grabbox@def@a}
{%
- \protected\long\def\grabbox@def@a#1#2#3%
- {\@ifdefinable#1{\protected\def#1#2{#3}}}%
+ \protected\long\def\grabbox@def@a#1#2#3#4%
+ {\@ifdefinable#2{\protected#1\def#2#3{#4}}}%
}
\newcommand\grabbox@def@step[4]
{%
- \@ifdefinable#1{\grabbox@def#1##1{\def#2{##1}\grabbox@opt#3#4}}%
+ \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}
-\long\def\grabbox@afterelsefiA\else#1\fi#2#3{\fi#2}
-\long\def\grabbox@afterfiB\fi#1#2{\fi#2}
\grabbox@def\grabbox@opt#1#2%
{%
\@ifnextchar[
{\grabbox@opt@get#1#2}
{\def#1{}#2}%
}
-\protected\long\def\grabbox@opt@get#1#2[#3]%
+\grabbox@ldef\grabbox@opt@get#1#2[#3]%
{%
\def#1{#3}#2%
}
+\grabbox@def\grabbox@set@color
+ {%
+ \@ifundefined{set@color}{}
+ {\global\let\grabbox@set@color\set@color\grabbox@set@color}%
+ }
+\AtBeginDocument
+ {%
+ \@ifundefined{set@color}
+ {\gdef\grabbox@set@color{}}
+ {\global\let\grabbox@set@color\set@color}%
+ }%
+\newcommand*\grabbox@unskip@space
+ {%
+ \ifhmode\unskip\fi
+ }
\grabbox@def\grabbox@unpack
{%
\begingroup
@@ -81,31 +96,21 @@
{\@grabbox@spaces@true\grabbox@a}
{\@grabbox@spaces@false\grabbox@a}%
}
-\grabbox@def@step\grabbox@a\grabbox@name\grabbox@into@pre\grabbox@b
-\grabbox@def@step\grabbox@b\grabbox@type\grabbox@into@post\grabbox@c
-\protected\long\def\grabbox@c#1%
+\grabbox@def\grabbox@a
+ {%
+ \grabbox@opt\grabbox@into@prepre\grabbox@b
+ }
+\grabbox@def@step\grabbox@b\grabbox@name\grabbox@into@pre\grabbox@c
+\grabbox@def@step\grabbox@c\grabbox@type\grabbox@into@post\grabbox@d
+\grabbox@ldef\grabbox@d#1%
{%
\def\grabbox@final{#1}%
\afterassignment\grabbox@intermediate
\setbox\grabbox@name\grabbox@type
}
-\grabbox@def\grabbox@set@color
- {%
- \@ifundefined{set@color}{}
- {\global\let\grabbox@set@color\set@color\grabbox@set@color}%
- }
-\AtBeginDocument
- {%
- \@ifundefined{set@color}
- {\gdef\grabbox@set@color{}}
- {\global\let\grabbox@set@color\set@color}%
- }%
-\newcommand*\grabbox@unskip@space
- {%
- \ifhmode\unskip\fi
- }
\grabbox@def\grabbox@intermediate
{%
+ \grabbox@into@prepre
\bgroup
\if@grabbox@spaces@
\else