summaryrefslogtreecommitdiff
path: root/tex/context/base/page-set.tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/page-set.tex')
-rw-r--r--tex/context/base/page-set.tex46
1 files changed, 27 insertions, 19 deletions
diff --git a/tex/context/base/page-set.tex b/tex/context/base/page-set.tex
index fda87f691..e6b51be42 100644
--- a/tex/context/base/page-set.tex
+++ b/tex/context/base/page-set.tex
@@ -56,9 +56,6 @@
\def\OTRSETgetgridcell#1#2{\box\csname \@otr@:\number#1:\number#2\endcsname}
\def\OTRSETsetgridcell#1#2{\global\setbox\csname\@otr@:\number#1:\number#2\endcsname}
-\long\def\OTRSETdoifcellelse#1#2#3#4%
- {\relax\ifvoid\csname\@otr@:\number#1:\number#2\endcsname#4\else#3\fi}
-
\long\def\OTRSETdoifcellelse#1#2%
{\relax\ifvoid\csname\@otr@:\number#1:\number#2\endcsname
\@EA\secondoftwoarguments\else\@EA\firstoftwoarguments
@@ -1107,72 +1104,80 @@
\def\OTRSETstoreincolumnslotLRTB#1%
{\OTRSETprepareforcolumnslot1{#1}%
-\OTRSETflushtextsofar
+ \OTRSETflushtextsofar
\OTRSETstoreincolumnslotindeed
\mofcolumns\nofcolumns+\currenthcell
\plusone\columnmaxcells+\currentvcell{#1}}
\def\OTRSETstoreincolumnslotLRBT#1%
{\OTRSETprepareforcolumnslot3{#1}%
-\OTRSETflushtextsofar
+ \OTRSETflushtextsofar
\OTRSETstoreincolumnslotindeed
\mofcolumns\nofcolumns+\currenthcell
\columnmaxcells\plusone-\currentvcell{#1}}
\def\OTRSETstoreincolumnslotRLTB#1%
{\OTRSETprepareforcolumnslot1{#1}%
-\OTRSETflushtextsofar
+ \OTRSETflushtextsofar
+ \OTRSETcheckprefered
\OTRSETstoreincolumnslotindeed
\nofcolumns\qofcolumns-\currenthcell
\plusone\columnmaxcells+\currentvcell{#1}}
\def\OTRSETstoreincolumnslotRLBT#1%
{\OTRSETprepareforcolumnslot3{#1}%
-\OTRSETflushtextsofar
+ \OTRSETflushtextsofar
+ \OTRSETcheckprefered
\OTRSETstoreincolumnslotindeed
\nofcolumns\qofcolumns-\currenthcell
\columnmaxcells\plusone-\currentvcell{#1}}
\def\OTRSETstoreincolumnslotTBLR#1%
{\OTRSETprepareforcolumnslot1{#1}%
-\OTRSETflushtextsofar
+ \OTRSETflushtextsofar
\OTRSETstoreincolumnslotindeed
\plusone\columnmaxcells+\currentvcell
\mofcolumns\nofcolumns+\currenthcell{#1}}
\def\OTRSETstoreincolumnslotTBRL#1%
{\OTRSETprepareforcolumnslot1{#1}%
-\OTRSETflushtextsofar
+ \OTRSETflushtextsofar
+ \OTRSETcheckprefered
\OTRSETstoreincolumnslotindeed
\plusone\columnmaxcells+\currentvcell
\nofcolumns\qofcolumns-\currenthcell{#1}}
\def\OTRSETstoreincolumnslotBTLR#1%
{\OTRSETprepareforcolumnslot3{#1}%
-\OTRSETflushtextsofar
+ \OTRSETflushtextsofar
\OTRSETstoreincolumnslotindeed
\columnmaxcells\plusone-\currentvcell
\mofcolumns\nofcolumns+\currenthcell{#1}}
\def\OTRSETstoreincolumnslotBTRL#1%
{\OTRSETprepareforcolumnslot3{#1}%
-\OTRSETflushtextsofar
+ \OTRSETflushtextsofar
+ \OTRSETcheckprefered
\OTRSETstoreincolumnslotindeed
\columnmaxcells\plusone-\currentvcell
\nofcolumns\qofcolumns-\currenthcell{#1}}
\def\OTRSETstoreincolumnslotFXTB#1% fixed column
- {\OTRSETprepareforcolumnslot2{#1}% % 1/2 dependent of place, todo
-\OTRSETflushtextsofar
+ {\OTRSETcheckprefered
+ \OTRSETdoifcellelse\pofcolumns\plusone
+ {\OTRSETprepareforcolumnslot2}{\OTRSETprepareforcolumnslot1}{#1}% % 1/2 dependent of place, todo
+ \OTRSETflushtextsofar
\OTRSETstoreincolumnslotindeed
- \pofcolumns\pofcolumns+\currenthcell
+ \pofcolumns \pofcolumns +\currenthcell
\preferedrow\columnmaxcells+\currentvcell{#1}}
\def\OTRSETstoreincolumnslotFXBT#1% fixed column
- {\OTRSETprepareforcolumnslot2{#1}% % 3/2 dependent on place, todo
-\OTRSETflushtextsofar
+ {\OTRSETcheckprefered
+ \OTRSETdoifcellelse\pofcolumns\columnmaxcells
+ {\OTRSETprepareforcolumnslot2}{\OTRSETprepareforcolumnslot3}{#1}% % 3/2 dependent of place, todo
+ \OTRSETflushtextsofar
\OTRSETstoreincolumnslotindeed
- \pofcolumns\pofcolumns+\currenthcell
+ \pofcolumns \pofcolumns +\currenthcell
\columnmaxcells\preferedrow-\currentvcell{#1}}
% \def\OTRSETstoreincolumnslotHERE#1% fixed column
@@ -1232,7 +1237,7 @@
\noflines\columnmaxcells+\currentvcell{#2}%
\OTRSETsetvsize}
-\def\OTRSETstoreincolumnslotindeed#1#2#3#4#5#6#7#8#9%
+\def\OTRSETcheckprefered
{\ifnum\preferedcolumn<\mofcolumns
\let\pofcolumns\mofcolumns
\else
@@ -1248,7 +1253,10 @@
\fi
\else
\let\qofcolumns\mofcolumns
- \fi
+ \fi}
+
+\def\OTRSETstoreincolumnslotindeed#1#2#3#4#5#6#7#8#9%
+ {\OTRSETcheckprefered
\enoughcolumncellsfalse
\donefalse
\dostepwiserecurse{#1}{#2}{#31}