summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2009-11-30 23:27:00 +0100
committerHans Hagen <pragma@wxs.nl>2009-11-30 23:27:00 +0100
commit6f7cede47fa8d5d3dc7d27a1e39ce3182b1d6821 (patch)
tree01570394fa4a2fd7ebbce51571f312dfe1dd7330
parente55a0f36ef512134e32c0c11b1ede843dd4eb145 (diff)
downloadcontext-6f7cede47fa8d5d3dc7d27a1e39ce3182b1d6821.tar.gz
beta 2009.11.30 23:27
-rw-r--r--scripts/context/lua/mtx-context.lua5
-rw-r--r--scripts/context/lua/mtxrun.lua13
-rwxr-xr-xscripts/context/stubs/mswin/context.exebin5631 -> 6143 bytes
-rwxr-xr-xscripts/context/stubs/mswin/luatools.exebin5631 -> 6143 bytes
-rwxr-xr-xscripts/context/stubs/mswin/metatex.exebin5631 -> 6143 bytes
-rw-r--r--scripts/context/stubs/mswin/mtxrun.dllbin7679 -> 8191 bytes
-rwxr-xr-xscripts/context/stubs/mswin/mtxrun.exebin5631 -> 6143 bytes
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua13
-rwxr-xr-xscripts/context/stubs/mswin/mtxworks.exebin5631 -> 6143 bytes
-rwxr-xr-xscripts/context/stubs/mswin/texexec.exebin5631 -> 6143 bytes
-rwxr-xr-xscripts/context/stubs/mswin/texmfstart.exebin5631 -> 6143 bytes
-rwxr-xr-xscripts/context/stubs/unix/mtxrun13
-rw-r--r--tex/context/base/bibl-tra.mkii24
-rw-r--r--tex/context/base/bibl-tra.mkiv20
-rw-r--r--tex/context/base/cont-new.tex2
-rw-r--r--tex/context/base/context.tex2
-rw-r--r--tex/context/base/l-aux.lua13
-rw-r--r--tex/context/base/page-lin.mkiv8
-rw-r--r--tex/context/base/page-set.mkii362
-rw-r--r--tex/context/base/page-set.mkiv455
-rw-r--r--tex/context/base/scrp-cjk.lua4
-rw-r--r--tex/context/base/strc-des.mkiv36
-rw-r--r--tex/context/base/strc-not.mkiv36
-rw-r--r--tex/context/base/syst-aux.mkiv4
-rw-r--r--tex/context/base/syst-ext.mkii4
-rw-r--r--tex/context/base/type-buy.tex5
-rw-r--r--tex/generic/context/luatex-fonts-merged.lua2
27 files changed, 163 insertions, 858 deletions
diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua
index 2ed661774..c6d15a1b0 100644
--- a/scripts/context/lua/mtx-context.lua
+++ b/scripts/context/lua/mtx-context.lua
@@ -572,18 +572,15 @@ scripts.context.interfaces = {
it = "cont-it",
ro = "cont-ro",
pe = "cont-pe",
- -- for taco and me
- -- xp = "cont-xp",
}
scripts.context.defaultformats = {
"cont-en",
"cont-nl",
--- "cont-xp",
"mptopdf",
-- "metatex",
"metafun",
- "plain"
+-- "plain"
}
local function analyze(filename)
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua
index ceb9cb886..815d97235 100644
--- a/scripts/context/lua/mtxrun.lua
+++ b/scripts/context/lua/mtxrun.lua
@@ -2886,9 +2886,9 @@ function aux.settings_to_hash_strict(str,existing)
end
end
-local seperator = comma * space^0
+local separator = comma * space^0
local value = lpeg.P(lbrace * lpeg.C((nobrace + nested)^0) * rbrace) + lpeg.C((nested + (1-comma))^0)
-local pattern = lpeg.Ct(value*(seperator*value)^0)
+local pattern = lpeg.Ct(value*(separator*value)^0)
-- "aap, {noot}, mies" : outer {} removes, leading spaces ignored
@@ -2907,7 +2907,7 @@ local function set(t,v)
end
local value = lpeg.P(lpeg.Carg(1)*value) / set
-local pattern = value*(seperator*value)^0 * lpeg.Carg(1)
+local pattern = value*(separator*value)^0 * lpeg.Carg(1)
function aux.add_settings_to_array(t,str)
return pattern:match(str, nil, t)
@@ -2958,6 +2958,13 @@ function aux.settings_to_set(str,t)
return t
end
+local value = lbrace * lpeg.C((nobrace + nested)^0) * rbrace
+local pattern = lpeg.Ct((space + value)^0)
+
+function aux.arguments_to_table(str)
+ return pattern:match(str)
+end
+
-- temporary here
function aux.getparameters(self,class,parentclass,settings)
diff --git a/scripts/context/stubs/mswin/context.exe b/scripts/context/stubs/mswin/context.exe
index 968f672b6..a05675280 100755
--- a/scripts/context/stubs/mswin/context.exe
+++ b/scripts/context/stubs/mswin/context.exe
Binary files differ
diff --git a/scripts/context/stubs/mswin/luatools.exe b/scripts/context/stubs/mswin/luatools.exe
index 968f672b6..a05675280 100755
--- a/scripts/context/stubs/mswin/luatools.exe
+++ b/scripts/context/stubs/mswin/luatools.exe
Binary files differ
diff --git a/scripts/context/stubs/mswin/metatex.exe b/scripts/context/stubs/mswin/metatex.exe
index 968f672b6..a05675280 100755
--- a/scripts/context/stubs/mswin/metatex.exe
+++ b/scripts/context/stubs/mswin/metatex.exe
Binary files differ
diff --git a/scripts/context/stubs/mswin/mtxrun.dll b/scripts/context/stubs/mswin/mtxrun.dll
index f8e720f55..12d38d5ca 100644
--- a/scripts/context/stubs/mswin/mtxrun.dll
+++ b/scripts/context/stubs/mswin/mtxrun.dll
Binary files differ
diff --git a/scripts/context/stubs/mswin/mtxrun.exe b/scripts/context/stubs/mswin/mtxrun.exe
index 968f672b6..a05675280 100755
--- a/scripts/context/stubs/mswin/mtxrun.exe
+++ b/scripts/context/stubs/mswin/mtxrun.exe
Binary files differ
diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua
index ceb9cb886..815d97235 100644
--- a/scripts/context/stubs/mswin/mtxrun.lua
+++ b/scripts/context/stubs/mswin/mtxrun.lua
@@ -2886,9 +2886,9 @@ function aux.settings_to_hash_strict(str,existing)
end
end
-local seperator = comma * space^0
+local separator = comma * space^0
local value = lpeg.P(lbrace * lpeg.C((nobrace + nested)^0) * rbrace) + lpeg.C((nested + (1-comma))^0)
-local pattern = lpeg.Ct(value*(seperator*value)^0)
+local pattern = lpeg.Ct(value*(separator*value)^0)
-- "aap, {noot}, mies" : outer {} removes, leading spaces ignored
@@ -2907,7 +2907,7 @@ local function set(t,v)
end
local value = lpeg.P(lpeg.Carg(1)*value) / set
-local pattern = value*(seperator*value)^0 * lpeg.Carg(1)
+local pattern = value*(separator*value)^0 * lpeg.Carg(1)
function aux.add_settings_to_array(t,str)
return pattern:match(str, nil, t)
@@ -2958,6 +2958,13 @@ function aux.settings_to_set(str,t)
return t
end
+local value = lbrace * lpeg.C((nobrace + nested)^0) * rbrace
+local pattern = lpeg.Ct((space + value)^0)
+
+function aux.arguments_to_table(str)
+ return pattern:match(str)
+end
+
-- temporary here
function aux.getparameters(self,class,parentclass,settings)
diff --git a/scripts/context/stubs/mswin/mtxworks.exe b/scripts/context/stubs/mswin/mtxworks.exe
index 968f672b6..a05675280 100755
--- a/scripts/context/stubs/mswin/mtxworks.exe
+++ b/scripts/context/stubs/mswin/mtxworks.exe
Binary files differ
diff --git a/scripts/context/stubs/mswin/texexec.exe b/scripts/context/stubs/mswin/texexec.exe
index 968f672b6..a05675280 100755
--- a/scripts/context/stubs/mswin/texexec.exe
+++ b/scripts/context/stubs/mswin/texexec.exe
Binary files differ
diff --git a/scripts/context/stubs/mswin/texmfstart.exe b/scripts/context/stubs/mswin/texmfstart.exe
index 968f672b6..a05675280 100755
--- a/scripts/context/stubs/mswin/texmfstart.exe
+++ b/scripts/context/stubs/mswin/texmfstart.exe
Binary files differ
diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun
index ceb9cb886..815d97235 100755
--- a/scripts/context/stubs/unix/mtxrun
+++ b/scripts/context/stubs/unix/mtxrun
@@ -2886,9 +2886,9 @@ function aux.settings_to_hash_strict(str,existing)
end
end
-local seperator = comma * space^0
+local separator = comma * space^0
local value = lpeg.P(lbrace * lpeg.C((nobrace + nested)^0) * rbrace) + lpeg.C((nested + (1-comma))^0)
-local pattern = lpeg.Ct(value*(seperator*value)^0)
+local pattern = lpeg.Ct(value*(separator*value)^0)
-- "aap, {noot}, mies" : outer {} removes, leading spaces ignored
@@ -2907,7 +2907,7 @@ local function set(t,v)
end
local value = lpeg.P(lpeg.Carg(1)*value) / set
-local pattern = value*(seperator*value)^0 * lpeg.Carg(1)
+local pattern = value*(separator*value)^0 * lpeg.Carg(1)
function aux.add_settings_to_array(t,str)
return pattern:match(str, nil, t)
@@ -2958,6 +2958,13 @@ function aux.settings_to_set(str,t)
return t
end
+local value = lbrace * lpeg.C((nobrace + nested)^0) * rbrace
+local pattern = lpeg.Ct((space + value)^0)
+
+function aux.arguments_to_table(str)
+ return pattern:match(str)
+end
+
-- temporary here
function aux.getparameters(self,class,parentclass,settings)
diff --git a/tex/context/base/bibl-tra.mkii b/tex/context/base/bibl-tra.mkii
index 59783e139..087781db9 100644
--- a/tex/context/base/bibl-tra.mkii
+++ b/tex/context/base/bibl-tra.mkii
@@ -1041,21 +1041,27 @@
%D \type{\cite} commands with a braced argument (these might appear
%D in included data from the \type{.bib} file).
+% \unexpanded\def\cite
+% {\doifnextcharelse{[}
+% {\dodocite}
+% {\dobibref}}
+% \def\dobibref#1%
+% {\docite[#1][]}
+% \def\dodocite[#1]%
+% {\startstrictinspectnextcharacter
+% \dodoubleempty\dododocite[#1]}
+% \def\dododocite[#1][#2]{%
+% \stopstrictinspectnextcharacter
+% \docite[#1][#2]}
+
\unexpanded\def\cite
- {\doifnextcharelse{[}
- {\dodocite}
- {\dobibref}}
+ {\strictdoifnextoptionalelse\dodocite\dobibref}
\def\dobibref#1%
{\docite[#1][]}
\def\dodocite[#1]%
- {\startstrictinspectnextcharacter
- \dodoubleempty\dododocite[#1]}
-
-\def\dododocite[#1][#2]{%
- \stopstrictinspectnextcharacter
- \docite[#1][#2]}
+ {\strictdoifnextoptionalelse{\docite[#1]}{\docite[#1][]}}
\def\docite[#1][#2]%
{\begingroup
diff --git a/tex/context/base/bibl-tra.mkiv b/tex/context/base/bibl-tra.mkiv
index 936f310be..9648c068a 100644
--- a/tex/context/base/bibl-tra.mkiv
+++ b/tex/context/base/bibl-tra.mkiv
@@ -939,19 +939,25 @@
%D \type{\cite} commands with a braced argument (these might appear
%D in included data from the \type{.bib} file).
+% \unexpanded\def\cite
+% {\doifnextoptionalelse\dodocite\dobibref}
+% \def\dobibref#1%
+% {\docite[#1][]}
+% \def\dodocite[#1]%
+% {\startstrictinspectnextcharacter
+% \dodoubleempty\dododocite[#1]}
+% \def\dododocite % [#1][#2]
+% {\stopstrictinspectnextcharacter
+% \docite}
+
\unexpanded\def\cite
- {\doifnextoptionalelse\dodocite\dobibref}
+ {\strictdoifnextoptionalelse\dodocite\dobibref}
\def\dobibref#1%
{\docite[#1][]}
\def\dodocite[#1]%
- {\startstrictinspectnextcharacter
- \dodoubleempty\dododocite[#1]}
-
-\def\dododocite % [#1][#2]
- {\stopstrictinspectnextcharacter
- \docite}
+ {\strictdoifnextoptionalelse{\docite[#1]}{\docite[#1][]}}
\def\docite[#1][#2]%
{\begingroup
diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex
index aab4c7e01..2824ce6c4 100644
--- a/tex/context/base/cont-new.tex
+++ b/tex/context/base/cont-new.tex
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2009.11.26 16:28}
+\newcontextversion{2009.11.30 23:27}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex
index d2c49e60c..e0af24721 100644
--- a/tex/context/base/context.tex
+++ b/tex/context/base/context.tex
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2009.11.27 21:24}
+\edef\contextversion{2009.11.30 23:27}
%D For those who want to use this:
diff --git a/tex/context/base/l-aux.lua b/tex/context/base/l-aux.lua
index c577fb104..e422a2313 100644
--- a/tex/context/base/l-aux.lua
+++ b/tex/context/base/l-aux.lua
@@ -89,9 +89,9 @@ function aux.settings_to_hash_strict(str,existing)
end
end
-local seperator = comma * space^0
+local separator = comma * space^0
local value = lpeg.P(lbrace * lpeg.C((nobrace + nested)^0) * rbrace) + lpeg.C((nested + (1-comma))^0)
-local pattern = lpeg.Ct(value*(seperator*value)^0)
+local pattern = lpeg.Ct(value*(separator*value)^0)
-- "aap, {noot}, mies" : outer {} removes, leading spaces ignored
@@ -110,7 +110,7 @@ local function set(t,v)
end
local value = lpeg.P(lpeg.Carg(1)*value) / set
-local pattern = value*(seperator*value)^0 * lpeg.Carg(1)
+local pattern = value*(separator*value)^0 * lpeg.Carg(1)
function aux.add_settings_to_array(t,str)
return pattern:match(str, nil, t)
@@ -161,6 +161,13 @@ function aux.settings_to_set(str,t)
return t
end
+local value = lbrace * lpeg.C((nobrace + nested)^0) * rbrace
+local pattern = lpeg.Ct((space + value)^0)
+
+function aux.arguments_to_table(str)
+ return pattern:match(str)
+end
+
-- temporary here
function aux.getparameters(self,class,parentclass,settings)
diff --git a/tex/context/base/page-lin.mkiv b/tex/context/base/page-lin.mkiv
index e17cdea50..fc813953f 100644
--- a/tex/context/base/page-lin.mkiv
+++ b/tex/context/base/page-lin.mkiv
@@ -257,6 +257,8 @@
\expandafter\mkdoinnerlinenumber
\or
\expandafter\mkdoouterlinenumber
+ \or
+ \expandafter\mkdotextlinenumber
\fi}
\def\mkrightlinenumber
@@ -270,6 +272,8 @@
\expandafter\mkdoouterlinenumber
\or
\expandafter\mkdoinnerlinenumber
+ \or
+ \expandafter\mkdorightlinenumber
\fi}
\def\mkaddtextlinenumbers#1#2#3% box col max
@@ -293,6 +297,7 @@
\or % outer
\let\makenumber\mkdoouterlinenumber
\or % text
+ \let\makenumber\mkdotextlinenumber
\fi
\else\ifcase#2\relax
\let\makenumber\mkskiplinenumber
@@ -324,6 +329,9 @@
\mkprocesstextlinenumbers{#1}%
\egroup}
+\def\mkdotextlinenumber #1#2#3#4#5% beware, one needs so compensate for this in the width !
+ {\hbox{\dosomelinenumber{#1}{2}{#2}{#5}\hskip#3\scaledpoint}}
+
\def\mkdoleftlinenumber #1#2#3#4#5%
{\hbox{\llap{\dosomelinenumber{#1}{2}{#2}{#5}\hskip#3\scaledpoint}}}
diff --git a/tex/context/base/page-set.mkii b/tex/context/base/page-set.mkii
index b8a075179..6724ca979 100644
--- a/tex/context/base/page-set.mkii
+++ b/tex/context/base/page-set.mkii
@@ -545,26 +545,9 @@
%\gdef\localcolumnmaxcells{0}% here ?
\global\mofcolumns\nofcolumns} % otherwise problems in finaloutput
-% \def\OTRSETdofinaloutput
-% {\ifdim\ht\OTRfinalpagebox=\teksthoogte
-% % \bgroup \let\OTRSETsetvsize\relax % prevents useless search for gap
-% \ifcase\OTRSETbalancemethod
-% \finaloutput\box\OTRfinalpagebox
-% \else\ifdim\OTRSETbalht>\zeropoint
-% \global\setbox\OTRfinalpagebox \iftracecolumnset\ruledvbox\else\vbox\fi to \OTRSETbalht
-% {\box\OTRfinalpagebox}%
-% \global\dp\OTRfinalpagebox\strutdepth
-% \box\OTRfinalpagebox
-% \else
-% \finaloutput\box\OTRfinalpagebox
-% \fi \fi
-% \globallet\OTRSETbalht\zeropoint
-% % \egroup
-% \fi}
-
\def\OTRSETdofinaloutput
{\ifdim\ht\OTRfinalpagebox=\textheight
- \bgroup % \let\OTRSETsetvsize\relax % prevents useless search for gap
+ \bgroup % \let\OTRSETsetvsize\relax % prevents useless search for gap
\ifcase\OTRSETbalancemethod
\finaloutput\box\OTRfinalpagebox
\else\ifdim\OTRSETbalht>\zeropoint
@@ -585,7 +568,7 @@
\finaloutput\box\OTRfinalpagebox
\fi \fi
\globallet\OTRSETbalht\zeropoint
- \egroup
+ \egroup
\fi}
\definesystemvariable {mc}
@@ -1784,66 +1767,6 @@
\def\localcolumnmaxcells{0}
-% currently line represents real line, i.e. on the grid, and
-% not something noflines (also, watch out for switching from
-% 2-3 columns on one page with both sets balanced: the
-% second set does not see the first set
-
-% \def\OTRSETinitbalancing
-% {\ifcase\OTRSETbalancemethod\or
-% \let\savedcolumnmaxcells\columnmaxcells
-% \ifnum\realpageno=\balancingpageno\relax
-% \ifnum\mofcolumns=\plusone
-% \dorecurse\nofcolumns
-% {\!!counta\recurselevel\relax
-% \!!countb\getvalue{\??mc\OTRSETidentifier\number\!!counta\c!regels}\relax
-% \ifcase\!!countb
-% \!!countb\getvalue{\??mc\OTRSETidentifier\c!regels}\relax
-% \fi
-% \ifcase\!!countb
-% \!!countb \savedcolumnmaxcells\relax
-% \fi
-% % can be an option: absolute versus relative
-% \ifnum\OTRSETbalancemethod=\plusthree
-% \advance\!!countb\precolumnlines
-% \ifnum\!!countb>\localcolumnmaxcells\relax
-% \xdef\localcolumnmaxcells{\the\!!countb}%
-% \fi
-% \advance\!!countb \plusone
-% \dostepwiserecurse\!!countb\columnmaxcells\plusone
-% {\ifvoid\OTRSETgridcell\!!counta\recurselevel
-% \OTRSETsetgridcell\!!counta\recurselevel\copy\placeholderboxe
-% \fi}%
-% \else
-% \globallet\localcolumnmaxcells\columnmaxcells
-% \advance\!!countb-\columnmaxcells
-% \!!countb-\!!countb
-% \advance\!!countb \minusone
-% \ifnum\!!countb>\zerocount
-% \dostepwiserecurse\plusone\!!countb\plusone
-% {\ifvoid\OTRSETgridcell\!!counta\recurselevel
-% \OTRSETsetgridcell\!!counta\recurselevel\copy\placeholderboxe
-% \fi}%
-% \fi
-% \fi}%
-% \OTRSETsetvsize % ! ! !
-% \fi
-% \fi
-% \fi}
-%
-% \def\OTRSETpresetbalancing
-% {\doifvaluesomething{\??mc\OTRSETidentifier\c!regels}%
-% {\getcommacommandsize[\csname\??mc\OTRSETidentifier\c!regels\endcsname]%
-% \ifnum\commalistsize>\plusone
-% \scratchcounter\zerocount
-% \def\docommand##1%
-% {\advance\scratchcounter\plusone
-% \setvalue{\??mc\OTRSETidentifier\the\scratchcounter\c!regels}{##1}}%
-% \processcommacommand
-% [\csname\??mc\OTRSETidentifier\c!regels\endcsname]\docommand
-% \setvalue{\??mc\OTRSETidentifier\c!regels}{0}%
-% \fi}}
-
% don't loose empty 1page/1column with area (example **)
%
% \definecolumntextarea[title][x=1,y=4,nx=2,ny=7,state=start]
@@ -1859,32 +1782,6 @@
\def\setupcolumnsetarea {\setupcolumntextarea}
\def\setupcolumnsetareatext{\setupcolumntextareatext}
-% so this will be changed
-
-% \def\OTRSETnobalance
-% {\iflastcolumnfootnotes % testen ! optie
-% % inhibit flush of floats !
-% % todo: nothing if no footnotes, else empty page
-% \dostepwiserecurse\mofcolumns\nofcolumns\plusone
-% {\vskip-\struttotal\verticalstrut\vfill\eject}%
-% \else
-% \ifdim\pagetotal>\zeropoint % no, see example **
-% \ifnum\mofcolumns=\nofcolumns
-% \OTRSETflushfinalfootnotes
-% \else
-% % probably todo
-% \fi
-% \vfill
-% \eject
-% % brr, may result in empty page after nicely fit text
-% % or if left, then lost of first column only text
-% \ifnum\mofcolumns>1
-% \OTRSETdofinalflush
-% \OTRSETdofinaloutput
-% \fi
-% \fi
-% \fi}
-
\def\OTRSETnobalance
{\iflastcolumnfootnotes % testen ! optie
% inhibit flush of floats !
@@ -2037,31 +1934,12 @@
% test:
%
-% \definecolumnset[two] [n=2,balance=yes]
-% \definecolumnset[three][n=3,balance=yes]
-% \setupcolumnset [two] [1] [lines=10]
-% \setupcolumnset [two] [2] [lines=10]
-%
-% \startcolumnset[two] \dorecurse{14}{\input tufte \par} \stopcolumnset
-% \startcolumnset[three] \dorecurse{12}{\input tufte \par} \stopcolumnset
-%
-% with:
-%
-% \installoutput\OTRSETflushpreposttext
-% {%\ifvoid\normalpagebox
-% % \global\setbox\precolumnbox\vbox{}%
-% %\else
-% \global\setbox\precolumnbox\vbox
-% {\unvcopy\normalpagebox}%
-% \global\setbox\precolumnbox\vbox to \ht\precolumnbox
-% {\box\normalpagebox}%
-% %\fi
-% \global\dp\precolumnbox\strutdepth
-% \ifcarryoverfootnotes \else
-% \global\setbox\postcolumnbox\vbox{\placebottomnotes}%
-% \fi}
-
-% testcase : pascal demo-bbi, paragraaf/aanduiding koppen
+% \setupcolumnset [test-1] [balance=yes]
+% \setupcolumnset [test-2] [balance=yes]
+% \setupcolumnsetlines[test-1][1][1] [8]
+% \setupcolumnsetlines[test-1][1][2][10]
+% \startcolumnset [test-1] \dorecurse {1}{\input tufte \par} \stopcolumnset
+% \startcolumnset [test-2] \dorecurse {2}{\input ward \par} \stopcolumnset
\ifx\lastskipinotr\undefined \newskip\lastskipinotr \fi
@@ -2081,30 +1959,6 @@
\let\precolumnlines \!!zerocount
\let\postcolumnlines\!!zerocount
-% \def\OTRSEThandlepreposttext
-% {\ifdim\ht\precolumnbox>\zeropoint % new
-% \getnoflines{\ht\precolumnbox}%
-% \edef\precolumnlines{\the\noflines}%
-% \doOTRSETsetgridcells
-% {\copy\placeholderboxe}
-% \plusone\plusone\nofcolumns\noflines
-% {\box\precolumnbox}%
-% \else
-% \let\precolumnlines\!!zerocount
-% \fi
-% \ifdim\ht\postcolumnbox>\zeropoint % new, otherwise empty bottom line
-% \getnoflines{\ht\postcolumnbox}%
-% \edef\postcolumnlines{\the\noflines}%
-% \advance\columnfreecells -\noflines
-% \advance\columnfreecells \plusone
-% \doOTRSETsetgridcells
-% {\copy\placeholderboxe}
-% \plusone\columnfreecells\nofcolumns\noflines
-% {\box\postcolumnbox}%
-% \else
-% \let\postcolumnlines\!!zerocount
-% \fi}
-
\def\OTRSEThandlepreposttext
{\ifdim\ht\precolumnbox>\zeropoint % new
\getnoflines{\ht\precolumnbox}%
@@ -2798,206 +2652,6 @@
% \startcolumnsetspan[two] \input tufte \stopcolumnsetspan
% \stopcolumnset
-% We need to set the \dimen globally since we are in the
-% OTR. Unfortunately this interferes with local settings,
-% although we may assume that they will not cross page
-% boundaries.
-
-\def\OTRSETcheckcontent
- {\bgroup
- \donefalse
- \def\OTRSETcheckcontent##1%
- {\setbox\scratchbox##1\recurselevel
- \setbox\scratchbox\vbox{\unvbox\scratchbox}%
- \ifdim\ht\scratchbox>\zeropoint\donetrue\fi}%
- \dorecurse{\nofcolumns}
- {\OTRSETcheckcontent\columngettextbox
- \OTRSETcheckcontent\columngetfootbox
- \OTRSETcheckcontent\columngettopbox
- \OTRSETcheckcontent\columngetbotbox}%
- \ifdone\egroup\donefalse\else\egroup\donetrue\fi}
-
-\def\OTRSETgetcolumntextheight#1% max - boven - top
- {\scratchdimen=\OTRSETgetparameter\c!maxhoogte#1%
- \advance\scratchdimen -\OTRSETgetparameter\c!bovenoffset#1%
- \advance\scratchdimen -\ht\columntopbox#1%
- \advance\scratchdimen -\getvalue{\??mc\number\mofcolumns-f}%
- \advance\scratchdimen -\ht\columnbotbox#1} % not used
-
-\def\OTRSETgetcolumnnaturalheight#1% max - boven - top
- {\setbox\scratchbox\vbox{\unvcopy\columntextbox#1}%
- \scratchdimen\ht\scratchbox
- \advance\scratchdimen \OTRSETgetparameter\c!bovenoffset#1%
- \advance\scratchdimen \ht\columntopbox#1%
- \advance\scratchdimen -\getvalue{\??mc\number\mofcolumns-f}%
- \advance\scratchdimen \ht\columnbotbox#1} % not used
-
-\def\OTRSETdobalance% splitten in met en zonder footnotes
- {\bgroup
- \maxdeadcycles=1000
- % collect content and notes
- \bgroup
- \OTRSEToutput
- {\global\setbox1\vbox{\unvbox\normalpagebox}%
- \global\setbox3\vbox{\unvbox\footins}}%
- \verticalstrut\vskip-\struttotal % makes footnotes flush
- \eject
- \global\collectingcontentfalse
- % check for footnotes only
- \ifdim\ht1<\topskip % real dirty
- \global\setbox1=\vbox{}
- % fix height of first line
- \ifdim\ht3>\!!zeropoint
- \global\setbox3\vbox
- {\setfootnotebodyfont
- \kern-\strutht
- \kern\topskip
- \unvbox3}
- \fi
- % prepare trial box
- \global\setbox5\vbox
- {\ifdim\ht1>\zeropoint
- \unvcopy1 \ifdim\ht3>\zeropoint \kern\skip\footins \fi
- \fi
- \ifdim\ht3>\zeropoint \unvcopy3 \fi}
- \egroup
- % erase old stuff
- \columnerasetextboxes
- \columnerasefootboxes
- % prepare floats
- \OTRSETdotopinsertions
- \OTRSETdobotinsertions % not used can be removed
- % calculate available space
- \!!heighta\zeropoint % available total height
- \dorecurse{\nofcolumns}
- {\OTRSETgetcolumntextheight\recurselevel
- \OTRSETcalculatelines\scratchdimen
- \advance\!!heighta \scratchdimen}
- % quick check
- \ifdim\ht5>\!!heighta
- % use normal routine
- \columnerasetextboxes
- \columnerasefootboxes
- % TEMP, TODO, FORCE NEXT PASS !
- \unvbox1
- \unvbox3
- \doglobal\addtocommalist{-\realfolio}\OTRSETbalancinglist
- \donefalse
- %\writestatus\m!columns{no balancing, text overflows height}%
- \else\ifdim\ht5>\zeropoint \relax
- % some text and/or notes
- \donetrue
- \else
- \donefalse
- \dorecurse\nofcolumns
- {\ifdim\ht\columntopbox\recurselevel>\zeropoint \donetrue \fi}%
- \ifdone
- % no text and notes, but figures
- \else
- % no text, no notes, no figures
- \doglobal\addtocommalist{-\realfolio}\OTRSETbalancinglist
- \writestatus\m!columns{no balancing, nothing to be placed}%
- \fi
- \fi\fi
- \ifdone
- \ifdim\ht5>\zeropoint \relax
- % balancing text and notes
- %\writestatus\m!columns{text may fit, balancing}%
- \newcounter\loopcounter
- \newcounter\balancinglines
- \doloop
- {\increment\loopcounter\relax
- % initialize
- \columnerasetextboxes
- \columnerasefootboxes
- \setbox0=\copy5
- \splittopskip\topskip
- % pre-split loop and quality calculation
- %\writestatus\m!columns{pass \loopcounter: correction -\balancinglines}
- \dorecurse\nofcolumns
- {\OTRSETgetcolumntextheight\recurselevel
- \OTRSETcalculatelines\scratchdimen
- \!!heightc\scratchdimen
- \ifnum\recurselevel<\nofcolumns
- \advance\!!heightc -\balancinglines\lineheight
- \fi
- \columnsettextbox\recurselevel\vsplit0 to \!!heightc}
- % just one method
- \OTRSETgetcolumnnaturalheight1 \dimen4\scratchdimen
- \OTRSETgetcolumnnaturalheight\nofcolumns \dimen6\scratchdimen
- %\writestatus\m!columns{first column: \the\dimen4}%
- %\writestatus\m!columns{last column: \the\dimen6}%
- \ifdim\dimen4=\dimen6
- \donetrue % perfect balance
- \else\ifdim\dimen4>\dimen6
- \donefalse % not yet good enough
- \increment\balancinglines % try again
- \edef\balancingcount{\the\!!counta}
- \else
- \donetrue % worse balance
- \ifnum\balancinglines>0 % take previous
- \decrement\balancinglines
- \fi
- \fi\fi
- % extra check
- % \ifdim\ht0>\zeropoint\relax \donefalse \fi
- % another check
- \ifdone
- %\writestatus\m!columns{balancing finished in pass \loopcounter}%
- \else \ifnum\loopcounter>100 \donetrue
- %\writestatus\m!columns{balancing aborted after pass \loopcounter}%
- \else
- %\writestatus\m!columns{balancing continued after pass \loopcounter}%
- \fi \fi
- % final balancing pass
- \ifdone
- \setbox0\copy1
- \setbox2\copy3
- \columnerasetextboxes
- \columnerasefootboxes
- \dorecurse\nofcolumns
- {\OTRSETgetcolumntextheight\recurselevel
- \OTRSETcalculatelines\scratchdimen
- \!!heightc\scratchdimen
- \ifnum\recurselevel<\nofcolumns
- \advance\!!heightc -\balancinglines\lineheight
- \fi
- % split off text
- \ifdim\ht0>\zeropoint
- \columnsettextbox\recurselevel\vsplit0 to \!!heightc
- \setbox4\vbox{\unvcopy\columntextbox\recurselevel}
- \advance\!!heightc -\ht4
- \ifdim\ht0>\zeropoint
- \columnsettextbox\recurselevel\box4
- \advance\!!heightc \skip\footins
- \fi
- \fi
- % split off footnotes
- \ifdim\ht0>\zeropoint\relax \else
- \ifdim\ht2>\zeropoint\relax
- \setbox4\vsplit2 to \!!heightc
- \setbox\footins=\vbox{\unvbox4} % ugly and dirty trick
- \ifdim\ht\columntextbox\recurselevel=\zeropoint\relax
- \columnsettextbox\recurselevel\hbox
- {\raise\strutdp\hbox % ugly but needed
- {\setfootnotebodyfont % both these moves
- \lower\strutdp\hbox{\placebottomnotes}}}
- \else
- \columnsetfootbox\recurselevel\hbox{\placebottomnotes}
- \fi
- \fi
- \fi}
- \exitloop
- \fi}
- \else
- % no reason to balance floats
- \fi
- \fi
- \doglobal\addtocommalist{\realfolio}\OTRSETbalancinglist
- \OTRSETdoflush
- \fi
- \egroup}
-
\protect \endinput
% extreme examples (1)
diff --git a/tex/context/base/page-set.mkiv b/tex/context/base/page-set.mkiv
index 0fceea1c4..7e825d76d 100644
--- a/tex/context/base/page-set.mkiv
+++ b/tex/context/base/page-set.mkiv
@@ -541,23 +541,6 @@
%\gdef\localcolumnmaxcells{0}% here ?
\global\mofcolumns\nofcolumns} % otherwise problems in finaloutput
-% \def\OTRSETdofinaloutput
-% {\ifdim\ht\OTRfinalpagebox=\teksthoogte
-% % \bgroup \let\OTRSETsetvsize\relax % prevents useless search for gap
-% \ifcase\OTRSETbalancemethod
-% \finaloutput\box\OTRfinalpagebox
-% \else\ifdim\OTRSETbalht>\zeropoint
-% \global\setbox\OTRfinalpagebox \iftracecolumnset\ruledvbox\else\vbox\fi to \OTRSETbalht
-% {\box\OTRfinalpagebox}%
-% \global\dp\OTRfinalpagebox\strutdepth
-% \box\OTRfinalpagebox
-% \else
-% \finaloutput\box\OTRfinalpagebox
-% \fi \fi
-% \globallet\OTRSETbalht\zeropoint
-% % \egroup
-% \fi}
-
\def\OTRSETdofinaloutput
{\ifdim\ht\OTRfinalpagebox=\textheight
\bgroup % \let\OTRSETsetvsize\relax % prevents useless search for gap
@@ -923,36 +906,6 @@
\appendtoks
\OTRSETfillgapsbetweencells\mofcolumns\plusone
\to \OTRSETeverystartofcolumn
-
-%\def\OTRSETfreezeminimumgap#1%
-% {\OTRSETgetmaxfreecells{#1}{1}%
-% \ifnum\columnmaxfreecells>0
-% \!!countb=\columnfrmfreecells
-% \!!counta=\!!counta \advance\!!counta -\columnmaxfreecells
-% \dorecurse{\columnmaxcells}
-% {\ifnum\recurselevel<\!!counta\relax
-% \donetrue
-% \else\ifnum\recurselevel>\!!countb
-% \donetrue
-% \else
-% \donefalse
-% \fi\fi
-% \ifdone
-% \OTRSETdoifcellelse{#1}{\recurselevel}
-% {}{\OTRSETsetgridcell{#1}\recurselevel\copy\placeholderboxc}%
-% \fi}%
-% \fi}
-%
-%\def\OTRSETfillgaps#1#2#3% col from to
-% {\dostepwiserecurse{#2}{#3}{1}
-% {\OTRSETdoifcellelse{#1}{\recurselevel}
-% {}{\OTRSETsetgridcell{#1}\recurselevel\copy\placeholderboxc}}}
-%
-%\def\OTRSETfillbotgaps#1#2% col first
-% {\OTRSETfillgaps{#1}{#2}{\columnmaxcells}}
-%
-%\def\OTRSETfilltopgaps#1#2% col last
-% {\OTRSETfillgaps{#1}{1}{#2}}
\newif\ifspancolumnslots \spancolumnslotstrue
\newif\ifcheckcolumnspan \checkcolumnspantrue
@@ -1195,15 +1148,6 @@
\pofcolumns \pofcolumns +\currenthcell
\columnmaxcells\preferedrow-\currentvcell{#1}}
-% \def\OTRSETstoreincolumnslotHERE#1% fixed column
-% {\OTRSETprepareforcolumnslot2{#1}%
-% \OTRSETflushtextsofar
-% \getnoflines\pagetotal \advance\noflines\columnfirstcell
-% \OTRSETstoreincolumnslotindeed
-% \mofcolumns\mofcolumns+\currenthcell
-% \noflines\columnmaxcells+\currentvcell{#1}%
-% \OTRSETsetvsize}
-
\chardef\OTRSETforcefixedfloats=0
\def\OTRSETstoreincolumnslotHERE#1% fixed column
@@ -1354,15 +1298,6 @@
\def\OTRSETstoreincolumnslotUNKNOWN#1%
{\OTRSETprepareforcolumnslot2{#1}\copy#1} % {} ?
-% \def\OTRSETprepareforcolumnslot#1#2% 1=hoog 2=midden 3=laag
-% {\dp#2\zeropoint
-% \ifcase\columnslotspacing\else
-% \scratchdimen\columnslotspacing\lineheight
-% \ifnum#1=2 \scratchdimen2\scratchdimen \fi
-% \setbox#2\vbox spread \scratchdimen
-% {\ifnum#1>1\vss\fi\box#2\relax\ifnum#1<3\vss\fi}%
-% \fi}
-
\def\OTRSETprepareforcolumnslot#1#2% 1=hoog 2=midden 3=laag
{\dp#2\zeropoint
\ifcase\columnslotspacing\else
@@ -1724,7 +1659,6 @@
% \input knuth \endgraf \input knuth
% \stoptext
-
\def\OTRSETflushleftovers % new per 13/4/2006
{\OTRSETdoifcellelse{1}{1}
{\bgroup
@@ -1785,61 +1719,6 @@
% 2-3 columns on one page with both sets balanced: the
% second set does not see the first set
-% \def\OTRSETinitbalancing
-% {\ifcase\OTRSETbalancemethod\or
-% \let\savedcolumnmaxcells\columnmaxcells
-% \ifnum\realpageno=\balancingpageno\relax
-% \ifnum\mofcolumns=\plusone
-% \dorecurse\nofcolumns
-% {\!!counta\recurselevel\relax
-% \!!countb\getvalue{\??mc\OTRSETidentifier\number\!!counta\c!regels}\relax
-% \ifcase\!!countb
-% \!!countb\getvalue{\??mc\OTRSETidentifier\c!regels}\relax
-% \fi
-% \ifcase\!!countb
-% \!!countb \savedcolumnmaxcells\relax
-% \fi
-% % can be an option: absolute versus relative
-% \ifnum\OTRSETbalancemethod=\plusthree
-% \advance\!!countb\precolumnlines
-% \ifnum\!!countb>\localcolumnmaxcells\relax
-% \xdef\localcolumnmaxcells{\the\!!countb}%
-% \fi
-% \advance\!!countb \plusone
-% \dostepwiserecurse\!!countb\columnmaxcells\plusone
-% {\ifvoid\OTRSETgridcell\!!counta\recurselevel
-% \OTRSETsetgridcell\!!counta\recurselevel\copy\placeholderboxe
-% \fi}%
-% \else
-% \globallet\localcolumnmaxcells\columnmaxcells
-% \advance\!!countb-\columnmaxcells
-% \!!countb-\!!countb
-% \advance\!!countb \minusone
-% \ifnum\!!countb>\zerocount
-% \dostepwiserecurse\plusone\!!countb\plusone
-% {\ifvoid\OTRSETgridcell\!!counta\recurselevel
-% \OTRSETsetgridcell\!!counta\recurselevel\copy\placeholderboxe
-% \fi}%
-% \fi
-% \fi}%
-% \OTRSETsetvsize % ! ! !
-% \fi
-% \fi
-% \fi}
-%
-% \def\OTRSETpresetbalancing
-% {\doifvaluesomething{\??mc\OTRSETidentifier\c!regels}%
-% {\getcommacommandsize[\csname\??mc\OTRSETidentifier\c!regels\endcsname]%
-% \ifnum\commalistsize>\plusone
-% \scratchcounter\zerocount
-% \def\docommand##1%
-% {\advance\scratchcounter\plusone
-% \setvalue{\??mc\OTRSETidentifier\the\scratchcounter\c!regels}{##1}}%
-% \processcommacommand
-% [\csname\??mc\OTRSETidentifier\c!regels\endcsname]\docommand
-% \setvalue{\??mc\OTRSETidentifier\c!regels}{0}%
-% \fi}}
-
% don't loose empty 1page/1column with area (example **)
%
% \definecolumntextarea[title][x=1,y=4,nx=2,ny=7,state=start]
@@ -1857,30 +1736,6 @@
% so this will be changed
-% \def\OTRSETnobalance
-% {\iflastcolumnfootnotes % testen ! optie
-% % inhibit flush of floats !
-% % todo: nothing if no footnotes, else empty page
-% \dostepwiserecurse\mofcolumns\nofcolumns\plusone
-% {\vskip-\struttotal\verticalstrut\vfill\eject}%
-% \else
-% \ifdim\pagetotal>\zeropoint % no, see example **
-% \ifnum\mofcolumns=\nofcolumns
-% \OTRSETflushfinalfootnotes
-% \else
-% % probably todo
-% \fi
-% \vfill
-% \eject
-% % brr, may result in empty page after nicely fit text
-% % or if left, then lost of first column only text
-% \ifnum\mofcolumns>1
-% \OTRSETdofinalflush
-% \OTRSETdofinaloutput
-% \fi
-% \fi
-% \fi}
-
\def\OTRSETnobalance
{\iflastcolumnfootnotes % testen ! optie
% inhibit flush of floats !
@@ -1937,17 +1792,6 @@
\OTRSETcheckstartcells
\OTRSETsetvsize}
-% \def\OTRSETcheckstartcells
-% {\dorecurse\nofcolumns
-% {\bgroup
-% \mofcolumns\recurselevel
-% \scratchcounter\currentcolumnstartcell % uses \mofcolumns, returns 1 or more
-% \advance\scratchcounter \minusone
-% \dorecurse\scratchcounter
-% {\OTRSETdoifcellelse\mofcolumns\recurselevel
-% \donothing{\OTRSETsetgridcell\mofcolumns\recurselevel\copy\placeholderboxe}}%
-% \egroup}}
-
\def\OTRSETcheckstartcells
{\dorecurse\nofcolumns
{\bgroup
@@ -1959,14 +1803,6 @@
\donothing{\OTRSETsetgridcell\mofcolumns\recurselevel\copy\placeholderboxe}}%
\egroup}}
-% \OTRSEToutput
-% {\dontcomplain % new, get rid of overfull message (to be sorted out)
-% \OTRSETnaturalflush
-% %\OTRSETstartnextpage
-% \OTRSETdoflushfloats % actually belongs in \flushsavedfloats (but goes wrong)
-% \OTRSETcheckfreelines
-% \OTRSETchecksidefloat}
-
\OTRSEToutput
{\dontcomplain % new, get rid of overfull message (to be sorted out)
\doloop
@@ -1997,67 +1833,16 @@
\v!top=>\chardef\OTRSETbalancemethod\plustwo,
\v!bottom=>\chardef\OTRSETbalancemethod\plusthree]}
-% keep 'm for a while
-%
-% \installoutput\OTRSETflushpreposttext
-% {\global\setbox\precolumnbox\vbox{\unvbox\normalpagebox}%
-% \ifcarryoverfootnotes \else
-% \global\setbox\postcolumnbox\vbox{\placebottomnotes}%
-% \fi}
-%
-% to be tested on 'boekinhoud' in 'pascal/demo-bbi'
-%
-% junk ! ! ! ! !
-%
-%\installoutput\OTRSETflushpreposttext
-% {\global\setbox\precolumnbox\vbox
-% {\unvbox\normalpagebox
-% \strut\vskip-2\lineheight\strut}% we want a proper depth
-% \ifcarryoverfootnotes \else
-% \global\setbox\postcolumnbox\vbox{\placebottomnotes}%
-% \fi}
-%
-% \starttext
-% \definecolumnset[two][n=2]
-% \startcolumnset[two] \dorecurse{4}{\input tufte } \stopcolumnset
-% \input tufte
-% \startcolumnset[two] \input tufte \stopcolumnset
-% \stoptext
-%
-% \installoutput\OTRSETflushpreposttext
-% {\global\setbox\precolumnbox\vbox{\unvbox\normalpagebox}%
-% \global\dp\precolumnbox\strutdepth
-% \ifcarryoverfootnotes \else
-% \global\setbox\postcolumnbox\vbox{\placebottomnotes}%
-% \fi}
-
% test:
%
-% \definecolumnset[two] [n=2,balance=yes]
-% \definecolumnset[three][n=3,balance=yes]
-% \setupcolumnset [two] [1] [lines=10]
-% \setupcolumnset [two] [2] [lines=10]
+% \definecolumnset[test-1] %[balance=yes]
+% \definecolumnset[test-2] %[balance=yes]
%
-% \startcolumnset[two] \dorecurse{14}{\input tufte \par} \stopcolumnset
-% \startcolumnset[three] \dorecurse{12}{\input tufte \par} \stopcolumnset
+% \setupcolumnsetlines[test-1][1][1] [4]
+% \setupcolumnsetlines[test-1][1][2][10]
%
-% with:
-%
-% \installoutput\OTRSETflushpreposttext
-% {%\ifvoid\normalpagebox
-% % \global\setbox\precolumnbox\vbox{}%
-% %\else
-% \global\setbox\precolumnbox\vbox
-% {\unvcopy\normalpagebox}%
-% \global\setbox\precolumnbox\vbox to \ht\precolumnbox
-% {\box\normalpagebox}%
-% %\fi
-% \global\dp\precolumnbox\strutdepth
-% \ifcarryoverfootnotes \else
-% \global\setbox\postcolumnbox\vbox{\placebottomnotes}%
-% \fi}
-
-% testcase : pascal demo-bbi, paragraaf/aanduiding koppen
+% \startcolumnset [test-1] \dorecurse {1}{\input tufte \par} \stopcolumnset
+% \startcolumnset [test-2] \dorecurse {2}{\input ward \par} \stopcolumnset
\ifx\lastskipinotr\undefined \newskip\lastskipinotr \fi
@@ -2077,30 +1862,6 @@
\let\precolumnlines \!!zerocount
\let\postcolumnlines\!!zerocount
-% \def\OTRSEThandlepreposttext
-% {\ifdim\ht\precolumnbox>\zeropoint % new
-% \getnoflines{\ht\precolumnbox}%
-% \edef\precolumnlines{\the\noflines}%
-% \doOTRSETsetgridcells
-% {\copy\placeholderboxe}
-% \plusone\plusone\nofcolumns\noflines
-% {\box\precolumnbox}%
-% \else
-% \let\precolumnlines\!!zerocount
-% \fi
-% \ifdim\ht\postcolumnbox>\zeropoint % new, otherwise empty bottom line
-% \getnoflines{\ht\postcolumnbox}%
-% \edef\postcolumnlines{\the\noflines}%
-% \advance\columnfreecells -\noflines
-% \advance\columnfreecells \plusone
-% \doOTRSETsetgridcells
-% {\copy\placeholderboxe}
-% \plusone\columnfreecells\nofcolumns\noflines
-% {\box\postcolumnbox}%
-% \else
-% \let\postcolumnlines\!!zerocount
-% \fi}
-
\def\OTRSEThandlepreposttext
{\ifdim\ht\precolumnbox>\zeropoint % new
\getnoflines{\ht\precolumnbox}%
@@ -2797,210 +2558,6 @@
% \startcolumnsetspan[two] \input tufte \stopcolumnsetspan
% \stopcolumnset
-% We need to set the \dimen globally since we are in the
-% OTR. Unfortunately this interferes with local settings,
-% although we may assume that they will not cross page
-% boundaries.
-
-\def\OTRSETcheckcontent
- {\bgroup
- \donefalse
- \def\OTRSETcheckcontent##1%
- {\setbox\scratchbox##1\recurselevel
- \setbox\scratchbox\vbox{\unvbox\scratchbox}%
- \ifdim\ht\scratchbox>\zeropoint\donetrue\fi}%
- \dorecurse{\nofcolumns}
- {\OTRSETcheckcontent\columngettextbox
- \OTRSETcheckcontent\columngetfootbox
- \OTRSETcheckcontent\columngettopbox
- \OTRSETcheckcontent\columngetbotbox}%
- \ifdone\egroup\donefalse\else\egroup\donetrue\fi}
-
-\def\OTRSETgetcolumntextheight#1% max - boven - top
- {\scratchdimen=\OTRSETgetparameter\c!maxhoogte#1%
- \advance\scratchdimen -\OTRSETgetparameter\c!bovenoffset#1%
- \advance\scratchdimen -\ht\columntopbox#1%
- \advance\scratchdimen -\getvalue{\??mc\number\mofcolumns-f}%
- \advance\scratchdimen -\ht\columnbotbox#1} % not used
-
-\def\OTRSETgetcolumnnaturalheight#1% max - boven - top
- {\setbox\scratchbox\vbox{\unvcopy\columntextbox#1}%
- \scratchdimen\ht\scratchbox
- \advance\scratchdimen \OTRSETgetparameter\c!bovenoffset#1%
- \advance\scratchdimen \ht\columntopbox#1%
- \advance\scratchdimen -\getvalue{\??mc\number\mofcolumns-f}%
- \advance\scratchdimen \ht\columnbotbox#1} % not used
-
-\def\OTRSETdobalance% splitten in met en zonder footnotes
- {\bgroup
- \maxdeadcycles=1000
- % collect content and notes
- \bgroup
- \OTRSEToutput
- {\global\setbox1\vbox{\unvbox\normalpagebox}%
- \global\setbox3\vbox{\unvbox\footins}}%
- \verticalstrut\vskip-\struttotal % makes footnotes flush
- \eject
- \global\collectingcontentfalse
- % check for footnotes only
- \ifdim\ht1<\topskip % real dirty
- \global\setbox1=\vbox{}
- % fix height of first line
- \ifdim\ht3>\!!zeropoint
- \global\setbox3\vbox
- {\setfootnotebodyfont
- \kern-\strutht
- \kern\topskip
- \unvbox3}
- \fi
- % prepare trial box
- \global\setbox5\vbox
- {\ifdim\ht1>\zeropoint
- \unvcopy1 \ifdim\ht3>\zeropoint \kern\skip\footins \fi
- \fi
- \ifdim\ht3>\zeropoint \unvcopy3 \fi}
- \egroup
- % erase old stuff
- \columnerasetextboxes
- \columnerasefootboxes
- % prepare floats
- \OTRSETdotopinsertions
- \OTRSETdobotinsertions % not used can be removed
- % calculate available space
- \!!heighta\zeropoint % available total height
- \dorecurse{\nofcolumns}
- {\OTRSETgetcolumntextheight\recurselevel
- \OTRSETcalculatelines\scratchdimen
- \advance\!!heighta \scratchdimen}
- % quick check
- \ifdim\ht5>\!!heighta
- % use normal routine
- \columnerasetextboxes
- \columnerasefootboxes
- % TEMP, TODO, FORCE NEXT PASS !
- \unvbox1
- \unvbox3
- \doglobal\addtocommalist{-\realfolio}\OTRSETbalancinglist
- \donefalse
- %\writestatus\m!columns{no balancing, text overflows height}%
- \else\ifdim\ht5>\zeropoint \relax
- % some text and/or notes
- \donetrue
- \else
- \donefalse
- \dorecurse\nofcolumns
- {\ifdim\ht\columntopbox\recurselevel>\zeropoint \donetrue \fi}%
- \ifdone
- % no text and notes, but figures
- \else
- % no text, no notes, no figures
- \doglobal\addtocommalist{-\realfolio}\OTRSETbalancinglist
- \writestatus\m!columns{no balancing, nothing to be placed}%
- \fi
- \fi\fi
- \ifdone
- \ifdim\ht5>\zeropoint \relax
- % balancing text and notes
- %\writestatus\m!columns{text may fit, balancing}%
- \newcounter\loopcounter
- \newcounter\balancinglines
- \doloop
- {\increment\loopcounter\relax
- % initialize
- \columnerasetextboxes
- \columnerasefootboxes
- \setbox0=\copy5
- \splittopskip\topskip
- % pre-split loop and quality calculation
- %\writestatus\m!columns{pass \loopcounter: correction -\balancinglines}
- \dorecurse\nofcolumns
- {\OTRSETgetcolumntextheight\recurselevel
- \OTRSETcalculatelines\scratchdimen
- \!!heightc\scratchdimen
- \ifnum\recurselevel<\nofcolumns
- \advance\!!heightc -\balancinglines\lineheight
- \fi
- \columnsettextbox\recurselevel\vsplit0 to \!!heightc}
- % just one method
- \OTRSETgetcolumnnaturalheight1 \dimen4\scratchdimen
- \OTRSETgetcolumnnaturalheight\nofcolumns \dimen6\scratchdimen
- %\writestatus\m!columns{first column: \the\dimen4}%
- %\writestatus\m!columns{last column: \the\dimen6}%
- \ifdim\dimen4=\dimen6
- \donetrue % perfect balance
- \else\ifdim\dimen4>\dimen6
- \donefalse % not yet good enough
- \increment\balancinglines % try again
- \edef\balancingcount{\the\!!counta}
- \else
- \donetrue % worse balance
- \ifnum\balancinglines>0 % take previous
- \decrement\balancinglines
- \fi
- \fi\fi
- % extra check
- % \ifdim\ht0>\zeropoint\relax \donefalse \fi
- % another check
- \ifdone
- %\writestatus\m!columns{balancing finished in pass \loopcounter}%
- \else \ifnum\loopcounter>100 \donetrue
- %\writestatus\m!columns{balancing aborted after pass \loopcounter}%
- \else
- %\writestatus\m!columns{balancing continued after pass \loopcounter}%
- \fi \fi
- % final balancing pass
- \ifdone
- \setbox0\copy1
- \setbox2\copy3
- \columnerasetextboxes
- \columnerasefootboxes
- \dorecurse\nofcolumns
- {\OTRSETgetcolumntextheight\recurselevel
- \OTRSETcalculatelines\scratchdimen
- \!!heightc\scratchdimen
- \ifnum\recurselevel<\nofcolumns
- \advance\!!heightc -\balancinglines\lineheight
- \fi
- % split off text
- \ifdim\ht0>\zeropoint
- \columnsettextbox\recurselevel\vsplit0 to \!!heightc
- \setbox4\vbox{\unvcopy\columntextbox\recurselevel}
- \advance\!!heightc -\ht4
- \ifdim\ht0>\zeropoint
- \columnsettextbox\recurselevel\box4
- \advance\!!heightc \skip\footins
- \fi
- \fi
- % split off footnotes
- \ifdim\ht0>\zeropoint\relax \else
- \ifdim\ht2>\zeropoint\relax
- \setbox4\vsplit2 to \!!heightc
- \setbox\footins=\vbox{\unvbox4} % ugly and dirty trick
- \ifdim\ht\columntextbox\recurselevel=\zeropoint\relax
- \columnsettextbox\recurselevel\hbox
- {\raise\strutdp\hbox % ugly but needed
- {\setfootnotebodyfont % both these moves
- \lower\strutdp\hbox{\placebottomnotes}}}
- \else
- \columnsetfootbox\recurselevel\hbox{\placebottomnotes}
- \fi
- \fi
- \fi}
- \exitloop
- \fi}
- \else
- % no reason to balance floats
- \fi
- \fi
- \doglobal\addtocommalist{\realfolio}\OTRSETbalancinglist
- \OTRSETdoflush
- \fi
- \egroup}
-
-\def\OTRSETdobalance% splitten in met en zonder footnotes
- {\writestatus{columnsets}{balancing is not supported yet}%
- \OTRSETnobalance}
-
\protect \endinput
% extreme examples (1)
diff --git a/tex/context/base/scrp-cjk.lua b/tex/context/base/scrp-cjk.lua
index 066a72d13..41447319f 100644
--- a/tex/context/base/scrp-cjk.lua
+++ b/tex/context/base/scrp-cjk.lua
@@ -486,7 +486,7 @@ local injectors = { -- [previous] [current]
full_width_close = {
jami_initial = nobreak_shrink_break_stretch,
korean = nobreak_shrink_break_stretch,
- chinese = nobreak_shrink_break_stretch,
+ chinese = stretch_break, -- nobreak_shrink_break_stretch,
half_width_open = nobreak_shrink_break_stretch_nobreak_autoshrink,
half_width_close = nobreak_shrink_nobreak_stretch,
full_width_open = nobreak_shrink_break_stretch_nobreak_shrink,
@@ -498,7 +498,7 @@ local injectors = { -- [previous] [current]
half_width_close = {
jami_initial = nobreak_shrink_break_stretch,
korean = nobreak_autoshrink_break_stretch,
- chinese = nobreak_autoshrink_break_stretch,
+ chinese = stretch_break, -- nobreak_autoshrink_break_stretch,
half_width_open = nobreak_autoshrink_break_stretch_nobreak_autoshrink,
half_width_close = nobreak_autoshrink_nobreak_stretch,
full_width_open = nobreak_autoshrink_break_stretch_nobreak_shrink,
diff --git a/tex/context/base/strc-des.mkiv b/tex/context/base/strc-des.mkiv
index a802adcb0..6d0cc244e 100644
--- a/tex/context/base/strc-des.mkiv
+++ b/tex/context/base/strc-des.mkiv
@@ -21,19 +21,30 @@
%D
%D \startbuffer
%D \defineenumeration[one]
-%D \defineenumeration[two] [one]
-%D \defineenumeration[three] [number=one,style=slanted]
-%D \defineenumeration[four] [three]
-%D \defineenumeration[five] [three] [number=five]
+%D \defineenumeration[two] [one] % clone one
+%D \defineenumeration[three] [counter=one,style=slanted] % only use counter of one
+%D \defineenumeration[four] [three] % clone three
+%D \defineenumeration[five] [three] [counter=five] % clone three and use own counter
+%D \defineenumeration[six] [three] [counter=four] % clone tree and use counter four (undefined)
%D
-%D \startone test test 1 \stopone
-%D \starttwo test test 2 \stoptwo
-%D \startthree test test 3 \stopthree
-%D \startfour test test 4 \stopfour
-%D \startfive test test 1 \stopfive
+%D \startone test test 6 \stopone
+%D \starttwo test test 7 \stoptwo
+%D \startthree test test 8 \stopthree
+%D \startfour test test 9 \stopfour
+%D \startfive test test 2 \stopfive
+%D \startsix test test 10 \stopsix
%D \stopbuffer
%D
%D \typebuffer \start \getbuffer \stop
+%D
+%D \starttyping
+%D \setupenumerations[one] [prefix=yes,prefixsegments=section]
+%D \setupenumerations[two] [prefix=yes,prefixsegments=section]
+%D \setupenumerations[three][prefix=yes,prefixsegments=section]
+%D \setupenumerations[four] [prefix=yes,prefixsegments=chapter:section]
+%D \setupenumerations[five] [prefix=yes,prefixsegments=chapter:section]
+%D \setupenumerations[six] [prefix=yes,prefixsegments=chapter:section]
+%D \stoptyping
% list and titles are experimental
%
@@ -553,13 +564,13 @@
{\normalexpanded{\noexpand\dodefineenumerationcommands{#1}{\recurselevel}{\@@subslevel\v!sub}{\??dd\@@subslevel#1}}%
\edef\@@subslevel{\@@subslevel\v!sub}}%
\else % clone
- \getparameters[\??dd#1][\s!counter=#2,#3]%
+ \getparameters[\??dd#1][\s!parent=\??dd#2,#3]%
\let\@@subslevel\empty
\dorecurse{\descriptionparameter\c!levels}
{\normalexpanded{\noexpand\dodefineenumerationcommands{#1}{\recurselevel}{\@@subslevel}{\??dd\@@subslevel#2}}%
\edef\@@subslevel{\@@subslevel\v!sub}}%
\fi
- \edef\currentdescriptioncounter{\descriptionparameter\c!number}%
+ \edef\currentdescriptioncounter{\descriptionparameter\s!counter}%
\ifx\currentdescriptioncounter\empty
\ifdone\dodefineenumerationcounter{#1}\fi
\else\ifx\currentdescriptioncounter\v!yes
@@ -568,6 +579,7 @@
\ifdone\dodefineenumerationcounter{#1}\fi
\else
\letvalue{\??dd#1\s!counter}\currentdescriptioncounter % ?
+ %[[#1:\currentdescriptioncounter]]
\doifstructurecounterelse{\currentdescriptioncounter}{}{\dodefineenumerationcounter\currentdescriptioncounter}%
\fi\fi\fi
\dosetupenumerationcounter{#1}} % new
@@ -845,7 +857,7 @@
connector = \!!bs\descriptionparameter\c!prefixconnector\!!es,
},
numberdata = {
- numbers = structure.counters.compact("\currentdescriptionname",nil,true),
+ numbers = structure.counters.compact("\currentdescriptionnumber",nil,true), % ! number can be cloned
separatorset = "\descriptionparameter\c!numberseparatorset",
conversion = "\descriptionparameter\c!numberconversion",
conversionset = "\descriptionparameter\c!numberconversionset",
diff --git a/tex/context/base/strc-not.mkiv b/tex/context/base/strc-not.mkiv
index 560001c6e..917ba1894 100644
--- a/tex/context/base/strc-not.mkiv
+++ b/tex/context/base/strc-not.mkiv
@@ -220,8 +220,8 @@
[\c!location=\@@defaultnotedefloc,
\c!distance=\@@defaultnotedefdis,
\c!width=\v!fit,
- \c!headstyle=\noteparameter\c!style,
- \c!headcolor=\noteparameter\c!color,
+ \c!headstyle=\noteparameter\c!style, % hm
+ \c!headcolor=\noteparameter\c!color, % hm
\s!handler=\v!note,
\c!text=,
\c!before=,
@@ -491,6 +491,28 @@
%D functionality.
%D The next implementation runs on top of enumerations (only in \MKIV).
+%D
+%D \starttyping
+%D \setupenumerations
+%D [footnote]
+%D [ style=\type{(es)},
+%D headstyle=\type{(hs)}]
+%D
+%D \setupnote
+%D [footnote]
+%D [ style=\type{(s)},
+%D command=\type{(c)},
+%D textcommand=\type{(tc)},
+%D textstyle=\type{(ts)},
+%D numberstyle=\type{(ns)},
+%D numbercommand=\type{(nc)}]
+%D
+%D \setuplayout[backspace=6cm,marginwidth=cm,width=middle]
+%D
+%D \starttext
+%D \dorecurse{9}{This\footnote{Hello World #1} is a test.\par }
+%D \stoptext
+%D \stoptyping
% TODO: \ifnotesenabled
@@ -548,15 +570,16 @@
\endgroup
\fi}
-\def\dolastnotesymbol{\typesetsomenotesymbol\currentnote\currentnotenumber}
+\def\dolastnotesymbol
+ {\typesetsomenotesymbol\currentnote\currentnotenumber}
-\def\dotypesetsomenotesymbol#1#2%
+\def\dotypesetsomenotesymbol#1#2% running text
{\dodonotesymbol
{\synchronizesomenotesymbol{#1}{#2}%
\ctxlua{structure.notes.number("\currentnote",\currentnotenumber)}% \currentdescriptionnumberentry
\domovednote{#1}{#2}\v!previouspage\v!nextpage}}
-\def\typesetsomenotesymbol#1#2%
+\def\typesetsomenotesymbol#1#2% running text
{\removeunwantedspaces
\doifitalicelse\/\donothing % Charles IV \footnote{the fourth}
\ifdim\lastkern=\notesignal
@@ -595,7 +618,8 @@
\def\docurrentnoteenumerationfullnumber
{\noteparameter\c!numbercommand
- {\ctxlua{structure.notes.number("\currentnote",\currentdescriptionnumberentry)}%
+ {\dosetnoteattributes\c!numberstyle\c!numbercolor
+ \ctxlua{structure.notes.number("\currentnote",\currentdescriptionnumberentry)}%
\domovednote\currentdescription\currentdescriptionnumberentry\v!nextpage\v!previouspage}}
\def\synchronizesomenotesymbol#1#2% called more often than needed
diff --git a/tex/context/base/syst-aux.mkiv b/tex/context/base/syst-aux.mkiv
index fe2fbefbe..88bcc3778 100644
--- a/tex/context/base/syst-aux.mkiv
+++ b/tex/context/base/syst-aux.mkiv
@@ -6142,6 +6142,10 @@
\def\stopstrictinspectnextcharacter
{\let\inspectnextcharacter\normalinspectnextcharacter}
+\def\strictdoifnextoptionalelse#1#2%
+ {\startstrictinspectnextcharacter
+ \doifnextcharelse[{\stopstrictinspectnextcharacter#1}{\stopstrictinspectnextcharacter#2}}
+
%D \macros
%D {gobblespacetokens}
%D
diff --git a/tex/context/base/syst-ext.mkii b/tex/context/base/syst-ext.mkii
index f9827db8b..7327ca0f8 100644
--- a/tex/context/base/syst-ext.mkii
+++ b/tex/context/base/syst-ext.mkii
@@ -4769,6 +4769,10 @@
\def\stopstrictinspectnextcharacter
{\let\inspectnextcharacter\normalinspectnextcharacter}
+\def\strictdoifnextoptionalelse#1#2%
+ {\startstrictinspectnextcharacter
+ \doifnextcharelse[{\stopstrictinspectnextcharacter#1}{\stopstrictinspectnextcharacter#2}}
+
%D \macros
%D {gobblespacetokens}
%D
diff --git a/tex/context/base/type-buy.tex b/tex/context/base/type-buy.tex
index a973fb7b1..e8c323ed5 100644
--- a/tex/context/base/type-buy.tex
+++ b/tex/context/base/type-buy.tex
@@ -516,6 +516,11 @@
\loadmapfile[\typescriptthree-adobe-frutiger.map]
\stoptypescript
+\starttypescript [frutiger] [texnansi,ec,8r,uc]
+ \definetypeface [frutiger] [ss] [sans] [frutiger] [default] [encoding=\typescripttwo]
+% \loadmapfile [\typescripttwo-adobe-frutiger.map]
+\stoptypescript
+
% kabel
\starttypescript [sans] [kabel] [ec,8r,texnansi]
diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua
index 8fc59bc1f..09587b4bd 100644
--- a/tex/generic/context/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : c:/data/develop/context/texmf/tex/generic/context/luatex-fonts-merged.lua
-- parent file : c:/data/develop/context/texmf/tex/generic/context/luatex-fonts.lua
--- merge date : 11/27/09 21:28:10
+-- merge date : 11/30/09 23:32:01
do -- begin closure to overcome local limits and interference