diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/page-set.mkiv')
-rw-r--r-- | Master/texmf-dist/tex/context/base/page-set.mkiv | 315 |
1 files changed, 168 insertions, 147 deletions
diff --git a/Master/texmf-dist/tex/context/base/page-set.mkiv b/Master/texmf-dist/tex/context/base/page-set.mkiv index 8c3566bc087..467f22493cb 100644 --- a/Master/texmf-dist/tex/context/base/page-set.mkiv +++ b/Master/texmf-dist/tex/context/base/page-set.mkiv @@ -5,7 +5,7 @@ %D subtitle=Column Sets, %D author=Hans Hagen, %D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] %C %C This module is part of the \CONTEXT\ macro||package and is %C therefore copyrighted by \PRAGMA. See mreadme.pdf for @@ -54,8 +54,11 @@ \def\OTRSETmakeupwidth{\innermakeupwidth} -\let\OTRSETflushsidefloats \forgetsidefloats % \relax -\let\OTRSETsynchronizesidefloats\forgetsidefloats % \relax +\unexpanded\def\page_set_command_flush_side_floats + {\page_sides_forget_floats} + +\unexpanded\def\page_set_command_synchronize_side_floats + {\page_sides_forget_floats} \def\OTRSETgridcell #1#2{\csname \@otr@:\number#1:\number#2\endcsname} \def\OTRSETgetgridcell#1#2{\box\csname \@otr@:\number#1:\number#2\endcsname} @@ -237,7 +240,7 @@ \dostepwiserecurse{#3}\!!counte\plusone {\OTRSETsetgridcell\!!countf\recurselevel#1}}% \dostepwiserecurse{#3}\!!counte\plusone - {\global\wd\OTRSETgridcell{#2}\recurselevel\hsize}% + {\wd\OTRSETgridcell{#2}\recurselevel\hsize}% \OTRSETsetgridcell{#2}\!!counte#6} \def\OTRSETsetgridcells @@ -437,7 +440,7 @@ \vss \fi}% \wd\scratchbox\localcolumnwidth % \textwidth - \docolumnpagebodymarks{#1}{#2}\recurselevel\scratchbox + \page_marks_synchronize_column{#1}{#2}\recurselevel\scratchbox \ifcase\columndirection \hskip\OTRSETgetparameter\c!distance\recurselevel\box\scratchbox \else @@ -500,7 +503,6 @@ \fi \doglobal\increment\columnsetpage \OTRSETinitializecolumns - %\OTRSETdoflushfloats \OTRSETstartnextpage \initializecolumntextareas \fi} @@ -520,16 +522,16 @@ \def\OTRSETdofinaloutput {\ifdim\ht\OTRfinalpagebox=\textheight - \bgroup % \let\OTRSETsetvsize\relax % prevents useless search for gap + \bgroup \ifcase\OTRSETbalancemethod - \finaloutput\box\OTRfinalpagebox + \page_otr_construct_and_shipout\box\OTRfinalpagebox \else\ifdim\OTRSETbalht>\zeropoint % catch a bordercase \scratchdimen\OTRSETbalht \advance\scratchdimen\lineheight\relax \ifdim\scratchdimen>\textheight % full page - \finaloutput\box\OTRfinalpagebox + \page_otr_construct_and_shipout\box\OTRfinalpagebox \else % same page \global\setbox\OTRfinalpagebox \iftracecolumnset\ruledvbox\else\vbox\fi to \OTRSETbalht @@ -538,14 +540,12 @@ \snaptogrid\vbox{\vskip\OTRSETbalht}% hack \fi \else - \finaloutput\box\OTRfinalpagebox + \page_otr_construct_and_shipout\box\OTRfinalpagebox \fi \fi \globallet\OTRSETbalht\zeropoint - \egroup + \egroup \fi} - -\definesystemvariable {mc} -\definesystemvariable {mt} + \definesystemconstant {colset} \definetwopasslist\s!colset @@ -554,8 +554,6 @@ \newdimen \OTRSETtextsheight \let \OTRSETidentifier=\empty -\newtoks \OTRSEToutput - \def\OTRSETgetparameter#1#2{\csname\??mc\OTRSETidentifier\number#2#1\endcsname} \def\OTRSETsetparameter#1#2{\setvalue{\??mc\OTRSETidentifier\number#2#1}} @@ -570,9 +568,10 @@ \emptybox \fi} -\def\OTRSETsetvsize % snap per sectie (gap here?) +\unexpanded\def\page_set_command_set_vsize % snap per sectie (gap here?) {\ifcollectingcontent \else % can be assigndimen -\OTRSETskipstart % not that well tested + \OTRSETsetcolumnmaxcells % layout can be changed + \OTRSETskipstart % not that well tested \OTRSETcheckinsert % added \OTRSETsetfreecells\mofcolumns\columnfirstcell \ifsomefreecolumncells @@ -586,12 +585,12 @@ \synchronizenotes \fi} -\def\OTRSETsethsize % of course this does not migrate outside the otr +\def\page_set_command_set_hsize % of course this does not migrate outside the otr {\localcolumnwidth\OTRSETlocalwidth\mofcolumns \textwidth\localcolumnwidth \hsize\localcolumnwidth} -\def\OTRSETsynchronizehsize +\unexpanded\def\page_set_command_synchronize_hsize {\ifcase0\getvalue{\??mc\??mc\c!width}\else % some width set \bgroup \scratchdimen\OTRSETlocalwidth\mofcolumns @@ -599,12 +598,13 @@ \egroup \else % only if change in width and \column/\break - \egroup \OTRSETsethsize + \egroup + \page_set_command_set_hsize \fi \fi} \def\OTRSETcheckfreelines - {\OTRSETsetvsize} + {\page_set_command_set_vsize} \def\doOTRSETcolumnseparator {\hbox to \zeropoint{\hss\red\vl\hss}} @@ -614,34 +614,6 @@ \def\showbreaks {\let\OTRSETcolumnseparator\doOTRSETcolumnseparator} -% \installcolumnbreakhandler {SET} \v!ja -% {% hmmm: -% \ifhmode -% \bgroup -% \removeunwantedspaces -% \parfillskip\zeropoint -% \OTRSETcolumnseparator -% \par -% \egroup -% \fi -% % brrr: -% \ejectinsert -% \ejectpage -% \OTRSETsynchronizehsize} % no \OTRSETsethsize, can be mid smaller (like tabulate) -% -% \installcolumnbreakhandler {SET} \v!forceer -% {\OTRSETgotocolumn[\v!forceer]} -% \installcolumnbreakhandler {SET} \v!eerste -% {\OTRSETgotocolumn[\v!eerste]} -% \installcolumnbreakhandler {SET} \v!laatste -% {\OTRSETgotocolumn[\v!laatste]} -% -% \installcolumnbreakhandler {SET} \v!pagina -% {\simplepagebreak % \flushnotes \executepagebreakhandler\v!ja -% \ifnum\mofcolumns>\plusone -% \OTRSETgotocolumn[\v!laatste,\v!forceer]% -% \fi} - \def\OTRSETcolumnhbreak {\ifhmode \bgroup @@ -652,26 +624,26 @@ \egroup \fi} -\installcolumnbreakhandler {SET} \v!local +\installcolumnbreakmethod \s!columnset \v!local {\OTRSETcolumnhbreak - \ejectinsert - \ejectpage % brrr - % no \OTRSETsethsize, can be mid smaller (like tabulate) + \page_otr_flush_all_floats + \page_otr_eject_page + % no \page_set_command_set_hsize, can be mid smaller (like tabulate) % also, this one should be executed at the outer level % (setting hsize inside otr does not work) - \OTRSETsynchronizehsize} + \page_set_command_synchronize_hsize} % We need to make sure that we really leave the column; mid % column we may end up in an empty gap, and we don't want to % stay there (basically such a gap is a small empty page % then). -\installcolumnbreakhandler {SET} \v!yes +\installcolumnbreakmethod \s!columnset \v!yes {\OTRSETcolumnhbreak \edef\savedmofcolumns{\the\mofcolumns}% \edef\savedrealpageno{\the\realpageno}% - \ejectinsert - \ejectpage % brrr + \page_otr_flush_all_floats + \page_otr_eject_page \doloop {\ifnum\savedmofcolumns=\mofcolumns \ifnum\savedrealpageno=\realpageno @@ -682,20 +654,19 @@ \else \exitloop \fi}% - \OTRSETsynchronizehsize} + \page_set_command_synchronize_hsize} -\installcolumnbreakhandler {SET} \s!unknown +\installcolumnbreakmethod \s!columnset \s!unknown {\expanded{\OTRSETgotocolumn[\@@columnspecification]}} -\installcolumnbreakhandler {SET} \v!page - {\vfill\eject % \doejectpage\eject - \OTRSETgotonextpage} +\installcolumnbreakmethod \s!columnset \v!page + {\page_otr_fill_and_eject_page} \newtoks\OTRSETeverystartofcolumn \newbox\OTRSETsavedfootnotes -% \installoutput\OTRSETflushtextsofar % spacing goes wrong +% \installoutputroutine\OTRSETflushtextsofar % spacing goes wrong %\def\OTRSETflushtextsofar % {\ifvoid\normalpagebox \else @@ -718,7 +689,7 @@ \newconstant\OTRSETflushtextmode % will be replaced -\def\OTRSETflushtextsofar +\def\OTRSETflushtextsofar % needs renaming {\ifcase\OTRSETflushtextmode % don't mess around \or @@ -734,7 +705,7 @@ \newskip\lastskipinotr -\installoutput\doOTRSETflushtextsofar % experimental +\installoutputroutine\doOTRSETflushtextsofar % experimental {\ifvoid\normalpagebox\else \scratchdimen\dp\normalpagebox \setbox\scratchbox\vbox @@ -760,7 +731,7 @@ \else % we should not discard skips after here; tricky \fi - \OTRSETsetvsize + \page_set_command_set_vsize \fi} \def\OTRSETplacebottomnotes @@ -816,7 +787,7 @@ \doOTRSETsetgridcells {\copy\placeholderboxf} \mofcolumns\columnfirstcell\plusone\noflines - {\registeredtextarea1\columnfirstcell\scratchbox}% == \hbox / tricky htcorr == \columnfirstcell + {\page_areas_registered_box1\columnfirstcell\scratchbox}% == \hbox / tricky htcorr == \columnfirstcell \global\columnlastcell\columnfirstcell \global\advance\columnlastcell \noflines \global\lastcolumnlastcell\columnlastcell @@ -831,8 +802,8 @@ % we cannot adapt the hsize since it may have changed (like % inside a tabulate) so we only change it when there is a % reason to do so - \OTRSETsynchronizehsize - \OTRSETsetvsize} + \page_set_command_synchronize_hsize + \page_set_command_set_vsize} \def\OTRSETfindnextgap {\OTRSETsetfreecells\mofcolumns\columnlastcell @@ -844,7 +815,7 @@ \OTRSETdoflush \global\columnlastcell\plusone \global\columnfirstcell\zerocount - \OTRSETdoflushfloats + \page_set_command_flush_floats \else \the\OTRSETeverystartofcolumn \global\columnlastcell\plusone @@ -937,7 +908,7 @@ \ifenoughcolumncells \OTRSETsetgridcells\mofcolumns\columnfirstcell\columnhcells\columnvcells {\hbox{\copy#1}}% - \OTRSETsetvsize + \page_set_command_set_vsize \else \OTRSETsavebox{#1}% \fi} @@ -954,7 +925,7 @@ \ifenoughcolumncells \OTRSETsetgridcells\mofcolumns\columnlastcell\columnhcells\columnvcells{\copy#1}% \OTRSETfillgapsbetweencells\mofcolumns\savedcolumnlastcell % -) - \OTRSETsetvsize + \page_set_command_set_vsize \else \columnlastcell\savedcolumnlastcell \OTRSETsavebox{#1}% @@ -1169,7 +1140,7 @@ \OTRSETstoreincolumnslotindeed \mofcolumns\mofcolumns+\currenthcell \noflines\columnmaxcells+\currentvcell{#2}% - \OTRSETsetvsize} + \page_set_command_set_vsize} \def\OTRSETcheckprefered {\ifnum\preferedcolumn<\mofcolumns @@ -1247,7 +1218,7 @@ \else %\message{[flt]}% float \fi - \OTRSETsetvsize + \page_set_command_set_vsize %\message{[fnt]}% float \else %\message{[rej]}% save box @@ -1292,7 +1263,7 @@ \egroup \fi} -\def\OTRSETdocheckiffloatfits % eigenlijk moet else float anders +\unexpanded\def\page_set_command_check_if_float_fits {\global\ifnofloatpermitted\roomforfloatfalse\else\roomforfloattrue\fi} \def\OTRSETunpreparebox#1% @@ -1314,10 +1285,10 @@ {\OTRSETunpreparebox{#1}% \dofloatsresave\s!text} -\def\OTRSETflushfloatbox % nog verder doorvoeren en meer info in marge +\unexpanded\def\page_set_command_flush_float_box {\iftestfloatbox\ruledhbox\fi{\box\floatbox}} -\def\OTRSETdoflushfloats +\unexpanded\def\page_set_command_flush_floats {\bgroup \def\OTRSETsavebox##1{\!!doneafalse}% \doloop @@ -1488,8 +1459,8 @@ \definecolumnset[\s!default][\c!n=2] % fallback -\def\OTRSETgotonextpage - {\vfill\eject +\unexpanded\def\page_set_command_next_page + {\page_otr_fill_and_eject_page \relax\ifnum\mofcolumns>\plusone \OTRSETgotocolumn[\v!last]% \ifnum\mofcolumns>\plusone @@ -1497,7 +1468,8 @@ \fi \fi} -\let\OTRSETgotonextpageX\OTRSETgotonextpage % will become obsolete +\let\page_set_command_next_page_and_inserts\page_set_command_next_page + \def\OTRSETgotocolumn {\dosingleempty\doOTRSETgotocolumn} @@ -1515,7 +1487,7 @@ \def\doOTRSETgotoCOLUMN#1% {\ifnum\mofcolumns=#1\else - \vfill\eject % \doejectpage\eject + \page_otr_fill_and_eject_page \doloop {\ifnum\mofcolumns=#1\relax \exitloop \else \OTRSETdummycolumn @@ -1536,7 +1508,7 @@ \dorecurse\scratchcounter{\line{\strut}}% \fi \fi - \OTRSETsetvsize} + \page_set_command_set_vsize} \def\doOTRSETgotocolumn[#1]% yes|force|first|last|<number>|<number>*<number> {\processallactionsinset @@ -1584,7 +1556,7 @@ % \fi % \fi % \fi -% \OTRSETsetvsize} +% \page_set_command_set_vsize} \def\OTRSETgotocell#1#2% obsolete: now \column[#1*#2] {\endgraf @@ -1594,8 +1566,7 @@ \def\OTRSETdummycolumn {\verticalstrut \vskip-\struttotal - \vfill - \eject} + \page_otr_fill_and_eject_page} \newcounter\columnsetlevel \let\currentcolumnset\empty @@ -1615,16 +1586,17 @@ \globallet\columnsetpage\!!plusone \def\currentcolumnset{#2}% \insidecolumnstrue % will be different flag in addition - \activateotr{SET}{ONE}% andere naam, activate or so + \setupoutputroutine[\s!columnset]% \doifelsenothing{#1} {\globallet\OTRSETlist\s!default} {\xdef\OTRSETlist{#1}}% \OTRSETstartnextpage \OTRSETassignwidths - \OTRSETsethsize + \page_set_command_set_hsize \else \bgroup - \fi} + \fi + \begingroup} % extra grouping needed ... else weird issue with ungrouped font switch (e.g. \ss) % \setuplayout[grid=yes] \definecolumnset[example] \showgrid @@ -1644,14 +1616,15 @@ \OTRSETbalancemethod\plusone \OTRSETreducegridbox \global\setbox\OTRfinalpagebox\OTRSETmakegridbox - \global\ht\OTRfinalpagebox\textheight % signals output that there is content + \ht\OTRfinalpagebox\textheight % signals output that there is content \OTRSETdofinaloutput \globallet\OTRSETbalht\zeropoint \egroup} {}} \unexpanded\def\stopcolumnset - {\relax + {\endgraf + \endgroup % ends extra grouping \ifnum\columnsetlevel=\plusone \endgraf % needed, else wrong vsize in one par case \global\settrue\OTRSETfinish @@ -1659,8 +1632,8 @@ \dostopcolumnset \egroup \global\notelimittrue % brrr, untested and fuzzy - \setvsize - \sethsize + \page_otr_command_set_vsize + \page_otr_command_set_hsize \ifvoid\OTRfinalpagebox\else % probably balanced \ifdim\ht\OTRfinalpagebox<\textheight @@ -1670,7 +1643,11 @@ \fi \fi \global\setfalse\OTRSETfinish - \ifsomefloatwaiting \setvsize \pagebreak \setvsize \fi + \ifsomefloatwaiting + \page_otr_command_set_vsize + \pagebreak + \page_otr_command_set_vsize + \fi \OTRSETflushleftovers \else \egroup @@ -1719,7 +1696,7 @@ % inhibit flush of floats ! % todo: nothing if no footnotes, else empty page \dostepwiserecurse\mofcolumns\nofcolumns\plusone - {\vskip-\struttotal\verticalstrut\vfill\eject}% + {\vskip-\struttotal\verticalstrut\page_otr_fill_and_eject_page}% \else \ifnum\mofcolumns>\plusone \donetrue @@ -1734,8 +1711,7 @@ \else % probably todo \fi - \vfill - \eject + \page_otr_fill_and_eject_page % brr, may result in empty page after nicely fit text % or if left, then lost of first column only text \ifnum\mofcolumns>\plusone @@ -1761,13 +1737,13 @@ \OTRSETinitializecolumns \OTRSETcheckinsert \OTRSETcheckgrid - \OTRSETsetvsize - \OTRSETsethsize % or local ? + \page_set_command_set_vsize + \page_set_command_set_hsize % or local ? \OTRSETsetplaceholders \OTRSEThandlepreposttext \initializecolumntextareas % name ! \OTRSETcheckstartcells - \OTRSETsetvsize} + \page_set_command_set_vsize} \def\OTRSETcheckstartcells {\dorecurse\nofcolumns @@ -1780,12 +1756,12 @@ \donothing{\OTRSETsetgridcell\mofcolumns\recurselevel\copy\placeholderboxe}}% \egroup}} -\OTRSEToutput +\unexpanded\def\page_set_command_routine {\dontcomplain % new, get rid of overfull message (to be sorted out) \doloop {\OTRSETnaturalflush %\OTRSETstartnextpage % no - \OTRSETdoflushfloats % actually belongs in \flushsavedfloats (but goes wrong) + \page_set_command_flush_floats \OTRSETcheckfreelines \ifsomefreecolumncells \exitloop @@ -1794,10 +1770,13 @@ \fi}% \OTRSETchecksidefloat} +\def\OTRSETsetcolumnmaxcells + {\getrawnoflines\textheight\xdef\columnmaxcells{\the\noflines}} + \def\OTRSETinitializefeatures {% number of lines % new: raw - \getrawnoflines\textheight\xdef\columnmaxcells{\the\noflines}% + \OTRSETsetcolumnmaxcells % direction \doifelsevalue{\??mc\OTRSETidentifier\c!direction}\v!right {\columndirection\zerocount} @@ -1823,7 +1802,7 @@ \ifx\lastskipinotr\undefined \newskip\lastskipinotr \fi -\installoutput\OTRSETflushpreposttext +\installoutputroutine\OTRSETflushpreposttext {\global\setbox\precolumnbox\vbox {\unvbox\normalpagebox \global\lastskipinotr\lastskip}% @@ -1831,7 +1810,7 @@ \global\setbox\precolumnbox\hbox {\lower\strutdepth\box\precolumnbox}% \fi - \global\dp\precolumnbox\strutdepth + \dp\precolumnbox\strutdepth \ifcarryoverfootnotes \else \global\setbox\postcolumnbox\vbox{\placebottomnotes}% \fi} @@ -1871,8 +1850,8 @@ \def\OTRSETchecksidefloat {} % {\sidefloatoutput} -\def\OTRSETfinalsidefloatoutput - {} +\unexpanded\def\page_set_command_side_float_output + {} % nothing, reset anyway \def\OTRSETcheckgrid {\topskip1\topskip @@ -1907,12 +1886,11 @@ \ifcase\columnsetlevel\relax \mofcolumns\plusone \OTRSETinitializecolumns - \OTRSETassignwidths - \OTRSETsethsize + \OTRSETassignwidths % already done + \page_set_command_set_hsize \fi \!!counta#2\!!countb#3\docalculatecolumnsetspan - \expandafter\egroup\expandafter\edef\expandafter - #4\expandafter{\the\!!widtha}} + \expandafter\egroup\expandafter\edef\expandafter#4\expandafter{\the\!!widtha}} % interface to footnotes @@ -1994,21 +1972,22 @@ % page contents -\def\OTRSETdopagecontents#1#2% takes two args: \box<n> \unvbox<n> +% \def\OTRSETdopagecontents#1#2% takes two args: \box<n> \unvbox<n> +\unexpanded\def\page_set_command_package_contents#1#2% \box<n> \unvbox<n> % this one will be redone (checked) {\vbox to \textheight{\forgetall#1#2}} - -\def\OTRSETsomepagefloat {\def\floatmethod{PAGE}\OTRSETsomeslotfloat} % check -\def\OTRSETsomeherefloat {\def\floatmethod{HERE}\OTRSETsomeslotfloat} % check -\def\OTRSETsomeelsefloat {\def\floatmethod{HERE}\OTRSETsomeslotfloat} % check -\def\OTRSETsomefixdfloat {\def\floatmethod{FIXD}\OTRSETsomeslotfloat} % check -\def\OTRSETsometopfloat {\def\floatmethod{TOPS}\OTRSETsomeslotfloat} % check -\def\OTRSETsomebottomfloat{\def\floatmethod{BOTS}\OTRSETsomeslotfloat} % check + +\def\page_set_place_float_page {\def\floatmethod{PAGE}\page_set_place_float_slot} % check +\def\page_set_place_float_here {\def\floatmethod{HERE}\page_set_place_float_slot} % check +\def\page_set_place_float_else {\def\floatmethod{HERE}\page_set_place_float_slot} % check / not used +\def\page_set_place_float_force {\def\floatmethod{FIXD}\page_set_place_float_slot} % check +\def\page_set_place_float_top {\def\floatmethod{TOPS}\page_set_place_float_slot} % check +\def\page_set_place_float_bottom{\def\floatmethod{BOTS}\page_set_place_float_slot} % check \def\OTRSETflushfloatbox % nog verder doorvoeren en meer info in marge {\iftestfloatbox\ruledhbox\fi{\box\floatbox}} -\def\OTRSETsomeslotfloat[#1]% - {\setbox\floatbox\vbox{\flushfloatbox}% +\def\page_set_place_float_slot + {\setbox\floatbox\vbox{\page_otr_command_flush_float_box}% \dp\floatbox\strutdp \@EA\uppercasestring\floatmethod\to\floatmethod \OTRSETstoreincolumnslot\floatmethod\floatbox @@ -2016,21 +1995,23 @@ % kind of new, looks much like OTRONE, but not entirely -\def\OTRSETdosettopinserts +\newconditional\c_page_set_top_of_insert + +\unexpanded\def\page_set_command_set_top_insertions {\bgroup \ifsomefloatwaiting \noffloatinserts\zerocount \let\totaltopinserted\!!zeropoint \OTRSETdodosettopinserts - \ifnum\@@bknbottom=\zerocount - \ifnum\@@bknlines>\zerocount + \ifnum\rootfloatparameter\c!nbottom=\zerocount + \ifnum\rootfloatparameter\c!nlines>\zerocount \ifdim\totaltopinserted>\zeropoint\relax \dimen0\lineheight - \dimen0=\@@bknlines\dimen0 + \dimen0=\rootfloatparameter\c!nlines\dimen0 \advance\dimen0 \totaltopinserted\relax \ifdim\dimen0>\textheight % \vsize %%%%%%%%% \textheight - \showmessage\m!floatblocks8{\@@bknlines}% - \vfilll\eject + \showmessage\m!floatblocks8{\rootfloatparameter\c!nlines}% + \page_otr_fill_and_eject_page % was triple: vfilll \fi \fi \fi @@ -2042,21 +2023,21 @@ {\ifnum\noffloatinserts<\noftopfloats \dogetfloat \ifdim\topinserted=\zeropoint\relax - \topofinserttrue + \settrue\c_page_set_top_of_insert \else - \topofinsertfalse + \setfalse\c_page_set_top_of_insert \fi \setbox\scratchbox\vbox % kan beter ! {\forgetall - \iftopofinsert - \ifdim\OTRSETtopoffset=\zeropoint - \moveongrid[\v!top] - \fi + \ifconditional\c_page_set_top_of_insert + %\ifdim\OTRSETtopoffset=\zeropoint + % \moveongrid[\v!top] + %\fi \else \betweenfloatblanko % inserts can't look back \fi - \flushfloatbox - \blank[\@@bkspaceafter]}% + \page_otr_command_flush_float_box + \blank[\rootfloatparameter\c!spaceafter]}% \global\advance\topinserted \ht\scratchbox\relax \ifdim\topinserted>\vsize % was \textheight\relax \OTRSETresavebox\floatbox @@ -2081,7 +2062,7 @@ \fi \OTRSETdodosettopinserts} -\def\OTRSETdosetbotinserts +\unexpanded\def\page_set_command_set_bottom_insertions {\bgroup \ifsomefloatwaiting \noffloatinserts\zerocount @@ -2098,8 +2079,8 @@ \ifdim\botinserted<\pagegoal\relax \insert\botins {\forgetall - \blank[\@@bkspacebefore]% - \flushfloatbox}% + \blank[\rootfloatparameter\c!spacebefore]% + \page_otr_command_flush_float_box}% \ifsomefloatwaiting \advance\noffloatinserts \plusone \else @@ -2119,9 +2100,7 @@ \fi \OTRSETdodosetbotinserts} -\let\OTRSETdosetbothinserts\relax - -\def\OTRSETdotopinsertions +\unexpanded\def\page_set_command_flush_top_insertions {\ifvoid\topins\else \ifvoid\columntopbox\mofcolumns \columnsettopbox\mofcolumns\box\topins @@ -2135,7 +2114,7 @@ \fi \global\topinserted\zeropoint\relax} % goes away -\def\OTRSETdobotinsertions +\unexpanded\def\page_set_command_flush_bottom_insertions {\ifvoid\botins \else \columnsetbotbox\mofcolumns\box\botins % \else @@ -2275,7 +2254,7 @@ \def\flushcolumntextareas {\initializecolumntextareas - \setvsize} + \page_otr_command_set_vsize} % set ? \def\columntextlastbackspace{\backspace} @@ -2406,6 +2385,14 @@ \def\setcolumnsetspanhsize#1#2% x nx / uses counta/b {\!!counta#1\!!countb#2\docalculatecolumnsetspan \edef\columnsetspanhsize{\the\!!widtha}} + +\unexpanded\def\page_set_command_set_float_hsize + {\hsize % maybe checking optional + \ifdim\tempfloatwidth>\makeupwidth + \makeupwidth + \else + \tempfloatwidth + \fi} \unexpanded\def\definecolumnsetspan {\dodoubleempty\dodefinecolumnsetspan} @@ -2480,7 +2467,7 @@ \setcolumnsetspanhsize\mofcolumns\!!countc % a/b used \hsize\columnsetspanhsize \setbox\scratchbox\vbox\bgroup - \dostartframedtext[cs:#1][\v!none]% geen nils placement + \pack_framed_text_start{cs:#1}[\v!none]% geen nils placement % spoils spacing : \vskip-\struttotal\par\verticalstrut\par \ifnum\columnsetlevel>\zerocount \namedframedtextparameter{cs:#1}\c!before @@ -2499,7 +2486,7 @@ \else \endgraf \fi - \dostopframedtext + \pack_framed_text_stop \egroup \setbox\scratchbox\frozenhbox to \hsize {\dontcomplain @@ -2526,7 +2513,6 @@ \@EA\uppercasestring\floatmethod\to\floatmethod % todo : \v!here -> here enzovoorts \OTRSETstoreincolumnslot\floatmethod\scratchbox - % watch out: no \dochecknextindentation{tag} \checknextindentation[\namedframedtextparameter{cs:#1}\c!indentnext]% \else % of course we needed a one-column fall back for tm; brrr, the box has now too @@ -2550,7 +2536,42 @@ % \startcolumnsetspan[two] \emptylines[5] \stopcolumnsetspan % \startcolumnsetspan[two] \input tufte \stopcolumnsetspan % \stopcolumnset - + +\unexpanded\def\page_set_command_flush_saved_floats % rather similar to _one_ ut this might change + {\global\topinserted\zeropoint + \global\botinserted\zeropoint + \ifflushingfloats \else + \page_set_command_set_top_insertions + \page_set_command_set_bottom_insertions + \ifsomefloatwaiting + \doif{\rootfloatparameter\c!cache}\v!no\page_set_command_flush_floats % could be _otr_ + \fi + \fi} + +\defineoutputroutine + [\s!columnset] + [\s!page_otr_command_routine =\page_set_command_routine, + \s!page_otr_command_package_contents =\page_set_command_package_contents, + \s!page_otr_command_set_vsize =\page_set_command_set_vsize, + % \s!page_otr_command_set_hsize =\page_one_command_set_hsize, % tricky, goes wrong + \s!page_otr_command_next_page =\page_set_command_next_page, + \s!page_otr_command_next_page_and_inserts =\page_set_command_next_page_and_inserts, + \s!page_otr_command_synchronize_hsize =\page_set_command_synchronize_hsize, + \s!page_otr_command_set_top_insertions =\page_set_command_set_top_insertions, + \s!page_otr_command_set_bottom_insertions =\page_set_command_set_bottom_insertions, + \s!page_otr_command_flush_top_insertions =\page_set_command_flush_top_insertions, + \s!page_otr_command_flush_bottom_insertions =\page_set_command_flush_bottom_insertions, + \s!page_otr_command_set_float_hsize =\page_set_command_set_float_hsize, + \s!page_otr_command_check_if_float_fits =\page_set_command_check_if_float_fits, + \s!page_otr_command_flush_float_box =\page_set_command_flush_float_box, + \s!page_otr_command_synchronize_side_floats =\page_set_command_synchronize_side_floats, + \s!page_otr_command_side_float_output =\page_set_command_side_float_output, + \s!page_otr_command_flush_floats =\page_set_command_flush_floats, + \s!page_otr_command_flush_side_floats =\page_set_command_flush_side_floats, + \s!page_otr_command_flush_saved_floats =\page_set_command_flush_saved_floats + % \s!page_otr_command_flush_margin_blocks =\page_set_command_flush_margin_blocks, % not used + ] + \protect \endinput % extreme examples (1) |