summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/page-set.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/page-set.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/page-set.mkiv122
1 files changed, 55 insertions, 67 deletions
diff --git a/Master/texmf-dist/tex/context/base/page-set.mkiv b/Master/texmf-dist/tex/context/base/page-set.mkiv
index cc6fbb5e6d9..8c3566bc087 100644
--- a/Master/texmf-dist/tex/context/base/page-set.mkiv
+++ b/Master/texmf-dist/tex/context/base/page-set.mkiv
@@ -133,28 +133,6 @@
%D \stoptext
%D \stoptyping
-% not ok yet, for column sets we need a special case: within a column we
-% need to bubble-up the marks; the indirectness permits overloading here
-
-\let\saveOTRSETmark \refreshsavedmark
-\let\bubbleOTRSETmark\bubblesavedmark
-\let\resetOTRSETmark \resetsavedmark
-\let\presetOTRSETmark\presetsavedmark
-
-\def\doregisterOTRSETmarks#1{\saveOTRSETmark [#1][\number\mofcolumns]}
-\def\dobubbleOTRSETmarks #1{\bubbleOTRSETmark[#1][\number\mofcolumns]}
-\def\doresetOTRSETmarks #1{\resetOTRSETmark [#1][\recurselevel]}
-\def\dopresetOTRSETmarks #1{\presetOTRSETmark[#1][\recurselevel]}
-
-\def\registerOTRSETmarks
- {\processcommacommand[\alldefinedmarks]\doregisterOTRSETmarks}
-\def\bubbleOTRSETmarks
- {\processcommacommand[\alldefinedmarks]\dobubbleOTRSETmarks}
-\def\resetOTRSETmarks
- {\dorecurse\nofcolumns{\processcommacommand[\alldefinedmarks]\doresetOTRSETmarks}}
-\def\presetOTRSETmarks
- {\dorecurse\nofcolumns{\processcommacommand[\alldefinedmarks]\dopresetOTRSETmarks}}
-
%D test case of Vit Zika (context list):
%D
%D \starttyping
@@ -222,7 +200,7 @@
\box\csname\@otr@:\!!stringb:\recurselevel\endcsname
%\global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname\box\csname\@otr@:\!!stringb:\recurselevel\endcsname
\else
- \emptybox
+ \emptyhbox
%\global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname\emptybox
\expandafter\newbox\csname\@otr@:\!!stringb:\recurselevel\endcsname
\fi
@@ -459,6 +437,7 @@
\vss
\fi}%
\wd\scratchbox\localcolumnwidth % \textwidth
+ \docolumnpagebodymarks{#1}{#2}\recurselevel\scratchbox
\ifcase\columndirection
\hskip\OTRSETgetparameter\c!distance\recurselevel\box\scratchbox
\else
@@ -512,7 +491,6 @@
\def\OTRSETdoflush
{\ifcollectingcontent
- \registerOTRSETmarks
\global\mofcolumns\plusone
\else
\OTRSETdofinalflush
@@ -524,7 +502,6 @@
\OTRSETinitializecolumns
%\OTRSETdoflushfloats
\OTRSETstartnextpage
-\presetOTRSETmarks
\initializecolumntextareas
\fi}
@@ -590,7 +567,7 @@
\doOTRSETsetgridcells
{\copy\placeholderboxe}
\plusone\plusone\nofcolumns\scratchcounter
- \null
+ \emptybox
\fi}
\def\OTRSETsetvsize % snap per sectie (gap here?)
@@ -739,7 +716,7 @@
% 2 = a solution that works ok, is experimental and above
% all messy
-\chardef\OTRSETflushtextmode=0
+\newconstant\OTRSETflushtextmode % will be replaced
\def\OTRSETflushtextsofar
{\ifcase\OTRSETflushtextmode
@@ -861,9 +838,7 @@
{\OTRSETsetfreecells\mofcolumns\columnlastcell
\ifsomefreecolumncells
% okay
- \bubbleOTRSETmarks % not robust because we reenter
\else
- \registerOTRSETmarks % not robust because we reenter
\global\advance\mofcolumns \plusone
\ifnum\mofcolumns>\nofcolumns
\OTRSETdoflush
@@ -1148,7 +1123,7 @@
\pofcolumns \pofcolumns +\currenthcell
\columnmaxcells\preferedrow-\currentvcell{#1}}
-\chardef\OTRSETforcefixedfloats=0
+\newconstant\OTRSETforcefixedfloats
\def\OTRSETstoreincolumnslotHERE#1% fixed column
{\ifcase\OTRSETforcefixedfloats
@@ -1179,9 +1154,9 @@
\ifdim\scratchdimen<\pagegoal
%OTRSETprepareforcolumnslot3{#1}%
%ruledvskip\columnslotspacing\lineheight
- \blank[\columnslotspacing*\v!line]%
+ \blank[\number\columnslotspacing*\v!line]%
\snaptogrid\hbox to \hsize{\hss\box#1\hss}% strange, why the centering
- \blank[\columnslotspacing*\v!line]%
+ \blank[\number\columnslotspacing*\v!line]%
\else
\OTRSETstoreincolumnslotSOMEWHERE2{#1}%
\fi
@@ -1279,7 +1254,7 @@
\OTRSETsavebox{#9}%
\fi}
-\chardef\columnslotspacing \plusone
+\setnewconstant\columnslotspacing\plusone
\def\OTRSETstoreincolumnslot#1% #2 % {method} {box} % alleen last
{% no messing around here
@@ -1333,11 +1308,11 @@
\def\OTRSETsavebox#1% clean up the skips
{\OTRSETunpreparebox{#1}%
- \dofloatssave{text}}
+ \dofloatssave\s!text}
\def\OTRSETresavebox#1% clean up the skips
{\OTRSETunpreparebox{#1}%
- \dofloatsresave{text}}
+ \dofloatsresave\s!text}
\def\OTRSETflushfloatbox % nog verder doorvoeren en meer info in marge
{\iftestfloatbox\ruledhbox\fi{\box\floatbox}}
@@ -1348,10 +1323,10 @@
\doloop
{\ifsomefloatwaiting
\OTRSETskipstart
- \dofloatsgetinfo{text}%
+ \dofloatsgetinfo\s!text
\ifdim\floatwidth>\zeropoint
\!!doneatrue
- \dofloatsflush{text}{1}%
+ \dofloatsflush\s!text{1}%
\dp\floatbox\zeropoint
\OTRSETstoreincolumnslot{TBLR}\floatbox
\if!!donea
@@ -1624,7 +1599,8 @@
\newcounter\columnsetlevel
\let\currentcolumnset\empty
-\chardef\OTRSETfinish\zerocount
+
+\newconditional\OTRSETfinish % never checked
\unexpanded\def\startcolumnset
{\dodoubleempty\dostartcolumnset}
@@ -1632,8 +1608,7 @@
\def\dostartcolumnset[#1][#2]%
{\increment\columnsetlevel\relax
\globallet\localcolumnmaxcells\!!zerocount
- \global\chardef\OTRSETfinish\zerocount
- \resetOTRSETmarks
+ \global\setfalse\OTRSETfinish
\ifnum\columnsetlevel=\plusone
\bgroup
\saveinterlinespace
@@ -1666,7 +1641,7 @@
{\OTRSETdoifcellelse{1}{1}
{\bgroup
\OTRSETcentergridcells
- \chardef\OTRSETbalancemethod\plusone
+ \OTRSETbalancemethod\plusone
\OTRSETreducegridbox
\global\setbox\OTRfinalpagebox\OTRSETmakegridbox
\global\ht\OTRfinalpagebox\textheight % signals output that there is content
@@ -1679,7 +1654,7 @@
{\relax
\ifnum\columnsetlevel=\plusone
\endgraf % needed, else wrong vsize in one par case
- \global\chardef\OTRSETfinish\plusone
+ \global\settrue\OTRSETfinish
% no, extra page \pagebreak % (test on pascal toc)
\dostopcolumnset
\egroup
@@ -1694,7 +1669,7 @@
\box\OTRfinalpagebox
\fi
\fi
- \global\chardef\OTRSETfinish\zerocount
+ \global\setfalse\OTRSETfinish
\ifsomefloatwaiting \setvsize \pagebreak \setvsize \fi
\OTRSETflushleftovers
\else
@@ -1702,7 +1677,7 @@
\fi
\decrement\columnsetlevel\relax}
-\chardef\OTRSETbalancemethod\zerocount
+\newconstant\OTRSETbalancemethod
\def\dostopcolumnset
{%\OTRSETdofinalflushfloats % yes/no
@@ -1761,7 +1736,6 @@
\fi
\vfill
\eject
-\registerOTRSETmarks
% brr, may result in empty page after nicely fit text
% or if left, then lost of first column only text
\ifnum\mofcolumns>\plusone
@@ -1826,15 +1800,15 @@
\getrawnoflines\textheight\xdef\columnmaxcells{\the\noflines}%
% direction
\doifelsevalue{\??mc\OTRSETidentifier\c!direction}\v!right
- {\chardef\columndirection\zerocount}
- {\chardef\columndirection\plusone}%
+ {\columndirection\zerocount}
+ {\columndirection\plusone}%
% balancing
- \chardef\OTRSETbalancemethod\zerocount
+ \OTRSETbalancemethod\zerocount
\processaction
[\getvalue{\??mc\OTRSETidentifier\c!balance}]
- [ \v!yes=>\chardef\OTRSETbalancemethod\plusone,
- \v!top=>\chardef\OTRSETbalancemethod\plustwo,
- \v!bottom=>\chardef\OTRSETbalancemethod\plusthree]}
+ [ \v!yes=>\OTRSETbalancemethod\plusone,
+ \v!top=>\OTRSETbalancemethod\plustwo,
+ \v!bottom=>\OTRSETbalancemethod\plusthree]}
% test:
%
@@ -1925,6 +1899,21 @@
\def\OTRSETinhibitinserts
{\disablenotes}
+% undocumented goodie
+
+\def\definecolumnsethsize#1#2#3#4% will be improved/speed up
+ {\bgroup
+ \def\OTRSETidentifier{#1}%
+ \ifcase\columnsetlevel\relax
+ \mofcolumns\plusone
+ \OTRSETinitializecolumns
+ \OTRSETassignwidths
+ \OTRSETsethsize
+ \fi
+ \!!counta#2\!!countb#3\docalculatecolumnsetspan
+ \expandafter\egroup\expandafter\edef\expandafter
+ #4\expandafter{\the\!!widtha}}
+
% interface to footnotes
\def\OTRSETassignwidths
@@ -2423,7 +2412,7 @@
\def\dodefinecolumnsetspan[#1][#2]%
{%\ifsecondargument
- \defineframedtext
+ \defineframedtext % we can have a parent
[cs:#1]
[\c!frame=\v!off,
\c!before=,
@@ -2477,7 +2466,7 @@
\c!depthcorrection=\v!off,
#2]%
% determine widths
- \!!countc\framedtextparameter{cs:#1}\c!n
+ \!!countc\namedframedtextparameter{cs:#1}\c!n
% \!!countd\numexpr(\nofcolumns-\mofcolumns+\plusone)%
\!!countd\nofcolumns
% n <= n of columns
@@ -2485,7 +2474,7 @@
\advance\!!countd -\mofcolumns
\advance\!!countd \plusone
% n <= n of available columns (alternative a)
- \doif{\framedtextparameter{cs:#1}\c!alternative}\v!a
+ \doif{\namedframedtextparameter{cs:#1}\c!alternative}\v!a
{\ifnum\!!countc>\!!countd \!!countc\!!countd \fi}%
% here it all starts
\setcolumnsetspanhsize\mofcolumns\!!countc % a/b used
@@ -2494,7 +2483,7 @@
\dostartframedtext[cs:#1][\v!none]% geen nils placement
% spoils spacing : \vskip-\struttotal\par\verticalstrut\par
\ifnum\columnsetlevel>\zerocount
- \framedtextparameter{cs:#1}\c!before
+ \namedframedtextparameter{cs:#1}\c!before
\fi
\unexpanded\def\stopcolumnsetspan{\dostopcolumnsetspan{#1}}}
@@ -2504,8 +2493,8 @@
\kern-2\struttotal
\verticalstrut
\ifnum\columnsetlevel>\zerocount
- \doifsomething{\framedtextparameter{cs:#1}\c!after}
- {\framedtextparameter{cs:#1}\c!after
+ \doifsomething{\namedframedtextparameter{cs:#1}\c!after}
+ {\namedframedtextparameter{cs:#1}\c!after
\kern\zeropoint}% otherwise blanks disappear, better be a switch
\else
\endgraf
@@ -2514,16 +2503,15 @@
\egroup
\setbox\scratchbox\frozenhbox to \hsize
{\dontcomplain
- \alignedline{\framedtextparameter{cs:#1}\c!location}\v!middle
- {\lower\strutdepth\box\scratchbox}}%
+ \alignedline{\namedframedtextparameter{cs:#1}\c!location}\v!middle{\lower\strutdepth\box\scratchbox}}%
\dp\scratchbox\zeropoint % else wrong snap insidefloat
%
% to be tested first (strange in grid mode)
%
% \setbox\scratchbox\frozenhbox to \hsize
% {\dontcomplain
-% \chardef\alignstrutmode\zerocount
-% \alignedline{\framedtextparameter{cs:#1}\c!plaats}\v!midden
+% \alignstrutmode\zerocount
+% \alignedline{\namedframedtextparameter{cs:#1}\c!plaats}\v!midden
% {\box\scratchbox}}%
%
\ifinsidefloat
@@ -2531,24 +2519,24 @@
\else\ifnum\columnsetlevel>\zerocount
% we only set \columnsetspacing when asked for, else bottom problems
% don't change this any more (test naw)
- \chardef\columnslotspacing\framedtextparameter{cs:#1}\c!nlines\relax
- % todo: nboven/onder & \chardef\columnslotlocation2
+ \columnslotspacing\namedframedtextparameter{cs:#1}\c!nlines\relax
+ % todo: nboven/onder
%\OTRSETstoreincolumnslotHERE\scratchbox
- \edef\floatmethod{\framedtextparameter{cs:#1}\c!default}%
+ \edef\floatmethod{\namedframedtextparameter{cs:#1}\c!default}%
\@EA\uppercasestring\floatmethod\to\floatmethod
% todo : \v!here -> here enzovoorts
\OTRSETstoreincolumnslot\floatmethod\scratchbox
% watch out: no \dochecknextindentation{tag}
- \checknextindentation[\framedtextparameter{cs:#1}\c!indentnext]%
+ \checknextindentation[\namedframedtextparameter{cs:#1}\c!indentnext]%
\else
% of course we needed a one-column fall back for tm; brrr, the box has now too
% much height (try \ruledvbox); don't change this without testing techniek
\scratchdimen\ht\scratchbox
\advance\scratchdimen-\strutdp
\ht\scratchbox\scratchdimen
- \framedtextparameter{cs:#1}\c!before
+ \namedframedtextparameter{cs:#1}\c!before
\snaptogrid\vbox{\box\scratchbox}%
- \framedtextparameter{cs:#1}\c!after
+ \namedframedtextparameter{cs:#1}\c!after
\fi\fi
\egroup
\endgraf}