diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/grabbox/grabbox.sty | 61 |
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 |