summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/grabbox
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-05-08 21:17:53 +0000
committerKarl Berry <karl@freefriends.org>2019-05-08 21:17:53 +0000
commitdc27dfcd77b6a8654d149e1821c03289d7aa359a (patch)
tree5836b1c3fea3c94b67dd4cb3c512e7144020aebb /Master/texmf-dist/source/latex/grabbox
parent610fc8431cfaf2913a54f01c6d3abd4d9283fc34 (diff)
grabbox (8may19)
git-svn-id: svn://tug.org/texlive/trunk@51052 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/grabbox')
-rw-r--r--Master/texmf-dist/source/latex/grabbox/grabbox.dtx50
1 files changed, 31 insertions, 19 deletions
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}
%</driver>
%<*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