summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2012-07-24 12:20:14 +0300
committerMarius <mariausol@gmail.com>2012-07-24 12:20:14 +0300
commitb5479d5f43b89e9ce712f0cfa629ccd9c55ac22a (patch)
tree6da8abd32685ff158d4843e62bf32cfb3377805f /tex
parent1258e9df5026925ba69b6184b984d4fa70ed3ffa (diff)
downloadcontext-b5479d5f43b89e9ce712f0cfa629ccd9c55ac22a.tar.gz
beta 2012.07.24 10:59
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/chem-str.lua12
-rw-r--r--tex/context/base/chem-str.mkiv17
-rw-r--r--tex/context/base/cont-new.mkii2
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4078 -> 4090 bytes
-rw-r--r--tex/context/base/context-version.pngbin106362 -> 106541 bytes
-rw-r--r--tex/context/base/context.mkii2
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/mult-aux.mkiv3
-rw-r--r--tex/context/base/page-set.mkiv425
-rw-r--r--tex/context/base/status-files.pdfbin24353 -> 24356 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin184566 -> 184572 bytes
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
13 files changed, 248 insertions, 219 deletions
diff --git a/tex/context/base/chem-str.lua b/tex/context/base/chem-str.lua
index 77ca0a319..b56525e3f 100644
--- a/tex/context/base/chem-str.lua
+++ b/tex/context/base/chem-str.lua
@@ -1,12 +1,15 @@
if not modules then modules = { } end modules ['chem-str'] = {
version = 1.001,
comment = "companion to chem-str.mkiv",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ author = "Hans Hagen and Alan Braslau",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
--- This module in incomplete and experimental.
+-- The original \PPCHTEX\ code was written in pure \TEX\, although later we made
+-- the move from \PICTEX\ to \METAPOST\. The current implementation is a mix between
+-- \TEX\, \LUA\ and \METAPOST. Although the first objective is to get a compatible
+-- but better implementation, later versions might provide more,
-- We can push snippets into an mp instance.
@@ -52,7 +55,7 @@ local common_keys = {
mid = "fixed", mids = "fixed", midz = "text",
z = "text", rz = "text", mrz = "text", prz = "text", crz = "text",
rt = "text", rtt = "text", rbt = "text", zt = "text", zn = "number",
- mov = "transform", rot = "transform", adj = "transform", dir = "transform", sub = "transform",
+ mov = "transform", rot = "transform", adj = "transform", sub = "transform",
}
local front_keys = {
@@ -63,6 +66,7 @@ local front_keys = {
}
local one_keys = {
+ b = "line", msb = "line", psb = "line",
sb = "line", db = "line", tb = "line",
ep = "line", es = "line", ed = "line", et = "line",
sd = "line", ldd = "line", rdd = "line",
@@ -81,7 +85,7 @@ local syntax = {
one = {
n = 1, max = 8, keys = one_keys,
align = {
- z = { { "r", "r_b", "b", "l_b", "l", "l_t", "t", "r_t" } },
+-- z = { { "r", "r_b", "b", "l_b", "l", "l_t", "t", "r_t" } },
--~ z = { { "r", "r", "b", "l", "l", "l", "t", "r" } },
}
},
diff --git a/tex/context/base/chem-str.mkiv b/tex/context/base/chem-str.mkiv
index c0eaa8c28..183eeb181 100644
--- a/tex/context/base/chem-str.mkiv
+++ b/tex/context/base/chem-str.mkiv
@@ -2,7 +2,7 @@
%D [ file=chem-ini,
%D version=2009.05.13,
%D subtitle=Chemistry,
-%D author=Hans Hagen,
+%D author=Hans Hagen \& Alan Braslau,
%D date=\currentdate,
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
@@ -10,8 +10,10 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D This module in incomplete and experimental. Eventually this code
-%D will replace \PPCHTEX.
+%D The original \PPCHTEX\ code was written in pure \TEX\, although later we made
+%D the move from \PICTEX\ to \METAPOST\. The current implementation is a mix between
+%D \TEX\, \LUA\ and \METAPOST. Although the first objective is to get a compatible
+%D but better implementation, later versions might provide more,
\writestatus{loading}{ConTeXt Chemistry Macros / Structure}
@@ -58,6 +60,10 @@
\let\setupchemicals\setupchemical
+%D We use a dedicated framed macro instead of inheriting one. This is both
+%D a historical and practical reason (like shared keys with different meaning
+%D that could clash, e.g.\ align).
+
\defineframed
[\??chemicalframed]
[\c!align=\v!normal,
@@ -101,11 +107,6 @@
\edef\chemicaltoplocation{t}
\edef\chemicalbotlocation{b}
-% \unexpanded\def\chemicaltext#1% in ppchtex we had a more clever alignment
-% {\usechemicalstyleandcolor\c!style\c!color
-% \strut
-% #1} % maybe also \setstrut
-
\unexpanded\def\chemicaltext#1%
{\mathematics
{\usechemicalstyleandcolor\c!style\c!color
diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii
index 650d129cd..ceae7e699 100644
--- a/tex/context/base/cont-new.mkii
+++ b/tex/context/base/cont-new.mkii
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2012.07.23 20:18}
+\newcontextversion{2012.07.24 10:59}
%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/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index 6af5aff9c..264511c3a 100644
--- a/tex/context/base/cont-new.mkiv
+++ b/tex/context/base/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2012.07.23 20:18}
+\newcontextversion{2012.07.24 10:59}
%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-version.pdf b/tex/context/base/context-version.pdf
index 98526f426..df1cdb8a8 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/context-version.png b/tex/context/base/context-version.png
index 09cb78f21..c6e119c8d 100644
--- a/tex/context/base/context-version.png
+++ b/tex/context/base/context-version.png
Binary files differ
diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii
index 0fecb78a5..b53641cf9 100644
--- a/tex/context/base/context.mkii
+++ b/tex/context/base/context.mkii
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2012.07.23 20:18}
+\edef\contextversion{2012.07.24 10:59}
%D For those who want to use this:
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index 6756fb304..8e386872c 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -25,7 +25,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2012.07.23 20:18}
+\edef\contextversion{2012.07.24 10:59}
%D For those who want to use this:
diff --git a/tex/context/base/mult-aux.mkiv b/tex/context/base/mult-aux.mkiv
index 18cafd153..a2ebf6e2c 100644
--- a/tex/context/base/mult-aux.mkiv
+++ b/tex/context/base/mult-aux.mkiv
@@ -14,6 +14,9 @@
% todo: setupxxx and setupxxxs (so a plural for the root setup and
% we can consider blocking the root)
+% todo (e.g for columnsets and registers): \definexxx[parent][1]
+%
+
%D A generalization of \MKIV-like inheritance. Just something to play
%D with (interface might change). The code here evolved in an email
%D exchange between me and Wolgang Schuster.
diff --git a/tex/context/base/page-set.mkiv b/tex/context/base/page-set.mkiv
index 51e4896bc..3e3141b15 100644
--- a/tex/context/base/page-set.mkiv
+++ b/tex/context/base/page-set.mkiv
@@ -13,7 +13,9 @@
% getnoflines vs getrawnoflines
-% some day: cleanup and go etex
+% This is a rather old mechanism and we can best keep it as it is. If it gets
+% replaced by a more modern solution, it will be an extra mechanism. So, we
+% only do some basic cleanup.
\writestatus{loading}{ConTeXt Page Macros / Column Sets}
@@ -29,9 +31,6 @@
\unprotect
-\definesystemvariable {mc} % MultiColumn
-\definesystemvariable {mt} % MulTicolumn
-
\newcount\tofcolumns % total
\newcount\lofcolumns % left
\newcount\rofcolumns % right
@@ -47,7 +46,7 @@
\newif\ifenoughcolumncells
\newif\ifsomefreecolumncells
\newif\ifcolumnspread
-\newif\iftracecolumnset % \tracecolumnsettrue
+\newif\iftracecolumnset
\newif\ifforcecolumnsetgrid \forcecolumnsetgridtrue
\newif\ifcollectingsetcontent % never set
@@ -55,16 +54,87 @@
\newif\iflastcolumnfootnotes % never set \lastcolumnfootnotestrue
\newif\ifintermediatefootnotes
-\newbox\b_page_set_preceding
-\newbox\b_page_set_trailing
+\newbox \b_page_set_preceding
+\newbox \b_page_set_trailing
+
+\newdimen \d_page_set_local_hsize
+\newconditional\c_page_set_width_set
-\newdimen\d_page_set_local_hsize
+\installcorenamespace{columnsetgrid}
\def\columnmaxcells {75} % runtime
\def\columnmaxfreecells {0} % runtime
\def\columngaplimit {0} % {5}
-\def\@otr@{otr}
+\def\page_set_cell #1#2{\csname \??columnsetgrid:\number#1:\number#2\endcsname}
+\def\page_set_cell_get#1#2{\box\csname \??columnsetgrid:\number#1:\number#2\endcsname}
+\def\page_set_cell_set#1#2{\global\setbox\csname\??columnsetgrid:\number#1:\number#2\endcsname}
+
+\def\page_set_cell_doifelse#1#2%
+ {\relax
+ \ifvoid\csname\??columnsetgrid:\number#1:\number#2\endcsname
+ \expandafter\secondoftwoarguments
+ \else
+ \expandafter\firstoftwoarguments
+ \fi}
+
+\def\page_set_cell_erase_grid % maybe dedicated loops ... make another loop when max's have changed
+ {\bgroup
+ \increment\columnmaxcells\relax
+ \ifodd\realpageno \else
+ \columnspreadfalse
+ \fi
+ \ifcolumnspread
+ \page_set_cell_erase_grid_spread
+ \else
+ \page_set_cell_erase_grid_page
+ \fi
+ \page_set_cell_erase_grid_top
+ \global\columnfirstcell\zerocount
+ \global\columnlastcell \columnfirstcell
+ \global\columnfreecells\columnfirstcell
+ \egroup}
+
+\let\m_page_column_l\relax
+\let\m_page_column_r\relax
+
+\def\page_set_cell_erase_grid_spread
+ {\dorecurse\nofcolumns
+ {\let \m_page_column_l\recurselevel
+ \edef\m_page_column_r{\the\numexpr\recurselevel+\lofcolumns}%
+ \dostepwiserecurse \zerocount \columnmaxcells \plusone
+ {\ifcsname\??columnsetgrid:\m_page_column_l:\recurselevel\endcsname
+ \global\setbox\csname\??columnsetgrid:\m_page_column_l:\recurselevel\endcsname
+ \ifcsname\??columnsetgrid:\m_page_column_r:\recurselevel\endcsname
+ \box\csname\??columnsetgrid:\m_page_column_r:\recurselevel\endcsname
+ \else
+ \emptyhbox
+ \expandafter\newbox\csname\??columnsetgrid:\m_page_column_r:\recurselevel\endcsname
+ \fi
+ \else
+ \expandafter\newbox\csname\??columnsetgrid:\m_page_column_l:\recurselevel\endcsname
+ \ifcsname\??columnsetgrid:\m_page_column_r:\recurselevel\endcsname
+ \global\setbox\csname\??columnsetgrid:\m_page_column_l:\recurselevel\endcsname\box\csname\??columnsetgrid:\m_page_column_r:\recurselevel\endcsname
+ \else
+ \expandafter\newbox\csname\??columnsetgrid:\m_page_column_r:\recurselevel\endcsname
+ \fi
+ \fi}}}
+
+\def\page_set_cell_erase_grid_page
+ {\dorecurse \tofcolumns
+ {\let\m_page_column_l\recurselevel
+ \dostepwiserecurse \zerocount \columnmaxcells \plusone
+ {\ifcsname\??columnsetgrid:\m_page_column_l:\recurselevel\endcsname
+ \global\setbox\csname\??columnsetgrid:\m_page_column_l:\recurselevel\endcsname\emptybox
+ \else
+ \expandafter\newbox\csname\??columnsetgrid:\m_page_column_l:\recurselevel\endcsname
+ \fi}}}
+
+\def\page_set_cell_erase_grid_top
+ {\dorecurse\tofcolumns
+ {\global\setbox\csname\??columnsetgrid:\recurselevel:\columnmaxcells\endcsname\copy\placeholderboxa}}
+
+% % % %
\def\OTRSETmakeupwidth{\innermakeupwidth}
@@ -74,15 +144,6 @@
\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}
-\def\OTRSETsetgridcell#1#2{\global\setbox\csname\@otr@:\number#1:\number#2\endcsname}
-
-\long\def\OTRSETdoifcellelse#1#2%
- {\relax\ifvoid\csname\@otr@:\number#1:\number#2\endcsname
- \@EA\secondoftwoarguments\else\@EA\firstoftwoarguments
- \fi}
-
% The following two macros are used to compensate for a switch in body fonts
% as in:
%
@@ -198,64 +259,16 @@
\relax % needed ! ! ! ! else lookahead over \fi and \@EA
\@EA\egroup\@EA\scratchdimen\the\!!dimena\relax}
-\def\columnerasegridboxes % maybe dedicated loops
- {\bgroup
- \increment\columnmaxcells\relax
- \ifodd\realpageno
- \else % we are on the other page
- \columnspreadfalse
- \fi
- \ifcolumnspread
- \dorecurse\nofcolumns
- {\let\!!stringa\recurselevel
- \scratchcounter\recurselevel \advance\scratchcounter\lofcolumns
- \edef\!!stringb{\the\scratchcounter}%
- \dostepwiserecurse \zerocount \columnmaxcells \plusone
- {\ifcsname\@otr@:\!!stringa:\recurselevel\endcsname
- \global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname
- \ifcsname\@otr@:\!!stringb:\recurselevel\endcsname
- \box\csname\@otr@:\!!stringb:\recurselevel\endcsname
- %\global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname\box\csname\@otr@:\!!stringb:\recurselevel\endcsname
- \else
- \emptyhbox
- %\global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname\emptybox
- \expandafter\newbox\csname\@otr@:\!!stringb:\recurselevel\endcsname
- \fi
- \else
- \expandafter\newbox\csname\@otr@:\!!stringa:\recurselevel\endcsname
- \ifcsname\@otr@:\!!stringb:\recurselevel\endcsname
- \global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname\box\csname\@otr@:\!!stringb:\recurselevel\endcsname
- \else
- \expandafter\newbox\csname\@otr@:\!!stringb:\recurselevel\endcsname
- \fi
- \fi}}%
- \else
- \dorecurse \tofcolumns
- {\let\!!stringa\recurselevel
- \dostepwiserecurse \zerocount \columnmaxcells \plusone
- {\ifcsname\@otr@:\!!stringa:\recurselevel\endcsname
- \global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname\emptybox
- \else
- \expandafter\newbox\csname\@otr@:\!!stringa:\recurselevel\endcsname
- \fi}}%
- \fi
- \dorecurse\tofcolumns
- {\global\setbox\csname\@otr@:\recurselevel:\columnmaxcells\endcsname\copy\placeholderboxa}%
- \global\columnfirstcell\zerocount
- \global\columnlastcell\columnfirstcell
- \global\columnfreecells\columnfirstcell
- \egroup}
-
\def\doOTRSETsetgridcells#1#2#3#4#5#6% placeholder col row wid hei {data}
{\!!countd#2\advance\!!countd#4\advance\!!countd\minusone
\!!counte#3\advance\!!counte#5\advance\!!counte\minusone
\dostepwiserecurse{#2}\!!countd\plusone
{\!!countf\recurselevel
\dostepwiserecurse{#3}\!!counte\plusone
- {\OTRSETsetgridcell\!!countf\recurselevel#1}}%
+ {\page_set_cell_set\!!countf\recurselevel#1}}%
\dostepwiserecurse{#3}\!!counte\plusone
- {\wd\OTRSETgridcell{#2}\recurselevel\hsize}%
- \OTRSETsetgridcell{#2}\!!counte#6}
+ {\wd\page_set_cell{#2}\recurselevel\hsize}%
+ \page_set_cell_set{#2}\!!counte#6}
\def\OTRSETsetgridcells
{\doOTRSETsetgridcells{\copy\placeholderboxb}}
@@ -266,19 +279,17 @@
\unexpanded\def\setupcolumnsetlines{\doquintupleempty\dosetupcolumnsettrick[l]}
\unexpanded\def\setupcolumnsetstart{\doquintupleempty\dosetupcolumnsettrick[s]}
+\installcorenamespace{columnsettag} % temp hack
+
\def\dosetupcolumnsettrick[#1][#2][#3][#4][#5]% tag id page col value
- {% not needed, is already relative
- % \doifinstringelse{+}{#3}{\scratchcounter\realpageno}{\scratchcounter\zerocount}%
- % \advance\scratchcounter#3\relax % \relax needed
- % \setevalue{\??mc:#1:#2:\the\scratchcounter:\number#4}{\number#5}}
- \iffifthargument
- \setevalue{\??mc:#1:#2:\number#3:\number#4}{\number#5}%
+ {\iffifthargument
+ \setevalue{\??columnsettag:#1:#2:\number#3:\number#4}{\number#5}%
\else
- \setevalue{\??mc:#1:#2:\number#3:0}{\number#4}%
+ \setevalue{\??columnsettag:#1:#2:\number#3:0}{\number#4}%
\fi}
-\def\currentcolumnmaxcellstag #1{\??mc:l:\OTRSETidentifier:\columnsetpage:\number#1}
-\def\currentcolumnstartcelltag#1{\??mc:s:\OTRSETidentifier:\columnsetpage:\number#1}
+\def\currentcolumnmaxcellstag #1{\??columnsettag:l:\OTRSETidentifier:\columnsetpage:\number#1}
+\def\currentcolumnstartcelltag#1{\??columnsettag:s:\OTRSETidentifier:\columnsetpage:\number#1}
\def\doresetcolumnsetlines#1%
{\ifcsname\currentcolumnmaxcellstag{#1}\endcsname
@@ -326,7 +337,7 @@
{\ifnum\columnfirstcell>\columnmaxcells\relax
\exitloop
\else
- \OTRSETdoifcellelse{#1}\columnfirstcell
+ \page_set_cell_doifelse{#1}\columnfirstcell
{\global\advance\columnfirstcell\plusone}\exitloop
\fi}%
\global\columnlastcell\columnfirstcell
@@ -334,7 +345,7 @@
{\ifnum\columnlastcell>\columnmaxcells\relax
\exitloop
\else
- \OTRSETdoifcellelse{#1}\columnlastcell
+ \page_set_cell_doifelse{#1}\columnlastcell
{\global\advance\columnlastcell \minusone \exitloop}
{\global\advance\columnlastcell \plusone }%
\fi}%
@@ -365,7 +376,7 @@
\edef\columnmaxcells{\the\scratchcounter}%
\scratchcounter\zerocount
\dostepwiserecurse{#2}\columnmaxcells\plusone
- {\OTRSETdoifcellelse{#1}\recurselevel
+ {\page_set_cell_doifelse{#1}\recurselevel
{\ifnum\columnmaxfreecells<\scratchcounter
\edef\columnmaxfreecells{\the\scratchcounter}%
\let\columnfrmfreecells\recurselevel
@@ -376,7 +387,7 @@
\long\def\OTRSETrecurseRL#1%
{\dostepwiserecurse\nofcolumns\plusone\minusone
- {#1\hskip\OTRSETgetparameter\c!distance\recurselevel}}
+ {#1\hskip\namedcolumnsetparameter{\currentcolumnset:\recurselevel}\c!distance}}
\def\OTRSETmakegridbox
{\ifcase\columndirection
@@ -387,6 +398,26 @@
\def\OTRSETmakeupwidth{\makeupwidth} % temporary indirectness
+\def\page_set_make_background_box
+ {\begingroup
+ \d_page_set_local_hsize\OTRSETlocalwidth\recurselevel
+ \scratchdistance\namedcolumnsetparameter{\currentcolumnset:\recurselevel}\c!distance\relax
+ \edef\currentcolumnset{\currentcolumnset:\recurselevel}%
+ \letcolumnsetparameter\c!width\d_page_set_local_hsize
+ \letcolumnsetparameter\c!height\!!heighta
+ \letcolumnsetparameter\c!lines\empty
+ \setbox\scratchbox\hbox\inheritedcolumnsetframed{}% maybe \fastlocalframed
+ \wd\scratchbox\d_page_set_local_hsize
+ \ht\scratchbox\!!heighta
+ \ifcase\columndirection
+ \hskip\scratchdistance
+ \box\scratchbox
+ \else
+ \box\scratchbox
+ \hskip\scratchdistance
+ \fi
+ \endgroup}
+
\def\OTRSETdomakegridbox#1#2#3%
{\hbox\bgroup
\dontcomplain
@@ -394,22 +425,7 @@
\!!heighta \textheight
% test first !
\hbox to \OTRSETmakeupwidth
- {\dostepwiserecurse{#1}{#2}{#3}
- {\mofcolumns\recurselevel
- \d_page_set_local_hsize\OTRSETlocalwidth\mofcolumns
- \setbox\scratchbox\hbox\localframed
- [\??mc\OTRSETidentifier\number\mofcolumns]%
- [\c!width=\d_page_set_local_hsize,\c!height=\!!heighta,\c!lines=]%
- {}%
- \wd\scratchbox\d_page_set_local_hsize
- \ht\scratchbox\!!heighta
- \ifcase\columndirection
- \hskip\OTRSETgetparameter\c!distance\recurselevel
- \box\scratchbox
- \else
- \box\scratchbox
- \hskip\OTRSETgetparameter\c!distance\recurselevel
- \fi}}%
+ {\dostepwiserecurse{#1}{#2}{#3}\page_set_make_background_box}%
\hskip-\OTRSETmakeupwidth
% main text
\hbox to \OTRSETmakeupwidth
@@ -431,7 +447,7 @@
\vfill
\fi
\dorecurse\columnmaxcells
- {\setbox\scratchbox\hbox{\OTRSETgetgridcell\mofcolumns\recurselevel}%
+ {\setbox\scratchbox\hbox{\page_set_cell_get\mofcolumns\recurselevel}%
\ht\scratchbox\strutht
\dp\scratchbox\strutdp
\ifcase\columndirection
@@ -456,9 +472,9 @@
\wd\scratchbox\d_page_set_local_hsize % \textwidth
\page_marks_synchronize_column{#1}{#2}\recurselevel\scratchbox
\ifcase\columndirection
- \hskip\OTRSETgetparameter\c!distance\recurselevel\box\scratchbox
+ \hskip\namedcolumnsetparameter{\currentcolumnset:\recurselevel}\c!distance\box\scratchbox
\else
- \box\scratchbox\hskip\OTRSETgetparameter\c!distance\recurselevel
+ \box\scratchbox\hskip\namedcolumnsetparameter{\currentcolumnset:\recurselevel}\c!distance
\fi}}%
\egroup}
@@ -473,7 +489,7 @@
\!!counta\columnmaxcells
\donetrue
\doloop
- {\dorecurse\nofcolumns{\OTRSETdoifcellelse\recurselevel\!!counta\donefalse\donothing}%
+ {\dorecurse\nofcolumns{\page_set_cell_doifelse\recurselevel\!!counta\donefalse\donothing}%
\ifdone
\ifnum\!!counta>\plusone\advance\!!counta\minusone\else\exitloop\fi
\else
@@ -497,11 +513,11 @@
{\placebottomnotes}%
\ifdim\ht\scratchbox>\zeropoint
\setbox\scratchbox\hbox
- {\hbox to \zeropoint{\OTRSETgetgridcell\nofcolumns\lastcolumnlastcell}%
+ {\hbox to \zeropoint{\page_set_cell_get\nofcolumns\lastcolumnlastcell}%
\box\scratchbox}%
\ht\scratchbox\strutht
\dp\scratchbox\strutdp
- \OTRSETsetgridcell\nofcolumns\lastcolumnlastcell\box\scratchbox
+ \page_set_cell_set\nofcolumns\lastcolumnlastcell\box\scratchbox
\fi
\global\lastcolumnlastcell\zerocount
\fi}
@@ -512,7 +528,7 @@
\else
\OTRSETdofinalflush
\OTRSETdofinaloutput
- \ifnum\columnsetpage>0
+ \ifnum\columnsetpage>\zerocount
\dorecurse\nofcolumns{\doresetcolumnsetlines\recurselevel}%
\fi
\doglobal\increment\columnsetpage
@@ -568,11 +584,10 @@
\newdimen \OTRSETtextsheight
\let \OTRSETidentifier=\empty
-\def\OTRSETgetparameter#1#2{\csname\??mc\OTRSETidentifier\number#2#1\endcsname}
-\def\OTRSETsetparameter#1#2{\setvalue{\??mc\OTRSETidentifier\number#2#1}}
-
\def\OTRSETskipstart
- {\scratchcounter\executeifdefined{\??mc\OTRSETidentifier\c!start}\zerocount
+ {\doifelsenothing{\columnsetparameter\c!start}
+ {\scratchcounter\zerocount}%
+ {\scratchcounter\columnsetparameter\c!start}%
\relax % needed !
\ifcase\scratchcounter\else
\advance\scratchcounter\plusone
@@ -605,7 +620,7 @@
\hsize\d_page_set_local_hsize}
\unexpanded\def\page_set_command_synchronize_hsize
- {\ifcase0\getvalue{\??mc\??mc\c!width}\else % some width set
+ {\ifconditional\c_page_set_width_set
\bgroup
\scratchdimen\OTRSETlocalwidth\mofcolumns
\ifdim\scratchdimen=\textwidth
@@ -843,7 +858,7 @@
{\ifnum\columngaplimit>\zerocount
\donefalse
\dostepwiserecurse{#2}\columnmaxcells\plusone
- {\OTRSETdoifcellelse{#1}\recurselevel
+ {\page_set_cell_doifelse{#1}\recurselevel
{\ifdone
\!!countb\recurselevel \advance\!!countb -\!!counta\relax
\ifnum\!!countb>\plusone
@@ -851,7 +866,7 @@
\ifnum\!!countb<\columngaplimit\relax
\!!countb\recurselevel \advance\!!countb \minusone
\dostepwiserecurse\!!counta\!!countb\plusone
- {\OTRSETsetgridcell{#1}\recurselevel\copy\placeholderboxc}%
+ {\page_set_cell_set{#1}\recurselevel\copy\placeholderboxc}%
%\message{[gap]}%
\fi
\fi
@@ -965,7 +980,7 @@
\else
\advance\columnhcells \plusone
\advance\scratchcounter \plusone
- \advance\totalcolumnspace \OTRSETgetparameter\c!distance\scratchcounter
+ \advance\totalcolumnspace \namedcolumnsetparameter{\currentcolumnset:\number\scratchcounter}\c!distance
\fi
\else
\exitloop
@@ -987,9 +1002,9 @@
%\scratchcounter#2\advance\scratchcounter\minusone
%\ifnum\scratchcounter>0
% \dostepwiserecurse{#1}\!!countd\plusone
-% {\ifdim\wd\OTRSETgridcell\recurselevel\scratchcounter>\zeropoint
+% {\ifdim\wd\page_set_cell\recurselevel\scratchcounter>\zeropoint
% \let\columnspacetopoffset\plusone
-% \else\ifdim\dp\OTRSETgridcell\recurselevel\scratchcounter>\zeropoint
+% \else\ifdim\dp\page_set_cell\recurselevel\scratchcounter>\zeropoint
% \let\columnspacetopoffset\plusone
% \fi\fi}%
% \advance\!!counte \columnspacetopoffset \relax
@@ -1000,9 +1015,9 @@
%\advance\scratchcounter \columnvcells \relax
%\ifnum\scratchcounter>\columnmaxcells\else
% \dostepwiserecurse{#1}\!!countd\plusone
-% {\ifdim\wd\OTRSETgridcell\recurselevel\scratchcounter>\zeropoint
+% {\ifdim\wd\page_set_cell\recurselevel\scratchcounter>\zeropoint
% \let\columnspacebotoffset\plusone
-% \else\ifdim\dp\OTRSETgridcell\recurselevel\scratchcounter>\zeropoint
+% \else\ifdim\dp\page_set_cell\recurselevel\scratchcounter>\zeropoint
% \let\columnspacebotoffset\plusone
% \fi\fi}%
% \advance\!!counte \columnspacebotoffset \relax
@@ -1013,7 +1028,7 @@
\!!countf\recurselevel\relax
\dostepwiserecurse{#2}\!!counte\plusone % rows
{\ifenoughcolumncells
- \OTRSETdoifcellelse\!!countf\recurselevel
+ \page_set_cell_doifelse\!!countf\recurselevel
{\enoughcolumncellsfalse}{}%
\fi}%
\fi}%
@@ -1095,7 +1110,7 @@
\def\OTRSETstoreincolumnslotFXTB#1% fixed column
{\OTRSETcheckprefered
- \OTRSETdoifcellelse\pofcolumns\plusone
+ \page_set_cell_doifelse\pofcolumns\plusone
{\OTRSETprepareforcolumnslot2}{\OTRSETprepareforcolumnslot1}{#1}% % 1/2 dependent of place, todo
\OTRSETflushtextsofar
\OTRSETstoreincolumnslotindeed
@@ -1104,7 +1119,7 @@
\def\OTRSETstoreincolumnslotFXBT#1% fixed column
{\OTRSETcheckprefered
- \OTRSETdoifcellelse\pofcolumns\columnmaxcells
+ \page_set_cell_doifelse\pofcolumns\columnmaxcells
{\OTRSETprepareforcolumnslot2}{\OTRSETprepareforcolumnslot3}{#1}% % 3/2 dependent of place, todo
\OTRSETflushtextsofar
\OTRSETstoreincolumnslotindeed
@@ -1350,9 +1365,9 @@
\else
% only span if there is a next column with content
\dorecurse\columnmaxcells
- {\ifdim\ht\OTRSETgridcell\currenthcell\currentvcell>\zeropoint
+ {\ifdim\ht\page_set_cell\currenthcell\currentvcell>\zeropoint
\centergridcellonlyfalse
- \else\ifdim\dp\OTRSETgridcell\currenthcell\currentvcell>\zeropoint
+ \else\ifdim\dp\page_set_cell\currenthcell\currentvcell>\zeropoint
\centergridcellonlyfalse
\fi\fi}%
\fi
@@ -1360,10 +1375,10 @@
\currenthcell\recurselevel
\dorecurse\columnmaxcells
{\currentvcell\recurselevel\relax
- \ifdim\ht\OTRSETgridcell\currenthcell\currentvcell>\zeropoint
- \ifdim\dp\OTRSETgridcell\currenthcell\currentvcell=\zeropoint
+ \ifdim\ht\page_set_cell\currenthcell\currentvcell>\zeropoint
+ \ifdim\dp\page_set_cell\currenthcell\currentvcell=\zeropoint
\bgroup
- \setbox\scratchbox\OTRSETgetgridcell\currenthcell\currentvcell
+ \setbox\scratchbox\page_set_cell_get\currenthcell\currentvcell
\getnoflines{\ht\scratchbox}%
\!!counta\currentvcell
\advance\!!counta -\noflines
@@ -1380,9 +1395,9 @@
{\if!!doneb
\let\xrecurselevel\recurselevel
\dostepwiserecurse\!!counta\currentvcell\plusone
- {\ifdim\ht\OTRSETgridcell\xrecurselevel\recurselevel>\zeropoint
+ {\ifdim\ht\page_set_cell\xrecurselevel\recurselevel>\zeropoint
\!!donebfalse
- \else\ifdim\wd\OTRSETgridcell\xrecurselevel\recurselevel>\zeropoint
+ \else\ifdim\wd\page_set_cell\xrecurselevel\recurselevel>\zeropoint
\!!donebfalse
\fi\fi}%
\if!!doneb
@@ -1392,11 +1407,11 @@
\totalcolumnspace\OTRSETlocalwidth\currenthcell
\dostepwiserecurse\!!countc\!!countb\plusone
{\advance\totalcolumnspace \OTRSETlocalwidth\recurselevel
- \advance\totalcolumnspace \OTRSETgetparameter\c!distance\recurselevel}%
+ \advance\totalcolumnspace \namedcolumnsetparameter{\currentcolumnset:\recurselevel}\c!distance}%
\ifdim\totalcolumnspace>\wd\scratchbox
\setbox\scratchbox\hbox to \totalcolumnspace{\hss\box\scratchbox\hss}%
\fi
- \OTRSETsetgridcell\currenthcell\currentvcell\box\scratchbox
+ \page_set_cell_set\currenthcell\currentvcell\box\scratchbox
\egroup
\fi
\fi}}%
@@ -1405,8 +1420,8 @@
\def\OTRSETinitializecolumns% once per page
{\columnspreadtrue % todo
\ifcolumnspread
- \global\rofcolumns\getvalue{\??mc\OTRSETidentifier\c!nright}%
- \global\lofcolumns\getvalue{\??mc\OTRSETidentifier\c!nleft}%
+ \global\rofcolumns\columnsetparameter\c!nright
+ \global\lofcolumns\columnsetparameter\c!nleft
\global\tofcolumns\rofcolumns \relax
\ifodd\realpageno\relax
\global\nofcolumns\rofcolumns
@@ -1415,67 +1430,70 @@
\global\nofcolumns\lofcolumns
\fi
\else
- \global\nofcolumns\getvalue{\??mc\OTRSETidentifier\c!n}%
+ \global\nofcolumns\columnsetparameter\c!n
\global\rofcolumns\nofcolumns
\global\lofcolumns\nofcolumns
\global\tofcolumns\nofcolumns
\fi
\OTRSETassignwidths
\global\mofcolumns\plusone
- \columnerasegridboxes}
+ \page_set_cell_erase_grid}
-% vanaf hier:
-
-\unexpanded\def\definecolumnset
- {\dodoubleargument\dodefinecolumnset}
-
-\def\dodefinecolumnset[#1][#2]%
- {\getparameters[\??mc#1]
- [\c!direction=\v!right,
- \c!balance=\v!no,
- \c!distance=1.5\bodyfontsize, % controleren
- \c!n=2,
- \c!nleft=\getvalue{\??mc#1\c!n},
- \c!nright=\getvalue{\??mc#1\c!n},
- \c!width=\v!fit,
- \c!lines=0,
- \c!start=0,
- #2]%
- \dorecurse{\getvalue{\??mc#1\c!nleft}} % todo
- {\dododefinecolumnset[#1][\recurselevel]}%
- \dorecurse{\getvalue{\??mc#1\c!nright}} % todo
- {\dododefinecolumnset[#1][\recurselevel]}%
- % redo framed settings
- \setupcolumnset[#1][1][\c!distance=\zeropoint]}
-
-\def\dododefinecolumnset[#1][#2]%
- {\presetlocalframed
- [\??mc#1#2]%
- \setupcolumnset
- [#1][#2]
- [\c!offset=\v!overlay,
- \c!frame=\v!off,
- \c!align=,
- \c!lines=0,% really needed since c!regels is now part of framed
- \c!width=\getvalue{\??mc#1\c!width},
- \c!distance=\getvalue{\??mc#1\c!distance}]}
+% this is a first step in upgrading
+
+\installcorenamespace{columnset}
+
+\installframedcommandhandler \??columnset {columnset} \??columnset
+
+\setupcolumnset % todo, use the rather basic backgroundframed
+ [\c!direction=\v!right,
+ \c!balance=\v!no,
+ \c!distance=1.5\bodyfontsize,
+ \c!n=2,
+ \c!nleft=\columnsetparameter\c!n,
+ \c!nright=\columnsetparameter\c!n,
+ \c!width=\v!fit,
+ \c!lines=0,
+ \c!start=0,
+ \c!frame=\v!off,
+ \c!offset=\v!overlay,
+ \c!frame=\v!off,
+ \c!align=,
+ \c!lines=0]
+
+\let\page_set_setup_saved\setupcolumnset
+
+\newconditional\c_page_set_defining
+
+\appendtoks
+ \ifconditional\c_page_set_defining \else
+ \settrue\c_page_set_defining
+ \dorecurse{\columnsetparameter\c!nleft}
+ {\normalexpanded{\definecolumnset[\currentcolumnset:\recurselevel][\currentcolumnset]}}%
+ \dorecurse{\columnsetparameter\c!nright}
+ {\normalexpanded{\definecolumnset[\currentcolumnset:\recurselevel][\currentcolumnset]}}%
+ \normalexpanded{\page_set_setup_saved[\currentcolumnset:1][\c!distance=\zeropoint]}%
+ \setfalse\c_page_set_defining
+ \fi
+\to \everydefinecolumnset
\unexpanded\def\setupcolumnset
- {\dotripleargument\dosetupcolumnset}
+ {\dotripleargument\page_set_setup}
-\def\dosetupcolumnset[#1][#2][#3]%
+\def\page_set_setup[#1][#2][#3]%
{\ifthirdargument
- \def\docommand##1%
+ \unexpanded\def\page_set_setup_step##1%
{\doifelse{##1}\v!each
- {\dorecurse{\getvalue{\??mc#1\c!n}}{\docommand\recurselevel}}
- {\getparameters[\??mc#1##1][#3]}}%
- \processcommalist[#2]\docommand
+ {\dorecurse{\namedcolumnsetparameter{#1}\c!n}{\page_set_setup_step\recurselevel}}
+ {\normalexpanded{\page_set_setup_saved[#1:\recurselevel]}[#3]}}%
+ \processcommalist[#2]\page_set_setup_step
\else
- \getparameters[\??mc#1][#2]%
+ \page_set_setup_saved[#1][#2]%
\fi}
-
-\definecolumnset[\s!default][\c!n=2] % fallback
-
+
+\definecolumnset
+ [\s!default]
+
\unexpanded\def\page_set_command_next_page
{\page_otr_fill_and_eject_page
\relax\ifnum\mofcolumns>\plusone
@@ -1487,7 +1505,6 @@
\let\page_set_command_next_page_and_inserts\page_set_command_next_page
-
\def\OTRSETgotocolumn
{\dosingleempty\doOTRSETgotocolumn}
@@ -1517,7 +1534,7 @@
\currenthcell\mofcolumns
\currentvcell#1\advance\currentvcell \minusone
\dorecurse\currentvcell
- {\OTRSETdoifcellelse\mofcolumns\recurselevel\donothing
+ {\page_set_cell_doifelse\mofcolumns\recurselevel\donothing
{\advance\scratchcounter\plusone}}
\getnoflines\pagetotal
\advance\scratchcounter-\noflines
@@ -1564,7 +1581,7 @@
% \currenthcell\mofcolumns
% \currentvcell#2\advance\currentvcell \minusone
% \dorecurse\currentvcell
-% {\OTRSETdoifcellelse\mofcolumns\recurselevel\donothing
+% {\page_set_cell_doifelse\mofcolumns\recurselevel\donothing
% {\advance\scratchcounter\plusone}}
% \getnoflines\pagetotal
% \advance\scratchcounter-\noflines
@@ -1627,7 +1644,7 @@
% \stoptext
\def\OTRSETflushleftovers % new per 13/4/2006
- {\OTRSETdoifcellelse{1}{1}
+ {\page_set_cell_doifelse\plusone\plusone
{\bgroup
\OTRSETcentergridcells
\OTRSETbalancemethod\plusone
@@ -1742,8 +1759,8 @@
{\doifsomething\OTRSETlist
{\getfromcommacommand[\OTRSETlist][1]%
\global\let\OTRSETidentifier\commalistelement
- \doifundefined{\??mc\OTRSETidentifier\c!n}
- {\globallet\OTRSETidentifier\s!default}%
+ \xdef\currentcolumnset{\commalistelement}%
+ \checkcolumnsetparent
\let\newcommalistelement\empty
\doglobal\replaceincommalist\OTRSETlist1%
\OTRSETrestart}}
@@ -1769,8 +1786,8 @@
\OTRSETsetcorrectnofcells\currentcolumnstartcell
\advance\scratchcounter \minusone
\dorecurse\scratchcounter
- {\OTRSETdoifcellelse\mofcolumns\recurselevel
- \donothing{\OTRSETsetgridcell\mofcolumns\recurselevel\copy\placeholderboxe}}%
+ {\page_set_cell_doifelse\mofcolumns\recurselevel
+ \donothing{\page_set_cell_set\mofcolumns\recurselevel\copy\placeholderboxe}}%
\egroup}}
\unexpanded\def\page_set_command_routine
@@ -1795,13 +1812,13 @@
% new: raw
\OTRSETsetcolumnmaxcells
% direction
- \doifelsevalue{\??mc\OTRSETidentifier\c!direction}\v!right
+ \doifelse{\columnsetparameter\c!direction}\v!right
{\columndirection\zerocount}
{\columndirection\plusone}%
% balancing
\OTRSETbalancemethod\zerocount
\processaction
- [\getvalue{\??mc\OTRSETidentifier\c!balance}]
+ [\columnsetparameter\c!balance]
[ \v!yes=>\OTRSETbalancemethod\plusone,
\v!top=>\OTRSETbalancemethod\plustwo,
\v!bottom=>\OTRSETbalancemethod\plusthree]}
@@ -1911,29 +1928,31 @@
% interface to footnotes
+\installcorenamespace{columnsetwidth}
+
\def\OTRSETassignwidths
{%\scratchdimen\makeupwidth
\freezetextwidth \scratchdimen\textwidth
%
\scratchcounter\zerocount
\dorecurse\nofcolumns
- {\doifelsevalue{\??mc\OTRSETidentifier\recurselevel\c!width}\v!fit
- {\advance\scratchcounter \plusone }
- {\advance\scratchdimen -\getvalue{\??mc\OTRSETidentifier\recurselevel\c!width}}%
- \advance\scratchdimen -\getvalue{\??mc\OTRSETidentifier\recurselevel\c!distance}}%
+ {\doifelse{\namedcolumnsetparameter{\currentcolumnset:\recurselevel}\c!width}\v!fit
+ {\advance\scratchcounter \plusone}
+ {\advance\scratchdimen -\namedcolumnsetparameter{\currentcolumnset:\recurselevel}\c!width}%
+ \advance\scratchdimen -\namedcolumnsetparameter{\currentcolumnset:\recurselevel}\c!distance}%
\ifcase\scratchcounter\else
\divide\scratchdimen \scratchcounter
\fi
- \setgvalue{\??mc\??mc\c!width}{0}%
+ \global\setfalse\c_page_set_width_set
\dorecurse\nofcolumns
- {\doifelsevalue{\??mc\OTRSETidentifier\recurselevel\c!width}\v!fit
+ {\doifelse{\namedcolumnsetparameter{\currentcolumnset:\recurselevel}\c!width}\v!fit
{\dimen0=\scratchdimen}
- {\setgvalue{\??mc\??mc\c!width}{1}%
- \dimen0=\getvalue{\??mc\OTRSETidentifier\recurselevel\c!width}}%
- \setxvalue{\??mc\recurselevel\??mc\c!width}{\the\dimen0}}}
+ {\global\settrue\c_page_set_width_set
+ \dimen0=\namedcolumnsetparameter{\currentcolumnset:\recurselevel}\c!width}%
+ \setxvalue{\??columnsetwidth\recurselevel}{\the\dimen0}}}
\def\OTRSETlocalwidth#1%
- {\getvalue{\??mc\number#1\??mc\c!width}}
+ {\getvalue{\??columnsetwidth\number#1}}
\newbox\placeholderboxa
\newbox\placeholderboxb
@@ -2154,6 +2173,8 @@
% links rechts => odd, even, n, named
+\definesystemvariable {mt} % MulTicolumn
+
\unexpanded\def\definecolumntextarea
{\dotripleempty\dodefinecolumntextarea}
@@ -2330,7 +2351,7 @@
\c!height=\!!heighta]%
{\copy\scratchbox}%
\fi}%
- \OTRSETsetgridcell\!!counta\!!countb\box0
+ \page_set_cell_set\!!counta\!!countb\box0
\ifcase\!!countc\else
\advance\!!counta \columntextareaparameter\c!nx
\advance\!!counta -\!!countc
@@ -2347,7 +2368,7 @@
\c!height=\!!heighta,%
\c!hoffset=\!!widthb]%
{\copy\scratchbox}}%
- \OTRSETsetgridcell\!!counta\!!countb\box0%
+ \page_set_cell_set\!!counta\!!countb\box0%
\fi}
\unexpanded\def\setupcolumntextareatext
@@ -2385,7 +2406,7 @@
\fi
\advance\!!counta \plusone
\dostepwiserecurse\!!counta\!!countb\plusone
- {\advance\!!widtha\OTRSETgetparameter\c!distance\recurselevel}%
+ {\advance\!!widtha\namedcolumnsetparameter{\currentcolumnset:\recurselevel}\c!distance}%
\!!widthb\!!widtha
\advance\!!widthb -\!!countc\textwidth
\ifodd\realpageno \else % tricky, assumes that we keep there
@@ -2395,7 +2416,7 @@
\advance\!!widtha \namedlayoutparameter\v!odd \c!backspace
\advance\!!widthb \namedlayoutparameter\v!even\c!backspace
\dorecurse\!!countc
- {\advance\!!widtha\OTRSETgetparameter\c!distance\recurselevel}%
+ {\advance\!!widtha\namedcolumnsetparameter{\currentcolumnset:\recurselevel}\c!distance}%
\fi
\fi}
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index 5b66e2e1f..d2407bdd9 100644
--- a/tex/context/base/status-files.pdf
+++ b/tex/context/base/status-files.pdf
Binary files differ
diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf
index 378d9be23..a410bf055 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index fb3d0fe82..081dbca80 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : luatex-fonts-merged.lua
-- parent file : luatex-fonts.lua
--- merge date : 07/23/12 20:18:32
+-- merge date : 07/24/12 10:59:59
do -- begin closure to overcome local limits and interference