%%
%% This is file `grabbox.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% grabbox.dtx  (with options: `pkg')
%% 
%% --------------------------------------------------------------
%% grabbox -- utilities to get an argument as a box
%% E-mail: jspratte@yahoo.de
%% Released under the LaTeX Project Public License v1.3c or later
%% See http://www.latex-project.org/lppl.txt
%% --------------------------------------------------------------
%% 
%% 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
%% (at your option) any later version.  The latest version of this license is in
%% the file:
%% 
%%   http://www.latex-project.org/lppl.txt
%% 
%% This work is "maintained" (as per LPPL maintenance status) by
%%   Jonathan P. Spratte.
%% 
%% This work consists of the file  grabbox.dtx
%% and the derived files           grabbox.pdf and
%%                                 grabbox.sty.
%% 
\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
    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@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#4%
      {\@ifdefinable#2{\protected#1\def#2#3{#4}}}%
  }
\newcommand\grabbox@def@step[4]
  {%
    \grabbox@def#1##1{\def#2{##1}\grabbox@opt#3#4}%
  }
\grabbox@def\grabbox@opt#1#2%
  {%
    \@ifnextchar[
      {\grabbox@opt@get#1#2}
      {\def#1{}#2}%
  }
\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
  {%
    \@ifstar
      {\@grabbox@spaces@true\grabbox@a}
      {\@grabbox@spaces@false\grabbox@a}%
  }
\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
  {%
    \@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
    \bgroup
    \if@grabbox@spaces@
    \else
      \aftergroup\grabbox@unskip@space
    \fi
    \grabbox@set@color
    \aftergroup\grabbox@after
    \grabbox@into@pre
    \if@grabbox@spaces@
    \else
      \ignorespaces
    \fi
  }
\newcommand*\grabbox@after@aux@b[1]
  {%
    \grabbox@after@aux@a
  }
\grabbox@def\grabbox@after@aux@a
  {%
    \@ifnextchar\reset@color
      {\reset@color\grabbox@after@aux@b}
      {\egroup\grabbox@final}%
  }
\grabbox@def\grabbox@after
  {%
    \grabbox@into@post
    \endgraf
    \grabbox@after@aux@a
  }
%% 
%%
%% End of file `grabbox.sty'.
