summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2011-01-18 19:34:00 +0100
committerHans Hagen <pragma@wxs.nl>2011-01-18 19:34:00 +0100
commit94e8563927cb29baf940ea15f9f48c9e06e1f95c (patch)
tree0b2052fcabdc0f570fb2a14b8fb97365c847abab /tex
parent4f903253161d4f14a4d880c75803766aba620005 (diff)
downloadcontext-94e8563927cb29baf940ea15f9f48c9e06e1f95c.tar.gz
beta 2011.01.18 19:34
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/anch-pos.mkii8
-rw-r--r--tex/context/base/anch-pos.mkiv8
-rw-r--r--tex/context/base/bibl-bib.mkiv10
-rw-r--r--tex/context/base/buff-ini.lua4
-rw-r--r--tex/context/base/buff-ver.lua8
-rw-r--r--tex/context/base/catc-ini.mkiv6
-rw-r--r--tex/context/base/cldf-ver.lua4
-rw-r--r--tex/context/base/cont-err.mkii (renamed from tex/context/base/cont-err.tex)0
-rw-r--r--tex/context/base/cont-fil.mkiv28
-rw-r--r--tex/context/base/cont-mtx.tex25
-rw-r--r--tex/context/base/cont-new.mkii923
-rw-r--r--tex/context/base/cont-new.mkiv582
-rw-r--r--tex/context/base/cont-new.tex995
-rw-r--r--tex/context/base/cont-sys.ori4
-rw-r--r--tex/context/base/cont-usr.ori109
-rw-r--r--tex/context/base/context.mkii9
-rw-r--r--tex/context/base/context.mkiv4
-rw-r--r--tex/context/base/context.tex2
-rw-r--r--tex/context/base/core-fil.mkiv25
-rw-r--r--tex/context/base/core-job.mkii41
-rw-r--r--tex/context/base/core-job.mkiv94
-rw-r--r--tex/context/base/data-env.lua6
-rw-r--r--tex/context/base/enco-fde.mkii2
-rw-r--r--tex/context/base/enco-ffr.mkii2
-rw-r--r--tex/context/base/enco-ini.mkiv12
-rw-r--r--tex/context/base/enco-l7x.mkii16
-rw-r--r--tex/context/base/enco-t5.mkii6
-rw-r--r--tex/context/base/enco-x5.mkii6
-rw-r--r--tex/context/base/font-ini.mkiv130
-rw-r--r--tex/context/base/l-string.lua4
-rw-r--r--tex/context/base/luat-cod.mkiv4
-rw-r--r--tex/context/base/mtx-context-arrange.tex3
-rw-r--r--tex/context/base/mult-cld.lua74
-rw-r--r--tex/context/base/mult-def.lua3
-rw-r--r--tex/context/base/mult-def.mkiv4
-rw-r--r--tex/context/base/mult-ini.lua100
-rw-r--r--tex/context/base/mult-ini.mkiv85
-rw-r--r--tex/context/base/mult-sys.mkii13
-rw-r--r--tex/context/base/mult-sys.mkiv10
-rw-r--r--tex/context/base/page-ini.mkiv6
-rw-r--r--tex/context/base/page-set.mkii15
-rw-r--r--tex/context/base/page-set.mkiv15
-rw-r--r--tex/context/base/s-fnt-10.tex4
-rw-r--r--tex/context/base/s-fnt-26.tex1
-rw-r--r--tex/context/base/s-fnt-29.tex4
-rw-r--r--tex/context/base/s-mod-02.mkii4
-rw-r--r--tex/context/base/s-mod-02.mkiv4
-rw-r--r--tex/context/base/spec-dpm.mkii4
-rw-r--r--tex/context/base/spec-dpx.mkii4
-rw-r--r--tex/context/base/spec-dvi.mkii4
-rw-r--r--tex/context/base/spec-pdf.mkii4
-rw-r--r--tex/context/base/spec-tst.mkii4
-rw-r--r--tex/context/base/spec-win.mkii4
-rw-r--r--tex/context/base/spec-xtx.mkii4
-rw-r--r--tex/context/base/strc-ren.mkiv6
-rw-r--r--tex/context/base/strc-sec.mkiv4
-rw-r--r--tex/context/base/strc-syn.lua1
-rw-r--r--tex/context/base/supp-fil.mkiv6
-rw-r--r--tex/context/base/supp-mat.mkiv12
-rw-r--r--tex/context/base/supp-pat.mkii4
-rw-r--r--tex/context/base/symb-mis.mkiv4
-rw-r--r--tex/context/base/symb-was.mkii4
-rw-r--r--tex/context/base/syst-aux.mkiv7
-rw-r--r--tex/context/base/type-ghz.mkiv10
-rw-r--r--tex/context/base/type-ini.mkiv1
-rw-r--r--tex/context/base/type-lua.mkiv4
-rw-r--r--tex/context/base/type-otf.mkiv83
-rw-r--r--tex/context/base/type-set.mkii8
-rw-r--r--tex/context/base/type-set.mkiv6
-rw-r--r--tex/context/base/type-siz.mkiv2
-rw-r--r--tex/context/base/v-default.lua3
-rw-r--r--tex/context/base/v-lua.lua2
-rw-r--r--tex/context/base/x-mathml.lua465
-rw-r--r--tex/context/base/x-res-08.tex4
-rw-r--r--tex/context/base/x-set-11.mkiv1
-rw-r--r--tex/context/config/cont-usr.tex109
-rw-r--r--tex/context/interface/cont-cs.xml7
-rw-r--r--tex/context/interface/cont-de.xml7
-rw-r--r--tex/context/interface/cont-en.xml7
-rw-r--r--tex/context/interface/cont-fr.xml7
-rw-r--r--tex/context/interface/cont-it.xml7
-rw-r--r--tex/context/interface/cont-nl.xml7
-rw-r--r--tex/context/interface/cont-pe.xml7
-rw-r--r--tex/context/interface/cont-ro.xml7
-rw-r--r--tex/context/user/cont-sys.rme4
-rw-r--r--tex/generic/context/luatex-fonts-merged.lua6
86 files changed, 2280 insertions, 1982 deletions
diff --git a/tex/context/base/anch-pos.mkii b/tex/context/base/anch-pos.mkii
index 589c4aa26..c793f7ba4 100644
--- a/tex/context/base/anch-pos.mkii
+++ b/tex/context/base/anch-pos.mkii
@@ -637,7 +637,13 @@
\iftracepositions\registerparsymbol\fi}
\def\traceposstring#1#2#3%
- {\iftracepositions\smashedhbox{#1{\infofont#2#3}}\fi}
+ {\iftracepositions
+ \smashedhbox
+ {#1{\infofont#2#3}%
+ \scratchdimen.5\points
+ \kern-2\scratchdimen
+ \vrule\!!width4\scratchdimen\!!height\scratchdimen\!!depth\scratchdimen}%
+ \fi}
\def\registerparsymbol
{\iftracepositions
diff --git a/tex/context/base/anch-pos.mkiv b/tex/context/base/anch-pos.mkiv
index d136dbc0a..69d3525c6 100644
--- a/tex/context/base/anch-pos.mkiv
+++ b/tex/context/base/anch-pos.mkiv
@@ -549,7 +549,13 @@
\iftracepositions\registerparsymbol\fi}
\def\traceposstring#1#2#3%
- {\iftracepositions\smashedhbox{#1{\infofont#2#3}}\fi}
+ {\iftracepositions
+ \smashedhbox
+ {#1{\infofont#2#3}%
+ \scratchdimen.5\points
+ \kern-2\scratchdimen
+ \vrule\!!width4\scratchdimen\!!height\scratchdimen\!!depth\scratchdimen}%
+ \fi}
\def\registerparsymbol
{\iftracepositions
diff --git a/tex/context/base/bibl-bib.mkiv b/tex/context/base/bibl-bib.mkiv
index 9f8e8c55b..f4200635c 100644
--- a/tex/context/base/bibl-bib.mkiv
+++ b/tex/context/base/bibl-bib.mkiv
@@ -465,9 +465,13 @@
\doloadbibtexpublicationalternative
\to \everysetupbibtexpublications
-\appendtoks
- \doloadbibtexpublicationalternative
-\to \everystarttext % was everyjob, will change anyway
+% we expect at least one invocation of the setup commands
+% because otherwise we always load the apa style even if
+% no publications are used
+%
+% \appendtoks
+% \doloadbibtexpublicationalternative
+% \to \everystarttext
% whatever, should be key
diff --git a/tex/context/base/buff-ini.lua b/tex/context/base/buff-ini.lua
index 6dbdf542b..a1e1f5d6b 100644
--- a/tex/context/base/buff-ini.lua
+++ b/tex/context/base/buff-ini.lua
@@ -70,7 +70,7 @@ local function collectcontent(names,separator) -- no print
t[n] = c
end
end
- return concat(t,separator or "\r") -- "\n" is safer due to comments and such
+ return concat(t,separator or "\r")
end
end
@@ -123,7 +123,7 @@ function commands.grabbuffer(name,begintag,endtag,bufferdata) -- maybe move \\ t
if dn == "" then
dn = sub(bufferdata,1,-2)
else
- dn = dn .. "\n" .. sub(bufferdata,1,-2)
+ dn = dn .. "\n" .. sub(bufferdata,1,-2) -- no \r, \n is more generic
end
local last = sub(dn,-1)
if last == "\n" or last == "\r" then
diff --git a/tex/context/base/buff-ver.lua b/tex/context/base/buff-ver.lua
index 070224751..7427e1f86 100644
--- a/tex/context/base/buff-ver.lua
+++ b/tex/context/base/buff-ver.lua
@@ -349,7 +349,8 @@ function visualizers.registerescapepattern(name,before,after,normalmethod,escape
(before / "")
* ((1 - after)^0 / (escapemethod or texmethod))
* (after / "")
- + hack((1 - before)^1) / (normalmethod or defaultmethod)
+ -- + hack((1 - before)^1) / (normalmethod or defaultmethod)
+ + ((1 - before)^1) / (normalmethod or defaultmethod)
)^0
escapepatterns[name] = escapepattern
end
@@ -460,7 +461,8 @@ local emptyline = C(patterns.emptyline) * CargOne / f_emptyline
local beginline = C(patterns.beginline) * CargOne / f_beginline
local anything = C(patterns.somecontent) * CargOne / f_default
-local verbosed = (space + newline * (emptyline^0) * beginline + anything)^0
+----- verbosed = (space + newline * (emptyline^0) * beginline + anything)^0
+local verbosed = (space + newline * (emptyline^0) * beginline + emptyline + newline + anything)^0
local function write(s,settings) -- bad name
lpegmatch(verbosed,s,1,settings or false)
@@ -599,7 +601,7 @@ local function filter(lines,settings) -- todo: inline or display in settings
first, last = getrange(lines,first,last,range)
first, last = getstrip(lines,first,last)
end
- local content = concat(lines,(settings.nature == "inline" and " ") or "\n",first,last)
+ local content = concat(lines,(settings.nature == "inline" and " ") or "\r",first,last) -- was \n
return content, m
end
diff --git a/tex/context/base/catc-ini.mkiv b/tex/context/base/catc-ini.mkiv
index e86ee9593..9e974545e 100644
--- a/tex/context/base/catc-ini.mkiv
+++ b/tex/context/base/catc-ini.mkiv
@@ -207,8 +207,7 @@
:\number#1\endcsname}
%D \macros
-%D {restorecatcodes,
-%D beginrestorecatcodes,endrestorecatcodes}
+%D {restorecatcodes,pushcatcodetable,popcatcodetable}
%D
%D We're not finished dealing \CATCODES\ yet. In \CONTEXT\ we
%D use only one auxiliary file, which deals with tables of
@@ -282,9 +281,6 @@
\let\tracepushcatcodetable\empty
\let\tracepopcatcodetable \empty
-\def\beginrestorecatcodes{\pushcatcodetable}
-\def\endrestorecatcodes {\popcatcodetable}
-
%D Handy for debugging:
% \tracecatcodetables
diff --git a/tex/context/base/cldf-ver.lua b/tex/context/base/cldf-ver.lua
index 120bc468a..54cc6a58b 100644
--- a/tex/context/base/cldf-ver.lua
+++ b/tex/context/base/cldf-ver.lua
@@ -15,7 +15,7 @@ local tostring, type = tostring, type
local context = context
local function flush(...)
- context(concat{...,"\n"})
+ context(concat{...,"\r"}) -- was \n
end
local function t_tocontext(...)
@@ -57,7 +57,7 @@ end
function context.tobuffer(name,str)
context.startbuffer { name }
context.pushcatcodes("verbatim")
- local lines = (type(str) == "string" and find(str,"\n") and splitlines(str)) or str
+ local lines = (type(str) == "string" and find(str,"[\n\r]") and splitlines(str)) or str
for i=1,#lines do
context(lines[i] .. " ")
end
diff --git a/tex/context/base/cont-err.tex b/tex/context/base/cont-err.mkii
index f01ce87aa..f01ce87aa 100644
--- a/tex/context/base/cont-err.tex
+++ b/tex/context/base/cont-err.mkii
diff --git a/tex/context/base/cont-fil.mkiv b/tex/context/base/cont-fil.mkiv
index b295872ca..181a881b5 100644
--- a/tex/context/base/cont-fil.mkiv
+++ b/tex/context/base/cont-fil.mkiv
@@ -13,30 +13,18 @@
\writestatus{loading}{ConTeXt File Synonyms}
-\definefilesynonym [chemie] [chemic]
\definefilesynonym [chemics] [chemic]
\definefilesynonym [unit] [units]
-\definefilesynonym [eenheid] [units]
-\definefilesynonym [einheit] [units]
\definefilesynonym [pstric] [pstricks]
\definefilesynonym [pstrick] [pstricks]
\definefilesynonym [finance] [financ]
-\definefilesynonym [con-01] [contml] % will go away
-
-%definefilesynonym [sch-base] [sch-00]
-%definefilesynonym [sch-make] [sch-01]
-
\definefilesynonym [dir-make] [dir-01]
\definefilesynonym [dir-identify] [dir-05]
-\definefilesynonym [xml-format] [xml-01]
-\definefilesynonym [xml-pretty] [xml-02]
-\definefilesynonym [xml-analyze] [xml-11]
-
\definefilesynonym [int-load] [set-11]
\definefilesynonym [int-make] [set-12]
@@ -84,9 +72,7 @@
%definefilesynonym [pre-more] [pre-24]
%definefilesynonym [pre-more] [pre-25]
-
\definefilesynonym [pre-more] [pre-26]
-
%definefilesynonym [pre-more] [pre-27]
%definefilesynonym [pre-more] [pre-28]
%definefilesynonym [pre-more] [pre-29]
@@ -101,22 +87,8 @@
\definefilesynonym [abr-pseudocaps] [abr-01]
\definefilesynonym [abr-smallcaps] [abr-02]
-\definefilesynonym [chinese] [chi-00]
-\definefilesynonym [japanese] [jap-00]
-
-%definefilesynonym [chi-simplified] [chi-01]
-%definefilesynonym [chi-traditional] [chi-02]
-
-\definefilesynonym [greek] [grk-00]
-
-\definefilesynonym [unic-chi] [unic-cjk]
-\definefilesynonym [unic-jap] [unic-cjk]
-
-%definefilesynonym [practexjournal] [ptj-01]
\definefilesynonym [pracjourn] [ptj-01]
-
\definefilesynonym [maps] [map-10]
-\definefilesynonym [map-se] [map-10] % for some time
\definefilesynonym [mml] [mathml]
\definefilesynonym [cml] [chemml]
diff --git a/tex/context/base/cont-mtx.tex b/tex/context/base/cont-mtx.tex
deleted file mode 100644
index 833785a7f..000000000
--- a/tex/context/base/cont-mtx.tex
+++ /dev/null
@@ -1,25 +0,0 @@
-%D \module
-%D [ file=cont-mtx,
-%D version=2006.01.01, % no date -)
-%D title=\CONTEXT\ Miscellaneous Macros,
-%D subtitle=Experimental MetaTeX Macros,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% format generation : texexec --make --all --luatex
-%
-% pdftex compatible run : texexec --luatex filename
-% aleph compatible run : texexec --luatex --output=dvipdfmx filename
-%
-% or, at top of tex file : % engine=luatex
-
-% \loadcorefile{meta-xxx.tex}
-
-%D Here we load files that are not yet part of the core.
-
-\endinput
diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii
index 79a2f5846..1dafcb61f 100644
--- a/tex/context/base/cont-new.mkii
+++ b/tex/context/base/cont-new.mkii
@@ -11,6 +11,927 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+\newcontextversion{2011.01.18 19:34}
+
+%D This file is loaded at runtime, thereby providing an
+%D excellent place for hacks, patches, extensions and new
+%D features.
+
+\unprotect
+
+% it's about time to clean up this file ...
+
+\writestatus\m!systems{beware: some patches loaded from cont-new.mkii}
+
+% \ifx\pdfmapfile \undefined \else \pdfmapfile{ } \fi
+
+% \font\f=dummyfont \rpcode\f0=500 \hbox{..}\char0
+% todo: mp-new
+% caption: grid=top|bottom in xml defs
+
+\def\fastscale#1%
+ {\begingroup
+ \ifnum#1=1000\relax
+ \setfalse\scaleboxdone
+ \else
+ \settrue\scaleboxdone
+ \edef\finalscaleboxxscale{\withoutpt\the\dimexpr#1pt/1000\relax}%
+ \let\finalscaleboxyscale\finalscaleboxxscale
+ \fi
+ \dowithnextbox{\doscaleboxindeed\flushnextbox\endgroup}\hbox}
+
+% \setupcaption [figure] [align=flushleft]
+% \setupcaption [figure-1] [align=flushleft,leftmargin=10mm]
+% \setupcaption [figure-2] [align=flushleft,leftmargin=10mm,rightmargin=-10mm,width=\textwidth]
+%
+% \startsetups somefigure
+% \ifdim\floatsetupwidth>\textwidth
+% \placesetupfloat[figure-2]
+% \else
+% \placesetupfloat[figure-1]
+% \fi
+% \stopsetups
+%
+% \placefloatwithsetups[somefigure]{}{\externalfigure[dummy][width=5cm,height=2cm]}
+
+\def\placefloatwithsetups
+ {\dotripleempty\doplacefloatwithsetups}
+
+\long\def\doplacefloatwithsetups[#1][#2][#3]#4%
+ {\def\floatsetupcaption {#4}%
+ \def\floatsetupcontent {\copy\nextbox}%
+ \def\floatsetupwidth {\wd\nextbox}%
+ \def\floatsetupheight {\ht\nextbox}%
+ \def\placesetupfloat[##1]{\placefloat[##1][#2][#3]{#4}{\floatsetupcontent}}% #4 and not \floatsetupcaption (unexpanded)
+ \dowithnextbox{\setups[#1]}\vbox}
+
+\def\dividedsize#1#2#3% size gap n
+ {\dimexpr
+ \ifnum\dimexpr#1\relax>\plusone
+ (\dimexpr#1\relax-\numexpr#3-1\relax\dimexpr#2\relax)/#3\else#1%
+ \fi
+ \relax}
+
+% \setuplabeltext[\s!itemcount1={{I(},{)}}]
+% \def\labeledcountervalue#1{\labeltexts{#1}{\countervalue{#1}}}
+
+\def\singlewidened #1{\hbox spread 1em{\hss#1\hss}}
+\def\complexwidened[#1]#2{\hbox spread #1{\hss#2\hss}}
+
+\definecomplexorsimple\widened
+
+% todo
+%
+% \def\definelocation{\dodoubleargument\dodefinelocation}
+% \def\dodefinelocation[#1][#2]{\setvalue{loc:#1}{#2}}
+%
+% \definelocation[lt] [\v!left\v!top]
+% \definelocation[tl] [\v!left\v!top]
+% \definelocation[\v!top\v!left][\v!left\v!top]
+%
+% \def\getlocation#1{\executeifdefined{loc:#1}{#1}}
+
+% just in case we load something from a file (pdfr-ec for instance)
+
+\prependtoks \restoreendofline \to \everybeforeshipout
+
+% \let\cs\getvalue % no, we want \cs to be czech
+
+% experimental so this may change
+
+\def\startdescriptions
+ {\dosingleempty\dostartdescriptions}
+
+\def\dostartdescriptions[#1]%
+ {\begingroup
+ \def\item{\getvalue{#1}}%
+ \let\dostoppairdescription \donothing
+ \let\@@description \dostartpairdescription
+ \let\@@startsomedescription\dostartsomedescription}
+
+\def\stopdescriptions
+ {\dostoppairdescription
+ \endgroup}
+
+\def\dostartpairdescription[#1][#2]%
+ {\dostoppairdescription
+ \def\dostoppairdescription{\@@stopdescription{#1}}%
+ \bgroup
+ \def\currentdescription{#1}%
+ \doifelse{\descriptionparameter{\s!do\c!state}}\v!start
+ {\@@makedescription{#1}[#2]{}}
+ {\@@makedescription{#1}[#2]}}
+
+\def\dostartsomedescription% #1[#2]#3%
+ {\bgroup
+ \@@makedescription} % {#1}[#2]{#3}}
+
+% \starttext
+%
+% \definedescription[test]
+%
+% \startdescriptions
+% \test{Foo} Bar bar bar
+% \test{Foo} Bar bar bar
+% \test{Foo} Bar bar bar
+% \stopdescriptions
+%
+% \startdescriptions[test]
+% \item{Foo} Bar bar bar
+% \item{Foo} Bar bar bar
+% \item{Foo} Bar bar bar
+% \stopdescriptions
+%
+% \startdescriptions
+% \starttest{Foo} Bar bar bar \stoptest
+% \starttest{Foo} Bar bar bar \stoptest
+% \starttest{Foo} Bar bar bar \stoptest
+% \stopdescriptions
+%
+% \startdescriptions[test]
+% \item{Foo} Bar bar bar
+% \item{Foo} Bar bar bar
+% \item{Foo} Bar bar bar
+% \stopdescriptions
+%
+% \stoptext
+
+% to do:
+%
+% \def\defineshapesynonym
+% {\dodoubleargument\dodefineshapesynonym}
+%
+% \def\dodefineshapesynonym[#1][#2]%
+% {\setvalue{shsy:#1}{#2}}
+%
+% \def\shapesynonym#1%
+% {\ifcsname shsy:#1\endcsname
+% \expandafter\shapesynonym\csname shsy:#1\endcsname\else#1%
+% \fi}
+%
+%\defineshapesynonym[eacute] [e]
+%\defineshapesynonym[egrave] [e]
+%\defineshapesynonym[eumlaut [e]
+%\defineshapesynonym[eogonek][e]
+%
+% more reduction
+%
+%\defineshapesynonym[e][o]
+%\defineshapesynonym[w][v]
+%\defineshapesynonym[m][n]
+%
+% \shapesynonym{eacute}
+
+% this will be activated when
+
+% \newinsert\thispageinsert % <- installinsertion
+
+% \def\flushatthispage
+% {\bgroup
+% \dowithnextbox{\insert\thispageinsert{\box\nextbox}\egroup}%
+% \hbox}
+
+% \appendtoks
+% \ifvoid\thispageinsert\else\hbox{\smashedbox\thispageinsert}\fi
+% \to \everyshipout
+
+% \definemarkedpage[nobackgrounds]
+% \markpage[nobackgrounds]
+% \doifmarkedpageelse{nobackgrounds}
+
+\newcounter\nofmarkedpages
+
+\def\definemarkedpage[#1]%
+ {\definetwopasslist{\v!page:#1}}
+
+\def\markpage[#1]% looks very much like domarginreference
+ {\iftrialtypesetting\else
+ \doglobal\increment\nofmarkedpages\relax
+ \lazysavetwopassdata{\v!page:#1}{\nofmarkedpages}{\noexpand\realfolio}%
+ \fi}
+
+\def\doifmarkedpageelse#1%
+ {\gettwopassdatalist{\v!page:#1}%
+ \expanded{\doifinsetelse{\realfolio}{\twopassdatalist}}}
+
+% Just a simple and fast hanger, for usage in macros.
+
+\def\setuphanging
+ {\dodoubleempty\getparameters[\??ha]}
+
+\setuphanging
+ [\c!distance=.5em]
+
+\def\starthanging
+ {\noindent\bgroup
+ \dowithnextbox
+ {\setbox\nextbox\hbox{\flushnextbox\hskip\@@hadistance}%
+ \hangindent\nextboxwd
+ \hangafter\plusone
+ \flushnextbox\ignorespaces}
+ \hbox}
+
+\def\stophanging
+ {\endgraf
+ \egroup}
+
+% experimental
+
+\def\stophangaround
+ {\endgraf
+ \egroup}
+
+\def\starthangaround
+ {\noindent\bgroup
+ \dowithnextbox
+ {\ifdim\nextboxht>\strutht\setbox\nextbox\tbox{\flushnextbox}\fi
+ \setbox\nextbox\hbox{\flushnextbox\hskip\@@hadistance}%
+ \getboxheight\scratchdimen\of\box\nextbox
+ \getnoflines\scratchdimen
+ \nextboxht\strutht
+ \nextboxdp\strutdp
+ \hangindent\nextboxwd
+ \hangafter-\noflines
+ \llap{\flushnextbox}\ignorespaces}
+ \hbox}
+
+\def\modevalue#1#2#3%
+ {\@EA\ifx\csname\@mode@\systemmodeprefix#1\endcsname\endcsname\enabledmode#2\else#2\fi}
+
+\def\systemmodevalue#1%
+ {\modevalue{\systemmodeprefix#1}}
+
+% \getmulticolumnlines -> now in cont-loc, to be tested and really needed
+
+% \tracefonthandlingtrue
+
+% new, still to be improved
+%
+% \dorecurse{10}
+% {\input thuan
+% \placefigure{}{\framed[height=1.5cm]{test}}
+% \placefloatplaceholder}
+
+\def\placefloatplaceholder
+ {\ifroomforfloat \else
+ \scratchdimen\pagegoal
+ \advance\scratchdimen-\pagetotal
+ \advance\scratchdimen-3\lineheight
+ \ifdim\scratchdimen>\zeropoint
+ \startlinecorrection[blank]
+ \mhbox{\inframed{\labeltexts{placeholder}{\lastcaptiontag}}}%
+ \stoplinecorrection
+ \else
+ \allowbreak
+ \fi
+ \fi}
+
+\setuplabeltext
+ [placeholder={, moved}]
+
+% etex only, of course we could just parse (scan for \% in string)
+
+\newif\ifpercentdimendone
+
+\bgroup % usage: \setpercentdimen\somedimen{% or dimen} todo: pct
+\catcode124=\@@comment
+\catcode 37=\@@active
+\gdef\setpercentdimen#1#2|
+ {\xdef\@@expanded{#2}|
+ \ifx\@@expanded\empty\else
+ \bgroup
+ \global\percentdimendonefalse
+ \def\%{\dimexpr#1/100\relax\global\percentdimendonetrue\ignorespaces}| scantokens add's a space
+ \catcode`%=\@@active
+ \catcode`\\=\@@escape
+ \let%\%|
+ \scratchdimen#1|
+ \xdef\@@expanded{\@@expanded\scratchdimen\!!zeropoint}| trick: when 1.2 => .2\scratchdimen and 0pt typeset
+ \startnointerference
+ \global\globalscratchdimen\scantokens\@EA{\@@expanded}| i'm lazy and use etex
+ \stopnointerference
+ \egroup
+ #1\globalscratchdimen
+ \fi}
+\egroup
+
+% TEX alternative, in principle accurate enough and also a bit faster
+
+% \bgroup
+%
+% \catcode`\%=\@@other
+% \catcode`\|=\@@comment
+%
+% \gdef\setpercentdimen#1#2|
+% {\beforesplitstring#2\at%\to\ascii
+% \doifelse\ascii{#2}
+% {#1=#2}
+% {\divide#1by100\relax#1=\ascii#1\relax}} | or: {#1=\ascii#1\divide#1by100\relax}}
+%
+% \egroup
+%
+% \dimen0=1000pt \setpercentdimen{\dimen0}{10%} \the\dimen0
+% \dimen0= 100pt \setpercentdimen{\dimen0}{10%} \the\dimen0
+% \dimen0= 95pt \setpercentdimen{\dimen0}{10%} \the\dimen0
+% \dimen0= 10pt \setpercentdimen{\dimen0}{10%} \the\dimen0
+% \dimen0= 1pt \setpercentdimen{\dimen0}{10%} \the\dimen0
+
+\bgroup
+
+\obeylines % don't remove %'s !
+
+\gdef\collapsedspace#1%
+ {\ifx#1^^M%
+ \expandafter\collapsedspace
+ \else
+ \space
+ \expandafter#1%
+ \fi}
+
+\gdef\collapsespaces
+ {\prependtoksonce\relax\to\everyeof%
+ \ignorelines%
+ \ignoretabs%
+ \let\obeyedspace\collapsedspace%
+ \obeyspaces}
+
+\egroup
+
+\def\inlinedbox
+ {\bgroup
+ \dowithnextbox
+ {\scratchdimen\nextboxht
+ \advance\scratchdimen\nextboxdp
+ \advance\scratchdimen-\lineheight
+ \divide\scratchdimen\plustwo
+ \advance\scratchdimen\strutdepth
+ \setbox\nextbox\hbox{\lower\scratchdimen\flushnextbox}%
+ \nextboxht\strutht
+ \nextboxdp\strutdp
+ \flushnextbox
+ \egroup}%
+ \hbox}
+
+% \readfile{cont-exp}\donothing\donothing % speed up (5-20%)
+
+\def\dimenratio#1#2% etex only
+ {\withoutpt\the\dimexpr2\dimexpr(#1)/\dimexpr(#2)/32768\relax\relax}
+
+\def\doxprecurse#1#2%
+ {\ifnum#1=\zerocount % no \ifcase
+ \expandafter\gobblethreearguments
+ \else
+ #2\expandafter\expandafter\expandafter\doxprecurse\expandafter
+ \fi\expandafter{\the\numexpr#1-1\relax}{#2}}
+
+\def\buttonframed{\dodoubleempty\localframed[\??bt]} % goodie
+
+\unexpanded\def\asciistr#1{\dontleavehmode{\defconvertedargument\ascii{#1}\verbatimfont\ascii}}
+
+\def\shapefill{\vskip\zeropoint\!!plus\lineheight\!!minus\lineheight\relax}
+
+\let\normaltype\type
+
+\ifx\scantextokens\undefined
+ \ifx\scantokens\undefined
+ \unexpanded\def\retype#1{\dontleavehmode{\defconvertedargument\ascii{#1}\@EA\normaltype\@EA{\ascii}}}
+ \else
+ \unexpanded\def\retype#1{\dontleavehmode\scantokens{\normaltype{#1}\ignorespaces}\relax}
+ \fi
+\else
+ \unexpanded\def\retype#1{\dontleavehmode\scantextokens{\normaltype{#1}}}
+\fi
+
+\def\simplifytype{\let\type\retype}
+
+% \ruledhbox
+% {\startignorespaces
+% \def\oeps{a}
+% \startignorespaces
+% \def\oeps{a}
+% \stopignorespaces
+% \def\oeps{a}
+% \stopignorespaces
+% \oeps}
+
+\newsignal\boissignal
+\newcount \boislevel
+
+\long\def\startignorespaces
+ {\advance\boislevel\plusone
+ \ifcase\boislevel\or \ifhmode
+ \hskip\boissignal
+ \fi \fi
+ \ignorespaces}
+
+\long\def\stopignorespaces
+ {\ifcase\boislevel\or \ifhmode
+ \doloop
+ {\ifdim\lastskip=\zeropoint
+ \exitloop
+ \else\ifdim\lastskip=\boissignal
+ \unskip
+ \exitloop
+ \else
+ \unskip
+ \fi\fi}%
+ \fi \fi
+ \advance\boislevel\minusone}
+
+\def\minimalhbox#1#%
+ {\dowithnextbox
+ {\bgroup
+ \setbox\scratchbox\hbox#1{\hss}%
+ \ifdim\nextboxwd<\wd\scratchbox\nextboxwd\wd\scratchbox\fi
+ \flushnextbox
+ \egroup}
+ \hbox}
+
+% \def\dodimchoice#1#2#3%
+% {\ifx#3\relax
+% #1\@EA\gobbleuntilrelax
+% \else\ifdim#1#2%
+% #3\@EAEAEA\gobbleuntilrelax
+% \else
+% \@EAEAEA\dodimchoice
+% \fi\fi{#1}}
+
+% \def\donumchoice#1#2#3%
+% {\ifx#3\relax
+% #1\@EA\gobbleuntilrelax
+% \else\ifnum#1#2%
+% #3\@EAEAEA\gobbleuntilrelax
+% \else
+% \@EAEAEA\dodimchoice
+% \fi\fi{#1}}
+
+% \def\dimchoice#1#2{\dodimchoice{#1}#2\empty\relax}
+% \def\numchoice#1#2{\donumchoice{#1}#2\empty\relax}
+
+\def\gobbleuntilempty#1\empty{}
+
+\def\dodimchoice#1#2#3%
+ {\ifdim#1#2%
+ #3\@EA\gobbleuntilempty
+ \else
+ \@EA\dodimchoice
+ \fi{#1}}
+
+\def\donumchoice#1#2#3%
+ {\ifnum#1#2%
+ #3\@EA\gobbleuntilempty
+ \else
+ \@EA\dodimchoice
+ \fi{#1}}
+
+\def\dimchoice#1#2{\dodimchoice{#1}#2{=#1}{#1}\empty}
+\def\numchoice#1#2{\donumchoice{#1}#2{=#1}{#1}\empty}
+
+% \the\dimexpr(\dimchoice {7pt}{{<10pt}{8pt}{<12pt}{9pt}{<15pt}{10pt}{=11pt}{12pt}})
+% \the\dimexpr(\dimchoice{11pt}{{<10pt}{8pt}{<12pt}{9pt}{<15pt}{10pt}{=11pt}{12pt}})
+% \the\dimexpr(\dimchoice{14pt}{{<10pt}{8pt}{<12pt}{9pt}{<15pt}{10pt}{=11pt}{12pt}})
+
+\def\showsetupsdefinition[#1]{\showvalue{\??su:#1}} % temp hack for debugging
+
+% will be a MyWay
+%
+% \setuplayout[grid=yes] \setupcaption[figure][inbetween=] \useMPlibrary[dum] \setupcolors[state=start]
+%
+% \starttext \showgrid \showstruts
+%
+% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.4,grid=yes]}
+% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.4,grid=fit]}
+% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.4,grid=height]}
+% \input ward
+% \page
+% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.5,grid=yes]}
+% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.5,grid=fit]}
+% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.5,grid=height]}
+% \input ward
+% \page
+% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.6,grid=yes]}
+% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.6,grid=fit]}
+% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.6,grid=height]}
+% \input ward
+% \page
+% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.4,grid=yes]}
+% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.4,grid=fit]}
+% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.4,grid=height]}
+% \input ward
+% \page
+% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.5,grid=yes]}
+% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.5,grid=fit]}
+% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.5,grid=height]}
+% \input ward
+% \page
+% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.6,grid=yes]}
+% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.6,grid=fit]}
+% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.6,grid=height]}
+% \input ward
+%
+% \stoptext
+
+% funny, as field action with e.g. dissolve ... only the field dissolves, bug?
+
+\setglobalsystemreference\rt!exec{Transition}{transition}
+
+%def\PDFexecutetransition {/Trans /Trans <</Type /Trans \executeifdefined{PDFpage\argumentA}\PDFpagereplace>>}
+\def\PDFexecutetransition {/Trans /Trans <<\executeifdefined{PDFpage\argumentA}\PDFpagereplace>>}
+
+% new, continuous blocks, \som \par \startdoorlopendblok ...
+
+% \startitemize
+% \item bagger
+% \item bagger
+% \item \startdoorlopendblok bagger \stopdoorlopendblok
+% \item \endgraf \startdoorlopendblok bagger \stopdoorlopendblok
+% \item \endgraf \startdoorlopendblok \strut bagger \stopdoorlopendblok
+% \item \startdoorlopendblok
+% \starttabulate
+% \NC test \NC test \NC \NR
+% \NC test \NC test \NC \NR
+% \NC test \NC test \NC \NR
+% \stoptabulate
+% \stopdoorlopendblok
+% \item test
+% \stopitemize
+
+\def\startdoorlopendblok % for special cases, don't change it too much and don't rely on it
+ {\ifhmode\endgraf\nobreak\fi % don't remove the \nobreak
+ \dowithnextboxcontent
+ {\setlocalhsize \hsize\localhsize \forgetall}
+ {\bgroup
+ \forgeteverypar
+ \forgetparskip
+ \scratchdimen\nextboxht
+ \advance\scratchdimen\nextboxdp
+ \getnoflines\scratchdimen
+ \advance\scratchdimen-\strutheight
+ \setbox\nextbox\hbox{\lower\scratchdimen\box\nextbox}%
+ \ht\nextbox\strutheight
+ \dp\nextbox\strutdepth
+ \setbox\nextbox\vbox
+ {\indent\box\nextbox
+ \endgraf
+ \nobreak
+ \advance\noflines\minusone
+ \dorecurse\noflines{\crlf\nobreak}}%
+ \verticalstrut
+ \endgraf
+ \nobreak
+ \offinterlineskip
+ \kern-2\lineheight % 2\lineheight when no vertical struts in main \vbox
+ \nobreak
+ \unvbox\nextbox
+ \prevdepth\strutdepth
+ % evt (eerst testen) een signal zodat een direct volgend blok goed gaat)
+ \egroup}
+ \vbox\bgroup
+ \vskip-\lineheight \verticalstrut\endgraf
+ \insidefloattrue
+ \doinhibitblank} % beware, no \inhibitblank ! ! ! ! ! !
+
+\def\stopdoorlopendblok
+ {\endgraf\verticalstrut\endgraf\kern-2\lineheight
+ \egroup}
+
+\def\tabulaterule % to be redone, not correct
+ {\dotabulaterule
+ {\hrule\!!height.5\scratchdimen\!!depth.5\scratchdimen\relax
+ \doifvalue{\??tt\currenttabulate\c!distance}\v!grid
+ {\kern-\scratchdimen}}} % experimental tm-prikkels
+
+% experimental: \synchronizegrid bla bla bla
+
+\newcounter\currentgridsync
+
+\def\gridsynctag{grs:\currentgridsync}
+
+\def\synchronizegrid
+ {\doglobal\increment\currentgridsync
+ \par\prevdepth\zeropoint
+ \nointerlineskip
+ \hpos\gridsynctag{\strut}\par
+ \vskip-\lineheight
+ \nointerlineskip
+ % top of text
+ \scratchdimen\MPy{\v!text:\MPp\gridsynctag}%
+ \advance\scratchdimen\MPh{\v!text:\MPp\gridsynctag}%
+ % move to first baseline
+ \advance\scratchdimen-\topskip
+ % subtract wrong baseline
+ \advance\scratchdimen-\MPy\gridsynctag
+ % get minimal number of lines
+ \advance\scratchdimen\lineheight
+ \getnoflines\scratchdimen
+ % calculate difference
+ \advance\scratchdimen-\noflines\lineheight\relax
+ \scratchdimen-\scratchdimen\relax
+ \ifdim\scratchdimen>\zeropoint
+ \nointerlineskip
+ \advance\scratchdimen-\lineheight
+ \vskip\scratchdimen \dontleavehmode \quad \strut
+ \par
+ %\else
+ % \message{no grid correction: \the\scratchdimen}\wait
+ \fi}
+
+% between alignment lines certain rules apply, and even a
+% simple test can mess up a table, which is why we have a
+% special test facility
+%
+% \ruledvbox
+% {\starttabulate[|l|p|]
+% \NC 1test \NC test \NC \NR
+% \tableifelse{\doifelse{a}{a}}{\NC Xtest \NC test \NC \NR}{}%
+% \stoptabulate}
+
+\long\def\tableifelse#1%
+ {\tablenoalign
+ {#1%
+ {\aftergroup \firstoftwoarguments}%
+ {\aftergroup\secondoftwoarguments}}}
+
+\long \def\tableiftextelse#1{\tableifelse{\doiftextelse{#1}}}
+
+% experiment, not yet to be used
+
+\def\displaybreak
+ {\ifhmode
+ \removeunwantedspaces
+ \ifcase\raggedstatus\hfill\fi
+ \strut\penalty-9999 % \break fails on case (3)
+ \fi}
+
+\def\startdisplay{\displaybreak\ignorespaces\startpacked}
+\def\stopdisplay {\stoppacked\displaybreak\ignorespaces}
+
+\def\tightvbox{\dowithnextbox{\nextboxdp\zeropoint\flushnextbox}\vbox}
+\def\tightvtop{\dowithnextbox{\nextboxht\zeropoint\flushnextbox}\vtop}
+
+% what is this stupid macro meant for:
+
+\def\hyphenationpoint
+ {\hskip\zeropoint}
+
+\def\hyphenated#1%
+ {\bgroup
+ \!!counta\zerocount
+ \def\hyphenated##1{\advance\!!counta\plusone}%
+ \handletokens#1\with\hyphenated
+ \!!countb\plusone
+ \def\hyphenated##1%
+ {##1%
+ \advance\!!countb\plusone\relax
+ \ifnum\!!countb>2 \ifnum\!!countb<\!!counta
+ \hyphenationpoint
+ \fi\fi}%
+ \handletokens#1\with\hyphenated
+ \egroup}
+
+\def\obeysupersubletters
+ {\let\super\normalsuper
+ \let\suber\normalsuber
+ \let\normalsuper\letterhat
+ \let\normalsuber\letterunderscore
+ \enablesupersub}
+
+\def\obeysupersubmath
+ {\let\normalsuper\letterhat
+ \let\normalsuber\letterunderscore
+ \enablesupersub}
+
+%\let\normaltype\type
+%
+%\def\type#1%
+% {\expanded{\normaltype{\detokenize{#1}}}}
+
+% {x123 \os x123} {\tfa x123 \os x123} {x123 \tx x123 \os x123}
+% \definefontsynonym[OldStyle][Serif]
+% {x123 \os x123} {\tfa x123 \os x123} {x123 \tx x123 \os x123}
+
+% testen :
+%
+% \appendtoks
+% \let\registerparoptions\relax
+% \to \everyforgetall
+
+\def\startgridcorrection
+ {\dosingleempty\dostartgridcorrection}
+
+\def\dostartgridcorrection[#1]%
+ {\ifgridsnapping
+ \iffirstargument\doifsomething{#1}{\moveongrid[#1]}\fi
+ \snaptogrid\vbox\bgroup
+ \else
+ \startbaselinecorrection
+ \fi}
+
+\def\stopgridcorrection
+ {\ifgridsnapping
+ \egroup
+ \else
+ \stopbaselinecorrection
+ \fi}
+
+\def\checkgridsnapping
+ {\lineskip\ifgridsnapping\zeropoint\else\normallineskip\fi}
+
+\def\startplaatsen
+ {\dosingleempty\dostartplaatsen}
+
+\def\dostartplaatsen[#1]% tzt n*links etc
+ {\endgraf
+ \noindent\bgroup
+ \setlocalhsize
+ \hbox to \localhsize\bgroup
+ \doifnot{#1}\v!left\hss
+ \def\stopplaatsen
+ {\unskip\unskip\unskip
+ \doifnot{#1}\v!right\hss
+ \egroup
+ \egroup
+ \endgraf}%
+ \gobblespacetokens}
+
+% \startplaatsen[links] bla \stopplaatsen
+
+% we don't register the paragraph characteristics, only the
+% width
+
+\appendtoks
+ \setinnerparpositions % see "techniek" for application
+\to \everytabulate
+
+\def\fontclassname#1#2%
+ {\ifcsname\??ff#1#2\endcsname
+ \fontclassname{#1}{\csname\??ff#1#2\endcsname}%
+ \else\ifcsname\??ff#2\endcsname
+ \fontclassname{#1}{\csname\??ff#2\endcsname}%
+ \else
+ #2%
+ \fi\fi}
+
+\def\defineclassfontsynonym
+ {\dotripleargument\dodefineclassfontsynonym}
+
+\def\dodefineclassfontsynonym[#1][#2][#3]%
+ {\definefontsynonym[#1][\fontclassname{#2}{#3}]}
+
+%\definefontsynonym [KopFont] [\fontclassname{officina}{SerifBold}]
+%
+%\defineclassfontsynonym [KopFont] [officina] [SerifBold]
+
+\def\startcolumnmakeup % don't change
+ {\bgroup
+ \getrawnoflines\textheight % teksthoogte kan topskip hebben, dus raw
+ \scratchdimen\noflines\lineheight
+ \advance\scratchdimen-\lineheight
+ \advance\scratchdimen\topskip
+ \setbox\scratchbox
+ \ifcase\showgridstate\vbox\else\ruledvbox\fi to \scratchdimen\bgroup
+ \forgetall} % ! don't change
+
+\def\stopcolumnmakeup
+ {\egroup
+ \dp\scratchbox\zeropoint
+ \wd\scratchbox\textwidth
+ \box\scratchbox
+ \egroup
+ \synchronizehsize}
+
+\long\def\startexternalfigure
+ {\dotripleempty\dostartexternalfigure}
+
+\long\def\dostartexternalfigure[#1][#2][#3]#4\stopexternalfigure
+ {\gdef\figuredescription{#4}%
+ \externalfigure[#1][#2][#3]%
+ \globallet\figuredescription\empty}
+
+\let\figuredescription\empty
+
+%% where does this come from, old code probably
+%%
+%%
+%% \newif\ifpagechanged \let\lastchangedpage\empty
+%%
+%% \def\checkpagechange#1%
+%% {\gettwopassdata\s!paragraph
+%% \pagechangedfalse
+%% \iftwopassdatafound
+%% \ifnum\twopassdata>0\getvalue{\s!paragraph:p:#1}\relax
+%% \pagechangedtrue
+%% \fi
+%% \fi
+%% \ifpagechanged
+%% \letgvalue{\s!paragraph:p:#1}\twopassdata
+%% \globallet\lastchangedpage\twopassdata
+%% \else
+%% \globallet\lastchangedpage\realfolio
+%% \fi
+%% \doparagraphreference}
+%%
+%% \def\changedpage#1%
+%% {\getvalue{\s!paragraph:p:#1}}
+
+\newcount\nofprofiled
+
+\def\profilemacro#1%
+ {\nofprofiled\zerocount
+ \letvalue{\string#1\string#1}#1%
+ \appendtoks
+ \normalwritestatus\m!systems{profile \string#1: \number\nofprofiled}%
+ \to \everystoptext
+ \unexpanded\def#1%
+ {\global\advance\nofprofiled\plusone
+ \csname\string#1\string#1\endcsname}}
+
+% incomplete, will be a special case of float placement
+
+\def\startfixed{\dosingleempty\dostartfixed}
+
+\def\dostartfixed[#1]%
+ {\expanded{\dowithnextbox{\noexpand\dodofixed{\ifhmode0\else1\fi}{#1}}}%
+ \vbox\bgroup
+ \setlocalhsize}
+
+\def\stopfixed
+ {\egroup}
+
+\def\dodofixed#1#2%
+ {\ifcase#1\relax
+ \processaction
+ [#2]
+ [ \v!high=>\bbox {\flushnextbox},
+ \v!low=>\tbox {\flushnextbox},
+ \v!middle=>\vcenter{\flushnextbox},
+ \v!lohi=>\vcenter{\flushnextbox},
+ \s!unknown=>\tbox {\flushnextbox},
+ \s!default=>\tbox {\flushnextbox}]%
+ \else
+ \startbaselinecorrection
+ \noindent\flushnextbox
+ \stopbaselinecorrection
+ \fi}
+
+% \startitemize
+%
+% \item \externalfigure[koe][height=2cm]
+% \item \externalfigure[koe][height=2cm]
+% \item \externalfigure[koe][height=2cm]
+% \item \externalfigure[koe][height=2cm]
+%
+% \page
+%
+% \item \startfixed \externalfigure[koe][height=2cm]\stopfixed
+% \item \startfixed[high]\externalfigure[koe][height=2cm]\stopfixed
+% \item \startfixed[low] \externalfigure[koe][height=2cm]\stopfixed
+% \item \startfixed[lohi]\externalfigure[koe][height=2cm]\stopfixed
+%
+% \page
+%
+% \item test \startfixed \externalfigure[koe][height=2cm]\stopfixed
+% \item test \startfixed[high]\externalfigure[koe][height=2cm]\stopfixed
+% \item test \startfixed[low] \externalfigure[koe][height=2cm]\stopfixed
+% \item test \startfixed[lohi]\externalfigure[koe][height=2cm]\stopfixed
+%
+% \page
+%
+% \item test \par \startfixed \externalfigure[koe][height=2cm]\stopfixed
+% \item test \par \startfixed[high]\externalfigure[koe][height=2cm]\stopfixed
+% \item test \par \startfixed[low] \externalfigure[koe][height=2cm]\stopfixed
+% \item test \par \startfixed[lohi]\externalfigure[koe][height=2cm]\stopfixed
+%
+% \stopitemize
+
+\def\obeyfollowingtoken{{}} % end \cs scanning
+
+% \def\comparedimension#1#2%
+% {\chardef\compresult
+% \ifdim#1<#2%
+% \zerocount
+% \else\ifdim#1<#2%
+% \plusone
+% \else
+% \plustwo
+% \fi\fi}
+% \newdimen\roundingeps \roundingeps=10sp
+% \def\comparedimensioneps#1#2%
+% {\chardef\compresult
+% \ifdim\dimexpr(#1-#2)<\roudingeps
+% \zerocount
+% \else\ifdim\dimexpr(#2-#1)<\roudingeps
+% \zerocount
+% \else\ifdim#1<#2%
+% \plusone
+% \else
+% \plustwo
+% \fi\fi\fi}
+
+%D Next we load a few local optimizations and new features. They
+%D live on on my machine and are not distributed, but they may end
+%D up in the distributed files.
+
\enablemode[mkii] \enablemode[*mkii]
\long\def\startluacode#1\stopluacode{}
@@ -19,4 +940,4 @@
\def\enabletrackers [#1]{}
\def\disabletrackers[#1]{}
-\endinput
+\protect \endinput
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index 08307b0d5..9b76b6ca2 100644
--- a/tex/context/base/cont-new.mkiv
+++ b/tex/context/base/cont-new.mkiv
@@ -1,6 +1,6 @@
%D \module
%D [ file=cont-new,
-%D version=2006.10.04,
+%D version=1995.10.10,
%D title=\CONTEXT\ Miscellaneous Macros,
%D subtitle=New Macros,
%D author=Hans Hagen,
@@ -11,29 +11,579 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-% potential new defaults:
-%
-% \setbreakpoints[compound]
+\newcontextversion{2011.01.18 19:34}
+
+%D This file is loaded at runtime, thereby providing an
+%D excellent place for hacks, patches, extensions and new
+%D features.
\unprotect
-% \ctxlua{logs.report = commands.writereport} % this will become default
+\writestatus\m!systems{beware: some patches loaded from cont-new.mkiv}
+
+
+\def\fastscale#1%
+ {\begingroup
+ \ifnum#1=1000\relax
+ \setfalse\scaleboxdone
+ \else
+ \settrue\scaleboxdone
+ \edef\finalscaleboxxscale{\withoutpt\the\dimexpr#1pt/1000\relax}%
+ \let\finalscaleboxyscale\finalscaleboxxscale
+ \fi
+ \dowithnextbox{\doscaleboxindeed\flushnextbox\endgroup}\hbox}
+
+% \setupcaption [figure] [align=flushleft]
+% \setupcaption [figure-1] [align=flushleft,leftmargin=10mm]
+% \setupcaption [figure-2] [align=flushleft,leftmargin=10mm,rightmargin=-10mm,width=\textwidth]
+%
+% \startsetups somefigure
+% \ifdim\floatsetupwidth>\textwidth
+% \placesetupfloat[figure-2]
+% \else
+% \placesetupfloat[figure-1]
+% \fi
+% \stopsetups
+%
+% \placefloatwithsetups[somefigure]{}{\externalfigure[dummy][width=5cm,height=2cm]}
+
+\def\placefloatwithsetups
+ {\dotripleempty\doplacefloatwithsetups}
+
+\long\def\doplacefloatwithsetups[#1][#2][#3]#4%
+ {\def\floatsetupcaption {#4}%
+ \def\floatsetupcontent {\copy\nextbox}%
+ \def\floatsetupwidth {\wd\nextbox}%
+ \def\floatsetupheight {\ht\nextbox}%
+ \def\placesetupfloat[##1]{\placefloat[##1][#2][#3]{#4}{\floatsetupcontent}}% #4 and not \floatsetupcaption (unexpanded)
+ \dowithnextbox{\setups[#1]}\vbox}
+
+\def\dividedsize#1#2#3% size gap n
+ {\dimexpr
+ \ifnum\dimexpr#1\relax>\plusone
+ (\dimexpr#1\relax-\numexpr#3-1\relax\dimexpr#2\relax)/#3\else#1%
+ \fi
+ \relax}
+
+\def\singlewidened #1{\hbox spread 1em{\hss#1\hss}}
+\def\complexwidened[#1]#2{\hbox spread #1{\hss#2\hss}}
+
+\definecomplexorsimple\widened
+
+% todo
+%
+% \def\definelocation{\dodoubleargument\dodefinelocation}
+% \def\dodefinelocation[#1][#2]{\setvalue{loc:#1}{#2}}
+%
+% \definelocation[lt] [\v!left\v!top]
+% \definelocation[tl] [\v!left\v!top]
+% \definelocation[\v!top\v!left][\v!left\v!top]
+%
+% \def\getlocation#1{\executeifdefined{loc:#1}{#1}}
+
+% \let\cs\getvalue % no, we want \cs to be czech
+
+% experimental so this may change
+
+\def\startdescriptions
+ {\dosingleempty\dostartdescriptions}
+
+\def\dostartdescriptions[#1]%
+ {\begingroup
+ \def\item{\getvalue{#1}}%
+ \let\dostoppairdescription \donothing
+ \let\@@description \dostartpairdescription
+ \let\@@startsomedescription\dostartsomedescription}
+
+\def\stopdescriptions
+ {\dostoppairdescription
+ \endgroup}
+
+\def\dostartpairdescription[#1][#2]%
+ {\dostoppairdescription
+ \def\dostoppairdescription{\@@stopdescription{#1}}%
+ \bgroup
+ \def\currentdescription{#1}%
+ \doifelse{\descriptionparameter{\s!do\c!state}}\v!start
+ {\@@makedescription{#1}[#2]{}}
+ {\@@makedescription{#1}[#2]}}
+
+\def\dostartsomedescription% #1[#2]#3%
+ {\bgroup
+ \@@makedescription} % {#1}[#2]{#3}}
+
+% \starttext
+%
+% \definedescription[test]
+%
+% \startdescriptions
+% \test{Foo} Bar bar bar
+% \test{Foo} Bar bar bar
+% \test{Foo} Bar bar bar
+% \stopdescriptions
+%
+% \startdescriptions[test]
+% \item{Foo} Bar bar bar
+% \item{Foo} Bar bar bar
+% \item{Foo} Bar bar bar
+% \stopdescriptions
+%
+% \startdescriptions
+% \starttest{Foo} Bar bar bar \stoptest
+% \starttest{Foo} Bar bar bar \stoptest
+% \starttest{Foo} Bar bar bar \stoptest
+% \stopdescriptions
+%
+% \startdescriptions[test]
+% \item{Foo} Bar bar bar
+% \item{Foo} Bar bar bar
+% \item{Foo} Bar bar bar
+% \stopdescriptions
+%
+% \stoptext
+
+% this will be activated when
+%
+% \newinsert\thispageinsert % <- installinsertion
+%
+% \def\flushatthispage
+% {\bgroup
+% \dowithnextbox{\insert\thispageinsert{\box\nextbox}\egroup}%
+% \hbox}
+%
+% \appendtoks
+% \ifvoid\thispageinsert\else\hbox{\smashedbox\thispageinsert}\fi
+% \to \everyshipout
+
+% \definemarkedpage[nobackgrounds]
+% \markpage[nobackgrounds]
+% \doifmarkedpageelse{nobackgrounds}
+
+% Just a simple and fast hanger, for usage in macros.
+
+\def\setuphanging
+ {\dodoubleempty\getparameters[\??ha]}
+
+\setuphanging
+ [\c!distance=.5em]
+
+\def\starthanging
+ {\noindent\bgroup
+ \dowithnextbox
+ {\setbox\nextbox\hbox{\flushnextbox\hskip\@@hadistance}%
+ \hangindent\nextboxwd
+ \hangafter\plusone
+ \flushnextbox\ignorespaces}
+ \hbox}
+
+\def\stophanging
+ {\endgraf
+ \egroup}
+
+% experimental
+
+\def\stophangaround
+ {\endgraf
+ \egroup}
+
+\def\starthangaround
+ {\noindent\bgroup
+ \dowithnextbox
+ {\ifdim\nextboxht>\strutht\setbox\nextbox\tbox{\flushnextbox}\fi
+ \setbox\nextbox\hbox{\flushnextbox\hskip\@@hadistance}%
+ \getboxheight\scratchdimen\of\box\nextbox
+ \getnoflines\scratchdimen
+ \nextboxht\strutht
+ \nextboxdp\strutdp
+ \hangindent\nextboxwd
+ \hangafter-\noflines
+ \llap{\flushnextbox}\ignorespaces}
+ \hbox}
+
+\def\modevalue#1#2#3%
+ {\@EA\ifx\csname\@mode@\systemmodeprefix#1\endcsname\endcsname\enabledmode#2\else#2\fi}
+
+\def\systemmodevalue#1%
+ {\modevalue{\systemmodeprefix#1}}
+
+% new, still to be improved
+%
+% \dorecurse{10}
+% {\input thuan
+% \placefigure{}{\framed[height=1.5cm]{test}}
+% \placefloatplaceholder}
+
+\def\placefloatplaceholder
+ {\ifroomforfloat \else
+ \scratchdimen\pagegoal
+ \advance\scratchdimen-\pagetotal
+ \advance\scratchdimen-3\lineheight
+ \ifdim\scratchdimen>\zeropoint
+ \startlinecorrection[blank]
+ \mhbox{\inframed{\labeltexts{placeholder}{\lastcaptiontag}}}%
+ \stoplinecorrection
+ \else
+ \allowbreak
+ \fi
+ \fi}
+
+\setuplabeltext
+ [placeholder={, moved}]
+
+\startluacode
+ function commands.percentageof(str,dim)
+ local n = str:match("^(.*)%%$")
+ tex.sprint(tex.ctxcatcodes,(n and (tonumber(n)/100)*dim .. "sp") or str)
+ end
+\stopluacode
+
+\gdef\setpercentdimen#1#2%
+ {#1=\ctxlua{commands.percentageof("#2",\number#1)}\relax}
+
+% \scratchdimen=100pt \setpercentdimen\scratchdimen{10\letterpercent} \the\scratchdimen
+% \scratchdimen=100pt \setpercentdimen\scratchdimen{5pt} \the\scratchdimen
+
+\bgroup \permitcaretescape
+
+\obeylines % don't remove %'s !
-\def\immediatemessage#1{\ctxlua{logs.status("message","#1")}}
+\gdef\collapsedspace#1%
+ {\ifx#1^^M%
+ \expandafter\collapsedspace
+ \else
+ \space
+ \expandafter#1%
+ \fi}
-% we need to figure this out (to be discussed)
+\gdef\collapsespaces
+ {\prependtoksonce\relax\to\everyeof%
+ \ignorelines%
+ \ignoretabs%
+ \let\obeyedspace\collapsedspace%
+ \obeyspaces}
-\unexpanded\def\textminus
- {\char \iffontchar\font"2012 "2012 % figuredash
- \else\iffontchar\font"2013 "2013 % endash
- \else\iffontchar\font"2212 "2212 % math minus
- "002D % hyphen
- \fi\fi\fi}
+\egroup
+
+\def\inlinedbox
+ {\bgroup
+ \dowithnextbox
+ {\scratchdimen\nextboxht
+ \advance\scratchdimen\nextboxdp
+ \advance\scratchdimen-\lineheight
+ \divide\scratchdimen\plustwo
+ \advance\scratchdimen\strutdepth
+ \setbox\nextbox\hbox{\lower\scratchdimen\flushnextbox}%
+ \nextboxht\strutht
+ \nextboxdp\strutdp
+ \flushnextbox
+ \egroup}%
+ \hbox}
+
+\def\dimenratio#1#2% etex only
+ {\withoutpt\the\dimexpr2\dimexpr(#1)/\dimexpr(#2)/32768\relax\relax}
+
+\def\doxprecurse#1#2%
+ {\ifnum#1=\zerocount % no \ifcase
+ \expandafter\gobblethreearguments
+ \else
+ #2\expandafter\expandafter\expandafter\doxprecurse\expandafter
+ \fi\expandafter{\the\numexpr#1-1\relax}{#2}}
+
+\def\buttonframed{\dodoubleempty\localframed[\??bt]} % goodie
+
+\unexpanded\def\asciistr#1{\dontleavehmode{\defconvertedargument\ascii{#1}\verbatimfont\ascii}}
+
+\def\shapefill{\vskip\zeropoint\!!plus\lineheight\!!minus\lineheight\relax}
+
+% \ruledhbox
+% {\startignorespaces
+% \def\oeps{a}
+% \startignorespaces
+% \def\oeps{a}
+% \stopignorespaces
+% \def\oeps{a}
+% \stopignorespaces
+% \oeps}
-\unexpanded\def\textplus
- {\char"002B } % plus
+\newsignal\boissignal
+\newcount \boislevel
+
+\long\def\startignorespaces
+ {\advance\boislevel\plusone
+ \ifcase\boislevel\or \ifhmode
+ \hskip\boissignal
+ \fi \fi
+ \ignorespaces}
+
+\long\def\stopignorespaces
+ {\ifcase\boislevel\or \ifhmode
+ \doloop
+ {\ifdim\lastskip=\zeropoint
+ \exitloop
+ \else\ifdim\lastskip=\boissignal
+ \unskip
+ \exitloop
+ \else
+ \unskip
+ \fi\fi}%
+ \fi \fi
+ \advance\boislevel\minusone}
+
+\def\minimalhbox#1#%
+ {\dowithnextbox
+ {\bgroup
+ \setbox\scratchbox\hbox#1{\hss}%
+ \ifdim\nextboxwd<\wd\scratchbox\nextboxwd\wd\scratchbox\fi
+ \flushnextbox
+ \egroup}
+ \hbox}
+
+\def\gobbleuntilempty#1\empty{}
+
+\def\dodimchoice#1#2#3%
+ {\ifdim#1#2%
+ #3\@EA\gobbleuntilempty
+ \else
+ \@EA\dodimchoice
+ \fi{#1}}
+
+\def\donumchoice#1#2#3%
+ {\ifnum#1#2%
+ #3\@EA\gobbleuntilempty
+ \else
+ \@EA\dodimchoice
+ \fi{#1}}
+
+\def\dimchoice#1#2{\dodimchoice{#1}#2{=#1}{#1}\empty}
+\def\numchoice#1#2{\donumchoice{#1}#2{=#1}{#1}\empty}
+
+% \the\dimexpr(\dimchoice {7pt}{{<10pt}{8pt}{<12pt}{9pt}{<15pt}{10pt}{=11pt}{12pt}})
+% \the\dimexpr(\dimchoice{11pt}{{<10pt}{8pt}{<12pt}{9pt}{<15pt}{10pt}{=11pt}{12pt}})
+% \the\dimexpr(\dimchoice{14pt}{{<10pt}{8pt}{<12pt}{9pt}{<15pt}{10pt}{=11pt}{12pt}})
+
+\def\showsetupsdefinition[#1]{\showvalue{\??su:#1}} % temp hack for debugging
+
+\def\tabulaterule % to be redone, not correct
+ {\dotabulaterule
+ {\hrule\!!height.5\scratchdimen\!!depth.5\scratchdimen\relax
+ \doifvalue{\??tt\currenttabulate\c!distance}\v!grid
+ {\kern-\scratchdimen}}} % experimental tm-prikkels
+% so far
+
+% between alignment lines certain rules apply, and even a
+% simple test can mess up a table, which is why we have a
+% special test facility
+%
+% \ruledvbox
+% {\starttabulate[|l|p|]
+% \NC 1test \NC test \NC \NR
+% \tableifelse{\doifelse{a}{a}}{\NC Xtest \NC test \NC \NR}{}%
+% \stoptabulate}
+
+\long\def\tableifelse#1%
+ {\tablenoalign
+ {#1%
+ {\aftergroup \firstoftwoarguments}%
+ {\aftergroup\secondoftwoarguments}}}
+
+\long \def\tableiftextelse#1{\tableifelse{\doiftextelse{#1}}}
+
+\def\tightvbox{\dowithnextbox{\nextboxdp\zeropoint\flushnextbox}\vbox}
+\def\tightvtop{\dowithnextbox{\nextboxht\zeropoint\flushnextbox}\vtop}
+
+% what is this stupid macro meant for:
+
+\def\hyphenationpoint
+ {\hskip\zeropoint}
+
+\def\hyphenated#1%
+ {\bgroup
+ \!!counta\zerocount
+ \def\hyphenated##1{\advance\!!counta\plusone}%
+ \handletokens#1\with\hyphenated
+ \!!countb\plusone
+ \def\hyphenated##1%
+ {##1%
+ \advance\!!countb\plusone\relax
+ \ifnum\!!countb>2 \ifnum\!!countb<\!!counta
+ \hyphenationpoint
+ \fi\fi}%
+ \handletokens#1\with\hyphenated
+ \egroup}
+
+\def\obeysupersubletters
+ {\let\super\normalsuper
+ \let\suber\normalsuber
+ \let\normalsuper\letterhat
+ \let\normalsuber\letterunderscore
+ \enablesupersub}
+
+\def\obeysupersubmath
+ {\let\normalsuper\letterhat
+ \let\normalsuber\letterunderscore
+ \enablesupersub}
+
+\def\startgridcorrection
+ {\dosingleempty\dostartgridcorrection}
+
+\def\dostartgridcorrection[#1]%
+ {\ifgridsnapping
+ \iffirstargument\doifsomething{#1}{\moveongrid[#1]}\fi
+ \snaptogrid\vbox\bgroup
+ \else
+ \startbaselinecorrection
+ \fi}
+
+\def\stopgridcorrection
+ {\ifgridsnapping
+ \egroup
+ \else
+ \stopbaselinecorrection
+ \fi}
+
+\def\checkgridsnapping
+ {\lineskip\ifgridsnapping\zeropoint\else\normallineskip\fi}
+
+\def\startplaatsen
+ {\dosingleempty\dostartplaatsen}
+
+\def\dostartplaatsen[#1]% tzt n*links etc
+ {\endgraf
+ \noindent\bgroup
+ \setlocalhsize
+ \hbox to \localhsize\bgroup
+ \doifnot{#1}\v!left\hss
+ \def\stopplaatsen
+ {\unskip\unskip\unskip
+ \doifnot{#1}\v!right\hss
+ \egroup
+ \egroup
+ \endgraf}%
+ \gobblespacetokens}
+
+% \startplaatsen[links] bla \stopplaatsen
+
+% we don't register the paragraph characteristics, only the
+% width
+
+\appendtoks
+ \setinnerparpositions % see "techniek" for application
+\to \everytabulate
+
+\def\fontclassname#1#2%
+ {\ifcsname\??ff#1#2\endcsname
+ \fontclassname{#1}{\csname\??ff#1#2\endcsname}%
+ \else\ifcsname\??ff#2\endcsname
+ \fontclassname{#1}{\csname\??ff#2\endcsname}%
+ \else
+ #2%
+ \fi\fi}
+
+\def\defineclassfontsynonym
+ {\dotripleargument\dodefineclassfontsynonym}
+
+\def\dodefineclassfontsynonym[#1][#2][#3]%
+ {\definefontsynonym[#1][\fontclassname{#2}{#3}]}
+
+%\definefontsynonym [KopFont] [\fontclassname{officina}{SerifBold}]
+%
+%\defineclassfontsynonym [KopFont] [officina] [SerifBold]
+
+\def\startcolumnmakeup % don't change
+ {\bgroup
+ \getrawnoflines\textheight % teksthoogte kan topskip hebben, dus raw
+ \scratchdimen\noflines\lineheight
+ \advance\scratchdimen-\lineheight
+ \advance\scratchdimen\topskip
+ \setbox\scratchbox
+ \ifcase\showgridstate\vbox\else\ruledvbox\fi to \scratchdimen\bgroup
+ \forgetall} % ! don't change
+
+\def\stopcolumnmakeup
+ {\egroup
+ \dp\scratchbox\zeropoint
+ \wd\scratchbox\textwidth
+ \box\scratchbox
+ \egroup
+ \synchronizehsize}
+
+\long\def\startexternalfigure
+ {\dotripleempty\dostartexternalfigure}
+
+\long\def\dostartexternalfigure[#1][#2][#3]#4\stopexternalfigure
+ {\gdef\figuredescription{#4}%
+ \externalfigure[#1][#2][#3]%
+ \globallet\figuredescription\empty}
+
+\let\figuredescription\empty
+
+% incomplete, will be a special case of float placement
+
+\def\startfixed{\dosingleempty\dostartfixed}
+
+\def\dostartfixed[#1]%
+ {\expanded{\dowithnextbox{\noexpand\dodofixed{\ifhmode0\else1\fi}{#1}}}%
+ \vbox\bgroup
+ \setlocalhsize}
+
+\def\stopfixed
+ {\egroup}
+
+\def\dodofixed#1#2%
+ {\ifcase#1\relax
+ \processaction
+ [#2]
+ [ \v!high=>\bbox {\flushnextbox},
+ \v!low=>\tbox {\flushnextbox},
+ \v!middle=>\vcenter{\flushnextbox},
+ \v!lohi=>\vcenter{\flushnextbox},
+ \s!unknown=>\tbox {\flushnextbox},
+ \s!default=>\tbox {\flushnextbox}]%
+ \else
+ \startbaselinecorrection
+ \noindent\flushnextbox
+ \stopbaselinecorrection
+ \fi}
+
+% \startitemize
+%
+% \item \externalfigure[koe][height=2cm]
+% \item \externalfigure[koe][height=2cm]
+% \item \externalfigure[koe][height=2cm]
+% \item \externalfigure[koe][height=2cm]
+%
+% \page
+%
+% \item \startfixed \externalfigure[koe][height=2cm]\stopfixed
+% \item \startfixed[high]\externalfigure[koe][height=2cm]\stopfixed
+% \item \startfixed[low] \externalfigure[koe][height=2cm]\stopfixed
+% \item \startfixed[lohi]\externalfigure[koe][height=2cm]\stopfixed
+%
+% \page
+%
+% \item test \startfixed \externalfigure[koe][height=2cm]\stopfixed
+% \item test \startfixed[high]\externalfigure[koe][height=2cm]\stopfixed
+% \item test \startfixed[low] \externalfigure[koe][height=2cm]\stopfixed
+% \item test \startfixed[lohi]\externalfigure[koe][height=2cm]\stopfixed
+%
+% \page
+%
+% \item test \par \startfixed \externalfigure[koe][height=2cm]\stopfixed
+% \item test \par \startfixed[high]\externalfigure[koe][height=2cm]\stopfixed
+% \item test \par \startfixed[low] \externalfigure[koe][height=2cm]\stopfixed
+% \item test \par \startfixed[lohi]\externalfigure[koe][height=2cm]\stopfixed
+%
+% \stopitemize
+
+\def\obeyfollowingtoken{{}} % end \cs scanning
+
+% potential new defaults:
+%
+% \setbreakpoints[compound]
+
+% \ctxlua{logs.report = commands.writereport} % this will become default
-% till we fixed all styles
+% till we fixed all styles:
\let\\=\crlf
diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex
deleted file mode 100644
index 67354000a..000000000
--- a/tex/context/base/cont-new.tex
+++ /dev/null
@@ -1,995 +0,0 @@
-%D \module
-%D [ file=cont-new,
-%D version=1995.10.10,
-%D title=\CONTEXT\ Miscellaneous Macros,
-%D subtitle=New Macros,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\newcontextversion{2011.01.14 14:44}
-
-%D This file is loaded at runtime, thereby providing an
-%D excellent place for hacks, patches, extensions and new
-%D features.
-
-\unprotect
-
-% it's about time to clean up this file ...
-
-\writestatus\m!systems{beware: some patches loaded from cont-new.tex}
-
-% \ifx\pdfmapfile \undefined \else \pdfmapfile{ } \fi
-
-% \font\f=dummyfont \rpcode\f0=500 \hbox{..}\char0
-% todo: mp-new
-% caption: grid=top|bottom in xml defs
-
-\def\fastscale#1%
- {\begingroup
- \ifnum#1=1000\relax
- \setfalse\scaleboxdone
- \else
- \settrue\scaleboxdone
- \edef\finalscaleboxxscale{\withoutpt\the\dimexpr#1pt/1000\relax}%
- \let\finalscaleboxyscale\finalscaleboxxscale
- \fi
- \dowithnextbox{\doscaleboxindeed\flushnextbox\endgroup}\hbox}
-
-% \setupcaption [figure] [align=flushleft]
-% \setupcaption [figure-1] [align=flushleft,leftmargin=10mm]
-% \setupcaption [figure-2] [align=flushleft,leftmargin=10mm,rightmargin=-10mm,width=\textwidth]
-%
-% \startsetups somefigure
-% \ifdim\floatsetupwidth>\textwidth
-% \placesetupfloat[figure-2]
-% \else
-% \placesetupfloat[figure-1]
-% \fi
-% \stopsetups
-%
-% \placefloatwithsetups[somefigure]{}{\externalfigure[dummy][width=5cm,height=2cm]}
-
-\def\placefloatwithsetups
- {\dotripleempty\doplacefloatwithsetups}
-
-\long\def\doplacefloatwithsetups[#1][#2][#3]#4%
- {\def\floatsetupcaption {#4}%
- \def\floatsetupcontent {\copy\nextbox}%
- \def\floatsetupwidth {\wd\nextbox}%
- \def\floatsetupheight {\ht\nextbox}%
- \def\placesetupfloat[##1]{\placefloat[##1][#2][#3]{#4}{\floatsetupcontent}}% #4 and not \floatsetupcaption (unexpanded)
- \dowithnextbox{\setups[#1]}\vbox}
-
-\def\dividedsize#1#2#3% size gap n
- {\dimexpr
- \ifnum\dimexpr#1\relax>\plusone
- (\dimexpr#1\relax-\numexpr#3-1\relax\dimexpr#2\relax)/#3\else#1%
- \fi
- \relax}
-
-% \setuplabeltext[\s!itemcount1={{I(},{)}}]
-% \def\labeledcountervalue#1{\labeltexts{#1}{\countervalue{#1}}}
-
-\def\singlewidened #1{\hbox spread 1em{\hss#1\hss}}
-\def\complexwidened[#1]#2{\hbox spread #1{\hss#2\hss}}
-
-\definecomplexorsimple\widened
-
-% todo
-%
-% \def\definelocation{\dodoubleargument\dodefinelocation}
-% \def\dodefinelocation[#1][#2]{\setvalue{loc:#1}{#2}}
-%
-% \definelocation[lt] [\v!left\v!top]
-% \definelocation[tl] [\v!left\v!top]
-% \definelocation[\v!top\v!left][\v!left\v!top]
-%
-% \def\getlocation#1{\executeifdefined{loc:#1}{#1}}
-
-% just in case we load something from a file (pdfr-ec for instance)
-
-\prependtoks \restoreendofline \to \everybeforeshipout
-
-% \let\cs\getvalue % no, we want \cs to be czech
-
-% experimental so this may change
-
-\def\startdescriptions
- {\dosingleempty\dostartdescriptions}
-
-\def\dostartdescriptions[#1]%
- {\begingroup
- \def\item{\getvalue{#1}}%
- \let\dostoppairdescription \donothing
- \let\@@description \dostartpairdescription
- \let\@@startsomedescription\dostartsomedescription}
-
-\def\stopdescriptions
- {\dostoppairdescription
- \endgroup}
-
-\def\dostartpairdescription[#1][#2]%
- {\dostoppairdescription
- \def\dostoppairdescription{\@@stopdescription{#1}}%
- \bgroup
- \def\currentdescription{#1}%
- \doifelse{\descriptionparameter{\s!do\c!state}}\v!start
- {\@@makedescription{#1}[#2]{}}
- {\@@makedescription{#1}[#2]}}
-
-\def\dostartsomedescription% #1[#2]#3%
- {\bgroup
- \@@makedescription} % {#1}[#2]{#3}}
-
-% \starttext
-%
-% \definedescription[test]
-%
-% \startdescriptions
-% \test{Foo} Bar bar bar
-% \test{Foo} Bar bar bar
-% \test{Foo} Bar bar bar
-% \stopdescriptions
-%
-% \startdescriptions[test]
-% \item{Foo} Bar bar bar
-% \item{Foo} Bar bar bar
-% \item{Foo} Bar bar bar
-% \stopdescriptions
-%
-% \startdescriptions
-% \starttest{Foo} Bar bar bar \stoptest
-% \starttest{Foo} Bar bar bar \stoptest
-% \starttest{Foo} Bar bar bar \stoptest
-% \stopdescriptions
-%
-% \startdescriptions[test]
-% \item{Foo} Bar bar bar
-% \item{Foo} Bar bar bar
-% \item{Foo} Bar bar bar
-% \stopdescriptions
-%
-% \stoptext
-
-% to do:
-%
-% \def\defineshapesynonym
-% {\dodoubleargument\dodefineshapesynonym}
-%
-% \def\dodefineshapesynonym[#1][#2]%
-% {\setvalue{shsy:#1}{#2}}
-%
-% \def\shapesynonym#1%
-% {\ifcsname shsy:#1\endcsname
-% \expandafter\shapesynonym\csname shsy:#1\endcsname\else#1%
-% \fi}
-%
-%\defineshapesynonym[eacute] [e]
-%\defineshapesynonym[egrave] [e]
-%\defineshapesynonym[eumlaut [e]
-%\defineshapesynonym[eogonek][e]
-%
-% more reduction
-%
-%\defineshapesynonym[e][o]
-%\defineshapesynonym[w][v]
-%\defineshapesynonym[m][n]
-%
-% \shapesynonym{eacute}
-
-% this will be activated when
-
-% \newinsert\thispageinsert % <- installinsertion
-
-% \def\flushatthispage
-% {\bgroup
-% \dowithnextbox{\insert\thispageinsert{\box\nextbox}\egroup}%
-% \hbox}
-
-% \appendtoks
-% \ifvoid\thispageinsert\else\hbox{\smashedbox\thispageinsert}\fi
-% \to \everyshipout
-
-% \definemarkedpage[nobackgrounds]
-% \markpage[nobackgrounds]
-% \doifmarkedpageelse{nobackgrounds}
-
-\newcounter\nofmarkedpages
-
-\def\definemarkedpage[#1]%
- {\definetwopasslist{\v!page:#1}}
-
-\def\markpage[#1]% looks very much like domarginreference
- {\iftrialtypesetting\else
- \doglobal\increment\nofmarkedpages\relax
- \lazysavetwopassdata{\v!page:#1}{\nofmarkedpages}{\noexpand\realfolio}%
- \fi}
-
-\def\doifmarkedpageelse#1%
- {\gettwopassdatalist{\v!page:#1}%
- \expanded{\doifinsetelse{\realfolio}{\twopassdatalist}}}
-
-% Just a simple and fast hanger, for usage in macros.
-
-\def\setuphanging
- {\dodoubleempty\getparameters[\??ha]}
-
-\setuphanging
- [\c!distance=.5em]
-
-\def\starthanging
- {\noindent\bgroup
- \dowithnextbox
- {\setbox\nextbox\hbox{\flushnextbox\hskip\@@hadistance}%
- \hangindent\nextboxwd
- \hangafter\plusone
- \flushnextbox\ignorespaces}
- \hbox}
-
-\def\stophanging
- {\endgraf
- \egroup}
-
-% experimental
-
-\def\stophangaround
- {\endgraf
- \egroup}
-
-\def\starthangaround
- {\noindent\bgroup
- \dowithnextbox
- {\ifdim\nextboxht>\strutht\setbox\nextbox\tbox{\flushnextbox}\fi
- \setbox\nextbox\hbox{\flushnextbox\hskip\@@hadistance}%
- \getboxheight\scratchdimen\of\box\nextbox
- \getnoflines\scratchdimen
- \nextboxht\strutht
- \nextboxdp\strutdp
- \hangindent\nextboxwd
- \hangafter-\noflines
- \llap{\flushnextbox}\ignorespaces}
- \hbox}
-
-\def\modevalue#1#2#3%
- {\@EA\ifx\csname\@mode@\systemmodeprefix#1\endcsname\endcsname\enabledmode#2\else#2\fi}
-
-\def\systemmodevalue#1%
- {\modevalue{\systemmodeprefix#1}}
-
-% \getmulticolumnlines -> now in cont-loc, to be tested and really needed
-
-% \tracefonthandlingtrue
-
-% new, still to be improved
-%
-% \dorecurse{10}
-% {\input thuan
-% \placefigure{}{\framed[height=1.5cm]{test}}
-% \placefloatplaceholder}
-
-\def\placefloatplaceholder
- {\ifroomforfloat \else
- \scratchdimen\pagegoal
- \advance\scratchdimen-\pagetotal
- \advance\scratchdimen-3\lineheight
- \ifdim\scratchdimen>\zeropoint
- \startlinecorrection[blank]
- \mhbox{\inframed{\labeltexts{placeholder}{\lastcaptiontag}}}%
- \stoplinecorrection
- \else
- \allowbreak
- \fi
- \fi}
-
-\setuplabeltext
- [placeholder={, moved}]
-
-% etex only, of course we could just parse (scan for \% in string)
-
-\newif\ifpercentdimendone
-
-\bgroup % usage: \setpercentdimen\somedimen{% or dimen} todo: pct
-\catcode124=\@@comment
-\catcode 37=\@@active
-\gdef\setpercentdimen#1#2|
- {\xdef\@@expanded{#2}|
- \ifx\@@expanded\empty\else
- \bgroup
- \global\percentdimendonefalse
- \def\%{\dimexpr#1/100\relax\global\percentdimendonetrue\ignorespaces}| scantokens add's a space
- \catcode`%=\@@active
- \catcode`\\=\@@escape
- \let%\%|
- \scratchdimen#1|
- \xdef\@@expanded{\@@expanded\scratchdimen\!!zeropoint}| trick: when 1.2 => .2\scratchdimen and 0pt typeset
- \startnointerference
- \global\globalscratchdimen\scantokens\@EA{\@@expanded}| i'm lazy and use etex
- \stopnointerference
- \egroup
- #1\globalscratchdimen
- \fi}
-\egroup
-
-% TEX alternative, in principle accurate enough and also a bit faster
-
-% \bgroup
-%
-% \catcode`\%=\@@other
-% \catcode`\|=\@@comment
-%
-% \gdef\setpercentdimen#1#2|
-% {\beforesplitstring#2\at%\to\ascii
-% \doifelse\ascii{#2}
-% {#1=#2}
-% {\divide#1by100\relax#1=\ascii#1\relax}} | or: {#1=\ascii#1\divide#1by100\relax}}
-%
-% \egroup
-%
-% \dimen0=1000pt \setpercentdimen{\dimen0}{10%} \the\dimen0
-% \dimen0= 100pt \setpercentdimen{\dimen0}{10%} \the\dimen0
-% \dimen0= 95pt \setpercentdimen{\dimen0}{10%} \the\dimen0
-% \dimen0= 10pt \setpercentdimen{\dimen0}{10%} \the\dimen0
-% \dimen0= 1pt \setpercentdimen{\dimen0}{10%} \the\dimen0
-
-\bgroup
-
-\ifdefined\permitcaretescape \permitcaretescape \fi % mkiv
-
-\obeylines % don't remove %'s !
-
-\gdef\collapsedspace#1%
- {\ifx#1^^M%
- \expandafter\collapsedspace
- \else
- \space
- \expandafter#1%
- \fi}
-
-\gdef\collapsespaces
- {\prependtoksonce\relax\to\everyeof%
- \ignorelines%
- \ignoretabs%
- \let\obeyedspace\collapsedspace%
- \obeyspaces}
-
-\egroup
-
-\def\inlinedbox
- {\bgroup
- \dowithnextbox
- {\scratchdimen\nextboxht
- \advance\scratchdimen\nextboxdp
- \advance\scratchdimen-\lineheight
- \divide\scratchdimen\plustwo
- \advance\scratchdimen\strutdepth
- \setbox\nextbox\hbox{\lower\scratchdimen\flushnextbox}%
- \nextboxht\strutht
- \nextboxdp\strutdp
- \flushnextbox
- \egroup}%
- \hbox}
-
-% \readfile{cont-exp}\donothing\donothing % speed up (5-20%)
-
-\def\dimenratio#1#2% etex only
- {\withoutpt\the\dimexpr2\dimexpr(#1)/\dimexpr(#2)/32768\relax\relax}
-
-\def\doxprecurse#1#2%
- {\ifnum#1=\zerocount % no \ifcase
- \expandafter\gobblethreearguments
- \else
- #2\expandafter\expandafter\expandafter\doxprecurse\expandafter
- \fi\expandafter{\the\numexpr#1-1\relax}{#2}}
-
-\def\buttonframed{\dodoubleempty\localframed[\??bt]} % goodie
-
-\unexpanded\def\asciistr#1{\dontleavehmode{\defconvertedargument\ascii{#1}\verbatimfont\ascii}}
-
-\def\shapefill{\vskip\zeropoint\!!plus\lineheight\!!minus\lineheight\relax}
-
-\let\normaltype\type
-
-\ifx\scantextokens\undefined
- \ifx\scantokens\undefined
- \unexpanded\def\retype#1{\dontleavehmode{\defconvertedargument\ascii{#1}\@EA\normaltype\@EA{\ascii}}}
- \else
- \unexpanded\def\retype#1{\dontleavehmode\scantokens{\normaltype{#1}\ignorespaces}\relax}
- \fi
-\else
- \unexpanded\def\retype#1{\dontleavehmode\scantextokens{\normaltype{#1}}}
-\fi
-
-\def\simplifytype{\let\type\retype}
-
-% \ruledhbox
-% {\startignorespaces
-% \def\oeps{a}
-% \startignorespaces
-% \def\oeps{a}
-% \stopignorespaces
-% \def\oeps{a}
-% \stopignorespaces
-% \oeps}
-
-\newsignal\boissignal
-\newcount \boislevel
-
-\long\def\startignorespaces
- {\advance\boislevel\plusone
- \ifcase\boislevel\or \ifhmode
- \hskip\boissignal
- \fi \fi
- \ignorespaces}
-
-\long\def\stopignorespaces
- {\ifcase\boislevel\or \ifhmode
- \doloop
- {\ifdim\lastskip=\zeropoint
- \exitloop
- \else\ifdim\lastskip=\boissignal
- \unskip
- \exitloop
- \else
- \unskip
- \fi\fi}%
- \fi \fi
- \advance\boislevel\minusone}
-
-\def\minimalhbox#1#%
- {\dowithnextbox
- {\bgroup
- \setbox\scratchbox\hbox#1{\hss}%
- \ifdim\nextboxwd<\wd\scratchbox\nextboxwd\wd\scratchbox\fi
- \flushnextbox
- \egroup}
- \hbox}
-
-% \def\dodimchoice#1#2#3%
-% {\ifx#3\relax
-% #1\@EA\gobbleuntilrelax
-% \else\ifdim#1#2%
-% #3\@EAEAEA\gobbleuntilrelax
-% \else
-% \@EAEAEA\dodimchoice
-% \fi\fi{#1}}
-
-% \def\donumchoice#1#2#3%
-% {\ifx#3\relax
-% #1\@EA\gobbleuntilrelax
-% \else\ifnum#1#2%
-% #3\@EAEAEA\gobbleuntilrelax
-% \else
-% \@EAEAEA\dodimchoice
-% \fi\fi{#1}}
-
-% \def\dimchoice#1#2{\dodimchoice{#1}#2\empty\relax}
-% \def\numchoice#1#2{\donumchoice{#1}#2\empty\relax}
-
-\def\gobbleuntilempty#1\empty{}
-
-\def\dodimchoice#1#2#3%
- {\ifdim#1#2%
- #3\@EA\gobbleuntilempty
- \else
- \@EA\dodimchoice
- \fi{#1}}
-
-\def\donumchoice#1#2#3%
- {\ifnum#1#2%
- #3\@EA\gobbleuntilempty
- \else
- \@EA\dodimchoice
- \fi{#1}}
-
-\def\dimchoice#1#2{\dodimchoice{#1}#2{=#1}{#1}\empty}
-\def\numchoice#1#2{\donumchoice{#1}#2{=#1}{#1}\empty}
-
-% \the\dimexpr(\dimchoice {7pt}{{<10pt}{8pt}{<12pt}{9pt}{<15pt}{10pt}{=11pt}{12pt}})
-% \the\dimexpr(\dimchoice{11pt}{{<10pt}{8pt}{<12pt}{9pt}{<15pt}{10pt}{=11pt}{12pt}})
-% \the\dimexpr(\dimchoice{14pt}{{<10pt}{8pt}{<12pt}{9pt}{<15pt}{10pt}{=11pt}{12pt}})
-
-\def\showsetupsdefinition[#1]{\showvalue{\??su:#1}} % temp hack for debugging
-
-% documentation : \setupregister[alternative=a|b|A|B]
-\unprotected \def\traceposstring#1#2#3%
- {\iftracepositions
- \smashedhbox%
- {#1{\infofont#2#3}%
- \scratchdimen.5\points
- \kern-2\scratchdimen
- \vrule\!!width4\scratchdimen\!!height\scratchdimen\!!depth\scratchdimen}%
- \fi}
-
-% will be a MyWay
-%
-% \setuplayout[grid=yes] \setupcaption[figure][inbetween=] \useMPlibrary[dum] \setupcolors[state=start]
-%
-% \starttext \showgrid \showstruts
-%
-% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.4,grid=yes]}
-% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.4,grid=fit]}
-% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.4,grid=height]}
-% \input ward
-% \page
-% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.5,grid=yes]}
-% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.5,grid=fit]}
-% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.5,grid=height]}
-% \input ward
-% \page
-% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.6,grid=yes]}
-% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.6,grid=fit]}
-% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.6,grid=height]}
-% \input ward
-% \page
-% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.4,grid=yes]}
-% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.4,grid=fit]}
-% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.4,grid=height]}
-% \input ward
-% \page
-% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.5,grid=yes]}
-% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.5,grid=fit]}
-% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.5,grid=height]}
-% \input ward
-% \page
-% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.6,grid=yes]}
-% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.6,grid=fit]}
-% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.6,grid=height]}
-% \input ward
-%
-% \stoptext
-
-% funny, as field action with e.g. dissolve ... only the field dissolves, bug?
-
-\setglobalsystemreference\rt!exec{Transition}{transition}
-
-%def\PDFexecutetransition {/Trans /Trans <</Type /Trans \executeifdefined{PDFpage\argumentA}\PDFpagereplace>>}
-\def\PDFexecutetransition {/Trans /Trans <<\executeifdefined{PDFpage\argumentA}\PDFpagereplace>>}
-
-% new, continuous blocks, \som \par \startdoorlopendblok ...
-
-% \startitemize
-% \item bagger
-% \item bagger
-% \item \startdoorlopendblok bagger \stopdoorlopendblok
-% \item \endgraf \startdoorlopendblok bagger \stopdoorlopendblok
-% \item \endgraf \startdoorlopendblok \strut bagger \stopdoorlopendblok
-% \item \startdoorlopendblok
-% \starttabulate
-% \NC test \NC test \NC \NR
-% \NC test \NC test \NC \NR
-% \NC test \NC test \NC \NR
-% \stoptabulate
-% \stopdoorlopendblok
-% \item test
-% \stopitemize
-
-\def\startdoorlopendblok % for special cases, don't change it too much and don't rely on it
- {\ifhmode\endgraf\nobreak\fi % don't remove the \nobreak
- \dowithnextboxcontent
- {\setlocalhsize \hsize\localhsize \forgetall}
- {\bgroup
- \forgeteverypar
- \forgetparskip
- \scratchdimen\nextboxht
- \advance\scratchdimen\nextboxdp
- \getnoflines\scratchdimen
- \advance\scratchdimen-\strutheight
- \setbox\nextbox\hbox{\lower\scratchdimen\box\nextbox}%
- \ht\nextbox\strutheight
- \dp\nextbox\strutdepth
- \setbox\nextbox\vbox
- {\indent\box\nextbox
- \endgraf
- \nobreak
- \advance\noflines\minusone
- \dorecurse\noflines{\crlf\nobreak}}%
- \verticalstrut
- \endgraf
- \nobreak
- \offinterlineskip
- \kern-2\lineheight % 2\lineheight when no vertical struts in main \vbox
- \nobreak
- \unvbox\nextbox
- \prevdepth\strutdepth
- % evt (eerst testen) een signal zodat een direct volgend blok goed gaat)
- \egroup}
- \vbox\bgroup
- \vskip-\lineheight \verticalstrut\endgraf
- \insidefloattrue
- \doinhibitblank} % beware, no \inhibitblank ! ! ! ! ! !
-
-\def\stopdoorlopendblok
- {\endgraf\verticalstrut\endgraf\kern-2\lineheight
- \egroup}
-
-\def\tabulaterule % to be redone, not correct
- {\dotabulaterule
- {\hrule\!!height.5\scratchdimen\!!depth.5\scratchdimen\relax
- \doifvalue{\??tt\currenttabulate\c!distance}\v!grid
- {\kern-\scratchdimen}}} % experimental tm-prikkels
-
-% experimental: \synchronizegrid bla bla bla
-
-\newcounter\currentgridsync
-
-\def\gridsynctag{grs:\currentgridsync}
-
-\def\synchronizegrid
- {\doglobal\increment\currentgridsync
- \par\prevdepth\zeropoint
- \nointerlineskip
- \hpos\gridsynctag{\strut}\par
- \vskip-\lineheight
- \nointerlineskip
- % top of text
- \scratchdimen\MPy{\v!text:\MPp\gridsynctag}%
- \advance\scratchdimen\MPh{\v!text:\MPp\gridsynctag}%
- % move to first baseline
- \advance\scratchdimen-\topskip
- % subtract wrong baseline
- \advance\scratchdimen-\MPy\gridsynctag
- % get minimal number of lines
- \advance\scratchdimen\lineheight
- \getnoflines\scratchdimen
- % calculate difference
- \advance\scratchdimen-\noflines\lineheight\relax
- \scratchdimen-\scratchdimen\relax
- \ifdim\scratchdimen>\zeropoint
- \nointerlineskip
- \advance\scratchdimen-\lineheight
- \vskip\scratchdimen \dontleavehmode \quad \strut
- \par
- %\else
- % \message{no grid correction: \the\scratchdimen}\wait
- \fi}
-
-% needed for extreme (will go away)
-
-\definesystemvariable{ie}
-
-\def\definetest
- {\dodoubleempty\dodefinetest}
-
-\def\dodefinetest[#1][#2]#3%
- {\setgvalue{\??ie#1}{#3}%
- \ifsecondargument
- \processaction
- [#2]
- [% first test true, rest depends
- \v!next=>\setgvalue{\??ie#1}{\setgvalue{\??ie#1}{#3}\firstoftwoarguments},
- % rest true if first true
- % \v!first=>\setgvalue{\??ie#1}{#3{\letgvalue{\??ie#1}%
- % \firstoftwoarguments\firstoftwoarguments}%
- % \secondoftwoarguments},
- % always true
- \v!yes=>\letgvalue{\??ie#1}\firstoftwoarguments,
- % always false
- \v!no=>\letgvalue{\??ie#1}\secondoftwoarguments]%
- \fi}
-
-\def\doperformtest#1%
- {\executeifdefined{\??ie#1}\secondoftwoarguments}
-
-\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}}
-
-% so far
-
-% between alignment lines certain rules apply, and even a
-% simple test can mess up a table, which is why we have a
-% special test facility
-%
-% \ruledvbox
-% {\starttabulate[|l|p|]
-% \NC 1test \NC test \NC \NR
-% \tableifelse{\doifelse{a}{a}}{\NC Xtest \NC test \NC \NR}{}%
-% \stoptabulate}
-
-\long\def\tableifelse#1%
- {\tablenoalign
- {#1%
- {\aftergroup \firstoftwoarguments}%
- {\aftergroup\secondoftwoarguments}}}
-
-\long \def\tableiftextelse#1{\tableifelse{\doiftextelse{#1}}}
-
-% experiment, not yet to be used
-
-\def\displaybreak
- {\ifhmode
- \removeunwantedspaces
- \ifcase\raggedstatus\hfill\fi
- \strut\penalty-9999 % \break fails on case (3)
- \fi}
-
-\def\startdisplay{\displaybreak\ignorespaces\startpacked}
-\def\stopdisplay {\stoppacked\displaybreak\ignorespaces}
-
-\def\tightvbox{\dowithnextbox{\nextboxdp\zeropoint\flushnextbox}\vbox}
-\def\tightvtop{\dowithnextbox{\nextboxht\zeropoint\flushnextbox}\vtop}
-
-% what is this stupid macro meant for:
-
-\def\hyphenationpoint
- {\hskip\zeropoint}
-
-\def\hyphenated#1%
- {\bgroup
- \!!counta\zerocount
- \def\hyphenated##1{\advance\!!counta\plusone}%
- \handletokens#1\with\hyphenated
- \!!countb\plusone
- \def\hyphenated##1%
- {##1%
- \advance\!!countb\plusone\relax
- \ifnum\!!countb>2 \ifnum\!!countb<\!!counta
- \hyphenationpoint
- \fi\fi}%
- \handletokens#1\with\hyphenated
- \egroup}
-
-\def\obeysupersubletters
- {\let\super\normalsuper
- \let\suber\normalsuber
- \let\normalsuper\letterhat
- \let\normalsuber\letterunderscore
- \enablesupersub}
-
-\def\obeysupersubmath
- {\let\normalsuper\letterhat
- \let\normalsuber\letterunderscore
- \enablesupersub}
-
-%\let\normaltype\type
-%
-%\def\type#1%
-% {\expanded{\normaltype{\detokenize{#1}}}}
-
-% {x123 \os x123} {\tfa x123 \os x123} {x123 \tx x123 \os x123}
-% \definefontsynonym[OldStyle][Serif]
-% {x123 \os x123} {\tfa x123 \os x123} {x123 \tx x123 \os x123}
-
-% testen :
-%
-% \appendtoks
-% \let\registerparoptions\relax
-% \to \everyforgetall
-
-\def\startgridcorrection
- {\dosingleempty\dostartgridcorrection}
-
-\def\dostartgridcorrection[#1]%
- {\ifgridsnapping
- \iffirstargument\doifsomething{#1}{\moveongrid[#1]}\fi
- \snaptogrid\vbox\bgroup
- \else
- \startbaselinecorrection
- \fi}
-
-\def\stopgridcorrection
- {\ifgridsnapping
- \egroup
- \else
- \stopbaselinecorrection
- \fi}
-
-\def\checkgridsnapping
- {\lineskip\ifgridsnapping\zeropoint\else\normallineskip\fi}
-
-\def\startplaatsen
- {\dosingleempty\dostartplaatsen}
-
-\def\dostartplaatsen[#1]% tzt n*links etc
- {\endgraf
- \noindent\bgroup
- \setlocalhsize
- \hbox to \localhsize\bgroup
- \doifnot{#1}\v!left\hss
- \def\stopplaatsen
- {\unskip\unskip\unskip
- \doifnot{#1}\v!right\hss
- \egroup
- \egroup
- \endgraf}%
- \gobblespacetokens}
-
-% \startplaatsen[links] bla \stopplaatsen
-
-% we don't register the paragraph characteristics, only the
-% width
-
-\appendtoks
- \setinnerparpositions % see "techniek" for application
-\to \everytabulate
-
-\def\fontclassname#1#2%
- {\ifcsname\??ff#1#2\endcsname
- \fontclassname{#1}{\csname\??ff#1#2\endcsname}%
- \else\ifcsname\??ff#2\endcsname
- \fontclassname{#1}{\csname\??ff#2\endcsname}%
- \else
- #2%
- \fi\fi}
-
-\def\defineclassfontsynonym
- {\dotripleargument\dodefineclassfontsynonym}
-
-\def\dodefineclassfontsynonym[#1][#2][#3]%
- {\definefontsynonym[#1][\fontclassname{#2}{#3}]}
-
-%\definefontsynonym [KopFont] [\fontclassname{officina}{SerifBold}]
-%
-%\defineclassfontsynonym [KopFont] [officina] [SerifBold]
-
-\def\startcolumnmakeup % don't change
- {\bgroup
- \getrawnoflines\textheight % teksthoogte kan topskip hebben, dus raw
- \scratchdimen\noflines\lineheight
- \advance\scratchdimen-\lineheight
- \advance\scratchdimen\topskip
- \setbox\scratchbox
- \ifcase\showgridstate\vbox\else\ruledvbox\fi to \scratchdimen\bgroup
- \forgetall} % ! don't change
-
-\def\stopcolumnmakeup
- {\egroup
- \dp\scratchbox\zeropoint
- \wd\scratchbox\textwidth
- \box\scratchbox
- \egroup
- \synchronizehsize}
-
-\long\def\startexternalfigure
- {\dotripleempty\dostartexternalfigure}
-
-\long\def\dostartexternalfigure[#1][#2][#3]#4\stopexternalfigure
- {\gdef\figuredescription{#4}%
- \externalfigure[#1][#2][#3]%
- \globallet\figuredescription\empty}
-
-\let\figuredescription\empty
-
-%% where does this come from, old code probably
-%%
-%%
-%% \newif\ifpagechanged \let\lastchangedpage\empty
-%%
-%% \def\checkpagechange#1%
-%% {\gettwopassdata\s!paragraph
-%% \pagechangedfalse
-%% \iftwopassdatafound
-%% \ifnum\twopassdata>0\getvalue{\s!paragraph:p:#1}\relax
-%% \pagechangedtrue
-%% \fi
-%% \fi
-%% \ifpagechanged
-%% \letgvalue{\s!paragraph:p:#1}\twopassdata
-%% \globallet\lastchangedpage\twopassdata
-%% \else
-%% \globallet\lastchangedpage\realfolio
-%% \fi
-%% \doparagraphreference}
-%%
-%% \def\changedpage#1%
-%% {\getvalue{\s!paragraph:p:#1}}
-
-\newcount\nofprofiled
-
-\def\profilemacro#1%
- {\nofprofiled\zerocount
- \letvalue{\string#1\string#1}#1%
- \appendtoks
- \normalwritestatus\m!systems{profile \string#1: \number\nofprofiled}%
- \to \everystoptext
- \unexpanded\def#1%
- {\global\advance\nofprofiled\plusone
- \csname\string#1\string#1\endcsname}}
-
-% incomplete, will be a special case of float placement
-
-\def\startfixed{\dosingleempty\dostartfixed}
-
-\def\dostartfixed[#1]%
- {\expanded{\dowithnextbox{\noexpand\dodofixed{\ifhmode0\else1\fi}{#1}}}%
- \vbox\bgroup
- \setlocalhsize}
-
-\def\stopfixed
- {\egroup}
-
-\def\dodofixed#1#2%
- {\ifcase#1\relax
- \processaction
- [#2]
- [ \v!high=>\bbox {\flushnextbox},
- \v!low=>\tbox {\flushnextbox},
- \v!middle=>\vcenter{\flushnextbox},
- \v!lohi=>\vcenter{\flushnextbox},
- \s!unknown=>\tbox {\flushnextbox},
- \s!default=>\tbox {\flushnextbox}]%
- \else
- \startbaselinecorrection
- \noindent\flushnextbox
- \stopbaselinecorrection
- \fi}
-
-% \startitemize
-%
-% \item \externalfigure[koe][height=2cm]
-% \item \externalfigure[koe][height=2cm]
-% \item \externalfigure[koe][height=2cm]
-% \item \externalfigure[koe][height=2cm]
-%
-% \page
-%
-% \item \startfixed \externalfigure[koe][height=2cm]\stopfixed
-% \item \startfixed[high]\externalfigure[koe][height=2cm]\stopfixed
-% \item \startfixed[low] \externalfigure[koe][height=2cm]\stopfixed
-% \item \startfixed[lohi]\externalfigure[koe][height=2cm]\stopfixed
-%
-% \page
-%
-% \item test \startfixed \externalfigure[koe][height=2cm]\stopfixed
-% \item test \startfixed[high]\externalfigure[koe][height=2cm]\stopfixed
-% \item test \startfixed[low] \externalfigure[koe][height=2cm]\stopfixed
-% \item test \startfixed[lohi]\externalfigure[koe][height=2cm]\stopfixed
-%
-% \page
-%
-% \item test \par \startfixed \externalfigure[koe][height=2cm]\stopfixed
-% \item test \par \startfixed[high]\externalfigure[koe][height=2cm]\stopfixed
-% \item test \par \startfixed[low] \externalfigure[koe][height=2cm]\stopfixed
-% \item test \par \startfixed[lohi]\externalfigure[koe][height=2cm]\stopfixed
-%
-% \stopitemize
-
-\def\obeyfollowingtoken{{}} % end \cs scanning
-
-% \def\comparedimension#1#2%
-% {\chardef\compresult
-% \ifdim#1<#2%
-% \zerocount
-% \else\ifdim#1<#2%
-% \plusone
-% \else
-% \plustwo
-% \fi\fi}
-% \newdimen\roundingeps \roundingeps=10sp
-% \def\comparedimensioneps#1#2%
-% {\chardef\compresult
-% \ifdim\dimexpr(#1-#2)<\roudingeps
-% \zerocount
-% \else\ifdim\dimexpr(#2-#1)<\roudingeps
-% \zerocount
-% \else\ifdim#1<#2%
-% \plusone
-% \else
-% \plustwo
-% \fi\fi\fi}
-
-%D Next we load a few local optimizations and new features. They
-%D live on on my machine and are not distributed, but they may end
-%D up in the distributed files.
-
-\loadmarkfile{cont-new}
-
-\readsysfile {cont-loc} {} {} % local improvements, patches, new features
-\readsysfile {cont-exp} {} {} % experimental features (e.g. local speed-ups)
-%readsysfile {cont-mtx} {} {} % experimental metatex features
-
-\protect \endinput
diff --git a/tex/context/base/cont-sys.ori b/tex/context/base/cont-sys.ori
index 11c0141e7..fa438a78d 100644
--- a/tex/context/base/cont-sys.ori
+++ b/tex/context/base/cont-sys.ori
@@ -11,6 +11,10 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+%D Beware, this is a MkII specific file. In MkIV we only load
+%D cont-sys.mkiv but in MkII we load the first found of
+%D cont-sys.mkii, cont-sys.tex, cont-sys.rme.
+
\unprotect
% Speed up typescript loading, but at the cost of much memory:
diff --git a/tex/context/base/cont-usr.ori b/tex/context/base/cont-usr.ori
deleted file mode 100644
index 5a3070362..000000000
--- a/tex/context/base/cont-usr.ori
+++ /dev/null
@@ -1,109 +0,0 @@
-%D \module
-%D [ file=cont-usr,
-%D version=1997.10.05,
-%D title=\CONTEXT\ User Format Specifications,
-%D subtitle=System Specific Setups,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt User Settings}
-
-\unprotect
-
-%D Additional languages can be defined here. Beware of
-%D encoding incompatibilities. Please take a look at the
-%D \type {cont-en.tex}, \type {cont-nl.tex}, enz.\ files
-%D first. Normally you don't have to change a byte. If you
-%D want to play safe, use \typ {texexec --make --alone
-%D --all}.
-
-% \preloadallpatterns % will load them all
-
-% \installlanguage [\s!af] [\c!state=\v!start] % afrikaans
-% \installlanguage [\s!ca] [\c!state=\v!start] % catalan
-% \installlanguage [\s!cs] [\c!state=\v!start] % czech
-% \installlanguage [\s!da] [\c!state=\v!start] % danish
-% \installlanguage [\s!de] [\c!state=\v!start] % german
-% \installlanguage [\s!en] [\c!state=\v!start] % english us
-% \installlanguage [\s!es] [\c!state=\v!start] % spanish
-% \installlanguage [\s!fi] [\c!state=\v!start] % finnish
-% \installlanguage [\s!fr] [\c!state=\v!start] % french
-% \installlanguage [\s!hr] [\c!state=\v!start] % croatian
-% \installlanguage [\s!hu] [\c!state=\v!start] % hungarian
-% \installlanguage [\s!it] [\c!state=\v!start] % italian
-% \installlanguage [\s!la] [\c!state=\v!start] % latin
-% \installlanguage [\s!nl] [\c!state=\v!start] % dutch
-% \installlanguage [\s!nb] [\c!state=\v!start] % bokmal
-% \installlanguage [\s!nn] [\c!state=\v!start] % nynorsk
-% \installlanguage [\s!pl] [\c!state=\v!start] % polish
-% \installlanguage [\s!pt] [\c!state=\v!start] % portuguese
-% \installlanguage [\s!ro] [\c!state=\v!start] % romanian
-% \installlanguage [\s!ru] [\c!state=\v!start] % russian
-% \installlanguage [\s!sk] [\c!state=\v!start] % slovak
-% \installlanguage [\s!sl] [\c!state=\v!start] % slovenian
-% \installlanguage [\s!sv] [\c!state=\v!start] % swedish
-% \installlanguage [\s!tr] [\c!state=\v!start] % turkish
-% \installlanguage [\s!ua] [\c!state=\v!start] % ukrainian
-% \installlanguage [\s!gb] [\c!state=\v!start] % english uk
-% \installlanguage [\s!vn] [\c!state=\v!start] % vietnamese
-
-% \installlanguage [deo] [\c!state=\v!start] % old german
-
-%D The next lines can be used for setting the language to be
-%D used at startup time.
-
-% \setupcurrentlanguage[\s!af]
-% \setupcurrentlanguage[\s!ca]
-% \setupcurrentlanguage[\s!cs]
-% \setupcurrentlanguage[\s!da]
-% \setupcurrentlanguage[\s!de]
-% \setupcurrentlanguage[\s!en]
-% \setupcurrentlanguage[\s!es]
-% \setupcurrentlanguage[\s!fi]
-% \setupcurrentlanguage[\s!fr]
-% \setupcurrentlanguage[\s!hr]
-% \setupcurrentlanguage[\s!hu]
-% \setupcurrentlanguage[\s!it]
-% \setupcurrentlanguage[\s!la]
-% \setupcurrentlanguage[\s!nl]
-% \setupcurrentlanguage[\s!nb]
-% \setupcurrentlanguage[\s!nn]
-% \setupcurrentlanguage[\s!pl]
-% \setupcurrentlanguage[\s!pt]
-% \setupcurrentlanguage[\s!ro]
-% \setupcurrentlanguage[\s!ru]
-% \setupcurrentlanguage[\s!sk]
-% \setupcurrentlanguage[\s!sl]
-% \setupcurrentlanguage[\s!sv]
-% \setupcurrentlanguage[\s!tr]
-% \setupcurrentlanguage[\s!ua]
-
-%D Local font settings can go here. Normally suitable
-%D defaults are already preloaded, almost certainly the
-%D Computer Modern Roman typefaces or some derivate. So, the
-%D next line is only meant as sample, take a look at the
-%D format related files first.
-
-% This is obsolete due to latin modern:
-%
-% \definefilesynonym [font-cmr] [font-csr] % czech & slovak
-% \definefilesynonym [font-cmr] [font-plr] % polish
-
-%D In some languages, compound characters, like \type {"e}
-%D are used to get accented and non latin characters.
-
-% Per 21/9/2006 one needs to explicitly enable this.
-
-% \useencoding[fde] % german
-% \useencoding[ffr] % french
-% \useencoding[fro] % romanian
-% \useencoding[fpl] % polish
-
-%D Don't remove the next few lines.
-
-\protect \endinput
diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii
index 3bbb7e304..2124dc771 100644
--- a/tex/context/base/context.mkii
+++ b/tex/context/base/context.mkii
@@ -105,8 +105,7 @@
\loadmarkfile{core-fil}
\loadmarkfile{core-con}
-%D We already need some synonyms (patterns). At runtime this
-%D file will be reloaded.
+%D We already need some synonyms (patterns).
\loadmarkfile{cont-fil}
@@ -279,6 +278,7 @@
\loadmarkfile{type-ini}
\loadmarkfile{type-set}
+\loadmarkfile{type-def}
%D Properties. Don't ask.
@@ -385,8 +385,3 @@
%D \item \type{cont-new}: new macro implementations (for testing)
%D \item \type{cont-fil}: filename and module synonyms
%D \stopitemize
-
-% %D Except from english, no hyphenation patterns are loaded
-% %D yet. Users can specify their needs in the next module:
-%
-% \input cont-usr
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index a7fcb8651..75306e53c 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -65,7 +65,7 @@
\loadmarkfile{char-act}
\loadmarkfile{mult-ini}
-\loadmarkfile{mult-fst}
+%loadmarkfile{mult-fst} % obsolete
\loadmarkfile{mult-sys}
\loadmarkfile{mult-def}
\loadmarkfile{mult-chk}
@@ -290,6 +290,8 @@
\loadmarkfile{type-ini}
\loadmarkfile{type-set}
+\loadmarkfile{type-def}
+\loadmarkfile{type-lua}
\loadmarkfile{scrp-ini}
diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex
index 9903d22f5..8c2c70ab7 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{2011.01.14 14:44}
+\edef\contextversion{2011.01.18 19:34}
%D For those who want to use this:
diff --git a/tex/context/base/core-fil.mkiv b/tex/context/base/core-fil.mkiv
index e96feae07..ac3f88d26 100644
--- a/tex/context/base/core-fil.mkiv
+++ b/tex/context/base/core-fil.mkiv
@@ -193,28 +193,7 @@
%D We also support a singular call, which saves us for
%D frustrations when we do a typo.
-\let\usemodule=\usemodules
-
-% %D The definition shows that the language specific settings
-% %D are activated after loading all the modules specified.
-
-%D \macros
-%D {ifprotectbuffers, bufferprefix,
-%D TEXbufferfile, MPgraphicfile}
-%D
-%D The next switch enables protection of temporary filenames,
-%D which is needed when we process more files on one path at
-%D the same time.
-
-\newif\ifprotectbuffers
-
-\def\bufferprefix{\ifprotectbuffers\jobname-\fi}
-
-% The following filenames are defined here:
-
-\def\TEXbufferfile #1{\bufferprefix#1.\f!temporaryextension}
-\def\MPgraphicfile {\bufferprefix mp\ifMPrun run\else graph\fi} % not needed in luatex
-\def\convertMPcolorfile{\bufferprefix metacmyk.tmp}
+\let\usemodule\usemodules
%D To save memory, we implement some seldomly used commands
%D in a lazy way. Nota bene: such runtime definitions are
@@ -259,4 +238,6 @@
%D This module will be perfected / changed / weeded.
+\let\protectbufferstrue\relax % will go away ... now in cont-sys.tex
+
\protect \endinput
diff --git a/tex/context/base/core-job.mkii b/tex/context/base/core-job.mkii
index d33f7bfdf..869ae6a31 100644
--- a/tex/context/base/core-job.mkii
+++ b/tex/context/base/core-job.mkii
@@ -126,31 +126,34 @@
\ifx\preloadfonts \undefined \let\preloadfonts \relax \fi
\ifx\preloadspecials\undefined \let\preloadspecials\relax \fi
-\def\loadallsystemfiles#1#2%
- {\ifx\@@svdirectory\empty
- \readsysfile{#1}{\showmessage\m!systems2{#1}}{#2}%
- \else% yet undocumented
- \def\doloadsystemfile##1%
- {\readsetfile{##1}{#1}{\showmessage\m!systems2{#1}}{#2}}%
- \processcommacommand[\@@svdirectory]\doloadsystemfile
- \fi}
-
\ifx\disableXML\undefined \let\disableXML\relax \fi
+\def\doloadsystemfile#1% mkii with fallback to tex
+ {\readsysfile{#1.\mksuffix}
+ {\showmessage\m!systems2{#1.\mksuffix}}
+ {\readsysfile{#1.tex}{\showmessage\m!systems2{#1.tex}}\donothing}}
+
\def\loadsystemfiles
{\reportprotectionstate
- \readsysfile\f!newfilename{\showmessage\m!systems2\f!newfilename}\donothing
- %\readsysfile\f!oldfilename{\showmessage\m!systems2\f!oldfilename}\donothing
- \loadallsystemfiles\f!filfilename
- \donothing
- \loadallsystemfiles\f!sysfilename
- {\loadallsystemfiles{\f!sysfilename.rme}\donothing % new, fall back
- \doglobal\appendtoks % brrr better \setcatcodetable\ctxcatcodes % % test
- \bgroup\disableXML\loadallsystemfiles\f!errfilename\donothing\egroup
- \to\everygoodbye}}
+ \doloadsystemfile\f!newfilename
+ \doloadsystemfile\f!locfilename
+ \doloadsystemfile\f!expfilename
+ \readsysfile{\f!sysfilename.\mksuffix}
+ {\showmessage\m!systems2{\f!sysfilename.\mksuffix}}
+ {\readsysfile{\f!sysfilename.tex}
+ {\showmessage\m!systems2{\f!sysfilename.tex}}
+ {\readsysfile{\f!sysfilename.rme}
+ {\showmessage\m!systems2{\f!sysfilename.rme}%
+ \doglobal\appendtoks % brrr better \setcatcodetable\ctxcatcodes
+ \bgroup
+ \disableXML
+ \readsysfile{\f!errfilename.\mksuffix}\donothing
+ \egroup
+ \to\everygoodbye}}}}
%D Loading of \type {cont-usr.tex} (edited by the user)
-%D and \type {cont-fmt.tex} (generated by texexec).
+%D and \type {cont-fmt.tex} (generated by texexec). This is
+%S obsolete now that we have enough memory for patterns.
% \def\loaduserspecifications
% {% this used to be the file where users can tune their system, especially patterns
diff --git a/tex/context/base/core-job.mkiv b/tex/context/base/core-job.mkiv
index e7771e22c..ad75cd079 100644
--- a/tex/context/base/core-job.mkiv
+++ b/tex/context/base/core-job.mkiv
@@ -58,31 +58,21 @@
\def\usesubpath [#1]{\edef\allinputpaths{\ctxlua{commands.usesubpath("#1")}}}
\def\usezipfile {\dodoubleempty\dousezipfile}
\def\dousezipfile[#1][#2]{\ctxlua{commands.usezipfile("#1","#2")}} % [filename] [optional subtree]
-
\def\loadexamodes {\dosingleempty\doloadexamodes}
\def\doloadexamodes [#1]{\ctxlua{commands.loadexamodes("#1")}}
\def\registerfileinfo[#1#2]#3% geen \showmessage ?
{\writestatus\m!systems{#1#2 file #3 at line \the\inputlineno}}
-\def\loadallsystemfiles#1#2%
- {\ifx\@@svdirectory\empty
- \readsysfile{#1}{\showmessage\m!systems2{#1}}{#2}%
- \else% yet undocumented
- \def\doloadsystemfile##1%
- {\readsetfile{##1}{#1}{\showmessage\m!systems2{#1}}{#2}}%
- \processcommacommand[\@@svdirectory]\doloadsystemfile
- \fi}
+\def\doloadsystemfile#1% only mkiv files
+ {\readsysfile{#1.\mksuffix}{\showmessage\m!systems2{#1.\mksuffix}}\donothing}
\def\loadsystemfiles
{\reportprotectionstate
- \readsysfile\f!newfilename{\showmessage\m!systems2\f!newfilename}\donothing
- %\readsysfile\f!oldfilename{\showmessage\m!systems2\f!oldfilename}\donothing
- \loadallsystemfiles\f!filfilename % this will move to lua and get preloaded
- \donothing
- \loadallsystemfiles\f!sysfilename
- {\loadallsystemfiles{\f!sysfilename.rme}\donothing % new, fall back
- \loadallsystemfiles \f!errfilename \donothing}}
+ \doloadsystemfile\f!newfilename % new code, to be integrated at some point, plus fixes posted on the list
+ \doloadsystemfile\f!locfilename % new code, somewhat experimental, not distributed (outside the dev group)
+ \doloadsystemfile\f!expfilename % new code, very experimental, can be engine specific, mostly for me only
+ \doloadsystemfile\f!sysfilename} % local settings, but probably not that good an idea to use
%D We don't want multiple jobfiles to interfere.
@@ -178,21 +168,34 @@
\def\donotexecutefile#1%
{}
-\def\useenvironment[#1]% maybe commalist
- {\environment #1 \relax}
+\unexpanded\def\project {\doifnextoptionalelse\useproject \redoproject}
+\unexpanded\def\environment{\doifnextoptionalelse\useenvironment\redoenvironment}
+\unexpanded\def\product {\doifnextoptionalelse\useproduct \redoproduct}
+\unexpanded\def\component {\doifnextoptionalelse\usecomponent \redocomponent}
+
+\def\redoproject #1 {\useproject [#1]}
+\def\redoenvironment #1 {\useenvironment[#1]}
+\def\redoproduct #1 {\useproduct [#1]}
+\def\redocomponent #1 {\usecomponent [#1]}
-\def\environment #1 % at outermost level only (load only once)
- {\pushmacro\startenvironment
+\def\useproject[#1]%
+ {}
+
+\def\useenvironment[#1]% maybe commalist
+ {\pushmacro\dostartenvironment % we could use a depth counter
\pushmacro\stopenvironment
- \unexpanded\def\startenvironment ##1 {}%
+ \unexpanded\def\dostartenvironment[##1]{}%
\let\stopenvironment\relax
\startreadingfile
\doexecutefileonce{#1}
\stopreadingfile
\popmacro\stopenvironment
- \popmacro\startenvironment}
+ \popmacro\dostartenvironment}
-\def\component #1 % at outermost level only
+\def\useproduct[#1]%
+ {}
+
+\def\usecomponent[#1]%
{\dostarttextfile{#1}%
\processfile{#1}%
\dostoptextfile}
@@ -202,7 +205,7 @@
\let\currentcomponent \v!text
\let\currentcomponentpath\f!currentpath
-\def\donextlevel#1#2#3#4#5#6#7\\%
+\def\donextlevel#1#2#3#4#5#6#7\\% we will move this to lua
{\pushmacro\currentcomponent
\pushmacro\currentcomponentpath
\let\currentcomponent#1%
@@ -216,10 +219,10 @@
\beforesplitstring#7\at.\to#2\relax % can become path + base
\ifcase\filelevel\relax
\starttext
- \def\project ##1 {#3{##1}}%
- \def\environment ##1 {#4{##1}}%
- \def\product ##1 {#5{##1}}%
- \def\component ##1 {#6{##1}}%
+ \unexpanded\def\useproject [##1]{#3{##1}}%
+ \unexpanded\def\useenvironment[##1]{#4{##1}}%
+ \unexpanded\def\useproduct [##1]{#5{##1}}%
+ \unexpanded\def\usecomponent [##1]{#6{##1}}%
\fi
\advance\filelevel\plusone
\fullexpandoneargafter\addtocommalist{#1}\loadedfiles}
@@ -235,24 +238,34 @@
\expandafter\endinput
\fi}
-\unexpanded\def\startproject #1 %
+\unexpanded\def\startproject {\doifnextoptionalelse\dostartproject \redostartproject}
+\unexpanded\def\startenvironment{\doifnextoptionalelse\dostartenvironment\redostartenvironment}
+\unexpanded\def\startproduct {\doifnextoptionalelse\dostartproduct \redostartproduct}
+\unexpanded\def\startcomponent {\doifnextoptionalelse\dostartcomponent \redostartcomponent}
+
+\def\redostartproject #1 {\dostartproject [#1]}
+\def\redostartenvironment #1 {\dostartenvironment[#1]}
+\def\redostartproduct #1 {\dostartproduct [#1]}
+\def\redostartcomponent #1 {\dostartcomponent [#1]}
+
+\def\dostartproject[#1]%
{\donextlevel\v!project\currentproject
\donotexecutefile\doexecutefileonce
\doexecutefileonce\doexecutefile#1\\}
-\unexpanded\def\startproduct #1 %
+\def\dostartproduct[#1]%
{\doateverystarttext
\donextlevel\v!product\currentproduct
\doexecutefileonce\doexecutefileonce
\donotexecutefile\doexecutefile#1\\}
-\unexpanded\def\startcomponent #1 %
+\def\dostartcomponent[#1]%
{\doateverystarttext
\donextlevel\v!component\currentcomponent
\doexecutefileonce\doexecutefileonce
\donotexecutefile\doexecutefile#1\\}
-\unexpanded\def\startenvironment #1 %
+\def\dostartenvironment[#1]%
{\donextlevel\v!environment\currentenvironment
\donotexecutefile\doexecutefileonce
\donotexecutefile\donotexecutefile#1\\}
@@ -275,18 +288,17 @@
{\beforesplitstring##1\at.\to\someevironment
\fullexpandoneargafter\addtocommalist\someevironment\loadedlocalenvironments}%
\processcommalist[#1]\docommand
- \fullexpandtwoargsafter\doifcommonelse % no longer next needed
- {\currentproject,\currentproduct,%
- \currentcomponent,\currentenvironment}
- {\loadedlocalenvironments}
+ \expanded{\doifcommonelse{\currentproject,\currentproduct,\currentcomponent,\currentenvironment}{\loadedlocalenvironments}} % \expanded not needed
{\letvalue{\e!stop\v!localenvironment}\relax}
- {\grabuntil{\e!stop\v!localenvironment}\gobbleoneargument}} % TH: fixed, was \relax
+ {\grabuntil{\e!stop\v!localenvironment}\gobbleoneargument}}
+
+\setvalue{\v!localenvironment}{\doifnextoptionalelse\uselocalenvironment\redolocalenvironment}
+
+\def\redolocalenvironment#1 {\uselocalenvironment[#1]}
-\setvalue{\v!localenvironment}#1 {\doexecutefileonce{#1}}
-
-% NOT TOEVOEGEN: \the\everytrace
+\def\uselocalenvironment[#1]{\doexecutefileonce{#1}}
-\neverypar\emptytoks
+\neverypar\emptytoks % here ?
% \appendtoks \flushnotes \to \everypar
% \appendtoks \synchronizesidefloats \to \everypar
diff --git a/tex/context/base/data-env.lua b/tex/context/base/data-env.lua
index d2c38262d..82e53c290 100644
--- a/tex/context/base/data-env.lua
+++ b/tex/context/base/data-env.lua
@@ -20,12 +20,12 @@ local suffixmap = allocate() resolvers.suffixmap = suffixmap
local relations = allocate { -- todo: handlers also here
core = {
- ofm = {
+ ofm = { -- will become obsolete
names = { "ofm", "omega font metric", "omega font metrics" },
variable = 'OFMFONTS',
suffixes = { 'ofm', 'tfm' },
},
- ovf = {
+ ovf = { -- will become obsolete
names = { "ovf", "omega virtual font", "omega virtual fonts" },
variable = 'OVFFONTS',
suffixes = { 'ovf', 'vf' },
@@ -75,7 +75,7 @@ local relations = allocate { -- todo: handlers also here
variable = 'TEXFORMATS',
suffixes = { 'fmt' },
},
- mem = {
+ mem = { -- will become obsolete
names = { 'mem', "metapost format" },
variable = 'MPMEMS',
suffixes = { 'mem' },
diff --git a/tex/context/base/enco-fde.mkii b/tex/context/base/enco-fde.mkii
index a7c11abfc..da104b802 100644
--- a/tex/context/base/enco-fde.mkii
+++ b/tex/context/base/enco-fde.mkii
@@ -11,8 +11,6 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\doifmode{mkiv}{\endinput}
-
\unprotect
\installactivecharacter "
diff --git a/tex/context/base/enco-ffr.mkii b/tex/context/base/enco-ffr.mkii
index 093cc6500..259b59949 100644
--- a/tex/context/base/enco-ffr.mkii
+++ b/tex/context/base/enco-ffr.mkii
@@ -11,8 +11,6 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\doifmode{mkiv}{\endinput}
-
% \definehspace[fr][:][.25em]
% \definehspace[fr][;][.25em]
% \definehspace[fr][!][.25em]
diff --git a/tex/context/base/enco-ini.mkiv b/tex/context/base/enco-ini.mkiv
index 33a5e92d7..d7fac77c2 100644
--- a/tex/context/base/enco-ini.mkiv
+++ b/tex/context/base/enco-ini.mkiv
@@ -533,4 +533,16 @@
\let\_\normalunderscore
+%D To be sorted out:
+
+\unexpanded\def\textminus
+ {\char \iffontchar\font"2012 "2012 % figuredash
+ \else\iffontchar\font"2013 "2013 % endash
+ \else\iffontchar\font"2212 "2212 % math minus
+ "002D % hyphen
+ \fi\fi\fi}
+
+\unexpanded\def\textplus
+ {\char"002B } % plus
+
\protect \endinput
diff --git a/tex/context/base/enco-l7x.mkii b/tex/context/base/enco-l7x.mkii
index 8f355317b..776c683c1 100644
--- a/tex/context/base/enco-l7x.mkii
+++ b/tex/context/base/enco-l7x.mkii
@@ -17,17 +17,17 @@
\startmapping[l7x]
-\definecaseswap 25 `I % dotless i (TODO - probably wrong; maybe use \defineuppercasecom)
-\definecaseswap 156 140 % oeligature
-\definecaseswap 184 168 % ostroke
-\definecaseswap 186 170 % rcommaaccent
-\definecaseswap 191 175 % aeligature
-\definecaseself 223 % ssharp (this is wrong, but no better way)
+\definecaseswap 25 `I % dotless i (TODO - probably wrong; maybe use \defineuppercasecom)
+\definecaseswap 156 140 % oeligature
+\definecaseswap 184 168 % ostroke
+\definecaseswap 186 170 % rcommaaccent
+\definecaseswap 191 175 % aeligature
+\definecaseself 223 % ssharp (this is wrong, but no better way)
\definecasemaps 192 to 222 lc +32 uc 0
\definecasemaps 224 to 254 lc 0 uc -32
-\resetcaserange 215 to 215 % textmultiply
-\resetcaserange 247 to 247 % textdiv
+\resetcaserange 215 to 215 % textmultiply
+\resetcaserange 247 to 247 % textdiv
\stopmapping
diff --git a/tex/context/base/enco-t5.mkii b/tex/context/base/enco-t5.mkii
index 251c68765..a8d80be14 100644
--- a/tex/context/base/enco-t5.mkii
+++ b/tex/context/base/enco-t5.mkii
@@ -205,6 +205,8 @@
%
% \stopencoding
%
+% \unprotect
+%
% \def\xfiveencodedaa%
% {\accent23a}
%
@@ -214,7 +216,9 @@
% \dimen@\ht\zerocount
% \advance\dimen@ -1ex
% \rlap{\raise.67\dimen@\hbox{\char23}}A}
-
+%
+% \protect
+%
% \quotesinglbase 13
% \guilsinglleft 14
% \guilsinglright 15
diff --git a/tex/context/base/enco-x5.mkii b/tex/context/base/enco-x5.mkii
index f82ec6c5c..d3b701c1a 100644
--- a/tex/context/base/enco-x5.mkii
+++ b/tex/context/base/enco-x5.mkii
@@ -179,6 +179,8 @@
%
% \stopencoding
%
+% \unprotect
+%
% \def\xfiveencodedaa%
% {\accent23a}
%
@@ -188,7 +190,9 @@
% \dimen@\ht\zerocount
% \advance\dimen@ -1ex
% \rlap{\raise.67\dimen@\hbox{\char23}}A}
-
+%
+% \protect
+%
% \quotesinglbase 13
% \guilsinglleft 14
% \guilsinglright 15
diff --git a/tex/context/base/font-ini.mkiv b/tex/context/base/font-ini.mkiv
index 9be2feb10..f0f63f465 100644
--- a/tex/context/base/font-ini.mkiv
+++ b/tex/context/base/font-ini.mkiv
@@ -3134,12 +3134,39 @@
%D text and headings, which is accomplished by assigning both
%D arguments.
+% \def\dodefinealternativestyle[#1][#2][#3]%
+% {\def\docommand##1%
+% {\ifcsname##1\endcsname\else\setuvalue{##1}{\groupedcommand{#2}{}}\fi
+% \setvalue{\@letter@ ##1}{#2}%
+% \setvalue{\@noletter@##1}{#3}}%
+% \processcommalist[#1]\docommand}
+
+\setnewconstant \currentalternativestyleindex \plusone
+
+\def\dododefinealternativestyle#1#2#3%
+ {\ifcsname#3\endcsname
+ % no redefinition
+ \else
+ \setuvalue{#3}{\groupedcommand{#1}{}}%
+ \fi
+ \setvalue{\??ft:as:#3}{\doapplyalternativestyle{#1}{#2}}}%
+
\def\dodefinealternativestyle[#1][#2][#3]%
- {\def\docommand##1%
- {\ifcsname##1\endcsname\else\setuvalue{##1}{\groupedcommand{#2}{}}\fi
- \setvalue{\@letter@ ##1}{#2}%
- \setvalue{\@noletter@##1}{#3}}%
- \processcommalist[#1]\docommand}
+ {\processcommalist[#1]{\dododefinealternativestyle{#2}{#3}}} % also gets {##1}
+
+\def\applyalternativestyle#1%
+ {\ifcsname\??ft:as:#1\endcsname\csname\??ft:as:#1\expandafter\endcsname\fi}
+
+\def\doapplyalternativestyle
+ {\ifcase\currentalternativestyleindex
+ \expandafter\gobbletwoarguments
+ \or
+ \expandafter\firstoftwoarguments
+ \or
+ \expandafter\secondoftwoarguments
+ \else
+ \expandafter\firstoftwoarguments
+ \fi}
\unexpanded\def\definealternativestyle
{\dotripleempty\dodefinealternativestyle}
@@ -3202,51 +3229,72 @@
% subtle ... \expandafter is needed else problems with lookahead caps
%
% this will be cleaned up
-
-\def\@@dodoconvertfont{\csname\@letter@ \p!defined\expandafter\endcsname\gobbleoneargument}
-\def\@@donoconvertfont{\csname\@noletter@\p!defined\endcsname}
-\def\@@redoconvertfont{\csname \p!defined\expandafter\endcsname\gobbleoneargument}
-
+%
% beware: p!defined can contain crap like \edef crap {...} and such
% so we need to pass #1 as well .. no longer needed in luatex
-\unexpanded\def\dodoconvertfont#1% #2% we need the protection
- {\edef\p!defined{#1}%
- \ifx\p!defined\empty\else
- \@EA\dododoconvertfont
- \fi{#1}}
-
-\def\dododoconvertfont % #1
- {\ifcsname\@letter@\detokenize\@EA{\p!defined}\endcsname
- \@EA\@@dodoconvertfont
- \else\ifcsname\detokenize\@EA{\p!defined}\endcsname
- \@EAEAEA\@@redoconvertfont
- \else
- \@EAEAEA\firstofoneargument
- \fi\fi} % {#1}
-
-\let\doconvertfont\dodoconvertfont
+% \def\@@dodoconvertfont{\csname\@letter@ \p!defined\expandafter\endcsname\gobbleoneargument}
+% \def\@@donoconvertfont{\csname\@noletter@\p!defined\endcsname}
+% \def\@@redoconvertfont{\csname \p!defined\expandafter\endcsname\gobbleoneargument}
+%
+% \unexpanded\def\dodoconvertfont#1% #2% we need the protection
+% {\edef\p!defined{#1}%
+% \ifx\p!defined\empty\else
+% \@EA\dododoconvertfont
+% \fi{#1}}
+%
+% \def\dododoconvertfont % #1 (detokenize no longer needed in luatex)
+% {\ifcsname\@letter@\detokenize\@EA{\p!defined}\endcsname
+% \@EA\@@dodoconvertfont
+% \else\ifcsname\detokenize\@EA{\p!defined}\endcsname
+% \@EAEAEA\@@redoconvertfont
+% \else
+% \@EAEAEA\firstofoneargument
+% \fi\fi} % {#1}
+%
+% \let\doconvertfont\dodoconvertfont
+%
+% \unexpanded\def\noconvertfont#1% #2%
+% {\edef\p!defined{#1}%
+% \ifx\p!defined\empty
+% \else
+% \@EA\nononoconvertfont
+% \fi}
+%
+% \def\nononoconvertfont
+% {\ifcsname\@noletter@\detokenize\@EA{\p!defined}\endcsname
+% \@EA\@@donoconvertfont
+% \fi}
+%
+% %D Extras:
+%
+% \unexpanded\def\dontconvertfont{\let\doconvertfont\noconvertfont}
+% \unexpanded\def\redoconvertfont{\let\doconvertfont\dodoconvertfont}
-\unexpanded\def\noconvertfont#1% #2%
- {\edef\p!defined{#1}%
- \ifx\p!defined\empty
- \else
- \@EA\nononoconvertfont
- \fi}
+%D These commands are not grouped! Grouping is most probably
+%D done by the calling macro's and would lead to unnecessary
+%D overhead.
-\def\nononoconvertfont
- {\ifcsname\@noletter@\detokenize\@EA{\p!defined}\endcsname
- \@EA\@@donoconvertfont
+\unexpanded\def\doconvertfont#1% #2% we need the protection
+ {\edef\currentconvertfont{#1}%
+ \ifx\currentconvertfont\empty \else
+ \@EA\dodoconvertfont
\fi}
-%D Extras:
+\def\dodoconvertfont
+ {\edef\dtcurrentconvertfont{\detokenize\@EA{\currentconvertfont}}%
+ \ifcsname\??ft:as:\dtcurrentconvertfont\endcsname
+ \csname\??ft:as:\dtcurrentconvertfont\expandafter\endcsname
+ \else\ifcsname\dtcurrentconvertfont\endcsname
+ \csname\dtcurrentconvertfont\expandafter\endcsname
+ \else
+ \@EAEAEA\currentconvertfont
+ \fi\fi}
-\unexpanded\def\dontconvertfont{\let\doconvertfont\noconvertfont}
-\unexpanded\def\redoconvertfont{\let\doconvertfont\dodoconvertfont}
+%D Low level switches (downward compatible):
-%D These commands are not grouped! Grouping is most probably
-%D done by the calling macro's and would lead to unnecessary
-%D overhead.
+\unexpanded\def\dontconvertfont{\currentalternativestyleindex\plustwo}
+\unexpanded\def\redoconvertfont{\currentalternativestyleindex\plusone}
%D \macros
%D {em,emphasistypeface,emphasisboldface}
diff --git a/tex/context/base/l-string.lua b/tex/context/base/l-string.lua
index 69a836787..7e4f7a95c 100644
--- a/tex/context/base/l-string.lua
+++ b/tex/context/base/l-string.lua
@@ -54,9 +54,9 @@ function string.count(str,pattern) -- variant 3
return n
end
-function string.limit(str,n,sentinel)
+function string.limit(str,n,sentinel) -- not utf proof
if #str > n then
- sentinel = sentinel or " ..."
+ sentinel = sentinel or "..."
return sub(str,1,(n-#sentinel)) .. sentinel
else
return str
diff --git a/tex/context/base/luat-cod.mkiv b/tex/context/base/luat-cod.mkiv
index 6605f8d83..6c9da7e51 100644
--- a/tex/context/base/luat-cod.mkiv
+++ b/tex/context/base/luat-cod.mkiv
@@ -13,6 +13,8 @@
% \writestatus{loading}{ConTeXt Lua Macros / Code}
+\unprotect
+
\long\def\lastexpanded{} % todo: elsewhere we use \@@expanded
\long\def\expanded#1{\long\xdef\lastexpanded{\noexpand#1}\lastexpanded}
@@ -65,4 +67,4 @@
% \everydump\expandafter{\the\everydump\ctxlua{lua.finalize()}}
-\endinput
+\protect \endinput
diff --git a/tex/context/base/mtx-context-arrange.tex b/tex/context/base/mtx-context-arrange.tex
index 4bb4dec69..b3d8a4df1 100644
--- a/tex/context/base/mtx-context-arrange.tex
+++ b/tex/context/base/mtx-context-arrange.tex
@@ -104,6 +104,3 @@
\stopluacode
\stoptext
-
-
-
diff --git a/tex/context/base/mult-cld.lua b/tex/context/base/mult-cld.lua
index 79307fb0b..24660b3a4 100644
--- a/tex/context/base/mult-cld.lua
+++ b/tex/context/base/mult-cld.lua
@@ -31,29 +31,29 @@ local lpegmatch = lpeg.match
local tex = tex
-local texsprint = tex.sprint
-local textprint = tex.tprint
-local texprint = tex.print
-local texiowrite = texio.write
-local texcount = tex.count
+local texsprint = tex.sprint
+local textprint = tex.tprint
+local texprint = tex.print
+local texiowrite = texio.write
+local texcount = tex.count
-local isnode = node.is_node -- after 0.65 just node.type
-local writenode = node.write
-local copynodelist = node.copylist
+local isnode = node.is_node -- after 0.65 just node.type
+local writenode = node.write
+local copynodelist = node.copylist
-local ctxcatcodes = tex.ctxcatcodes
-local prtcatcodes = tex.prtcatcodes
-local texcatcodes = tex.texcatcodes
-local txtcatcodes = tex.txtcatcodes
-local vrbcatcodes = tex.vrbcatcodes
-local xmlcatcodes = tex.xmlcatcodes
+local ctxcatcodes = tex.ctxcatcodes
+local prtcatcodes = tex.prtcatcodes
+local texcatcodes = tex.texcatcodes
+local txtcatcodes = tex.txtcatcodes
+local vrbcatcodes = tex.vrbcatcodes
+local xmlcatcodes = tex.xmlcatcodes
-local flush = texsprint
+local flush = texsprint
-local trace_context = logs.new("context") -- here
-local report_cld = logs.new("cld")
+local report_context = logs.new("context") -- here
+local report_cld = logs.new("cld")
-local processlines = true -- experiments.register("context.processlines", function(v) processlines = v end)
+local processlines = true -- experiments.register("context.processlines", function(v) processlines = v end)
-- for tracing it's easier to have two stacks
@@ -163,7 +163,7 @@ function tex.fprint(...) -- goodie
texsprint(currentcatcodes,format(...))
end
--- -- --
+-- -- -- todo: tracing
local newline = lpeg.patterns.newline
local space = lpeg.patterns.spacer
@@ -178,15 +178,15 @@ local function n_content(s)
end
local function n_endofline()
- texsprint(" ")
+ texsprint(" \r")
end
local function n_emptyline()
- texprint("")
+ texprint("\r")
end
local function n_simpleline()
- texprint("")
+ texprint("\r")
end
function lpeg.texlinesplitter(f_content,f_endofline,f_emptyline,f_simpleline)
@@ -247,7 +247,7 @@ local function writer(parent,command,first,...)
if typ == "string" or typ == "number" then
flush(currentcatcodes,ti)
else -- node.write
- trace_context("error: invalid use of direct in '%s', only strings and numbers can be flushed directly, not '%s'",command,typ)
+ report_context("error: invalid use of direct in '%s', only strings and numbers can be flushed directly, not '%s'",command,typ)
end
direct = false
elseif ti == nil then
@@ -255,7 +255,7 @@ local function writer(parent,command,first,...)
elseif ti == "" then
flush(currentcatcodes,"{}")
elseif typ == "string" then
- if processlines and find(ti,"\n") then -- we can check for ti == "\n"
+ if processlines and find(ti,"[\n\r]") then -- we can check for ti == "\n"
flush(currentcatcodes,"{")
local flushlines = parent.__flushlines or flushlines
flushlines(ti)
@@ -317,11 +317,11 @@ local function writer(parent,command,first,...)
direct = true
end
elseif typ == "thread" then
- trace_context("coroutines not supported as we cannot yield across boundaries")
+ report_context("coroutines not supported as we cannot yield across boundaries")
elseif isnode(ti) then -- slow
flush(currentcatcodes,"{\\cldfn{",_store_n_(ti),"}}")
else
- trace_context("error: '%s' gets a weird argument '%s'",command,tostring(ti))
+ report_context("error: '%s' gets a weird argument '%s'",command,tostring(ti))
end
end
end
@@ -349,7 +349,7 @@ local function caller(parent,f,a,...)
if typ == "string" then
if a then
flush(contentcatcodes,format(f,a,...)) -- was currentcatcodes
- elseif processlines and find(f,"\n") then
+ elseif processlines and find(f,"[\n\r]") then
local flushlines = parent.__flushlines or flushlines
flushlines(f)
else
@@ -383,12 +383,12 @@ local function caller(parent,f,a,...)
end
end
elseif typ == "thread" then
- trace_context("coroutines not supported as we cannot yield across boundaries")
+ report_context("coroutines not supported as we cannot yield across boundaries")
elseif isnode(f) then -- slow
-- writenode(f)
flush(currentcatcodes,"\\cldfn{",_store_n_(f),"}")
else
- trace_context("error: 'context' gets a weird argument '%s'",tostring(f))
+ report_context("error: 'context' gets a weird argument '%s'",tostring(f))
end
end
end
@@ -463,7 +463,7 @@ end
local function settracing(v)
if v then
- pushlogger(trace_context)
+ pushlogger(report_context)
else
poplogger()
end
@@ -485,19 +485,19 @@ function context.runfile(filename)
local ok = dofile(foundname)
if type(ok) == "function" then
if trace_cld then
- trace_context("begin of file '%s' (function call)",foundname)
+ report_context("begin of file '%s' (function call)",foundname)
end
ok()
if trace_cld then
- trace_context("end of file '%s' (function call)",foundname)
+ report_context("end of file '%s' (function call)",foundname)
end
elseif ok then
- trace_context("file '%s' is processed and returns true",foundname)
+ report_context("file '%s' is processed and returns true",foundname)
else
- trace_context("file '%s' is processed and returns nothing",foundname)
+ report_context("file '%s' is processed and returns nothing",foundname)
end
else
- trace_context("unknown file '%s'",filename)
+ report_context("unknown file '%s'",filename)
end
end
@@ -621,10 +621,10 @@ local function caller(parent,f,a,...)
if f then
flush(currentcatcodes,mpdrawing,"{^^M}")
else
- trace_context("warning: 'metafun' gets argument 'false' which is currently unsupported")
+ report_context("warning: 'metafun' gets argument 'false' which is currently unsupported")
end
else
- trace_context("error: 'metafun' gets a weird argument '%s'",tostring(f))
+ report_context("error: 'metafun' gets a weird argument '%s'",tostring(f))
end
end
end
diff --git a/tex/context/base/mult-def.lua b/tex/context/base/mult-def.lua
index 2214c7eda..41da6fcf5 100644
--- a/tex/context/base/mult-def.lua
+++ b/tex/context/base/mult-def.lua
@@ -168,7 +168,8 @@ return {
["pe"]="تنظیم‌طرح‌بندی",
["ro"]="adapteazaaspect",
},
- ["adding"]={},
+ ["adding"]={
+ },
["arg"]={
["cs"]="arg",
["de"]="arg",
diff --git a/tex/context/base/mult-def.mkiv b/tex/context/base/mult-def.mkiv
index 156cdfff5..a273fa18a 100644
--- a/tex/context/base/mult-def.mkiv
+++ b/tex/context/base/mult-def.mkiv
@@ -25,8 +25,8 @@
\def\userinterfacetag{\ifcsname @interface@\currentinterface @\endcsname\csname @interface@\currentinterface @\endcsname\else en\fi}
\def\userresponsestag{\ifcsname @interface@\currentresponses @\endcsname\csname @interface@\currentresponses @\endcsname\else en\fi}
-\input mult-\userinterfacetag \relax
-\input mult-m\userresponsestag \relax
+% \input mult-\userinterfacetag \relax
+% \input mult-m\userresponsestag \relax
\ctxlua{interfaces.setuserinterface("\userinterfacetag","\userresponsestag")}
diff --git a/tex/context/base/mult-ini.lua b/tex/context/base/mult-ini.lua
index 3e89cf68f..c715fb1ad 100644
--- a/tex/context/base/mult-ini.lua
+++ b/tex/context/base/mult-ini.lua
@@ -10,14 +10,20 @@ local format, gmatch, gsub = string.format, string.gmatch, string.gsub
local lpegmatch = lpeg.match
local serialize = table.serialize
+local texsprint = tex.sprint
+
+local report_interfaces = logs.new("interfaces")
+
interfaces = interfaces or { }
interfaces.messages = interfaces.messages or { }
interfaces.constants = interfaces.constants or { }
interfaces.variables = interfaces.variables or { }
+interfaces.elements = interfaces.elements or { }
storage.register("interfaces/messages", interfaces.messages, "interfaces.messages" )
storage.register("interfaces/constants", interfaces.constants, "interfaces.constants")
storage.register("interfaces/variables", interfaces.variables, "interfaces.variables")
+storage.register("interfaces/elements", interfaces.elements, "interfaces.elements")
interfaces.interfaces = {
"cs", "de", "en", "fr", "it", "nl", "ro", "pe",
@@ -26,17 +32,30 @@ interfaces.interfaces = {
storage.shared.currentinterface = storage.shared.currentinterface or "en"
storage.shared.currentresponse = storage.shared.currentresponse or "en"
-function interfaces.setuserinterface(interface,response)
- storage.shared.currentinterface = interface
- storage.shared.currentresponse = response
-end
+local currentinterface = storage.shared.currentinterface
+local currentresponse = storage.shared.currentresponse
-local messages, constants, variables = interfaces.messages, interfaces.constants, interfaces.variables
+local complete = { } interfaces.complete = complete
+
+setmetatable(complete, { __index = function(t,k)
+ report_interfaces("loading interface definitions from 'mult-def.lua'")
+ complete = dofile(resolvers.find_file("mult-def.lua"))
+ report_interfaces("loading interface messages from 'mult-mes.lua'")
+ complete.messages = dofile(resolvers.find_file("mult-mes.lua"))
+ interfaces.complete = complete
+ return complete[k]
+end } )
+
+local messages = interfaces.messages
+local constants = interfaces.constants
+local variables = interfaces.variables
+local elements = interfaces.elements
local valueiskey = { __index = function(t,k) t[k] = k return k end }
setmetatable(variables,valueiskey)
setmetatable(constants,valueiskey)
+setmetatable(elements, valueiskey)
function interfaces.setmessages(category,str)
local m = messages[category] or { }
@@ -85,14 +104,69 @@ function interfaces.showmessage(category,tag,arguments)
end
function interfaces.setvariable(variable,given)
---~ variables[given] = variable
- variables[variable] = given
+ variables[given] = variable
end
function interfaces.setconstant(constant,given)
constants[given] = constant
end
+function interfaces.setelement(element,given)
+ elements[given] = element
+end
+
+-- initialization
+
+function interfaces.setuserinterface(interface,response)
+ -- texsprint(format("\\input{mult-%s}", interface))
+ -- texsprint(format("\\input{mult-m%s}", response))
+ storage.shared.currentinterface, currentinterface = interface, interface
+ storage.shared.currentresponse, currentresponse = response, response
+ if environment.initex then
+ local nofconstants = 0
+ for given, constant in next, complete.constants do
+ constant = constant[interface] or constant.en or given
+ constants[constant] = given -- breedte -> width
+ texsprint("\\do@sicon{",given,"}{",constant,"}")
+ nofconstants = nofconstants + 1
+ end
+ local nofvariables = 0
+ for given, variable in next, complete.variables do
+ variable = variable[interface] or variable.en or given
+ variables[given] = variable -- ja -> yes
+ texsprint("\\do@sivar{",given,"}{",variable,"}")
+ nofvariables = nofvariables + 1
+ end
+ local nofelements = 0
+ for given, element in next, complete.elements do
+ element = element[interface] or element.en or given
+ elements[element] = given
+ texsprint("\\do@siele{",given,"}{",element,"}")
+ nofelements = nofelements + 1
+ end
+ local nofcommands = 0
+ for given, command in next, complete.commands do
+ command = command[interface] or command.en or given
+ if command ~= given then
+ texsprint("\\do@sicom{",given,"}{",command,"}")
+ end
+ nofcommands = nofcommands + 1
+ end
+ local nofmessages = 0
+ local setmessage = interfaces.setmessage
+ for category, message in next, complete.messages do
+ for tag, set in next, message do
+ if tag ~= "files" then
+ setmessage(category,tag,set[interface] or set.en)
+ end
+ end
+ nofmessages = nofmessages + 1
+ end
+ report_interfaces("definitions: %s constants, %s variables, %s elements, %s commands, %s message groups",
+ nofconstants,nofvariables,nofelements,nofcommands,nofmessages)
+ end
+end
+
-- it's nicer to have numbers as reference than a hash
interfaces.cachedsetups = interfaces.cachedsetups or { }
@@ -121,17 +195,7 @@ function interfaces.is_command(str)
return (str and str ~= "" and token.csname_name(token.create(str)) ~= "") or false -- there will be a proper function for this
end
--- -- --
-
-local complete = { } interfaces.complete = complete
-
-setmetatable(complete, { __index = function(t,k)
- complete = require("mult-def.lua")
- interfaces.complete = complete
- return complete[k]
-end } )
-
function interfaces.interfacedcommand(name)
local command = complete.commands[name]
- return command and command[storage.shared.currentinterface] or name
+ return command and command[currentinterface] or name
end
diff --git a/tex/context/base/mult-ini.mkiv b/tex/context/base/mult-ini.mkiv
index eddee98a4..e0042d002 100644
--- a/tex/context/base/mult-ini.mkiv
+++ b/tex/context/base/mult-ini.mkiv
@@ -44,7 +44,7 @@
%D \NC \type{\f!prefix!} \NC f! \NC file \NC\MR
%D \NC \type{\k!prefix!} \NC k! \NC constant (indirect) \NC\MR
%D \NC \type{\l!prefix!} \NC l! \NC language \NC\MR
-%D \NC \type{\m!prefix!} \NC m! \NC message \NC\MR
+%D \NC \type{\m!prefix!} \NC m! \NC age \NC\MR
%D \NC \type{\p!prefix!} \NC p! \NC procedure \NC\MR
%D \NC \type{\r!prefix!} \NC r! \NC reference \NC\MR
%D \NC \type{\s!prefix!} \NC s! \NC system \NC\MR
@@ -436,69 +436,6 @@
\def\doresetvalue #1#2{\dosetvalue{#1}{#2}{}}
\def\doignorevalue#1#2#3{\dosetvalue{#1}{#2}{}}
-% \def\dosetvalue#1#2%
-% {\let\c!internal!\c!internal!n
-% \ifcsname\k!prefix!#2\endcsname
-% \let\c!internal!\c!internal!y
-% \@EA\def\csname#1\csname\k!prefix!#2\endcsname%\endcsname
-% \else
-% \let\c!internal!\c!internal!y
-% \@EA\def\csname#1#2%\endcsname
-% \fi\endcsname}
-
-% \def\dosetevalue#1#2%
-% {\let\c!internal!\c!internal!n
-% \ifcsname\k!prefix!#2\endcsname
-% \let\c!internal!\c!internal!y
-% \@EA\edef\csname#1\csname\k!prefix!#2\endcsname%\endcsname
-% \else
-% \let\c!internal!\c!internal!y
-% \@EA\edef\csname#1#2%\endcsname
-% \fi\endcsname}
-
-% \def\dosetgvalue#1#2%
-% {\let\c!internal!\c!internal!n
-% \ifcsname\k!prefix!#2\endcsname
-% \let\c!internal!\c!internal!y
-% \@EA\gdef\csname#1\csname\k!prefix!#2\endcsname%\endcsname
-% \else
-% \let\c!internal!\c!internal!y
-% \@EA\gdef\csname#1#2%\endcsname
-% \fi\endcsname}
-
-% \def\dosetxvalue#1#2%
-% {\let\c!internal!\c!internal!n
-% \ifcsname\k!prefix!#2\endcsname
-% \let\c!internal!\c!internal!y
-% \@EA\xdef\csname#1\csname\k!prefix!#2\endcsname%\endcsname
-% \else
-% \let\c!internal!\c!internal!y
-% \@EA\xdef\csname#1#2%\endcsname
-% \fi\endcsname}
-
-% \def\docopyvalue#1#2#3% real tricky expansion, quite unreadable
-% {\let\c!internal!\c!internal!n
-% \ifcsname\k!prefix!#3\endcsname
-% \let\c!internal!\c!internal!y
-% \@EA\def\csname#1\csname\k!prefix!#3\endcsname
-% \@EA\endcsname\@EA{\csname#2\csname\k!prefix!#3\endcsname\endcsname}%
-% \else
-% \let\c!internal!\c!internal!y
-% \@EA\def\csname#1#3\@EA\endcsname\@EA{\csname#2#3\endcsname}%
-% \fi}
-
-% \def\dosetvalue #1#2{\@EA \def\csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
-% \def\dosetevalue#1#2{\@EA\edef\csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
-% \def\dosetgvalue#1#2{\@EA\gdef\csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
-% \def\dosetxvalue#1#2{\@EA\xdef\csname#1\ifcsname\k!prefix!#2\endcsname\csname\k!prefix!#2\endcsname\else#2\fi\endcsname}
-
-% \def\docopyvalue#1#2#3% real tricky expansion, quite unreadable
-% {\ifcsname\k!prefix!#3\endcsname
-% \@EA\def\csname#1\csname\k!prefix!#3\endcsname\@EA\endcsname\@EA{\csname#2\csname\k!prefix!#3\endcsname\endcsname}%
-% \else
-% \@EA\def\csname#1#3\@EA\endcsname\@EA{\csname#2#3\endcsname}%
-% \fi}
-
\def\doletvalue #1#2{\@EA \let\csname#1#2\endcsname}
\def\dosetvalue #1#2{\@EA \def\csname#1#2\endcsname}
\def\dosetevalue #1#2{\@EA\edef\csname#1#2\endcsname}
@@ -769,18 +706,8 @@
% temporary mkiv hack (we can best just store the whole table in memory)
-% \let\c!internal!y \string
-% \def\c!internal!n {-}
-% \let\c!internal! \c!internal!y
-
-% \def\setinterfaceconstant#1#2%
-% {\ctxlua{interfaces.setconstant("#1","#2")}%
-% \setvalue{\c!prefix!#1}{\c!internal!#1}%
-% \setvalue{\k!prefix!#2}{#1}}
-
\def\setinterfaceconstant#1#2%
{\ctxlua{interfaces.setconstant("#1","#2")}%
- %\setvalue{\k!prefix!#2}{#1}%
\setvalue{\c!prefix!#1}{#1}}
\def\setinterfacevariable#1#2%
@@ -813,7 +740,8 @@
%D part is needed, we use a \type{-}:
\def\setinterfaceelement#1#2%
- {\ifcsname\e!prefix!#1\endcsname
+ {\ctxlua{interfaces.setelement("#1","#2")}%
+ \ifcsname\e!prefix!#1\endcsname
\doifnotvalue{\e!prefix!#1}{#2}{\setvalue{\e!prefix!#1}{#2}}%
\else
\setvalue{\e!prefix!#1}{#2}%
@@ -829,6 +757,13 @@
\unexpanded\def\startelements {\gobbleuntil\stopelements}
\unexpanded\def\startcommands {\gobbleuntil\stopcommands}
+%D For at the \LUA\ end (experiment):
+
+\def\do@sicon#1#2{\@EA\gdef\csname\c!prefix!#1\endcsname{#1}}
+\def\do@sivar#1#2{\@EA\gdef\csname\v!prefix!#1\endcsname{#2}}
+\def\do@siele#1#2{\@EA\gdef\csname\e!prefix!#1\endcsname{#2}}
+\def\do@sicom#1#2{\@EA\gdef\csname#2\@EA\endcsname\@EA{\csname#1\endcsname}}
+
%D \macros
%D {interfaced}
%D
diff --git a/tex/context/base/mult-sys.mkii b/tex/context/base/mult-sys.mkii
index 23b93d495..1484acecc 100644
--- a/tex/context/base/mult-sys.mkii
+++ b/tex/context/base/mult-sys.mkii
@@ -769,10 +769,11 @@
\definefileconstant {errfilename} {cont-err}
\definefileconstant {sysfilename} {cont-sys}
-\definefileconstant {oldfilename} {cont-old}
\definefileconstant {newfilename} {cont-new}
-\definefileconstant {filfilename} {cont-fil.\mksuffix}
-\definefileconstant {modfilename} {cont-mod}
+\definefileconstant {locfilename} {cont-loc}
+\definefileconstant {expfilename} {cont-exp}
+%definefileconstant {usrfilename} {cont-usr} % .tex
+%definefileconstant {fmtfilename} {cont-fmt} % .tex
%D Handy for typescripts (we could use s! instead:
@@ -782,12 +783,6 @@
\definetypescriptconstant {special} {special}
\definetypescriptconstant {size} {size}
-%D The next two files specify user settings as well as
-%D \TEXEXEC\ settings when generating a format.
-
-\definefileconstant {usrfilename} {cont-usr} % .tex
-\definefileconstant {fmtfilename} {cont-fmt} % .tex
-
%D The setup files for the language, font, color and special
%D subsystems have a common prefix. This means that we have at
%D most three characters for unique filenames.
diff --git a/tex/context/base/mult-sys.mkiv b/tex/context/base/mult-sys.mkiv
index 143d70485..8e9602b38 100644
--- a/tex/context/base/mult-sys.mkiv
+++ b/tex/context/base/mult-sys.mkiv
@@ -776,10 +776,9 @@
\definefileconstant {errfilename} {cont-err}
\definefileconstant {sysfilename} {cont-sys}
-\definefileconstant {oldfilename} {cont-old}
\definefileconstant {newfilename} {cont-new}
-\definefileconstant {filfilename} {cont-fil.\mksuffix}
-\definefileconstant {modfilename} {cont-mod}
+\definefileconstant {locfilename} {cont-loc}
+\definefileconstant {expfilename} {cont-exp}
%D Handy for typescripts (we could use s! instead:
@@ -789,11 +788,6 @@
\definetypescriptconstant {special} {special}
\definetypescriptconstant {size} {size}
-%D The next two files specify user settings as well as
-%D \TEXEXEC\ settings when generating a format.
-
-\definefileconstant {usrfilename} {cont-usr} % .tex
-\definefileconstant {fmtfilename} {cont-fmt} % .tex
%D The setup files for the language, font, color and special
%D subsystems have a common prefix. This means that we have at
diff --git a/tex/context/base/page-ini.mkiv b/tex/context/base/page-ini.mkiv
index 1315ad869..ac3b4d500 100644
--- a/tex/context/base/page-ini.mkiv
+++ b/tex/context/base/page-ini.mkiv
@@ -822,8 +822,8 @@
\def\buildpagebody#1#2%
{\ifsavepagebody\global\setbox\savedpagebody\fi
\vbox
- {\beginrestorecatcodes
-% \forgetall % igv problemen, check: \boxmaxdepth\maxdimen
+ {%\pushcatcodetable
+ %\forgetall % igv problemen, check: \boxmaxdepth\maxdimen
\boxmaxdepth\maxdimen % new
\dontcomplain
% marks get done here
@@ -858,7 +858,7 @@
\negateprintbox \pagebox
\fi
\box\pagebox
- \endrestorecatcodes}%
+ }% \popcatcodetable
\ifsavepagebody\copy\savedpagebody\fi}
\setvalue{\??ly\c!method\v!normal}#1#2%
diff --git a/tex/context/base/page-set.mkii b/tex/context/base/page-set.mkii
index eb01799ae..e4817066d 100644
--- a/tex/context/base/page-set.mkii
+++ b/tex/context/base/page-set.mkii
@@ -2019,6 +2019,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
diff --git a/tex/context/base/page-set.mkiv b/tex/context/base/page-set.mkiv
index fae15a1cc..8b689b284 100644
--- a/tex/context/base/page-set.mkiv
+++ b/tex/context/base/page-set.mkiv
@@ -1899,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
diff --git a/tex/context/base/s-fnt-10.tex b/tex/context/base/s-fnt-10.tex
index 612845fc2..a8ef90c5e 100644
--- a/tex/context/base/s-fnt-10.tex
+++ b/tex/context/base/s-fnt-10.tex
@@ -1,4 +1,4 @@
-fonts.identifiers%D \module
+%D \module
%D [ file=s-fnt-01,
%D version=2006.10.10, % guess
%D title=\CONTEXT\ Style File,
@@ -148,7 +148,7 @@ end
\page
\egroup}
-% \endinput
+\doifnotmode{demo} {\endinput}
\starttext
diff --git a/tex/context/base/s-fnt-26.tex b/tex/context/base/s-fnt-26.tex
index 026abf29b..18d1d6573 100644
--- a/tex/context/base/s-fnt-26.tex
+++ b/tex/context/base/s-fnt-26.tex
@@ -63,6 +63,7 @@
end
context.stoptabulate()
end
+ end
\stopluacode
diff --git a/tex/context/base/s-fnt-29.tex b/tex/context/base/s-fnt-29.tex
index c09a8f85e..86f40e2f8 100644
--- a/tex/context/base/s-fnt-29.tex
+++ b/tex/context/base/s-fnt-29.tex
@@ -15,7 +15,9 @@
function fonts.tracers.shapes() -- todo: ranges
local NC, NR = context.NC, context.NR
+ local char = context.char
local chrs = fonts.identifiers[font.current()].characters
+ -- local desc = fonts.identifiers[font.current()].descriptions
context.starttabulate { "|l|c|c|c|c|l|" }
context.FL()
NC() context("unicode")
@@ -23,6 +25,7 @@
NC() context("shape")
NC() context("lower")
NC() context("upper")
+ -- NC() context("name")
NC() context("description")
NC() NR()
context.TL()
@@ -33,6 +36,7 @@
NC() char(v.shcode)
NC() char(v.lccode or k)
NC() char(v.uccode or k)
+ -- NC() context(desc[k].name)
NC() context(v.description)
NC() NR()
end
diff --git a/tex/context/base/s-mod-02.mkii b/tex/context/base/s-mod-02.mkii
index fac5c23e6..bc53f6890 100644
--- a/tex/context/base/s-mod-02.mkii
+++ b/tex/context/base/s-mod-02.mkii
@@ -18,6 +18,8 @@
\usemodule[mod-00]
+\unprotect
+
% todo: internationalize + setups
\setuphead[paragraaf][expansion=command]
@@ -416,4 +418,4 @@
\setuptolerance
[verytolerant]
-\endinput
+\protect \endinput
diff --git a/tex/context/base/s-mod-02.mkiv b/tex/context/base/s-mod-02.mkiv
index f62513dd3..1ca88b796 100644
--- a/tex/context/base/s-mod-02.mkiv
+++ b/tex/context/base/s-mod-02.mkiv
@@ -20,6 +20,8 @@
\usemodule[mod-00]
+\unprotect
+
% todo: internationalize + setups
\setuphead[paragraaf][expansion=command]
@@ -418,4 +420,4 @@
\setuptolerance
[verytolerant]
-\endinput
+\protect \endinput
diff --git a/tex/context/base/spec-dpm.mkii b/tex/context/base/spec-dpm.mkii
index efecd7928..ddbb6caf8 100644
--- a/tex/context/base/spec-dpm.mkii
+++ b/tex/context/base/spec-dpm.mkii
@@ -11,8 +11,6 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\unprotect
-
%D This driver is build on top of the general \PDF\ macros,
%D as defined in \type{spec-fdf}, so we inherit that one. Remark:
%D this driver is no longer actively maintained, use the dpx one
@@ -443,4 +441,4 @@
\stopspecials
-\protect \endinput
+\endinput
diff --git a/tex/context/base/spec-dpx.mkii b/tex/context/base/spec-dpx.mkii
index c521da8c7..323152e0b 100644
--- a/tex/context/base/spec-dpx.mkii
+++ b/tex/context/base/spec-dpx.mkii
@@ -20,8 +20,6 @@
%C
%C http://project.ktug.or.kr/dvipdfmx/
-\unprotect
-
%D This driver is built on top of the general \PDF\ macros,
%D as defined in \type{spec-fdf}, so we inherit that one.
@@ -791,4 +789,4 @@
\stopspecials
-\protect \endinput
+\endinput
diff --git a/tex/context/base/spec-dvi.mkii b/tex/context/base/spec-dvi.mkii
index 1a8f653f0..522890851 100644
--- a/tex/context/base/spec-dvi.mkii
+++ b/tex/context/base/spec-dvi.mkii
@@ -11,8 +11,6 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\unprotect
-
%D \macros
%D {dostartobject,
%D dostopobject,
@@ -115,4 +113,4 @@
\stopspecials
-\protect \endinput
+\endinput
diff --git a/tex/context/base/spec-pdf.mkii b/tex/context/base/spec-pdf.mkii
index 2191eaeae..222c4e3a6 100644
--- a/tex/context/base/spec-pdf.mkii
+++ b/tex/context/base/spec-pdf.mkii
@@ -13,8 +13,6 @@
% funny things: mail to yeny: "please geen auto-crlf in special"
-\unprotect
-
%D This driver is build on top of the general \PDF\ macros,
%D as defined in \type{spec-fdf}, so we inherit that one.
@@ -481,4 +479,4 @@
\stopspecials
-\protect \endinput
+\endinput
diff --git a/tex/context/base/spec-tst.mkii b/tex/context/base/spec-tst.mkii
index 543baa647..628a0dbbf 100644
--- a/tex/context/base/spec-tst.mkii
+++ b/tex/context/base/spec-tst.mkii
@@ -11,12 +11,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\unprotect
-
%D The code is now merged into spec-*.mkii
-\protect
-
\doifnotmode{demo}{\endinput}
\mainlanguage[vn]
diff --git a/tex/context/base/spec-win.mkii b/tex/context/base/spec-win.mkii
index 73db8830e..55ceec691 100644
--- a/tex/context/base/spec-win.mkii
+++ b/tex/context/base/spec-win.mkii
@@ -11,8 +11,6 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\unprotect
-
%D Remark: chained references are not yet implemented.
%D \macros
@@ -96,4 +94,4 @@
\stopspecials
-\protect \endinput
+\endinput
diff --git a/tex/context/base/spec-xtx.mkii b/tex/context/base/spec-xtx.mkii
index 799c6ca8d..81b83e663 100644
--- a/tex/context/base/spec-xtx.mkii
+++ b/tex/context/base/spec-xtx.mkii
@@ -7,8 +7,6 @@
%D date=\currentdate,
%D copyright={Adam Lindsay \& Hans Hagen}]
-\unprotect
-
\startspecials[xetex][reset,dpx]
%D Actually, there's an intermediate ``\type{xdv}''
@@ -84,4 +82,4 @@
\stopspecials
-\protect \endinput
+\endinput
diff --git a/tex/context/base/strc-ren.mkiv b/tex/context/base/strc-ren.mkiv
index 7f65bd8e3..84f8b34dd 100644
--- a/tex/context/base/strc-ren.mkiv
+++ b/tex/context/base/strc-ren.mkiv
@@ -30,7 +30,8 @@
\doif{\structureheadparameter\c!margintext}\v!yes\placemargincontent}
\unexpanded\def\setupheadcomponentfont#1#2%
- {\ifconditional\structureheadisdisplay
+ {\dontconvertfont
+ \ifconditional\structureheadisdisplay
\edef\askedstructureheadinterlinespace{\structureheadparameter\c!interlinespace}%
\ifx\askedstructureheadinterlinespace\empty
% here the interline space is only set when style sets no space
@@ -68,8 +69,7 @@
\ifconditional\fontattributeisset
\setupspacing
\fi
- \fi
- \dontconvertfont}
+ \fi}
\def\doplaceheadtextcomponent#1%
{\begingroup
diff --git a/tex/context/base/strc-sec.mkiv b/tex/context/base/strc-sec.mkiv
index ed0dee7a4..94e97ea24 100644
--- a/tex/context/base/strc-sec.mkiv
+++ b/tex/context/base/strc-sec.mkiv
@@ -497,9 +497,9 @@
\ifdefined\setupheadcomponentfont \else
\unexpanded\def\setupheadcomponentfont#1#2%
- {\dosetstructureheadattributes\c!style\c!color
+ {\dontconvertfont
+ \dosetstructureheadattributes\c!style\c!color
\dosetstructureheadattributes#1#2%
- \dontconvertfont
\setupinterlinespace}
\fi
diff --git a/tex/context/base/strc-syn.lua b/tex/context/base/strc-syn.lua
index dc8e2e951..599f15311 100644
--- a/tex/context/base/strc-syn.lua
+++ b/tex/context/base/strc-syn.lua
@@ -162,6 +162,7 @@ function synonyms.flush(data,options)
-- context[format("\\start%ssection",kind)](sublist.tag)
for d=1,#data do
local entry = data[d].definition
+ -- context[format("\\%sentry",kind)](d,entry.tag,entry.synonym,entry.meaning or "")
context("\\%sentry{%s}{%s}{%s}{%s}",kind,d,entry.tag,entry.synonym,entry.meaning or "")
end
-- context[format("\\stop%ssection",kind)]()
diff --git a/tex/context/base/supp-fil.mkiv b/tex/context/base/supp-fil.mkiv
index 4bae541c6..41e3a3ad9 100644
--- a/tex/context/base/supp-fil.mkiv
+++ b/tex/context/base/supp-fil.mkiv
@@ -414,11 +414,11 @@
\unexpanded\def\startreadingfile% beter een every en \setnormalcatcodes
{\global\advance\readingfilelevel\plusone
\the\everystartreadingfile
- \beginrestorecatcodes
- \setcatcodetable\prtcatcodes}
+ \pushcatcodetable % saveguard
+ }% \setcatcodetable\prtcatcodes % no longer in mkiv, has to be done explictly
\unexpanded\def\stopreadingfile
- {\endrestorecatcodes
+ {\popcatcodetable % saveguard
\the\everystopreadingfile
\global\advance\readingfilelevel\minusone}
diff --git a/tex/context/base/supp-mat.mkiv b/tex/context/base/supp-mat.mkiv
index 48cb9ffc0..3da664f36 100644
--- a/tex/context/base/supp-mat.mkiv
+++ b/tex/context/base/supp-mat.mkiv
@@ -298,4 +298,16 @@
\def\crampedrlap{\mathpalette\docrampedrlap}
\def\crampedclap{\mathpalette\docrampedclap}
+% experiment, not yet to be used
+
+% \def\displaybreak
+% {\ifhmode
+% \removeunwantedspaces
+% \ifcase\raggedstatus\hfill\fi
+% \strut\penalty-9999 % \break fails on case (3)
+% \fi}
+%
+% \def\startdisplay{\displaybreak\ignorespaces\startpacked}
+% \def\stopdisplay {\stoppacked\displaybreak\ignorespaces}
+
\protect \endinput
diff --git a/tex/context/base/supp-pat.mkii b/tex/context/base/supp-pat.mkii
index d91083076..8cd4dd072 100644
--- a/tex/context/base/supp-pat.mkii
+++ b/tex/context/base/supp-pat.mkii
@@ -31,17 +31,13 @@
%D is meant as an experiment.
\ifx\writestatus\undefined \else
-
\writestatus{loading}{ConTeXt Support Macros / Patterns}
-
\fi
%D \CONTEXT:
\ifx\startmapping\undefined \else \ifx\startencoding\undefined \else
-
\def\fetchpatterntoken#1{\csname#1\endcsname}
-
\fi \fi
%D First we define the \ETEX\ variant. We cannot do that inside
diff --git a/tex/context/base/symb-mis.mkiv b/tex/context/base/symb-mis.mkiv
index 8985e31d0..131924ef4 100644
--- a/tex/context/base/symb-mis.mkiv
+++ b/tex/context/base/symb-mis.mkiv
@@ -43,8 +43,8 @@
\definesymbol [S] [\sectionmark]
\definesymbol [P] [\paragraphmark]
-\definesymbol [Numero] [N\textnumero]
-\definesymbol [numero] [n\textnumero]
+\definesymbol [Numero] [\textnumero]
+\definesymbol [numero] [\textnumero]
\definesymbol [euro] [\texteuro]
\let\euro\texteuro
diff --git a/tex/context/base/symb-was.mkii b/tex/context/base/symb-was.mkii
index d6c324864..53132cd23 100644
--- a/tex/context/base/symb-was.mkii
+++ b/tex/context/base/symb-was.mkii
@@ -35,6 +35,8 @@
\loadmapfile[original-wasy.map]
+\unprotect
+
% there are also fonts for 6, 7, 8, 9 pt; how can we access these automatically?
% how about the bold wasy font?
@@ -202,4 +204,4 @@
%D \showsymbolset[wasy physics]
%D \showsymbolset[wasy apl]
-\endinput
+\protect \endinput
diff --git a/tex/context/base/syst-aux.mkiv b/tex/context/base/syst-aux.mkiv
index 9c6dff663..685e8c923 100644
--- a/tex/context/base/syst-aux.mkiv
+++ b/tex/context/base/syst-aux.mkiv
@@ -2791,6 +2791,13 @@
{}
%D \macros
+%D {immediatemessage}
+%D
+%D A fully expandable message:
+
+\def\immediatemessage#1{\ctxlua{logs.status("message","#1")}}
+
+%D \macros
%D {debuggerinfo}
%D
%D For debugging purposes we can enhance macros with the
diff --git a/tex/context/base/type-ghz.mkiv b/tex/context/base/type-ghz.mkiv
index e6a12d7e3..d08d7ae90 100644
--- a/tex/context/base/type-ghz.mkiv
+++ b/tex/context/base/type-ghz.mkiv
@@ -192,7 +192,7 @@
\stoptypescript
-\starttypescript [serif] [palatino-nova-light] [name] % may change
+\starttypescript [serif] [palatino-nova-light] [name]% may change
\definefontsynonym [Serif] [PalatinoNova-Light]
\definefontsynonym [SerifItalic] [PalatinoNova-LightItalic]
@@ -203,7 +203,7 @@
\stoptypescript
-\starttypescript [serif] [palatino-nova-medium] [name] % may change
+\starttypescript [serif] [palatino-nova-medium] [name]% may change
\definefontsynonym [Serif] [PalatinoNova-Medium]
\definefontsynonym [SerifItalic] [PalatinoNova-MediumItalic]
@@ -270,7 +270,7 @@
\definetypeface[palatino][rm][serif][palatino-nova][default][features=default]
\definetypeface[palatino][ss][sans] [palatino-sans][default][features=default]
\definetypeface[palatino][tt][mono] [latin-modern] [default][features=default,rscale=1.1]
- \definetypeface[palatino][mm][math] [palatino] [default][features=default] % ,rscale=1.1]
+ \definetypeface[palatino][mm][math] [palatino] [default][features=default]% ,rscale=1.1]
\quittypescriptscanning
\stoptypescript
@@ -278,7 +278,7 @@
\definetypeface[palatino][ss][sans] [palatino-sans][default][features=default]
\definetypeface[palatino][rm][serif][palatino-nova][default][features=default]
\definetypeface[palatino][tt][mono] [latin-modern] [default][features=default,rscale=1.1]
- \definetypeface[palatino][mm][math] [palatino] [default][features=default] % ,rscale=1.1]
+ \definetypeface[palatino][mm][math] [palatino] [default][features=default]% ,rscale=1.1]
\quittypescriptscanning
\stoptypescript
@@ -286,7 +286,7 @@
\definetypeface[palatino-informal][ss][sans] [palatino-informal][default][features=default]
\definetypeface[palatino-informal][rm][serif][palatino-nova] [default][features=default]
\definetypeface[palatino-informal][tt][mono] [latin-modern] [default][features=default,rscale=1.1]
- \definetypeface[palatino-informal][mm][math] [palatino] [default][features=default] % ,rscale=1.1]
+ \definetypeface[palatino-informal][mm][math] [palatino] [default][features=default]% ,rscale=1.1]
\quittypescriptscanning
\stoptypescript
diff --git a/tex/context/base/type-ini.mkiv b/tex/context/base/type-ini.mkiv
index d3755a5b3..bd3f5e6c9 100644
--- a/tex/context/base/type-ini.mkiv
+++ b/tex/context/base/type-ini.mkiv
@@ -171,7 +171,6 @@
{\startreadingfile
\pushendofline
\unprotect
- % we could have something readfilewithMKfallback
\readfile{\currenttypefile.\mksuffix}\donothing{\readfile\currenttypefile\donothing\donothing}%
\protect
\popendofline
diff --git a/tex/context/base/type-lua.mkiv b/tex/context/base/type-lua.mkiv
index a6799671e..4abae2295 100644
--- a/tex/context/base/type-lua.mkiv
+++ b/tex/context/base/type-lua.mkiv
@@ -11,8 +11,6 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\unprotect
-
\starttypescriptcollection [luatex]
\starttypescript [specserif] [all] [name]
@@ -85,4 +83,4 @@
\stoptypescriptcollection
-\protect \endinput
+\endinput
diff --git a/tex/context/base/type-otf.mkiv b/tex/context/base/type-otf.mkiv
index c9b4857bb..097141f5d 100644
--- a/tex/context/base/type-otf.mkiv
+++ b/tex/context/base/type-otf.mkiv
@@ -62,8 +62,6 @@
% \definefontsynonym [LMRoman10-DemiOblique] [\s!name:LMRoman10-DemiOblique] [\s!features=\s!default]
% \definefontsynonym [LMRoman10-DemiOblique] [lmroman10-demioblique] [\s!features=\s!default]
-\unprotect
-
% \starttypescript [math] [modern,computer-modern,latin-modern]
% \definefontsynonym[MathSymbol][MathSymbol-Regular@symbol-math]
% \loadfontgoodies[symbol-math]
@@ -105,7 +103,7 @@
\definefontsynonym [LMRoman10-BoldOblique] [\s!file:lmromanslant10-bold] [\s!features=\s!default]
\definefontsynonym [LMRoman10-Demi] [\s!file:lmromandemi10-regular] [\s!features=\s!default]
\definefontsynonym [LMRoman10-DemiOblique] [\s!file:lmromandemi10-oblique] [\s!features=\s!default]
- \definefontsynonym [LMRoman10-CapsRegular] [\s!file:lmromancaps10-regular] [\s!features=\s!default] % features=smallcaps?
+ \definefontsynonym [LMRoman10-CapsRegular] [\s!file:lmromancaps10-regular] [\s!features=\s!default]
\definefontsynonym [LMRoman10-CapsOblique] [\s!file:lmromancaps10-oblique] [\s!features=\s!default]
\definefontsynonym [LMRoman10-Dunhill] [\s!file:lmromandunh10-regular] [\s!features=\s!default]
@@ -143,7 +141,7 @@
\definefontsynonym [LMTypewriter12-Regular] [\s!file:lmmono12-regular] [\s!features=\s!none]
\definefontsynonym [LMTypewriter10-Italic] [\s!file:lmmono10-italic] [\s!features=\s!none]
\definefontsynonym [LMTypewriter10-Oblique] [\s!file:lmmonoslant10-regular] [\s!features=\s!none]
- \definefontsynonym [LMTypewriter10-CapsRegular] [\s!file:lmmonocaps10-regular] [\s!features=\s!none] % features=smallcaps?
+ \definefontsynonym [LMTypewriter10-CapsRegular] [\s!file:lmmonocaps10-regular] [\s!features=\s!none]
\definefontsynonym [LMTypewriter10-CapsOblique] [\s!file:lmmonocaps10-oblique] [\s!features=\s!none]
\definefontsynonym [LMTypewriter10-Light] [\s!file:lmmonolt10-regular] [\s!features=\s!none]
@@ -431,7 +429,7 @@
\quittypescriptscanning
\stoptypescript
- \starttypescript [serif] [simple] [name] % bad, will be changed but in sycn with manuals that use it
+ \starttypescript [serif] [simple] [name]% bad, will be changed but in sycn with manuals that use it
\definefontsynonym [Simple] [cmvtt10]
%setupfontsynonym [Simple] [handling=pure]
\stoptypescript
@@ -445,9 +443,9 @@
\definetypescriptprefix [f:heros] [heros] \definetypescriptprefix [f:helvetica] [heros]
\definetypescriptprefix [f:bonum] [bonum] \definetypescriptprefix [f:bookman] [bonum]
\definetypescriptprefix [f:schola] [schola] \definetypescriptprefix [f:schoolbook] [schola]
- \definetypescriptprefix [f:adventor][adventor] %definetypescriptprefix [f:adventor] [adventor]
+ \definetypescriptprefix [f:adventor][adventor]% \definetypescriptprefix [f:adventor] [adventor]
\definetypescriptprefix [f:cursor] [cursor] \definetypescriptprefix [f:courier] [cursor]
- \definetypescriptprefix [f:chorus] [chorus] \definetypescriptprefix [f:chancery] [chorus] % not the full set
+ \definetypescriptprefix [f:chorus] [chorus] \definetypescriptprefix [f:chancery] [chorus]
\starttypescript [serif,sans] [adventor,bonum,bookman,heros,helvetica,pagella,palatino,schola,schoolbook,termes,times]
\definefontsynonym [\typescriptprefix{n:\typescripttwo}-Regular] [\s!file:texgyre\typescriptprefix{f:\typescripttwo}-regular] [\s!features=\s!default]
@@ -471,14 +469,14 @@
\definefontsynonym [TeXGyreChorus-MediumItalic] [\s!file:texgyrechorus-mediumitalic] [\s!features=\s!default]
\stoptypescript
- \definetypescriptprefix [n:pagella] [TeXGyrePagella] \definetypescriptprefix [n:palatino] [TeXGyrePagella]
- \definetypescriptprefix [n:termes] [TeXGyreTermes] \definetypescriptprefix [n:times] [TeXGyreTermes]
- \definetypescriptprefix [n:heros] [TeXGyreHeros] \definetypescriptprefix [n:helvetica] [TeXGyreHeros]
- \definetypescriptprefix [n:bonum] [TeXGyreBonum] \definetypescriptprefix [n:bookman] [TeXGyreBonum]
- \definetypescriptprefix [n:schola] [TeXGyreSchola] \definetypescriptprefix [n:schoolbook] [TeXGyreSchola]
- \definetypescriptprefix [n:adventor] [TeXGyreAdventor] %definetypescriptprefix [n:adventor] [TeXGyreAdventor]
- \definetypescriptprefix [n:cursor] [TeXGyreCursor] \definetypescriptprefix [n:courier] [TeXGyreCursor]
- \definetypescriptprefix [n:chorus] [TeXGyreChorus] \definetypescriptprefix [n:chancery] [TeXGyreChorus] % not the full set
+ \definetypescriptprefix [n:pagella] [TeXGyrePagella] \definetypescriptprefix [n:palatino] [TeXGyrePagella]
+ \definetypescriptprefix [n:termes] [TeXGyreTermes] \definetypescriptprefix [n:times] [TeXGyreTermes]
+ \definetypescriptprefix [n:heros] [TeXGyreHeros] \definetypescriptprefix [n:helvetica] [TeXGyreHeros]
+ \definetypescriptprefix [n:bonum] [TeXGyreBonum] \definetypescriptprefix [n:bookman] [TeXGyreBonum]
+ \definetypescriptprefix [n:schola] [TeXGyreSchola] \definetypescriptprefix [n:schoolbook] [TeXGyreSchola]
+ \definetypescriptprefix [n:adventor] [TeXGyreAdventor]% \definetypescriptprefix [n:adventor] [TeXGyreAdventor]
+ \definetypescriptprefix [n:cursor] [TeXGyreCursor] \definetypescriptprefix [n:courier] [TeXGyreCursor]
+ \definetypescriptprefix [n:chorus] [TeXGyreChorus] \definetypescriptprefix [n:chancery] [TeXGyreChorus] % not the full set
\starttypescript [serif] [pagella,palatino,termes,times,bonum,bookman,schola,schoolbook] [name]
\definefontsynonym [Serif] [\typescriptprefix{n:\typescripttwo}-Regular]
@@ -1275,13 +1273,13 @@
\starttypescriptcollection[charter]
\starttypescript [serif] [charter]
- \definefontsynonym [Charter-Roman] [\s!name:CharterBT-Roman] % or: [bchr8a]
- \definefontsynonym [Charter-Italic] [\s!name:CharterBT-Italic] % or: [bchri8a]
- \definefontsynonym [Charter-Bold] [\s!name:CharterBT-Bold] % or: [bchb8a]
- \definefontsynonym [Charter-BoldItalic] [\s!name:CharterBT-BoldItalic] % or: [bchbi8a]
- \definefontsynonym [Charter-Slanted] [\s!name:CharterBT-Italic] % or: [bchri8a]
- \definefontsynonym [Charter-BoldSlanted] [\s!name:CharterBT-BoldItalic] % or: [bchbi8a]
- \definefontsynonym [Charter-Roman-Caps] [Charter-Roman] % not present
+ \definefontsynonym [Charter-Roman] [\s!name:CharterBT-Roman]
+ \definefontsynonym [Charter-Italic] [\s!name:CharterBT-Italic]
+ \definefontsynonym [Charter-Bold] [\s!name:CharterBT-Bold]
+ \definefontsynonym [Charter-BoldItalic] [\s!name:CharterBT-BoldItalic]
+ \definefontsynonym [Charter-Slanted] [\s!name:CharterBT-Italic]
+ \definefontsynonym [Charter-BoldSlanted] [\s!name:CharterBT-BoldItalic]
+ \definefontsynonym [Charter-Roman-Caps] [Charter-Roman]
\stoptypescript
\starttypescript [serif] [charter] [name]
@@ -1316,7 +1314,7 @@
\starttypescriptcollection[lucida]
\starttypescript [serif] [lucida]
- \definefontsynonym [LucidaBright] [\s!name:LucidaBright] % [goodies=lucida-one]
+ \definefontsynonym [LucidaBright] [\s!name:LucidaBright]
\definefontsynonym [LucidaBright-Demi] [\s!name:LucidaBright-Demi]
\definefontsynonym [LucidaBright-Italic] [\s!name:LucidaBright-Italic]
\definefontsynonym [LucidaBright-DemiItalic] [\s!name:LucidaBright-DemiItalic]
@@ -1400,21 +1398,6 @@
\definefontsynonym [SansCaps] [LucidaSans]
\stoptypescript
- % Lucida Bright Typewriter
-
- % only one family may be used as mono; sans used to be that since the beginning,
- % so we keep using that as default
-
- % \starttypescript [mono] [lucida] [name]
- % \definefontsynonym [Mono] [LucidaTypewriter]
- % \definefontsynonym [MonoBold] [LucidaTypewriterBold]
- % \definefontsynonym [MonoItalic] [LucidaTypewriterOblique]
- % \definefontsynonym [MonoBoldItalic] [LucidaTypewriterBoldOblique]
- % \definefontsynonym [MonoSlanted] [LucidaTypewriterOblique]
- % \definefontsynonym [MonoBoldSlanted] [LucidaTypewriterBoldOblique]
- % \definefontsynonym [MonoCaps] [LucidaTypewriter]
- % \stoptypescript
-
% Lucida Bright Sans Typewriter
\starttypescript [mono] [lucida] [name]
@@ -1433,34 +1416,12 @@
\definefontsynonym [Calligraphy] [LucidaCalligraphy-Italic]
\stoptypescript
- % Lucida Casual
-
- % \starttypescript [casual] [lucida] [name]
- % % LucidaCasual
- % % LucidaCasual-Italic
- % \stoptypescript
-
% Lucida Handwriting
\starttypescript [handwriting] [lucida] [name]
\definefontsynonym [Handwriting] [LucidaHandwriting-Italic]
\stoptypescript
- % Lucida Fax
- %
- % \starttypescript [fax] [lucida] [name]
- % \definefontsynonym [FaksRegular] [LucidaFax]
- % \definefontsynonym [FaksBold] [LucidaFax-Demi]
- % \definefontsynonym [FaksItalic] [LucidaFax-Italic]
- % \definefontsynonym [FaksBoldItalic] [LucidaFax-DemiItalic]
- % \stoptypescript
-
- % Lucida Black Letter
- %
- % \starttypescript [blackletter] [lucida] [name]
- % \definefontsynonym [Blackletter] [LucidaBlackletter]
- % \stoptypescript
-
\starttypescript [lucida]
\definetypeface [lucida] [rm] [\s!serif] [lucida] [\s!default] [\s!features=\s!default]
\definetypeface [lucida] [ss] [\s!sans] [lucida] [\s!default] [\s!features=\s!default]
@@ -1943,4 +1904,4 @@
\stoptypescriptcollection
-\protect \endinput
+\endinput
diff --git a/tex/context/base/type-set.mkii b/tex/context/base/type-set.mkii
index 0316f95c7..2845b1dbb 100644
--- a/tex/context/base/type-set.mkii
+++ b/tex/context/base/type-set.mkii
@@ -64,15 +64,15 @@
\stopsetups
\ifnum\texengine=\xetexengine
- \usetypescriptfile[\f!typeprefix def]
- %usetypescriptfile[\f!typeprefix tmf]
+ %usetypescriptfile[\f!typeprefix def] % preloaded in context.mkii
+ %usetypescriptfile[\f!typeprefix tmf] % replaced
\usetypescriptfile[\f!typeprefix siz]
\usetypescriptfile[\f!typeprefix otf]
\usetypescriptfile[\f!typeprefix xtx]
\usetypescriptfile[\f!typeprefix loc]
\else
- \usetypescriptfile[\f!typeprefix def]
- %usetypescriptfile[\f!typeprefix tmf]
+ %usetypescriptfile[\f!typeprefix def] % preloaded in context.mkii
+ %usetypescriptfile[\f!typeprefix tmf] % replaced
\usetypescriptfile[\f!typeprefix siz]
\usetypescriptfile[\f!typeprefix one]
\usetypescriptfile[\f!typeprefix loc]
diff --git a/tex/context/base/type-set.mkiv b/tex/context/base/type-set.mkiv
index d12c333fe..b09e4ac69 100644
--- a/tex/context/base/type-set.mkiv
+++ b/tex/context/base/type-set.mkiv
@@ -67,9 +67,9 @@
%definefontsynonym [SansCaps] [SansBold]
\stopsetups
-\usetypescriptfile[\f!typeprefix def]
-\usetypescriptfile[\f!typeprefix lua]
-%usetypescriptfile[\f!typeprefix tmf]
+%usetypescriptfile[\f!typeprefix def] % preloaded in main context.mkiv file
+%usetypescriptfile[\f!typeprefix lua] % preloaded in main context.mkiv file
+%usetypescriptfile[\f!typeprefix tmf] % replaced by otf (mkiv) en one (mkii)
\usetypescriptfile[\f!typeprefix siz]
\usetypescriptfile[\f!typeprefix otf]
\usetypescriptfile[\f!typeprefix loc]
diff --git a/tex/context/base/type-siz.mkiv b/tex/context/base/type-siz.mkiv
index f513c7392..35bc8fb44 100644
--- a/tex/context/base/type-siz.mkiv
+++ b/tex/context/base/type-siz.mkiv
@@ -55,7 +55,7 @@
[cg] [default]
\stoptypescript
-\starttypescript [casual] [default] [size] % maps onto rm !
+\starttypescript [casual] [default] [size]
\definebodyfont
[4pt,5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt,17.3pt]
[rm] [default]
diff --git a/tex/context/base/v-default.lua b/tex/context/base/v-default.lua
index 2f5c44245..2e3707442 100644
--- a/tex/context/base/v-default.lua
+++ b/tex/context/base/v-default.lua
@@ -25,7 +25,8 @@ local grammar = { "visualizer",
-- handy
- line = V("newline") * V("emptyline")^0 * V("beginline"),
+ -- line = V("newline") * V("emptyline")^0 * V("beginline"),
+ line = V("newline") * V("emptyline")^0 * V("beginline") + V("emptyline") + V("newline"),
whitespace = (V("space") + V("line"))^1,
optionalwhitespace = (V("space") + V("line"))^0,
diff --git a/tex/context/base/v-lua.lua b/tex/context/base/v-lua.lua
index a7ca42cf8..abe8de211 100644
--- a/tex/context/base/v-lua.lua
+++ b/tex/context/base/v-lua.lua
@@ -144,7 +144,7 @@ local special = S("-+/*^%=#") + P("..")
-- that can be found at http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html.
local equals = P("=")^0
-local open = P("[") * Cg(equals, "init") * P("[") * P("\n")^-1
+local open = P("[") * Cg(equals, "init") * P("[") * P("\n")^-1 -- maybe better: patterns.newline^-1
local close = P("]") * C(equals) * P("]")
local closeeq = Cmt(close * Cb("init"), function(s,i,a,b) return a == b end)
local longstring = open * Cs((P(1) - closeeq)^0) * close * Carg(1)
diff --git a/tex/context/base/x-mathml.lua b/tex/context/base/x-mathml.lua
index 209f575e1..99ea6c34b 100644
--- a/tex/context/base/x-mathml.lua
+++ b/tex/context/base/x-mathml.lua
@@ -27,55 +27,55 @@ lxml.mml = lxml.mml or { }
local doublebar = utfchar(0x2016)
local n_replacements = {
--- [" "] = utfchar(0x2002), -- "&textspace;" -> tricky, no &; in mkiv
- ["."] = "{.}",
- [","] = "{,}",
- [" "] = "",
+-- [" "] = utfchar(0x2002), -- "&textspace;" -> tricky, no &; in mkiv
+ ["."] = "{.}",
+ [","] = "{,}",
+ [" "] = "",
}
local l_replacements = { -- in main table
- ["|"] = "\\mmlleftdelimiter\\vert",
- ["{"] = "\\mmlleftdelimiter\\lbrace",
- ["("] = "\\mmlleftdelimiter(",
- ["["] = "\\mmlleftdelimiter[",
- ["<"] = "\\mmlleftdelimiter<",
- [doublebar] = "\\mmlleftdelimiter\\Vert",
+ ["|"] = "\\mmlleftdelimiter\\vert",
+ ["{"] = "\\mmlleftdelimiter\\lbrace",
+ ["("] = "\\mmlleftdelimiter(",
+ ["["] = "\\mmlleftdelimiter[",
+ ["<"] = "\\mmlleftdelimiter<",
+ [doublebar] = "\\mmlleftdelimiter\\Vert",
}
local r_replacements = { -- in main table
- ["|"] = "\\mmlrightdelimiter\\vert",
- ["}"] = "\\mmlrightdelimiter\\rbrace",
- [")"] = "\\mmlrightdelimiter)",
- ["]"] = "\\mmlrightdelimiter]",
- [">"] = "\\mmlrightdelimiter>",
- [doublebar] = "\\mmlrightdelimiter\\Vert",
+ ["|"] = "\\mmlrightdelimiter\\vert",
+ ["}"] = "\\mmlrightdelimiter\\rbrace",
+ [")"] = "\\mmlrightdelimiter)",
+ ["]"] = "\\mmlrightdelimiter]",
+ [">"] = "\\mmlrightdelimiter>",
+ [doublebar] = "\\mmlrightdelimiter\\Vert",
}
local o_replacements = { -- in main table
- ["@l"] = "\\mmlleftdelimiter.",
- ["@r"] = "\\mmlrightdelimiter.",
- ["{"] = "\\mmlleftdelimiter\\lbrace",
- ["}"] = "\\mmlrightdelimiter\\rbrace",
- ["|"] = "\\mmlleftorrightdelimiter\\vert",
- [doublebar] = "\\mmlleftorrightdelimiter\\Vert",
- ["("] = "\\mmlleftdelimiter(",
- [")"] = "\\mmlrightdelimiter)",
- ["["] = "\\mmlleftdelimiter[",
- ["]"] = "\\mmlrightdelimiter]",
- ["<"] = "\\mmlleftdelimiter<",
- [">"] = "\\mmlrightdelimiter>",
- ["#"] = "\\mmlchar{35}",
- ["$"] = "\\mmlchar{36}", -- $
- ["%"] = "\\mmlchar{37}",
- ["&"] = "\\mmlchar{38}",
- ["^"] = "\\mmlchar{94}{}", -- strange, sometimes luatex math sees the char instead of \char
- ["_"] = "\\mmlchar{95}{}", -- so we need the {}
- ["~"] = "\\mmlchar{126}",
- [" "] = "",
- ["°"] = "^\\circ", -- hack
-
- [utfchar(0xF103C)] = "\\mmlleftdelimiter<",
+ ["@l"] = "\\mmlleftdelimiter.",
+ ["@r"] = "\\mmlrightdelimiter.",
+ ["{"] = "\\mmlleftdelimiter \\lbrace",
+ ["}"] = "\\mmlrightdelimiter\\rbrace",
+ ["|"] = "\\mmlleftorrightdelimiter\\vert",
+ [doublebar] = "\\mmlleftorrightdelimiter\\Vert",
+ ["("] = "\\mmlleftdelimiter(",
+ [")"] = "\\mmlrightdelimiter)",
+ ["["] = "\\mmlleftdelimiter[",
+ ["]"] = "\\mmlrightdelimiter]",
+ -- ["<"] = "\\mmlleftdelimiter<",
+ -- [">"] = "\\mmlrightdelimiter>",
+ ["#"] = "\\mmlchar{35}",
+ ["$"] = "\\mmlchar{36}", -- $
+ ["%"] = "\\mmlchar{37}",
+ ["&"] = "\\mmlchar{38}",
+ ["^"] = "\\mmlchar{94}{}", -- strange, sometimes luatex math sees the char instead of \char
+ ["_"] = "\\mmlchar{95}{}", -- so we need the {}
+ ["~"] = "\\mmlchar{126}",
+ [" "] = "",
+ ["°"] = "^\\circ", -- hack
+
+ -- [utfchar(0xF103C)] = "\\mmlleftdelimiter<",
[utfchar(0xF1026)] = "\\mmlchar{38}",
- [utfchar(0xF103E)] = "\\mmlleftdelimiter>",
+ -- [utfchar(0xF103E)] = "\\mmlleftdelimiter>",
}
@@ -137,250 +137,253 @@ local i_replacements = {
["as"] = "{\\mr as}",
}
+-- we could use a metatable or when accessing fallback on the
+-- key but at least we now have an overview
+
local csymbols = {
arith1 = {
- lcm = "lcm",
- big_lcm = "lcm",
- gcd = "gcd",
- big_gcd = "big_gcd",
- plus = "plus",
- unary_minus = "minus",
- minus = "minus",
- times = "times",
- divide = "divide",
- power = "power",
- abs = "abs",
- root = "root",
- sum = "sum",
- product ="product",
+ lcm = "lcm",
+ big_lcm = "lcm",
+ gcd = "gcd",
+ big_gcd = "big_gcd",
+ plus = "plus",
+ unary_minus = "minus",
+ minus = "minus",
+ times = "times",
+ divide = "divide",
+ power = "power",
+ abs = "abs",
+ root = "root",
+ sum = "sum",
+ product = "product",
},
fns = {
- domain = "domain",
- range = "codomain",
- image = "image",
- identity = "ident",
---~ left_inverse = "",
---~ right_inverse = "",
- inverse = "inverse",
- left_compose = "compose",
- lambda = "labmda",
+ domain = "domain",
+ range = "codomain",
+ image = "image",
+ identity = "ident",
+ -- left_inverse = "",
+ -- right_inverse = "",
+ inverse = "inverse",
+ left_compose = "compose",
+ lambda = "labmda",
},
linalg1 = {
- vectorproduct = "vectorproduct",
- scalarproduct = "scalarproduct",
- outerproduct = "outerproduct",
- transpose = "transpose",
- determinant = "determinant",
- vector_selector = "selector",
---~ matrix_selector = "matrix_selector",
+ vectorproduct = "vectorproduct",
+ scalarproduct = "scalarproduct",
+ outerproduct = "outerproduct",
+ transpose = "transpose",
+ determinant = "determinant",
+ vector_selector = "selector",
+ -- matrix_selector = "matrix_selector",
},
logic1 = {
- equivalent = "equivalent",
- ["not"] = "not",
- ["and"] = "and",
---~ big_and = "",
- ["xor"] = "xor",
---~ big_xor = "",
- ["or"] = "or",
---~ big-or= "",
- implies = "implies",
- ["true"] = "true",
- ["false"] = "false",
+ equivalent = "equivalent",
+ ["not"] = "not",
+ ["and"] = "and",
+ -- big_and = "",
+ ["xor"] = "xor",
+ -- big_xor = "",
+ ["or"] = "or",
+ -- big-or = "",
+ implies = "implies",
+ ["true"] = "true",
+ ["false"] = "false",
},
nums1 = {
---~ based_integer = "based_integer"
- rational = "rational",
- inifinity = "infinity",
- e = "expenonentiale",
- i ="imaginaryi",
- pi = "pi",
- gamma = "gamma",
- NaN, "NaN",
+ -- based_integer = "based_integer"
+ rational = "rational",
+ inifinity = "infinity",
+ e = "expenonentiale",
+ i = "imaginaryi",
+ pi = "pi",
+ gamma = "gamma",
+ NaN = "NaN",
},
relation1 = {
- eq = "eq",
- lt = "lt",
- gt = "gt",
- neq = "neq",
- leq = "leq",
- geq = "geq",
- approx = "approx",
+ eq = "eq",
+ lt = "lt",
+ gt = "gt",
+ neq = "neq",
+ leq = "leq",
+ geq = "geq",
+ approx = "approx",
},
set1 = {
- cartesian_product = "cartesianproduct",
- empty_set = "emptyset",
- map = "map",
- size = "card",
---~ suchthat = "suchthat",
- set = "set",
- intersect = "intersect",
---~ big_intersect = "",
- union = "union",
---~ big_union = "",
- setdiff = "setdiff",
- subset = "subset",
- ["in"] = "in",
- notin = "notin",
- prsubset = "prsubset",
- notsubset = "notsubset",
- notprsubset = "notprsubset",
+ cartesian_product = "cartesianproduct",
+ empty_set = "emptyset",
+ map = "map",
+ size = "card",
+ -- suchthat = "suchthat",
+ set = "set",
+ intersect = "intersect",
+ -- big_intersect = "",
+ union = "union",
+ -- big_union = "",
+ setdiff = "setdiff",
+ subset = "subset",
+ ["in"] = "in",
+ notin = "notin",
+ prsubset = "prsubset",
+ notsubset = "notsubset",
+ notprsubset = "notprsubset",
},
veccalc1 = {
- divergence = "divergence",
- grad = "grad",
- curl = "curl",
- Laplacian = "laplacian",
+ divergence = "divergence",
+ grad = "grad",
+ curl = "curl",
+ Laplacian = "laplacian",
},
calculus1 = {
- diff = "diff",
---~ nthdiff = "",
- partialdiff = "partialdiff",
- int = "int",
---~ defint = "defint",
+ diff = "diff",
+ -- nthdiff = "",
+ partialdiff = "partialdiff",
+ int = "int",
+ -- defint = "defint",
},
integer1 = {
- factorof = "factorof",
- factorial = "factorial",
- quotient = "quotient",
- remainder = "rem",
+ factorof = "factorof",
+ factorial = "factorial",
+ quotient = "quotient",
+ remainder = "rem",
},
linalg2 = {
- vector = "vector",
- matrix = "matrix",
- matrixrow = "matrixrow",
+ vector = "vector",
+ matrix = "matrix",
+ matrixrow = "matrixrow",
},
mathmkeys = {
---~ equiv = "",
---~ contentequiv = "",
---~ contentequiv_strict = "",
+ -- equiv = "",
+ -- contentequiv = "",
+ -- contentequiv_strict = "",
},
rounding1 = {
- ceiling = "ceiling",
- floor = "floor",
---~ trunc = "trunc",
---~ round = "round",
+ ceiling = "ceiling",
+ floor = "floor",
+ -- trunc = "trunc",
+ -- round = "round",
},
setname1 = {
- P = "primes",
- N = "naturalnumbers",
- Z = "integers",
- rationals = "rationals",
- R = "reals",
- complexes = "complexes",
+ P = "primes",
+ N = "naturalnumbers",
+ Z = "integers",
+ rationals = "rationals",
+ R = "reals",
+ complexes = "complexes",
},
complex1 = {
---~ complex_cartesian = "complex_cartesian", -- ci ?
- real = "real",
- imaginary = "imaginary",
---~ complex_polar = "complex_polar", -- ci ?
- argument = "arg",
- conjugate = "conjugate",
+ -- complex_cartesian = "complex_cartesian", -- ci ?
+ real = "real",
+ imaginary = "imaginary",
+ -- complex_polar = "complex_polar", -- ci ?
+ argument = "arg",
+ conjugate = "conjugate",
},
interval1 = { -- not an apply
---~ "integer_interval" = "integer_interval",
- interval = "interval",
- interval_oo = { tag = "interval", closure = "open" },
- interval_cc = { tag = "interval", closure = "closed" },
- interval_oc = { tag = "interval", closure = "open-closed" },
- interval_co = { tag = "interval", closure = "closed-open" },
+ -- integer_interval = "integer_interval",
+ interval = "interval",
+ interval_oo = { tag = "interval", closure = "open" },
+ interval_cc = { tag = "interval", closure = "closed" },
+ interval_oc = { tag = "interval", closure = "open-closed" },
+ interval_co = { tag = "interval", closure = "closed-open" },
},
linalg3 = {
---~ vector = "vector.column",
---~ matrixcolumn = "matrixcolumn",
---~ matrix = "matrix.column",
+ -- vector = "vector.column",
+ -- matrixcolumn = "matrixcolumn",
+ -- matrix = "matrix.column",
},
minmax1 = {
- min = "min",
---~ big_min = "",
- max = "max",
---~ big_max = "",
+ min = "min",
+ -- big_min = "",
+ max = "max",
+ -- big_max = "",
},
piece1 = {
- piecewise = "piecewise",
- piece = "piece",
- otherwise = "otherwise",
+ piecewise = "piecewise",
+ piece = "piece",
+ otherwise = "otherwise",
},
error1 = {
---~ unhandled_symbol = "",
---~ unexpected_symbol = "",
---~ unsupported_CD = "",
+ -- unhandled_symbol = "",
+ -- unexpected_symbol = "",
+ -- unsupported_CD = "",
},
limit1 = {
---~ limit = "limit",
---~ both_sides = "both_sides",
---~ above = "above",
---~ below = "below",
---~ null = "null",
- tendsto = "tendsto",
+ -- limit = "limit",
+ -- both_sides = "both_sides",
+ -- above = "above",
+ -- below = "below",
+ -- null = "null",
+ tendsto = "tendsto",
},
list1 = {
---~ map = "",
---~ suchthat = "",
---~ list = "list",
+ -- map = "",
+ -- suchthat = "",
+ -- list = "list",
},
multiset1 = {
- size = { tag = "card", type="multiset" },
- cartesian_product = { tag = "cartesianproduct", type="multiset" },
- empty_set = { tag = "emptyset", type="multiset" },
---~ multi_set = { tag = "multiset", type="multiset" },
- intersect = { tag = "intersect", type="multiset" },
---~ big_intersect = "",
- union = { tag = "union", type="multiset" },
---~ big_union = "",
- setdiff = { tag = "setdiff", type="multiset" },
- subset = { tag = "subset", type="multiset" },
- ["in"] = { tag = "in", type="multiset" },
- notin = { tag = "notin", type="multiset" },
- prsubset = { tag = "prsubset", type="multiset" },
- notsubset = { tag = "notsubset", type="multiset" },
- notprsubset = { tag = "notprsubset", type="multiset" },
+ size = { tag = "card", type = "multiset" },
+ cartesian_product = { tag = "cartesianproduct", type = "multiset" },
+ empty_set = { tag = "emptyset", type = "multiset" },
+ -- multi_set = { tag = "multiset", type = "multiset" },
+ intersect = { tag = "intersect", type = "multiset" },
+ -- big_intersect = "",
+ union = { tag = "union", type = "multiset" },
+ -- big_union = "",
+ setdiff = { tag = "setdiff", type = "multiset" },
+ subset = { tag = "subset", type = "multiset" },
+ ["in"] = { tag = "in", type = "multiset" },
+ notin = { tag = "notin", type = "multiset" },
+ prsubset = { tag = "prsubset", type = "multiset" },
+ notsubset = { tag = "notsubset", type = "multiset" },
+ notprsubset = { tag = "notprsubset", type = "multiset" },
},
quant1 = {
- forall = "forall",
- exists = "exists",
+ forall = "forall",
+ exists = "exists",
},
s_dist = {
---~ mean = "mean.dist",
---~ sdev = "sdev.dist",
---~ variance = "variance.dist",
---~ moment = "moment.dist",
+ -- mean = "mean.dist",
+ -- sdev = "sdev.dist",
+ -- variance = "variance.dist",
+ -- moment = "moment.dist",
},
s_data = {
- mean = "mean",
- sdev = "sdev",
- variance = "vriance",
- mode = "mode",
- median = "median",
- moment = "moment",
+ mean = "mean",
+ sdev = "sdev",
+ variance = "vriance",
+ mode = "mode",
+ median = "median",
+ moment = "moment",
},
transc1 = {
- log = "log",
- ln = "ln",
- exp = "exp",
- sin = "sin",
- cos = "cos",
- tan = "tan",
- sec = "sec",
- csc = "csc",
- cot = "cot",
- sinh = "sinh",
- cosh = "cosh",
- tanh = "tanh",
- sech = "sech",
- csch = "cscs",
- coth = "coth",
- arcsin = "arcsin",
- arccos = "arccos",
- arctan = "arctan",
- arcsec = "arcsec",
- arcscs = "arccsc",
- arccot = "arccot",
- arcsinh = "arcsinh",
- arccosh = "arccosh",
- arctanh = "arstanh",
- arcsech = "arcsech",
- arccsch = "arccsch",
- arccoth = "arccoth",
+ log = "log",
+ ln = "ln",
+ exp = "exp",
+ sin = "sin",
+ cos = "cos",
+ tan = "tan",
+ sec = "sec",
+ csc = "csc",
+ cot = "cot",
+ sinh = "sinh",
+ cosh = "cosh",
+ tanh = "tanh",
+ sech = "sech",
+ csch = "cscs",
+ coth = "coth",
+ arcsin = "arcsin",
+ arccos = "arccos",
+ arctan = "arctan",
+ arcsec = "arcsec",
+ arcscs = "arccsc",
+ arccot = "arccot",
+ arcsinh = "arcsinh",
+ arccosh = "arccosh",
+ arctanh = "arstanh",
+ arcsech = "arcsech",
+ arccsch = "arccsch",
+ arccoth = "arccoth",
},
}
@@ -450,7 +453,7 @@ function lxml.mml.stripped(str)
tex.sprint(ctxcatcodes,str:strip())
end
-function characters.remapentity(chr,slot)
+function characters.remapentity(chr,slot) -- brrrrrr
texsprint(format("{\\catcode%s=13\\xdef%s{\\string%s}}",slot,utfchar(slot),chr))
end
diff --git a/tex/context/base/x-res-08.tex b/tex/context/base/x-res-08.tex
index 3d0625f8c..3d79b00e4 100644
--- a/tex/context/base/x-res-08.tex
+++ b/tex/context/base/x-res-08.tex
@@ -29,9 +29,7 @@
%D </rl:library>
%D \stoptyping
-\doifnotmode{\systemmodeprefix\v!first}{\endinput}
-
-\unprotect
+\unprotect \doifnotmode{\systemmodeprefix\v!first}{\protect\endinput}
\def\XMLrlprefix{rl:}
diff --git a/tex/context/base/x-set-11.mkiv b/tex/context/base/x-set-11.mkiv
index 5e96436d7..f445459ee 100644
--- a/tex/context/base/x-set-11.mkiv
+++ b/tex/context/base/x-set-11.mkiv
@@ -13,6 +13,7 @@
%C details.
% we can make this module a bit cleaner using more recent features
+% like sorting the xml directly
% \startluacode
% collectgarbage("stop")
diff --git a/tex/context/config/cont-usr.tex b/tex/context/config/cont-usr.tex
deleted file mode 100644
index 5a3070362..000000000
--- a/tex/context/config/cont-usr.tex
+++ /dev/null
@@ -1,109 +0,0 @@
-%D \module
-%D [ file=cont-usr,
-%D version=1997.10.05,
-%D title=\CONTEXT\ User Format Specifications,
-%D subtitle=System Specific Setups,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt User Settings}
-
-\unprotect
-
-%D Additional languages can be defined here. Beware of
-%D encoding incompatibilities. Please take a look at the
-%D \type {cont-en.tex}, \type {cont-nl.tex}, enz.\ files
-%D first. Normally you don't have to change a byte. If you
-%D want to play safe, use \typ {texexec --make --alone
-%D --all}.
-
-% \preloadallpatterns % will load them all
-
-% \installlanguage [\s!af] [\c!state=\v!start] % afrikaans
-% \installlanguage [\s!ca] [\c!state=\v!start] % catalan
-% \installlanguage [\s!cs] [\c!state=\v!start] % czech
-% \installlanguage [\s!da] [\c!state=\v!start] % danish
-% \installlanguage [\s!de] [\c!state=\v!start] % german
-% \installlanguage [\s!en] [\c!state=\v!start] % english us
-% \installlanguage [\s!es] [\c!state=\v!start] % spanish
-% \installlanguage [\s!fi] [\c!state=\v!start] % finnish
-% \installlanguage [\s!fr] [\c!state=\v!start] % french
-% \installlanguage [\s!hr] [\c!state=\v!start] % croatian
-% \installlanguage [\s!hu] [\c!state=\v!start] % hungarian
-% \installlanguage [\s!it] [\c!state=\v!start] % italian
-% \installlanguage [\s!la] [\c!state=\v!start] % latin
-% \installlanguage [\s!nl] [\c!state=\v!start] % dutch
-% \installlanguage [\s!nb] [\c!state=\v!start] % bokmal
-% \installlanguage [\s!nn] [\c!state=\v!start] % nynorsk
-% \installlanguage [\s!pl] [\c!state=\v!start] % polish
-% \installlanguage [\s!pt] [\c!state=\v!start] % portuguese
-% \installlanguage [\s!ro] [\c!state=\v!start] % romanian
-% \installlanguage [\s!ru] [\c!state=\v!start] % russian
-% \installlanguage [\s!sk] [\c!state=\v!start] % slovak
-% \installlanguage [\s!sl] [\c!state=\v!start] % slovenian
-% \installlanguage [\s!sv] [\c!state=\v!start] % swedish
-% \installlanguage [\s!tr] [\c!state=\v!start] % turkish
-% \installlanguage [\s!ua] [\c!state=\v!start] % ukrainian
-% \installlanguage [\s!gb] [\c!state=\v!start] % english uk
-% \installlanguage [\s!vn] [\c!state=\v!start] % vietnamese
-
-% \installlanguage [deo] [\c!state=\v!start] % old german
-
-%D The next lines can be used for setting the language to be
-%D used at startup time.
-
-% \setupcurrentlanguage[\s!af]
-% \setupcurrentlanguage[\s!ca]
-% \setupcurrentlanguage[\s!cs]
-% \setupcurrentlanguage[\s!da]
-% \setupcurrentlanguage[\s!de]
-% \setupcurrentlanguage[\s!en]
-% \setupcurrentlanguage[\s!es]
-% \setupcurrentlanguage[\s!fi]
-% \setupcurrentlanguage[\s!fr]
-% \setupcurrentlanguage[\s!hr]
-% \setupcurrentlanguage[\s!hu]
-% \setupcurrentlanguage[\s!it]
-% \setupcurrentlanguage[\s!la]
-% \setupcurrentlanguage[\s!nl]
-% \setupcurrentlanguage[\s!nb]
-% \setupcurrentlanguage[\s!nn]
-% \setupcurrentlanguage[\s!pl]
-% \setupcurrentlanguage[\s!pt]
-% \setupcurrentlanguage[\s!ro]
-% \setupcurrentlanguage[\s!ru]
-% \setupcurrentlanguage[\s!sk]
-% \setupcurrentlanguage[\s!sl]
-% \setupcurrentlanguage[\s!sv]
-% \setupcurrentlanguage[\s!tr]
-% \setupcurrentlanguage[\s!ua]
-
-%D Local font settings can go here. Normally suitable
-%D defaults are already preloaded, almost certainly the
-%D Computer Modern Roman typefaces or some derivate. So, the
-%D next line is only meant as sample, take a look at the
-%D format related files first.
-
-% This is obsolete due to latin modern:
-%
-% \definefilesynonym [font-cmr] [font-csr] % czech & slovak
-% \definefilesynonym [font-cmr] [font-plr] % polish
-
-%D In some languages, compound characters, like \type {"e}
-%D are used to get accented and non latin characters.
-
-% Per 21/9/2006 one needs to explicitly enable this.
-
-% \useencoding[fde] % german
-% \useencoding[ffr] % french
-% \useencoding[fro] % romanian
-% \useencoding[fpl] % polish
-
-%D Don't remove the next few lines.
-
-\protect \endinput
diff --git a/tex/context/interface/cont-cs.xml b/tex/context/interface/cont-cs.xml
index 65e243cc8..fbe91763a 100644
--- a/tex/context/interface/cont-cs.xml
+++ b/tex/context/interface/cont-cs.xml
@@ -1,13 +1,16 @@
-<?xml version="1.0" encoding="UTF-8"?> <!-- versions:
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- versions:
comment : user interface definitions of ConTeXt
- authors : Hans Hagen, Taco Hoekwater, Patrick Gundlach
+ authors : Hans Hagen, Taco Hoekwater, Patrick Gundlach, Wolfgang Schuster, and others
versions : 2004.11.17 : initial version
2006.08.02 : define + resolve
-->
+
<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="cs" version="2006.08.02">
<cd:define name="align">
diff --git a/tex/context/interface/cont-de.xml b/tex/context/interface/cont-de.xml
index cb5624e06..d6d65eddc 100644
--- a/tex/context/interface/cont-de.xml
+++ b/tex/context/interface/cont-de.xml
@@ -1,13 +1,16 @@
-<?xml version="1.0" encoding="UTF-8"?> <!-- versions:
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- versions:
comment : user interface definitions of ConTeXt
- authors : Hans Hagen, Taco Hoekwater, Patrick Gundlach
+ authors : Hans Hagen, Taco Hoekwater, Patrick Gundlach, Wolfgang Schuster, and others
versions : 2004.11.17 : initial version
2006.08.02 : define + resolve
-->
+
<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="de" version="2006.08.02">
<cd:define name="align">
diff --git a/tex/context/interface/cont-en.xml b/tex/context/interface/cont-en.xml
index b15c133aa..0f928f671 100644
--- a/tex/context/interface/cont-en.xml
+++ b/tex/context/interface/cont-en.xml
@@ -1,13 +1,16 @@
-<?xml version="1.0" encoding="UTF-8"?> <!-- versions:
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- versions:
comment : user interface definitions of ConTeXt
- authors : Hans Hagen, Taco Hoekwater, Patrick Gundlach
+ authors : Hans Hagen, Taco Hoekwater, Patrick Gundlach, Wolfgang Schuster, and others
versions : 2004.11.17 : initial version
2006.08.02 : define + resolve
-->
+
<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="en" version="2006.08.02">
<cd:define name="align">
diff --git a/tex/context/interface/cont-fr.xml b/tex/context/interface/cont-fr.xml
index ebd32fd5d..354465e08 100644
--- a/tex/context/interface/cont-fr.xml
+++ b/tex/context/interface/cont-fr.xml
@@ -1,13 +1,16 @@
-<?xml version="1.0" encoding="UTF-8"?> <!-- versions:
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- versions:
comment : user interface definitions of ConTeXt
- authors : Hans Hagen, Taco Hoekwater, Patrick Gundlach
+ authors : Hans Hagen, Taco Hoekwater, Patrick Gundlach, Wolfgang Schuster, and others
versions : 2004.11.17 : initial version
2006.08.02 : define + resolve
-->
+
<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="fr" version="2006.08.02">
<cd:define name="align">
diff --git a/tex/context/interface/cont-it.xml b/tex/context/interface/cont-it.xml
index 3052b7bb4..c215ed4cd 100644
--- a/tex/context/interface/cont-it.xml
+++ b/tex/context/interface/cont-it.xml
@@ -1,13 +1,16 @@
-<?xml version="1.0" encoding="UTF-8"?> <!-- versions:
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- versions:
comment : user interface definitions of ConTeXt
- authors : Hans Hagen, Taco Hoekwater, Patrick Gundlach
+ authors : Hans Hagen, Taco Hoekwater, Patrick Gundlach, Wolfgang Schuster, and others
versions : 2004.11.17 : initial version
2006.08.02 : define + resolve
-->
+
<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="it" version="2006.08.02">
<cd:define name="align">
diff --git a/tex/context/interface/cont-nl.xml b/tex/context/interface/cont-nl.xml
index 8fb7a0e41..aa99a0a2f 100644
--- a/tex/context/interface/cont-nl.xml
+++ b/tex/context/interface/cont-nl.xml
@@ -1,13 +1,16 @@
-<?xml version="1.0" encoding="UTF-8"?> <!-- versions:
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- versions:
comment : user interface definitions of ConTeXt
- authors : Hans Hagen, Taco Hoekwater, Patrick Gundlach
+ authors : Hans Hagen, Taco Hoekwater, Patrick Gundlach, Wolfgang Schuster, and others
versions : 2004.11.17 : initial version
2006.08.02 : define + resolve
-->
+
<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="nl" version="2006.08.02">
<cd:define name="align">
diff --git a/tex/context/interface/cont-pe.xml b/tex/context/interface/cont-pe.xml
index 4c03573dd..08e0284da 100644
--- a/tex/context/interface/cont-pe.xml
+++ b/tex/context/interface/cont-pe.xml
@@ -1,13 +1,16 @@
-<?xml version="1.0" encoding="UTF-8"?> <!-- versions:
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- versions:
comment : user interface definitions of ConTeXt
- authors : Hans Hagen, Taco Hoekwater, Patrick Gundlach
+ authors : Hans Hagen, Taco Hoekwater, Patrick Gundlach, Wolfgang Schuster, and others
versions : 2004.11.17 : initial version
2006.08.02 : define + resolve
-->
+
<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="pe" version="2006.08.02">
<cd:define name="align">
diff --git a/tex/context/interface/cont-ro.xml b/tex/context/interface/cont-ro.xml
index d0ddaa9b4..27863b40a 100644
--- a/tex/context/interface/cont-ro.xml
+++ b/tex/context/interface/cont-ro.xml
@@ -1,13 +1,16 @@
-<?xml version="1.0" encoding="UTF-8"?> <!-- versions:
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- versions:
comment : user interface definitions of ConTeXt
- authors : Hans Hagen, Taco Hoekwater, Patrick Gundlach
+ authors : Hans Hagen, Taco Hoekwater, Patrick Gundlach, Wolfgang Schuster, and others
versions : 2004.11.17 : initial version
2006.08.02 : define + resolve
-->
+
<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="ro" version="2006.08.02">
<cd:define name="align">
diff --git a/tex/context/user/cont-sys.rme b/tex/context/user/cont-sys.rme
index 11c0141e7..fa438a78d 100644
--- a/tex/context/user/cont-sys.rme
+++ b/tex/context/user/cont-sys.rme
@@ -11,6 +11,10 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+%D Beware, this is a MkII specific file. In MkIV we only load
+%D cont-sys.mkiv but in MkII we load the first found of
+%D cont-sys.mkii, cont-sys.tex, cont-sys.rme.
+
\unprotect
% Speed up typescript loading, but at the cost of much memory:
diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua
index 59dbc499e..67a48dd9c 100644
--- a/tex/generic/context/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : luatex-fonts-merged.lua
-- parent file : luatex-fonts.lua
--- merge date : 01/14/11 14:44:17
+-- merge date : 01/18/11 19:34:25
do -- begin closure to overcome local limits and interference
@@ -60,9 +60,9 @@ function string.count(str,pattern) -- variant 3
return n
end
-function string.limit(str,n,sentinel)
+function string.limit(str,n,sentinel) -- not utf proof
if #str > n then
- sentinel = sentinel or " ..."
+ sentinel = sentinel or "..."
return sub(str,1,(n-#sentinel)) .. sentinel
else
return str