diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/strc-flt.mkii')
-rw-r--r-- | Master/texmf-dist/tex/context/base/strc-flt.mkii | 48 |
1 files changed, 46 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/context/base/strc-flt.mkii b/Master/texmf-dist/tex/context/base/strc-flt.mkii index e64a439ec39..3d07cdc2064 100644 --- a/Master/texmf-dist/tex/context/base/strc-flt.mkii +++ b/Master/texmf-dist/tex/context/base/strc-flt.mkii @@ -2035,7 +2035,7 @@ \c!nbottom=0, \c!nlines=4, \c!local=, - \c!default=\v!figure, + \c!default=, % was \v!figure but this is the location \c!numbering=\v!yes] % float strategy, replaces some of the above macros @@ -2139,5 +2139,49 @@ \def\somerightpagefloat{\placesomerightpagefloat} \def\somefacefloat {\placesomefacefloat} \def\someslotfloat {\placesomeslotfloat} - + +%D Local floats. + +\def\setuplocalfloats + {\getparameters[\??lf]} + +\setuplocalfloats + [%\c!before=\blank, + %\c!after=\blank, + \c!inbetween=\blank] + +\installfloathandler \v!local \somelocalfloat + +\initializeboxstack{localfloats} + +\newcounter\noflocalfloats + +\def\resetlocalfloats + {\doglobal\newcounter\noflocalfloats + \initializeboxstack{localfloats}} + +\def\somelocalfloat[#1]% + {\doglobal\increment\noflocalfloats + \savebox{localfloats}{\noflocalfloats}{\box\floatbox}} + +\def\getlocalfloats + {\dorecurse\noflocalfloats + {\ifnum\recurselevel=\plusone % 1\relax + \getvalue{\??lf\c!before}% + \else + \getvalue{\??lf\c!inbetween}% + \fi + \dontleavehmode\hbox{\foundbox{localfloats}\recurselevel}% + \ifnum\recurselevel=\noflocalfloats\relax + \getvalue{\??lf\c!after}% + \fi}} + +\def\flushlocalfloats + {\getlocalfloats + \resetlocalfloats} + +\def\getlocalfloat#1{\expanded{\foundbox{localfloats}{\number#1}}} + +\def\forcelocalfloats{\let\forcedfloatmethod\v!local} + \protect \endinput |