summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2004-01-02 00:00:00 +0100
committerHans Hagen <pragma@wxs.nl>2004-01-02 00:00:00 +0100
commit722c56251cf3c197a4a8474aa7024265ba284ec0 (patch)
treef3d28e979790959bc6f2c8ffaa6f2321fabc8bb8 /tex
parent70b6b86404ca9e9de782a577d1dfda3b15f0544d (diff)
downloadcontext-722c56251cf3c197a4a8474aa7024265ba284ec0.tar.gz
stable 2004.01.02
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/colo-ini.tex461
-rw-r--r--tex/context/base/colo-run.tex22
-rw-r--r--tex/context/base/cont-new.tex453
-rw-r--r--tex/context/base/cont-usr.ori124
-rw-r--r--tex/context/base/context.tex15
-rw-r--r--tex/context/base/core-con.tex113
-rw-r--r--tex/context/base/core-des.tex20
-rw-r--r--tex/context/base/core-fig.tex718
-rw-r--r--tex/context/base/core-fil.tex110
-rw-r--r--tex/context/base/core-fld.tex218
-rw-r--r--tex/context/base/core-fnt.tex261
-rw-r--r--tex/context/base/core-grd.tex16
-rw-r--r--tex/context/base/core-ini.tex38
-rw-r--r--tex/context/base/core-int.tex119
-rw-r--r--tex/context/base/core-itm.tex191
-rw-r--r--tex/context/base/core-lnt.tex236
-rw-r--r--tex/context/base/core-mak.tex28
-rw-r--r--tex/context/base/core-mar.tex10
-rw-r--r--tex/context/base/core-mat.tex140
-rw-r--r--tex/context/base/core-mis.tex31
-rw-r--r--tex/context/base/core-nav.tex112
-rw-r--r--tex/context/base/core-new.tex8
-rw-r--r--tex/context/base/core-not.tex1027
-rw-r--r--tex/context/base/core-ntb.tex565
-rw-r--r--tex/context/base/core-num.tex22
-rw-r--r--tex/context/base/core-pos.tex147
-rw-r--r--tex/context/base/core-ref.tex56
-rw-r--r--tex/context/base/core-reg.tex87
-rw-r--r--tex/context/base/core-rul.tex158
-rw-r--r--tex/context/base/core-sec.tex11
-rw-r--r--tex/context/base/core-snc.tex179
-rw-r--r--tex/context/base/core-spa.tex438
-rw-r--r--tex/context/base/core-syn.tex2
-rw-r--r--tex/context/base/core-sys.tex102
-rw-r--r--tex/context/base/core-tab.tex219
-rw-r--r--tex/context/base/core-tbl.tex255
-rw-r--r--tex/context/base/core-uti.tex92
-rw-r--r--tex/context/base/core-var.tex126
-rw-r--r--tex/context/base/core-ver.tex224
-rw-r--r--tex/context/base/core-vis.tex391
-rw-r--r--tex/context/base/enco-ec.tex24
-rw-r--r--tex/context/base/enco-ini.tex486
-rw-r--r--tex/context/base/font-bfm.tex193
-rw-r--r--tex/context/base/font-ini.tex110
-rw-r--r--tex/context/base/font-run.tex125
-rw-r--r--tex/context/base/font-uni.tex322
-rw-r--r--tex/context/base/java-fld.tex36
-rw-r--r--tex/context/base/lang-ger.tex3
-rw-r--r--tex/context/base/lang-ini.tex44
-rw-r--r--tex/context/base/lang-lab.tex56
-rw-r--r--tex/context/base/m-pstric.tex10
-rw-r--r--tex/context/base/m-tryout.tex24
-rw-r--r--tex/context/base/math-fou.tex1
-rw-r--r--tex/context/base/math-ini.tex120
-rw-r--r--tex/context/base/math-run.tex30
-rw-r--r--tex/context/base/math-tex.tex110
-rw-r--r--tex/context/base/meta-ini.tex380
-rw-r--r--tex/context/base/meta-nav.tex30
-rw-r--r--tex/context/base/meta-pag.tex33
-rw-r--r--tex/context/base/mult-com.tex18
-rw-r--r--tex/context/base/mult-con.tex6
-rw-r--r--tex/context/base/mult-ini.tex151
-rw-r--r--tex/context/base/mult-sys.tex28
-rw-r--r--tex/context/base/page-app.tex42
-rw-r--r--tex/context/base/page-bck.tex92
-rw-r--r--tex/context/base/page-flt.tex83
-rw-r--r--tex/context/base/page-flw.tex41
-rw-r--r--tex/context/base/page-imp.tex64
-rw-r--r--tex/context/base/page-ini.tex179
-rw-r--r--tex/context/base/page-lay.tex132
-rw-r--r--tex/context/base/page-lin.tex202
-rw-r--r--tex/context/base/page-log.tex88
-rw-r--r--tex/context/base/page-lyr.tex158
-rw-r--r--tex/context/base/page-mak.tex103
-rw-r--r--tex/context/base/page-mar.tex150
-rw-r--r--tex/context/base/page-mul.tex199
-rw-r--r--tex/context/base/page-not.tex106
-rw-r--r--tex/context/base/page-one.tex107
-rw-r--r--tex/context/base/page-set.tex2
-rw-r--r--tex/context/base/page-sid.tex130
-rw-r--r--tex/context/base/page-spr.tex38
-rw-r--r--tex/context/base/page-txt.tex175
-rw-r--r--tex/context/base/plus-rul.tex62
-rw-r--r--tex/context/base/ppchtex.tex253
-rw-r--r--tex/context/base/regi-utf.tex18
-rw-r--r--tex/context/base/s-abr-01.tex19
-rw-r--r--tex/context/base/s-fnt-02.tex95
-rw-r--r--tex/context/base/s-mod-01.tex22
-rw-r--r--tex/context/base/s-mod-02.tex87
-rw-r--r--tex/context/base/setupb.tex22
-rw-r--r--tex/context/base/spec-dvi.tex52
-rw-r--r--tex/context/base/spec-fdf.tex73
-rw-r--r--tex/context/base/spec-tpd.tex90
-rw-r--r--tex/context/base/supp-box.tex478
-rw-r--r--tex/context/base/supp-fil.tex219
-rw-r--r--tex/context/base/supp-fun.tex294
-rw-r--r--tex/context/base/supp-lan.tex8
-rw-r--r--tex/context/base/supp-mis.tex121
-rw-r--r--tex/context/base/supp-mpe.tex128
-rw-r--r--tex/context/base/supp-mrk.tex178
-rw-r--r--tex/context/base/supp-num.tex4
-rw-r--r--tex/context/base/supp-pdf.tex407
-rw-r--r--tex/context/base/supp-ran.tex36
-rw-r--r--tex/context/base/symb-mis.tex36
-rw-r--r--tex/context/base/syst-ext.tex34
-rw-r--r--tex/context/base/syst-gen.tex18
-rw-r--r--tex/context/base/syst-new.tex128
-rw-r--r--tex/context/base/thrd-trg.tex114
-rw-r--r--tex/context/base/type-enc.tex261
-rw-r--r--tex/context/base/type-exa.tex178
-rw-r--r--tex/context/base/type-fsf.tex4
-rw-r--r--tex/context/base/type-ghz.tex103
-rw-r--r--tex/context/base/type-ini.tex51
-rw-r--r--tex/context/base/type-map.tex3
-rw-r--r--tex/context/base/type-pre.tex2
-rw-r--r--tex/context/base/type-siz.tex2
-rw-r--r--tex/context/base/type-spe.tex6
-rw-r--r--tex/context/base/type-syn.tex35
-rw-r--r--tex/context/base/unic-000.tex106
-rw-r--r--tex/context/base/unic-001.tex6
-rw-r--r--tex/context/base/unic-002.tex10
-rw-r--r--tex/context/base/unic-exp.tex24
-rw-r--r--tex/context/base/unic-ini.tex182
-rw-r--r--tex/context/base/x-contml.tex100
-rw-r--r--tex/context/base/x-corres.tex48
-rw-r--r--tex/context/base/x-dir-01.tex134
-rw-r--r--tex/context/base/xtag-ent.tex30
-rw-r--r--tex/context/base/xtag-hyp.tex49
-rw-r--r--tex/context/base/xtag-ini.tex279
-rw-r--r--tex/context/base/xtag-mmc.tex122
-rw-r--r--tex/context/base/xtag-mml.tex36
-rw-r--r--tex/context/base/xtag-mmp.tex58
-rw-r--r--tex/context/base/xtag-utf.tex6
-rw-r--r--tex/context/config/cont-usr.tex124
-rw-r--r--tex/context/sample/bryson.tex9
-rw-r--r--tex/context/sample/davis.tex13
-rw-r--r--tex/context/sample/dawkins.tex4
-rw-r--r--tex/context/sample/sample.tex29
-rw-r--r--tex/context/sample/ward.tex6
139 files changed, 10753 insertions, 6239 deletions
diff --git a/tex/context/base/colo-ini.tex b/tex/context/base/colo-ini.tex
index 9f45f42ec..3dc2bb141 100644
--- a/tex/context/base/colo-ini.tex
+++ b/tex/context/base/colo-ini.tex
@@ -14,7 +14,7 @@
\writestatus{loading}{Context Color Macros}
%D To do: stroke versus fill color
-%D 1000 100 10 -> constants
+%D 1000 100 10 -> constants
\unprotect
@@ -175,8 +175,8 @@
%D to group when converting colors. By the way, this is not
%D really faster. We can sqeeze half a second runtime for 50K
%D switches on a 1G machine, but the macros will become rather
-%D ugly then. To mention one such improvement: no colon
-%D after the key character (.25 sec).
+%D ugly then. To mention one such improvement: no colon
+%D after the key character (.25 sec).
\newdimen\colordimen
\newcount\colorcount
@@ -206,21 +206,21 @@
%D
%D Gray scales are specified with the \type{s} parameter,
%D where the \type {s} is derived from {\em screen}.
-%D
+%D
%D Starting with \PDF\ 1.4 (2001) \CONTEXT\ supports
%D transparent colors. The transparency factor is represented
%D by a \type {t} and the transparency method by an \type {a}
%D (alternative). Later we will implement more control
-%D (probably by symbolic methods. So, currently the data is
-%D stored as follows:
-%D
+%D (probably by symbolic methods. So, currently the data is
+%D stored as follows:
+%D
%D \starttypen
%D \setvalue{\??cr name}{R:r:g:b:a:t}
%D \setvalue{\??cr name}{C:c:m:y:k:a:t}
%D \setvalue{\??cr name}{S:s:a:t}
%D \stoptypen
-% beware: comparisons asked/current on name, not value
+% beware: comparisons asked/current on name, not value
\newif\iffreezecolors \freezecolorsfalse
@@ -236,7 +236,7 @@
\let\@@cl@@k\@@cl@@z\let\@@cl@@s\@@cl@@z\let\@@cl@@p\@@cl@@o
\let\@@cl@@t\@@cl@@z\let\@@cl@@a\@@cl@@z\let\@@cl@@n\empty}
-\def\@@cl@@A{\@@cl@@a} % a hook for symbolic conversion, see below
+\def\@@cl@@A{\@@cl@@a} % a hook for symbolic conversion, see below
%D Handling a few nested \type{\cs}'s is no problem (\type
%D {\@EA\@EAEAEA\@EA}) but we need a full expansion, so I
@@ -245,9 +245,9 @@
%D does not work, but \type {\romannumeral} does. Actually,
%D \type{\romannumeral0} returns nothing, so it's a perfect
%D candidate for this kind of hackery. This reminds me that I
-%D have to look into David Karstrup's (check spelling)
-%D Euro\TeX\ 2002 article because he is using \type
-%D {\romannumeral} for loops (repetitive \quote {m} stuff).
+%D have to look into David Karstrup's (check spelling)
+%D Euro\TeX\ 2002 article because he is using \type
+%D {\romannumeral} for loops (repetitive \quote {m} stuff).
% \def\x{\y}\def\y{\z}\def\z{0:1:1:1}
%
@@ -262,13 +262,13 @@
\def\colorRpattern{0R:\@@cl@@r:\@@cl@@g:\@@cl@@b:\@@cl@@A:\@@cl@@t}
\def\colorPpattern{0P:\@@cl@@n:\@@cl@@p:\@@cl@@A:\@@cl@@t}
-%D The extra 0 catches empty colors specs (needed for the
-%D \type {\MPcolor} and \type {\PDFcolor} conversion (\type
+%D The extra 0 catches empty colors specs (needed for the
+%D \type {\MPcolor} and \type {\PDFcolor} conversion (\type
%D {\@@cr} equals \type {\relax}!).
-\def\handlecolorwith#1{\@EA#1\romannumeral0}
+\def\handlecolorwith#1{\@EA#1\romannumeral0}
-%D Next comes the main definition macro.
+%D Next comes the main definition macro.
\def\definecolor {\dodoubleargument\dodefinecolor}
\def\defineglobalcolor{\dodoubleargument\dodefineglobalcolor}
@@ -278,9 +278,9 @@
\def\dodefineglobalcolor{\dododefinecolor\doglobal\setgvalue\setxvalue1}
\def\dodefinenamedcolor {\dododefinecolor\doglobal\setvalue \setevalue0}
-% keep this for readability
+% keep this for readability
%
-% \def\dodefinecolor[#1][#2]%
+% \def\dodefinecolor[#1][#2]%
% {\addtocommalist{#1}\colorlist
% \doifassignmentelse{#2}
% {\@@resetcolorparameters
@@ -296,12 +296,12 @@
% {\doifdefinedelse{\??cr#2}
% {\doifelse{#1}{#2}
% {% this way we can freeze \definecolor[somecolor][somecolor]
-% % and still prevent cyclic definitions
+% % and still prevent cyclic definitions
% \iffreezecolors\setevalue{\??cr#1}{\getvalue{\??cr#2}}\fi}
% {\iffreezecolors\@EA\setevalue\else\@EA\setvalue\fi
% {\??cr#1}{\getvalue{\??cr#2}}}}
% {\showmessage\m!colors3{#1}}}%
-% \unexpanded\setvalue{#1}{\color[#1]}} % \unexpanded toegevoegd
+% \unexpanded\setvalue{#1}{\color[#1]}} % \unexpanded toegevoegd
\def\dododefinecolor#1#2#3#4[#5][#6]% #2==set(g)value #3==set[e|x]value
{#1\addtocommalist{#5}\colorlist
@@ -319,16 +319,16 @@
{\doifdefinedelse{\??cr#6}
{\doifelse{#5}{#6}
{% this way we can freeze \definecolor[somecolor][somecolor]
- % and still prevent cyclic definitions
+ % and still prevent cyclic definitions
\iffreezecolors#3{\??cr#5}{\getvalue{\??cr#6}}\fi}
{\iffreezecolors\@EA#3\else\@EA#2\fi
{\??cr#5}{\getvalue{\??cr#6}}}}
{\showmessage\m!colors3{#5}}}%
\ifcase#4\or
- \unexpanded#2{#5}{\switchtocolor[#5]}% \unexpanded toegevoegd
+ \unexpanded#2{#5}{\switchtocolor[#5]}% \unexpanded toegevoegd
\fi}
-%D New and experimental.
+%D New and experimental.
\let\allspotcolors\empty
@@ -363,7 +363,7 @@
\def\registerusedcolorchannels
{\bgroup
\doifdefinedelse{\??cs c}
- {\def\usedcolorchannels{c,m,y,k}}%
+ {\def\usedcolorchannels{c,m,y,k}}%
{\let\usedcolorchannels\empty}%
\doifdefined{\??cs r}
{\addtocommalist{r,g,b}\usedcolorchannels}%
@@ -372,17 +372,17 @@
{\addtocommalist{s}\usedcolorchannels}}%
\savecurrentvalue\usedcolorchannels\usedcolorchannels
\egroup}
-
+
\prependtoks
\registerusedspotcolors
\registerusedcolorchannels
-\to \everylastshipout
+\to \everylastshipout
\def\registerusedspotcolor#1%
{\global\@EA\chardef\csname\??cs#1\endcsname\zerocount}
-%D We now redefine the color definition macro so that you
-%D can define both normal and spotcolors.
+%D We now redefine the color definition macro so that you
+%D can define both normal and spotcolors.
\def\definecolor
{\dotripleempty\dodefinewhatevercolor}
@@ -390,34 +390,34 @@
\def\dodefinewhatevercolor[#1][#2][#3]%
{\ifthirdargument
\doifassignmentelse{#2}
- {\dododefinecolor[#1][#2,#3]}% actually this is an error
- {\dodefinespotcolor[#1][#2][#3]}%
+ {\dododefinecolor[#1][#2,#3]}% actually this is an error
+ {\dodefinespotcolor[#1][#2][#3]}%
\else
- \dodefinecolor[#1][#2]%
+ \dodefinecolor[#1][#2]%
\fi}
%D The names of colors are stored in a comma separated list
%D only for the purpose of showing them with \type {\showcolor}.
-%D
+%D
%D \typebuffer
%D \haalbuffer
%D
%D This color shows up as \color [SomeKindOfRed] {some kind
%D of red}.
%D
-%D \starttypen
+%D \starttypen
%D \setupcolors[state=start]
-%D
+%D
%D \definecolor[mygreen][green]
%D \definecolor[green][g=.5]
-%D
+%D
%D \startcolor[mygreen]test\stopcolor
-%D
+%D
%D \setupcolors[expansion=no]
-%D
+%D
%D \definecolor[mygreen][green]
%D \definecolor[green][g=.5]
-%D
+%D
%D \startcolor[mygreen]test\stopcolor
%D \stoptypen
@@ -491,15 +491,15 @@
%D The last boolean controls reduction of \kap{CMYK} to
%D \kap{CMY} colors. When set to true, the black component
%D is added to the other ones.
-%D
+%D
%D Prefering gray is not the same as converting to gray.
%D Conversion treats each color components in a different way,
%D while prefering is just a reduction and thus a
-%D space||saving option.
+%D space||saving option.
-%D The next (internal) switch suppresses duplicate messages.
+%D The next (internal) switch suppresses duplicate messages.
-\newif\ifconverttoGRAY
+\newif\ifconverttoGRAY
%D This module also needs:
@@ -518,9 +518,9 @@
%D Since color is used frequently today (at least by the
%D author of this module) it makes sense to optimize switching
-%D to the max.
-%D
-%D \starttypen
+%D to the max.
+%D
+%D \starttypen
%D \def\startcolormode#1%
%D {\ifincolor\ifpermitcolormode
%D \doifcolorelse{#1}
@@ -528,14 +528,14 @@
%D \expandafter\dostartcolormode\currentcolorspecs\od}
%D {\nostartcolormode}%
%D \fi\fi}
-%D \stoptypen
+%D \stoptypen
%D
-%D So, the more readable alternatives like the one above are
-%D gone now.
+%D So, the more readable alternatives like the one above are
+%D gone now.
\beginETEX \ifcsname
-\def\dowithcolor#1#2% #1=\action #2=color
+\def\dowithcolor#1#2% #1=\action #2=color
{\ifincolor\ifpermitcolormode
\ifcsname\??cr\currentpalet#2\endcsname
\handlecolorwith#1\csname\??cr\currentpalet#2\endcsname\od
@@ -548,7 +548,7 @@
\beginTEX
-\def\dowithcolor#1#2% #1=\action #2=color
+\def\dowithcolor#1#2% #1=\action #2=color
{\ifincolor\ifpermitcolormode
\@EA\ifx\csname\??cr\currentpalet#2\endcsname\relax
\@EA\ifx\csname\??cr#2\endcsname\relax \else
@@ -578,7 +578,7 @@
\dostopcolormode
\ifx\maintextcolor\empty \else
\startcolormode\maintextcolor
- \fi
+ \fi
\fi\fi}
%D Color modes are entered using the next set of commands.
@@ -602,14 +602,14 @@
{\csname execcolor#1\endcsname}
\def\execcolorR
- {\iffilterspotcolor
+ {\iffilterspotcolor
\@EA\noexeccolorR
\else
\@EA\doexeccolorR
\fi}
\def\execcolorC
- {\iffilterspotcolor
+ {\iffilterspotcolor
\@EA\noexeccolorC
\else
\@EA\doexeccolorC
@@ -640,7 +640,7 @@
\ifGRAYprefered
\registercolorchannel\c!s
\let\@@cl@@s\@@cl@@r
- \normalizeGRAY
+ \normalizeGRAY
\doexeccolorgray
\else\ifRGBsupported
\registercolorchannel\c!r
@@ -668,16 +668,16 @@
\ifGRAYprefered
\registercolorchannel\c!s
\let\@@cl@@s\@@cl@@c
- \normalizeGRAY
+ \normalizeGRAY
\doexeccolorgray
\else\ifCMYKsupported
\registercolorchannel\c!c
\ifreduceCMYK
\convertCMYKtoCMY\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k
-% \else
+% \else
% \normalizeCMYK
% \fi
-\fi
+\fi
\normalizeCMYK
\doexeccolorcmyk
\else\ifRGBsupported
@@ -702,33 +702,33 @@
\def\doexeccolorP#1:#2:%
{\edef\@@cl@@n{#1}%
- \edef\@@cl@@p{#2}%
+ \edef\@@cl@@p{#2}%
\registerusedspotcolor\@@cl@@n
\ifSPOTsupported
\dowithcolor\registerspotcolor\@@cl@@n
\dostartspotcolormode\@@cl@@n\@@cl@@p
\else
- \doingspotcolortrue
- \let\spotcolorfactor\@@cl@@p
- \factorizecolortrue % using counter and array
+ \doingspotcolortrue
+ \let\spotcolorfactor\@@cl@@p
+ \factorizecolortrue % using counter and array
\dowithcolor\execcolorRCSP\@@cl@@n
\factorizecolorfalse
\let\spotcolorfactor\@@cl@@o
\doingspotcolorfalse
\fi
- \exectransparency}
+ \exectransparency}
% \def\doexeccolorPP#1:#2:%
% {\edef\@@cl@@n{#1}%
% \edef\@@cl@@p{#2}%
% \registerusedspotcolor\@@cl@@n
% \ifx\@@cl@@n\currentspotcolor
-% \normalizeSPOT
+% \normalizeSPOT
% \dostartgraycolormode\@@cl@@p % was spotcolormode
% \else
% \dostartgraycolormode\@@cl@@o
% \fi
-% \exectransparency}
+% \exectransparency}
\def\doexeccolorPP#1:#2:%
{\edef\@@cl@@n{#1}%
@@ -745,32 +745,32 @@
\def\doexeccolorrgb
{\ifcase\currentcolorchannel
\dostartrgbcolormode\@@cl@@r\@@cl@@g\@@cl@@b
- \or \or \or \or
- \or \dostartgraycolormode\@@cl@@r
- \or \dostartgraycolormode\@@cl@@g
- \or \dostartgraycolormode\@@cl@@b
+ \or \or \or \or
+ \or \dostartgraycolormode\@@cl@@r
+ \or \dostartgraycolormode\@@cl@@g
+ \or \dostartgraycolormode\@@cl@@b
\fi}
\def\doexeccolorcmyk
- {\ifcase\currentcolorchannel
+ {\ifcase\currentcolorchannel
\dostartcmykcolormode\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k
- \or \negatecolorcomponent\@@cl@@c\dostartgraycolormode\@@cl@@c
- \or \negatecolorcomponent\@@cl@@m\dostartgraycolormode\@@cl@@m
- \or \negatecolorcomponent\@@cl@@y\dostartgraycolormode\@@cl@@y
- \or \negatecolorcomponent\@@cl@@k\dostartgraycolormode\@@cl@@k
+ \or \negatecolorcomponent\@@cl@@c\dostartgraycolormode\@@cl@@c
+ \or \negatecolorcomponent\@@cl@@m\dostartgraycolormode\@@cl@@m
+ \or \negatecolorcomponent\@@cl@@y\dostartgraycolormode\@@cl@@y
+ \or \negatecolorcomponent\@@cl@@k\dostartgraycolormode\@@cl@@k
\fi}
\def\doexeccolorgray
- {\ifcase\currentcolorchannel
+ {\ifcase\currentcolorchannel
\dostartgraycolormode\@@cl@@s
- \or \or \or
- \or \dostartgraycolormode\@@cl@@s
- \or \or \or
- \or \dostartgraycolormode\@@cl@@s
+ \or \or \or
+ \or \dostartgraycolormode\@@cl@@s
+ \or \or \or
+ \or \dostartgraycolormode\@@cl@@s
\fi}
-%D When filtering colors, we need to either erase
-%D the background, or ignore the foreground.
+%D When filtering colors, we need to either erase
+%D the background, or ignore the foreground.
% \newif\ifhidesplitcolor \hidesplitcolortrue
%
@@ -813,10 +813,10 @@
\dostartgraycolormode\@@cl@@o
\fi}
-% \def\fullytransparentcolor % fails on floats
+% \def\fullytransparentcolor % fails on floats
% {\dostartgraycolormode\@@cl@@o % better than z
% %\global\@EA\chardef\csname\@@currenttransparent\endcsname\plusone
-% %\global\intransparenttrue
+% %\global\intransparenttrue
% \dostarttransparency10}
\def\noexeccolorR#1:#2:#3:#4\od
@@ -835,10 +835,10 @@
{\edef\@@cl@@p{#2}%
\dohidecolor\@@cl@@p\@@cl@@z}
-%D For the sake of postprocessing (i.e.\ color separation)
-%D we can normalize colors, which comes down to giving equal
-%D values an equal accuracy and format. This feature is
-%D turned off by default due to a speed penalty. This macro
+%D For the sake of postprocessing (i.e.\ color separation)
+%D we can normalize colors, which comes down to giving equal
+%D values an equal accuracy and format. This feature is
+%D turned off by default due to a speed penalty. This macro
%D also handles spot color percentages.
\newif\iffactorizecolor
@@ -847,7 +847,7 @@
\def\spotcolorfactor{1}
\def\normalizecolor#1%
- {\colordimen#1\thousandpoint
+ {\colordimen#1\thousandpoint
\colordimen\spotcolorfactor\colordimen
\colorcount\colordimen
\advance\colorcount \medcard
@@ -855,8 +855,8 @@
\edef#1{\realcolorvalue\colorcount}}
\def\normalizespotcolor#1%
- {\colordimen-#1\thousandpoint
- \advance\colordimen\thousandpoint
+ {\colordimen-#1\thousandpoint
+ \advance\colordimen\thousandpoint
\colorcount\colordimen
\advance\colorcount \medcard
\divide\colorcount \maxcard
@@ -869,9 +869,9 @@
\def\normalizeRGB
{\ifnormalizecolor
- \donormalizeRGB
+ \donormalizeRGB
\else\iffactorizecolor
- \donormalizeRGB
+ \donormalizeRGB
\fi\fi}
\def\donormalizeCMYK
@@ -898,15 +898,16 @@
\fi\fi}
\def\normalizeSPOT
- {\normalizespotcolor\@@cl@@p}
+ {\normalizespotcolor\@@cl@@p}
-%D We need to register spot colors (i.e.\ resources need to
+%D We need to register spot colors (i.e.\ resources need to
%D be created.
\def\registerspotcolor#1:%
{\ifundefined{\??cl:\c!p:\@@cl@@n}%
\letgvalue{\??cl:\c!p:\@@cl@@n}\empty
- \@EA\@EA\csname registerspotcolor#1\endcsname
+ %\@EA\@EA\csname registerspotcolor#1\endcsname
+ \csname registerspotcolor#1\@EA\endcsname
\else
\@EA\dontregistersplotcolor
\fi}
@@ -926,10 +927,10 @@
\def\registerspotcolorP#1:#2:#3\od
{\doregistergrayspotcolor\@@cl@@n{#2}}
-%D Transparency is handled similar for all three color modes. We
+%D Transparency is handled similar for all three color modes. We
%D can turn transparency off with the following switch:
-\newif\iftransparencysupported \transparencysupportedtrue % todo
+\newif\iftransparencysupported \transparencysupportedtrue % todo
\def\exectransparency
{\iftransparencysupported
@@ -939,7 +940,7 @@
\fi}
%\def\doexectransparency#1:#2\od
-% {\global\@EA\chardef\csname\@@currenttransparent\endcsname % nasty
+% {\global\@EA\chardef\csname\@@currenttransparent\endcsname % nasty
% \ifcase#1\space
% \zerocount
% \else
@@ -960,13 +961,13 @@
\def\noexectransparency#1\od
{}
-%D Experimental: minimize transparency resets.
+%D Experimental: minimize transparency resets.
-\newif\ifintransparent
-\newif\ifoptimizetransparency \optimizetransparencytrue % under test
+\newif\ifintransparent
+\newif\ifoptimizetransparency \optimizetransparencytrue % under test
-% due to bugs in pdf viewers we used transparancies for
-% hiding colors, but now we use none colors
+% due to bugs in pdf viewers we used transparancies for
+% hiding colors, but now we use none colors
% \def\supportedstoptransparency
% {\iffilterspotcolor
@@ -974,7 +975,7 @@
% \else\iftransparencysupported
% \dostoptransparency
% \fi\fi}
-%
+%
% \def\conditionalstoptransparency
% {\iffilterspotcolor
% \dostoptransparency
@@ -1011,22 +1012,22 @@
\expandafter\gobbletwoarguments
\fi}
-%D We now use the \type {\@@cl@@A} hook to implement
-%D symbolic names. These are converted into numbers
-%D at definition time (which saves runtime).
+%D We now use the \type {\@@cl@@A} hook to implement
+%D symbolic names. These are converted into numbers
+%D at definition time (which saves runtime).
\def\definetransparency
{\dodoubleargument\dodefinetransparency}
%\def\dodefinetransparency[#1][#2]%
-% {\@EA\chardef\csname\??cl-#1\endcsname#2\relax
-% \ifundefined{\??cl-#2}#2\else\csname\??cl-#2\endcsname\fi}
+% {\@EA\chardef\csname\??cl-#1\endcsname#2\relax
+% \ifundefined{\??cl-#2}#2\else\csname\??cl-#2\endcsname\fi}
\def\dodefinetransparency[#1][#2]%
{\@EA\chardef\csname\??cl-#1\endcsname#2\relax}
\def\transparencynumber#1%
- {\the\executeifdefined{\??cl-#1}\zerocount}
+ {\the\executeifdefined{\??cl-#1}\zerocount}
\definetransparency [none] [0] \definetransparency [0] [0]
\definetransparency [normal] [1] \definetransparency [1] [1]
@@ -1042,7 +1043,7 @@
\definetransparency [difference] [11] \definetransparency [11] [11]
\definetransparency [exclusion] [12] \definetransparency [12] [12]
-%D Now we hook 'm into the patterns:
+%D Now we hook 'm into the patterns:
\def\@@cl@@A{\transparencynumber\@@cl@@a}
@@ -1059,37 +1060,37 @@
\def\stopregistercolor
{\permitcolormodefalse\stopcolor\permitcolormodetrue}
-%D We use these macros for implementing text colors
-%D (actually, the first application was in foreground
-%D colors).
-%D
-%D \starttypen
+%D We use these macros for implementing text colors
+%D (actually, the first application was in foreground
+%D colors).
+%D
+%D \starttypen
%D \starttextcolor[red]
%D \dorecurse{10}{\input tufte \color[green]{oeps} \par}
%D \stoptextcolor
-%D \stoptypen
+%D \stoptypen
%D
-%D This is more efficient than the alternative:
+%D This is more efficient than the alternative:
%D
-%D \starttypen
+%D \starttypen
%D \setupbackgrounds[text][foregroundcolor=red]
%D \startregistercolor[red]
%D \dorecurse{10}{\input tufte \color[green]{oeps} \par}
%D \stopregistercolor
-%D \stoptypen
+%D \stoptypen
\let\maintextcolor\empty \def\defaulttextcolor{black}
-% \def\starttextcolor[#1]%
+% \def\starttextcolor[#1]%
% {\doifsomething{#1}
% {\bgroup
-% \def\stoptextcolor % also goes ok with \page after
-% {\let\maintextcolor\empty % this one because the top of
-% \stopregistercolor % page sets the color right (side
-% \egroup}% % effect)
+% \def\stoptextcolor % also goes ok with \page after
+% {\let\maintextcolor\empty % this one because the top of
+% \stopregistercolor % page sets the color right (side
+% \egroup}% % effect)
% \def\starttextcolor[##1]%
% {\bgroup
-% \let\stoptextcolor\egroup}%
+% \let\stoptextcolor\egroup}%
% \startregistercolor[#1]%
% \edef\maintextcolor{#1}}}
@@ -1104,28 +1105,28 @@
\egroup}% % effect)
\def\starttextcolor[##1]%
{\bgroup
- % \@@themaintextcolor==##1 is catched in \definecolor
+ % \@@themaintextcolor==##1 is catched in \definecolor
\definecolor[\@@themaintextcolor][##1]%
\let\stoptextcolor\egroup}%
\startregistercolor[\@@themaintextcolor]%
\definecolor[\@@themaintextcolor][#1]%
\let\maintextcolor\@@themaintextcolor}}
-\let\stoptextcolor\relax
+\let\stoptextcolor\relax
-%D The following hook permits proper support at the text
-%D level. This definition actually belongs in another
-%D module.
+%D The following hook permits proper support at the text
+%D level. This definition actually belongs in another
+%D module.
\ifx\initializemaintextcolor\undefined
% \def\initializemaintextcolor
% {\doifsomething\@@cltekstkleur
-% {\appendtoks\starttextcolor[\@@cltekstkleur]\to\everystarttext
-% \appendtoks\stoptextcolor \to\everystoptext
+% {\appendtoks\starttextcolor[\@@cltekstkleur]\to\everystarttext
+% \appendtoks\stoptextcolor \to\everystoptext
% \let\initializemaintextcolor\relax}}
- % global ?
+ % global ?
\def\initializemaintextcolor
{\doifelsenothing\@@cltekstkleur
@@ -1133,17 +1134,17 @@
{\let\maintextcolor\@@themaintextcolor
\definecolor[\@@themaintextcolor][\@@cltekstkleur]%
\doinitializemaintextcolor}}
-
+
\def\doinitializemaintextcolor
{\appendtoks\starttextcolor[\@@themaintextcolor]\to\everystarttext
\appendtoks\stoptextcolor \to\everystoptext
\let\doinitializemaintextcolor\relax}
-
-\fi
+
+\fi
%D The next macro can be used to return to the (normal)
-%D page color. This macro is used in the same way as
-%D \type {\color}.
+%D page color. This macro is used in the same way as
+%D \type {\color}.
\def\localstarttextcolor
{\ifx\maintextcolor\empty
@@ -1159,7 +1160,7 @@
{\ifx\maintextcolor\empty
\expandafter\dorestoretextcolor
\else
- % obey main text color
+ % obey main text color
\fi}
\def\dorestoretextcolor
@@ -1209,7 +1210,7 @@
%D in three digits precision.
\def\realcolorvalue#1%
- {\ifnum#1>\zerocount % important, first encountered in --modu supp-mpe
+ {\ifnum#1>\zerocount % important, first encountered in --modu supp-mpe
\ifnum#1<\plusten 0.00\the#1\else
\ifnum#1<\plushundred 0.0\the#1\else
\ifnum#1<\plusthousand 0.\the#1\else
@@ -1217,13 +1218,13 @@
\else 0\fi}
\def\doconvertCMYKtoRGB#1\k#2\to#3%
- {\ifdim#2\s!pt>#1\s!pt % >= problem, repaired 2/12/2002
+ {\ifdim#2\points>#1\points% >= problem, repaired 2/12/2002
\let#3\@@cl@@z % k >= color
- \else
- \colordimen1\s!pt
- \advance\colordimen -#1\s!pt
- \advance\colordimen -#2\s!pt
- \multiply\colordimen \plusthousand
+ \else
+ \colordimen\onepoint
+ \advance\colordimen -#1\points
+ \advance\colordimen -#2\points
+ \multiply\colordimen \plusthousand
\colorcount\colordimen
\advance\colorcount \medcard
\divide\colorcount \maxcard
@@ -1236,13 +1237,13 @@
\doconvertCMYKtoRGB#3\k#4\to\@@cl@@b}
\def\doconvertRGBtoCMYK#1\to#2%
- {\colordimen#1\s!pt
- \multiply\colordimen \plusthousand
+ {\colordimen#1\points
+ \multiply\colordimen \plusthousand
\colorcount\colordimen
\advance\colorcount \medcard
\divide\colorcount \maxcard
\colorcount-\colorcount
- \advance\colorcount \plusthousand
+ \advance\colorcount \plusthousand
\edef#2{\realcolorvalue\colorcount}}
\def\convertRGBtoCMYK#1#2#3%
@@ -1262,13 +1263,13 @@
\def\bGRAYfactor{\ifweightGRAY110\else\nGRAYfactor\fi}
\def\convertRGBtoGRAY#1#2#3%
- {\colordimen#1\s!pt
+ {\colordimen#1\points
\colordimen\rGRAYfactor\colordimen
\colorcount\colordimen
- \colordimen#2\s!pt
+ \colordimen#2\points
\colordimen\gGRAYfactor\colordimen
\advance\colorcount \colordimen
- \colordimen#3\s!pt
+ \colordimen#3\points
\colordimen\bGRAYfactor\colordimen
\advance\colorcount \colordimen
\advance\colorcount \medcard
@@ -1280,14 +1281,14 @@
\convertRGBtoGRAY\@@cl@@r\@@cl@@g\@@cl@@b}
\def\doconvertCMYKtoCMY#1\k#2\to#3%
- {\colordimen#1\s!pt
- \advance\colordimen #2\s!pt\relax
- \ifdim\colordimen>1\s!pt
- \colordimen1\s!pt
+ {\colordimen#1\points
+ \advance\colordimen #2\points\relax
+ \ifdim\colordimen>\onepoint
+ \colordimen\onepoint
%\else
% \colordimen\colordimen
\fi
- \multiply\colordimen \plusthousand
+ \multiply\colordimen \plusthousand
\colorcount\colordimen
\advance\colorcount \medcard
\divide\colorcount \maxcard
@@ -1321,31 +1322,31 @@
\def\colorsplitsuffix{\ifcase\currentcolorchannel\else-\@@clsplitsen\fi}
\def\colorsplitprefix{\ifcase\currentcolorchannel\else\@@clsplitsen-\fi}
-\ifx\resetsystemmode\undefined
+\ifx\resetsystemmode\undefined
\let\setsystemmode \gobbleoneargument
\let\resetsystemmode\gobbleoneargument
-\fi
+\fi
\def\setcolorsplitting
{\resetsystemmode{\v!kleur\colorsplitsuffix}%
\resetcolorsplitting
\processaction
[\@@clsplitsen]
- [ c=>\chardef\currentcolorchannel1,%
- m=>\chardef\currentcolorchannel2,%
- y=>\chardef\currentcolorchannel3,%
- k=>\chardef\currentcolorchannel4,%
- r=>\chardef\currentcolorchannel5,%
- g=>\chardef\currentcolorchannel6,%
- b=>\chardef\currentcolorchannel7,%
- s=>\chardef\currentcolorchannel8,%
+ [ c=>\chardef\currentcolorchannel1,%
+ m=>\chardef\currentcolorchannel2,%
+ y=>\chardef\currentcolorchannel3,%
+ k=>\chardef\currentcolorchannel4,%
+ r=>\chardef\currentcolorchannel5,%
+ g=>\chardef\currentcolorchannel6,%
+ b=>\chardef\currentcolorchannel7,%
+ s=>\chardef\currentcolorchannel8,%
\v!nee=>,% \currentcolorchannel0,% all colors
\s!default=>,% \currentcolorchannel0,% all colors
- \s!unknown=>\filterspotcolortrue
+ \s!unknown=>\filterspotcolortrue
\edef\currentspotcolor{\commalistelement}]%
\setsystemmode{\v!kleur\colorsplitsuffix}%
\iffilterspotcolor \let\@@clrgb\v!nee \fi}
-
+
\def\dosetupcolors[#1]%
{\getparameters[\??cl][#1]%
\doifelse\@@clspot\v!ja
@@ -1369,7 +1370,7 @@
\doifelse\@@clcmyk\v!nee
{\ifCMYKsupported \showmessage\m!colors {9}\v!cmyk\CMYKsupportedfalse\fi}
{\ifCMYKsupported\else\showmessage\m!colors{10}\v!cmyk\CMYKsupportedtrue \fi}%
- % todo : mpspot
+ % todo : mpspot
\doifelse\@@clmpcmyk\v!nee
{\ifMPcmykcolors \showmessage\m!colors {9}{\v!mp\v!cmyk}\MPcmykcolorsfalse\fi}
{\ifMPcmykcolors\else\showmessage\m!colors{10}{\v!mp\v!cmyk}\MPcmykcolorstrue \fi}%
@@ -1429,8 +1430,8 @@
\expandafter\secondoftwoarguments
\fi}
-% no longer needed
-%
+% no longer needed
+%
% \def\getcurrentcolorspecs#1%
% {\edef\currentcolorspecs%
% {\csname\??cr
@@ -1448,8 +1449,8 @@
\expandafter\firstoftwoarguments
\fi}
-% no longer needed
-%
+% no longer needed
+%
% \def\getcurrentcolorspecs#1%
% {\edef\currentcolorspecs%
% {\csname\??cr\@EA
@@ -1515,8 +1516,8 @@
%D solution, but it suits. The signs are swapped when the
%D page ornaments are typeset.
-\let\@@colorplus \plusone
-\let\@@colorminus\minusone
+\let\@@colorplus \plusone
+\let\@@colorminus\minusone
\def\@@currentcolorname {\??cl\the\colorlevel C}
\def\@@currentcolorstop {\??cl\the\colorlevel S}
@@ -1569,7 +1570,7 @@
\donoglobalstopcolor
\global\@EA\let\@EA\@@previouscolor\csname\@@currentcolorname\endcsname
\ifcase\colorlevel\relax
- \ifpermitcolormode
+ \ifpermitcolormode
\docolormark\empty
\conditionalstoptransparency
\dostopcolormode
@@ -1584,14 +1585,14 @@
\else
\doifcolorelse\@@previouscolor
{\ifx\@@currentcolor\@@previouscolor\else
- % alternatively we could let \startcolormode handle this
- \ifpermitcolormode
- \conditionalstoptransparency % really needed
+ % alternatively we could let \startcolormode handle this
+ \ifpermitcolormode
+ \conditionalstoptransparency % really needed
% more safe but less efficient: \dostopcolormode
\fi
\startcolormode\@@previouscolor
\fi}
- {\ifpermitcolormode
+ {\ifpermitcolormode
\conditionalstoptransparency
\dostopcolormode
\fi}%
@@ -1604,7 +1605,7 @@
\global\@EA\let\@EA\@@currentcolor\csname\@@currentcolorname\endcsname
%\debuggerinfo{\m!colors}
% {stop \@@currentcolor\normalspace at level \the\colorlevel}%
- \global\advance\colorlevel \@@colorminus
+ \global\advance\colorlevel \@@colorminus
\fi}
\def\doglobalstopcolor
@@ -1724,7 +1725,7 @@
%D to resetting the color to black, while popping restores the
%D color state to that of before the break.
-\def\topofpagecolor{\rawgetbotmark\colormark} % see postponing
+\def\topofpagecolor{\rawgetbotmark\colormark} % see postponing
\def\pushcolor
{\stopcolormode}
@@ -1740,10 +1741,10 @@
{%\debuggerinfo\m!colors{split popping \getsplitbotmark\colormark}%
\startcolormode{\rawgetsplitbotmark\colormark}}}
-% Private macro: only needed in test cases (like multiple
-% seperations in one file); no user command!
+% Private macro: only needed in test cases (like multiple
+% seperations in one file); no user command!
-\def\resynccolor
+\def\resynccolor
{\ifdim\pagetotal=\zeropoint
\popcolor
\else\ifx\@@currentcolor\empty
@@ -1766,7 +1767,7 @@
\def\startcolorpage
{\bgroup
- \let\@@colorplus \minusone
+ \let\@@colorplus \minusone
\let\@@colorminus\plusone
\let\docolormark\gobbleoneargument
\edef\savedcolorlevel{\the\colorlevel}%
@@ -1775,7 +1776,7 @@
\localstartcolor[\defaulttextcolor]%
\else
\localstartcolor[\maintextcolor]%
- \fi}
+ \fi}
\def\stopcolorpage
{\localstopcolor
@@ -1809,7 +1810,7 @@
%D \def\switchtocolor[#1]%
%D {\startcolor[#1]\aftergroup\stopcolor}
-\def\switchtocolor[#1]% grouping is realy needed, else migration
+\def\switchtocolor[#1]% grouping is realy needed, else migration
{\bgroup\startcolor[#1]\aftergroup\stopcolor\aftergroup\egroup}
\unexpanded\def\color[#1]%
@@ -1848,8 +1849,8 @@
%D \haalbuffer
%D \stopvoorbeeld
%D
-%D We can speed the following macros a bit up, but this
-%D hardly pays off; they are only used in the manual.
+%D We can speed the following macros a bit up, but this
+%D hardly pays off; they are only used in the manual.
\def\realcolorformat#1%
{\ifnum#1<\plusten 0.00\the#1\else
@@ -1860,9 +1861,9 @@
\def\colorformatseparator{ }
\def\dodoformatcolor#1%
- {\colordimen#1\s!pt\relax
- \ifdim\colordimen>1\s!pt
- \colordimen1\s!pt
+ {\colordimen#1\points\relax
+ \ifdim\colordimen>\onepoint
+ \colordimen\onepoint
\fi
\multiply\colordimen \plusthousand
\colorcount\colordimen
@@ -1901,8 +1902,8 @@
\def\doformatgrayS#1:#2:#3\od
{\dodoformatcolor{#1}}
-\def\doformatgrayP#1:#2:#3:#4\od
- {\dowithcolor\doformatcolor{#1}}
+\def\doformatgrayP#1:#2:#3:#4\od
+ {\dowithcolor\doformatcolor{#1}}
\def\doformatgray#1:%
{\getvalue{doformatgray#1}}
@@ -2041,10 +2042,10 @@
\def\dosetuppalet[#1]%
{\edef\currentpalet{#1}%
- \ifx\currentpalet\empty
- % seems to be a reset
+ \ifx\currentpalet\empty
+ % seems to be a reset
\else
- % fast enough for tex and etex
+ % fast enough for tex and etex
\@EA\ifx\csname\??pa\currentpalet\endcsname\relax
\showmessage\m!colors7\currentpalet
\let\currentpalet\empty
@@ -2256,8 +2257,8 @@
%D
%D will negate the colors in box zero.
-\def\negatecolorcomponent#1% #1 = \macro
- {\scratchdimen\!!onepoint\advance\scratchdimen-#1\s!pt
+\def\negatecolorcomponent#1% #1 = \macro
+ {\scratchdimen\onepoint\advance\scratchdimen-#1\onepoint
\ifdim\scratchdimen<\zeropoint\scratchdimen\zeropoint\fi
\edef#1{\@EA\withoutpt\the\scratchdimen}}
@@ -2320,9 +2321,9 @@
\def\MPcolor{\scaledMPcolor1}
-%D Before we had transparency available, the following
-%D conversion macro was available:
-%D
+%D Before we had transparency available, the following
+%D conversion macro was available:
+%D
%D \starttypen
%D \def\doMPcolor#1:#2:#3:#4:#5:#6:#7:#8\end
%D {\if #1R(#2,#3,#4)%
@@ -2331,12 +2332,12 @@
%D \else (0,0,0)%
%D \fi\fi\fi}
%D \stoptypen
-%D
+%D
%D In order to be useful, this macro is to be fully
-%D expandabele.
+%D expandabele.
-\def\doMPcolor#1:% #1 can be \relax ! ! ! i.e. an empty color
- {\csname
+\def\doMPcolor#1:% #1 can be \relax ! ! ! i.e. an empty color
+ {\csname
MPc\@EA\ifx\csname MPc\string#1\endcsname\relax B\else#1\fi
\endcsname}
@@ -2349,9 +2350,11 @@
\def\transparentMP {transparent}
\def\cmykMP {scaledcmyk}
\def\cmykASrgbMP {scaledcmykasrgb} % not really needed any more
-\def\rgbMP {scaledrgb}
-\def\grayMP {scaledgray}
-\def\processMP {spotcolor}
+\def\rgbMP {scaledrgb}
+\def\grayMP {scaledgray}
+\def\spotMP {spotcolor}
+
+\let\processMP\spotMP % for some time, will become obsolete
\def\doMPtransparent#1#2:#3:#4\end
{\ifcase#2\space(#1)\else\transparentMP(#2,#3,(#1))\fi}
@@ -2369,7 +2372,7 @@
{\doMPtransparent{\cmykASrgbMP(#1,#2,#3,#4,#6)}#5\end}
\def\doMPspotY#1:#2:#3\end#4\end
- {\doMPtransparent{\processMP("#1",#2)}#3\end}
+ {\doMPtransparent{\spotMP("#1",#2)}#3\end}
\def\doMPspotN#1:#2:#3\end#4\end
{\scaledMPcolor{#2}{#1}}
@@ -2389,7 +2392,7 @@
{\if #1R#2 #3 #4 rg%
\else\if#1C#2 #3 #4 #5 k%
\else\if#1S#2 g%
- \else\if#1P#3 g% todo
+ \else\if#1P#3 g% todo
\else 0 g%
\fi\fi\fi\fi}
@@ -2411,17 +2414,17 @@
{[\if #1R#2 #3 #4%
\else\if#1C#2 #3 #4 #5%
\else\if#1S#2%
- \else\if#1P#3% todo
+ \else\if#1P#3% todo
\else 0%
\fi\fi\fi\fi]}
%D \macros
%D {everyshapebox}
-%D
-%D A terrible hack, needed because we cannot have marks in
-%D shape boxes.
+%D
+%D A terrible hack, needed because we cannot have marks in
+%D shape boxes.
-\appendtoks \localcolortrue \to \everyshapebox
+\appendtoks \localcolortrue \to \everyshapebox
%D We default to the colors defined in \module{colo-rgb} and
%D support both \kap{RGB} and \kap{CMYK} output.
@@ -2443,20 +2446,20 @@
\setupcolor
[\v!rgb]
-%D For the moment we keep the next downward compatibility
+%D For the moment we keep the next downward compatibility
%D switch, i.e.\ expanded colors. However, predefined colors
%D and palets are no longer expanded (which is what I wanted
-%D in the first place).
+%D in the first place).
%D
%D Well, in case we want to do color separation and use CMYK
-%D colors only, this is dangerous since unwanted remapping may
-%D take place. Especially when we redefine already defined
-%D colors in another color space (e.g. darkgreen is
-%D predefined in RGB color space, so a redefinition in CMYK
-%D coordinates before RGB mode is disabled, would give
+%D colors only, this is dangerous since unwanted remapping may
+%D take place. Especially when we redefine already defined
+%D colors in another color space (e.g. darkgreen is
+%D predefined in RGB color space, so a redefinition in CMYK
+%D coordinates before RGB mode is disabled, would give
%D unexpected results due to the already frozen color spec.)
%D
-%D So, from now on, colors are not frozen any more!
+%D So, from now on, colors are not frozen any more!
% \appendtoks\setupcolors[\c!expansie=\v!ja]\to\everyjob
@@ -2484,8 +2487,8 @@
{\filterspotcolorfalse
\chardef\currentcolorchannel\zerocount}
-%D These can be used in selecting specific files (like
-%D figuredatabases).
+%D These can be used in selecting specific files (like
+%D figuredatabases).
\def\colorchannelprefix{\doifseparatingcolorselse\@@clsplitsen\empty-}
\def\colorchannelsuffix{-\doifseparatingcolorselse\@@clsplitsen\empty}
@@ -2493,4 +2496,4 @@
%D As we can see, color support is turned off by default.
%D Reduction of gray colors to gray scales is turned on.
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/colo-run.tex b/tex/context/base/colo-run.tex
index 9e03627da..8cd9f62dd 100644
--- a/tex/context/base/colo-run.tex
+++ b/tex/context/base/colo-run.tex
@@ -1,4 +1,4 @@
-\unprotect
+\unprotect
\gdef\showpalet
{\dodoubleargument\doshowpalet}
@@ -45,12 +45,12 @@
\doifinset\v!nummer{#2}
{\def\doshowpalet##1{&\strut##1}%
\processpalet[#1]\doshowpalet}\cr
- \doifinset\v!naam{#2}{#1\hskip.5em}%
+ \doifinset\v!naam{#2}{#1\hskip.5em}%
\def\doshowpalet##1%
- {&\color[##1]{\vrule\!!width\!!widtha\!!height\strutht\!!depth\!!zeropoint}}%
+ {&\color[##1]{\vrule\!!width\!!widtha\!!height\strutht\!!depth\zeropoint}}%
\processpalet[#1]\doshowpalet\crcr
\def\doshowpalet##1%
- {&\graycolor[##1]{\vrule\!!width\!!widtha\!!height\!!zeropoint\!!depth\strutdp}}%
+ {&\graycolor[##1]{\vrule\!!width\!!widtha\!!height\zeropoint\!!depth\strutdp}}%
\processpalet[#1]\doshowpalet\crcr
\doifinset\v!waarde{#2}
{\def\doshowpalet##1%
@@ -68,7 +68,7 @@
{\expanded{\globalprocesscommalist[\getvalue{\??pa#1}]}}
\gdef\showcolorgroup
- {\dodoubleargument\doshowcolorgroup}
+ {\dodoubleargument\doshowcolorgroup}
\gdef\doshowcolorgroup[#1][#2]%
{\doifdefined{\??cr#1:1}
@@ -88,13 +88,13 @@
{\halign
{\hss####\hss\cr
\doifinset\v!nummer{#2}{\strut##1}\cr
- \color[#1:##1]{\vrule\!!width4em\!!height\strutht\!!depth\!!zeropoint}\cr
- \graycolor[#1:##1]{\vrule\!!width4em\!!height\!!zeropoint\!!depth\strutdp}\cr
+ \color[#1:##1]{\vrule\!!width4em\!!height\strutht\!!depth\zeropoint}\cr
+ \graycolor[#1:##1]{\vrule\!!width4em\!!height\zeropoint\!!depth\strutdp}\cr
\doifinset\v!waarde{#2}{\colorvalue{#1:##1}\strut}\crcr}}
\def\doshowgroup##1%
{\doifdefined{\??cr#1:##1}
{\vbox{\dodoshowgroup{##1}}}}
- \hbox
+ \hbox
{\doifinset\v!naam{#2}
{\strut
\doifinsetelse\v!waarde{#2}
@@ -118,7 +118,7 @@
\doifinset\v!waarde{#2}{\hskip.5em\colorvalue{#1:##1}}\crcr}}
\halign
{\hss##&\hss##\hss&##\hss\cr
- &\doifinset\v!naam{#2}{\strut#1}&\crcr
+ &\doifinset\v!naam{#2}{\strut#1}&\crcr
\doshowgroup1\doshowgroup2\doshowgroup3\doshowgroup4%
\doshowgroup5\doshowgroup6\doshowgroup7\doshowgroup8}}}
@@ -136,7 +136,7 @@
\def\rule
{\vrule\!!width4em\!!height\strutht\!!depth\strutdp}
\def\docommand##1%
- {\hbox
+ {\hbox
{\graycolor[##1]{\rule}\quad
\color[##1]{\rule}\quad
\grayvalue{##1}\quad
@@ -209,4 +209,4 @@
\endgraf}
\dorecurse\!!counta{\dododocomparecolorgroup\recurselevel}}}
-\protect \endinput
+\protect \endinput
diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex
index 6b78510a6..9cefe1cda 100644
--- a/tex/context/base/cont-new.tex
+++ b/tex/context/base/cont-new.tex
@@ -15,11 +15,315 @@
%D excellent place for hacks, patches, extensions and new
%D features.
+% todo: mp-new
\unprotect
\writestatus{\m!systems}{beware: some patches loaded from cont-new.tex!}
+
+% todo : test low level translation (nl->en) and optimize script
+
+% \readfile{cont-exp}\donothing\donothing % speed up (5-20%)
+
+\def\doiffontcharelse#1#2%
+ {\bgroup
+ \definedfont[#1]%
+ \iffontchar\font#2\relax
+ \egroup\expandafter\firstoftwoarguments
+ \else
+ \egroup\expandafter\secondoftwoarguments
+ \fi}
+
+\unexpanded\def\asciistr#1{\convertargument#1\to\ascii{\verbatimfont\ascii}}
+
+\def\shapedhbox % lines with non strutted dimensions have
+ {\expanded{\dowithnextbox % interlineskip so if we want the original
+ {\nextboxht\the\ht\shapebox % spacing, we need to preserve the original
+ \nextboxdp\the\dp\shapebox % height and depth which is definitely
+ \noexpand\flushnextbox}} % needed if we apply struts to the 'new'
+ \normalhbox} % box or do something that changed ist size
+
+\def\inrightmargin#1% new: hsize correction
+ {\pushindentation
+ \rlap
+ {\hskip\tekstbreedte
+ %\hskip-\hsize
+ %\hskip\hsize
+ \hskip-\rightskip
+ \hskip\rechtermargeafstand
+ \hsize\rechtermargebreedte
+ #1}%
+ \popindentation
+ \ignorespaces}
+
+\def\rechtermargetekstblok#1% new: hsize correction
+ {\maakmargetekstblok \rightmargintextwidth \v!rechts \v!links
+ {\hskip\margetekstafstand\hskip\tekstbreedte\hskip-\hsize }{\rlap{\plaatsmargetekstscheider}}
+ {#1}}
+
+\def\douniqueMPpagegraphic#1#2%
+ {\blabelgroup
+ \let\overlaystamp\overlaypagestamp
+ \setupMPvariables[\MPpageprefix#1][#2]% prefix is new here
+ \getvalue{\@@MPG\MPpageprefix#1}{}%
+ \elabelgroup}
+
+\prependtoks \setnormalcatcodes \to \everyTEXinputmode
+\appendtoks \processingXMLfalse \to \everyTEXinputmode
+
+\let\normalenableXML\enableXML % some day we move the normal \enableXML into the toks
+
+\prependtoks \normalenableXML \to \everyXMLinputmode
+\appendtoks \processingXMLtrue \to \everyXMLinputmode
+
+\def\enableXML {\setinputmode[XML]}
+\def\disableXML{\setinputmode[TEX]}
+
+\def\checkvariables
+ {\dodoubleargument\docheckvariables}
+
+\def\docheckvariables
+ {\dogetparameters\docheckrawvalue}
+
+\def\docheckrawvalue#1#2#3%
+ {\doifundefined {\??vars:#1:#2}{\setvalue{\??vars:#1:#2}{#3}}
+ {\doifvaluenothing{\??vars:#1:#2}{\setvalue{\??vars:#1:#2}{#3}}}}
+
+\beginTEX
+
+ % else the skip aborts the reshape process
+
+ \def\shapefill{\vskip\onepoint\!!plus\lineheight\!!minus\lineheight\relax}
+
+\endTEX
+
+\beginETEX
+
+ \def\shapefill{\vskip\zeropoint\!!plus\lineheight\!!minus\lineheight\relax}
+
+\endETEX
+
+\beginETEX \lastnodetype
+
+\def\dodoreshapebox#1#2#3#4% \shapebox, \shapepenalty, \shapekern, \shapeskip
+ {\ifnum\lastnodetype=\@@gluenode % \ifcase\lastskip % \ifdim\lastskip=\zeropoint\relax
+ \shapeskip\lastskip
+ \global\setbox\tmpshapebox\normalvbox{#4\unvbox\tmpshapebox}%
+ \unskip
+ \else\ifnum\lastnodetype=\@@kernnode % \ifcase\lastkern % \ifdim\lastkern=\zeropoint\relax
+ \shapekern\lastkern
+ \global\setbox\tmpshapebox\normalvbox{#3\unvbox\tmpshapebox}%
+ \unkern
+ \else\ifnum\lastnodetype=\@@penaltynode % \ifcase\lastpenalty % \ifnum\lastpenalty=\zerocount
+ \shapepenalty\lastpenalty
+ \global\setbox\tmpshapebox\normalvbox{#2\unvbox\tmpshapebox}%
+ \unpenalty
+ \else
+ \setbox\shapebox\lastbox
+ \ifvoid\shapebox
+ \unskip\unpenalty\unkern
+ \else
+ \ifdim\wd\shapebox=\shapesignal\relax
+ \exitloop
+ \else
+ \shapecounter\zerocount
+ \global\setbox\tmpshapebox\normalvbox{#1\unvbox\tmpshapebox}%
+ \fi
+ \fi
+ \fi\fi\fi
+ \ifnum\shapecounter>100 % can be less
+ \message{<<forced exit from shapebox>>}%
+ \global\setbox\tmpshapebox\copy\oldshapebox
+ \exitloop
+ \else
+ \advance\shapecounter \plusone
+ \fi}
+
+\endETEX
+
+\let\normaltype\type
+
+\beginTEX
+
+ \unexpanded\def\retype#1{\bgroup\convertargument#1\to\ascii\@EA\normaltype\@EA{\ascii}\egroup}
+
+\endTEX
+
+\beginETEX
+
+ \unexpanded\def\retype#1{\scantokens{\normaltype{#1}}}
+
+\endETEX
+
+\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}
+
+\defineblankmethod [\v!synchroniseer] {\verticalstrut\vskip-2\lineheight\verticalstrut}
+
+% \vtop{\blank[synchronize]\blank[line]test}
+
+\def\minimalhbox#1#%
+ {\dowithnextbox
+ {\bgroup
+ \setbox\scratchbox\hbox#1{\hss}%
+ \ifdim\nextboxwd<\wd\scratchbox\nextboxwd\wd\scratchbox\fi
+ \flushnextbox
+ \egroup}
+ \hbox}
+
+% manual
+%
+% externfiguur -> grid =ja|hoogte|diepte|halveregel|passend -> helemaal in details
+% stelplaatsblokin -> zijuitlijnen=hoogte|diepte|regel|halveregel|grid -> halveregel in 'details'
+
+% TODO: TEST FIRST, NO CORRECTION NEEDED IN GRID MODE, EVT OPTION
+
+\def\OTRONEsomeherefloat[#1]% spacing between two successive must be better
+ {\baselinecorrection % not really needed in grid mode:
+ %\ifgridsnapping \else \baselinecorrection \fi % ! ! ! test test test ! ! ! !
+ \doplacefloatbox
+ \doinsertfloatinfo
+ \dochecknextindentation\??bk}
+
+% todo: switch koppelen aan par scheelt pos
+
+% to be documented: \startspread .. \stopspread
+
+% to be documented primarydef p crossed d
+% to be documented PlainTextArea
+
+% manual
+%
+% Sometimes the demands are getting pretty weird:
+%
+% \startitemize
+% \item test
+% \item test
+% \headsym{xx} test \par test
+% \stopitemize
+
+\beginETEX \lastnodetype
+
+\def\removeunwantedspaces
+ {\ifhmode
+ \doloop{\ifnum\lastnodetype=\@@gluenode\unskip\else\exitloop\fi}%
+ \fi}
+
+\endETEX
+
+% \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]
+
+\def\pushXMLmeaning#1%
+ {\@EA\pushmacro\csname\@@XMLelement:#1/\endcsname
+ \@EA\pushmacro\csname\@@XMLelement:#1\endcsname
+ \@EA\pushmacro\csname\@@XMLelement:/#1\endcsname}
+
+\def\popXMLmeaning#1%
+ {\@EA\popmacro\csname\@@XMLelement:#1/\endcsname
+ \@EA\popmacro\csname\@@XMLelement:#1\endcsname
+ \@EA\popmacro\csname\@@XMLelement:/#1\endcsname}
+
+\def\defineXMLstore {\doquadrupleargument\dodefineXMLstore[\saveXMLasdata]}
+\def\defineXMLgstore{\doquadrupleargument\dodefineXMLstore[\gsaveXMLasdata]}
+
+\def\dodefineXMLstore[#1][#2][#3][#4]% element attribute prefix % will become faster
+ {\defineXMLargument[#2][#3=\s!dummy]{#1{#4:\XMLop{#3}}}}
+
+\def\countXMLchildren[#1]#2%
+ {\startnointerference
+ \doglobal\newcounter\nofXMLchildren
+ \defineXMLargument[#1]{\doglobal\increment\nofXMLchildren}%
+ \startXMLignore
+ #2%
+ \stopXMLignore
+ \stopnointerference}
-\def\showsetupsdefinition[#1]{\showvalue{\??su:#1}}
+\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
%
@@ -61,7 +365,23 @@
% new, continuous blocks, \som \par \startdoorlopendblok ...
-\def\startdoorlopendblok % fo rspecial cases, don't change it too much
+% \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}
@@ -81,28 +401,24 @@
\nobreak
\advance\noflines\minusone
\dorecurse\noflines{\crlf\nobreak}}%
- \verticalstrut
- \endgraf
- \nobreak
- \offinterlineskip
- \kern-2\lineheight
- \nobreak
- \unvbox\nextbox
+ \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
- \inhibitblank}
+ \doinhibitblank} % beware, no \inhibitblank ! ! ! ! ! !
\def\stopdoorlopendblok
- {\egroup}
-
-\def\defineXMLstore {\doquadrupleargument\dodefineXMLstore[\saveXMLasdata]}
-\def\defineXMLgstore{\doquadrupleargument\dodefineXMLstore[\gsaveXMLasdata]}
-
-\def\dodefineXMLstore[#1][#2][#3][#4]% element attribute prefix % will become faster
- {\defineXMLargument[#2][#3=\s!dummy]{#1{#4:\XMLop{#3}}}}
+ {\endgraf\verticalstrut\endgraf\kern-2\lineheight
+ \egroup}
% Just a simple and fast hanger, for usage in macros.
@@ -205,15 +521,6 @@
{\def\@@meta{#1:}%
\prepareMPvariables{#2}}
-\def\countXMLchildren[#1]#2%
- {\startnointerference
- \doglobal\newcounter\nofXMLchildren
- \defineXMLargument[#1]{\doglobal\increment\nofXMLchildren}%
- \startXMLignore
- #2%
- \stopXMLignore
- \stopnointerference}
-
\def\processlinetableXMLfile#1%
{\bgroup
\let\startlinetable\donothing
@@ -302,45 +609,6 @@
% so far
-% test this prikkels/pascal margin text before heads (mode
-% 1) as well as uitwerkingen (mode 2)
-
-%chardef\graphicvadjustmode=0 % fake
-%chardef\graphicvadjustmode=1 % normal
-\chardef\graphicvadjustmode=2 % normal + compensate (== default)
-
-\def\placemargintexts % to be documented and translated
- {\ifcase\margincontent\else
- \bgroup
- \chardef\graphicvadjustmode\zerocount
- \doflushmargincontents
- \egroup
- \fi}
-
-\def\graphicvadjust % bad, those low level color calls here
- {\dowithnextboxcontent
- {\forgetall}
- {\ifcase\graphicvadjustmode \@EA \fakedvadjust \else \@EA\normalvadjust \fi
- {\dostartgraphicgroup
- \localstarttextcolor
- \unvbox\nextbox
- \localstoptextcolor
- \dostopgraphicgroup
- \ifcase\graphicvadjustmode \or \or
- % corrects for one line paragraphs
- \nointerlineskip
- \kern-\struttotal
- \nointerlineskip
- \verticalstrut
- \fi}}%
- \vbox}
-
-\def\removefunnytabulateline
- {\ifhmode
- \strut\crcr
- \TABLEnoalign{\kern-\lineheight}%
- \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
@@ -797,60 +1065,7 @@
\def\gobbleparameters{\doquadrupleempty\dogobbleparameters}
\def\dogobbleparameters[#1][#2][#3][#4]{}
-\def\defineTABLEdivisions
- {\global\TABLEdivisionfalse % in start
- \let\DL\TableDL
- \let\DC\TableDC
- \let\DV\TableDV
- \let\DR\TableDR}
-
-\def\defineTABLErules
- {\let\VL\TableVL
- \let\VC\TableVC
- \let\HL\TableHL
- \let\HC\TableHC
- \let\VS\TableVS
- \let\VD\TableVD
- \let\VT\TableVT}
-
-\def\TableVS{\gdef\@VLn{1}\VL}
-\def\TableVD{\gdef\@VLn{2}\VL}
-\def\TableVT{\gdef\@VLn{3}\VL}
-
-\def\@VLn{1}
-\def\@VLd{.125em}
-
-\def\do!ttInsertVrule % will be merged in 2005
- {\vrule \!thWidth
- \ifnum\!tgCode=1
- \ifx\!tgValue\empty
- \LineThicknessFactor
- \else
- \!tgValue
- \fi
- \LineThicknessUnit
- \else
- \!tgValue
- \fi
- \hskip\@VLd}
-
-\def\!ttInsertVrule%
- {\hfil
- \TABLEbeforebar % added
- \startglobalTABLEcolor % added
- % we could do without this speedup, some day merge 'm
- \ifcase\@VLn\or
- \do!ttInsertVrule
- \unskip
- \else
- \dorecurse\@VLn\do!ttInsertVrule
- \gdef\@VLn{1}%
- \unskip
- \fi
- \stopglobalTABLEcolor % added
- \TABLEafterbar % added
- \hfil
- &}
+% documentation
% \starttable[|||]
% \HL
diff --git a/tex/context/base/cont-usr.ori b/tex/context/base/cont-usr.ori
index eaab96693..22b8a63f5 100644
--- a/tex/context/base/cont-usr.ori
+++ b/tex/context/base/cont-usr.ori
@@ -8,25 +8,26 @@
%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.
-
-%D In this file users can specify what hyphenation patterns
-%D they want to load into the format file. Normally, when
-%D using the \type {cont-..} files, this file can best be
-%D left unchanged. The default language and font settings
-%D done in the \type {cont-.} files take precedence! This file
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D In this file users can specify what hyphenation patterns
+%D they want to load into the format file. Normally, when
+%D using the \type {cont-..} files, this file can best be
+%D left unchanged. The default language and font settings
+%D done in the \type {cont-.} files take precedence! This file
%D is subject to changes.
\unprotect
%D Hyphenation patterns are normally sought in filed named
-%D \type {lang-xx.pat}. When present on the system, those
-%D patterns take precedence. (The next list is inspired on
-%D Thomas Esser's \TETEX\ distribution.) This list will be
+%D \type {lang-xx.pat}. When present on the system, those
+%D patterns take precedence. (The next list is inspired on
+%D Thomas Esser's \TETEX\ distribution.) This list will be
%D adapted to the actual situation.
-\definefilesynonym [lang-cz.pat] [czhyph.tex]
+%definefilesynonym [lang-cz.pat] [czhyph.tex] % is bound to latex (tl 8+)
+\definefilesynonym [lang-cz.pat] [czhyphen.tex]
\definefilesynonym [lang-da.pat] [dkhyph.tex]
\definefilesynonym [lang-de.pat] [dehyphn.tex]
\definefilesynonym [lang-en.pat] [ushyph1.tex]
@@ -43,7 +44,8 @@
\definefilesynonym [lang-pt.pat] [pthyph.tex]
\definefilesynonym [lang-ro.pat] [rohyph.tex]
\definefilesynonym [lang-ru.pat] [ruenhyph.tex]
-\definefilesynonym [lang-sk.pat] [skhyph.tex]
+%definefilesynonym [lang-sk.pat] [skhyph.tex] % is bound to latex (tl 8+)
+\definefilesynonym [lang-sk.pat] [skhyphen.tex]
\definefilesynonym [lang-sv.pat] [sehyph.tex]
\definefilesynonym [lang-tr.pat] [trhyph.tex]
\definefilesynonym [lang-ua.pat] [ukrenhyp.tex]
@@ -56,7 +58,7 @@
%D replaced by \type {nehyph96.tex}. Typical something that
%D you have to find out by accident. The names of hyphenation
%D files as well as their coding is one of the dark areas of
-%D \TEX\ distributions.
+%D \TEX\ distributions.
\doiffileelse{nehyph96.tex}
{\definefilesynonym[lang-nl.pat][nehyph96.tex]}
@@ -65,54 +67,54 @@
{\definefilesynonym[lang-nl.pat][nehyph.tex]}}
%D Pattern files are (can be) encoded! And, alas, not all
-%D pattern files are self contained, which is why (for the
-%D moment) we specify encodings here.
+%D pattern files are self contained, which is why (for the
+%D moment) we specify encodings here.
-\installlanguage [\s!cz] [\s!mapping={il2,ec},\s!encoding={il2,ec}]
-\installlanguage [\s!hr] [\s!mapping={il2,ec},\s!encoding={il2,ec}]
-%installlanguage [\s!pl] [\s!mapping=pl0,\s!encoding=pl0]
-\installlanguage [\s!pl] [\s!mapping={pl0,ec},\s!encoding={pl0,ec}]
-\installlanguage [\s!sk] [\s!mapping={il2,ec},\s!encoding={il2,ec}]
+\installlanguage [\s!cz] [\s!mapping={il2,ec},\s!encoding={il2,ec}]
+\installlanguage [\s!hr] [\s!mapping={il2,ec},\s!encoding={il2,ec}]
+%installlanguage [\s!pl] [\s!mapping=pl0,\s!encoding=pl0]
+\installlanguage [\s!pl] [\s!mapping={pl0,ec},\s!encoding={pl0,ec}]
+\installlanguage [\s!sk] [\s!mapping={il2,ec},\s!encoding={il2,ec}]
-%D Sometimes these are not wanted:
+%D Sometimes these are not wanted:
%\definefilesynonym [lang-deo.pat] [dehypht.tex] % old patterns
-%\definefilesynonym [lang-nlx.pat] [dutch96.pat] % new patterns
+%\definefilesynonym [lang-nlx.pat] [dutch96.pat] % new patterns
-%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.
+%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.
-% \installlanguage [\s!af] [\c!status=\v!start] % afrikaans
+% \installlanguage [\s!af] [\c!status=\v!start] % afrikaans
% \installlanguage [\s!cz] [\c!status=\v!start] % czech
-% \installlanguage [\s!da] [\c!status=\v!start] % danish
-% \installlanguage [\s!de] [\c!status=\v!start] % german
-% \installlanguage [\s!en] [\c!status=\v!start] % english us
-% \installlanguage [\s!es] [\c!status=\v!start] % spanish
+% \installlanguage [\s!da] [\c!status=\v!start] % danish
+% \installlanguage [\s!de] [\c!status=\v!start] % german
+% \installlanguage [\s!en] [\c!status=\v!start] % english us
+% \installlanguage [\s!es] [\c!status=\v!start] % spanish
% \installlanguage [\s!fi] [\c!status=\v!start] % finnish
-% \installlanguage [\s!fr] [\c!status=\v!start] % french
+% \installlanguage [\s!fr] [\c!status=\v!start] % french
% \installlanguage [\s!hr] [\c!status=\v!start] % croatian
-% \installlanguage [\s!hu] [\c!status=\v!start] % hungarian
-% \installlanguage [\s!it] [\c!status=\v!start] % italian
-% \installlanguage [\s!la] [\c!status=\v!start] % latin
-% \installlanguage [\s!nl] [\c!status=\v!start] % dutch
-% \installlanguage [\s!no] [\c!status=\v!start] % norwegian
+% \installlanguage [\s!hu] [\c!status=\v!start] % hungarian
+% \installlanguage [\s!it] [\c!status=\v!start] % italian
+% \installlanguage [\s!la] [\c!status=\v!start] % latin
+% \installlanguage [\s!nl] [\c!status=\v!start] % dutch
+% \installlanguage [\s!no] [\c!status=\v!start] % norwegian
% \installlanguage [\s!pl] [\c!status=\v!start] % polish
-% \installlanguage [\s!pt] [\c!status=\v!start] % portuguese
-% \installlanguage [\s!ro] [\c!status=\v!start] % romanian
-% \installlanguage [\s!ru] [\c!status=\v!start] % russian
+% \installlanguage [\s!pt] [\c!status=\v!start] % portuguese
+% \installlanguage [\s!ro] [\c!status=\v!start] % romanian
+% \installlanguage [\s!ru] [\c!status=\v!start] % russian
% \installlanguage [\s!sk] [\c!status=\v!start] % slovak
-% \installlanguage [\s!sv] [\c!status=\v!start] % swedish
-% \installlanguage [\s!tr] [\c!status=\v!start] % turkish
+% \installlanguage [\s!sv] [\c!status=\v!start] % swedish
+% \installlanguage [\s!tr] [\c!status=\v!start] % turkish
% \installlanguage [\s!ua] [\c!status=\v!start] % ukrainian
-% \installlanguage [\s!uk] [\c!status=\v!start] % english uk
+% \installlanguage [\s!uk] [\c!status=\v!start] % english uk
% \installlanguage [deo] [\c!status=\v!start] % old german
-% \installlanguage [nlx] [\c!status=\v!start] % dutch 8 bit
+% \installlanguage [nlx] [\c!status=\v!start] % dutch 8 bit
-%D The next lines can be used for setting the language to be
-%D used at startup time.
+%D The next lines can be used for setting the language to be
+%D used at startup time.
% \setupcurrentlanguage[\s!af]
% \setupcurrentlanguage[\s!cz]
@@ -137,23 +139,23 @@
% \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.
+%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.
-% \definefilesynonym [font-cmr] [font-csr] % czech & slovak
-% \definefilesynonym [font-cmr] [font-plr] % polish
+% \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.
+%D In some languages, compound characters, like \type {"e}
+%D are used to get accented and non latin characters.
- \useencoding[fde] % german
-% \useencoding[ffr] % french
+ \useencoding[fde] % german
+% \useencoding[ffr] % french
% \useencoding[fro] % romanian
-% \useencoding[fpl] % polish
+% \useencoding[fpl] % polish
-%D Don't remove the next few lines.
+%D Don't remove the next few lines.
-\protect \endinput
+\protect \endinput
diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex
index 9db58bf70..4c64d63ca 100644
--- a/tex/context/base/context.tex
+++ b/tex/context/base/context.tex
@@ -15,7 +15,7 @@
\catcode`\{=1 \catcode`\}=2
-\def\contextversion{2003.9.26}
+\def\contextversion{2004.1.2}
%D Welcome to the main module. When this module is ran through
%D \type{initex} or \type{tex -i} or \type{whatevertex} using
@@ -64,7 +64,8 @@
%D We also use some third party macros. These are loaded by
%D saying:
-\input thrd-ran.tex
+\input thrd-ran.tex % based on: David Carlisle
+\input thrd-trg.tex % based on: Donald Arseneau
%D Now we're ready for some general support modules. These
%D modules implement some basic typesetting functionality.
@@ -116,7 +117,7 @@
%D just go for the best there is and load \TABLE. Just to be
%D sure we do it here, before we redefine \type{|}.
-\input thrd-tab.tex
+\input thrd-tab.tex % based on: Michael Wichura
%D Here comes the last support modules. They take care of
%D some language specific things.
@@ -214,6 +215,8 @@
\input page-mar.tex
\input page-bck.tex
\input page-app.tex
+\input page-flw.tex % flows - experimental
+\input page-spr.tex % spreads - experimental
\input core-job.tex
@@ -236,6 +239,7 @@
%D On which the next one depends:
\input core-pos.tex
+\input core-snc.tex
%D A few more languages, that have specifics using core
%D functionality:
@@ -259,6 +263,7 @@
\input font-ini.tex
\input font-uni.tex
+\input font-bfm.tex
\input type-ini.tex
@@ -271,6 +276,7 @@
\input core-fnt.tex
\input core-not.tex
+\input core-lnt.tex
\input core-mis.tex
@@ -315,6 +321,7 @@
%D Defaults go here (more will be moved to this module
%D later):
+\input core-ini.tex
\input core-def.tex
%D At run time, a few more files are loaded, like:
@@ -510,4 +517,4 @@
\errorstopmode \dump
-\endinput
+\endinput \ No newline at end of file
diff --git a/tex/context/base/core-con.tex b/tex/context/base/core-con.tex
index b11800f4a..f5da17cfe 100644
--- a/tex/context/base/core-con.tex
+++ b/tex/context/base/core-con.tex
@@ -31,9 +31,18 @@
%D non||sence uppercase alternative.
%D
%D \showsetup{\y!numbers}
+%D
+%D \starttyping
+%D \def\numbers#1{\number#1}
+%D \def\Numbers#1{\number#1}
+%D \stoptyping
+%D
+%D Due to read ahead, as in \type{[\pagenumber\space]} the space will
+%D disappear, unless we use:
+
+\def\numbers#1{\purenumber{#1}}
+\def\Numbers#1{\purenumber{#1}}
-\def\numbers#1{\number#1}
-\def\Numbers#1{\number#1}
%D \macros
%D {romannumerals,Romannumerals}
@@ -54,16 +63,16 @@
%D For some years we had \unknown
%D
-%D \starttypen
+%D \starttypen
%D \def\Romannumerals#1%
%D {\uppercase\expandafter{\romannumeral#1}}
-%D \stoptypen
-%D
+%D \stoptypen
+%D
%D \unknown but we need to be fully expandable in order to get
%D the utility output file right, so now we have the following
%D solution. It was Patrick Gundlach who first noticed this
-%D ommision.
-
+%D ommision.
+
\def\Romannumerals#1%
{\expandafter\doRomannumerals\number#1\relax}
@@ -71,14 +80,14 @@
{\ifnum#1#2<10
\ifcase0#1#2 \or I\or II\or III\or IV\or V\or VI\or VII\or VIII\or IX\fi
\else\ifnum#1#2<100
- \ifcase0#1 \or X\or XX\or XXX\or XL\or L\or LX\or LXX\or LXXX\or XC\fi
- \doRomannumerals#2\relax
+ \ifcase0#1 \or X\or XX\or XXX\or XL\or L\or LX\or LXX\or LXXX\or XC\fi
+ \doRomannumerals#2\relax
\else\ifnum#1#2<1000
- \ifcase0#1 \or C\or CC\or CCC\or CD\or D\or DC\or DCC\or DCCC\or CM\fi
- \doRomannumerals#2\relax
+ \ifcase0#1 \or C\or CC\or CCC\or CD\or D\or DC\or DCC\or DCCC\or CM\fi
+ \doRomannumerals#2\relax
\else\ifnum#1#2<4000
\ifcase0#1 \or M\or MM\or MMM\fi
- \doRomannumerals#2\relax
+ \doRomannumerals#2\relax
\else
\uppercase\expandafter{\romannumeral#1#2}%
\fi\fi\fi\fi}
@@ -179,7 +188,7 @@
%D \macros
%D {oldstylenumerals,oldstyleromannumerals}
%D
-%D These conversions are dedicated to Frans Goddijn.
+%D These conversions are dedicated to Frans Goddijn.
\unexpanded\def\oldstylenumerals#1%
{{\os\number#1}}
@@ -207,10 +216,10 @@
%D possible, and because \TEX\ already uses up some of those,
%D we save the original meanings.
-\savenormalmeaning\time
-\savenormalmeaning\year
-\savenormalmeaning\month
-\savenormalmeaning\day
+\savenormalmeaning\time
+\savenormalmeaning\year
+\savenormalmeaning\month
+\savenormalmeaning\day
%D \macros
%D {month,MONTH}
@@ -280,9 +289,9 @@
\def\getdayoftheweek#1#2#3%
{\bgroup
- \!!counta#3\relax
+ \!!counta#3\relax
\advance\!!counta \minusone
- \!!countb\!!counta
+ \!!countb\!!counta
\multiply\!!countb 365
\advance\!!countb \ifcase#2\relax
0 \or 0 \or 31 \or 59 \or 90 \or120 \or151 \or
@@ -291,21 +300,21 @@
\ifnum#2>2
\doifleapyearelse{#3}{\advance\!!countb 1}{}\relax
\fi
- \!!countc\!!counta
+ \!!countc\!!counta
% \DoDiv\!!countc by4to\!!countc
\dosetdivision\!!countc4\!!countc
\advance\!!countb \!!countc
- \!!countc\!!counta
+ \!!countc\!!counta
% \DoDiv\!!countc by100to\!!countc
\dosetdivision\!!countc{100}\!!countc
\advance\!!countb -\!!countc
- \!!countc\!!counta
+ \!!countc\!!counta
% \DoDiv\!!countc by400to\!!countc
\dosetdivision\!!countc{400}\!!countc
\advance\!!countb \!!countc
% \DoMod\!!countb by7to\!!countb
\dosetmodulo\!!countb7\!!countb
- \advance\!!countb \plusone
+ \advance\!!countb \plusone
\@EA\egroup\@EA\normalweekday\the\!!countb\relax}
\def\dayoftheweek#1#2#3%
@@ -469,7 +478,7 @@
%D \haalbuffer
%D \stopregels
-\def\kenmerkdatumpatroon{j,mm,dd} % jj,mm,dd changed at januari 1-1-2000
+\def\kenmerkdatumpatroon{j,mm,dd} % jj,mm,dd changed at januari 1-1-2000
\newsignal\datesignal
@@ -483,14 +492,14 @@
% {\bgroup
% \let\labellanguage\currentlanguage
% \def\betweendates{\let\betweendates\dobetweendates}%
-% \lowercase{\edef\!!stringa{#1}}% permits usage in \kap
+% \lowercase{\edef\!!stringa{#1}}% permits usage in \kap
% \@EA\processallactionsinset\@EA
% [\!!stringa]
% [ \v!dag=>\betweendates\the\normalday,
% \v!maand=>\betweendates\month\normalmonth,
% \v!jaar=>\betweendates\the\normalyear,
-% \space=>\unskip\ \hskip\datesignal,% optimization -)
-% \ =>\unskip\ \hskip\datesignal,% optimization -)
+% \space=>\unskip\ \hskip\datesignal,% optimization -)
+% \ =>\unskip\ \hskip\datesignal,% optimization -)
% d=>\the\normalday,
% m=>\the\normalmonth,
% j=>\the\normalyear,
@@ -515,15 +524,15 @@
% {\bgroup
% \let\labellanguage\currentlanguage
% \def\betweendates{\let\betweendates\dobetweendates}%
-% \lowercase{\edef\!!stringa{#1}}% permits usage in \kap
+% \lowercase{\edef\!!stringa{#1}}% permits usage in \kap
% \@EA\processallactionsinset\@EA
% [\!!stringa]
% [ \v!dag=>\betweendates\the\normalday,
% \v!dag+=>\betweendates\ordinaldaynumber\normalday,
% \v!maand=>\betweendates\month\normalmonth,
% \v!jaar=>\betweendates\the\normalyear,
-% \v!spatie=>\unskip\ \hskip\datesignal,% optimization -)
-% \ =>\unskip\ \hskip\datesignal,% optimization -)
+% \v!spatie=>\unskip\ \hskip\datesignal,% optimization -)
+% \ =>\unskip\ \hskip\datesignal,% optimization -)
% d=>\the\normalday,
% d+=>\ordinaldaynumber\normalday,
% m=>\the\normalmonth,
@@ -550,7 +559,7 @@
{\bgroup
\let\labellanguage\currentlanguage
\def\betweendates{\let\betweendates\dobetweendates}%
- \lowercase{\edef\!!stringa{#1}}% permits usage in \kap
+ \lowercase{\edef\!!stringa{#1}}% permits usage in \kap
\@EA\processallactionsinset\@EA
[\!!stringa]
[ \v!dag=>\betweendates\the\normalday,
@@ -558,8 +567,8 @@
\v!dag+=>\betweendates\convertnumber{\v!dag+}\normalday,
\v!maand=>\betweendates\month\normalmonth,
\v!jaar=>\betweendates\the\normalyear,
- \v!spatie=>\unskip\ \hskip\datesignal,% optimization -)
- \ =>\unskip\ \hskip\datesignal,% optimization -)
+ \v!spatie=>\unskip\ \hskip\datesignal,% optimization -)
+ \ =>\unskip\ \hskip\datesignal,% optimization -)
d=>\convertnumber\v!dag\normalday,
%d+=>\ordinaldaynumber\normalday,
d+=>\convertnumber{\v!dag+}\normalday,
@@ -612,9 +621,9 @@
%D \macros
%D {currenttime}
%D
-%D The currenttime is actually the jobtime. You can specify
-%D a pattern similar to the previous date macro using the
-%D keys \type {h}, \type {m} and a separator.
+%D The currenttime is actually the jobtime. You can specify
+%D a pattern similar to the previous date macro using the
+%D keys \type {h}, \type {m} and a separator.
\def\calculatecurrenttime
% {\DoDiv\time by60to\scratchcounter\edef\currenthour {\the\scratchcounter}%
@@ -637,7 +646,7 @@
{\expanded{\complexcurrenttime[\currenttimespecification]}}
\definecomplexorsimple\currenttime
-
+
%D Because we're dealing with dates, we also introduce a few
%D day loops:
%D
@@ -687,7 +696,7 @@
%D \defineconversion [set 1] [$\star$,$\bullet$,$\ast$]
%D \stoptypen
%D
-%D You can define a language dependent conversion with:
+%D You can define a language dependent conversion with:
%D
%D \starttypen
%D \defineconversion [en] [whatever] [\something]
@@ -702,7 +711,7 @@
% \processcommalist[#2]\docommando
% \setvalue{\??cv#1}##1{\csname\??cv#1##1\endcsname}}
% {\setvalue{\??cv#1}{#2}}}
-%
+%
% \def\defineconversion%
% {\dodoubleargument\dodefineconversion}
@@ -747,7 +756,7 @@
% \else
% \@EA\firstoftwoarguments
% \fi}
-
+
\beginETEX \ifcsname
\def\convertnumber#1%
@@ -769,7 +778,7 @@
\else
\@EAEAEA\secondoftwoarguments
\fi\fi}
-
+
\endETEX
\beginTEX
@@ -853,24 +862,24 @@
\defineconversion
[set 0]
- [{\symbol[bullet]},
+ [{\symbol[bullet]},
{\symbol[dash]},
- {\symbol[star]},
+ {\symbol[star]},
{\symbol[triangle]},
- {\symbol[circle]},
+ {\symbol[circle]},
{\symbol[medcircle]},
- {\symbol[bigcircle]},
+ {\symbol[bigcircle]},
{\symbol[square]}]
\defineconversion
[set 1]
- [\mathematics{\star},
+ [\mathematics{\star},
\mathematics{\star\star},
- \mathematics{\star\star\star},
- \mathematics{\ddagger},
- \mathematics{\ddagger\ddagger},
+ \mathematics{\star\star\star},
+ \mathematics{\ddagger},
+ \mathematics{\ddagger\ddagger},
\mathematics{\ddagger\ddagger\ddagger},
- \mathematics{\ast},
+ \mathematics{\ast},
\mathematics{\ast\ast},
\mathematics{\ast\ast\ast}]
@@ -900,11 +909,11 @@
\mathematics{\P},
\mathematics{\P\P},
\mathematics{\P\P\P},
- \mathematics{\S},
+ \mathematics{\S},
\mathematics{\S\S},
\mathematics{\S\S\S},
\mathematics{\ast},
\mathematics{\ast\ast},
\mathematics{\ast\ast\ast}]
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/core-des.tex b/tex/context/base/core-des.tex
index 95a8bdf8f..9a6c8dd3a 100644
--- a/tex/context/base/core-des.tex
+++ b/tex/context/base/core-des.tex
@@ -541,35 +541,35 @@
\def\@@ddsetsubsubsubnummer#1%
{\edef\doornummer{\getvalue{\??dd#1\??dd\c!nummer}}%
- \setnummer[\v!sub\v!sub\v!sub\doornummer]}
+ \setnumber[\v!sub\v!sub\v!sub\doornummer]}
\def\@@ddsetsubsubnummer#1%
{\@@ddresetsubsubsubnummer{#1}%
- \setnummer[\v!sub\v!sub\doornummer]}
+ \setnumber[\v!sub\v!sub\doornummer]}
\def\@@ddsetsubnummer#1%
{\@@ddresetsubsubnummer{#1}%
- \setnummer[\v!sub\doornummer]}
+ \setnumber[\v!sub\doornummer]}
\def\@@ddsetnummer#1%
{\@@ddresetsubnummer{#1}%
- \setnummer[\doornummer]}
+ \setnumber[\doornummer]}
\def\@@ddresetsubsubsubnummer#1%
{\edef\doornummer{\getvalue{\??dd#1\??dd\c!nummer}}%
- \resetnummer[\v!sub\v!sub\v!sub\doornummer]}
+ \resetnumber[\v!sub\v!sub\v!sub\doornummer]}
\def\@@ddresetsubsubnummer#1%
{\@@ddresetsubsubsubnummer{#1}%
- \resetnummer[\v!sub\v!sub\doornummer]}
+ \resetnumber[\v!sub\v!sub\doornummer]}
\def\@@ddresetsubnummer#1%
{\@@ddresetsubsubnummer{#1}%
- \resetnummer[\v!sub\doornummer]}
+ \resetnumber[\v!sub\doornummer]}
\def\@@ddresetnummer#1%
{\@@ddresetsubnummer{#1}%
- \resetnummer[\doornummer]}
+ \resetnumber[\doornummer]}
\def\@@ddvolgendesubsubsubnummer#1[#2]%
{\edef\doornummer{\getvalue{\??dd#1\??dd\c!nummer}}%
@@ -760,7 +760,7 @@
% {\definieernummer
% [#1][\c!voor=,\c!na=,\c!kopletter=,\c!wijze=\@@nrwijze,#2]%
% \setvalue {#1}{\dodoubleempty\dodoorlabel[#1]}%
-% \setvalue{\s!reset #1}{\resetnummer[#1]}%
+% \setvalue{\s!reset #1}{\resetnumber[#1]}%
% \setvalue{\e!verhoog #1}{\verhoognummer[#1]}%
% \setvalue{\e!volgende#1}{\dodoubleempty\dovolgendedoorlabel[#1]}%
% \setvalue{\c!huidige #1}{\huidigenummer[#1]}}
@@ -796,7 +796,7 @@
[\c!wijze=\getvalue{\??lb#1\c!wijze}]%
% generated commands
\setvalue {#1}{\dodoubleempty\dodoorlabel[#1]}%
- \setvalue{\s!reset #1}{\resetnummer[#1]}%
+ \setvalue{\s!reset #1}{\resetnumber[#1]}%
\setvalue{\e!verhoog #1}{\verhoognummer[#1]}%
\setvalue{\e!volgende#1}{\dodoubleempty\dovolgendedoorlabel[#1]}%
\setvalue{\c!huidige #1}{\huidigenummer[#1]}}
diff --git a/tex/context/base/core-fig.tex b/tex/context/base/core-fig.tex
index b4182de1a..8930d1f52 100644
--- a/tex/context/base/core-fig.tex
+++ b/tex/context/base/core-fig.tex
@@ -657,16 +657,7 @@
\doifsomething\@@efmaxbreedte
{\ifdim\figwid>\@@efmaxbreedte\global\figwid\@@efmaxbreedte#2\relax\fi}%
\doifsomething\@@efmaxhoogte
- {\ifdim\fighei>\@@efmaxhoogte \global\fighei\@@efmaxhoogte #3\relax\fi}%
- \processaction
- [\@@efgrid]
- [ \v!ja=>\getnoflines\fighei
- \global\fighei\noflines\lineheight,
- \v!hoogte=>\getrawnoflines\fighei
- \global\fighei\noflines\lineheight
- \global\advance\fighei\strutdepth,
- \v!passend=>\getrawnoflines\fighei
- \global\fighei\noflines\lineheight]}
+ {\ifdim\fighei>\@@efmaxhoogte \global\fighei\@@efmaxhoogte #3\relax\fi}}
\def\setdimensionfiguresize
{\ifdim\figwid>\zeropoint\relax
@@ -755,11 +746,12 @@
%D tremendously faster (but uglier) implementation is:
\def\resetexternalfigures
- {\let\@@efoptie \empty
- \let\@@efmaxbreedte \empty
- \let\@@efmaxhoogte \empty
- \let\@@efkader \v!uit
- \let\@@efachtergrond\empty}
+ {\let\@@efoptie \empty
+ \let\@@efmaxbreedte \empty
+ \let\@@efmaxhoogte \empty
+ \let\@@efkader \v!uit
+ \let\@@efvoorgrondkleur\empty
+ \let\@@efachtergrond \empty}
% The following code will move:
@@ -853,7 +845,7 @@
% \fi
% \scratchdimen-\scratchdimen % beter hier - dan in driver
% \edef#2{\the\scratchdimen}% oeps, \the vergeten
-% \scratchdimen#3\s!pt
+% \scratchdimen#3\points
% \divide\scratchdimen \!!ten
% \edef#4{\@EA\withoutpt\@EA{\the\scratchdimen}}}
%
@@ -873,9 +865,9 @@
\scratchcounter#3\relax
\ifnum\scratchcounter>\plustenthousand
\divide\scratchcounter \!!ten
- \scratchdimen\the\scratchcounter\s!pt
+ \scratchdimen\the\scratchcounter\points
\else
- \scratchdimen\the\scratchcounter\s!pt
+ \scratchdimen\the\scratchcounter\points
\divide\scratchdimen \!!ten
\fi
\edef#4{\@EA\withoutpt\@EA{\the\scratchdimen}}}
@@ -927,6 +919,585 @@
\chardef\splitexternalfigure=0 % 0 nosplit 1 split/yes 2 split/no
+% \def\calculateexternalfigure[#1][#2][#3][#4][#5][#6]%
+% {\mindermeldingen
+% \setupexternalfigures
+% \the\externalfigureresets % hook, see resource libraries
+% \global\figwid\zeropoint \figxsca\plusone % see note *
+% \global\fighei\zeropoint \figysca\plusone % see note *
+% \global\setbox\foundexternalfigure\box\voidb@x
+% % get rid of active / and : as well as expand for [\get...] cases
+% \sanitizefilename#3\to\expandedfigurename
+% % nil path search in case of path spec
+% \expanded{\checkfilename{\expandedfigurename}}%
+% \ifcase\kindoffile\else \let\figurepathlist\empty \fi
+% \expandafter\beforesplitstring\expandedfigurename\at.\to\@@effilename
+% \expandafter\aftersplitstring \expandedfigurename\at.\to\@@efextension
+% \doifelse\@@effilename{mprun}
+% {\edef\@@effilepref{\bufferprefix}}
+% {\let \@@effilepref\empty}%
+% \edef\@@effilename{\@@effilepref\@@effilename}%
+% \restorecatcodes % recently added; we presume local use
+% \def\@@eflabel{#2}%
+% \global\let\externalfigurelog\empty
+% \getparameters
+% [\??ep]
+% [\c!e=\s!unknown,
+% %\c!w=15\korpsgrootte,\c!h=10\korpsgrootte,
+% \c!w=8\lineheight,\c!h=6\lineheight,
+% \c!x=\!!zeropoint,\c!y=\!!zeropoint,
+% \c!t=,\c!s=,\c!a=,\c!f=\@@effilename]%
+% \getparameters
+% [\??ef]
+% [\c!type=\s!unknown,\c!methode=\@@eftype,\c!symbool=\v!nee,
+% \c!object=\@@exobject,\c!preset=\v!ja,
+% \c!pagina=0,\c!sturing=\v!nee,\c!preview=\v!nee,\c!herhaal=\v!nee,
+% \c!maxbreedte=\@@exmaxbreedte,\c!maxhoogte=\@@exmaxhoogte,
+% \c!schaal=,\c!breedte=,\c!hoogte=,\c!scherm=,\c!regels=,\c!grid=,
+% %\c!voorgrondkleur=,
+% \c!splitsen=,
+% \c!factor=,\c!hfactor=,\c!bfactor=]%
+% \doif\@@efextension\c!mov\presetfiguremov
+% \doif\@@efextension\c!avi\presetfigureavi
+% #1[#4][#5][#6]%
+% % lines -> height
+% \checkfiguresettings
+% % new, color separation
+% \doifseparatingcolorselse
+% {\let\@@efvoorgrondkleur\empty
+% \doifelsenothing\@@efsplitsen
+% {\chardef\splitexternalfigure0}
+% {\doifcolorchannelelse\@@efsplitsen
+% {\let\@@efobject\v!nee % ?
+% \chardef\splitexternalfigure1}
+% {\chardef\splitexternalfigure2}}}
+% {\chardef\splitexternalfigure0}%
+% \relax % ends \chardef
+% % new, fake color in gray bitmaps
+% \doifsomething\@@efvoorgrondkleur
+% {\getparameters[\??ef]
+% [\c!achtergrond={\v!voorgrond,\v!kleur},
+% \c!achtergrondkleur=\@@efvoorgrondkleur]}%
+% %
+% \doif\@@efreset\v!ja \resetexternalfigures
+% \doif\@@eftype \c!mov\presetfiguremov
+% \doif\@@eftype \c!avi\presetfigureavi
+% % hack
+% \doif\@@efmethode\c!mov
+% {\doifsomething\@@efextension{\presetundefinedfigure\@@efextension}}%
+% %
+% \doif\@@eftype\v!buffer
+% {\ifx\@@efextension\empty
+% \let\@@efextension\c!tmp
+% \fi
+% \let\@@eftype\c!tex}%
+% \@EA\doifnumberelse\@EA{\@@efextension} % new, test first
+% {\def\@@eftype{\c!mps}}
+% {%
+% \processaction
+% [\@@efextension]
+% [ \c!tex=>\let\@@eftype\c!tex,
+% \c!tmp=>\let\@@eftype\c!tex
+% \edef\@@effilepref{\bufferprefix}%
+% \edef\@@effilename{\@@effilepref\@@effilename},
+% \c!avi=>\presetfigureavi,
+% \c!mov=>\presetfiguremov]%
+% }%
+% \edef\figuretypes{\figuretypes,\c!tex}%
+% \ifx\@@eftype\c!tex
+% % Since tex code can have positional stuff and worse,
+% % we want to avoid interference with how objects end
+% % up in files, therefore:
+% \let\@@efobject\v!nee
+% \fi
+% \edef\@@efobjectname{\@@effilename-\@@eftype-\@@efextension-\@@efpagina}%
+% \doifelse\@@efobject\v!nee
+% \donefalse
+% {\doifspecialavailableelse\dostartscaling
+% {\doifobjectssupportedelse
+% {\doifobjectfoundelse{FIG}\@@efobjectname\donetrue\donefalse}
+% \donefalse}
+% \donefalse}%
+% % redo message, only filename
+% \doifparentfileelse\@@effilename
+% {\@EA\removefromcommalist\@EA{\jobsuffix}\figuretypes
+% \let\@@efextension\empty
+% \showmessage\m!figures9\@@effilename
+% \donefalse}
+% \donothing
+% \ifdone
+% \getobjectdimensions{FIG}{\@@efobjectname}%
+% \geteparameters % e !
+% [\??ep]
+% [\c!x=\!!zeropoint,\c!y=\!!zeropoint,
+% \c!w=\objectwidth,\c!h=\objectheight]%
+% \chardef\figurestatus=5
+% \edef\@@effullname{\@@effilepref\expandedfigurename}%
+% \else
+% \doifelse{#2}\s!figurepreset
+% {\def\figureextension##1{\@@efextension}%
+% \edef\@@effullname{\@@effilepref\expandedfigurename}}%
+% {\ifx\@@efextension\empty
+% \dogetcommacommandelement1\from\@@eftype\to\commalistelement
+% \edef\@@effullname{\@@effilename.\commalistelement}%
+% \def\figureextension##1{##1}%
+% \else
+% \@EA\doifnumberelse\@EA{\@@efextension}
+% {\let\@@eftype\c!mps}\donothing
+% \edef\@@effullname{\@@effilename.\@@efextension}%
+% \def\figureextension##1{\@@efextension}%
+% \fi}%
+% \doifelse\@@efpreset\v!nee
+% {\doifelse\@@eftype\s!unknown
+% {\chardef\figurestatus0
+% \let\@@eftype\figuretypes
+% \locatepresetfigurefiles}
+% {\chardef\figurestatus1 }}
+% {\doifelse\@@eftype\s!unknown
+% {\let\@@eftype\figuretypes}
+% {\@EA\removefromcommalist\@EA{\@@eftype}\figuretypes
+% \edef\@@eftype{\ifx\@@eftype\empty\else\@@eftype,\fi\figuretypes}}%
+% \ifx\@@efextension\empty\else
+% \ExpandBothAfter\doifinsetelse\@@efextension\@@eftype
+% {\@EA\removefromcommalist\@EA{\@@efextension}\@@eftype
+% \edef\@@eftype{\@@efextension,\@@eftype}}%
+% \donothing
+% \fi
+% \doifelse{#2}\s!figurepreset
+% {\chardef\figurestatus4
+% %\def\@@efloadname{\f!currentpath\f!pathseparator\@@exfile}%
+% \assignfullfilename\f!currentpath\@@exfile\to\@@efloadname
+% \let\@@eftype\@@epe}
+% {\chardef\figurestatus\zerocount
+% \analyzefigurefiles}}%
+% \let\@@epe\@@eftype
+% \edef\@@efextension{\figureextension{\@@eftype}}% dirty trick
+% \global\figwid\zeropoint \figxsca\plusone
+% \global\fighei\zeropoint \figysca\plusone
+% \doif\v!kader\@@exoptie
+% {\let\@@efkader\v!aan}%
+% \fi
+% \ifcase\figurestatus
+% \let\@@efkader\v!aan
+% \let\@@efobject\v!nee
+% \showmessage\m!figures1{\@@effilename}%
+% \or
+% \showmessage\m!figures2{\@@effullname}%
+% \or
+% \showmessage\m!figures3{\@@effullname,\@@eflenttype}%
+% \or
+% \showmessage\m!figures4{\@@effullname}%
+% \or
+% \showmessage\m!figures5{\@@effullname,\@@efloadname}%
+% \or % no message
+% \doifnot\@@efsymbool\v!ja
+% {\showmessage\m!figures8{\@@effullname}}%
+% \fi
+% \ifdim\@@epw=\zeropoint \chardef\figurestatus1 \fi
+% \ifdim\@@eph=\zeropoint \chardef\figurestatus1 \fi
+% \ifnum\figurestatus=1 % unknown dimensions, take width or height or scale
+% \setnaturalfiguresize
+% \xdef\naturalfigurewidth{\the\figwid}%
+% \xdef\naturalfigureheight{\the\fighei}%
+% \let\@@efkader\v!uit
+% \else
+% \global\let\naturalfigurewidth\@@epw
+% \global\let\naturalfigureheight\@@eph
+% \setfactorfiguresize
+% \setscalefiguresize
+% \setdimensionfiguresize
+% \fi
+% \convertfigureinsertscale\@@epx\figx\figxsca\scax
+% \convertfigureinsertscale\@@epy\figy\figysca\scay
+% \iftraceexternalfigures
+% \message
+% {\externalfigurelog
+% [\@@effullname:
+% t={\@@eftype}\space m={\@@efmethode}\space l=\@@eflabel\space
+% w=\number\figwid\space h=\number\fighei\space
+% \c!sx=\scax\space\c!sy=\scay\space
+% ox=\figx\space oy=\figy]}%
+% \fi
+% \doif\v!leeg\@@exoptie
+% {\skipexternalfigurestrue
+% \let\@@efkader\v!uit}% ? ?
+% \doifelsenothing\@@efpagina % NIEUW ??
+% {\let\@@efoptions\empty}
+% {\let\@@efoptions\@@efpagina}%
+% \doif\@@efpreview\v!ja{\addtocommalist\v!preview\@@efoptions}%
+% \doif\@@efsturing\v!ja{\addtocommalist\v!sturing\@@efoptions}%
+% \doif\@@efherhaal\v!ja{\addtocommalist\v!herhaal\@@efoptions}%
+% \doif\@@eftype\c!mps
+% {\ifcase\EPSspecial\else\ifinobject\else
+% \@@eftrace{special mps, object forced}%
+% \doglobal\increment\forcedMPSobject
+% \edef\@@efobjectname{\c!mps::\forcedMPSobject}%
+% \let\@@efobject\v!ja
+% \fi\fi}%
+% \global\let\lastfigureobjectname\@@efobjectname
+% \doifelse\@@efobject\v!nee
+% \donefalse
+% {\doifobjectssupportedelse\donetrue\donefalse}%
+% \ifdone
+% \doifobjectfoundelse{FIG}\@@efobjectname
+% \donothing
+% {\bgroup % to be cleaned up
+% \figwid\@@epw % local ?
+% \fighei\@@eph % local ?
+% \scratchdimen\@@epx\scratchdimen-\scratchdimen
+% \edef\@@epx{\the\scratchdimen}%
+% \scratchdimen\@@epy\scratchdimen-\scratchdimen
+% \edef\@@epy{\the\scratchdimen}%
+% %\scratchdimen\@@epw\edef\@@epw{\the\scratchdimen}%
+% %\scratchdimen\@@eph\edef\@@eph{\the\scratchdimen}%
+% \setbox0\vbox to \fighei
+% {\vfill
+% \ifdim\wd\foundexternalfigure=\zeropoint
+% \doinsertfile
+% {\@@eftype,\@@efmethode}{\@@effullname,\@@eflabel}
+% {100}{100}\@@epx\@@epy\@@epw\@@eph\@@efoptions
+% \else\ifskipexternalfigures
+% \ruledhbox
+% {\backgroundline
+% [\@@efsplitskleur]{\fakebox\foundexternalfigure}}%
+% \else
+% \box\foundexternalfigure
+% \fi\fi}%
+% \wd0=\figwid
+% \setobject{FIG}\@@efobjectname\vbox{\box0}%
+% \setxvalue{\@@efobjectname\c!n}{\number\nofinsertpages}%
+% \egroup}%
+% \fi
+% \xdef\figurewidth {\the\figwid}%
+% \xdef\figureheight{\the\fighei}%
+% \global\setbox\foundexternalfigure\vbox to \fighei
+% {\vfill
+% \hsize\figwid
+% \ifdone
+% \scratchdimen\scax\points\divide\scratchdimen \plushundred
+% \edef\scax{\@EA\withoutpt\the\scratchdimen}%
+% \scratchdimen\scay\points\divide\scratchdimen \plushundred
+% \edef\scay{\@EA\withoutpt\the\scratchdimen}%
+% \schaal[\c!sx=\scax,\c!sy=\scay]{\dowithfigure{\getobject{FIG}{\@@efobjectname}}}%
+% \xdef\noffigurepages{\number\getvalue{\@@efobjectname\c!n}}%
+% \else\ifdim\wd\foundexternalfigure=\zeropoint
+% \dowithfigure
+% {\doinsertfile
+% {\@@eftype,\@@efmethode}{\@@effullname,\@@eflabel}
+% \scax\scay\figx\figy\figwid\fighei\@@efoptions}%
+% \xdef\noffigurepages{\number\nofinsertpages}%
+% \else
+% \scratchdimen\scax\points\divide\scratchdimen \plushundred
+% \edef\scax{\@EA\withoutpt\the\scratchdimen}%
+% \scratchdimen\scay\points\divide\scratchdimen \plushundred
+% \edef\scay{\@EA\withoutpt\the\scratchdimen}%
+% \schaal[\c!sx=\scax,\c!sy=\scay]{\dowithfigure{\box\foundexternalfigure}}%
+% \xdef\noffigurepages{\number\nofinsertpages}%
+% \fi\fi
+% \global\let\appliedfigurexscale\scax
+% \global\let\appliedfigureyscale\scay}%
+% \global\wd\foundexternalfigure\figwid
+% \finalizeexternalfigure{#2}{\expandedfigurename}}
+
+\newif\ifgridfigure
+
+% \def\calculateexternalfigure[#1][#2][#3][#4][#5][#6]%
+% {\mindermeldingen
+% \setupexternalfigures
+% \the\externalfigureresets % hook, see resource libraries
+% \global\figwid\zeropoint \figxsca\plusone % see note *
+% \global\fighei\zeropoint \figysca\plusone % see note *
+% \global\setbox\foundexternalfigure\box\voidb@x
+% % get rid of active / and : as well as expand for [\get...] cases
+% \sanitizefilename#3\to\expandedfigurename
+% % nil path search in case of path spec
+% \expanded{\checkfilename{\expandedfigurename}}%
+% \ifcase\kindoffile\else \let\figurepathlist\empty \fi
+% \expandafter\beforesplitstring\expandedfigurename\at.\to\@@effilename
+% \expandafter\aftersplitstring \expandedfigurename\at.\to\@@efextension
+% \doifelse\@@effilename{mprun}
+% {\edef\@@effilepref{\bufferprefix}}
+% {\let \@@effilepref\empty}%
+% \edef\@@effilename{\@@effilepref\@@effilename}%
+% \restorecatcodes % recently added; we presume local use
+% \def\@@eflabel{#2}%
+% \global\let\externalfigurelog\empty
+% \getparameters
+% [\??ep]
+% [\c!e=\s!unknown,
+% %\c!w=15\korpsgrootte,\c!h=10\korpsgrootte,
+% \c!w=8\lineheight,\c!h=6\lineheight,
+% \c!x=\!!zeropoint,\c!y=\!!zeropoint,
+% \c!t=,\c!s=,\c!a=,\c!f=\@@effilename]%
+% \getparameters
+% [\??ef]
+% [\c!type=\s!unknown,\c!methode=\@@eftype,\c!symbool=\v!nee,
+% \c!object=\@@exobject,\c!preset=\v!ja,
+% \c!pagina=0,\c!sturing=\v!nee,\c!preview=\v!nee,\c!herhaal=\v!nee,
+% \c!maxbreedte=\@@exmaxbreedte,\c!maxhoogte=\@@exmaxhoogte,
+% \c!schaal=,\c!breedte=,\c!hoogte=,\c!scherm=,\c!regels=,\c!grid=,
+% %\c!voorgrondkleur=,
+% \c!splitsen=,
+% \c!factor=,\c!hfactor=,\c!bfactor=]%
+% \doif\@@efextension\c!mov\presetfiguremov
+% \doif\@@efextension\c!avi\presetfigureavi
+% #1[#4][#5][#6]%
+% % lines -> height
+% \checkfiguresettings
+% % new, color separation
+% \doifseparatingcolorselse
+% {\let\@@efvoorgrondkleur\empty
+% \doifelsenothing\@@efsplitsen
+% {\chardef\splitexternalfigure0}
+% {\doifcolorchannelelse\@@efsplitsen
+% {\let\@@efobject\v!nee % ?
+% \chardef\splitexternalfigure1}
+% {\chardef\splitexternalfigure2}}}
+% {\chardef\splitexternalfigure0}%
+% \relax % ends \chardef
+% % new, fake color in gray bitmaps
+% \doifsomething\@@efvoorgrondkleur
+% {\getparameters[\??ef]
+% [\c!achtergrond={\v!voorgrond,\v!kleur},
+% \c!achtergrondkleur=\@@efvoorgrondkleur]}%
+% %
+% \doif\@@efreset\v!ja \resetexternalfigures
+% \doif\@@eftype \c!mov\presetfiguremov
+% \doif\@@eftype \c!avi\presetfigureavi
+% % hack
+% \doif\@@efmethode\c!mov
+% {\doifsomething\@@efextension{\presetundefinedfigure\@@efextension}}%
+% %
+% \doif\@@eftype\v!buffer
+% {\ifx\@@efextension\empty
+% \let\@@efextension\c!tmp
+% \fi
+% \let\@@eftype\c!tex}%
+% \@EA\doifnumberelse\@EA{\@@efextension} % new, test first
+% {\def\@@eftype{\c!mps}}
+% {\processaction
+% [\@@efextension]
+% [ \c!tex=>\let\@@eftype\c!tex,
+% \c!tmp=>\let\@@eftype\c!tex
+% \edef\@@effilepref{\bufferprefix}%
+% \edef\@@effilename{\@@effilepref\@@effilename},
+% \c!avi=>\presetfigureavi,
+% \c!mov=>\presetfiguremov]}%
+% \edef\figuretypes{\figuretypes,\c!tex}%
+% \ifx\@@eftype\c!tex
+% % Since tex code can have positional stuff and worse,
+% % we want to avoid interference with how objects end
+% % up in files, therefore:
+% \let\@@efobject\v!nee
+% \fi
+% \edef\@@efobjectname{\@@effilename-\@@eftype-\@@efextension-\@@efpagina}%
+% \doifelse\@@efobject\v!nee
+% \donefalse
+% {\doifspecialavailableelse\dostartscaling
+% {\doifobjectssupportedelse
+% {\doifobjectfoundelse{FIG}\@@efobjectname\donetrue\donefalse}
+% \donefalse}
+% \donefalse}%
+% % redo message, only filename
+% \doifparentfileelse\@@effilename
+% {\@EA\removefromcommalist\@EA{\jobsuffix}\figuretypes
+% \let\@@efextension\empty
+% \showmessage\m!figures9\@@effilename
+% \donefalse}
+% \donothing
+% \ifdone
+% \getobjectdimensions{FIG}\@@efobjectname
+% \geteparameters % e !
+% [\??ep]
+% [\c!x=\!!zeropoint,\c!y=\!!zeropoint,
+% \c!w=\objectwidth,\c!h=\objectheight]%
+% \chardef\figurestatus=5
+% \edef\@@effullname{\@@effilepref\expandedfigurename}%
+% \else
+% \doifelse{#2}\s!figurepreset
+% {\def\figureextension##1{\@@efextension}%
+% \edef\@@effullname{\@@effilepref\expandedfigurename}}%
+% {\ifx\@@efextension\empty
+% \dogetcommacommandelement1\from\@@eftype\to\commalistelement
+% \edef\@@effullname{\@@effilename.\commalistelement}%
+% \def\figureextension##1{##1}%
+% \else
+% \@EA\doifnumberelse\@EA{\@@efextension}
+% {\let\@@eftype\c!mps}\donothing
+% \edef\@@effullname{\@@effilename.\@@efextension}%
+% \def\figureextension##1{\@@efextension}%
+% \fi}%
+% \doifelse\@@efpreset\v!nee
+% {\doifelse\@@eftype\s!unknown
+% {\chardef\figurestatus0
+% \let\@@eftype\figuretypes
+% \locatepresetfigurefiles}
+% {\chardef\figurestatus1 }}
+% {\doifelse\@@eftype\s!unknown
+% {\let\@@eftype\figuretypes}
+% {\@EA\removefromcommalist\@EA{\@@eftype}\figuretypes
+% \edef\@@eftype{\ifx\@@eftype\empty\else\@@eftype,\fi\figuretypes}}%
+% \ifx\@@efextension\empty\else
+% \ExpandBothAfter\doifinsetelse\@@efextension\@@eftype
+% {\@EA\removefromcommalist\@EA{\@@efextension}\@@eftype
+% \edef\@@eftype{\@@efextension,\@@eftype}}%
+% \donothing
+% \fi
+% \doifelse{#2}\s!figurepreset
+% {\chardef\figurestatus4
+% %\def\@@efloadname{\f!currentpath\f!pathseparator\@@exfile}%
+% \assignfullfilename\f!currentpath\@@exfile\to\@@efloadname
+% \let\@@eftype\@@epe}
+% {\chardef\figurestatus\zerocount
+% \analyzefigurefiles}}%
+% \let\@@epe\@@eftype
+% \edef\@@efextension{\figureextension{\@@eftype}}% dirty trick
+% \global\figwid\zeropoint \figxsca\plusone
+% \global\fighei\zeropoint \figysca\plusone
+% \doif\v!kader\@@exoptie
+% {\let\@@efkader\v!aan}%
+% \fi
+% \ifcase\figurestatus
+% \let\@@efkader\v!aan
+% \let\@@efobject\v!nee
+% \showmessage\m!figures1{\@@effilename}%
+% \or
+% \showmessage\m!figures2{\@@effullname}%
+% \or
+% \showmessage\m!figures3{\@@effullname,\@@eflenttype}%
+% \or
+% \showmessage\m!figures4{\@@effullname}%
+% \or
+% \showmessage\m!figures5{\@@effullname,\@@efloadname}%
+% \or % no message
+% \doifnot\@@efsymbool\v!ja
+% {\showmessage\m!figures8{\@@effullname}}%
+% \fi
+% \ifdim\@@epw=\zeropoint \chardef\figurestatus1 \fi
+% \ifdim\@@eph=\zeropoint \chardef\figurestatus1 \fi
+% \global\gridfigurefalse
+% \ifnum\figurestatus=1 % unknown dimensions, take width or height or scale
+% \setnaturalfiguresize
+% \xdef\naturalfigurewidth{\the\figwid}%
+% \xdef\naturalfigureheight{\the\fighei}%
+% \let\@@efkader\v!uit
+% \else
+% \global\let\naturalfigurewidth\@@epw
+% \global\let\naturalfigureheight\@@eph
+% \setfactorfiguresize
+% \setscalefiguresize
+% \setdimensionfiguresize
+% \processaction
+% [\@@efgrid]
+% [ \v!ja=>\getnoflines\fighei
+% \edef\@@efhoogte{\the\noflines\lineheight}%
+% \global\gridfiguretrue,
+% \v!hoogte=>\getrawnoflines\fighei
+% \scratchdimen\noflines\lineheight
+% \advance\scratchdimen\strutdepth
+% \edef\@@efhoogte{\the\scratchdimen}%
+% \global\gridfiguretrue,
+% \v!passend=>\getrawnoflines\fighei
+% \edef\@@efhoogte{\the\noflines\lineheight}%
+% \global\gridfiguretrue]%
+% \ifgridfigure
+% \setfactorfiguresize
+% \setscalefiguresize
+% \setdimensionfiguresize
+% \fi
+% \fi
+% \convertfigureinsertscale\@@epx\figx\figxsca\scax
+% \convertfigureinsertscale\@@epy\figy\figysca\scay
+% \iftraceexternalfigures
+% \message
+% {\externalfigurelog
+% [\@@effullname:
+% t={\@@eftype}\space m={\@@efmethode}\space l=\@@eflabel\space
+% w=\number\figwid\space h=\number\fighei\space
+% \c!sx=\scax\space\c!sy=\scay\space
+% ox=\figx\space oy=\figy]}%
+% \fi
+% \doif\v!leeg\@@exoptie
+% {\skipexternalfigurestrue
+% \let\@@efkader\v!uit}% ? ?
+% \doifelsenothing\@@efpagina % NIEUW ??
+% {\let\@@efoptions\empty}
+% {\let\@@efoptions\@@efpagina}%
+% \doif\@@efpreview\v!ja{\addtocommalist\v!preview\@@efoptions}%
+% \doif\@@efsturing\v!ja{\addtocommalist\v!sturing\@@efoptions}%
+% \doif\@@efherhaal\v!ja{\addtocommalist\v!herhaal\@@efoptions}%
+% \doif\@@eftype\c!mps
+% {\ifcase\EPSspecial\else\ifinobject\else
+% \@@eftrace{special mps, object forced}%
+% \doglobal\increment\forcedMPSobject
+% \edef\@@efobjectname{\c!mps::\forcedMPSobject}%
+% \let\@@efobject\v!ja
+% \fi\fi}%
+% \global\let\lastfigureobjectname\@@efobjectname
+% \doifelse\@@efobject\v!nee
+% \donefalse
+% {\doifobjectssupportedelse\donetrue\donefalse}%
+% \ifdone
+% \doifobjectfoundelse{FIG}\@@efobjectname
+% \donothing
+% {\bgroup % to be cleaned up
+% \figwid\@@epw % local ?
+% \fighei\@@eph % local ?
+% \scratchdimen\@@epx\scratchdimen-\scratchdimen
+% \edef\@@epx{\the\scratchdimen}%
+% \scratchdimen\@@epy\scratchdimen-\scratchdimen
+% \edef\@@epy{\the\scratchdimen}%
+% %\scratchdimen\@@epw\edef\@@epw{\the\scratchdimen}%
+% %\scratchdimen\@@eph\edef\@@eph{\the\scratchdimen}%
+% \setbox0\vbox to \fighei
+% {\vfill
+% \ifdim\wd\foundexternalfigure=\zeropoint
+% \doinsertfile
+% {\@@eftype,\@@efmethode}{\@@effullname,\@@eflabel}
+% {100}{100}\@@epx\@@epy\@@epw\@@eph\@@efoptions
+% \else\ifskipexternalfigures
+% \ruledhbox
+% {\backgroundline
+% [\@@efsplitskleur]{\fakebox\foundexternalfigure}}%
+% \else
+% \box\foundexternalfigure
+% \fi\fi}%
+% \wd0=\figwid
+% \setobject{FIG}\@@efobjectname\vbox{\box0}%
+% \setxvalue{\@@efobjectname\c!n}{\number\nofinsertpages}%
+% \egroup}%
+% \fi
+% \xdef\figurewidth {\the\figwid}%
+% \xdef\figureheight{\the\fighei}%
+% \global\setbox\foundexternalfigure\vbox to \fighei
+% {\vfill
+% \hsize\figwid
+% \ifdone
+% \scratchdimen\scax\points\divide\scratchdimen \plushundred
+% \edef\scax{\@EA\withoutpt\the\scratchdimen}%
+% \scratchdimen\scay\points\divide\scratchdimen \plushundred
+% \edef\scay{\@EA\withoutpt\the\scratchdimen}%
+% \schaal[\c!sx=\scax,\c!sy=\scay]{\dowithfigure{\getobject{FIG}{\@@efobjectname}}}%
+% \xdef\noffigurepages{\number\getvalue{\@@efobjectname\c!n}}%
+% \else\ifdim\wd\foundexternalfigure=\zeropoint
+% \dowithfigure
+% {\doinsertfile
+% {\@@eftype,\@@efmethode}{\@@effullname,\@@eflabel}
+% \scax\scay\figx\figy\figwid\fighei\@@efoptions}%
+% \xdef\noffigurepages{\number\nofinsertpages}%
+% \else
+% \scratchdimen\scax\points\divide\scratchdimen \plushundred
+% \edef\scax{\@EA\withoutpt\the\scratchdimen}%
+% \scratchdimen\scay\points\divide\scratchdimen \plushundred
+% \edef\scay{\@EA\withoutpt\the\scratchdimen}%
+% \schaal[\c!sx=\scax,\c!sy=\scay]{\dowithfigure{\box\foundexternalfigure}}%
+% \xdef\noffigurepages{\number\nofinsertpages}%
+% \fi\fi
+% \global\let\appliedfigurexscale\scax
+% \global\let\appliedfigureyscale\scay}%
+% \global\wd\foundexternalfigure\figwid
+% \finalizeexternalfigure{#2}{\expandedfigurename}}
+
\def\calculateexternalfigure[#1][#2][#3][#4][#5][#6]%
{\mindermeldingen
\setupexternalfigures
@@ -1001,16 +1572,14 @@
\let\@@eftype\c!tex}%
\@EA\doifnumberelse\@EA{\@@efextension} % new, test first
{\def\@@eftype{\c!mps}}
- {%
- \processaction
+ {\processaction
[\@@efextension]
[ \c!tex=>\let\@@eftype\c!tex,
\c!tmp=>\let\@@eftype\c!tex
\edef\@@effilepref{\bufferprefix}%
\edef\@@effilename{\@@effilepref\@@effilename},
\c!avi=>\presetfigureavi,
- \c!mov=>\presetfiguremov]%
- }%
+ \c!mov=>\presetfiguremov]}%
\edef\figuretypes{\figuretypes,\c!tex}%
\ifx\@@eftype\c!tex
% Since tex code can have positional stuff and worse,
@@ -1034,7 +1603,7 @@
\donefalse}
\donothing
\ifdone
- \getobjectdimensions{FIG}{\@@efobjectname}%
+ \getobjectdimensions{FIG}\@@efobjectname
\geteparameters % e !
[\??ep]
[\c!x=\!!zeropoint,\c!y=\!!zeropoint,
@@ -1103,6 +1672,7 @@
\fi
\ifdim\@@epw=\zeropoint \chardef\figurestatus1 \fi
\ifdim\@@eph=\zeropoint \chardef\figurestatus1 \fi
+ \global\gridfigurefalse
\ifnum\figurestatus=1 % unknown dimensions, take width or height or scale
\setnaturalfiguresize
\xdef\naturalfigurewidth{\the\figwid}%
@@ -1114,6 +1684,34 @@
\setfactorfiguresize
\setscalefiguresize
\setdimensionfiguresize
+ \processaction
+ [\@@efgrid]
+ [ \v!ja=>\getnoflines\fighei
+ \edef\@@efhoogte{\the\noflines\lineheight}%
+ \global\gridfiguretrue,
+ \v!hoogte=>\getrawnoflines\fighei
+ \scratchdimen\noflines\lineheight
+ \advance\scratchdimen\strutdepth
+ \edef\@@efhoogte{\the\scratchdimen}%
+ \global\gridfiguretrue,
+ \v!diepte=>\getrawnoflines\fighei
+ \scratchdimen\noflines\lineheight
+ \advance\scratchdimen-\strutdepth
+ \edef\@@efhoogte{\the\scratchdimen}%
+ \global\gridfiguretrue,
+ \v!halveregel=>\getrawnoflines\fighei
+ \scratchdimen\noflines\lineheight
+ \advance\scratchdimen+.5\lineheight
+ \edef\@@efhoogte{\the\scratchdimen}%
+ \global\gridfiguretrue,
+ \v!passend=>\getrawnoflines\fighei
+ \edef\@@efhoogte{\the\noflines\lineheight}%
+ \global\gridfiguretrue]%
+ \ifgridfigure
+ \setfactorfiguresize
+ \setscalefiguresize
+ \setdimensionfiguresize
+ \fi
\fi
\convertfigureinsertscale\@@epx\figx\figxsca\scax
\convertfigureinsertscale\@@epy\figy\figysca\scay
@@ -1182,11 +1780,12 @@
{\vfill
\hsize\figwid
\ifdone
- \scratchdimen\scax\s!pt\divide\scratchdimen \plushundred
+ \scratchdimen\scax\points\divide\scratchdimen \plushundred
\edef\scax{\@EA\withoutpt\the\scratchdimen}%
- \scratchdimen\scay\s!pt\divide\scratchdimen \plushundred
+ \scratchdimen\scay\points\divide\scratchdimen \plushundred
\edef\scay{\@EA\withoutpt\the\scratchdimen}%
- \schaal[\c!sx=\scax,\c!sy=\scay]{\dowithfigure{\getobject{FIG}{\@@efobjectname}}}%
+ %\schaal[\c!sx=\scax,\c!sy=\scay]{\dowithfigure{\getobject{FIG}{\@@efobjectname}}}%
+ \doscalenextbox\scax\scay\figwid\fighei{\dowithfigure{\getobject{FIG}{\@@efobjectname}}}%
\xdef\noffigurepages{\number\getvalue{\@@efobjectname\c!n}}%
\else\ifdim\wd\foundexternalfigure=\zeropoint
\dowithfigure
@@ -1195,11 +1794,12 @@
\scax\scay\figx\figy\figwid\fighei\@@efoptions}%
\xdef\noffigurepages{\number\nofinsertpages}%
\else
- \scratchdimen\scax\s!pt\divide\scratchdimen \plushundred
+ \scratchdimen\scax\points\divide\scratchdimen \plushundred
\edef\scax{\@EA\withoutpt\the\scratchdimen}%
- \scratchdimen\scay\s!pt\divide\scratchdimen \plushundred
+ \scratchdimen\scay\points\divide\scratchdimen \plushundred
\edef\scay{\@EA\withoutpt\the\scratchdimen}%
- \schaal[\c!sx=\scax,\c!sy=\scay]{\dowithfigure{\box\foundexternalfigure}}%
+ %\schaal[\c!sx=\scax,\c!sy=\scay]{\dowithfigure{\box\foundexternalfigure}}%
+ \doscalenextbox\scax\scay\figwid\fighei{\dowithfigure{\box\foundexternalfigure}}%
\xdef\noffigurepages{\number\nofinsertpages}%
\fi\fi
\global\let\appliedfigurexscale\scax
@@ -1207,18 +1807,32 @@
\global\wd\foundexternalfigure\figwid
\finalizeexternalfigure{#2}{\expandedfigurename}}
+\def\doscalenextbox#1#2#3#4% for the moment here, faster
+ {\bgroup
+ \dowithnextbox
+ {\dontshowcomposition
+ \setbox\nextbox\hbox
+ {\smashbox\nextbox
+ \dostartscaling#1#2\flushnextbox\dostopscaling}%
+ \nextboxwd#3%
+ \nextboxht#4%
+ \nextboxdp\zeropoint
+ \flushnextbox
+ \egroup}
+ \hbox}
+
\let\figurelabel \empty
\let\figurefilename\empty
\let\figurefiletype\empty
\let\figurefilepage\empty
\def\finalizeexternalfigure#1#2%
- {\pushmacro\figurewidth
- \pushmacro\figureheight
- \pushmacro\figurelabel
- \pushmacro\figurefilename
- \pushmacro\figurefiletype
- \pushmacro\figurefilepage
+ {\globalpushmacro\figurewidth
+ \globalpushmacro\figureheight
+ \globalpushmacro\figurelabel
+ \globalpushmacro\figurefilename
+ \globalpushmacro\figurefiletype
+ \globalpushmacro\figurefilepage
\xdef\figurewidth {\the\figwid}%
\xdef\figureheight {\the\fighei}%
\xdef\figurelabel {#1}%
@@ -1275,12 +1889,12 @@
\fi}}%
\fi\fi\fi
\fi}%
- \popmacro\figurefilepage
- \popmacro\figurefiletype
- \popmacro\figurefilename
- \popmacro\figurelabel
- \popmacro\figureheight
- \popmacro\figurewidth}
+ \globalpopmacro\figurefilepage
+ \globalpopmacro\figurefiletype
+ \globalpopmacro\figurefilename
+ \globalpopmacro\figurelabel
+ \globalpopmacro\figureheight
+ \globalpopmacro\figurewidth}
\def\externalfigurereplacement#1#2#3%
{\setupcolors
@@ -1722,7 +2336,7 @@
\def\colorbar##1[##2]%
{}%
\position(0,0){\box0}%
- \linewidth1pt
+ \linewidth\onepoint
\setuppositioning
[\c!eenheid=pt,
\c!xschaal=\withoutpt{\the\efxsteps},
@@ -1741,7 +2355,7 @@
\box\colorbarbox}}
\def\dodostartfigure[#1][#2][#3]#4\stopfigure
- {\doifelse{\v!test}{\@@exoptie}
+ {\doifelse\v!test\@@exoptie
{\teststartfigure[#1][#2][#3]#4\teststopfigure
\let\@@exhokjes\v!aan}
{\let\@@exhokjes\v!uit}%
@@ -1788,7 +2402,7 @@
\c!xschaal=\withoutpt{\the\efxsteps},
\c!yschaal=\withoutpt{\the\efysteps},
\c!factor=1]%
- \linewidth1pt
+ \linewidth\onepoint
\ignorespaces#4\relax
\stoppositioning
\vfill}%
@@ -1817,19 +2431,29 @@
\vtop{\vskip12pt\box2\vskip6pt}}%
\endgroup}
-\def\dodostartfigure[#1][#2][#3]#4\stopfigure%
+% \def\dodostartfigure[#1][#2][#3]#4\stopfigure
+% {\doifelse\v!test\@@exoptie
+% {\teststartfigure[#1][#2][#3]#4\teststopfigure
+% \let\@@exhokjes\v!aan}
+% {\let\@@exhokjes\v!uit}%
+% \setvalue{\??ef\??ef#1}%
+% {\dosingleempty{\placestartfigure[#1][#2][#3]#4\placestopfigure}}%
+% \doifundefined{#1}{\setvalue{#1}{\getexternalfigure{#1}}}}
+
+\def\dodostartfigure[#1][#2][#3]#4\stopfigure
{\doifelse\v!test\@@exoptie
{\teststartfigure[#1][#2][#3]#4\teststopfigure
\let\@@exhokjes\v!aan}
{\let\@@exhokjes\v!uit}%
\setvalue{\??ef\??ef#1}%
- {\dosingleempty{\placestartfigure[#1][#2][#3]#4\placestopfigure}}%
+ {\def\next{\placestartfigure[#1][#2][#3]#4\placestopfigure}%
+ \dosingleempty\next}%
\doifundefined{#1}{\setvalue{#1}{\getexternalfigure{#1}}}}
\long\def\dostartfigure#1%
{\dotripleargument\dodostartfigure#1\stopfigure}
-\def\startfigure%
+\def\startfigure
{\grabuntil{\e!stop\v!figuur}\dostartfigure}
%D \macros
diff --git a/tex/context/base/core-fil.tex b/tex/context/base/core-fil.tex
index ca5f3056a..8acbd878e 100644
--- a/tex/context/base/core-fil.tex
+++ b/tex/context/base/core-fil.tex
@@ -8,8 +8,8 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
\writestatus{loading}{Context Core Macros / File Support}
@@ -17,15 +17,15 @@
% NOT YET DOCUMENTED !!
%
-% overal \normalinput
-
+% overal \normalinput
+
\startmessages dutch library: files
- title: files
+ title: files
1: file synoniem -- is al in gebruik voor --
\stopmessages
\startmessages english library: files
- title: files
+ title: files
1: file synonym -- is already used for --
\stopmessages
@@ -45,7 +45,7 @@
\stopmessages
\startmessages norwegian library: files
- title: filer
+ title: filer
1: filesynonym -- er allerede brukt for --
\stopmessages
@@ -54,28 +54,28 @@
1: sinonimul fisierelor -- este folosit deja pentru --
\stopmessages
-%D \macros
+%D \macros
%D {definefilesynonym}
%D
-%D One of the problems with loading files is that their names
-%D can depend on the interface language. We therefore need a
-%D method to define filesynonyms. The actual synonyms are
+%D One of the problems with loading files is that their names
+%D can depend on the interface language. We therefore need a
+%D method to define filesynonyms. The actual synonyms are
%D defined elsewhere, but look like:
-%D
+%D
%D \starttypen
%D \definefilesynonym [chemic] [chemie]
%D \definefilesynonym [einheit] [eenheid]
%D \definefilesynonym [unit] [eenheid]
%D \stoptypen
-%D
+%D
%D So we can say in english:
-%D
+%D
%D \starttypen
%D \usemodules[pictex,chemic,unit]
%D \stoptypen
-%D
+%D
%D and in dutch:
-%D
+%D
%D \starttypen
%D \usemodules[pictex,chemie,eenheid]
%D \stoptypen
@@ -85,23 +85,23 @@
\def\dodefinefilesynonym[#1][#2]%
{\doifdefined{\??fs#1}
- {\doifnotvalue{\??fs#1}{#2}
+ {\doifnotvalue{\??fs#1}{#2}
{\showmessage\m!files1{#1 (#2),\getvalue{\??fs#1}}}}%
\doifelse{#1}{#2}
{\letbeundefined{\??fs#1}{#2}}
{\setevalue{\??fs#1}{#2}}}
-
-%D \macros
+
+%D \macros
%D {truefilename}
%D
-%D At the system level such a filename can be called upon by
+%D At the system level such a filename can be called upon by
%D saying:
-%D
+%D
%D \starttypen
%D \truefilename{filename/filesynonym}
%D \stoptypen
-%D
-%D The implementation shows that nesting is supported.
+%D
+%D The implementation shows that nesting is supported.
\def\truefilename#1%
{\ifundefined{\??fs#1}%
@@ -114,7 +114,7 @@
%D {makeshortfilename}
%D
%D To prevent cross platform problems with filenames, we
-%D lowercase them as well as only use the first 8~characters.
+%D lowercase them as well as only use the first 8~characters.
\def\domakeshortfilename[#1#2#3#4#5#6#7#8#9]%
{\lowercase{\edef\shortfilename{#1#2#3#4#5#6#7#8.}}%
@@ -126,24 +126,24 @@
%D \macros
%D {usemodule}
-%D
+%D
%D Most of \CONTEXT is preloaded in the format file. Some very
%D domain specific typesetting topics are however dealt with in
%D separate modules, e.g. typesetting of chemical structure
-%D formulas. These modules are loaded by:
-%D
+%D formulas. These modules are loaded by:
+%D
%D \showsetup{\y!usemodule}
-%D
+%D
%D More information on the specific modules can be found in
-%D their dedicated manuals. We use \type {\next} so that we
-%D can \type {\end} in modules.
+%D their dedicated manuals. We use \type {\next} so that we
+%D can \type {\end} in modules.
\newconditional\moduleisloaded
-\def\dododousemodules#1#2% no \unprotect/\protect when loading,
- {\relax % since we need to use ? ! unprotected
+\def\dododousemodules#1#2% no \unprotect/\protect when loading,
+ {\relax % since we need to use ? ! unprotected
\ifconditional\moduleisloaded % sometimes (see xtag-map)
- \let\next\relax
+ \let\next\relax % or: \expandafter\gobbleoneargument
\else
\makeshortfilename[#1\truefilename{#2}]%
\doifelseflagged\shortfilename
@@ -159,16 +159,16 @@
\stopreadingfile}}%
\fi
\next}
-
-\def\dodousemodules#1#2%
- {\setfalse\moduleisloaded
+
+\def\dodousemodules#1#2%
+ {\setfalse\moduleisloaded
\doifelsenothing{#1}
- {\dododousemodules\f!moduleprefix {#2}%
+ {\dododousemodules\f!moduleprefix {#2}%
\dododousemodules\f!privateprefix{#2}%
\dododousemodules\f!styleprefix {#2}%
\dododousemodules\f!xstyleprefix {#2}%
\dododousemodules\f!thirdprefix {#2}%
- \dododousemodules\empty {#2}}% new, fall back on raw name
+ \dododousemodules\empty {#2}}% new, fall back on raw name
{\dododousemodules{#1-}{#2}}%
\ifconditional\moduleisloaded\else
\showmessage\m!systems6{#2}%
@@ -191,33 +191,33 @@
% \usemodule[t][speech]
-%D We also support a singular call, which saves us for
+%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 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 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.
+%D the same time.
\newif\ifprotectbuffers
\def\bufferprefix{\ifprotectbuffers\jobname-\fi}
-% The following filenames are defined here:
+% The following filenames are defined here:
\def\TEXbufferfile #1{\bufferprefix#1.\f!temporaryextension}
\def\MPgraphicfile {\bufferprefix mp\ifMPrun run\else graph\fi}
\def\convertMPcolorfile{\bufferprefix metacmyk.tmp}
-%D The next few macros ar eused for some internal (rather
+%D The next few macros ar eused for some internal (rather
%D old already) extensions.
\def\definieerfilegroep
@@ -243,13 +243,13 @@
{\getvalue{\e!stop#1#2}%
\getvalue{\??fp#1\c!na}}
-%D To save memory, we implement some seldomly used commands
-%D in a lazy way. Nota bene: such runtime definitions are
-%D global.
+%D To save memory, we implement some seldomly used commands
+%D in a lazy way. Nota bene: such runtime definitions are
+%D global.
%D
-%D \starttypen
+%D \starttypen
%D \fetchruntimecommand\showaccents{\f!encodingprefix ...}
-%D \stoptypen
+%D \stoptypen
\def\fetchruntimecommand#1#2%
{\def#1{\dofetchruntimecommand#1{#2}}}
@@ -259,15 +259,15 @@
{\let#1\undefined
\startreadingfile
\startnointerference % \bgroup
- \cleanupfeatures % better \setnormalcatcodes / test first
+ \cleanupfeatures % better \setnormalcatcodes / test first
\readfile{#2}\donothing\donothing
\stopnointerference % \egroup
\stopreadingfile
- \doglobal\setflag{#2}}%
+ \doglobal\setflag{#2}}%
\ifx#1\undefined
\writestatus{\m!systems}{command \string#1 not found in file #2}%
\def#1{{\infofont[unknown command \string#1]}}%
- \fi
+ \fi
#1}
%D To be documented and probably moved
@@ -279,6 +279,6 @@
\stelexternebronnenin[url=]
-%D This module will be perfected / changed / weeded.
-
+%D This module will be perfected / changed / weeded.
+
\protect \endinput
diff --git a/tex/context/base/core-fld.tex b/tex/context/base/core-fld.tex
index c67342c0f..a9b1649fc 100644
--- a/tex/context/base/core-fld.tex
+++ b/tex/context/base/core-fld.tex
@@ -8,21 +8,21 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
-% \appendtocommalist versus \addtocommalist
+% \appendtocommalist versus \addtocommalist
%
-% * as default trigger in radiofields ?
+% * as default trigger in radiofields ?
%
-% beware: weblink plugin truncates on length, while save as doesn't;
-% more precise: (1) first time right string is sent, (2)
-% internal string truncated, (3) second time truncated
-% string is sent.
+% beware: weblink plugin truncates on length, while save as doesn't;
+% more precise: (1) first time right string is sent, (2)
+% internal string truncated, (3) second time truncated
+% string is sent.
\writestatus{loading}{Context Field Macros}
-% messages
+% messages
\definemessageconstant{fields}
@@ -37,12 +37,12 @@
{\checkobjectreferences
\doifobjectfoundelse{SYM}{#1}
{}
- {\settightobject{SYM}{#1}\hbox{\symbol[#1]}%
+ {\settightobject{SYM}{#1}\hbox{\symbol[#1]}%
\flushatshipout
{\setbox0\hbox{\hskip-\maxdimen\getobject{SYM}{#1}}%
\smashbox0\box0}}}
-\def\presetfieldsymbols[#1]% slow
+\def\presetfieldsymbols[#1]% slow
{\def\dopresetfieldsymbols##1%
{\processcommalist[##1]\dopresetfieldsymbol}%
\@EA\processcommalist\@EA[#1]\dopresetfieldsymbols}
@@ -51,17 +51,17 @@
{\definesymbol[defaultyes][$\times$]%
\definesymbol[defaultno][$\cdot$]}
-\def\resetfieldsymbol[#1]% for experimental usage only
+\def\resetfieldsymbol[#1]% for experimental usage only
{\resetobject{SYM}{#1}}
-%D The interface to the specials. DEFAULT NOG ANDERS
+%D The interface to the specials. DEFAULT NOG ANDERS
\def\presetlinefield
{\dopresetlinefield
{\@@FieldName}
{\@@FieldWidth}
{\@@FieldHeight}
- {\@@FieldDefault}
+ {\@@FieldDefault}
{\@@fdn}
{\@@fdletter,\@@fdkleur,\@@fdveldachtergrondkleur,\@@fdveldkaderkleur}
{\@@fdoptie}
@@ -74,7 +74,7 @@
{\@@FieldName}
{\@@FieldWidth}
{\@@FieldHeight}
- {\@@FieldDefault}
+ {\@@FieldDefault}
{\@@fdn}
{\@@fdletter,\@@fdkleur,\@@fdveldachtergrondkleur,\@@fdveldkaderkleur}
{\@@fdoptie}
@@ -87,7 +87,7 @@
{\@@FieldName}
{\@@FieldWidth}
{\@@FieldHeight}
- {\@@FieldDefault}
+ {\@@FieldDefault}
{\@@fdletter,\@@fdkleur,\@@fdveldachtergrondkleur,\@@fdveldkaderkleur}
{\@@fdoptie}
{\@@FieldValues}
@@ -99,7 +99,7 @@
{\@@FieldName}
{\@@FieldWidth}
{\@@FieldHeight}
- {\@@FieldDefault}
+ {\@@FieldDefault}
{\@@fdletter,\@@fdkleur,\@@fdveldachtergrondkleur,\@@fdveldkaderkleur}
{\@@fdoptie}
{\@@FieldValues}
@@ -111,7 +111,7 @@
{\@@FieldName}
{\@@FieldWidth}
{\@@FieldHeight}
- {\@@FieldDefault}
+ {\@@FieldDefault}
{\@@fdletter,\@@fdkleur,\@@fdveldachtergrondkleur,\@@fdveldkaderkleur}
{\@@fdoptie}
{\@@FieldValues}
@@ -124,7 +124,7 @@
{\@@FieldName}
{\@@FieldWidth}
{\@@FieldHeight}
- {\@@FieldDefault}
+ {\@@FieldDefault}
{\@@fdoptie}
{\@@FieldValues}
{\@@fdklikin,\@@fdklikuit,\@@fdgebiedin,\@@fdgebieduit,\@@fdnatoets,%
@@ -137,7 +137,7 @@
{\@@FieldName}
{\@@FieldWidth}
{\@@FieldHeight}
- {\@@FieldDefault}
+ {\@@FieldDefault}
{\@@fdoptie}
{\@@FieldValues}
{\@@fdklikin,\@@fdklikuit,\@@fdgebiedin,\@@fdgebieduit,\@@fdnatoets,%
@@ -149,7 +149,7 @@
{\@@FieldName}
{\@@FieldWidth}
{\@@FieldHeight}
- {\@@FieldDefault}
+ {\@@FieldDefault}
{\@@fdoptie}
{\@@FieldRoot}
{\@@FieldValues}
@@ -159,29 +159,29 @@
\def\presetradiorecord
{\dopresetradiorecord
{\@@FieldName}
- {\@@FieldDefault}
+ {\@@FieldDefault}
{\@@fdoptie}
{\@@FieldKids}
{\@@fdklikin,\@@fdklikuit,\@@fdgebiedin,\@@fdgebieduit,\@@fdnatoets,%
\@@fdformatteer,\@@fdvalideer,\@@fdbereken,\@@fdfocusin,\@@fdfocusuit}}
\def\setfieldmodes#1#2#3%
- {\xdef\@@FieldMode{#1}% % 0 1 2 3
- \xdef\@@FieldFree{#2}% % 0 1
- \xdef\@@FieldAuto{#3}} % 0 1
+ {\xdef\@@FieldMode{#1}% % 0 1 2 3
+ \xdef\@@FieldFree{#2}% % 0 1
+ \xdef\@@FieldAuto{#3}} % 0 1
\newevery\everysetfield\relax
\def\doiffieldelse#1{\doifdefinedelse{fielddata#1}}
-\def\setfield#1#2#3#4#5#6#7#8#9%
- {\bgroup
+\def\setfield#1#2#3#4#5#6#7#8#9%
+ {\bgroup
\doglobal\increment\numberoffields
\iftracefields
\doglobal\addtocommalist{#1}\collectedfields
\fi
\the\everysetfield
- \setxvalue{fielddata#1}% kortere tag
+ \setxvalue{fielddata#1}% kortere tag
{\noexpand\dosetfield{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}%
\egroup}
@@ -203,7 +203,7 @@
{\setfield{#1}\@@FieldType\@@FieldRoot\@@FieldParent\@@FieldKids\@@FieldGroup
{\@@FieldMode\@@FieldFree\@@FieldAuto}\@@FieldValues\@@FieldDefault}
-\def\getfield#1% name
+\def\getfield#1% name
{\doifundefinedelse{fielddata#1}
{\dosetfield{#1}\empty\empty\empty\empty\empty{\empty00}\empty\empty}
{\getvalue{fielddata#1}}}
@@ -212,11 +212,11 @@
\let\tracefields\tracefieldstrue
-\def\doshowfields[#1]% todo: tabulate van maken en runtime
+\def\doshowfields[#1]% todo: tabulate van maken en runtime
{\bgroup
\switchtobodyfont[8pt,tt]
\doifsomething{#1}{\def\collectedfields{#1}}
- \ifx\collectedfields\empty
+ \ifx\collectedfields\empty
\par specify [fieldlist] or say \type{\tracefieldstrue} first\par
\else
\def\normalizedfieldmode##1##2##3%
@@ -236,14 +236,14 @@
\fi
\egroup}
-\def\showfields%
+\def\showfields%
{\dosingleempty\doshowfields}
\def\dologfields[#1]%
{\bgroup
\immediate\openout\scratchwrite=fields.log
\doifsomething{#1}{\def\collectedfields{#1}}
- \ifx\colledtedfields\empty
+ \ifx\colledtedfields\empty
\immediate\write\scratchwrite{use \tracefieldstrue}%
\else
\def\normalizedfieldmode##1##2##3%
@@ -251,9 +251,9 @@
{\ifcase##1 loner \or parent \or clone \or copy \fi
\ifcase##2 \else(done)\fi}}
\def\dosetfield##1##2##3##4##5##6##7##8##9%
- {\normalizedfieldmode##7%
- \immediate\write\scratchwrite
- {N=##1 / T=##2 / R=##3 / P=##4 / K=##5 / G=##6 /
+ {\normalizedfieldmode##7%
+ \immediate\write\scratchwrite
+ {N=##1 / T=##2 / R=##3 / P=##4 / K=##5 / G=##6 /
M=\@@FieldMode\space/ V=##8 / D=##9}}%
\processcommacommand[\collectedfields]\getfield
\fi
@@ -263,18 +263,18 @@
\def\logfields
{\dosingleempty\doLogFields}
-%D \starttypen
+%D \starttypen
%D \definefield [name] [type] [group] [values] [default]
%D
%D \definefield [WWWW] [text] [textsetup] [default text]
-%D \definefield [XXXX] [push] [pushsetup] [yes,no] [yes]
+%D \definefield [XXXX] [push] [pushsetup] [yes,no] [yes]
%D \definefield [XXXX] [check] [checksetup] [yes,no] [yes]
%D \definefield [YYYY] [combo] [combosetup] [a,b,c,d] [b]
-%D \definefield [ZZZZ] [radio] [radiosetup] [W,X,Y,Z] [Y]
+%D \definefield [ZZZZ] [radio] [radiosetup] [W,X,Y,Z] [Y]
%D
-%D \definesubfield [W] [subsetup] [p,q]
-%D \definesubfield [X,Y] [subsetup] [p,r]
-%D \definesubfield [Z] [subsetup] [y,z]
+%D \definesubfield [W] [subsetup] [p,q]
+%D \definesubfield [X,Y] [subsetup] [p,r]
+%D \definesubfield [Z] [subsetup] [y,z]
%D
%D evt \definemainfield ... wanneer geplaatst voor subs gegeven
%D
@@ -291,16 +291,16 @@
\newif\ifdefinemainfield \definemainfieldfalse
%D We need to keep track of cloned (related) fields and so by
-%D maintaining lists of field clones.
+%D maintaining lists of field clones.
%D
-%D The first alternative used a two pass data list and was
+%D The first alternative used a two pass data list and was
%D implemented as follows:
%D
%D \starttypen
%D \def\getmainfieldkids#1%
%D {\let\@@FieldKids\empty
-%D \ifdefinemainfield
-%D \definetwopasslist{fld:#1}% defined by system
+%D \ifdefinemainfield
+%D \definetwopasslist{fld:#1}% defined by system
%D \doloop
%D {\gettwopassdata{fld:#1}%
%D \iftwopassdatafound
@@ -311,21 +311,21 @@
%D \fi}%
%D \fi}
%D \stoptypen
-%D
-%D However, the next alternative is much faster when we have
-%D a field with thousands of clones, something not that
+%D
+%D However, the next alternative is much faster when we have
+%D a field with thousands of clones, something not that
%D imaginary.
%D
%D \starttypen
%D \def\getmainfieldkids#1%
%D {\let\@@FieldKids\empty
-%D \ifdefinemainfield
-%D \definerawpasslist{fld:#1}% runtime defined by system
+%D \ifdefinemainfield
+%D \definerawpasslist{fld:#1}% runtime defined by system
%D \moverawpasslist{fld:#1}\@@FieldKids
%D \fi}
%D \stoptypen
-%D
-%D The data is written by file using:
+%D
+%D The data is written by file using:
%D
%D \starttypen
%D \newcounter\nofmainfieldkids
@@ -339,19 +339,19 @@
%D {#2}}}
%D \stoptypen
%D
-%D The trade of of this mechanism is that for each cloned or
-%D copied field, the uitlity file is to be read in order to
+%D The trade of of this mechanism is that for each cloned or
+%D copied field, the uitlity file is to be read in order to
%D fetch the data.
%D
%D The next, much faster alternative uses a dedicated %
-%D reference mechanism.
+%D reference mechanism.
\def\setmainfieldkid#1#2%
{\immediatewriteutilitycommand{\fieldreference{#1}{#2}}}
\def\checkfieldreferences
{\startnointerference
- \protectlabels
+ \protectlabels
\doutilities{fieldreferences}\jobname\empty\relax\relax
\global\let\checkfieldreferences\relax
\stopnointerference}
@@ -370,7 +370,7 @@
\def\getmainfieldkids#1%
{\checkfieldreferences
- \ifdefinemainfield
+ \ifdefinemainfield
\doifundefinedelse{\r!widget#1}%
{\let\@@FieldKids\empty}
{\@EA\let\@EA\@@FieldKids\csname\r!widget#1\endcsname}%
@@ -381,9 +381,9 @@
\resetfieldreferences
%D Of course it costs a few more tokens to implement, but it's
-%D worth the memory: running for instance the 2000 page
-%D english examns publishing on demand document went down from
-%D 1350 seconds to less than 950 on a 650 Mhz pentium.
+%D worth the memory: running for instance the 2000 page
+%D english examns publishing on demand document went down from
+%D 1350 seconds to less than 950 on a 650 Mhz pentium.
\def\definefield
{\definemainfieldfalse\doquintupleempty\dodefinefield}
@@ -406,18 +406,18 @@
% {\ifnum\totalnumberoffields>0
% \definereference[AtOpenInitializeForm][\v!ResetForm]%
% \fi}
-%
+%
% \definereference[AtOpenInitializeForm][\v!geen]
-%
+%
% \appendtoks \presetfieldreferences \to \everycheckreferences
-\def\dodefinefield[#1][#2][#3][#4][#5]%
+\def\dodefinefield[#1][#2][#3][#4][#5]%
{\ifsecondargument
\edef\currentfieldname{#1}% just in case we're inside a loop
\doifundefinedelse{define#2field}
{\writestatus\m!fields{unknown field type #2}}
{\doifundefined{fielddata\currentfieldname}
- {\getmainfieldkids\currentfieldname
+ {\getmainfieldkids\currentfieldname
\ifdefinemainfield
\ifx\@@FieldKids\empty
\let\@@FieldMode\fieldlonermode
@@ -428,7 +428,7 @@
\else
\let\@@FieldMode\fieldlonermode
\def\@@FieldAuto{0}%
- \fi
+ \fi
\def\@@FieldFree{0}%
\getvalue{define#2field}{\currentfieldname}{#2}{#3}{#4}{#5}}}%
\else
@@ -455,7 +455,7 @@
%\def\definecheckfield#1#2#3#4#5%
% {\doifelsenothing{#4}
-% {\definedefaultsymbols
+% {\definedefaultsymbols
% \def\@@FieldValues{defaultyes}}
% {\def\@@FieldValues{#4}}%
% \doifelsenothing{#5}
@@ -465,11 +465,11 @@
% \setfield{#1}{#2}{}{}{\@@FieldKids}{#3}{\@@FieldMode\@@FieldFree\@@FieldAuto}{\@@FieldValues}{\@@FieldDefault}}
%D Since these fields have an on/off state only, we pass 1/0
-%D to the driver as default values.
+%D to the driver as default values.
\def\definecheckfield#1#2#3#4#5%
{\doifelsenothing{#4}
- {\definedefaultsymbols
+ {\definedefaultsymbols
\def\@@FieldValues{defaultyes}}
{\def\@@FieldValues{#4}}%
\doifelsenothing{#5}
@@ -477,7 +477,7 @@
{\dogetcommacommandelement1\from\@@FieldValues\to\@@FieldDefault
\doifinstringelse{#5}{\@@FieldDefault}
{\def\@@FieldDefault{1}}
- {\def\@@FieldDefault{0}}}%
+ {\def\@@FieldDefault{0}}}%
\setfield
{#1}{#2}{}{}{\@@FieldKids}{#3}%
{\@@FieldMode\@@FieldFree\@@FieldAuto}%
@@ -491,7 +491,7 @@
{\dogetcommacommandelement1\from#4\to\SavedFieldDefault
\dogetcommacommandelement1\from\SavedFieldDefault\to\SavedFieldDefault}
{\def\SavedFieldDefault{#5}}%
-% when opt works
+% when opt works
% \@EA\beforesplitstring\SavedFieldDefault\at=>\to\SavedFieldDefault
\ifx\@@FieldKids\empty
\setfield{#1}{#2}{}{}{#4}{#3}{\@@FieldMode\@@FieldFree\@@FieldAuto}{}{\SavedFieldDefault}%
@@ -501,14 +501,14 @@
%
\def\docommando##1%
{\doifelse{##1}\SavedFieldDefault
- {\def\@@FieldDefault{##1}}%
+ {\def\@@FieldDefault{##1}}%
{\let\@@FieldDefault\empty}%
\setfield{##1}{#2}{#1}{}{}{#3}{\@@FieldMode\@@FieldFree\@@FieldAuto}{}{\@@FieldDefault}}%
-% when opt works
+% when opt works
% \def\docommando##1%
% {\@EA\beforesplitstring##1\at=>\to\FieldValue
% \doifelse\FieldValue\SavedFieldDefault
-% {\let\@@FieldDefault\FieldValue}%
+% {\let\@@FieldDefault\FieldValue}%
% {\let\@@FieldDefault\empty}%
% \setfield\FieldValue{#2}{#1}{}{}{#3}{\@@FieldMode\@@FieldFree\@@FieldAuto}{}{\@@FieldDefault}}%
\processcommalist[#4]\docommando
@@ -519,17 +519,17 @@
\def\definesubfield%
{\dotripleempty\dodefinesubfield}
-\def\dodefinesubfield[#1][#2][#3]% for the moment only radio ones
+\def\dodefinesubfield[#1][#2][#3]% for the moment only radio ones
{\ifsecondargument
\def\docommando##1%
{\getfield{##1}%
- \ifx\@@FieldType\empty
+ \ifx\@@FieldType\empty
\writestatus\m!fields{unknown field ##1}% to do
- \else
+ \else
\doifsomething{#2}
{\edef\@@FieldGroup{#2}}%
\doifelsenothing{#3}
- {\definedefaultsymbols
+ {\definedefaultsymbols
\def\@@FieldValues{defaultyes}}
{\def\@@FieldValues{#3}}%
\changefield{##1}%
@@ -682,7 +682,7 @@
\def\dopresetrecord
{\iftrialtypesetting\else\iflocation\getvalue{preset\@@FieldType record}\fi\fi}
-\def\dodefinethefieldset[#1][#2]%
+\def\dodefinethefieldset[#1][#2]%
{\dodefinefieldset{#1}{#2}}
\def\definefieldset%
@@ -735,7 +735,7 @@
\else\iffirstargument
\doifelse{#1}\v!reset
{\let\dodosetupfield\normaldodosetupfield}
- {\setupfields[][][][#1]}% checken
+ {\setupfields[][][][#1]}% checken
\else
\writestatus\m!fields{provide either 1 or 4 arguments}%
\fi\fi}
@@ -750,8 +750,8 @@
\newif\ifVerticalField
\newif\ifHorizontalField
-% way to slow/complicated, we need some simple alternative
-% as well
+% way to slow/complicated, we need some simple alternative
+% as well
\def\dohandlefield[#1][#2][#3][#4][#5]%
{\presetlocalframed[\??fd]%
@@ -769,15 +769,15 @@
\c!uitlijnen=\v!rechts,\c!breedte=20em]%
\else\ifHorizontalField
\getparameters[\??fd]
- [\c!afstand=\@@localoffset,\c!tussen=,\c!uitlijnen=\c!links,
+ [\c!afstand=\@@localoffset,\c!tussen=,\c!uitlijnen=\c!links,
\c!hoogte=10ex]%
\else
\getparameters[\??fd]
- [\c!afstand=\!!zeropoint,\c!tussen=,\c!uitlijnen=\c!links]%
+ [\c!afstand=\!!zeropoint,\c!tussen=,\c!uitlijnen=\c!links]%
\fi\fi
\getparameters[\??fd]
[\c!n=,\c!voor=,\c!na=\vss,\c!letter=,\c!kleur=,#3]%
- \reshapeframeboxfalse % else ugly spacing
+ \reshapeframeboxfalse % else ugly spacing
\ifShowFieldFrame
\localframed[\??fd][\c!strut=\v!nee,\c!uitlijnen=]\bgroup
\else
@@ -786,13 +786,13 @@
\mindermeldingen
\ifShowFieldLabel
\setbox0=\hbox
- {\reshapeframeboxtrue % else wrong dimensions
+ {\reshapeframeboxtrue % else wrong dimensions
\framed
[\c!letter=,\c!kleur=,\c!uitlijnen=\c!rechts,#4]
{\@@FieldLabel}}%
\fi
\setbox2=\hbox
- {\reshapeframeboxtrue % else wrong dimensions
+ {\reshapeframeboxtrue % else wrong dimensions
\ifVerticalField
\setupframed[\c!hoogte=6ex,\c!breedte=\hsize]%
\else\ifHorizontalField
@@ -810,8 +810,8 @@
\c!focusin=,\c!focusuit=,
\c!veldoffset=\!!zeropoint,\c!veldachtergrondkleur=,
\c!veldkaderkleur=,#5]%
- \dimen0=\framedwidth \edef\@@FieldWidth {\the\dimen0}%
- \dimen0=\framedheight\edef\@@FieldHeight{\the\dimen0}%
+ \dimen0=\framedwidth \edef\@@FieldWidth {\the\dimen0}%
+ \dimen0=\framedheight\edef\@@FieldHeight{\the\dimen0}%
\vfill
\hbox{\lower\@@fdveldoffset\hbox{\typesetfield}}
\vss}}%
@@ -838,7 +838,7 @@
\fi
\egroup}
-\def\dohandlefitfield[#1][#2][#3][#4][#5]% alleen check
+\def\dohandlefitfield[#1][#2][#3][#4][#5]% alleen check
{\presetlocalframed[\??fd]%
\localframed
[\??fd]
@@ -855,12 +855,12 @@
\fi
\dopresetfieldsymbol\@@FieldValue
\setbox0=\hbox{\dogetfieldsymbol{\@@FieldValue}}%
- \dimen0=\wd0 \edef\@@FieldWidth {\the\dimen0}%
- \dimen0=\ht0 \edef\@@FieldHeight{\the\dimen0}%
- \vbox to \ht0
+ \dimen0=\wd0 \edef\@@FieldWidth {\the\dimen0}%
+ \dimen0=\ht0 \edef\@@FieldHeight{\the\dimen0}%
+ \vbox to \ht0
{\vfill\hbox to \wd0{\typesetfield\hfill}\vss}}}
-%D Common stuff
+%D Common stuff
\newcounter\nofsystemfields
@@ -876,22 +876,22 @@
\def\dofillinfield[#1]#2%
{\leavevmode
\hbox
- {\forgetall
+ {\forgetall
\setupfields[\v!reset]%
\nextsystemfield
- \useJSscripts[ans]%
+ \useJSscripts[ans]%
\doifelsenothing{#1}
{\def\therightanswer{#2}}
{\def\therightanswer{#1}}%
\setbox0=\hbox{#2}%
\setbox2=\hbox{\therightanswer}%
- \dimen0=\ifdim\wd0>\wd2 \wd0 \else \wd2 \fi
+ \dimen0=\ifdim\wd0>\wd2 \wd0 \else \wd2 \fi
\advance\dimen0 .2em
\definefield
[\currentsystemfield][line][systemfield]%
\setupfield
[systemfield]
- [\c!n=1024, % beware: weblink plugin truncates
+ [\c!n=1024, % beware: weblink plugin truncates
\c!plaats=\v!laag,\c!strut=\v!ja,\c!veldoffset=0pt,
\c!hoogte=1.2\openlineheight,\c!breedte=\dimen0,\c!offset=\v!overlay,
\c!letter=,\c!uitlijnen=\v!midden,\c!kader=\v!uit,
@@ -904,11 +904,11 @@
%D and another one:
-\def\tooltip%
+\def\tooltip
{\dosingleempty\dotooltip}
\def\dotooltip[#1]#2#3%
- {\bgroup
+ {\bgroup
\setupfields[\v!reset]%
\useJSscripts[fld]%
\setbox0\hbox
@@ -918,7 +918,7 @@
\definesymbol
[\currentsystemfield:txt]
[{\inframed[\c!kader=\v!uit,\c!achtergrond=\v!raster]{#3}}]%
- \setbox2=\hbox{\symbol[\currentsystemfield:txt]}%
+ \setbox2\hbox{\symbol[\currentsystemfield:txt]}%
\definefield
[\currentsystemfield:txt][check]
[dummy][\currentsystemfield:txt][\currentsystemfield:txt]%
@@ -932,7 +932,7 @@
\doifelse{#1}\v!links
{\hskip-\dimen0}
{\doif{#1}\v!midden
- {\hskip-.5\dimen0}}%
+ {\hskip-.5\dimen0}}%
\lower\openlineheight\hbox to \zeropoint
{\fitfield[\currentsystemfield:txt]}}%
\dimen0=\ifdim\wd0=\zeropoint 3em\else\wd0\fi
@@ -954,16 +954,16 @@
\ht0\strutht\dp0\strutdp\box0
\egroup}
-%D And one more:
+%D And one more:
\def\definefieldstack%
{\dotripleargument\dodefinefieldstack}
-\def\dodefinefieldstack[#1][#2][#3]% name, symbols, settings
+\def\dodefinefieldstack[#1][#2][#3]% name, symbols, settings
{\doifundefined{fieldstack:#1}
{\setgvalue{fieldstack:#1}{\dodofieldstack[#1][#2][#3]}}}
-\def\dodofieldstack[#1][#2][#3]% start=n, 0 == leeg
+\def\dodofieldstack[#1][#2][#3]% start=n, 0 == leeg
{\bgroup
\getparameters[\??fd][\c!start=1,#3]%
\setupfields[\v!reset]%
@@ -976,14 +976,14 @@
\definefield[#1:\stackedfieldnumber][check][#1][##1,\v!leeg][##1]%
\else
\definefield[#1:\stackedfieldnumber][check][#1][##1,\v!leeg][\v!leeg]%
- \fi}%
+ \fi}%
\processcommalist[#2]\dododofieldstack
\setupfield[#1][\v!reset]% added
- \setupfield[#1][\c!optie=\v!alleenleesbaar,#3]% #3 swapped
+ \setupfield[#1][\c!optie=\v!alleenleesbaar,#3]% #3 swapped
\newcounter\stackedfieldnumber
\def\dododofieldstack##1%
{\doglobal\increment\stackedfieldnumber
- \fitfield[#1:\stackedfieldnumber]\egroup\bgroup}%
+ \fitfield[#1:\stackedfieldnumber]\egroup\bgroup}%
\startoverlay
\bgroup
\globalprocesscommalist[#2]\dododofieldstack
@@ -1002,7 +1002,7 @@
{\dotripleempty\dofieldstack}
%D When submitting a form, we need to tell the driver module
-%D that we want \FDF\ or \HTML.
+%D that we want \FDF\ or \HTML.
\def\setupforms
{\dodoubleargument\getparameters[\??fr]}
diff --git a/tex/context/base/core-fnt.tex b/tex/context/base/core-fnt.tex
index c51f07103..1187774fe 100644
--- a/tex/context/base/core-fnt.tex
+++ b/tex/context/base/core-fnt.tex
@@ -8,8 +8,8 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
\writestatus{loading}{Context Core Macros / Font Support}
@@ -29,7 +29,7 @@
\bgroup \catcode`\|=\@@active \gdef\compound#1{|#1|} \egroup
%D Here we hook some code into the clean up mechanism needed
-%D for verbatim data.
+%D for verbatim data.
\appendtoks
\disablecompoundcharacters
@@ -70,14 +70,14 @@
%D
%D This at first sight unusual capitilization is completely
%D legal.
-%D
+%D
%D \showsetup{\y!kap}
%D \showsetup{\y!Kap}
%D \showsetup{\y!KAP}
%D \showsetup{\y!Kaps}
%D \showsetup{\y!nokap}
%D
-%D The difference between pseudo and real caps is demonstrated
+%D The difference between pseudo and real caps is demonstrated
%D below:
%D
%D \startbuffer
@@ -86,11 +86,11 @@
%D \stopbuffer
%D
%D \typebuffer
-%D
+%D
%D \haalbuffer
%D
-%D The \type {\bgroup} trickery below is needed because of
-%D \type {\groupedcommand}.
+%D The \type {\bgroup} trickery below is needed because of
+%D \type {\groupedcommand}.
\def\usepseudocaps%
{\def\cap@@uppercase{\the\everyuppercase\uppercased}%
@@ -130,31 +130,31 @@
\unexpanded\def\Kap#1%
{\KAP{\\#1}}
-\unexpanded\def\Kaps%
- {\let\processword=\Kap
+\unexpanded\def\Kaps
+ {\let\processword\Kap
\processwords}
%D Sure:
\let\normalkap\kap
-%D Some precautions for a \PLAIN\ \TEX\ definition.
+%D Some precautions for a \PLAIN\ \TEX\ definition.
\let\normalcap\cap
-\def\cap%
+\def\cap
{\ifmmode
\expandafter\normalcap
\else
\expandafter\kap
\fi}
-%D \macros
+%D \macros
%D {setupcapitals}
%D
%D By default we use pseudo small caps in titles. This can be
%D set up with:
-%D
+%D
%D \showsetup{setupcapitals}
\def\setupcapitals%
@@ -168,7 +168,7 @@
\let\kap\normalkap}
{\definealternativestyle[\v!kapitaal][\normalkap][\uppercased]%
\definealternativestyle[\v!smallcaps][\sc][\uppercased]%
- \def\kap{\doconvertfont{\v!kapitaal}}}%
+ \def\kap{\doconvertfont{\v!kapitaal}}}%
\doifelse{\@@kksc}{\v!ja}
{\userealcaps}
{\usepseudocaps}}
@@ -176,16 +176,16 @@
\ifx\uppercased\undefined \let\uppercased\uppercase \fi
\ifx\lowercased\undefined \let\lowercased\lowercase \fi
-% pretty tricky stuff:
+% pretty tricky stuff:
%
% \usemodule[abr-01] \TEX \METAPOST \PPCHTEX \LATEX
% \usemodule[abr-02] \TEX \METAPOST \PPCHTEX \LATEX
-\def\uppercased#1%
- {{\forceunexpanded\xdef\@@globalcrap{\uppercase{#1}}}\@@globalcrap}
+%def\uppercased#1{{\forceunexpanded\xdef\@@globalcrap{\uppercase{#1}}}\@@globalcrap}
+%def\lowercased#1{{\forceunexpanded\xdef\@@globalcrap{\lowercase{#1}}}\@@globalcrap}
-\def\lowercased#1%
- {{\forceunexpanded\xdef\@@globalcrap{\lowercase{#1}}}\@@globalcrap}
+\def\uppercased#1{{\forceunexpanded\xdef\@@expanded{\uppercase{#1}}}\@@expanded}
+\def\lowercased#1{{\forceunexpanded\xdef\@@expanded{\lowercase{#1}}}\@@expanded}
\setupcapitals
[\c!titel=\v!ja,
@@ -228,7 +228,7 @@
\unexpanded\def\Word#1%
{\doWord#1}
-\def\doprocesswords#1 #2\od%
+\def\doprocesswords#1 #2\od
{\ConvertToConstant\doifnot{#1}{}
{\processword{#1} %
\doprocesswords#2 \od}}
@@ -238,19 +238,21 @@
\let\processword\relax
-\unexpanded\def\Words%
- {\let\processword=\Word
+\unexpanded\def\Words
+ {\let\processword\Word
\processwords}
\unexpanded\def\WORD#1%
{\bgroup
\the\everyuppercase
- \def\kap##1{##1}%
- \def\WORD##1{##1}%
+ %\def\kap##1{##1}%
+ %\def\WORD##1{##1}%
+ \let\kap\firstofoneargument
+ \let\WORD\firstofoneargument
\uppercase{#1}% No expansion here, otherwise \getvalue problems!
-% \edef\next{#1}%
-% \uppercase\expandafter{\next}%
- \egroup}
+ %\edef\next{#1}% keep this to prevent roll back
+ %\uppercase\expandafter{\next}% keep this to prevent roll back
+ \egroup}
\unexpanded\def\WORDS#1%
{\WORD{#1}}
@@ -276,9 +278,9 @@
%D
%D \showsetup{\y!stretched}
-\def\stretched%
+\def\stretched#1%
{\ifvmode\hbox to \hsize\else\ifinner\else\hbox\fi\fi
- \processtokens\relax\hss\relax{\hss\hss}}% \normalspace}
+ \bgroup\processtokens\relax\hss\relax{\hss\hss}{#1}\egroup}
%D \startbuffer
%D \stretched{Unknown Box}
@@ -286,13 +288,13 @@
%D \vbox to 2cm{\stretched{A Vertical Box}}
%D \hbox to 3cm{\stretched{sp{\'e}c{\`\i}{\"a}l}}
%D \stopbuffer
-%D
-%D \haalbuffer
-%D
+%D
+%D \haalbuffer
+%D
%D The first line of this macros takes care of boxing. Normally
%D one will use an \type{\hbox} specification. The last line
-%D shows how special characters should be passed.
-%D
+%D shows how special characters should be passed.
+%D
%D \typebuffer
%D \macros
@@ -306,7 +308,7 @@
%D
%D \typebuffer
%D
-%D this one uses fixed skips and kerns.
+%D this one uses fixed skips and kerns.
%D
%D \startvoorbeeld
%D \haalbuffer
@@ -315,7 +317,7 @@
%D The default skip can be set with:
% \def\stretchedspacefactor{4}
-% \def\stretchedspaceamount{.25em}
+% \def\stretchedspaceamount{.25em}
%
% \unexpanded\def\stretcheduppercase#1%
% {\bgroup
@@ -334,29 +336,31 @@
% \fi
% \egroup}
+%D Given the following settings, the space is 1em by default:
+
\def\stretchedspacefactor{4}
-\def\stretchedspaceamount{.25em}
+\def\stretchedspaceamount{.25em}
\def\stretchedbreaktokens{.@/}
-\unexpanded\def\stretchednormalcase%
+\unexpanded\def\stretchednormalcase
{\stretchedsomecase\firstofoneargument}
-\unexpanded\def\stretcheduppercase
+\unexpanded\def\stretcheduppercase
{\stretchedsomecase{\the\everyuppercase\uppercase}}
-\unexpanded\def\stretchedlowercase
+\unexpanded\def\stretchedlowercase
{\stretchedsomecase{\the\everylowercase\lowercase}}
-\def\stretchedsomecase#1#2%
+\def\stretchedsomecase#1#2%
{\bgroup
#1{\def\textstring{#2}}%
\ifdim\stretchedspaceamount>\zeropoint
\def\textkern##1%
- {% beware: ##1 may not be \box\somebox -)
+ {% beware: ##1 may not be \box\somebox -)
\determinemidwordbreak{##1}{\stretchedbreaktokens}%
\kern\stretchedspaceamount##1\domidwordbreak}%
- \def\textskip%
- {\scratchdimen=\stretchedspaceamount
+ \def\textskip
+ {\scratchdimen\stretchedspaceamount
\hskip\stretchedspacefactor\scratchdimen}%
\@EA\processtokens\@EA\relax\@EA\textkern\@EA\relax\@EA
\textskip\@EA{\textstring}%
@@ -365,26 +369,26 @@
\fi
\egroup}
-%D An auxiliary macro, see for usage \type {\stretcheduppercase}.
+%D An auxiliary macro, see for usage \type {\stretcheduppercase}.
\let\domidwordbreak\relax
\def\setmidwordbreaktoken#1%
- {\sfcode`#1=5000\relax}
+ {\sfcode`#1=5000\relax}
\def\determinemidwordbreak#1#2%
{\edef\midwordbreaktokens{#2}%
- \ifx\midwordbreaktokens\empty
+ \ifx\midwordbreaktokens\empty
\global\let\domidwordbreak\relax
- \else
- \setbox\scratchbox=\hbox
+ \else
+ \setbox\scratchbox\hbox
{\expandafter\handletokens\midwordbreaktokens\with\setmidwordbreaktoken
a\space \!!dimena=\the\lastskip
- #1\space\!!dimenb=\the\lastskip \relax % needed
+ #1\space\!!dimenb=\the\lastskip \relax % needed
\ifdim\!!dimena=\!!dimenb
- \global\let\domidwordbreak\relax
+ \globallet\domidwordbreak\relax
\else
- \global\let\domidwordbreak\allowbreak
+ \globallet\domidwordbreak\allowbreak
\fi}%
\fi}
@@ -392,61 +396,61 @@
%D {underbar,underbars,
%D overbar,overbars,
%D overstrike,overstrikes,
-%D setupunderbar}
+%D setupunderbar}
%D
%D In the rare case that we need undelined words, for instance
%D because all font alternatives are already in use, one can
%D use \type{\underbar} and \type{\overstrike} and their plural
-%D forms.
-%D
+%D forms.
+%D
%D \startbuffer
%D \underbars{drawing \underbar{bars} under words is a typewriter leftover}
-%D \overstrikes{striking words makes them \overstrike{unreadable} but
+%D \overstrikes{striking words makes them \overstrike{unreadable} but
%D sometimes even \overbar{top lines} come into view.}
%D \stopbuffer
-%D
+%D
%D \typebuffer
-%D
+%D
%D \startvoorbeeld
%D \startregels
%D \haalbuffer
%D \stopregels
%D \stopvoorbeeld
-%D
-%D The next macros are derived from the \PLAIN\ \TEX\ one, but
-%D also supports nesting. The \type{$} keeps us in horizontal
-%D mode and at the same time applies grouping.
+%D
+%D The next macros are derived from the \PLAIN\ \TEX\ one, but
+%D also supports nesting. The \type{$} keeps us in horizontal
+%D mode and at the same time applies grouping.
%D
%D \showsetup{\y!underbar}
%D \showsetup{\y!underbars}
%D \showsetup{\y!overbar}
%D \showsetup{\y!overbars}
%D \showsetup{\y!overstrike}
-%D \showsetup{\y!overstrikes}
+%D \showsetup{\y!overstrikes}
%D
-%D Although underlining is ill advised, we permit some
-%D alternatives, that can be set up by:
+%D Although underlining is ill advised, we permit some
+%D alternatives, that can be set up by:
%D
%D \showsetup{\y!setupunderbar}
%D
-%D The alternatives show up as
+%D The alternatives show up as
%D {\setupunderbar [variant=a]\underbar{alternative a}},
%D {\setupunderbar [variant=b]\underbar{alternative b}},
%D {\setupunderbar [variant=c]\underbar{alternative c}}
-%D and
+%D and
%D {\setupunderbar [lijndikte=1pt]\underbar{1pt width}},
-%D {\setupunderbar [lijndikte=2pt]\underbar{2pt width}},
-%D or whatever. Because \type{\overstrike} uses the same
-%D method, the settings also apply to that macro.
+%D {\setupunderbar [lijndikte=2pt]\underbar{2pt width}},
+%D or whatever. Because \type{\overstrike} uses the same
+%D method, the settings also apply to that macro.
\newcounter\underbarlevel
-\def\underbarmethoda#1#2#3% RULE
+\def\underbarmethoda#1#2#3% RULE
{\hbox to #1{\vrule\!!width#1\!!height#2\!!depth#3}}
-\def\underbarmethodb#1#2#3% DASH
+\def\underbarmethodb#1#2#3% DASH
{\hbox to #1
- {\hskip-.25em
+ {\hskip-.25em
\xleaders
\hbox{\hskip.25em\vrule\!!width.25em\!!height#2\!!depth#3}
\hfil}}
@@ -454,19 +458,19 @@
\def\underbarmethodc#1#2#3% PERIOD
{\hbox to #1
{\dimen4=#3
- \advance\dimen4 .2ex
- \hskip-.25em
+ \advance\dimen4 .2ex
+ \hskip-.25em
\xleaders
\hbox{\hskip.25em\lower\dimen4\hbox{.}}
\hfil}}
-\def\dododounderbar#1#2#3%
+\def\dododounderbar#1#2#3%
{\startmathmode
\setbox0\hbox{#3}%
\setbox2\hbox{\color[\@@onlijnkleur]{\getvalue{underbarmethod\@@onvariant}{\wd0}{#1}{#2}}}%
\wd0\zeropoint
- \ht2\ht0
- \dp2\dp0
+ \ht2\ht0
+ \dp2\dp0
\box0\box2
\stopmathmode}
@@ -475,7 +479,7 @@
\dimen0=\@@ononderoffset
\dimen0=\underbarlevel\dimen0
\ifdone \else
- %\advance\dimen0 -1pt
+ %\advance\dimen0 -1pt
\advance\dimen0 -\strutht
\fi
\dimen2\dimen0
@@ -483,7 +487,7 @@
\dododounderbar{-\dimen0}{\dimen2}{#1}%
\egroup}
-\def\betweenunderbarwords%
+\def\betweenunderbarwords
{\bgroup
\setbox0\hbox
{\dodounderbar{\hskip\fontdimen2\font}}%
@@ -492,7 +496,7 @@
\discretionary{}{}{\box0}%
\egroup}
-\def\betweenunderbarspaces%
+\def\betweenunderbarspaces
{\hskip\currentspaceskip}
\unexpanded\def\dounderbar#1#2%
@@ -500,25 +504,25 @@
\processisolatedwords{#2}\dodounderbar
\egroup}
-\unexpanded\def\underbar%
+\unexpanded\def\underbar
{\bgroup
\increment\underbarlevel
\donetrue
\dounderbar\betweenunderbarwords}
-\unexpanded\def\underbars%
+\unexpanded\def\underbars
{\bgroup
\increment\underbarlevel
\donetrue
\dounderbar\betweenunderbarspaces}
-\unexpanded\def\overbar%
+\unexpanded\def\overbar
{\bgroup
\decrement\underbarlevel
\donefalse
\dounderbar\betweenunderbarwords}
-\unexpanded\def\overbars%
+\unexpanded\def\overbars
{\bgroup
\decrement\underbarlevel
\donefalse
@@ -532,9 +536,9 @@
\dododounderbar{\dimen2}{-\dimen0}{#1}%
\egroup}
-\def\betweenoverstrikewords%
+\def\betweenoverstrikewords
{\bgroup
- \setbox0=\hbox
+ \setbox0\hbox
{\dooverstrike{\hskip\fontdimen2\font}}%
\nobreak
\hskip\zeropoint\!!minus\fontdimen4\font
@@ -552,48 +556,47 @@
\processisolatedwords{#1}\dooverstrike
\egroup}
-\def\setupunderbar%
+\def\setupunderbar
{\dodoubleargument\getparameters[\??on]}
%D \macros
%D {low, high, lohi}
-%D
+%D
%D Although \TEX\ is pretty well aware of super- and
-%D subscripts, its mechanism is mainly tuned for math mode.
-%D The next few commands take care of script texts both modes.
-%D
+%D subscripts, its mechanism is mainly tuned for math mode.
+%D The next few commands take care of script texts both modes.
+%D
%D \startbuffer
%D The higher\high{one goes} the lower\low{one drops}, or\lohi{yes}{no}?
%D \stopbuffer
-%D
+%D
%D \typebuffer
-%D
+%D
%D \haalbuffer
%D
-%D Note the different placement of \type {\lohi}, where we
-%D need a bit more space. The implementation looks a bit
-%D fuzzy, since some \type {\fontdimen}'s are involved to
-%D determine the optimal placement.
+%D Note the different placement of \type {\lohi}, where we
+%D need a bit more space. The implementation looks a bit
+%D fuzzy, since some \type {\fontdimen}'s are involved to
+%D determine the optimal placement.
-\def\dodohighlow%
+\def\dodohighlow
{\ifx\fontsize\empty
\ifmmode
\ifnum\fam<0 \tx \else \holamathfont \fi
\else
- \tx
+ \tx
\fi
\else
- \tx
+ \tx
\fi}
\def\dohighlow#1#2#3#4#5%
{\dontleavehmode
\bgroup
- \scratchdimen=
- \ifdim\fontdimen5\textfont2=1ex\fontdimen#2\textfont2\else#3ex\fi
- \advance\scratchdimen by #4ex
+ \scratchdimen\ifdim\fontdimen5\textfont2=1ex\fontdimen#2\textfont2\else#3ex\fi
+ \advance\scratchdimen #4ex
\kern.1ex
- \setbox\scratchbox=\hbox{#1\scratchdimen\hbox{\dodohighlow#5}}%
+ \setbox\scratchbox\hbox{#1\scratchdimen\hbox{\dodohighlow#5}}%
\ht\scratchbox\strutheight
\dp\scratchbox\strutdepth
\box\scratchbox
@@ -613,14 +616,14 @@
% \wd6=\zeropoint\box6\box4
% \fi}}
-\unexpanded\def\lohi%
+\unexpanded\def\lohi
{\dosingleempty\dolohi}
\def\dolohi[#1]#2#3%
{\dontleavehmode
\hbox
- {\setbox4=\hbox{\dohighlow\lower{16}{.48}{.1}{#2}}%
- \setbox6=\hbox{\dohighlow\raise{14}{.86}{.1}{#3}}%
+ {\setbox4\hbox{\dohighlow\lower{16}{.48}{.1}{#2}}%
+ \setbox6\hbox{\dohighlow\raise{14}{.86}{.1}{#3}}%
\doif{#1}{\v!links}
{\ifdim\wd4<\wd6
\setbox4\hbox to \wd6{\hss\box4}%
@@ -636,38 +639,38 @@
%D You can provide an optional keyword \type {left}, in which
%D case the super and subscripts will be aligned in a way that
%D permits placement at the left of a word (which means that
-%D it will be right aligned).
-%D
+%D it will be right aligned).
+%D
%D \startbuffer
-%D \lohi{aha}{ah} test \lohi{aha}{ah} test
-%D \lohi[links]{aha}{ah} test \lohi[links]{aha}{ah} test
-%D \lohi{aha}{ah} test\lohi{aha}{ah} test
-%D \lohi[links]{aha}{ah}test \lohi[links]{aha}{ah}test
+%D \lohi{aha}{ah} test \lohi{aha}{ah} test
+%D \lohi[links]{aha}{ah} test \lohi[links]{aha}{ah} test
+%D \lohi{aha}{ah} test\lohi{aha}{ah} test
+%D \lohi[links]{aha}{ah}test \lohi[links]{aha}{ah}test
%D \stopbuffer
-%D
+%D
%D \typebuffer
-%D
+%D
%D \haalbuffer
%D \macros
%D {setupinitial,placeinitial,checkinitial}
-%D
+%D
%D {\em To be documented.}
%D
%D \starttypen
-%D \setupinitial[state=start] \placeinitial \input tufte
-%D \stoptypen
+%D \setupinitial[state=start] \placeinitial \input tufte
+%D \stoptypen
%D
-%D and
+%D and
%D
%D \starttypen
%D \def\bpar{\ifvmode\checkinitial\fi}
%D \def\epar{\ifhmode\par\fi\checkinitial}
-%D \stoptypen
+%D \stoptypen
-% to do: more fine tuning
+% to do: more fine tuning
-\def\setupinitial%
+\def\setupinitial
{\dodoubleempty\getparameters[\??dc]}
\definefontsynonym[Initial][Regular] % prefered initial identifier
@@ -679,9 +682,9 @@
\c!n=3,
\s!font=initial]
-\def\placeinitial%
- {\doifelse\@@dcplaats\v!marge{\chardef\DropMode1}{\chardef\DropMode0}%
- \doif\@@dcstatus\v!start{\ifnum\@@dcn>0 \AutoDroppedCaps\fi}}
+\def\placeinitial
+ {\doifelse\@@dcplaats\v!marge{\chardef\DropMode\plusone}{\chardef\DropMode\zerocount}%
+ \doif \@@dcstatus\v!start{\ifnum\@@dcn>0 \AutoDroppedCaps\fi}}
\let\checkinitial\CheckDroppedCaps
@@ -693,5 +696,5 @@
\c!onderoffset=1.5pt,
\c!bovenoffset=2.5pt,
\c!lijnkleur=]
-
-\protect \endinput
+
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/core-grd.tex b/tex/context/base/core-grd.tex
index e66b9c1dd..0dcfb4445 100644
--- a/tex/context/base/core-grd.tex
+++ b/tex/context/base/core-grd.tex
@@ -113,13 +113,27 @@
\kern\strutdp
\prevdepth\strutdp}
+% \def\baselinecorrection
+% {\endgraf
+% \ifvmode
+% \ifdim\prevdepth<\maxdimen
+% \ifdim\prevdepth<\zeropoint \else
+% \ifdim\prevdepth<\strutdp
+% \dobaselinecorrection
+% \fi
+% \fi
+% \fi
+% \fi}
+
\def\baselinecorrection
{\endgraf
\ifvmode
\ifdim\prevdepth<\maxdimen
\ifdim\prevdepth<\zeropoint \else
- \ifdim\prevdepth<\strutdp
+ \ifdim\prevdepth<\strutdepth \relax
+ \pushlastnode
\dobaselinecorrection
+ \poplastnode
\fi
\fi
\fi
diff --git a/tex/context/base/core-ini.tex b/tex/context/base/core-ini.tex
new file mode 100644
index 000000000..4fe47b813
--- /dev/null
+++ b/tex/context/base/core-ini.tex
@@ -0,0 +1,38 @@
+%D \module
+%D [ file=core-ini,
+%D version=2003.12.01,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=Additional Initialization,
+%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 Initialization}
+
+%D We will move more code to here, so that we become less dependent of the
+%D orde in which modules are loaded.
+
+\unprotect
+
+\appendtoks \flushsyncresets \to \everyendoftextbody
+
+\appendtoks \ignorespaces \to \everybeginofpar
+
+\appendtoks \removeunwantedspaces \to \everyendofpar
+%appendtoks \strut \to \everyendofpar % option ?
+\appendtoks \flushsyncresets \to \everyendofpar
+\appendtoks \setlastlinewidth \to \everyendofpar % must happen before endgraf
+\appendtoks \endgraf \to \everyendofpar
+
+% Todo: verbatim, xml, tex, move code to here
+
+\ifx\normalcompound\undefined \let\normalcompound=| \fi
+
+\appendtoks \catcode`|=\@@active \let|\normalcompound \to \everyTEXinputmode
+\appendtoks \catcode`|=\@@letter \to \everyXMLinputmode
+
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/core-int.tex b/tex/context/base/core-int.tex
index f42ac52c5..b394b15ab 100644
--- a/tex/context/base/core-int.tex
+++ b/tex/context/base/core-int.tex
@@ -25,8 +25,8 @@
2: actief
3: niet actief
4: geen paginasynchronisatie (--) in hmode
- 5: onbekend attachment --
- 6: attachment file -- bestaat niet
+ 5: onbekend attachment --
+ 6: attachment file -- bestaat niet
\stopmessages
\startmessages english library: interactions
@@ -35,8 +35,8 @@
2: active
3: inactive
4: no pagesynchronisation (--) in hmode
- 5: unknown attachment --
- 6: attachment file -- does not exist
+ 5: unknown attachment --
+ 6: attachment file -- does not exist
\stopmessages
\startmessages german library: interactions
@@ -45,8 +45,8 @@
2: aktiv
3: inaktiv
4: keine Seitensynchronisation (--) im hmode
- 5: unknown attachment --
- 6: attachment file -- does not exist
+ 5: unknown attachment --
+ 6: attachment file -- does not exist
\stopmessages
\startmessages czech library: interactions
@@ -55,8 +55,8 @@
2: aktivni
3: neaktivni
4: zadna strankova synchronizace (--) v hmode
- 5: unknown attachment --
- 6: attachment file -- does not exist
+ 5: unknown attachment --
+ 6: attachment file -- does not exist
\stopmessages
\startmessages italian library: interactions
@@ -65,8 +65,8 @@
2: attiva
3: inattiva
4: sincronizzazione di pagina (--) non disponibile in hmode
- 5: unknown attachment --
- 6: attachment file -- does not exist
+ 5: unknown attachment --
+ 6: attachment file -- does not exist
\stopmessages
\startmessages norwegian library: interactions
@@ -75,8 +75,8 @@
2: aktiv
3: inaktiv
4: ingen sidesynkronisering (--) i hmode
- 5: unknown attachment --
- 6: attachment file -- does not exist
+ 5: unknown attachment --
+ 6: attachment file -- does not exist
\stopmessages
\startmessages romanian library: interactions
@@ -85,8 +85,8 @@
2: activ
3: inactiv
4: nu exista sincronizare pt. pagini (--) in hmode
- 5: unknown attachment --
- 6: attachment file -- does not exist
+ 5: unknown attachment --
+ 6: attachment file -- does not exist
\stopmessages
\startmessages dutch library: versions
@@ -533,7 +533,7 @@
{\getvalue{\@@bookcount\the\!!counta}}%
\xdef\bookmarklevellist
{\bookmarklevellist/\bookmarktag:\bookmarklevelcount/}%
- \advance\!!counta \minusone
+ \advance\!!counta \minusone
\ifnum\!!counta=\currentbookmarklevel
\exitloop
\fi}%
@@ -981,7 +981,7 @@
\letvalue{\??am\v!boven }\empty
\letvalue{\??am\v!onder }\empty
-% todo : \defineinteractionmenuclass
+% todo : \defineinteractionmenuclass
\def\interactiemenus[#1]%
{\iflocation
@@ -999,8 +999,8 @@
\setvalue{\??am\??am\c!menu\v!onder}%
{\vertikaalinteractiemenu\v!onder\onderhoogte\c!voor\c!na}
-% this can be implemented with the following command (which
-% is new, undocumented, experimental, untested, etc etc)
+% this can be implemented with the following command (which
+% is new, undocumented, experimental, untested, etc etc)
\def\defineinteractionmenuclass
{\dodoubleargument\dodefineinteractionmenuclass}
@@ -1015,31 +1015,31 @@
{#1}{\getvalue{\??am#1\c!hoogte}}\c!links\c!rechts}}}
% \setupinteraction[menu=on,state=start]
-%
+%
% \defineinteractionmenuclass[test] [vertical]
% \defineinteractionmenuclass[another][horizontal]
-%
+%
% \defineinteractionmenu[test] [left][state=start,width=4cm]
% \defineinteractionmenu[another][top] [state=start,height=1cm]
-%
+%
% \startinteractionmenu[test]
-% \but [firstpage] test-a \\
-% \but [nextpage] test-b \\
+% \but [firstpage] test-a \\
+% \but [nextpage] test-b \\
% \stopinteractionmenu
-%
+%
% \startinteractionmenu[another]
-% \but [firstpage] test-a \\
-% \but [nextpage] test-b \\
+% \but [firstpage] test-a \\
+% \but [nextpage] test-b \\
% \stopinteractionmenu
-%
-% \setupheadertexts[{\interactiemenu[another]}]
-%
-% \starttext
-%
-% test \interactionmenu[test] \page
-% test \interactionmenu[test] \page
-%
-% \stoptext
+%
+% \setupheadertexts[{\interactiemenu[another]}]
+%
+% \starttext
+%
+% test \interactionmenu[test] \page
+% test \interactionmenu[test] \page
+%
+% \stoptext
%D This can save complicated menu macros when one want to
%D keep control over parts of a menu (i.e.\ turn them on and
@@ -1078,10 +1078,10 @@
{\dotripleempty\dodefinieerinteractiemenu}
\def\dodefinieerinteractiemenu[#1][#2]% compatibility hack
- {\convertargument#2\to\ascii % will disappear soon
+ {\convertargument#2\to\ascii % will disappear soon
\doifinstringelse[\ascii
\dodostelinteractielijstmenuinx
- \dododefinieerinteractiemenu
+ \dododefinieerinteractiemenu
[#1][#2]}
% [name] [location]
@@ -1112,7 +1112,7 @@
{\dodoubleargument\dostelinteractiemenuin}
\def\dostelinteractiemenuin[#1][% compatibillity hack
- {\doifnextcharelse\bgroup % will disappear soon
+ {\doifnextcharelse\bgroup % will disappear soon
{\dodostelinteractielijstmenuiny[#1][}
{\dodostelinteractiemenuin [#1][}}
@@ -2129,10 +2129,23 @@
\newbox\commentbox
+% \def\doflushcommentanchors
+% {\let\next\relax
+% \processaction
+% [\@@ccplaats]
+% [ \v!inmarge=>\let\next\inmarge,
+% \v!linkerrand=>\let\next\inleftedge,
+% \v!rechterrand=>\let\next\inrightedge,
+% \v!linkermarge=>\let\next\inleftmargin,
+% \v!rechtermarge=>\let\next\inrightmargin]%
+% \next{\hbox{\raise\strutht\box\commentbox}}}
+
\def\doflushcommentanchors
- {\processaction
+ {\let\next\relax, % new
+ \processaction
[\@@ccplaats]
- [ \v!inmarge=>\let\next\inmarge,
+ [% \v!tekst=>\let\next\relax, % new
+ \v!inmarge=>\let\next\inmarge,
\v!linkerrand=>\let\next\inleftedge,
\v!rechterrand=>\let\next\inrightedge,
\v!linkermarge=>\let\next\inleftmargin,
@@ -2185,7 +2198,7 @@
{\egroup}}%
\grabuntil{\e!stop\v!comment}\docommando}
-\letvalue{\e!stop\v!comment}\relax % handy for \expanded{...}
+\letvalue{\e!stop\v!comment}\relax % handy for \expanded{...}
\def\docommentaar[#1][#2]#3%
{\doif\@@ccstatus\v!start
@@ -2255,14 +2268,14 @@
{\doflushcomments}
% \setupinteraction[state=start]
-%
+%
% \useattachment[test.tex]
% \useattachment[whatever][test.tex]
% \useattachment[whatever][newname][test.tex]
% \useattachment[whatever][title][newname][test.tex]
-%
+%
% % \setupattachments[\c!symbool={symbol-normal,symbol-down}]
-%
+%
% \starttext \attachment[whatever] \stoptext
\definesystemvariable{at}
@@ -2270,15 +2283,15 @@
\def\useattachment
{\doquadrupleempty\douseattachment}
-\def\douseattachment[#1][#2][#3][#4]% tag title newname filename
+\def\douseattachment[#1][#2][#3][#4]% tag title newname filename
{\iffourthargument
- \setgvalue{\??at:#1}{{#2}{#3}{#4}}% tooltip kind of case
+ \setgvalue{\??at:#1}{{#2}{#3}{#4}}% tooltip kind of case
\else\ifthirdargument
- \setgvalue{\??at:#1}{{#2}{#2}{#3}}% full path case
+ \setgvalue{\??at:#1}{{#2}{#2}{#3}}% full path case
\else\ifsecondargument
\setgvalue{\??at:#1}{{#2}{#2}{#2}}% obvious case
\else
- \setgvalue{\??at:#1}{{#1}{#1}{#1}}% worst case
+ \setgvalue{\??at:#1}{{#1}{#1}{#1}}% worst case
\fi\fi\fi}
\let\attachmenttitle\empty
@@ -2288,17 +2301,17 @@
\def\getattachmentdata[#1]%
{\edef\attachmenttitle{\filterfromvalue{\??at:#1}31}% description
\edef\attachmentname {\filterfromvalue{\??at:#1}32}% new name
- \edef\attachmentfile {\filterfromvalue{\??at:#1}33}% original
+ \edef\attachmentfile {\filterfromvalue{\??at:#1}33}% original
\expandafter\splitstring\attachmentname\at.\to\!!stringa\and\!!stringb
- \ifx\!!stringb\empty % no suffix, so we need to inherit it
+ \ifx\!!stringb\empty % no suffix, so we need to inherit it
\expandafter\splitstring\attachmentfile\at.\to\!!stringc\and\!!stringd
\edef\attachmentname{\attachmentname.\!!stringd}%
\fi}
-\def\attachment[#1]% currently title equals newname
- {\iflocation
+\def\attachment[#1]% currently title equals newname
+ {\iflocation
\doifundefinedelse{\??at:#1}
- {\writestatus\m!interactions6{#1}}%
+ {\writestatus\m!interactions6{#1}}%
{\doif\@@atstatus\v!start
{\bgroup
\getattachmentdata[#1]%
diff --git a/tex/context/base/core-itm.tex b/tex/context/base/core-itm.tex
index 18a4e0dae..69fe63dec 100644
--- a/tex/context/base/core-itm.tex
+++ b/tex/context/base/core-itm.tex
@@ -283,17 +283,42 @@
\def\unknownitemsymbol{?}
+% \def\setitemmark#1% % en pas op: resets \docommando
+% {\doifelsenothing{#1}
+% {\edef\currentitemsymbol{\itemlevel}}
+% {\edef\currentitemsymbol{#1}}%
+% \doifsymboldefinedelse\currentitemsymbol
+% {\setxvalue{\@@globalitemsymbol\itemlevel}{\currentitemsymbol}%
+% \setgvalue{\@@localitemsymbol \itemlevel}{\unknownitemsymbol}%
+% \def\listitem{\symbol[\currentitemsymbol]}%
+% \let\docommando\gobbleoneargument}
+% {\doifconversiondefinedelse\currentitemsymbol
+% {\setxvalue{\@@globalitemsymbol\itemlevel}{\currentitemsymbol}%
+% \setgvalue{\@@localitemsymbol \itemlevel}%
+% {\convertnumber{\currentitemsymbol}{\countervalue{\@@itemcounter\itemlevel}}}%
+% \iftextitems
+% \doifsomething{\getitemparameter\itemlevel\c!linkertekst}
+% {\let\tempsymbol\empty}%
+% \fi
+% \def\listitem
+% {\getitemparameter\itemlevel
+% {\iftextitems\c!linkertekst\else\c!links\fi}%
+% \getvalue{\@@localitemsymbol\itemlevel}\tempsymbol
+% \getitemparameter\itemlevel
+% {\iftextitems\c!rechtertekst\else\c!rechts\fi}}%
+% \let\docommando\gobbleoneargument}
+% {\let\listitem\empty}}}
+
\def\setitemmark#1% % en pas op: resets \docommando
- {\doifelsenothing{#1}
- {\edef\currentitemsymbol{\itemlevel}}
- {\edef\currentitemsymbol{#1}}%
- \doifsymboldefinedelse\currentitemsymbol
- {\setxvalue{\@@globalitemsymbol\itemlevel}{\currentitemsymbol}%
+ {\doifsymboldefinedelse{#1}
+ {\edef\currentitemsymbol{#1}%
+ \setxvalue{\@@globalitemsymbol\itemlevel}{\currentitemsymbol}%
\setgvalue{\@@localitemsymbol \itemlevel}{\unknownitemsymbol}%
\def\listitem{\symbol[\currentitemsymbol]}%
- \let\docommando\gobbleoneargument}
- {\doifconversiondefinedelse\currentitemsymbol
- {\setxvalue{\@@globalitemsymbol\itemlevel}{\currentitemsymbol}%
+ \let\@@opsymbool\empty}% \let\docommando\gobbleoneargument}
+ {\doifconversiondefinedelse{#1}
+ {\edef\currentitemsymbol{#1}%
+ \setxvalue{\@@globalitemsymbol\itemlevel}{\currentitemsymbol}%
\setgvalue{\@@localitemsymbol \itemlevel}%
{\convertnumber{\currentitemsymbol}{\countervalue{\@@itemcounter\itemlevel}}}%
\iftextitems
@@ -306,8 +331,8 @@
\getvalue{\@@localitemsymbol\itemlevel}\tempsymbol
\getitemparameter\itemlevel
{\iftextitems\c!rechtertekst\else\c!rechts\fi}}%
- \let\docommando\gobbleoneargument}
- {\let\listitem\empty}}}
+ \let\@@opsymbool\empty}%\let\docommando\gobbleoneargument}
+ {}}}
\def\calculatelistwidth#1#2% distance deals with 'broad'
{#2=\getitemparameter{#1}\c!afstand\relax
@@ -464,6 +489,105 @@
\fi
\expanded{\redostartitemgroup[\itemgroupoptions]}}% [#2]
+% \def\redostartitemgroup[#1][#2]%
+% {\setfalse\inlinelistitem % new, no indent (leftskip)
+% \setfalse\concatnextitem % new, concat
+% \ifhmode
+% \ifconditional\autoconcatnextitem % new, concat
+% \ifdim\lastskip=\itemsignal % new, concat
+% \settrue\concatnextitem % new, concat
+% \fi % new, concat
+% \fi % new, concat
+% \iftextitems\else\doifnotinset\v!tekst{#1}\par\fi % suboptimal
+% \fi
+% \begingroup
+% \ifnum\itemlevel=\plusone % NIEUW
+% \doadaptleftskip{\getitemparameter1\c!marge}%
+% \fi
+% \dosetraggedcommand{\getitemparameter\itemlevel\c!uitlijnen}\raggedcommand
+% \doifsomething{\getitemparameter\itemlevel\c!inspringen}
+% {% is \expanded needed?
+% \expanded{\setupindenting[\getitemparameter\itemlevel\c!inspringen]}}%
+% \doifinset\v!kolommen{#1}%
+% {\ifbinnenkolommen\else\ifnum\itemcolumndepth=\zerocount
+% \globallet\itemcolumndepth\itemlevel
+% \getitemparameter\itemlevel\c!voor
+% \processfirstactioninset
+% [#1]
+% [ \v!een=>\!!counta1\relax,
+% \v!twee=>\!!counta2\relax,
+% \v!drie=>\!!counta3\relax,
+% \v!vier=>\!!counta4\relax,
+% \v!vijf=>\!!counta5\relax,
+% \s!unknown=>\@EA\!!counta\getitemparameter\itemlevel\c!n]%
+% % new
+% \edef\columneditemleftskip{\the\leftskip}%
+% \def\postprocesscolumnbox##1%
+% {\scratchdimen\columneditemleftskip
+% \divide\scratchdimen \nofcolumns
+% \hbox{\hskip\columneditemleftskip\hbox{\box##1}}}%
+% \scratchdimen-\columneditemleftskip
+% \multiply\scratchdimen \nofcolumns
+% \advance\scratchdimen \columneditemleftskip
+% \advance\scratchdimen \hsize
+% \edef\columntextwidth{\the\scratchdimen}%
+% \leftskip\zeropoint
+% % so far
+% \startkolommen
+% [\c!n=\!!counta, % netter \??op\itemlevel\c!n
+% \c!hoogte=,
+% \c!lijn=\v!uit,
+% \c!balanceren=\v!ja,
+% \c!uitlijnen=\v!nee]%
+% \fi\fi}%
+% \doifinsetelse\v!intro{#1}\itemintrotrue\itemintrofalse
+% \doglobal\increment\noflists
+% \let\currentlist\noflists
+% \newcounter\noflistelements
+% \headitemfalse
+% \subitemfalse
+% \symbolitemfalse
+% \let\marsymbol\relax
+% \globallet\somdestination\empty
+% \let\symsymbol\empty
+% \the\itemgroupcommands
+% \setitemlevel{#1}%
+% %\getitemparameter\itemlevel\empty
+% \doifelsenothing{#1} % iffirstargument
+% {\edef\@@opsymbool{\getitemparameter\itemlevel\c!symbool}%
+% \letgvalueempty{\@@globalitemsymbol\itemlevel}%
+% \global\letitemparameter\itemlevel\v!verder\empty
+% \setitemmark\@@opsymbool
+% \dosetupitemgroupvariable[\itemlevel][#2]}
+% {\dosetupitemgroupconstant[\itemlevel][#1]%
+% \dosetupitemgroupvariable[\itemlevel][#2]%
+% \doifinsetelse\v!verder{#1}% \noexpand, else problems in non-etex with chinese
+% {\edef\@@opsymbool{\noexpand\getvalue{\@@globalitemsymbol\itemlevel}}%
+% \getitemparameter\itemlevel\v!verder}
+% {\edef\@@opsymbool{\noexpand\getitemparameter{\itemlevel}{\c!symbool}}%
+% \global\setitemparameter\itemlevel\v!verder
+% {\dosetupitemgroupconstant[\itemlevel][#1]%
+% \dosetupitemgroupvariable[\itemlevel][#2]}}%
+% \def\docommando##1% \setitemmark resets \docommando
+% {\doifnot{##1}{0}{\setitemmark{##1}}}%
+% \processcommalist[#1,\@@opsymbool]\docommando}%
+% \ifautoitemintro\ifnum\prevgraf<3
+% \itemintrotrue
+% \fi\fi
+% \ifparagraphitems
+% \ifnum\itemlevel>\plusone
+% \letitemparameter\itemlevel\c!tussen\empty
+% \fi
+% \else\ifpackeditems
+% \letitemparameter\itemlevel\c!tussen\empty
+% \fi\fi
+% \calculatelistwidth\itemlevel{\dimen0}%
+% \ifdim\dimen0>\zeropoint\relax
+% \ifconditional\inlinelistitem\else
+% \advance\leftskip \dimen0\relax
+% \fi
+% \fi}
+
\def\redostartitemgroup[#1][#2]%
{\setfalse\inlinelistitem % new, no indent (leftskip)
\setfalse\concatnextitem % new, concat
@@ -528,11 +652,12 @@
\the\itemgroupcommands
\setitemlevel{#1}%
%\getitemparameter\itemlevel\empty
+ \let\listitem\empty % ** start value
\doifelsenothing{#1} % iffirstargument
{\edef\@@opsymbool{\getitemparameter\itemlevel\c!symbool}%
\letgvalueempty{\@@globalitemsymbol\itemlevel}%
\global\letitemparameter\itemlevel\v!verder\empty
- \setitemmark\@@opsymbool
+ % \setitemmark\@@opsymbool % ** default value
\dosetupitemgroupvariable[\itemlevel][#2]}
{\dosetupitemgroupconstant[\itemlevel][#1]%
\dosetupitemgroupvariable[\itemlevel][#2]%
@@ -545,7 +670,14 @@
\dosetupitemgroupvariable[\itemlevel][#2]}}%
\def\docommando##1% \setitemmark resets \docommando
{\doifnot{##1}{0}{\setitemmark{##1}}}%
- \processcommalist[#1,\@@opsymbool]\docommando}%
+ % \processcommalist[#1,\@@opsymbool]\docommando
+ \processcommalist[#1]\docommando}% ** preset sequence or provided sequence
+ \ifx\listitem\empty
+ \setitemmark\@@opsymbool % ** default value
+ \ifx\listitem\empty
+ \edef\currentitemsymbol{\itemlevel}% ** fall back
+ \fi
+ \fi
\ifautoitemintro\ifnum\prevgraf<3
\itemintrotrue
\fi\fi
@@ -647,6 +779,22 @@
\appendtoks \letvalue\v!kop \itemgrouphead \to \itemgroupcommands
\appendtoks \letvalue\v!its \itemgroupitems \to \itemgroupcommands
\appendtoks \letvalue\v!mar \itemgroupmargin \to \itemgroupcommands
+
+% Sometimes the user demands get pretty weird:
+%
+% \startitemize
+% \item test
+% \item test
+% \headsym{xx} test \par test
+% \stopitemize
+
+\def\itemgroupheadsym#1%
+ {\def\symsymbol{\doitemattributes\itemlevel\c!symletter\c!symkleur{#1}}%
+ \symbolitemtrue
+ \headitemtrue
+ \doitemgrouphead}
+
+\appendtoks \let\headsym \itemgroupheadsym \to \itemgroupcommands
\def\itembreak % -10
{\flushnotes\penalty-5\relax}
@@ -840,15 +988,24 @@
\definecomplexorsimpleempty\head
\definecomplexorsimpleempty\doitemgrouphead
+% \def\sym#1%
+% {\noindent
+% \begingroup
+% \setbox\scratchbox\hbox{\trialtypesettingtrue#1}%
+% \setbox\scratchbox\hbox
+% \ifdim\wd\scratchbox<1em to 1.5\else spread 1\fi em{#1\hfil}%
+% \hangindent\wd\scratchbox
+% \box\scratchbox
+% \endgroup
+% \ignorespaces}
+
\def\sym#1%
{\noindent
\begingroup
- \setbox\scratchbox\hbox{#1}%
+ \setbox\scratchbox\hbox{\trialtypesettingtrue#1}%
\setbox\scratchbox\hbox
\ifdim\wd\scratchbox<1em to 1.5\else spread 1\fi em{#1\hfil}%
- \hangindent\wd\scratchbox
- \box\scratchbox
- \endgroup
+ \expanded{\box\scratchbox\endgroup\hangindent\the\wd\scratchbox}%
\ignorespaces}
\setupitemgroups % undocumented
@@ -914,4 +1071,4 @@
% \def\stopitemize {\stopitemgroup}
% \def\setupitemize {\setupitemgroup[\v!itemize]}
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/core-lnt.tex b/tex/context/base/core-lnt.tex
new file mode 100644
index 000000000..b1082bd01
--- /dev/null
+++ b/tex/context/base/core-lnt.tex
@@ -0,0 +1,236 @@
+%D \module
+%D [ file=core-lnt,
+%D version=2002.05.10,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=Line Notes,
+%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 Core Macros / Line Notes}
+
+%D This module loads on top of the footnote and line numbering macros.
+
+\unprotect
+
+\newcounter\linenotecounter
+\newtoks \collectedlinenotes
+\newif \iftracelinenotes
+
+\appendtoks
+ \the\collectedlinenotes
+\to \everylinenumber
+
+\appendtoks
+ \global\collectedlinenotes\emptytoks
+\to \beforeeverylinenumbering
+
+% \def\handlelinenote#1#2%
+% {\bgroup
+% \expanded{\beforesplitstring#1}\at--\to\linenotelinenumber
+% \ifnum\linenotelinenumber=\linenumber\relax
+% % todo: \onlyfootnote{#1}{#2}% == configurable
+% \setupfootnotes[\c!nummercommando=\gobbleoneargument]%
+% \footnotetext{#1: #2}%
+% \fi
+% \egroup}
+
+\def\dohandlelinenote#1#2#3%
+ {\bgroup
+ \expanded{\beforesplitstring#2}\at--\to\linenotelinenumber
+ \ifnum\linenotelinenumber=\linenumber\relax
+ % todo: \onlyfootnote{#2}{#3}% == configurable
+ \setupnote[#1][\c!nummercommando=\gobbleoneargument]%
+ \setnotetext[#1]{#2: #3}%
+ \fi
+ \egroup}
+
+% \def\tracedlinenote#1%
+% {\iftracelinenotes
+% \hbox to \zeropoint
+% {\forgetall
+% \localcolortrue
+% \hsize\zeropoint
+% \hss
+% \vbox to \strutheight{\llap{\red\infofont\setstrut\linenotecounter}\vss}%
+% {\blue\vl}%
+% \vbox to \strutheight{\rlap{\red\infofont\setstrut#1}\vss}%
+% \hss}%
+% \prewordbreak
+% \fi}
+
+\def\dotracedlinenote#1%
+ {\iftracelinenotes
+ \hbox to \zeropoint
+ {\forgetall
+ \localcolortrue
+ \hsize\zeropoint
+ \hss
+ \vbox to \strutheight{\llap{\red\infofont\setstrut\linenotecounter}\vss}%
+ {\blue\vl}%
+ \vbox to \strutheight{\rlap{\red\infofont\setstrut#1}\vss}%
+ \hss}%
+ \prewordbreak
+ \fi}
+
+% \def\linenote#1%
+% {\doglobal\increment\linenotecounter
+% \doifreferencefoundelse{\??rr:\linenotecounter}%
+% {\doglobal\@EA\appendtoks\@EA\handlelinenote\@EA
+% {\currenttextreference}{#1}\to\collectedlinenotes}
+% \donothing
+% \tracedlinenote\empty
+% \expanded{\eenregel[\??rr:\linenotecounter]}}
+
+\def\dolinenote#1#2%
+ {\doglobal\increment\linenotecounter
+ \doifreferencefoundelse{\??rr:\linenotecounter}%
+ {\expanded{\doglobal\noexpand\appendtoks\noexpand\dohandlelinenote
+ {#1}{\currenttextreference}}{#2}\to\collectedlinenotes}
+ \donothing
+ \dotracedlinenote\empty
+ \expanded{\eenregel[\??rr:\linenotecounter]}}
+
+% \def\startlinenote[#1]#2%
+% {\doifreferencefoundelse{\??rr:#1}%
+% {\doglobal\@EA\appendtoks\@EA\handlelinenote\@EA
+% {\currenttextreference}{#2}\to\collectedlinenotes}
+% \donothing
+% \tracedlinenote{#1}%
+% \startregel[\??rr:#1]}
+
+\def\dostartlinenote#1[#2]#3%
+ {\doifreferencefoundelse{\??rr:#2}%
+ {\expanded{\doglobal\noexpand\appendtoks\noexpand\dohandlelinenote
+ {#1}{\currenttextreference}}{#3}\to\collectedlinenotes}
+ \donothing
+ \dotracedlinenote{#2}%
+ \startregel[\??rr:#2]}
+
+% \def\stoplinenote[#1]%
+% {\stopregel[\??rr:#1]}
+
+\def\dostoplinenote#1[#2]%
+ {\stopregel[\??rr:#2]}
+
+% defining them
+
+\def\definelinenote
+ {\dodoubleempty\dodefinelinenote}
+
+\def\dodefinelinenote[#1][#2]%
+ {\definenote[#1][#2]%
+ \setvalue {#1}{\dolinenote {#1}}%
+ \setvalue{\e!start#1}{\dostartlinenote{#1}}%
+ \setvalue{\e!stop #1}{\dostoplinenote {#1}}}
+
+\def\setuplinenote % convenient
+ {\setupnote}
+
+% We predefine one, namely \type {\linenote} cum suis.
+
+\definelinenote[\v!linenote]
+
+% \startbuffer[test]
+% \startlinenumbering[100]
+% test \linenote {oeps} test test test test test test
+% test \startlinenote [well] {oeps} test test test test test test
+% test \linenote {oeps} test test test test test test
+% test \linenote {oeps} test test test test test test
+% test \linenote {oeps} test test test test test test
+% test \linenote {oeps} test test test test test test
+% test \stoplinenote [well] test test test test test test
+% \stoplinenumbering
+% \stopbuffer
+%
+% {\typebuffer[test] \getbuffer[test]} \page
+%
+% \startbuffer[setup]
+% \setuplinenumbering
+% [align=left]
+% \stopbuffer
+%
+% {\typebuffer[setup] \getbuffer[setup,test]} \page
+%
+% \startbuffer[setup]
+% \setuplinenumbering
+% [width=1em,
+% align=left]
+% \stopbuffer
+%
+% {\typebuffer[setup] \getbuffer[setup,test]} \page
+%
+% \startbuffer[setup]
+% \setuplinenumbering
+% [width=2em,
+% distance=.5em,
+% align=left]
+% \stopbuffer
+%
+% {\typebuffer[setup] \getbuffer[setup,test]} \page
+%
+% \startbuffer[setup]
+% \setuplinenumbering
+% [width=2em,
+% align=middle]
+% \stopbuffer
+%
+% {\typebuffer[setup] \getbuffer[setup,test]} \page
+%
+% \startbuffer[setup]
+% \setuplinenumbering
+% [conversion=romannumerals,
+% start=1,
+% step=1,
+% location=text,
+% style=slanted,
+% color=blue,
+% width=1.5em]
+% \stopbuffer
+%
+% {\typebuffer[setup] \startnarrower\getbuffer[setup,test]\stopnarrower} \page
+%
+% \startbuffer[setup]
+% \setuplinenumbering
+% [width=4em,
+% left=--,
+% right=--,
+% align=middle]
+% \stopbuffer
+%
+% {\typebuffer[setup] \getbuffer[setup,test]} \page
+%
+% \startbuffer[setup-1]
+% \setuplinenumbering
+% [style=\bfxx,
+% command=\WatchThis]
+% \stopbuffer
+%
+% \startbuffer[setup-2]
+% \def\WatchThis#1%
+% {\ifodd\linenumber
+% \definecolor[linecolor][red]%
+% \else
+% \definecolor[linecolor][green]%
+% \fi
+% \inframed
+% [offset=1pt,frame=off,background=color,backgroundcolor=linecolor]
+% {#1}}
+% \stopbuffer
+%
+% {\typebuffer[setup-1,setup-2] \getbuffer[setup-1,setup-2,test]} \page
+%
+% \startbuffer[setup-1]
+% \setuplinenumbering
+% [location=inright,
+% style=\bfxx,
+% command=\WatchThis]
+% \stopbuffer
+%
+% {\typebuffer[setup-1] \getbuffer[setup-1,setup-2,test]} \page
+
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/core-mak.tex b/tex/context/base/core-mak.tex
index 040cce8c7..0d41bd8f5 100644
--- a/tex/context/base/core-mak.tex
+++ b/tex/context/base/core-mak.tex
@@ -8,8 +8,8 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
\writestatus{loading}{Context Core Macros / General Makeup Commands}
@@ -18,12 +18,12 @@
% \definieerplaats[naam][instellingen]
% \stelplaatsin[naam][instellingen]
% \plaats<naam>[[instellingen]]
-%
+%
% - still undocumented and also not in setupb yet
% - kan ook intern/direct (scheelt duplicatie), zie \framedtext
\def\dodefineplacement[#1][#2]%
- {\getparameters
+ {\getparameters
[\??pl#1]
[\c!links=\hss,
\c!rechts=\hss,
@@ -32,7 +32,7 @@
\c!marge=\v!standaard,
\c!grid=\v!midden,
%\c!voor=,
- %\c!na=,
+ %\c!na=,
#2]%
\setvalue{\e!plaats#1}{\doplacement[\??pl#1]}}
@@ -48,8 +48,8 @@
\def\doplacement
{\dodoubleempty\dodoplacement}
-% \def\dodoplacement[#1][#2]% correctie moet mooier
-% {\bgroup
+% \def\dodoplacement[#1][#2]% correctie moet mooier
+% {\bgroup
% \dowithnextbox
% {\setlocalhsize
% \getparameters[#1][#2]%
@@ -66,8 +66,8 @@
% \egroup}
% \vbox}
-\def\dodoplacement[#1][#2]% correctie moet mooier
- {\bgroup
+\def\dodoplacement[#1][#2]% correctie moet mooier
+ {\bgroup
\dowithnextboxcontent
{\forgetall}
{\setlocalhsize
@@ -81,10 +81,10 @@
\getvalue{#1\c!rechts}}%
\ifinsidefloat \else
\addlocalbackgroundtobox\nextbox
- \fi
- \ifgridsnapping
+ \fi
+ \ifgridsnapping
\doifundefined{#1\c!grid}{\letvalue{#1\c!grid}\v!midden}%
- % unchecked
+ % unchecked
\doifinset{\getvalue{#1\c!marge}}{\v!standaard,\v!ja}\noindent
\snaptogrid[\getvalue{#1\c!grid}]\hbox{\flushnextbox}%
\else
@@ -93,10 +93,10 @@
\flushnextbox
\doifvalue{#1\c!dieptecorrectie}\v!aan\baselinecorrection
\doifvalue{#1\c!regelcorrectie }\v!aan\stopbaselinecorrection
- \fi
+ \fi
\endgroup
\getvalue{#1\c!na}%
\egroup}
\vbox}
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/core-mar.tex b/tex/context/base/core-mar.tex
index 0882c2bc4..55aaf660e 100644
--- a/tex/context/base/core-mar.tex
+++ b/tex/context/base/core-mar.tex
@@ -105,9 +105,9 @@
\let\geenmarkering\empty
-\def\fetchmark[#1][#2]% never \unexpanded
- {\@EA\@EA\csname\??mk\??mk#2\endcsname
- \csname\??mk\hoofdmarkering{#1}\endcsname}
+% \def\fetchmark[#1][#2]% never \unexpanded
+% {\@EA\@EA\csname\??mk\??mk#2\endcsname
+% \csname\??mk\hoofdmarkering{#1}\endcsname}
\beginTEX
@@ -123,7 +123,9 @@
\def\fetchmark[#1][#2]% never \unexpanded
{\ifcsname\??mk#1\c!koppeling\endcsname
- \@EA\@EA\csname\??mk\??mk#2\endcsname
+ % \@EA\@EA\csname\??mk\??mk#2\endcsname
+ % \csname\??mk\csname\??mk#1\c!koppeling\endcsname\endcsname
+ \csname\??mk\??mk#2\@EA\endcsname
\csname\??mk\csname\??mk#1\c!koppeling\endcsname\endcsname
\fi}
diff --git a/tex/context/base/core-mat.tex b/tex/context/base/core-mat.tex
index 4604c9c75..ccdccb2e5 100644
--- a/tex/context/base/core-mat.tex
+++ b/tex/context/base/core-mat.tex
@@ -28,14 +28,6 @@
\ifx\text\undefined \let\text\hbox \fi
-% will move to page-ini
-
-\newevery \everybeginofpar \EveryBeginOfPar
-\newevery \everyendofpar \EveryEndOfPar
-
-\def\bpar{\the\everybeginofpar}
-\def\epar{\the\everyendofpar\endgraf}
-
\newdimen\lastlinewidth
% does not work at all
@@ -59,6 +51,7 @@
\ifoptimizedisplayspacing\ifmmode\else\ifhmode
\bgroup
\forgetdisplayskips
+ \displaywidowpenalty\widowpenalty % brrr, else widowpenalty does not work
\everymath\emptytoks
\everydisplay\emptytoks
$$\strut\global\lastlinewidth\predisplaysize$$
@@ -70,7 +63,7 @@
\def\resetlastlinewidth
{\global\lastlinewidth\zeropoint\relax}
-\appendtoks \setlastlinewidth \to \everyendofpar
+% not here: \appendtoks \setlastlinewidth \to \everyendofpar
%D moved from main-001
@@ -78,18 +71,18 @@
%
%\newevery \everymath \EveryMath
-\abovedisplayskip = \!!zeropoint
-\abovedisplayshortskip = \!!zeropoint % evt. 0pt minus 3pt
-\belowdisplayskip = \!!zeropoint
-\belowdisplayshortskip = \!!zeropoint % evt. 0pt minus 3pt
+\abovedisplayskip = \zeropoint
+\abovedisplayshortskip = \zeropoint % evt. 0pt minus 3pt
+\belowdisplayskip = \zeropoint
+\belowdisplayshortskip = \zeropoint % evt. 0pt minus 3pt
-\predisplaypenalty = 0
-\postdisplaypenalty = 0 % -5000 gaat mis, zie penalty bij \paragraaf
+\predisplaypenalty = \zerocount
+\postdisplaypenalty = \zerocount % -5000 gaat mis, zie penalty bij \paragraaf
% we don't use the skip's
\def\displayskipsize#1#2% obsolete
- {\ifdim\tussenwit>\!!zeropoint
+ {\ifdim\tussenwit>\zeropoint
#1\tussenwit\!!plus#2\tussenwit\!!minus#2\tussenwit\relax
\else
#1\lineheight\!!plus#2\lineheight\!!minus#2\lineheight\relax
@@ -118,8 +111,8 @@
\advance#1 -#3\relax}
\def\setdisplayskips % obsolete
- {\setdisplayskip\abovedisplayskip \abovedisplayskipsize \!!zeropoint
- \setdisplayskip\belowdisplayskip \belowdisplayskipsize \!!zeropoint
+ {\setdisplayskip\abovedisplayskip \abovedisplayskipsize \zeropoint
+ \setdisplayskip\belowdisplayskip \belowdisplayskipsize \zeropoint
\setdisplayskip\abovedisplayshortskip\abovedisplayshortskipsize\baselineskip
\setdisplayskip\belowdisplayshortskip\belowdisplayshortskipsize\baselineskip}
@@ -200,6 +193,8 @@
\setvalue{\e!start#1\v!formule}{\dostartformula{#1}}%
\setvalue{\e!stop #1\v!formule}{\dostopformula}}}
+\newtoks \everysetupformulas \relax % we need a hook for extensions in modules
+
\def\setupformulas
{\dodoubleempty\dosetupformulas}
@@ -208,7 +203,11 @@
\getparameters[\??fm#1][#2]%
\else
\getparameters[\??fm][#1]%
- \fi}
+ \fi
+ \the\everysetupformulas}
+
+\def\formulaparameter#1%
+ {\csname\??fm\currentformula#1\endcsname}
\setupformulas
[\c!wijze=\@@nrwijze,
@@ -234,17 +233,15 @@
\def\leftdisplayskip {\leftskip}
\def\rightdisplayskip {\rightskip}
-\def\leftdisplaymargin {\getvalue{\??fm\currentformula\c!linkermarge}}
-\def\rightdisplaymargin {\getvalue{\??fm\currentformula\c!rechtermarge}}
-\def\displaygridsnapping{\getvalue{\??fm\currentformula\c!grid}}
+\def\leftdisplaymargin {\formulaparameter\c!linkermarge}
+\def\rightdisplaymargin {\formulaparameter\c!rechtermarge}
+\def\displaygridsnapping{\formulaparameter\c!grid}
\def\beforedisplayspace
- {\doifnotvalue{\??fm\currentformula\c!voorwit}\v!geen
- {\blanko[\getvalue{\??fm\currentformula\c!voorwit}]}}
+ {\doifnot{\formulaparameter\c!voorwit}\v!geen{\blanko[\formulaparameter\c!voorwit]}}
\def\afterdisplayspace
- {\doifnotvalue{\??fm\currentformula\c!nawit}\v!geen
- {\blanko[\getvalue{\??fm\currentformula\c!nawit}]}}
+ {\doifnot{\formulaparameter\c!nawit }\v!geen{\blanko[\formulaparameter\c!nawit ]}}
\def\setpredisplaysize#1%
{\predisplaysize#1\relax
@@ -278,12 +275,27 @@
\def\dostartformula#1%
{\dodoubleempty\dodostartformula[#1]}
+\newskip\formulaparskip
+\newskip\formulastrutht
+\newskip\formulastrutdp
+
+% hm, invoke otr in hmode in order to move skips to mvl, could be an option
+
\def\dodostartformula[#1][#2]% setting leftskip adaption is slow !
- {\bgroup
+ {% todo: test first
+ %
+ % \ifdim\lastskip>\zeropoint
+ % \resetlastlinewidth % else problems with in between stuff without \epar
+ % \fi
+ \bgroup
+ \formulaparskip\parskip
+ \formulastrutdp\strutdepth
+ \formulastrutht\strutheight
\switchtoformulabodyfont[#2]%
+ \parskip\formulaparskip
\def\currentformula{#1}%
- \doifvaluesomething{\??fm\currentformula\c!marge}% so we test first
- {\dosetleftskipadaption{\getvalue{\??fm\currentformula\c!marge}}%
+ \doifsomething{\formulaparameter\c!marge}% so we test first
+ {\dosetleftskipadaption{\formulaparameter\c!marge}%
\edef\leftdisplaymargin{\the\leftskipadaption}}% overloaded
\long\def\dostartformula##1{\bgroup\let\dostopformula\egroup}%
\freezedimenmacro\leftdisplayskip
@@ -300,7 +312,7 @@
\else
\resetlastlinewidth
\fi
- \getvalue{\e!start\getvalue{\??fm\currentformula\c!variant}\v!formule}}
+ \getvalue{\e!start\formulaparameter\c!variant\v!formule}}
\def\switchtoformulabodyfont{\switchtobodyfont}
@@ -317,7 +329,7 @@
\def\dostopformula
{\doplaceformulanumber
- \getvalue{\e!stop\getvalue{\??fm\currentformula\c!variant}\v!formule}%
+ \getvalue{\e!stop\formulaparameter\c!variant\v!formule}%
\resetlastlinewidth
\nonoindentation
\dochecknextindentation{\??fm\currentformula}%
@@ -325,6 +337,50 @@
\newif\ifinformula
+% \def\startdisplaymath
+% {\ifgridsnapping
+% \beforedisplayspace
+% \snapmathtogrid\vbox
+% \bgroup
+% \informulatrue
+% %\forgetall % breaks side floats
+% \else
+% \bgroup
+% \informulatrue
+% %\forgetall % otherwise backgrounds fail
+% \ifdim\lastskip<\zeropoint\else
+% \par
+% \ifvmode \ifdim\parskip>\zeropoint\relax
+% \vskip-\parskip
+% \fi \fi
+% \fi
+% \doif\displaygridcorrection{-\v!boven}{\kern-\strutht}% new, currently only option/default
+% \beforedisplayspace
+% \par
+% \ifvmode
+% \verticalstrut
+% \vskip-\struttotal
+% \vskip-\baselineskip
+% \fi
+% \fi
+% $$\setdisplaydimensions
+% \setpredisplaysize\lastlinewidth
+% \startinnermath}
+
+% \def\stopdisplaymath
+% {\stopinnermath
+% $$%
+% \ifgridsnapping
+% \egroup
+% \afterdisplayspace
+% \else
+% \par\ifvmode\ifdim\parskip>\zeropoint\vskip-\parskip\fi\fi
+% \afterdisplayspace
+% \egroup
+% \fi
+% \globallet\displaylinecorrection\empty
+% \gdef\displaygridcorrection{\displaygridsnapping}}
+
\def\startdisplaymath
{\ifgridsnapping
\beforedisplayspace
@@ -334,13 +390,14 @@
%\forgetall % breaks side floats
\else
\bgroup
+ \parskip\formulaparskip % ! !
\informulatrue
%\forgetall % otherwise backgrounds fail
\ifdim\lastskip<\zeropoint\else
\par
- \ifvmode \ifdim\parskip>\zeropoint\relax
- \vskip-\parskip
- \fi \fi
+ \ifvmode \ifdim\parskip>\zeropoint\relax
+ \witruimte \vskip-\parskip % kind of forces and cancels again
+ \fi \fi
\fi
\doif\displaygridcorrection{-\v!boven}{\kern-\strutht}% new, currently only option/default
\beforedisplayspace
@@ -362,7 +419,7 @@
\egroup
\afterdisplayspace
\else
- \par\ifvmode\ifdim\parskip>\zeropoint\vskip-\parskip\fi\fi
+ \par\ifvmode\ifdim\parskip>\zeropoint\witruimte\vskip-\parskip\fi\fi
\afterdisplayspace
\egroup
\fi
@@ -570,13 +627,13 @@
%D modules.
\def\startinnermath
- {\getvalue{\e!start\??fm\getvalue{\??fm\currentformula\c!uitlijnen}}}
+ {\getvalue{\e!start\??fm\formulaparameter\c!uitlijnen}}
\def\stopinnermath
- {\getvalue{\e!stop \??fm\getvalue{\??fm\currentformula\c!uitlijnen}}}
+ {\getvalue{\e!stop \??fm\formulaparameter\c!uitlijnen}}
\def\mathinnerstrut
- {\doifvalue{\??fm\currentformula\c!strut}\v!ja\strut}
+ {\doif{\formulaparameter\c!strut}\v!ja\strut}
\long\def\defineinnermathhandler#1#2#3%
{\setvalue{\e!start\??fm#1}{#2}%
@@ -602,7 +659,7 @@
\ifx\@leqno\empty\else \ifcase#2
\rlap{\@leqno}%
\else
- \@leqno\hskip\getvalue{\??fm\currentformula\c!afstand}%
+ \@leqno\hskip\formulaparameter\c!afstand
\fi \fi
#1}
@@ -611,7 +668,7 @@
\ifx\@eqno\empty\else \ifcase#2
\llap{\@eqno}%
\else
- \hskip\getvalue{\??fm\currentformula\c!afstand}\@eqno
+ \hskip\formulaparameter\c!afstand\@eqno
\fi \fi
\egroup}
@@ -898,7 +955,7 @@
% \stop
%D \macros
-%D {enablesupersub}
+%D {enablesupersub,enablesimplesupersub}
%D
%D We can let \type {^} and \type {_} act like \type {\super}
%D and \type {\sub} by saying \type {\enablesupersub}.
@@ -912,7 +969,6 @@
\catcode`\_=\@@active
\def_{\ifmmode\expandafter\suber\else\expandafter\normalsuber\fi}}
\egroup
-
%D \macros
%D {enableautomath}
%D
diff --git a/tex/context/base/core-mis.tex b/tex/context/base/core-mis.tex
index 7a1f7910c..b4b84c414 100644
--- a/tex/context/base/core-mis.tex
+++ b/tex/context/base/core-mis.tex
@@ -831,7 +831,7 @@
% this will replace the quotation and speed definitions
-\newsignal\delimitedtextignal
+\newsignal\delimitedtextsignal
\def\delimitedtextparameter#1%
{\csname\??ci
@@ -965,7 +965,7 @@
{\bgroup
\setbox\scratchbox\hbox{#1}%
\ifdim\wd\scratchbox>\zeropoint
- \ifdim\lastskip=\delimitedtextignal
+ \ifdim\lastskip=\delimitedtextsignal
\unskip\hskip\hspaceamount\currentlanguage{interquotation}%
\else
#2%
@@ -975,7 +975,7 @@
\fi
\strut % new, needed below
\delimitedtextparameter#1%
- \penalty\!!tenthousand\hskip\delimitedtextignal % +- \prewordbreak
+ \penalty\!!tenthousand\hskip\delimitedtextsignal % +- \prewordbreak
\fi
\egroup}
@@ -1805,7 +1805,14 @@
[\??co#1][#2]}
\def\setupcombinations
- {\dodoubleargument\getparameters[\??co]}
+ {\dodoubleempty\dosetupcombinations}
+
+\def\dosetupcombinations[#1][#2]%
+ {\ifsecondargument
+ \getparameters[\??co#1][#2]%
+ \else
+ \getparameters[\??co][#1]%
+ \fi}
\def\startcombination
{\dodoubleempty\dostartcombination}
@@ -1974,7 +1981,7 @@
{\noalign
{\ifdim\ht\combinationstack>\zeropoint
\nointerlineskip % nieuw
- \@@cotussen
+ \combinationparameter\c!tussen
\global\horcombination\maxhorcombination
\globallet\doflushcombinationstack\dodoflushcombinationstack
\else
@@ -2135,7 +2142,7 @@
\hbox\bgroup % compatibility hack
\dowithnextbox
{\edef\@@rorotatie{#1}%
- \setbox\nextbox=\vbox{\flushnextbox}%
+ \setbox\nextbox\vbox{\flushnextbox}%
\dostoprotate
\egroup}}
@@ -2159,8 +2166,8 @@
\dostoprotation
#6}
#3}%
-\nextboxdp\zeropoint
-\flushnextbox
+ \nextboxdp\zeropoint
+ \flushnextbox
\egroup}
\def\dostoprotate
@@ -2234,9 +2241,9 @@
% \setdimensionfiguresize
% \convertfigureinsertscale\@@epx\figx\figxsca\scax
% \convertfigureinsertscale\@@epy\figy\figysca\scay
-% \scratchdimen\scax\s!pt \divide\scratchdimen 100
+% \scratchdimen\scax\points\divide\scratchdimen 100
% \edef\@@xysx{\withoutpt\the\scratchdimen}%
-% \scratchdimen\scay\s!pt \divide\scratchdimen 100
+% \scratchdimen\scay\points\divide\scratchdimen 100
% \edef\@@xysy{\withoutpt\the\scratchdimen}}}
% \def\doschaal[#1]%
@@ -2291,9 +2298,9 @@
\setdimensionfiguresize
\convertfigureinsertscale\@@epx\figx\figxsca\scax
\convertfigureinsertscale\@@epy\figy\figysca\scay
- \scratchdimen\scax\s!pt \divide\scratchdimen \plushundred
+ \scratchdimen\scax\points \divide\scratchdimen \plushundred
\edef\@@xysx{\withoutpt\the\scratchdimen}%
- \scratchdimen\scay\s!pt \divide\scratchdimen \plushundred
+ \scratchdimen\scay\points \divide\scratchdimen \plushundred
\edef\@@xysy{\withoutpt\the\scratchdimen}}}
\def\doschaal[#1]%
diff --git a/tex/context/base/core-nav.tex b/tex/context/base/core-nav.tex
index 1cad40c20..76e7e20d3 100644
--- a/tex/context/base/core-nav.tex
+++ b/tex/context/base/core-nav.tex
@@ -8,8 +8,8 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
\writestatus{loading}{Context Core Macros / Navigation}
@@ -17,14 +17,14 @@
%D Support for interactive document is very present in
%D \CONTEXT\ and interwoven in many modules. This means that in
-%D this module, where we deal with some common navigational
-%D features, there will be quite some forward references.
-%D
+%D this module, where we deal with some common navigational
+%D features, there will be quite some forward references.
+%D
%D When I started implementing hypertext support, the macros
%D were mostly dealing with things related to locations, that
%D is click in this location and goto that one. The
%D functionality of many macro depends on the output medium:
-%D paper or screen. The next boolean holds the state:
+%D paper or screen. The next boolean holds the state:
\newif\iflocation \def\ifinteractief{\iflocation} % upw comp
@@ -33,29 +33,29 @@
\newbox\locationbox
%D There is no interaction at all unless enabled by saying:
-%D
+%D
%D \starttypen
%D \setupinteraction[state=start]
%D \stoptypen
-%D
+%D
%D The other settings are:
-%D
+%D
%D \showsetup{\y!setupinteraction}
-%D
+%D
%D In the special driver modules we introduced a switch that
%D forces page destinations (instead of named ones). We set
-%D this switch here.
+%D this switch here.
-\def\setinteractionparameter#1#2% use with case, no checking done
+\def\setinteractionparameter#1#2% use with case, no checking done
{\setvalue{\??ia#1}{#2}} % pass #2, can be \blabla
-\def\resetinteractionparameter#1% use with case, no checking done
+\def\resetinteractionparameter#1% use with case, no checking done
{\letvalue{\??ia#1}\empty}
\def\setupinteraction
{\dosingleargument\dodosetupinteraction}
-\def\dodosetupinteraction[#1]% % \dosetupinteraction == special
+\def\dodosetupinteraction[#1]% % \dosetupinteraction == special
{\getparameters[\??ia][#1]%
\doifelse\@@iastatus\v!start
{\iflocation\else
@@ -67,9 +67,9 @@
\global\locationfalse
\fi}%
\iflocation
- \setsystemmode \v!interactie
+ \setsystemmode \v!interactie
\else
- \resetsystemmode\v!interactie
+ \resetsystemmode\v!interactie
\fi
\dosetuppageview\@@iafocus
\doifsomething\@@iabereken
@@ -116,22 +116,22 @@
%D comfortable properties, so we must force some minimal
%D dimensions. On the other hand button, and here I mean those
%D pieces of text with fancy outlines and/or backgrounds, often
-%D have fixed, preset dimensions.
-%D
+%D have fixed, preset dimensions.
+%D
%D To make things even worse, if we choose to let the optimal
%D dimensions depend on the height and depth of a strut, a not
%D too uncommon practice in \TEX, we have to deal with the fact
%D that such a strut, set inside a box, is unknown too the
-%D outside world.
-%D
-%D The solution lays in passing the strut characteristics in
-%D a proper way, in our case by applying \type{\presetgoto}:
-%D
-%D \starttypen
+%D outside world.
+%D
+%D The solution lays in passing the strut characteristics in
+%D a proper way, in our case by applying \type{\presetgoto}:
+%D
+%D \starttypen
%D {some piece of text \presetgoto}
%D \stoptypen
-%D
-%D This macro stores the current strut values.
+%D
+%D This macro stores the current strut values.
\newif\iflocationstrut
\newif\iflocationsplit
@@ -139,7 +139,7 @@
\def\resetgoto
{\globallet\@@ia@@hoogte\!!zeropoint
\globallet\@@ia@@diepte\!!zeropoint}
-
+
\resetgoto
\def\presetgoto
@@ -154,7 +154,7 @@
\globallet\@@ia@@diepte\@@iadiepte
\fi}
-%D In the macros that deal with making areas into hyperlinks,
+%D In the macros that deal with making areas into hyperlinks,
%D we use:
\def\dostartgoto\data#1\start#2\stop#3\dostopgoto
@@ -174,7 +174,7 @@
\buttonheight\ht0
\fi
\ifdim\dp0<\@@ia@@diepte\relax
- \dimen0=\@@ia@@diepte\relax % = !
+ \dimen0=\@@ia@@diepte\relax % = !
\else
\dimen0\dp0
\fi
@@ -183,28 +183,28 @@
{\lower\dimen0\hbox
{\mindermeldingen
\dimen0=.5\wd0 % direct skipping is faster of course
- \advance\dimen0 -.5\buttonwidth % buts this is nicer
+ \advance\dimen0 -.5\buttonwidth % buts this is nicer
\hskip\dimen0#2#3}}% when visualizing things
- \naturalhbox % needed for omega / moved from plus-omg
+ \naturalhbox % needed for omega / moved from plus-omg
{\ifreversegoto
\dimen0\wd0\box0\kern-\dimen0\smashbox2\box2\kern\dimen0
- \else
+ \else
\smashbox2\box2\box0
\fi}%
\resetgoto}%
\fi}
-%D The secondary references are processed but not typeset. The
-%D special driver must collect the data needed.
+%D The secondary references are processed but not typeset. The
+%D special driver must collect the data needed.
%D The width of the active area depends on the dimensions
%D preset, the actual dimens and/or the height and depth of the
-%D strut.
-%D
+%D strut.
+%D
%D Normally the hyper active area is laid on top of the text.
%D This enables stacking hyperlinks on top of each other. When,
%D for some reason the opposite is prefered, one can use the
-%D next boolean to signal this wish.
+%D next boolean to signal this wish.
\newif\ifreversegoto \reversegotofalse
@@ -213,11 +213,11 @@
%D possibly click. We've already seen a few macros that deal
%D with this visualization, something we definitely do not let
%D up to the viewer. One way of telling is using a distinctive
-%D typeface, another way is using color.
-%D
+%D typeface, another way is using color.
+%D
%D There are two colors involved: one for normal hyperlinks,
%D and one for those that point to the currentpage, the
-%D contrast color.
+%D contrast color.
\definecolor [interactioncolor] [r=0, g=.6, b=0]
\definecolor [interactioncontrastcolor] [r=.8, g=0, b=0]
@@ -228,7 +228,7 @@
%D The next few macros are responsible for highlighting hyper
%D links. The first one, \type{\showlocation}, is used in those
%D situations where the typeface is handled by the calling
-%D macro.
+%D macro.
\def\interactioncolor
{\iflocation
@@ -244,7 +244,7 @@
\def\showlocation#1%
{\iflocation\color[\@@iakleur]{#1\presetgoto}\else#1\fi}
-%D When local color settings are to be used, we can use the
+%D When local color settings are to be used, we can use the
%D next macro, where \type{#1} is a tag like \type{\??tg} and
%D \type{#2} some text.
@@ -255,8 +255,8 @@
#2%
\fi}
-%D When we're dealing with pure page references, contrast
-%D colors are used when we are already at the page mentioned.
+%D When we're dealing with pure page references, contrast
+%D colors are used when we are already at the page mentioned.
\def\showcontrastlocation#1#2#3% the \@EA is needed
{\iflocation
@@ -272,15 +272,15 @@
\fi}
%D The next simple macro can be used in color specifications,
-%D like \type{\color[\locationcolor{green}]}.
+%D like \type{\color[\locationcolor{green}]}.
\def\locationcolor#1%
{\iflocation#1\fi}
-%D More tokens are spend when we want both typeface and color
-%D highlighting.
+%D More tokens are spend when we want both typeface and color
+%D highlighting.
-\def\dolocationattributes#1#2#3#4%
+\def\dolocationattributes#1#2#3#4%
{\bgroup
\let\fontattribute\empty
\let\colorattribute\empty
@@ -296,7 +296,7 @@
\def\navigating
{\dolocationattributes\??ia\c!letter\c!kleur}
-%D Although not decently supported in current viewers, a
+%D Although not decently supported in current viewers, a
%D provisory hiding mechanims is implemented. Areas marked as
%D such, are visible on screen, but invisible on paper. Don't
%D trust this mechanism yet!
@@ -309,7 +309,7 @@
\let\startinteractie = \relax
\let\stopinteractie = \relax
-% in the future:
+% in the future:
%
% eerst boolean invoeren bij menu, achtergrond, balk, button
% enz; verder startinteractie een argument meegeven {#1} ->
@@ -321,11 +321,11 @@
\ifnum\normalmonth<10 0\fi\the\normalmonth
\ifnum\normalday <10 0\fi\the\normalday}
-% happens in core-fld
+% happens in core-fld
%
-% \definereference [AtOpenInitializeForm] [\v!geen]
+% \definereference [AtOpenInitializeForm] [\v!geen]
-\setupinteraction % start fit page and reset form
+\setupinteraction % start fit page and reset form
[\c!status=\v!stop,
\c!pagina=\v!nee,
\c!klik=\v!ja,
@@ -345,15 +345,15 @@
\c!strut=\v!ja,
\c!splitsen=\v!ja,
\c!kleur=interactioncolor,
- \c!contrastkleur=interactioncontrastcolor,
+ \c!contrastkleur=interactioncontrastcolor,
\c!symboolset=,
\c!breedte=1em,
\c!hoogte=\!!zeropoint,
\c!diepte=\!!zeropoint,
- \c!titel=\jobname, % needed for fdf/x
+ \c!titel=\jobname, % needed for fdf/x
\c!subtitel=,
\c!auteur=,
\c!trefwoord=,
\c!datum=\@@iatimestamp]
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/core-new.tex b/tex/context/base/core-new.tex
index aee564701..31870a0c1 100644
--- a/tex/context/base/core-new.tex
+++ b/tex/context/base/core-new.tex
@@ -269,6 +269,8 @@
% \long\def\dostartsetups#1#2% watch out: not \grabuntil
% {\dograbuntil#1{\egroup\long\setvalue{\??su#2}}}
+% todo : \startsetups[name][XML] \setups[name][XML]
+
\expanded
{\long\def\@EA\noexpand\csname\e!start\v!instellingen\endcsname
{\bgroup\noexpand\doifnextcharelse[%
@@ -277,11 +279,15 @@
\letvalue{\e!stop\v!instellingen}\relax
-\def\setups % {..} or [..]
+\unexpanded \def\setups % {..} or [..]
{\doifnextcharelse\bgroup\dosetupsA\dosetupsB}
+\unexpanded \def\setup % {..} or [..]
+ {\doifnextcharelse\bgroup\dosetups\dosetupsC}
+
\def\dosetupsA #1{\processcommalist[#1]\dosetups} % {..}
\def\dosetupsB[#1]{\processcommalist[#1]\dosetups} % [..]
+\def\dosetupsC[#1]{\dosetups{#1}} % [..]
\def\dosetups#1% the grid option will be extended to other main modes
{\executeifdefined{\??su\ifgridsnapping\v!grid\fi:#1}{\csname\??su:#1\endcsname}\relax}
diff --git a/tex/context/base/core-not.tex b/tex/context/base/core-not.tex
index 1340bbb59..84ecf1198 100644
--- a/tex/context/base/core-not.tex
+++ b/tex/context/base/core-not.tex
@@ -1,8 +1,8 @@
%D \module
%D [ file=core-not,
-%D version=1997.09.15,
+%D version=2002.05.10, % 1997.09.15
%D title=\CONTEXT\ Core Macros,
-%D subtitle=Footnote Handling,
+%D subtitle=Note Handling, % Footnote Handling
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
@@ -11,9 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\writestatus{loading}{Context Core Macros / Footnote Handling}
-
-%D BEWARE: THIS MODULE IS REPLACED BY A NEW VERSION (FOR IDRIS)
+\writestatus{loading}{Context Core Macros / Note Handling}
%D Unfortunately we cannot force an even number of lines in
%D a two column footnote placement.
@@ -28,9 +26,9 @@
%D Footnotes are can be characterized by three components:
%D
%D \startopsomming[opelkaar]
-%D \som a small number \voetnoot{a footnote number} or
-%D symbol {\stelvoetnotenin[conversie=set 2]\voetnoot{a
-%D footnote}}
+%D \som a small number \voetnoot {a footnote number} or
+%D symbol {\stelvoetnotenin [conversie=set 2]\voetnoot
+%D {a footnote}}
%D \som and a similar mark at the bottom of the page
%D \som followed by some additional text
%D \stopopsomming
@@ -41,15 +39,13 @@
%D taken into account in the pagebreak calculations. This kind
%D of calculations are forced by using \type{\insert}.
-\installinsertion\footins
-
%D \macros
-%D {setupfootnotes,setupfootnotedefinition}
+%D {setupnote,setupnotedefinition}
%D
%D We can influence footnote typesetting with the setup
%D command:
%D
-%D \showsetup{\y!setupfootnotes}
+%D \showsetup{\y!setupfootnotes} % ! !
%D
%D It's sort of a custom to precede footnotes by a horizontal
%D rule and although fancy rules like
@@ -70,163 +66,310 @@
\newif\ifendnotes \endnotesfalse
\newif\ifbottomnotes \bottomnotestrue
+\newif\ifclevernotes \clevernotesfalse % being [plaats=kolommen]
-%D The footnoterule can be a graphic and therefore calling this
-%D setup macro at every skipswitch is tricky (many many MP
-%D runs). Let's just reserve a few points, that probably match
-%D those of the stretch component.
+%D The next definitions indicate that we can frame the footnote
+%D area. The footnotes themselves are treated as definitions.
+%D
+%D \showsetup{\y!setupfootnotes}
-\def\setupfootnotedefinition%
- {\steldoordefinierenin[\??vn\??vn]}
+\let\currentnote\v!voetnoot
-\doordefinieren
- [\??vn\??vn]
- [\c!plaats=\v!inlinker,
- \c!breedte=\v!passend,
- \c!kopletter=\@@vnletter,
- \c!kopkleur=\@@vnkleur,
- \c!voor=,
- \c!na=]
+\def\noteparameter #1{\csname\??vn \currentnote#1\endcsname}
+\def\notedefparameter #1{\csname\??vn\??vn\currentnote#1\endcsname}
+\def\footnoteparameter #1{\csname\??vn \v!voetnoot#1\endcsname}
-\presetlocalframed
- [\??vn]
+\def\startnotedef {\csname\e!start\??vn\??vn\currentnote\endcsname}
+\def\stopnotedef {\csname\e!stop \??vn\??vn\currentnote\endcsname}
-%D The previous definitions indicate that we can frame
-%D the footnote area. The footnotes themselves are treated as
-%D definitions.
-%D
-%D \showsetup{\y!setupfootnotes}
+\def\noteinsertion #1{\csname\??vn:#1\endcsname}
+\def\currentnoteins {\csname\??vn:\currentnote\endcsname}
+\def\currentsaveins {\csname\??vn-\currentnote\endcsname}
+\def\localpostponednotes {\csname\??vn+\currentnote\endcsname}
-\newif\ifcleverfootnotes % being [plaats=kolommen]
+\def\backupnoteins #1{\@EA\backupinsertion\csname\??vn:#1\endcsname}
+\def\currentbackupnoteins{\@EA\backupinsertion\csname\??vn:\currentnote\endcsname}
-\def\setupfootnotes
- {\dosingleempty\dosetupfootnotes}
+%D The numbers that accompany a footnote are generated using
+%D the standard \CONTEXT\ numbering mechanism, and thereby can
+%D be assigned on a per whatever sectioning basis.
-\def\dodofootnoterule
- {\ifvmode
- \color
- [\@@vnlijnkleur]
- {\hrule\!!width.2\hsize\!!height\@@vnlijndikte\!!depth\!!zeropoint}%
- \kern\strutdepth
+\let\noteinsertions\empty
+
+\def\doprocessnotes#1#2% #1 may be { ... }
+ {\def\currentnote{#2}#1}
+
+\def\doprocessnotescs#1#2% #1 == \cs that takes arg
+ {\def\currentnote{#2}\@EA#1\csname\??vn:\currentnote\endcsname}
+
+\def\processnotes #1{\processcommacommand[\noteinsertions]{\doprocessnotes {#1}}}
+\def\processnotescs#1{\processcommacommand[\noteinsertions]{\doprocessnotescs#1}}
+
+\def\savenotecontent {\processnotescs\saveinsertionbox }
+\def\erasenotebackup {\processnotescs\eraseinsertionbackup}
+\def\savenotedata {\processnotescs\saveinsertiondata }
+\def\restorenotecontent{\processnotescs\restoreinsertionbox }
+\def\restorenotedata {\processnotescs\restoreinsertiondata}
+
+%D ... due to invisibility of inserts ... maybe save them twice
+%D and split new part ... todo ...
+
+\def\doenablenotes
+ {\global\count\currentnoteins1000
+ \global\skip \currentnoteins1\baselineskip\relax}
+
+\def\dodisablenotes
+ {\global\count\currentnoteins\zerocount
+ \global\skip \currentnoteins\zeropoint}
+
+\def\enablenotes {\processnotes\doenablenotes }
+\def\disablenotes{\processnotes\dodisablenotes}
+
+\def\dosavenotes
+ {\global\setbox\currentsaveins\vbox
+ {\ifvoid\currentsaveins\else\unvbox\currentsaveins\fi
+ \box\currentnoteins}}
+
+\def\doflushsavednotes
+ {\ifvoid\currentsaveins\else
+ \insert\currentnoteins{\unvbox\currentsaveins}%
\fi}
-%D The following switch can be used to disable limiting the
-%D height of the footnote area, something that is needed in
-%D multi column balancing. Use this switch with care.
+\def\savenotes {\processnotes\dosavenotes }
+\def\flushsavednotes{\processnotes\doflushsavednotes}
-\newif\iffootnotelimit \footnotelimittrue
+%D Both these parameters are coupled to the setup command we
+%D will implement in a moment. This means that, given a
+%D suitable symbol set, symbols can be used instead of numbers,
+%D by saying:
+%D
+%D \starttypen
+%D \setupfootnotes[conversion=set 2]
+%D \stoptypen
-\def\dosetupfootnotes[#1]%
- {\iffirstargument
- \getparameters[\??vn][#1]%
+\def\definenote
+ {\dodoubleempty\dodefinenote}
+
+\def\dodefinenote[#1][#2]%
+ {\def\currentnote{#1}%
+ \ifundefined{\??vn:\currentnote}%
+ \@EA\installinsertion \csname\??vn:\currentnote\endcsname\relax
+ \@EA\installbackupinsertion\csname\??vn:\currentnote\endcsname\relax
+% \@EA\newbox\csname\??vn::\currentnote\endcsname % scratch box % needed ?
+ \@EA\newbox\csname\??vn+\currentnote\endcsname % local box
+ \doglobal\addtocommalist{#1}\noteinsertions
+ \doordefinieren
+ [\??vn\??vn\currentnote]
+ [\c!plaats=\v!inlinker,
+ \c!breedte=\v!passend,
+ \c!kopletter=\noteparameter\c!letter,
+ \c!kopkleur=\noteparameter\c!kleur,
+ \c!voor=,
+ \c!na=]%
+ \presetlocalframed
+ [\??vn\currentnote]%
+ \getparameters
+ [\??vn\currentnote]
+ [\c!plaats=\v!pagina,
+ \c!wijze=\v!per\v!deel,
+ \c!sectienummer=\v!nee,
+ \c!conversie=,
+ \c!lijn=\v!aan,
+ \c!voor=\blanko,
+ \c!korps=\v!klein,
+ \c!letter=,
+ \c!kleur=,
+ \c!na=,
+ \c!lijnkleur=,
+ \c!lijndikte=\linewidth,
+ \c!kader=\v!uit,
+ \c!margeafstand=.5em,
+ \c!kolomafstand=1em,
+ \c!afstand=.125em,
+ \c!uitlijnen=\v!normaal,
+ \c!tolerantie=\v!soepel,
+ \c!splitsen=\v!soepel,
+ %\c!breedte=\zetbreedte,
+ %\c!breedte=\ifdim\hsize<\zetbreedte\hsize\else\zetbreedte\fi,
+ \c!breedte=\defaultnotewidth,
+ \c!hoogte=\teksthoogte,
+ \c!nummercommando=\high,
+ \c!commando=\noteparameter\c!nummercommando, % downward compatible
+ \c!scheider=\@@koscheider,
+ \c!tekstcommando=\high,
+ \c!tekstletter=\tx,
+ \c!tekstkleur=,
+ \c!n=1]%
+ \definieernummer
+ [\currentnote]
+ [\c!wijze=\noteparameter\c!wijze,
+ \c!sectienummer=\noteparameter\c!wijze,
+ \c!conversie=\noteparameter\c!conversie]%
+ \letvalue{\??vn\c!lijn:\currentnote}\normalnoterule
+ \unexpanded\setvalue{\currentnote}{\setnote[#1]}%
+ \unexpanded\setvalue{\currentnote\v!tekst}{\setnotetext[#1]}%
+ \setupnote[\currentnote][#2]%
+ \fi}
+
+\def\setupnotedefinition[#1]%
+ {\steldoordefinierenin[\??vn\??vn#1]}
+
+\def\setupnote
+ {\dodoubleempty\dosetupnote}
+
+\def\dosetupnote[#1][#2]%
+ {\edef\currentnote{#1}%
+ \ifsecondargument
+ \getparameters
+ [\??vn\currentnote][#2]%
\processaction
- [\@@vnlijn]
- [ \v!aan=>\let\dofootnoterule\dodofootnoterule,
- \v!uit=>\let\dofootnoterule\relax,
- \s!default=>\let\dofootnoterule\relax,
- \s!unknown=>\let\dofootnoterule\@@vnlijn]%
- \processaction
- [\@@vnsplitsen]
- [ \v!soepel=>\footnotepenalty\zeropoint,
- \v!streng=>\footnotepenalty9999,
- \v!zeerstreng=>\footnotepenalty\maxdimen,
- \s!default=>\footnotepenalty\zeropoint,
- \s!unknown=>\footnotepenalty\commalistelement]%
+ [\noteparameter\c!lijn]
+ [ \v!aan=>\letvalue{\??vn\c!lijn:\currentnote}\normalnoterule,
+ \v!uit=>\letvalue{\??vn\c!lijn:\currentnote}\relax,
+ \s!default=>\letvalue{\??vn\c!lijn:\currentnote}\relax,
+ \s!unknown=>\setvalue{\??vn\c!lijn:\currentnote}{\noteparameter\c!lijn}]%
+ \processaction % todo
+ [\noteparameter\c!splitsen]
+ [ \v!soepel=>\notepenalty\zeropoint,
+ \v!streng=>\notepenalty9999,
+ \v!zeerstreng=>\notepenalty\maxdimen,
+ \s!default=>\notepenalty\zeropoint,
+ \s!unknown=>\notepenalty\commalistelement]%
\fi
- \setfootnotedistance
- \count\footins1000
- \ExpandBothAfter\doifinsetelse\v!kolommen\@@vnplaats
- {\cleverfootnotestrue % global ?
+ \dochecknote}
+
+\def\dolocalsetupnotes#1#2%
+ {\ifsecondargument
+ \edef\noteinsertions{#1}%
+ \processnotes{\setupnote[\currentnote][#2]}%
+ \else\iffirstargument
+ \doifassignmentelse{#1}
+ {\processnotes{\setupnote[\currentnote][#1]}}
+ {\edef\noteinsertions{#1}}%
+ \fi\fi}
+
+\def\dochecknote % for the moment no mixed text/endnotes modes
+ {\setnotedistance
+ \count\currentnoteins1000
+ %ExpandBothAfter\doifinsetelse\v!kolommen{\noteparameter\c!plaats}
+ \ExpandBothAfter\doifinsetelse\v!kolommen{\footnoteparameter\c!plaats}
+ {\clevernotestrue % global ?
\ifnum\@@kln=\zerocount
\scratchcounter\plusone
\else
- \scratchcounter\@@vnn
+ %scratchcounter\noteparameter\c!n\relax
+ \scratchcounter\footnoteparameter\c!n\relax
\fi
\global\endnotesfalse
\global\bottomnotestrue
- \setcleverfootnotes}
- {\cleverfootnotesfalse
- \ifnum\@@vnn=\zerocount
- \settextfootnotes
+ \setclevernotes}
+ {\clevernotesfalse
+ \ifnum\noteparameter\c!n=\zerocount
+ \settextnotes
\scratchcounter\plusone
\else
- \setcolumnfootnotes
- \scratchcounter\@@vnn
- \divide\count\footins \scratchcounter
+ \setcolumnnotes
+ \scratchcounter\noteparameter\c!n\relax
+ \divide\count\currentnoteins \scratchcounter
\fi
- \ExpandBothAfter\doifinsetelse\v!pagina\@@vnplaats
+ %ExpandBothAfter\doifinsetelse\v!pagina{\noteparameter\c!plaats}
+ \ExpandBothAfter\doifinsetelse\v!pagina{\footnoteparameter\c!plaats}
{\global\endnotesfalse
- \ExpandBothAfter\doifinsetelse\v!hoog\@@vnplaats
+ %ExpandBothAfter\doifinsetelse\v!hoog{\noteparameter\c!plaats}
+ \ExpandBothAfter\doifinsetelse\v!hoog{\footnoteparameter\c!plaats}
{\global\bottomnotesfalse}
{\global\bottomnotestrue}}
{\global\endnotestrue
\global\bottomnotestrue
- \postponefootnotes}}%
- \iffootnotelimit
- \dimen\footins\@@vnhoogte
- \multiply\dimen\footins \scratchcounter
+ \postponenotes}}%
+ \ifnotelimit
+ \dimen\currentnoteins\noteparameter\c!hoogte
+ \multiply\dimen\currentnoteins \scratchcounter
+ \fi}
+
+\def\checknotes
+ {\processnotes\dochecknote}
+
+%D The noterule can be a graphic and therefore calling this
+%D setup macro at every skipswitch is tricky (many many MP
+%D runs). Let's just reserve a few points, that probably match
+%D those of the stretch component.
+
+\def\placenoterule
+ {\getvalue{\??vn\c!lijn:\currentnote}}
+
+\def\normalnoterule
+ {\ifvmode
+ \color
+ [\noteparameter\c!lijnkleur]
+ {\hrule
+ \!!width .2\hsize
+ \!!height\noteparameter\c!lijndikte
+ \!!depth \zeropoint}%
+ \kern\strutdepth
\fi}
-\def\checknotes{\setupfootnotes\relax} % will be replaced
+%D The following switch can be used to disable limiting the
+%D height of the footnote area, something that is needed in
+%D multi column balancing. Use this switch with care.
+
+\newif\ifnotelimit \notelimittrue
-\def\setfootnotedistance
+\def\setnotedistance
{\setbox\scratchbox\vbox
{\forgetall
- \@@vnvoor
- \dofootnoterule
- \@@vnna}%
- \global\skip\footins\ht\scratchbox
+ \noteparameter\c!voor
+ \placenoterule
+ \noteparameter\c!na}%
+ \global\skip\currentnoteins\ht\scratchbox
\setbox\scratchbox\box\voidb@x} % scratchbox can be in use
-\ifx\setfootnotehsize\undefined
+\ifx\setnotehsize\undefined
- \def\setfootnotehsize{\hsize\@@vnbreedte} % can be overloaded
+ \def\setnotehsize{\hsize\noteparameter\c!breedte} % can be overloaded
\fi
-\def\setcleverfootnotes
- {\def\startpushfootnote {\bgroup % wellicht ooit kopuitlijnen
- \stelinmargein[\c!uitlijnen=\v!links]%
- \getvalue{\e!start\??vn\??vn}}%
- \def\stoppushfootnote {\getvalue{\e!stop\??vn\??vn}%
- \egroup}%
- \let\startpopfootnotes \donothing
- \let\stoppopfootnotes \donothing}
-
-\def\setcolumnfootnotes
- {\def\startpushfootnote {\setfootnotehsize % possibly overloaded
- \setrigidcolumnhsize\hsize\@@vnkolomafstand\@@vnn
- \bgroup
- \stelinmargein[\c!uitlijnen=\v!links]%
- \getvalue{\e!start\??vn\??vn}}%
- \def\stoppushfootnote {\getvalue{\e!stop\??vn\??vn}%
- \egroup}%
- \def\startpopfootnotes {\bgroup
- \setfootnotehsize
- \setrigidcolumnhsize\hsize\@@vnkolomafstand\@@vnn
- \setbox0\vbox\bgroup}%
- \def\stoppopfootnotes {\egroup
- \setbox0\vbox
- {\unvbox0\setbox0\lastbox
- \ifvbox0\unvbox\else\box\fi0}%
- \rigidcolumnbalance0\egroup}}
-
-\def\settextfootnotes
- {\def\startpushfootnote {\startvboxtohbox
- \dostartattributes\??vn\c!letter\c!kleur{}}%
- \def\stoppushfootnote {\hskip\@@vnkolomafstand % plus.5em minus.5em
- \dostopattributes
- \stopvboxtohbox}%
- \def\startpopfootnotes {\vbox\bgroup
- \doifnotinset\@@vnbreedte{\v!passend,\v!ruim}
- {\setfootnotehsize}%
- \beginofshapebox}%
- \def\stoppopfootnotes {\endofshapebox
- \reshapebox
- {\ifhbox\shapebox\unhbox\else\box\fi\shapebox
- \endgraf}%
- \flushshapebox
- \egroup}}
+\def\setclevernotes
+ {\def\startpushnote {\bgroup % wellicht ooit kopuitlijnen
+ \stelinmargein[\c!uitlijnen=\v!links]%
+ \startnotedef}%
+ \def\stoppushnote {\stopnotedef
+ \egroup}%
+ \let\startpopnotes \donothing
+ \let\stoppopnotes \donothing}
+
+\def\setcolumnnotes
+ {\def\startpushnote {\setnotehsize % possibly overloaded
+ \setrigidcolumnhsize\hsize{\noteparameter\c!kolomafstand}{\noteparameter\c!n}%
+ \bgroup
+ \stelinmargein[\c!uitlijnen=\v!links]%
+ \startnotedef}%
+ \def\stoppushnote {\stopnotedef
+ \egroup}%
+ \def\startpopnotes {\bgroup
+ \setnotehsize
+ \setrigidcolumnhsize\hsize{\noteparameter\c!kolomafstand}{\noteparameter\c!n}%
+ \setbox0\vbox\bgroup}%
+ \def\stoppopnotes {\egroup
+ \setbox0\vbox
+ {\unvbox0\setbox0\lastbox
+ \ifvbox0\unvbox\else\box\fi0}%
+ \rigidcolumnbalance0\egroup}}
+
+\def\settextnotes
+ {\def\startpushnote {\startvboxtohbox
+ \dostartattributes{\??vn\currentnote}\c!letter\c!kleur{}}%
+ \def\stoppushnote {\hskip\noteparameter\c!kolomafstand % plus.5em minus.5em
+ \dostopattributes
+ \stopvboxtohbox}%
+ \def\startpopnotes {\vbox\bgroup
+ \doifnotinset{\noteparameter\c!breedte}{\v!passend,\v!ruim}\setnotehsize
+ \beginofshapebox}%
+ \def\stoppopnotes {\endofshapebox
+ \reshapebox{\ifhbox\shapebox\unhbox\else\box\fi\shapebox\endgraf}%
+ \flushshapebox
+ \egroup}}
%D The formatting depends on the width of the table, so we
%D have to set \type {n} to zero.
@@ -244,25 +387,6 @@
%D \stoplocalfootnotes
%D \stoptypen
-%D The numbers that accompany a footnote are generated using
-%D the standard \CONTEXT\ numbering mechanism, and thereby can
-%D be assigned on a per whatever sectioning basis.
-
-\definieernummer
- [\v!voetnoot]
- [\c!wijze=\@@vnwijze,
- \c!sectienummer=\@@vnwijze,
- \c!conversie=\@@vnconversie]
-
-%D Both these parameters are coupled to the setup command we
-%D will implement in a moment. This means that, given a
-%D suitable symbol set, symbols can be used instead of numbers,
-%D by saying:
-%D
-%D \starttypen
-%D \setupfootnotes[conversion=set 2]
-%D \stoptypen
-
%D \macros
%D {footnote}
%D
@@ -305,30 +429,31 @@
%D merge this functionality with the existing \type {\note}
%D functionality.
-\newif\iffootnotesymbol
+\newif\ifnotesymbol
-\unexpanded\def\footnote {\dodoubleempty\dofootnote[1]}
-\unexpanded\def\footnotetext{\dodoubleempty\dofootnote[0]}
+\unexpanded\def\setnote {\dotripleempty\dosetnote[1]}
+\unexpanded\def\setnotetext{\dotripleempty\dosetnote[0]}
-\def\dofootnote[#1][#2]%
+\def\dosetnote[#1][#2][#3]%
{\unskip
+ \def\currentnote{#2}%
\ifcase#1\relax
- \global\footnotesymbolfalse
+ \global\notesymbolfalse
\else
- \global\footnotesymboltrue
+ \global\notesymboltrue
\fi
\ifvisible
\ifreshapingbox
\@EAEAEA\gobbletwoarguments
\else
- \@EAEAEA\dodofootnote
+ \@EAEAEA\dodonote
\fi
\else % todo: \iftrialtypesetting
\@EA\gobbletwoarguments
- \fi{#2}}
+ \fi{#3}}
%D \macros
-%D {footnotesenabled}
+%D {notesenabled}
%D
%D Before we come to typesetting a footnote, we first check
%D if we have to typeset a number. When a \type{-} is passed
@@ -336,65 +461,65 @@
%D temporary disable footnotes by saying
%D
%D \starttypen
-%D \footnotesenabledfalse
+%D \notesenabledfalse
%D \stoptypen
%D
%D which can be handy while for instance typesetting tables
%D of contents. The pagewise footnote numbering is dedicated
%D to Han The Thanh, who needed it first.
-\newif\iffootnotesenabled \footnotesenabledtrue
+\newif\ifnotesenabled \notesenabledtrue
-\newconditional\pagewisefootnotes % saves two hash entries
+\newconditional\pagewisenotes % saves two hash entries
-\def\lastfootnotepage{1}
+\def\lastnotepage{1}
\def\domovednote#1#2%
- {\ifconditional\pagewisefootnotes
+ {\ifconditional\pagewisenotes
\doifreferencefoundelse{\s!fnt:t:\internalfootreference}
{\let\savedrealreference\currentrealreference
\doifreferencefoundelse{\s!fnt:f:\internalfootreference}
{\ifnum\savedrealreference<\currentrealreference\relax\symbol[#1]\else
\ifnum\savedrealreference>\currentrealreference\relax\symbol[#2]\fi\fi}
- {}}
- {}
+ \donothing}
+ \donothing
\fi}
-\def\dodofootnote
- {\iffootnotesenabled
+\def\dodonote
+ {\ifnotesenabled
\iftrialtypesetting
- \@EAEAEA\nododofootnote
+ \@EAEAEA\nododonote
\else
- \@EAEAEA\dododofootnote
+ \@EAEAEA\dododonote
\fi
\else
\@EA\gobbletwoarguments
\fi}
-\def\nododofootnote#1%
+\def\nododonote#1%
{\doifnot{#1}{-}{\kern.5em}% quick hack, approximation
\gobbleoneargument}
-\def\dododofootnote#1%
+\def\dododonote#1%
{\doglobal\increment\internalfootreference
- \doifelse\@@vnwijze{\v!per\v!pagina}
- {\settrue \pagewisefootnotes}
- {\setfalse\pagewisefootnotes}%
+ \doifelse{\noteparameter\c!wijze}{\v!per\v!pagina}
+ {\settrue\pagewisenotes}
+ {\setfalse\pagewisenotes}%
\doifelse{#1}{-}
- {\let\footnotenumber\empty}
- {\ifconditional\pagewisefootnotes
+ {\let\lastnotenumber\empty}
+ {\ifconditional\pagewisenotes
\doifreferencefoundelse{\s!fnt:t:\internalfootreference}
- {\ifnum\currentrealreference>\lastfootnotepage\relax
- \global\let\lastfootnotepage\currentrealreference
- \resetnummer[\v!voetnoot]%
+ {\ifnum\currentrealreference>\lastnotepage\relax
+ \globallet\lastnotepage\currentrealreference
+ \resetnumber[\currentnote]%
\fi}
{}%
\fi
- \verhoognummer[\v!voetnoot]%
- \maakhetnummer[\v!voetnoot]%
- \rawreference\s!fnt{#1}{\hetnummer}%
- \let\footnotenumber\hetnummer}%
- \dostartfootnote}
+ \verhoognummer[\currentnote]%
+ \maakhetnummer[\currentnote]%
+ \rawreference\s!fnt{#1}\hetnummer
+ \let\lastnotenumber\hetnummer}%
+ \dostartnote}
%D The main typesetting routine is more or less the same as the
%D \PLAIN\ \TEX\ one, except that we only handle one type while
@@ -402,7 +527,7 @@
%D footnotes can be handled by a straight insert, but we do so
%D by using an indirect call to the \type{\insert} primitive.
-\let\localfootinsert=\insert
+\let\localnoteinsert=\insert
%D Making footnote numbers active is not always that logical,
%D especially when we keep the reference and text at one page.
@@ -415,97 +540,114 @@
\newcounter\internalfootreference
-\let\startpushfootnote = \relax
-\let\stoppushfootnote = \relax
+\let\startpushnote=\relax
+\let\stoppushnote =\relax
-\newsignal\footnotesignal
-\newcount \footnotepenalty
+\newsignal\notesignal
+\newcount \notepenalty
-\footnotepenalty=0 % needed in order to split in otrset
+\notepenalty=0 % needed in order to split in otrset
-\def\dostartfootnote% nog gobble als in pagebody
+\newconditional\processingnote
+
+\def\dostartnote% nog gobble als in pagebody
{\bgroup
+ \settrue\processingnote
%\restorecatcodes % to be tested first
\ifinregels % otherwise problems with \type <crlf> {xxx}
\ignorelines % makes footnotes work in \startlines ... \stoplines
\fi
- \iffootnotesymbol
+ \ifnotesymbol
\dolastnotesymbol
\else
\unskip\unskip
- \global\let\lastnotesymbol\dolastnotesymbol
+ \globallet\lastnotesymbol\dolastnotesymbol
\fi
\ignorespaces
- \localfootinsert\footins\bgroup
- \penalty\footnotepenalty
+ \localnoteinsert\currentnoteins\bgroup
+ \penalty\notepenalty
\forgetall
- \setfootnotebodyfont
+ \setnotebodyfont
\redoconvertfont % to undo \undo calls in in headings etc
\splittopskip\strutht % not actually needed here
\splitmaxdepth\strutdp % not actually needed here
\iffixedlayoutdimensions % ugly hack, will change
- \linkermargeafstand\@@vnmargeafstand
+ \linkermargeafstand\noteparameter\c!margeafstand
\rechtermargeafstand\linkermargeafstand
\else
- \def\linkermargeafstand{\@@vnmargeafstand}%
+ \def\linkermargeafstand{\noteparameter\c!margeafstand}%
\let\rechtermargeafstand\linkermargeafstand
\fi
- \ifcase\@@vnn\relax % new 31-07-99 ; always ?
- \doifnotinset\@@vnbreedte{\v!passend,\v!ruim}
- {\setfootnotehsize}%
+ \ifcase\noteparameter\c!n\relax % new 31-07-99 ; always ?
+ \doifnotinset{\noteparameter\c!breedte}{\v!passend,\v!ruim}\setnotehsize
\fi
- \startpushfootnote
- {\ifx\footnotenumber\empty \else
-\preparethenumber\??vn\footnotenumber\preparednumber
+ \startpushnote
+ {\ifx\lastnotenumber\empty \else
+ \preparethenumber{\??vn\currentnote}\lastnotenumber\preparednumber
\iflocation
- \naarbox{\@@vnnummercommando
-% {\footnotenumber\domovednote\v!volgendepagina\v!vorigepagina}}%
-{\preparednumber\domovednote\v!volgendepagina\v!vorigepagina}}%
+ \naarbox{\noteparameter\c!commando % was \c!nummercommando, but compatible
+ {\preparednumber\domovednote\v!volgendepagina\v!vorigepagina}}%
[\s!fnt:f:\internalfootreference]%
\else
- \@@vnnummercommando
-% {\footnotenumber\domovednote\v!volgendepagina\v!vorigepagina}%
-{\preparednumber\domovednote\v!volgendepagina\v!vorigepagina}%
+ \noteparameter\c!nummercommando
+ {\preparednumber\domovednote\v!volgendepagina\v!vorigepagina}%
\fi
\fi
\iflocation
\rawreference\s!fnt{\s!fnt:t:\internalfootreference}{}%
- \else\ifconditional\pagewisefootnotes
+ \else\ifconditional\pagewisenotes
\rawreference\s!fnt{\s!fnt:t:\internalfootreference}{}%
\fi\fi}%
\bgroup
- \postponefootnotes
- \aftergroup\dostopfootnote
+ \postponenotes
+ \aftergroup\dostopnote
\begstrut
\let\next}
-\def\dostopfootnote
+\def\dostopnote
{\endstrut
- \stoppushfootnote
+ \stoppushnote
\egroup
\egroup
- \kern\footnotesignal\relax} % \relax is needed to honor spaces
-
-\let\lastnotesymbol\empty
-
-\def\dolastnotesymbol%
+ \kern\notesignal\relax} % \relax is needed to honor spaces
+
+% \def\dolastnotesymbol
+% {\unskip\unskip
+% \ifdim\lastkern=\notesignal
+% \high{\kern\noteparameter\c!afstand}% gets the font right, hack !
+% \fi
+% \nobreak
+% \iflocation
+% \naarbox
+% {\high{\tx\lastnotenumber\domovednote\v!vorigepagina\v!volgendepagina}}%
+% [\s!fnt:t:\internalfootreference]%
+% \rawreference\s!fnt{\s!fnt:f:\internalfootreference}{}%
+% \else
+% \high{\tx\lastnotenumber\domovednote\v!vorigepagina\v!volgendepagina}%
+% \ifconditional\pagewisenotes
+% \rawreference\s!fnt{\s!fnt:f:\internalfootreference}{}%
+% \fi
+% \fi
+% \globallet\lastnotesymbol\relax}
+
+\def\dolastnotesymbol
{\unskip\unskip
- \ifdim\lastkern=\footnotesignal
- \high{\kern\@@vnafstand}% gets the font right, hack !
+ \ifdim\lastkern=\notesignal
+ \dodonotesymbol{\kern\noteparameter\c!afstand}% gets the font right, hack !
\fi
\nobreak
\iflocation
\naarbox
- {\high{\tx\footnotenumber\domovednote\v!vorigepagina\v!volgendepagina}}%
+ {\dodonotesymbol{\lastnotenumber\domovednote\v!vorigepagina\v!volgendepagina}}%
[\s!fnt:t:\internalfootreference]%
\rawreference\s!fnt{\s!fnt:f:\internalfootreference}{}%
\else
- \high{\tx\footnotenumber\domovednote\v!vorigepagina\v!volgendepagina}%
- \ifconditional\pagewisefootnotes
+ \dodonotesymbol{\lastnotenumber\domovednote\v!vorigepagina\v!volgendepagina}%
+ \ifconditional\pagewisenotes
\rawreference\s!fnt{\s!fnt:f:\internalfootreference}{}%
\fi
\fi
- \global\let\lastnotesymbol\relax}
+ \globallet\lastnotesymbol\relax}
\let\lastnotesymbol\relax
@@ -519,64 +661,87 @@
%D
%D This command is implemented rather straightforward as:
-\definecomplexorsimple\note
-
-\def\complexnote[#1]%
- {\iffootnotesenabled
- \ifx\lastnotesymbol\relax
- \bgroup
- \unskip
- \naarbox{\high{\tx\currenttextreference}}[#1]%
- \egroup
+\def\notesymbol
+ {\dodoubleempty\donotesymbol}
+
+% \def\donotesymbol[#1][#2]%
+% {\bgroup
+% \ifnotesenabled
+% \def\currentnote{#1}%
+% \ifsecondargument
+% \ifx\lastnotesymbol\relax
+% \unskip
+% \naarbox{\high{\tx\currenttextreference}}[#2]%
+% \else
+% \lastnotesymbol
+% \fi
+% \else
+% \lastnotesymbol
+% \fi
+% \fi
+% \egroup}
+
+\def\dodonotesymbol#1%
+ {\noteparameter\c!tekstcommando{\doattributes{\??vn\currentnote}\c!tekstletter\c!tekstkleur{#1}}}
+
+\def\donotesymbol[#1][#2]%
+ {\bgroup
+ \ifnotesenabled
+ \def\currentnote{#1}%
+ \ifsecondargument
+ \ifx\lastnotesymbol\relax
+ \unskip
+ \naarbox{\dodonotesymbol\currenttextreference}[#2]%
+ \else
+ \lastnotesymbol
+ \fi
\else
\lastnotesymbol
\fi
- \fi}
-
-\def\simplenote%
- {\lastnotesymbol}
+ \fi
+ \egroup}
%D Normally footnotes are saved as inserts that are called upon
%D as soon as the pagebody is constructed. The footnote
%D insertion routine looks just like the \PLAIN\ \TEX\ one,
%D except that we check for the end note state.
-\let\startpopfootnotes = \relax
-\let\stoppopfootnotes = \relax
+\let\startpopnotes = \relax
+\let\stoppopnotes = \relax
-\def\placefootnoteinserts
- {%\ifvoid\footins \else % unsafe, strange
- \ifdim\ht\footins>\zeropoint
+\def\placenoteinserts
+ {%\ifvoid\currentnoteins \else % unsafe, strange
+ \ifdim\ht\currentnoteins>\zeropoint\relax
\ifendnotes \else
- \@@vnvoor
- \dofootnoterule % alleen in ..mode
+ \noteparameter\c!voor
+ \placenoterule % alleen in ..mode
\bgroup
- \setfootnotebodyfont
+ \setnotebodyfont
\setbox0\hbox
- {\startpopfootnotes
- \setfootnotebodyfont
+ {\startpopnotes
+ \setnotebodyfont
% % this should be checked, smells like a mix-up
-% % does not split: \ifcase\@@vnn\unvbox\else\box\fi\footins
-% \ifcase\@@vnn
- \box\footins
+% % does not split: \ifcase\noteparameter\c!n\unvbox\else\box\fi\currentnoteins
+% \ifcase\noteparameter\c!n
+ \box\currentnoteins
% \else
-% \unvbox\footins
+% \unvbox\currentnoteins
% \fi
% this is too ugly actually
- \stoppopfootnotes}%
+ \stoppopnotes}%
\localframed
- [\??vn]
+ [\??vn\currentnote]
[\c!breedte=\v!passend,
\c!hoogte=\v!passend,
\c!strut=\v!nee,
\c!offset=\v!overlay]
- {\ifdim\dp0=\zeropoint % this hack is needed because \vadjust
+ {\ifdim\dp0=\zeropoint % this hack is needed because \vadjust
\hbox{\lower\strutdp\box0}% % in margin number placement
\else % hides the (always) present depth
\box0
\fi}%
\egroup
- \@@vnna
+ \noteparameter\c!na
\fi
\fi}
@@ -586,7 +751,7 @@
%D deeply nested boxes. The general case looks like:
%D
%D \starttypen
-%D \postponefootnotes
+%D \postponenotes
%D \.box{whatever we want with footnotes}
%D \flushnotes
%D \stoptypen
@@ -608,62 +773,67 @@
%D is. Therefore the auto method can is to be overruled when
%D needed.
-\newbox\postponedfootnotes
+\newconditional\postponednote
-\def\autopostponefootnotes
- {\def\localfootinsert % not global
+\def\autopostponenotes
+ {\def\localnoteinsert % not global
{\ifinner
- %\message{[postponed footnote]}%
- \global\setbox\postponedfootnotes\vbox\bgroup
- \ifvoid\postponedfootnotes\else
- \unvbox\postponedfootnotes
+ %\message{[postponed note]}%
+ \global\setbox\localpostponednotes\vbox\bgroup
+ \global\settrue\postponednote
+ \ifvoid\localpostponednotes\else
+ \unvbox\localpostponednotes
\fi
\expandafter\gobbletwoarguments
\else
- %\message{[inserted footnote]}%
+ %\message{[inserted note]}%
\expandafter\insert
\fi}}
-\def\postponefootnotes
- {\let\autopostponefootnotes\postponefootnotes
- \let\postponefootnotes\relax % prevent loops
- \def\localfootinsert % not global
- {%\message{[postponed footnote]}%
- \global\setbox\postponedfootnotes=\vbox\bgroup
- \unvbox\postponedfootnotes
+\def\postponenotes
+ {\let\autopostponenotes\postponenotes
+ \let\postponenotes\relax % prevent loops
+ \def\localnoteinsert % not global
+ {%\message{[postponed note]}%
+ \global\setbox\localpostponednotes\vbox\bgroup
+ \global\settrue\postponednote
+ \unvbox\localpostponednotes
\gobbletwoarguments}}
+\def\dodoflushnotes % per class, todo: handle endnotes here
+ {\ifdim\ht\localpostponednotes>\zeropoint
+ \bgroup
+ % not that accurate when multiple notes
+ \scratchdimen\pagegoal
+ \advance\scratchdimen -\pagetotal
+ \ifdim\scratchdimen<\ht\localpostponednotes
+ \message{[moved note \currentnote]}%
+ \fi
+ \egroup
+ \fi
+ \insert\currentnoteins\bgroup\unvbox\localpostponednotes\egroup}
+
\def\doflushnotes % also called directly, \ifvoid is needed !
- {\ifendnotes \else
- \ifvoid\postponedfootnotes
- \let\localfootinsert\insert % not global
+ {\ifconditional\processingnote \else \ifconditional\postponednote
+ \ifendnotes
+ % todo: per class
\else
- \bgroup
- \ifdim\ht\postponedfootnotes>\zeropoint
- \scratchdimen\pagegoal
- \advance\scratchdimen -\pagetotal
- \ifdim\scratchdimen<\ht\postponedfootnotes
- \message{[moved footnote]}%
- \fi
- \fi
- \egroup
- \let\localfootinsert\insert % not global
- \insert\footins\bgroup\unvbox\postponedfootnotes\egroup
+ \let\localnoteinsert\insert % not global
+ \processnotes\dodoflushnotes
+ \global\setfalse\postponednote
\fi
- \fi}
+ \fi \fi}
\def\flushnotes
- {\ifvoid\postponedfootnotes \else
- \ifinner \else
- \ifendnotes \else
- \ifinpagebody \else
- %\ifvmode % less interference, but also less secure
- \doflushnotes
- %\fi
- \fi
- \fi
- \fi
- \fi}
+ {\ifconditional\processingnote \else \ifconditional\postponednote
+ \ifendnotes
+ % todo: per class
+ \else \ifinner \else \ifinpagebody \else
+ %\ifvmode % less interference, but also less secure
+ \doflushnotes
+ %\fi
+ \fi \fi \fi
+ \fi \fi}
%D This is a nasty and new secondary footnote flusher. It
%D can be hooked into \type {\everypar} like:
@@ -673,33 +843,35 @@
%D \stoptypen
\def\dosynchronizenotes
- {\insert\footins{\unvbox\footins}}
+ {\insert\currentnoteins{\unvbox\currentnoteins}}
-\def\synchronizenotes% indirect because of everypar
- {\ifvoid\footins\else\dosynchronizenotes\fi}
+\def\synchronizenotes
+ {\ifvoid\currentnoteins\else\processnotes\dosynchronizenotes\fi}
-\def\placefootnotesintext#1%
+%D There are several placement alternatives.
+
+\def\placenotesintext#1%
{\ifdim\ht#1>\zeropoint
\endgraf
\ifvmode
\witruimte
- \@@vnvoor
+ \noteparameter\c!voor
\fi
\snaptogrid\hbox
- {\setfootnotebodyfont
+ {\setnotebodyfont
\setbox0\hbox
- {\startpopfootnotes
+ {\startpopnotes
\unvbox#1\endgraf\relax
- \stoppopfootnotes}%
- \doif\@@vnbreedte\v!passend % new, auto width
- {\setbox0\hbox % uggly but ok.
+ \stoppopnotes}%
+ \doif{\noteparameter\c!breedte}\v!passend % new, auto width
+ {\setbox0\hbox % uggly but ok.
{\beginofshapebox
\unhbox0\setbox0=\lastbox\unvbox0
\endofshapebox
\reshapebox{\hbox{\unhbox\shapebox}}%
\vbox{\flushshapebox}}}%
\localframed
- [\??vn]
+ [\??vn\currentnote]
[\c!breedte=\v!passend,
\c!hoogte=\v!passend,
\c!strut=\v!nee,
@@ -710,7 +882,7 @@
\box0
\fi}}%
\ifvmode
- \@@vnna
+ \noteparameter\c!na
\fi
\fi}
@@ -720,15 +892,15 @@
%D \setupfootnotes[location={text,none}]
%D \stoptypen
-\def\placefootnotesasnone#1% is grouped already
+\def\placenotesasnone#1% is grouped already
{\ifdim\ht#1>\zeropoint
- \@@vnvoor
- \setfootnotebodyfont
- \startpopfootnotes % make sure that fake height is killed
+ \noteparameter\c!voor
+ \setnotebodyfont
+ \startpopnotes % make sure that fake height is killed
\unvbox#1\endgraf
- \stoppopfootnotes
+ \stoppopnotes
\setbox0=\lastbox \ifvbox0 \unvbox0\else\box0\fi % enable columns
- \@@vnna
+ \noteparameter\c!na
\fi}
%D \macros
@@ -740,54 +912,52 @@
%D \showsetup{\y!startlocalfootnotes}
%D \showsetup{\y!placelocalfootnotes}
-\def\defaultfootnotewidth{\zetbreedte}
-
-\newbox\localpostponedfootnotes
+\def\defaultnotewidth{\zetbreedte}
-\def\collectlocalfootnotes%
- {\def\localfootinsert##1% was \gdef, but never reset!
- {%\message{[local footnote]}%
- \global\setbox\localpostponedfootnotes\vbox\bgroup
- \ifvoid\localpostponedfootnotes \else
- \unvbox\localpostponedfootnotes
+\def\collectlocalnotes
+ {\def\localnoteinsert##1% was \gdef, but never reset!
+ {%\message{[local note]}%
+ \global\setbox\localpostponednotes\vbox\bgroup
+ \ifvoid\localpostponednotes \else
+ \unvbox\localpostponednotes
\fi
\let\next}}
-\def\dostartlocalfootnotes[#1]%
- {\let\autopostponefootnotes\postponefootnotes
- \let\postponefootnotes\collectlocalfootnotes
- \def\defaultfootnotewidth
- {\ifdim\hsize<\zetbreedte\hsize\else\zetbreedte\fi}%
- \setupfootnotes[#1]%
- \savenumber[\v!voetnoot]%
- \resetnummer[\v!voetnoot]%
- \collectlocalfootnotes}
-
-\def\startlocalfootnotes
- {\bgroup % here because we support \vbox\startlocalfootnotes
- \dosingleempty\dostartlocalfootnotes}
-
-\def\stoplocalfootnotes
- {\restorenumber[\v!voetnoot]%
+\def\startlocalnotes
+ {\bgroup % here because we support \vbox\startlocalnotes
+ \dosingleempty\dostartlocalnotes}
+
+\def\dostartlocalnotes[#1]%
+ {\let\autopostponenotes\postponenotes
+ \let\postponenotes\collectlocalnotes
+ \def\defaultnotewidth{\ifdim\hsize<\zetbreedte\hsize\else\zetbreedte\fi}%
+ \processnotes
+ {\doifsomething{#1}{\setupnote[\currentnote][#1]}%
+ \savenumber[\currentnote]%
+ \resetnumber[\currentnote]}%
+ \collectlocalnotes}
+
+\def\stoplocalnotes
+ {\processnotes{\restorenumber[\currentnote]}%
\egroup
\checknotes} % really needed, else wrong main settings
-\def\doplacelocalfootnotes[#1]%
+\def\placelocalnotes
+ {\dodoubleempty\doplacelocalnotes}
+
+\def\doplacelocalnotes[#1][#2]%
{\bgroup
- \setupfootnotes[#1]%
- \ExpandBothAfter\doifinsetelse\v!geen\@@vnplaats
- {\placefootnotesasnone\localpostponedfootnotes}%
- {\placefootnotesintext\localpostponedfootnotes}%
+ \dolocalsetupnotes{#1}{#2}
+ \processnotes
+ {\ExpandBothAfter\doifinsetelse\v!geen{\noteparameter\c!plaats}
+ \placenotesasnone\placenotesintext\localpostponednotes}%
\egroup
\checknotes}
-\def\placelocalfootnotes
- {\dosingleempty\doplacelocalfootnotes}
-
%D These commands can be used like:
%D
%D \startbuffer
-%D \startlocalfootnotes[breedte=.3\hsize,n=0]
+%D \startlocalnotes[breedte=.3\hsize,n=0]
%D \plaatstabel
%D {Some Table}
%D \plaatsonderelkaar
@@ -797,8 +967,8 @@
%D \VL Bene\voetnoot{Nota} \VL Nota\voetnoot{Bene} \VL\SR
%D \HL
%D \stoptabel}
-%D {\placelocalfootnotes}
-%D \stoplocalfootnotes
+%D {\placelocalnotes}
+%D \stoplocalnotes
%D \stopbuffer
%D
%D \typebuffer
@@ -810,7 +980,7 @@
%D \haalbuffer
%D \macros
-%D {placefootnotes, fakefootnotes}
+%D {placefootnotes}
%D
%D We still have no decent command for placing footnotes
%D somewhere else than at the bottom of the page (for which no
@@ -819,57 +989,86 @@
%D
%D \showsetup{\y!placefootnotes}
-\def\placefootnotes
- {\dosingleempty\doplacefootnotes}
+\def\placebottomnotes
+ {\processnotes\dodoplacenotes}
+
+% \definecomplexorsimple\placenotes
+
+% \def\simpleplacenotes
+% {\processnotes\dodoplacenotes}
-\def\doplacefootnotes[#1]%
+% \def\complexplacenotes[#1]%
+% {\bgroup
+% \edef\noteinsertions{#1}%
+% \simpleplacenotes
+% \egroup}
+
+\def\placenotes
+ {\dodoubleempty\doplacenotes}
+
+\def\doplacenotes[#1][#2]%
{\bgroup
- \ifendnotes
- \ifinpagebody \else \ifdim\ht\postponedfootnotes>\zeropoint
- \iffirstargument\setupfootnotes[#1,\c!hoogte=\teksthoogte]\fi
- \ExpandBothAfter\doifinsetelse\v!geen\@@vnplaats
- \placefootnotesasnone\placefootnotesintext\postponedfootnotes
- \fi \fi
- \else \ifdim\ht\footins>\zeropoint
- \iffirstargument\setupfootnotes[#1,\c!hoogte=\teksthoogte]\fi
- \placefootnoteinserts
- \fi \fi
+ \dolocalsetupnotes{#1}{#2}
+ \processnotes\dodoplacenotes
\egroup}
-\def\fakefootnotes
- {\ifhmode \endgraf \fi
+\def\dodoplacenotes
+ {\ifendnotes % hm, todo: per noteclass
+ \ifinpagebody \else \ifdim\ht\localpostponednotes>\zeropoint
+ \ExpandBothAfter\doifinsetelse\v!geen{\noteparameter\c!plaats}
+ \placenotesasnone\placenotesintext\localpostponednotes
+ \fi \fi
+ \else \ifdim\ht\currentnoteins>\zeropoint
+ \placenoteinserts
+ \fi \fi}
+
+%D \macros
+%D {fakenotes}
+
+\def\fakenotes
+ {\ifhmode
+ \endgraf
+ \fi
\ifvmode
\calculatetotalnoteheight
\ifdim\totalnoteheight>\zeropoint \kern\totalnoteheight \fi
\fi}
-\def\placebottomnotes{\placefootnotes}
-
\newdimen\totalnoteheight
+\def\docalculatetotalnoteheight
+ {\ifdim\ht\currentnoteins>\zeropoint
+ \ifclevernotes % tricky here ! ! ! to be sorted out ! ! !
+ \advance\totalnoteheight\ht \currentbackupnoteins
+ \advance\totalnoteheight\skip\currentbackupnoteins
+ \else
+ \advance\totalnoteheight\ht \currentnoteins
+ \advance\totalnoteheight\skip\currentnoteins
+ \fi
+ \fi}
+
\def\calculatetotalnoteheight
{\totalnoteheight\zeropoint
- \ifdim\ht\footins>\zeropoint
- \advance\totalnoteheight\ht\footins
- \advance\totalnoteheight\skip\footins
- \fi}
+ \processnotes\docalculatetotalnoteheight}
-\newif\ifnotespresent % global ?
+\newif\ifnotespresent
-\def\checknotepresence
- {\ifdim\ht\footins>\zeropoint
+\def\dochecknotepresence
+ {\ifdim\ht\currentnoteins>\zeropoint
\notespresenttrue
- \else
- \notespresentfalse
\fi}
+\def\checknotepresence
+ {\notespresentfalse
+ \processnotes\dochecknotepresence}
+
%D Now how can this mechanism be hooked into \CONTEXT\ without
%D explictly postponing footnotes? The solution turned out to
%D be rather simple:
%D
%D \starttypen
%D \everypar {...\flushnotes...}
-%D \neverypar {...\postponefootnoes}
+%D \neverypar {...\postponenotes}
%D \stoptypen
%D
%D and
@@ -891,43 +1090,41 @@
%D from the global document bodyfont size. In the previous macros
%D we already used a footnote specific font setting macro.
-\def\setfootnotebodyfont
- {\let\setfootnotebodyfont\relax
+\def\setnotebodyfont
+ {\let\setnotebodyfont\relax
\restoreglobalbodyfont
- \switchtobodyfont[\@@vnkorps]%
- \setuptolerance[\@@vntolerantie]%
- \setupalign[\@@vnuitlijnen]}
+ \switchtobodyfont[\noteparameter\c!korps]%
+ \setuptolerance[\noteparameter\c!tolerantie]%
+ \setupalign[\noteparameter\c!uitlijnen]}
%D The footnote mechanism defaults to a traditional one
%D column way of showing them. By default we precede them by
%D a small line.
-\setupfootnotes
- [\c!plaats=\v!pagina,
- \c!wijze=\v!per\v!deel,
- \c!sectienummer=\v!nee,
- \c!conversie=,
- \c!lijn=\v!aan,
- \c!voor=\blanko,
- \c!korps=\v!klein,
- \c!letter=,
- \c!kleur=,
- \c!na=,
- \c!lijnkleur=,
- \c!lijndikte=\linewidth,
- \c!kader=\v!uit,
- \c!margeafstand=.5em,
- \c!kolomafstand=1em,
- \c!afstand=.125em,
- \c!uitlijnen=\v!normaal,
- \c!tolerantie=\v!soepel,
- \c!splitsen=\v!soepel,
- %\c!breedte=\zetbreedte,
- %\c!breedte=\ifdim\hsize<\zetbreedte\hsize\else\zetbreedte\fi,
- \c!breedte=\defaultfootnotewidth,
- \c!hoogte=\teksthoogte,
- \c!nummercommando=\high,
- \c!scheider=\@@koscheider,
- \c!n=1]
-
-\protect \endinput
+\definenote[\v!voetnoot]
+
+%D Compatibility macros:
+
+ \def\setupfootnotedefinition{\setupnotedefinition [\v!voetnoot]}
+ \def\setupfootnotes {\setupnote [\v!voetnoot]}
+\unexpanded \def\footnote {\setnote [\v!voetnoot]}
+\unexpanded \def\footnotetext {\setnotetext [\v!voetnoot]}
+ \def\note {\dodoubleempty\notesymbol [\v!voetnoot]} % alleen footnote
+ \def\placefootnotes {\dodoubleempty\doplacefootnotes [\v!voetnoot]}
+ \def\placelocalfootnotes {\dodoubleempty\doplacelocalfootnotes[\v!voetnoot]}
+ \def\startlocalfootnotes {\startlocalnotes}
+ \def\stoplocalfootnotes {\stoplocalnotes }
+
+\def\doplacefootnotes [#1][#2]%
+ {\ifsecondargument\placenotes [#1][#2,\c!hoogte=\teksthoogte]\else\placenotes [#1]\fi}
+
+\def\doplacelocalfootnotes[#1][#2]%
+ {\ifsecondargument\placelocalnotes[#1][#2,\c!hoogte=\teksthoogte]\else\placelocalnotes[#1]\fi}
+
+%D Backward compatibility command:
+
+\def\footins {\noteinsertion\currentnote}
+\def\postponefootnotes {\postponenotes}
+\def\autopostponefootnotes{\autopostponenotes}
+
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/core-ntb.tex b/tex/context/base/core-ntb.tex
index b85c87c61..a8d030137 100644
--- a/tex/context/base/core-ntb.tex
+++ b/tex/context/base/core-ntb.tex
@@ -55,7 +55,7 @@
%D However, the next alternative also takes care of preceding
%D and following white space.
-\def\bTBLCELL
+\def\bTBLCELL % why not \doinhibitblank
{\inhibitblank\doconvertfont\tbltblletter\empty\everypar{\begstrut}}
\def\eTBLCELL
@@ -113,7 +113,7 @@
% \def\settblspn#1#2{\setvalue {\@@tblprefix#1:s}{#2}}
% \def\doiftblspn #1{\doifelsevalue{\@@tblprefix#1:s}{1}}
-\newif\ifsqueezeTBLspan % \squeezeTBLspantrue
+\newif\ifsqueezeTBLspan \squeezeTBLspantrue % spans one column cell over multi column par cells
\def\settblspn #1{\setvalue {\@@tblprefix#1:s}{1}}
\def\doifelsetblspn#1{\doifelsevalue{\@@tblprefix#1:s}{1}}
@@ -146,6 +146,8 @@
\newif\iftraceTABLE \traceTABLEfalse
\def\noftblheadlines{0}
+\def\noftblnextlines{0}
+\def\noftblhdnxlines{0}
\presetlocalframed[\@@tbl\@@tbl]
@@ -190,14 +192,12 @@
\fi\fi}
\def\dosetupTABLExy[#1][#2][#3]%
- {\def\dodosetupTABLE##1%
- {\setTABLEparameters[#1##1][#3]}%
+ {\def\dodosetupTABLE##1{\setTABLEparameters[#1##1][#3]}%
\processcommalist[#2]\dodosetupTABLE}
\def\dosetupTABLEzz[#1][#2][#3]%
{\def\dodosetupTABLE##1%
- {\def\dododosetupTABLE####1%
- {\setTABLEparameters[\c!x##1\c!y####1][#3]}%
+ {\def\dododosetupTABLE####1{\setTABLEparameters[\c!x##1\c!y####1][#3]}%
\processcommalist[#2]\dododosetupTABLE}%
\processcommalist[#1]\dodosetupTABLE}
@@ -249,7 +249,7 @@
\ifnum#1=\plusone \ifnum#2=\plusone
\getvalue{\@@tblprefix\c!x\v!eerste\c!y\v!eerste}%
\fi\fi
- \ifnum#1>\noftblheadlines\else
+ \ifnum#1>\noftblhdnxlines\else
\executeifdefined{\@@tblprefix\v!hoofd\v!elk}\donothing
\executeifdefined{\@@tblprefix\v!hoofd#2}\donothing
\fi
@@ -320,18 +320,23 @@
{\parseTD[#1]\digits#2\relax\eTD}
\newtoks\TBLhead
+\newtoks\TBLnext
\newtoks\TBLbody
\newtoks\TBLfoot
% to be done: head <raw> foot, dus state var
\long\def\bTABLEhead{\dosingleempty\doTABLEhead}
+\long\def\bTABLEnext{\dosingleempty\doTABLEnext}
\long\def\bTABLEbody{\dosingleempty\doTABLEbody}
\long\def\bTABLEfoot{\dosingleempty\doTABLEfoot}
\long\def\doTABLEhead[#1]#2\eTABLEhead
{\appendtoks\doTABLEsection[#1]{#2}\to\TBLhead}
+\long\def\doTABLEnext[#1]#2\eTABLEnext
+ {\appendtoks\doTABLEsection[#1]{#2}\to\TBLnext}
+
\long\def\doTABLEbody[#1]#2\eTABLEbody
{\appendtoks\doTABLEsection[#1]{#2}\to\TBLbody}
@@ -356,11 +361,84 @@
\def\bTABLE
{\dosingleempty\dobTABLE}
+% \def\dobTABLE[#1]%
+% {\pushTBL
+% % box not here
+% \bgroup
+% \resetcharacteralign % new
+% \getparameters
+% [\@@tbl\@@tbl]
+% [\c!uitlijnen={\v!rechts,\v!ruim,\v!hoog},#1]%
+% \processaction
+% [\tbltblsplitsen]
+% [ \v!ja=>\enableTBLbreaktrue,
+% \v!herhaal=>\enableTBLbreaktrue\multipleTBLheadstrue]%
+% \processaction
+% [\tbltblhoofd]
+% [\v!herhaal=>\multipleTBLheadstrue]%
+% \ifnum\TBLlevel>\plusone
+% \vbox
+% \else\ifenableTBLbreak
+% % no \vbox
+% \else
+% \vbox
+% \fi\fi
+% \bgroup
+% \localcolortrue
+% \presetallTABLEparameters
+% \ExpandFirstAfter\processallactionsinset
+% [\tbltbloptie]
+% [\v!rek=>\autoTBLspreadtrue]%
+% \linewidth\tbltbllijndikte % needs to be frozen
+% \dontcomplain
+% \let\currentcol\!!zerocount
+% \let\maximumrowspan\!!plusone
+% \let\maximumcol\currentcol
+% \let\maximumrow\currentcol
+% \def\bTR{\dodoubleempty\parseTR}%
+% \def\bTD{\dodoubleempty\parseTD}%
+% \def\bTH{\dodoubleempty\parseTH}%
+% \def\bTN{\dodoubleempty\parseTN}%
+% \endgraf}
+
+% \def\dobTABLE[#1]%
+% {\pushTBL
+% % box not here
+% \bgroup
+% \resetcharacteralign % new
+% \getparameters
+% [\@@tbl\@@tbl]
+% [\c!uitlijnen={\v!rechts,\v!ruim,\v!hoog},#1]%
+% \processaction
+% [\tbltblsplitsen]
+% [ \v!ja=>\enableTBLbreaktrue,
+% \v!herhaal=>\enableTBLbreaktrue\multipleTBLheadstrue]%
+% \processaction
+% [\tbltblhoofd]
+% [\v!herhaal=>\multipleTBLheadstrue]%
+% \localcolortrue
+% \presetallTABLEparameters
+% \ExpandFirstAfter\processallactionsinset
+% [\tbltbloptie]
+% [\v!rek=>\autoTBLspreadtrue]%
+% \linewidth\tbltbllijndikte % needs to be frozen
+% \dontcomplain
+% \let\currentcol\!!zerocount
+% \let\maximumrowspan\!!plusone
+% \let\maximumcol\currentcol
+% \let\maximumrow\currentcol
+% \def\bTR{\dodoubleempty\parseTR}%
+% \def\bTD{\dodoubleempty\parseTD}%
+% \def\bTH{\dodoubleempty\parseTH}%
+% \def\bTN{\dodoubleempty\parseTN}%
+% \endgraf}
+
\def\dobTABLE[#1]%
{\pushTBL
% box not here
\bgroup
-\resetcharacteralign % new
+ \ifhmode\kern\zeropoint\fi % blocks \removeunwantedspaces: check this on icare handelingsschema
+ \resetcharacteralign % new
\getparameters
[\@@tbl\@@tbl]
[\c!uitlijnen={\v!rechts,\v!ruim,\v!hoog},#1]%
@@ -368,14 +446,17 @@
[\tbltblsplitsen]
[ \v!ja=>\enableTBLbreaktrue,
\v!herhaal=>\enableTBLbreaktrue\multipleTBLheadstrue]%
- \ifnum\TBLlevel>\plusone
- \vbox
- \else\ifenableTBLbreak
- % no \vbox
- \else
- \vbox
- \fi\fi
- \bgroup
+ \processaction
+ [\tbltblhoofd]
+ [\v!herhaal=>\multipleTBLheadstrue]%
+% \ifnum\TBLlevel>\plusone
+% \vbox
+% \else\ifenableTBLbreak
+% % no \vbox
+% \else
+% \vbox
+% \fi\fi
+% \bgroup
\localcolortrue
\presetallTABLEparameters
\ExpandFirstAfter\processallactionsinset
@@ -390,8 +471,7 @@
\def\bTR{\dodoubleempty\parseTR}%
\def\bTD{\dodoubleempty\parseTD}%
\def\bTH{\dodoubleempty\parseTH}%
- \def\bTN{\dodoubleempty\parseTN}%
- \endgraf}
+ \def\bTN{\dodoubleempty\parseTN}}
% permits \expanded{\bTD ... \eTD}
@@ -400,13 +480,23 @@
\unexpanded\def\eTH{}
\unexpanded\def\eTN{}
-\def\eTABLE
+\def\eTABLE % beware, we need to get rid of spurious spaces when in hmode
{% tricky and dirty order -)
- \the\TBLhead
- \edef\noftblheadlines{\number\maximumrow}%
+ \doifsometokselse\TBLhead
+ {\the\TBLhead
+ \edef\noftblheadlines{\number\maximumrow}%
+ \doifsometokselse\TBLnext
+ {\the\TBLnext
+ \scratchcounter\maximumrow \advance\scratchcounter-\noftblheadlines
+ \edef\noftblnextlines{\number\scratchcounter}}%
+ {\let\noftblnextlines\!!zerocount}% was 1
+ \edef\noftblhdnxlines{\number\maximumrow}}
+ {\let\noftblheadlines\!!zerocount % was 1
+ \let\noftblnextlines\!!zerocount
+ \let\noftblhdnxlines\!!zerocount}%
\the\TBLbody
\the\TBLfoot
- \endgraf
+ \removeunwantedspaces % only if hmode
% finish cells
\dorecurse\maximumrow
{\let\row\recurselevel
@@ -469,13 +559,13 @@
{\let\col\recurselevel
\expanded{\doTBL{\row}{\col}}}%
\eTBL}%
+ \removeunwantedspaces % only if hmode
\endTBL
% wrong ! ! ! better to have an auto-offset-overlay
% \ifnum\TBLlevel>1
% \vskip-\strutdp
% \fi
\egroup
- \egroup
\popTBL}
\def\spanTBL#1#2%
@@ -518,7 +608,7 @@
\egroup
\bgroup % protect local vars
\increment\rowTBL\relax
- \ifnum\rowTBL>\noftblheadlines\relax
+ \ifnum\rowTBL>\noftblhdnxlines\relax
\ifnum\rowTBL<\maximumrow\relax
\doifsomething\tbltbltussenwit{\blank[\tbltbltussenwit]}%
\fi
@@ -565,6 +655,133 @@
\begintbl
\to\tbltoks}
+% \def\endTBL
+% {\appendtoks
+% \endtbl
+% \to\tbltoks
+% \setbox\scratchbox\hbox
+% {\localframed
+% [\@@tbl\@@tbl]
+% [\c!kader=\v!uit,\c!achtergrond=,\c!uitlijnen=\v!nee]
+% {\strut}}%
+% \edef\minimalcellheight{\the\ht\scratchbox}%
+% \dorecurse\maximumcol
+% {\settblaut\recurselevel\!!zeropoint % \zeropoint etc
+% % new
+% \let\xcol\recurselevel
+% \dorecurse\maximumrow
+% {\settblwd \recurselevel\xcol\!!zeropoint
+% \settblht \recurselevel\xcol\!!zeropoint}%
+% % till here
+% \settblwid\recurselevel\!!zeropoint}%
+% \dorecurse\maximumrow
+% {\settblhei\recurselevel\maxdimen}%
+% \chardef\TBLpass\plusone
+% \let\handleTBLcell\dohandleTBLcellA
+% \def\makeTBL##1##2%
+% {\gettbltxt{##1}{##2}}%
+% \def\inTBLcell##1##2%
+% {\ExpandBothAfter\doifinsetelse\localwidth{\v!passend,\v!ruim} % user set
+% {}
+% {\scratchdimen\gettblaut\colTBL\relax
+% \ifdim\localwidth>\scratchdimen
+% \settblaut\colTBL\localwidth
+% \fi}}%
+% \setbox0\vbox{\trialtypesettingtrue \the\tbltoks}%
+% \ifautoTBLspread
+% % experimental, stretch non fixed cells to \hsize
+% \checktblwidthsone % trial run
+% \checktblwidthstwo % real run
+% \stretchtblwidths
+% \let\handleTBLcell\dohandleTBLcellB
+% \setbox\scratchbox\vbox{\trialtypesettingtrue \the\tbltoks}%
+% \else\ifdim\wd0>\hsize
+% \ifautoTBLhsize
+% \checktblwidthsone % trial run
+% \checktblwidthstwo % real run
+% \let\handleTBLcell\dohandleTBLcellB
+% \setbox\scratchbox\vbox{\trialtypesettingtrue \the\tbltoks}%
+% \fi
+% \else\ifautoTBLrowspan\ifnum\maximumrowspan>1 % max ?
+% % added jan 2002 because nx=* did no longer work
+% \checktblwidthsone % trial run
+% \checktblwidthstwo % real run
+% %
+% \let\handleTBLcell\dohandleTBLcellC
+% \setbox\scratchbox\vbox{\trialtypesettingtrue \the\tbltoks}%
+% \fi\fi\fi\fi
+% \let\handleTBLcell\dohandleTBLcellD
+% \chardef\TBLpass2
+% \def\makeTBL##1##2% meer in cellD
+% {\dimen2\zeropoint
+% \pushmacro\colTBL
+% \dorecurse{\gettblcol{##1}{##2}}
+% {\advance\dimen2 \gettblwid\colTBL
+% \increment\colTBL}%
+% \edef\widthTBL{\the\dimen2}%
+% \popmacro\colTBL
+% \setbox\scratchbox\hbox{\gettbltxt{##1}{##2}}%
+% \settblht{##1}{##2}{\the\ht\scratchbox}%
+% \settblwd{##1}{##2}{\the\wd\scratchbox}%
+% \ifdim\ht\scratchbox>\gettblhei{##1}\relax
+% \settblhei{##1}{\the\ht\scratchbox}%
+% \fi}%
+% \setbox\scratchbox\vbox{\trialtypesettingtrue \the\tbltoks}%
+% \checktblheightsone
+% \checktblheightstwo
+% \let\handleTBLcell\dohandleTBLcellE
+% \chardef\TBLpass3
+% \def\makeTBL##1##2%
+% {% height
+% \pushmacro\rowTBL
+% \scratchdimen\zeropoint
+% \def\rowTBL{##1}%
+% \ifnum\gettblcol{##1}{##2}=\maximumcol\relax
+% % case: nc=maxcolumns
+% \else
+% \dorecurse{\gettblrow{##1}{##2}}
+% {\advance\scratchdimen \gettblhei\rowTBL
+% \increment\rowTBL}%
+% \ifdim\scratchdimen<\gettblht{##1}{##2}\relax
+% \scratchdimen\gettblht{##1}{##2}\relax
+% \fi
+% \fi
+% \edef\heightTBL{\the\scratchdimen}%
+% \popmacro\rowTBL
+% % width
+% \pushmacro\colTBL
+% \scratchdimen\zeropoint
+% \dorecurse{\gettblcol{##1}{##2}}
+% {\advance\scratchdimen \gettblwid\colTBL
+% \increment\colTBL}%
+% \edef\widthTBL{\the\scratchdimen}%
+% \popmacro\colTBL
+% % cell
+% \setbox\scratchbox\hbox{\gettbltxt{##1}{##2}}%
+% \ifnum\gettblcol{##1}{##2}=\maximumcol\relax
+% % case: nc=maxcolumns
+% \else
+% \scratchdimen\gettblhei{##1}%
+% \setbox\scratchbox\hbox
+% {\lower\ht\scratchbox\hbox{\raise\scratchdimen\box\scratchbox}}%
+% \ht\scratchbox\scratchdimen
+% \fi
+% \dp\scratchbox\zeropoint
+% \box\scratchbox}%
+% \iftraceTABLE\showtbltoks\fi
+% \ifnum\TBLlevel>\plusone
+% \vbox{\the\tbltoks}%
+% \else\ifenableTBLbreak
+% \ifmultipleTBLheads
+% \setbox\scratchbox\vbox{\the\tbltoks}%
+% \splittblbox\scratchbox
+% \else
+% \the\tbltoks
+% \fi
+% \else
+% \vbox{\the\tbltoks}%
+% \fi\fi}
+
\def\endTBL
{\appendtoks
\endtbl
@@ -624,12 +841,12 @@
\chardef\TBLpass2
\def\makeTBL##1##2% meer in cellD
{\dimen2\zeropoint
- \pushmacro\colTBL
+ \globalpushmacro\colTBL
\dorecurse{\gettblcol{##1}{##2}}
{\advance\dimen2 \gettblwid\colTBL
\increment\colTBL}%
\edef\widthTBL{\the\dimen2}%
- \popmacro\colTBL
+ \globalpopmacro\colTBL
\setbox\scratchbox\hbox{\gettbltxt{##1}{##2}}%
\settblht{##1}{##2}{\the\ht\scratchbox}%
\settblwd{##1}{##2}{\the\wd\scratchbox}%
@@ -643,7 +860,7 @@
\chardef\TBLpass3
\def\makeTBL##1##2%
{% height
- \pushmacro\rowTBL
+ \globalpushmacro\rowTBL
\scratchdimen\zeropoint
\def\rowTBL{##1}%
\ifnum\gettblcol{##1}{##2}=\maximumcol\relax
@@ -657,15 +874,15 @@
\fi
\fi
\edef\heightTBL{\the\scratchdimen}%
- \popmacro\rowTBL
+ \globalpopmacro\rowTBL
% width
- \pushmacro\colTBL
+ \globalpushmacro\colTBL
\scratchdimen\zeropoint
\dorecurse{\gettblcol{##1}{##2}}
{\advance\scratchdimen \gettblwid\colTBL
\increment\colTBL}%
\edef\widthTBL{\the\scratchdimen}%
- \popmacro\colTBL
+ \globalpopmacro\colTBL
% cell
\setbox\scratchbox\hbox{\gettbltxt{##1}{##2}}%
\ifnum\gettblcol{##1}{##2}=\maximumcol\relax
@@ -680,17 +897,12 @@
\box\scratchbox}%
\iftraceTABLE\showtbltoks\fi
\ifnum\TBLlevel>\plusone
- \vbox{\the\tbltoks}%
+ \@EA\notsplittblbox
\else\ifenableTBLbreak
- \ifmultipleTBLheads
- \setbox\scratchbox\vbox{\the\tbltoks}%
- \splittblbox\scratchbox
- \else
- \the\tbltoks
- \fi
+ \@EAEAEA\splittblbox
\else
- \vbox{\the\tbltoks}%
- \fi\fi}
+ \@EAEAEA\notsplittblbox
+ \fi\fi{\the\tbltoks}}
\def\stretchtblwidths
{\!!dimend\zeropoint
@@ -744,7 +956,6 @@
% \ifvoid#1 \exitloop \else \donetrue \fi}%
% \fi}
-
% \bTABLE[split=repeat]
% \bTABLEhead
% \bTR \bTH lxxxeft \eTH\bTD right \eTD\eTR
@@ -755,38 +966,124 @@
% \eTABLEbody
% \eTABLE
-\def\splittblbox#1% #1 <> 0/2
+% \def\splittblbox#1% #1 <> 0/2
+% {\ifinsidefloat
+% \unvbox#1%
+% \else
+% % spacing between rows gets lost in split
+% \setbox4\vbox
+% {\doifsomething\tbltbltussenwit{\blank[\tbltbltussenwit]}}%
+% \setbox2\vbox
+% {}%
+% \dorecurse\noftblheadlines
+% {\setbox0\vsplit#1 to \lineheight
+% \setbox2\vbox{\unvcopy2\unvcopy0}}%
+% \ifcase\noftblheadlines\else\unvcopy2\fi
+% \donefalse
+% \doloop
+% {\setbox0\vsplit#1 to \lineheight
+% \ifdim\pagegoal<\maxdimen
+% \setbox0\vbox{\unvbox0}%
+% \dimen0\ht0
+% \advance\dimen0\ht4
+% \advance\dimen0\pagetotal
+% \ifdim\dimen0>\pagegoal
+% \bgroup \pagina \egroup % make sure that local vars are kept
+% \ifcase\noftblheadlines\else\unvcopy2\fi
+% \fi
+% \fi
+% \ifdone
+% \doifsomething\tbltbltussenwit{\blank[\tbltbltussenwit]}%
+% \fi
+% \unvbox0
+% %\allowbreak
+% \bgroup
+% \scratchcounter\recurselevel
+% \advance\scratchcounter\noftblheadlines
+% \setupTBLcell{\number\scratchcounter}1
+% \ifx\@@tblsplitafter\relax
+% \allowbreak
+% \else
+% \doifelsenothing\@@tblsplitafter
+% \allowbreak
+% {\scratchcounter\realpageno
+% \@@tblsplitafter
+% \ifnum\scratchcounter<\realpageno
+% \ifcase\noftblheadlines\else\unvcopy2\fi
+% \fi}%
+% \fi
+% \egroup
+% \ifvoid#1 \exitloop \else \donetrue \fi}%
+% \fi}
+
+\newbox\finaltblbox
+
+\def\notsplittblbox#1%
+ {\setbox\finaltblbox\vbox{#1}%
+ \postprocessTABLEbox\finaltblbox
+ \beforeTABLEbox
+ \box\finaltblbox
+ \afterTABLEbox}
+
+\def\splittblbox#1%
{\ifinsidefloat
- \unvbox#1%
+ \notsplittblbox{#1}%
\else
- % spacing between rows gets lost in split
- \setbox4\vbox
- {\doifsomething\tbltbltussenwit{\blank[\tbltbltussenwit]}}%
- \setbox2\vbox
- {}%
+ \executeifdefined{splittblbox\tbltblsplitsmethode}\splittblboxa{#1}%
+ \fi}
+
+\def\splittblboxa#1% spacing between rows gets lost in split
+ {\ifmultipleTBLheads
+ \setbox\scratchbox\vbox{#1}%
+ \setbox8\vbox{\doifsomething\tbltbltussenwit{\blank[\tbltbltussenwit]}}%
+ \setbox2\vbox{}%
+ \setbox4\vbox{}%
\dorecurse\noftblheadlines
- {\setbox0\vsplit#1 to \lineheight
+ {\setbox0\vsplit\scratchbox to \lineheight
\setbox2\vbox{\unvcopy2\unvcopy0}}%
- \ifcase\noftblheadlines\else\unvcopy2\fi
+ \dorecurse\noftblnextlines
+ {\setbox0\vsplit\scratchbox to \lineheight
+ \setbox4\vbox{\unvcopy4\unvcopy0}}%
+ \ifcase\noftblheadlines\else
+ \ifdim\pagegoal<\maxdimen
+ \dimen0\ht2
+ \advance\dimen0\ht8
+ \advance\dimen0\pagetotal\relax
+ \ifdim\dimen0>\pagegoal
+ \bgroup\pagina\egroup % make sure that local vars are kept
+ \fi
+ \fi
+ \unvcopy2
+ \ifcase\noftblnextlines\else
+ \setbox2\box4
+ \fi
+ \fi
\donefalse
+ \!!doneafalse
\doloop
- {\setbox0\vsplit#1 to \lineheight
- \ifdim\pagegoal<\maxdimen
- \setbox0\vbox{\unvbox0}%
- \dimen0\ht0
- \advance\dimen0\ht4
- \advance\dimen0\pagetotal
- \ifdim\dimen0>\pagegoal
- \bgroup \pagina \egroup % make sure that local vars are kept
- \ifcase\noftblheadlines\else\unvcopy2\fi
+ {\setbox0\vsplit\scratchbox to \lineheight
+ \if!!donea
+ \ifdim\pagegoal<\maxdimen
+ \setbox0\vbox{\unvbox0}%
+ \ifdim\ht0>\zeropoint
+ \dimen0\ht0
+ \advance\dimen0\ht8
+ \advance\dimen0\pagetotal\relax
+ \ifdim\dimen0>\pagegoal
+ \bgroup\pagina\egroup % make sure that local vars are kept
+ \ifcase\noftblheadlines\else\unvcopy2\fi
+ \fi
+ \fi
\fi
\fi
+ \!!doneatrue
\ifdone
\doifsomething\tbltbltussenwit{\blank[\tbltbltussenwit]}%
\fi
\unvbox0
%\allowbreak
\bgroup
+ % todo: what if tblnextlines ?
\scratchcounter\recurselevel
\advance\scratchcounter\noftblheadlines
\setupTBLcell{\number\scratchcounter}1
@@ -802,9 +1099,141 @@
\fi}%
\fi
\egroup
- \ifvoid#1 \exitloop \else \donetrue \fi}%
+ \ifvoid\scratchbox \exitloop \else \donetrue \fi}%
+ \else
+ \notsplittblbox{#1}%
\fi}
+% \def\splittblboxb#1%
+% {\setbox\scratchbox\vbox{#1}%
+% \setbox8\vbox{\doifsomething\tbltbltussenwit{\blank[\tbltbltussenwit]}}%
+% \ifmultipleTBLheads
+% \setbox2\vbox{}%
+% \setbox4\vbox{}%
+% \dorecurse\noftblheadlines
+% {\setbox0\vsplit\scratchbox to \lineheight
+% \setbox2\vbox{\unvcopy2\unvcopy0}}%
+% \dorecurse\noftblnextlines
+% {\setbox0\vsplit\scratchbox to \lineheight
+% \setbox4\vbox{\unvcopy4\unvcopy0}}%
+% \fi
+% \!!doneafalse
+% \doloop
+% {\ifdim\pagegoal<\maxdimen
+% \scratchdimen\pagegoal
+% \advance\scratchdimen-\pagetotal
+% \else
+% \scratchdimen\teksthoogte
+% \fi
+% \ifmultipleTBLheads
+% \ifcase\noftblheadlines\else
+% \advance\scratchdimen-\ht2
+% \fi
+% \fi
+% \advance\scratchdimen-\ht8
+% \setbox\finaltblbox\vbox
+% {\ifmultipleTBLheads
+% \ifcase\noftblheadlines\else
+% \unvcopy2
+% \doifsomething\tbltbltussenwit{\blank[\tbltbltussenwit]}%
+% \fi
+% \fi
+% \setbox0\vsplit\scratchbox to\scratchdimen
+% \unvbox0}%
+% \if!!donea\else\ifcase\noftblnextlines\else
+% \setbox2\box4
+% \fi\fi
+% \!!doneatrue
+% \postprocessTABLEsplitbox\finaltblbox
+% \beforeTABLEsplitbox
+% \box\finaltblbox
+% \afterTABLEsplitbox
+% \setupTBLcell{\number\scratchcounter}1
+% \@@tblsplitafter
+% \ifvoid\scratchbox
+% \exitloop
+% \else
+% \pagina
+% \fi}}
+
+\let\extratblsplitheight\zeropoint % additional space taken by before/afterTABLEsplitbox
+
+\def\splittblboxb#1%
+ {\setbox\scratchbox\vbox{#1}%
+ \setbox8\vbox{\doifsomething\tbltbltussenwit{\blank[\tbltbltussenwit]}}%
+ \ifmultipleTBLheads
+ \setbox2\vbox{}%
+ \setbox4\vbox{}%
+ \dorecurse\noftblheadlines
+ {\setbox0\vsplit\scratchbox to \lineheight
+ \setbox2\vbox{\unvcopy2\unvcopy0}}%
+ \dorecurse\noftblnextlines
+ {\setbox0\vsplit\scratchbox to \lineheight
+ \setbox4\vbox{\unvcopy4\unvcopy0}}%
+ \fi
+ \testpage[2]% quite save since a row is > 1 lineheight and we don't want on-liners
+ \!!doneafalse
+ \doloop
+ {\ifdim\pagegoal<\maxdimen
+ \scratchdimen\pagegoal
+ \advance\scratchdimen-\pagetotal
+ \else
+ \scratchdimen\teksthoogte
+ \fi
+ \ifmultipleTBLheads
+ \ifcase\noftblheadlines\else
+ \advance\scratchdimen-\ht2
+ \fi
+ \fi
+ \advance\scratchdimen-\ht8
+ \getnoflines\scratchdimen
+ \ifdim\noflines\lineheight>\scratchdimen
+ \advance\scratchdimen-\lineheight
+ \fi
+\advance\scratchdimen-\extratblsplitheight
+ \setbox\finaltblbox\vbox
+ {\ifmultipleTBLheads
+ \ifcase\noftblheadlines\else
+ \unvcopy2
+ \doifsomething\tbltbltussenwit{\blank[\tbltbltussenwit]}%
+ \fi
+ \fi
+ \setbox0\vsplit\scratchbox to\scratchdimen
+ \unvbox0}%
+ \if!!donea\else\ifcase\noftblnextlines\else
+ \setbox2\box4
+ \fi\fi
+ \!!doneatrue
+ \postprocessTABLEsplitbox\finaltblbox
+ \ifvoid\scratchbox
+ \beforeTABLEsplitbox
+ \box\finaltblbox
+ \afterTABLEsplitbox
+ \@@tblsplitafter
+ \exitloop
+ \else
+ % hack
+ \scratchdimen\pagegoal
+ \advance\scratchdimen \lineheight
+ \global\pagegoal\scratchdimen
+ % brrr
+ \beforeTABLEsplitbox
+ \box\finaltblbox
+ \afterTABLEsplitbox
+ \@@tblsplitafter
+ \pagina
+ \fi}}
+
+% ! ! ! ! TODO: naast \postprocessTABLEsplitbox ook evt \postprocessTABLEbox voor niet split
+
+\let\postprocessTABLEsplitbox\gobbleoneargument
+\let\postprocessTABLEbox \gobbleoneargument
+
+\let\beforeTABLEsplitbox\relax
+\let\afterTABLEsplitbox \relax
+\let\beforeTABLEbox \relax
+\let\afterTABLEbox \relax
+
\def\checktblwidthsone{\dochecktblwidths0} % 0 = trial run
\def\checktblwidthstwo{\dochecktblwidths1} % 1 = real run
@@ -1091,8 +1520,10 @@
\c!uitlijnkarakter={,},
\c!optie=, % \v!rek
\c!splitsen=\v!nee,
+ \c!hoofd=,
\c!tussenwit=,
- \c!maxbreedte=8em]
+ \c!maxbreedte=8em,
+ \c!splitsmethode=a]
%D We have already prepared the previous macros for nesting,
%D so we only have to pop in the right ones:
@@ -1101,7 +1532,7 @@
\newcounter\TBLlevel
-\def\@@tblprefix{\@@tbl:\ifnum\TBLlevel>1 \TBLlevel:\fi}
+\def\@@tblprefix{\@@tbl:\ifnum\TBLlevel>1 :\TBLlevel:\fi}
\long\def\settbltxt#1#2#3%
{\setxvalue{\@@tblprefix#1:#2:l}{\TBLlevel}%
@@ -1116,7 +1547,7 @@
%D New:
\def\pushTBLparameters
- {\pushmacro\TBLlevel
+ {\globalpushmacro\TBLlevel
\ifcase\TBLpass
% we're just after \bTABLE
\else\ifnum\TBLlevel>\zerocount
@@ -1124,7 +1555,7 @@
\fi\fi}
\def\popTBLparameters
- {\popmacro\TBLlevel}
+ {\globalpopmacro\TBLlevel}
\def\pushTBL
{\ifnum\TBLlevel=\zerocount
@@ -1133,16 +1564,16 @@
\doglobal\increment\TBLlevel\relax
\ifnum\TBLlevel>\plusone
\resetallTABLEparameters
- \pushmacro\colTBL
- \pushmacro\rowTBL
+ \globalpushmacro\colTBL
+ \globalpushmacro\rowTBL
\else
\global\intabletrue
\fi}
\def\popTBL
{\ifnum\TBLlevel>\plusone
- \popmacro\rowTBL
- \popmacro\colTBL
+ \globalpopmacro\rowTBL
+ \globalpopmacro\colTBL
\else
\global\intablefalse
\fi
diff --git a/tex/context/base/core-num.tex b/tex/context/base/core-num.tex
index d9618c720..43e1832f4 100644
--- a/tex/context/base/core-num.tex
+++ b/tex/context/base/core-num.tex
@@ -8,8 +8,8 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
\writestatus{loading}{Context Core Macros / Numbering}
@@ -19,8 +19,8 @@
%
% \definieernummer[naam]
% \stelnummerin[naam][wijze=,blok=,tekst=,plaats=,conversie=,start=]
-% \setnummer[naam]{waarde}
-% \resetnummer[naam]
+% \setnumber[naam]{waarde}
+% \resetnumber[naam]
% \verhoognummer[naam]
% \verlaagnummer[naam]
% \volgendenummer[naam][tag][referentie]
@@ -53,13 +53,13 @@
\def\dododefinieernummer[#1][#2]%
{\getparameters
[\s!number#1]
- [\c!nummer=#1,
+ [\c!nummer=#1,
\s!check=,
\c!wijze=\@@nrwijze,
\c!wijze\c!lokaal=\getvalue{\@@thenumber{#1}\c!wijze},
\c!sectienummer=\v!ja,
- \c!tekst=, % weg hier
- \c!plaats=, % weg hier, was trouwens \c!zetwijze
+ \c!tekst=, % weg hier
+ \c!plaats=, % weg hier, was trouwens \c!zetwijze
\c!conversie=\v!cijfers,
\c!start=0,
#2]%
@@ -69,10 +69,10 @@
\def\definieernummer
{\dodoubleempty\dodefinieernummer}
-\def\setnummer[#1]#2%
+\def\setnumber[#1]#2%
{\setcounter{\@@thenumber{#1}}{#2}}
-\def\resetnummer[#1]%
+\def\resetnumber[#1]%
{\setcounter{\@@thenumber{#1}}{0\csname\@@thenumber{#1}\c!start\endcsname}}
\def\dodoreset#1%
@@ -136,7 +136,7 @@
\ifx\checknummer\undefined \let\checknummer\gobbleoneargument \fi
-% ook de pag nummers hierheen halen ivm \@@nrwijze
+% ook de pag nummers hierheen halen ivm \@@nrwijze
\def\dostelnummerenin[#1]% globaal
{\getparameters[\??nr][#1]%
@@ -153,4 +153,4 @@
\c!sectienummer=\v!ja,
\c!status=\v!start]
-\protect \endinput
+\protect \endinput
diff --git a/tex/context/base/core-pos.tex b/tex/context/base/core-pos.tex
index cbc7c8195..a19863251 100644
--- a/tex/context/base/core-pos.tex
+++ b/tex/context/base/core-pos.tex
@@ -121,7 +121,7 @@
% \dosetpositionpt\@@posy{#4}%
% %\setxvalue{\POSprefix#1}{\@@posp,\@@posx,\@@posy}}%
% \@EA\xdef\csname\POSprefix#1\endcsname{\@@posp,\@@posx,\@@posy}}%
-%
+%
% \def\setpospxywhd#1#2#3#4#5#6#7%
% {\dosetpositionnm\@@posp{#2}%
% \dosetpositionpt\@@posx{#3}%
@@ -131,7 +131,7 @@
% \dosetpositionpt\@@posd{#7}%
% %\setxvalue{\POSprefix#1}{\@@posp,\@@posx,\@@posy,\@@posw,\@@posh,\@@posd}}%
% \@EA\xdef\csname\POSprefix#1\endcsname{\@@posp,\@@posx,\@@posy,\@@posw,\@@posh,\@@posd}}%
-%
+%
% \def\setpospxyplus#1#2#3#4#5#6#7#8%
% {\dosetpositionnm\@@posp{#2}%
% \dosetpositionpt\@@posx{#3}%
@@ -142,25 +142,27 @@
% %\setxvalue{\POSprefix#1}{\@@posp,\@@posx,\@@posy,\@@posw,\@@posh,\@@posd,#8}}
% \@EA\xdef\csname\POSprefix#1\endcsname{\@@posp,\@@posx,\@@posy,\@@posw,\@@posh,\@@posd,#8}}
-%D This is real tricky! The page anchor is applied to the
-%D page box and therefore flushed first. So, when present, it
-%D is applied to all positions except itself.
+%D This is real tricky! The page anchor is applied to the
+%D page box and therefore flushed first. So, when present, it
+%D is applied to all positions except itself.
-\chardef\positionanchormode=0 % don't relocate page origin
-\chardef\positionanchormode=1 % relocate page origin once
+\chardef\positionanchormode=0 % don't relocate page origin
+\chardef\positionanchormode=1 % relocate page origin once
\def\pageanchor{page:0}
+% todo: change with each page size change
+
\def\registerpageposition#1% this one is flushed first !
{\ifpositioning\ifcase\realpageno\or
\ifdim\printpapierhoogte=\papierhoogte\else
\ifdim\printpapierbreedte=\papierbreedte\else
\setbox#1\hbox{\hpos\pageanchor{\box#1}}%
- \fi
- \fi
+ \fi
+ \fi
\fi\fi}
-\def\dosetpositionxy#1#2#3% todo: scaled points
+\def\dosetpositionxy#1#2#3% todo: scaled points
{\scratchdimen#2\s!sp
\ifcase\positionanchormode\or
\advance\scratchdimen-#3\pageanchor
@@ -352,7 +354,7 @@
%D up. So, the third extra is fetched with,
%D
%D \starttypen
-%D \MPplus{identifier}{3}
+%D \MPplus{identifier}{3}{default}
%D \stoptypen
%D
%D All extras (comma separated) are fetched with:
@@ -487,7 +489,7 @@
\def\setpositiondata#1#2#3#4%
{\iftrialtypesetting \else
\initializenextposition
- \hbox
+ \hbox
{\def\currentposition{#1}%
\dosetpositionwhd\currentposition
{\number#2}%
@@ -505,7 +507,7 @@
\else
\initializenextposition
\hbox to \nextboxwd
- {\def\currentposition{#1}%
+ {\edef\currentposition{#1}%
\dosetpositionwhd\currentposition
{\number\nextboxwd}%
{\number\nextboxht}%
@@ -521,7 +523,7 @@
{\iftrialtypesetting \else
\initializenextposition
\hbox to \nextboxwd
- {\def\currentposition{#1}%
+ {\edef\currentposition{#1}%
\dosetpositionplus\currentposition
{\number#2}%
{\number#3}%
@@ -539,7 +541,7 @@
\else
\initializenextposition
\hbox to \nextboxwd
- {\def\currentposition{#1}%
+ {\edef\currentposition{#1}%
\dosetpositionplus\currentposition
{\number\nextboxwd}%
{\number\nextboxht}%
@@ -605,7 +607,7 @@
%D \traceposstring\clap\cyan{<#1>}%
%D \fi
%D \fi}
-%D \stoptypen
+%D \stoptypen
\def\doifpositionaction#1%
{\ifundefined{\POSactionprefix#1::}%
@@ -631,12 +633,11 @@
\def\copyposition#1#2%
{\bgroup
- \edef\to {\POSprefix#1}%
+ %\edef\to {\POSprefix#1}%
\edef\from{\POSprefix#2}%
- %\doifdefined\from
- % {\global\@EA\@EA\@EA\let\@EA\csname\@EA\to\@EA\endcsname\csname\from\endcsname}%
\ifundefined\from\else
- \global\@EA\@EA\@EA\let\@EA\csname\@EA\to\@EA\endcsname\csname\from\endcsname
+ % \global\@EA\@EA\@EA\let\@EA\csname\@EA\to\@EA\endcsname\csname\from\endcsname
+ \global\@EA\let\csname\POSprefix#1\@EA\endcsname\csname\from\endcsname
\fi
\egroup}
@@ -763,7 +764,7 @@
\fi \fi \fi
\fi \fi \fi}
-\chardef\parposstrut=1 % 0 => no strut data, so fall backs used
+\chardef\parposstrut=1 % 0 => no strut data, so fall backs used
\def\doregisterparoptions
{\doglobal\increment\parposcounter
@@ -796,7 +797,7 @@
{\hss
\blue
\llap{\infofont\number\parposcounter}%
- \scratchdimen\!!onepoint
+ \scratchdimen\onepoint
\vrule
\!!width 4\scratchdimen
\!!height2\scratchdimen
@@ -845,19 +846,17 @@
% #4%
% \fi}
-\newdimen\overlappingmargin \overlappingmargin\zeropoint
+% \newdimen\overlappingmargin \overlappingmargin\zeropoint
+%
+% \overlappingmargin-2sp % better
+
+\def\overlappingmargin{-2\s!sp}
\def\doifoverlappingelse#1#2%
{\begingroup
\donefalse
\edef\!!stringa{#1}\edef\!!stringb{#2}%
\ifnum\MPp\!!stringa=\MPp\!!stringb\relax
- \def\check##1##2%
- {\ifdim##1<\!!dimena \else \ifdim##1>\!!dimenb \else
- \ifdim##2<\!!dimenc \else \ifdim##2>\!!dimend \else
- \donetrue
- \fi\fi
- \fi\fi}%
\!!dimena\MPx\!!stringa
\!!dimenb\MPx\!!stringa\advance\!!dimenb \MPw\!!stringa
\!!dimenc\MPy\!!stringa\advance\!!dimenc-\MPd\!!stringa
@@ -875,11 +874,28 @@
\advance\!!dimenf+\overlappingmargin
\advance\!!dimeng-\overlappingmargin
\advance\!!dimenh+\overlappingmargin
- \fi
- \check\!!dimene\!!dimeng \ifdone \else
- \check\!!dimene\!!dimenh \ifdone \else
- \check\!!dimenf\!!dimeng \ifdone \else
- \check\!!dimenf\!!dimenh \fi \fi \fi
+ \fi
+ % more often eh fb eg fg
+ \def\checkone##1##2%
+ {\ifdim##1<\!!dimena \else \ifdim##1>\!!dimenb \else
+ \ifdim##2<\!!dimenc \else \ifdim##2>\!!dimend \else
+ \donetrue
+ \fi\fi
+ \fi\fi}%
+ \def\checktwo##1##2%
+ {\ifdim##1<\!!dimene \else \ifdim##1>\!!dimenf \else
+ \ifdim##2<\!!dimeng \else \ifdim##2>\!!dimenh \else
+ \donetrue
+ \fi\fi
+ \fi\fi}%
+ \checkone\!!dimene\!!dimeng \ifdone \else
+ \checkone\!!dimene\!!dimenh \ifdone \else
+ \checkone\!!dimenf\!!dimeng \ifdone \else
+ \checkone\!!dimenf\!!dimenh \ifdone \else
+ \checktwo\!!dimena\!!dimenc \ifdone \else
+ \checktwo\!!dimena\!!dimend \ifdone \else
+ \checktwo\!!dimenb\!!dimene \ifdone \else
+ \checktwo\!!dimenb\!!dimenc \fi \fi \fi \fi \fi \fi \fi
\fi
\ifdone
\endgroup\expandafter\firstoftwoarguments
@@ -1056,7 +1072,7 @@
\def\MPanchoridentifier{mpa} % {mp-anchor}
\def\MPoverlayposprefix{MO::}
-% obsolete and wrong anyway
+% obsolete and wrong anyway
%
% \long\def\defineMPpositiongraphic#1%
% {\long\setvalue{\MPoverlayposprefix#1}}
@@ -1096,8 +1112,8 @@
% \vfill}%
% \fi}
-% \def\positionoverlay#1% the test prevents too many redundant positions
-% {\ifpositioning % in (not used) text* position layers
+% \def\positionoverlay#1% the test prevents too many redundant positions
+% {\ifpositioning % in (not used) text* position layers
% \vbox to \overlayheight
% {\doifpositionactionelse{#1::\MPanchoridentifier}%
% {\edef\MPanchorid{#1::\MPanchoridentifier:\MPanchornumber}%
@@ -1181,7 +1197,7 @@
\def\handlepositionaction#1\with#2\on#3%
{\bgroup
\ifx\currentpositionoverlay\empty
- \edef\!!stringa{#3}% no layer, just pos itself as anchor
+ \edef\!!stringa{#3}% no layer, just pos itself as anchor
\else
\edef\!!stringa{\currentpositionoverlay::\MPanchoridentifier}%
\fi
@@ -1212,7 +1228,7 @@
\def\docleanpositionboxes#1#2#3% pos tag setups
{\ifnum\MPp{#1}<\realpageno \else
- \noexpand \dohandlepositionboxes{#1}{#2}{#3}% reinsert
+ \noexpand \dohandlepositionboxes{#1}{#2}{#3}% reinsert
\fi}
\appendtoks
@@ -1326,7 +1342,7 @@
\cleanuppositionaction{#1}%
\egroup % smashed is really needed else
\smashedbox\scratchbox % we get problems with too big
- \egroup % overlays (s-pre-0x.tex)
+ \egroup % overlays (s-pre-0x.tex)
\else
% shouldn't happen too often
\traceposstring\clap\cyan{<#1>}%
@@ -1601,7 +1617,7 @@
\def\MPl#1{\MPplus{#1}20}
\def\MPr#1{\MPplus{#1}30}
-\startMPpositionmethod{mpos:par} %%%%%%%%%%% will become obsolete
+\startMPpositionmethod{mpos:par} %%%%%%%%%%% will become obsolete
\edef\MPparcounter{\MPv\MPbself{1}{0}}%
\doifpositionelse\MPwself
{\startMPpositiongraphic{mpos:par}%
@@ -1726,6 +1742,7 @@
%\xdef\nextparbackground{background:\nofparbackgrounds}%
\xdef\nextparbackground{pbg:\nofparbackgrounds}%
\egroup
+ % todo : \synchonizepositionpage{b:\currentparbackground}{s:\currentparbackground}%
\setuptextbackground[#1][#2]%
\let\dodostarttextbackground\relax
\let\dodostoptextbackground \relax
@@ -1741,10 +1758,14 @@
[ \v!tekst=>\let\dodostarttextbackground\dostarttextbackgroundtxt
\let\dodostoptextbackground \dostoptextbackgroundtxt,
\v!alinea=>\let\dodostarttextbackground\dostarttextbackgroundpar
- \let\dodostoptextbackground \dostoptextbackgroundpar]%
- \ifnum\textbackgrounddepth>\plusone % new
- \let\dodostarttextbackground\dostarttextbackgroundtxt
- \let\dodostoptextbackground \dostoptextbackgroundtxt
+ \let\dodostoptextbackground \dostoptextbackgroundpar,
+ \v!geen=>\let\dodostarttextbackground\relax
+ \let\dodostoptextbackground \relax]%
+ \ifx\dodostarttextbackground\dostarttextbackgroundpar % untested
+ \ifnum\textbackgrounddepth>\plusone % new
+ \let\dodostarttextbackground\dostarttextbackgroundtxt
+ \let\dodostoptextbackground \dostoptextbackgroundtxt
+ \fi
\fi
\doifelsevalue{\??td#1\c!kader}\v!aan
{\doifelsevalue{\??td#1\c!hoek}\v!rond
@@ -1758,8 +1779,8 @@
\startpositionoverlay{\textbackgroundoverlay{\getvalue{\??td#1\c!niveau}}}%
\expanded
{\setMPpositiongraphicrange % moet veel efficienter
- {b:\currentparbackground}%
- {e:\currentparbackground}%
+ {\btbanchor}% {b:\currentparbackground}%
+ {\etbanchor}% {e:\currentparbackground}%
{\getvalue{\??td#1\c!methode}}%
{self=\currentparbackground,
mp=\getvalue{\??td#1\c!mp},
@@ -1779,6 +1800,14 @@
{\dodostoptextbackground
\carryoverpar\egroup}
+\def\starttextbackgroundmanual
+ {\dostartattributes{\??td\currenttextbackground}\c!letter\c!kleur\empty
+ \fpos\currentparbackground\ignorespaces}
+
+\def\stoptextbackgroundmanual
+ {\tpos\currentparbackground
+ \dostopattributes}
+
\def\dostarttextbackgroundtxt
{\ifvmode \leavevmode \fi
\dostartattributes{\??td\currenttextbackground}\c!letter\c!kleur\empty
@@ -1819,7 +1848,7 @@
% \endgraf % new
% \getvalue{\??td\currenttextbackground\c!na}}
-\def\dostarttextbackgroundpar
+\def\dostarttextbackgroundpar
{\endgraf % new
\getvalue{\??td\currenttextbackground\c!voor}%
\doassignsomeskip\getvalue{\??td\currenttextbackground\c!bovenoffset}\to\scratchskip
@@ -1844,7 +1873,7 @@
\advance\leftskip\leftskipadaption
\dosetleftskipadaption{\getvalue{\??td\currenttextbackground\c!rechteroffset}}%
\advance\rightskip\leftskipadaption
-% new
+% new
\dosetraggedcommand{\getvalue{\??td\currenttextbackground\c!uitlijnen}}%
\raggedcommand
%
@@ -1960,7 +1989,7 @@
{\dodoubleempty\dodefinetextbackground}
\def\dodefinetextbackground[#1][#2]%
- {\ifsecondargument % why ?
+ {\ifsecondargument % why ?
\copyparameters[\??td#1][\??td]
[\c!status,\c!plaats,\c!variant,\c!mp,\c!methode,
\c!achtergrond,\c!achtergrondkleur,\c!hoek,\c!niveau,
@@ -2135,13 +2164,13 @@
%D \macros
%D {stackeddown}
-%D
+%D
%D However, a better implementation is possible with the
%D following macro. We now have an extra key \type {stack} for
%D margin settings. When set to \type {yes}, this macro comes
-%D into action.
+%D into action.
-\def\stackeddown
+\def\stackeddown
{\dowithnextbox
{\doglobal\increment\currentautopos
\hpos{\POSstackprefix\currentautopos}
@@ -2158,11 +2187,11 @@
\advance\scratchdimen\MPd{\POSstackprefix\previousautopos}}%
\exitloop
\ifnum\previousautopos<\zerocount\exitloop\fi}%
- \ifdim\scratchdimen>\zeropoint
- \setbox\nextbox \hbox % \iftracepositons\ruledhbox\else\hbox\fi
+ % \ifdim\scratchdimen>\zeropoint
+ \setbox\nextbox\iftracepositions\@EA\ruledhbox\else\@EA\hbox\fi
{\lower\scratchdimen\flushnextbox}%
\next
- \fi
+ % \fi
\flushnextbox}}}
%D The next hack make sure that margin texts near faulty
@@ -2430,14 +2459,14 @@
%D linear_shade(pxy,0,.4c,.9c) ;
%D anchor_area(\MPanchor{\MPvar{from}}) ;
%D \stopMPpositiongraphic
-%D
+%D
%D \setMPpositiongraphic{b:x}{tableshade}{from=b:x,to=e:x,color=red}
%D \setMPpositiongraphic{b:y}{tableshade}{from=b:y,to=e:y,color=green}
%D \setMPpositiongraphic{b:z}{tableshade}{from=b:z,to=e:z,color=blue}
%D \stopbuffer
%D
%D \typebuffer \haalbuffer
-%D
+%D
%D The definition of the table looks about the same as the
%D previous one:
%D
@@ -2535,4 +2564,4 @@
% \advance\scratchdimen -\MPx{mh:#1}%
% \edef\righthdistance{\the\scratchdimen}}
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/core-ref.tex b/tex/context/base/core-ref.tex
index 7c60bcc3a..67eda416c 100644
--- a/tex/context/base/core-ref.tex
+++ b/tex/context/base/core-ref.tex
@@ -149,13 +149,13 @@
%D These are implemented in a low level form as:
%D
-%D \starttypen
+%D \starttypen
%D \def\dotextreference[#1]{\rawtextreference\s!txt{#1}} % #2
%D \def\dopagereference[#1]{\rawpagereference\s!pag{#1}}
%D \def\doreference [#1]{\rawreference \s!ref{#1}} % #2
-%D \stoptypen
+%D \stoptypen
%D
-%D or without expansion problems:
+%D or without expansion problems:
\def\dotextreference[#1]#2%
{\bgroup
@@ -224,7 +224,7 @@
\appendtoks
%\def\dohandleaccent #1#2{\string#1\string#2}%
%\def\dohandlecommand #1{\string#1}%
- \cleanupfeatures
+ \cleanupfeatures
\to \everyreference
%D Why do we have to write down references? \TEX, and therefore
@@ -277,11 +277,11 @@
\fi
\fi}
-%D Beware: \type {#2} gobbles space in references so that
-%D \typ {a nice ref} becomes \typ {anice ref}.
+%D Beware: \type {#2} gobbles space in references so that
+%D \typ {a nice ref} becomes \typ {anice ref}.
-\def\dodowritereference#1#2#3\end#4#5#6%
- {\bgroup
+\def\dodowritereference#1#2#3\end#4#5#6%
+ {\bgroup
\global\advance\crossreferencenumber \plusone\relax
\if#1-\if#2:%
\let\referenceprefix\empty
@@ -508,7 +508,7 @@
% \getvalue{\r!cross\fileprefix#2}%
% \egroup}
-\def\copycrossreference#1#2#3% file from to / slow
+\def\copycrossreference#1#2#3% file from to / slow
{\bgroup
\doifelse{#1}{}
{\let\fileprefix\empty}
@@ -1389,12 +1389,12 @@
\egroup
\doresetgotowhereever} % to prevent problems with direct goto's
-%D The following local redefinition permits the usage of
-%D nested \type {\doifreferencefoundelse}; see for an
+%D The following local redefinition permits the usage of
+%D nested \type {\doifreferencefoundelse}; see for an
%D example the local test for file|/|url references. This is
%D a fuzzy part of this mechanism and a result of the choice
-%D to let speed prevail over beauty in resolving chained
-%D references with symbolic (defined) references.
+%D to let speed prevail over beauty in resolving chained
+%D references with symbolic (defined) references.
\def\localdoifreferencefoundelse#1#2#3%
{\dodoifreferencefoundelse{#1}%
@@ -1646,7 +1646,7 @@
\def\reportreferenceerror#1#2%
{\bgroup
- \the\everyreference % cleanup : etc in french
+ \the\everyreference % cleanup : etc in french
\ifvoorlopig\ifinpagebody\else
\doifsomething{#2}
{\inlinker
@@ -1744,7 +1744,7 @@
\ifdone#2\else#3\fi}
{#3\unknownreference{#1}}}
-\def\docheckifreferencepermitted#1%
+\def\docheckifreferencepermitted#1%
{\ifx\currentinnerreference\empty
\ifx\currentouterreference\empty \else
\doifinstring{\currentouterreference::}\permittedreferences\donefalse
@@ -2089,8 +2089,8 @@
\beginETEX
-\def\checkexecutecommand#1#2% evt geen #1 en #2
- {\ifx#2\empty \else \ifcsname\s!do:\s!do:#1\endcsname
+\def\checkexecutecommand#1#2% evt geen #1 en #2
+ {\ifx#2\empty \else \ifcsname\s!do:\s!do:#1\endcsname
\@EA\let\@EA\docheckexecutecommand\csname\s!do:\s!do:#1\endcsname
\rawprocesscommalist[#2]\docheckexecutecommand
\fi \fi }
@@ -2099,8 +2099,8 @@
\beginTEX
-\def\checkexecutecommand#1#2% evt geen #1 en #2
- {\ifx#2\empty \else \@EA\ifx\csname\s!do:\s!do:#1\endcsname\relax \else
+\def\checkexecutecommand#1#2% evt geen #1 en #2
+ {\ifx#2\empty \else \@EA\ifx\csname\s!do:\s!do:#1\endcsname\relax \else
\@EA\let\@EA\docheckexecutecommand\csname\s!do:\s!do:#1\endcsname
\rawprocesscommalist[#2]\docheckexecutecommand
\fi \fi }
@@ -2113,7 +2113,7 @@
%D special driver (using \type{\executecommand}).
% better: [command(name)] and \definereference[name][command(name)]
-
+
\setglobalsystemreference \rt!exec \v!CloseDocument {close}
\setglobalsystemreference \rt!exec \v!ExitViewer {exit}
\setglobalsystemreference \rt!exec \v!FirstPage {first}
@@ -2239,7 +2239,7 @@
\ifx\@@rfprefix\empty
\let\referenceprefix\empty
\else\ifx\@@rfprefix\incrementreferenceprefix
- \advance\prefixcounter \plusone % should be global
+ \advance\prefixcounter \plusone % should be global
\edef\referenceprefix{\the\prefixcounter:}%
\let\@@rfprefix\s!unknown
\else\ifx\@@rfprefix\decrementreferenceprefix
@@ -2356,8 +2356,8 @@
\unexpanded\def\dospecialover[#1]%
{\dontleavehmode
\bgroup
- \def\thecurrentsubtextreference%
- {\limitatetext{\currentsubtextreference}{\@@rfbreedte}{\unknown}}%
+ \def\thecurrentsubtextreference
+ {\limitatetext\currentsubtextreference\@@rfbreedte\unknown}%
%\leaveoutervmode % no
\@@rflinks
\doifreferencefoundelse{#1}
@@ -2804,7 +2804,7 @@
\def\gebruikURL
{\bgroup
- \protectlabels
+ \protectlabels
\catcode`\#=12\catcode`\%=12\catcode`\/=12
\catcode`\_=12\catcode`\~=12\catcode`\:=12
\dodoubleempty\dogebruikURL}
@@ -2941,7 +2941,7 @@
\def\simpleuit
{\bgroup
- \protectlabels
+ \protectlabels
\ifundefined{\v!file:::\otherlabel}%
{\tttf[\otherlabel]}%
\else
@@ -2961,7 +2961,7 @@
\def\complexuit[#1]%
{\dontleavehmode % added, but probably not needed
\bgroup
- \protectlabels % needed for active french :'s
+ \protectlabels % needed for active french :'s
\edef\!!stringa{#1}%
\doifincsnameelse{::}\!!stringa\donothing{\edef\!!stringa{#1::}}%
\@EA\docomplexuit\@EA[\!!stringa]}
@@ -3287,7 +3287,7 @@
\newif\ifautocrossdocument
-\def\docoupledocument[#1][#2][#3][#4]% is this :/- safe ?
+\def\docoupledocument[#1][#2][#3][#4]% is this :/- safe ?
{\ifthirdargument
\begingroup
\def\dolijstelement##1##2##3##4##5##6% 2=aut 6=pag / 2 goes into text ref slot
@@ -3529,7 +3529,7 @@
% \c!breedte=\overlaywidth,\c!hoogte=\overlayheight]%
% {}}
-\def\complexoverlaybutton[#1]%
+\def\complexoverlaybutton[#1]%
{\iflocation
\doifreferencefoundelse{#1}
{\overlayfakebox {#1}}
diff --git a/tex/context/base/core-reg.tex b/tex/context/base/core-reg.tex
index e2f3b64dd..9b105df70 100644
--- a/tex/context/base/core-reg.tex
+++ b/tex/context/base/core-reg.tex
@@ -286,6 +286,61 @@
\def\dosetpageregisterpage#1#2#3#4#5#6%
{\doifreglevelelse[#5]{\dodosetpageregisterpage{#1}{#2}{#3}{#4}{#5}{#6}}{}}
+% \def\dodosetpageregisterpage#1#2#3#4#5#6%
+% {\global\utilitydonetrue
+% \c!entryletter
+% \setregisterhowto[#3]%
+% \def\dohandleregisterentry##1%
+% {\bgroup
+% \if!!donea % \strut nieuw
+% \setbox0\hbox{\showlocation{\doregistertexthowto{#2}
+% {\strut\limitedregisterentry{#2}{##1}}}}%
+% \gotonextinternal{\s!ind}{#4}{#6}{\box0}%
+% \else
+% \doregistertexthowto{#2}{##1}%
+% \fi
+% \egroup
+% \!!doneafalse}%
+% \!!doneafalse
+% \doifelsevalue{\??id#2\c!interactie}\v!tekst
+% {\ifcase\currententrylevel \or
+% \!!doneatrue\c!entrya\c!entryb\c!entryc \or
+% \c!entrya\!!doneatrue\c!entryb\c!entryc \or
+% \c!entrya\c!entryb\!!doneatrue\c!entryc \fi}
+% {\c!entrya\c!entryb\c!entryc}%
+% \global\let\c!entrya\relax
+% \global\let\c!entryb\relax
+% \global\let\c!entryc\relax
+% \global\let\c!entryletter\relax
+% \global\let\c!entryreference\relax
+% % \global\firstregisterentrytrue
+% \iffirstregisterpage
+% \global\chardef\lastregisterpagestatus\zerocount
+% \expandafter\hskip\getvalue{\??id#2\c!afstand}\relax
+% \donetrue
+% \else\ifnum#1=3
+% |--|\relax % -- !
+% \donetrue
+% \else\ifnum\lastregisterpagestatus=2
+% \donefalse % waiting for "to" pagenumber
+% \else
+% \registerpageseparator
+% |\spatie|\relax % \relax needed because | looks ahead
+% \donetrue
+% \fi\fi\fi
+% \ifdone
+% \doifelsevalue{\??id#2\c!interactie}\v!paginanummer
+% {\bgroup
+% \setbox0\hbox
+% {\showlocation{\doregisterpage{#2}[#5]\ifnum#1=2\/\fi}}%
+% \gotonextinternal\s!ind{#4}{#6}{\box0}%{\copy0}%
+% \egroup}
+% {\hbox{\doregisterpage{#2}[#5]\ifnum#1=2\/\fi}}%
+% \ignorespaces
+% \global\chardef\lastregisterpagestatus#1\relax
+% \fi
+% \global\firstregisterpagefalse}
+
\def\dodosetpageregisterpage#1#2#3#4#5#6%
{\global\utilitydonetrue
\c!entryletter
@@ -293,9 +348,14 @@
\def\dohandleregisterentry##1%
{\bgroup
\if!!donea % \strut nieuw
- \setbox0\hbox{\showlocation{\doregistertexthowto{#2}
- {\strut\limitedregisterentry{#2}{##1}}}}%
- \gotonextinternal{\s!ind}{#4}{#6}{\box0}%
+ %\setbox0\hbox{\showlocation{\doregistertexthowto{#2}
+ % {\strut\limitedregisterentry{#2}{##1}}}}%
+ % \gotonextinternal\s!ind{#4}{#6}{\box0}%
+ %
+ \hhboxindent\hangindent % maybe also left and right skip
+ \setbox0\hbox{\doregistertexthowto{#2}{\strut\limitedregisterentry{#2}{##1}}}%
+ \unhhbox0\with{\gotonextinternal\s!ind{#4}{#6}{\box\hhbox}}%
+ %
\else
\doregistertexthowto{#2}{##1}%
\fi
@@ -349,7 +409,7 @@
{\doregistertexthowto{#1}{\strut\limitedregisterentry{#1}{##1}}}%
\getvalue
{#1\ifcase\currententrylevel\s!entrya\or\s!entryb\else\s!entryc\fi}%
- {\doregisterpagehowto{#1}{\labeltexts{\v!zie}{#3}}}%
+ {\doregisterpagehowto{#1}{\labeltexts\v!zie{#3}}}%
\c!entryletter\c!entrya\c!entryb\c!entryc
\global\let\c!entrya\relax
\global\let\c!entryb\relax
@@ -382,8 +442,7 @@
{\getvalue{\??id#1\c!voor}%
\vskip\lineheight\goodbreak\vskip-\lineheight
\ifhmode\unskip\else\noindent\fi % brrr
- \getvalue{\??id#1\c!commando}%
- {\doattributes{\??id#1}\c!letter\c!kleur{\strut\ignorespaces#2}}%
+ \getvalue{\??id#1\c!commando}{\doattributes{\??id#1}\c!letter\c!kleur{\strut\ignorespaces#2}}%
\getvalue{\??id#1\c!na}%
\par\nobreak}
@@ -397,6 +456,9 @@
\getvalue{\??id#1\c!na}%
\nobreak}
+\def\doregistercharacterA[#1]#2{\doregistercharactera[#1]{\WORD{#2}}}
+\def\doregistercharacterB[#1]#2{\doregistercharacterb[#1]{\WORD{#2}}}
+
%D Don't use \type{\string#2}; another hack isneeded, since
%D \type {#2} can be \type {\string} itself.
@@ -496,7 +558,8 @@
\c!entryletter
\iflocation
\getalllistreferences{#1}{#2}%
- \endgraf\hangindent1em\noindent\c!entryreference
+% \endgraf
+ \hangindent1em\noindent\c!entryreference
%
%\thisissomeinternal{\s!lin}{\internallistreference}%
%
@@ -538,7 +601,7 @@
\fi}}%
\doifvalue{\??id#1\c!nummer}\v!ja
{\hskip\getvalue{\??id#1\c!afstand}(\commalistsize)}%
- \doifnotvalue{\??id#1\c!interactie}{\v!tekst} % paginanummer,alles
+ \doifnotvalue{\??id#1\c!interactie}\v!tekst % paginanummer,alles
{\def\docommando##1##2%
{{\setbox0\hbox{\showlocation{\hbox to 1em{\hss\symbol[##2]\hss}}}%
\ifx##1\empty
@@ -552,9 +615,11 @@
\docommando\lastlistreference\v!volgende}%
% tot hier
\else
- \endgraf\noindent\c!entryreference
+% \endgraf
+ \noindent\c!entryreference
\limitedregisterentry{#1}{#2}%
- \fi}
+ \fi
+\endgraf}
\def\dosetregister#1%
{\doifelsevalue{\??id#1\c!koppeling}\v!ja
@@ -964,4 +1029,4 @@
%
% \volledigeindex
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/core-rul.tex b/tex/context/base/core-rul.tex
index d09e5370e..c50cf9955 100644
--- a/tex/context/base/core-rul.tex
+++ b/tex/context/base/core-rul.tex
@@ -31,7 +31,7 @@
\newdimen\linewidth
\def\dosetuplinewidth[#1]%
- {\assigndimension{#1}\linewidth{.2\s!pt}{.4\s!pt}{.6\s!pt}}
+ {\assigndimension{#1}\linewidth{.2\points}{.4\points}{.6\points}}
\def\setuplinewidth
{\dosingleargument\dosetuplinewidth}
@@ -117,7 +117,7 @@
{\bgroup
\forgetall
\mindermeldingen
- \dimen10=\!!onepoint
+ \dimen10=\onepoint
\dimen10=\@@rsfactor\dimen10
\dimen10=#5\dimen10
\setbox2\hbox to #2
@@ -669,6 +669,8 @@
{\bgroup
\dodoubleempty\startlocalframed}
+\let\fastlocalframed\localframed
+
%D Before we go into details, we present (and implement) the
%D main framing routine. I saw no real reason for splitting the
%D next two macros into smaller pieces. The content will be
@@ -917,6 +919,21 @@
\newif\ifreshapeframebox \reshapeframeboxtrue
+%D Beware: setting \type {top} and \type {bottom} to nothing, may
+%D result in a frame that is larger that the given height! try:
+%D
+%D \starttypen
+%D \framed
+%D [height=3cm,top=,bottom=,offset=overlay]
+%D {\strut test \shapefill \strut test}
+%D \stoptypen
+%D
+%D This is intended behaviour and not a bug! One can always set
+%D
+%D \starttypen
+%D ...,bottom=\kern0pt,...
+%D \stoptypen
+
\def\stoplocalframed
{\dontshowcomposition
\ifboxhasformat
@@ -1268,20 +1285,111 @@
%D or free widths and heights. Each combination gets its own
%D macro.
-\def\dopresetformatbox
- {\forgetall
- \oninterlineskip}
+% \def\dopresetformatbox
+% {\forgetall
+% \oninterlineskip}
+
+% \def\doformatboxSomeFormat
+% {\vbox to \!!heighta
+% \bgroup
+% \dopresetformatbox
+% \hsize\!!widtha
+% \vsize\!!heighta
+% \raggedcommand
+% \dobeforeframedbox
+% \bgroup
+% \localbegstrut
+% \aftergroup\localendstrut
+% \aftergroup\doafterframedbox
+% \aftergroup\egroup
+% \let\next=}
+
+% \def\doformatboxNoFormat
+% {\vbox to \!!heighta
+% \bgroup
+% \dopresetformatbox
+% \hsize\!!widtha
+% \vsize\!!heighta
+% \raggedcenter
+% \vss
+% \bgroup
+% \localbegstrut
+% \aftergroup\localendstrut
+% \aftergroup\vss
+% \aftergroup\egroup
+% \let\next=}
+
+% \def\doformatboxHeight
+% {\vbox to \!!heighta
+% \bgroup
+% \dopresetformatbox
+% \raggedcommand
+% \vss
+% \bgroup
+% \aftergroup\localendstrut
+% \aftergroup\vss
+% \aftergroup\egroup
+% \localbegstrut
+% \let\next=}
+
+% \def\doformatboxWidth
+% {\vbox
+% \bgroup
+% \dopresetformatbox
+% \hsize\!!widtha
+% \raggedcommand
+% \dobeforeframedbox
+% \bgroup
+% \localbegstrut
+% \aftergroup\localendstrut
+% \aftergroup\doafterframedbox
+% \aftergroup\egroup
+% \let\next=}
+
+% \def\doformatboxVSize
+% {\vbox to \!!heighta
+% \bgroup
+% \forgetall
+% \vsize\!!heighta
+% \vss
+% \bgroup
+% \aftergroup\vss
+% \aftergroup\egroup
+% \hbox
+% \bgroup
+% \aftergroup\egroup
+% \localstrut
+% \let\next=}
+
+% \def\doformatboxHSize
+% {\hbox to \!!widtha
+% \bgroup
+% \forgetall
+% \hss
+% \localstrut
+% \bgroup
+% \aftergroup\hss
+% \aftergroup\egroup
+% \let\next=}
+
+% \def\doformatboxNoSize
+% {\hbox
+% \bgroup
+% \localstrut
+% \let\next=}
\def\doformatboxSomeFormat
{\vbox to \!!heighta
\bgroup
- \dopresetformatbox
+ \forgetall
+ \oninterlineskip
\hsize\!!widtha
\vsize\!!heighta
\raggedcommand
\dobeforeframedbox
\bgroup
\localbegstrut
+ \@@handleoneliner
\aftergroup\localendstrut
\aftergroup\doafterframedbox
\aftergroup\egroup
@@ -1290,13 +1398,15 @@
\def\doformatboxNoFormat
{\vbox to \!!heighta
\bgroup
- \dopresetformatbox
+ \forgetall
+ \oninterlineskip
\hsize\!!widtha
\vsize\!!heighta
\raggedcenter
\vss
\bgroup
\localbegstrut
+ \@@handleoneliner
\aftergroup\localendstrut
\aftergroup\vss
\aftergroup\egroup
@@ -1305,7 +1415,8 @@
\def\doformatboxHeight
{\vbox to \!!heighta
\bgroup
- \dopresetformatbox
+ \forgetall
+ \oninterlineskip
\raggedcommand
\vss
\bgroup
@@ -1313,29 +1424,20 @@
\aftergroup\vss
\aftergroup\egroup
\localbegstrut
+ \@@handleoneliner
\let\next=}
-% \def\doformatboxWidth
-% {\vbox
-% \bgroup
-% \dopresetformatbox
-% \hsize\!!widtha
-% \raggedcommand
-% \bgroup
-% \localbegstrut
-% \aftergroup\localendstrut
-% \aftergroup\egroup
-% \let\next=}
-
\def\doformatboxWidth
{\vbox
\bgroup
- \dopresetformatbox
+ \forgetall
+ \oninterlineskip
\hsize\!!widtha
\raggedcommand
\dobeforeframedbox
\bgroup
\localbegstrut
+ \@@handleoneliner
\aftergroup\localendstrut
\aftergroup\doafterframedbox
\aftergroup\egroup
@@ -1354,6 +1456,7 @@
\bgroup
\aftergroup\egroup
\localstrut
+ \@@handleoneliner
\let\next=}
\def\doformatboxHSize
@@ -1362,6 +1465,7 @@
\forgetall
\hss
\localstrut
+ \@@handleoneliner
\bgroup
\aftergroup\hss
\aftergroup\egroup
@@ -1371,6 +1475,7 @@
{\hbox
\bgroup
\localstrut
+ \@@handleoneliner
\let\next=}
%D On the next page we show some examples of how these macros
@@ -2059,8 +2164,8 @@
\let\@@dlhoogte\!!plusone
\let\@@dldiepte\!!plusone
\fi
- \freezedimensionwithunit\@@dlhoogte{\strutht}%
- \freezedimensionwithunit\@@dldiepte{\strutdp}%
+ \freezedimensionwithunit\@@dlhoogte\strutht
+ \freezedimensionwithunit\@@dldiepte\strutdp
\divide\linewidth 2
\doifelse\@@dlachtergrond\v!kleur
{\startcolor[\@@dlachtergrondkleur]%
@@ -2475,7 +2580,7 @@
\def\doframedtext
{\bgroup\dodoubleempty\dodoframedtext}
-\def\dodoframedtext[#1][#2]%
+\def\dodoframedtext[#1][#2]% beware!
{\expanded{\switchtobodyfont[\getvalue{\??kd#1\c!korps}]}%
\localframed[\??kd#1][\c!strut=\v!nee,#2]%
\bgroup
@@ -3040,6 +3145,8 @@
\c!strut=\v!nee,
\c!offset=\v!overlay,
\c!regelcorrectie=\v!nee,
+ \c!links=,
+ \c!rechts=,
#2]}
\def\setupframedcontent
@@ -3086,8 +3193,11 @@
\else
\doifelsevalue{\??fc#1\c!regelcorrectie}\v!ja\donetrue\donefalse
\fi
+ % plaats ?
\ifdone\startregelcorrectie\fi
+ \getvalue{\??fc#1\c!links}% new
\localframed[\??fc#1]{\box\framebox}%
+ \getvalue{\??fc#1\c!rechts}% new
\ifdone\stopregelcorrectie\fi
\egroup}
diff --git a/tex/context/base/core-sec.tex b/tex/context/base/core-sec.tex
index d76621570..dc84ffad3 100644
--- a/tex/context/base/core-sec.tex
+++ b/tex/context/base/core-sec.tex
@@ -927,7 +927,7 @@
\advance\!!counta \!!countb
\dosomebreak{\penalty\!!counta}%
\else
- \dosomebreak{\allowbreak}%
+ \dosomebreak\allowbreak
\fi
\fi
\xdef\@@koniveau{\getvalue{\??se\@@sectie\c!niveau}}}
@@ -1344,8 +1344,8 @@
\ifkopprefix
\setupreferenceprefix[\localkopprefix]%
\fi
- \dosomebreak\nobreak
\ifdisplaysectionhead
+ \dosomebreak\nobreak
\emptyheadcorrection
\getvalue{\??ko#1\c!na}%
\fi
@@ -1410,8 +1410,8 @@
{\marking[#1]{#4}%
\marking[#1\v!nummer]{}}%
\writesection{#1}{-}{#4}%
- \dosomebreak\nobreak
\ifdisplaysectionhead
+ \dosomebreak\nobreak
\emptyheadcorrection
\getvalue{\??ko#1\c!na}%
\fi
@@ -1544,8 +1544,11 @@
% \section{test test test test test test test test test test
% test test test test test test test}
+\newevery \everyheadstart \relax
+
\def\placeheadmargintexts#1%
- {\doifvalue{\??ko#1\c!margetekst}\v!ja\placemargintexts}
+ {\the\everyheadstart
+ \doifvalue{\??ko#1\c!margetekst}\v!ja\placemargintexts}
\def\doplaatskoptekst#1#2#3#4%
{\beginheadplacement{#1}%
diff --git a/tex/context/base/core-snc.tex b/tex/context/base/core-snc.tex
new file mode 100644
index 000000000..81d310c95
--- /dev/null
+++ b/tex/context/base/core-snc.tex
@@ -0,0 +1,179 @@
+%D \module
+%D [ file=core-snc,
+%D version=2003.12.01,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=Synchronization Support,
+%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 Synchronization}
+
+\unprotect
+
+\def\definesyncpositions[#1]%
+ {\setcounter{num:syncpos:#1}{0}%
+ \doglobal\appendtoksonce\getvalue {reset:sync:#1}\to\resetsyncpositions
+ \doglobal\appendtoksonce\getvalue{preset:sync:#1}\to\presetsyncpositions
+ \setgvalue{syncpos:#1}{sync_n[#1] := 0 ;}%
+ \setgvalue{set:syncpos:#1}{\dosetsyncpositions{#1}}}
+
+\def\syncposition
+ {\dodoubleempty\dosyncposition}
+
+\def\dosyncposition[#1][#2]%
+ {\letgvalue{reset:sync:#1}\relax
+ \letgvalue{preset:sync:#1}\relax
+ \dontleavehmode
+ \dodosyncposition{#1}{#2}\s!set
+ \ignorespaces}
+
+\def\doifelselastsyncposition#1#2%
+ {\doifelse{\lastsyncclass\lastsyncposition}{#1#2}}
+
+\def\dodosyncposition#1#2#3%
+ {\letgvalue{reset:sync:#1}\relax
+ \letgvalue{preset:sync:#1}\relax
+ \ifundefined{syncpos:#1}%
+ \strut
+ \else
+ \pluscounter{num:syncpos:#1}%
+ \setsyncpositions{#1}%
+ % option: geen w/h, alleen p 0 0 0 data
+ \setpositionplus
+ {sync:#1:\countervalue{num:syncpos:#1}}%
+ {#2}%
+ \hbox{\strut\traceposstring\llap\green{#3/\countervalue{num:syncpos:#1}/#1/#2>>}}%
+ \fi}
+
+\def\setsyncpositions#1%
+ {\enabletextarearegistration
+ \getvalue{set:syncpos:#1}%
+ \letgvalue{set:syncpos:#1}\relax}
+
+\def\dosetsyncpositions#1%
+ {\startnointerference % removing out of sync can best be done in mp
+ \!!dimena\maxdimen
+ \!!counta\zerocount
+ \!!countc\zerocount
+ \doloop
+ {\doifpositionelse{sync:#1:\recurselevel}
+ {\!!dimenb\MPy{sync:#1:\recurselevel}\relax
+ \!!countb\MPp{sync:#1:\recurselevel}\relax
+ \ifnum\!!countb=\!!counta % same page
+ \ifdim\!!dimenb>\!!dimena
+ \donefalse % out of order nodes
+ \else
+ \donetrue % nodes in order
+ \fi
+ \else
+ \donetrue % different page
+ \fi
+ \ifdone
+ \!!counta\!!countb
+ \!!dimena\!!dimenb
+ \advance\!!countc\plusone
+ \edef\!!stringc{sync:#1:\the\!!countc}%
+ \edef\!!stringa{[#1][\the\!!countc]}%
+ %
+ % the formal way:
+ %
+ % \setxvalue{syncpos:#1}%
+ % {\getsyncpositions{#1}%
+ % sync_p [#1][\the\!!countc] := \MPp \!!stringc ;
+ % sync_xy[#1][\the\!!countc] := \MPxy\!!stringc ;
+ % sync_w [#1][\the\!!countc] := \MPw \!!stringc ;
+ % sync_h [#1][\the\!!countc] := \MPh \!!stringc ;
+ % sync_d [#1][\the\!!countc] := \MPd \!!stringc ;
+ % sync_t [#1][\the\!!countc] := \MPplus{sync:#1:\recurselevel}{2}{0} ; }%
+ %
+ % less tokens:
+ %
+ \edef\!!stringa{[#1][\the\!!countc]:=}%
+ \setxvalue{syncpos:#1}%
+ {\getsyncpositions{#1}%
+ sync_p \!!stringa \MPp \!!stringc ;
+ sync_xy\!!stringa \MPxy\!!stringc ;
+ sync_w \!!stringa \MPw \!!stringc ;
+ sync_h \!!stringa \MPh \!!stringc ;
+ sync_d \!!stringa \MPd \!!stringc ;
+ sync_t \!!stringa \MPplus\!!stringc{1}{0} ; }%
+ \fi}
+ {\setxvalue{syncpos:#1}%
+ {\getsyncpositions{#1}%
+ sync_n[#1] := \the\!!countc ;}
+ \exitloop}}%
+ \stopnointerference}
+
+\def\getsyncpositions#1%
+ {\getvalue{syncpos:#1}}
+
+\newtoks\resetsyncpositions
+\newtoks\presetsyncpositions
+
+\def\resyncposition {\dodoubleargument\doresyncposition}
+\def\presyncposition{\dodoubleargument\dopresyncposition}
+
+\def\dodoresyncposition #1#2{\dodosyncposition{#1}{#2}\s!reset}
+\def\dodopresyncposition#1#2{\dodosyncposition{#1}{#2}\s!preset}
+
+\def\doresyncposition [#1][#2]{\setxvalue{reset:sync:#1}{\noexpand\dodoresyncposition{#1}{#2}}}
+\def\dopresyncposition[#1][#2]{\setxvalue{preset:sync:#1}{\noexpand\dodopresyncposition{#1}{#2}}}
+
+\ifx\s!preset\undefined \def\s!preset{preset} \fi
+
+% \appendtoks \the \resetsyncpositions \to \everypar
+% \appendtoks \the\presetsyncpositions \to \everypar
+
+\appendtoks \the \presetsyncpositions \to \everypar
+\appendtoks \the \resetsyncpositions \to \everypar
+
+% \explicitneverypar -> in grid snapper, eerst testen
+%
+% \appendtoks \the\resetsyncpositions \to \neverypar
+% \appendtoks \the\presetsyncpositions \to \neverypar
+
+\appendtoks
+ \the\presetsyncpositions
+ \the\resetsyncpositions
+\to \everyheadstart
+
+\def\flushsyncxxsets#1#2%
+ {\setbox\scratchbox\hbox{\the#1}%
+ \ifvoid\scratchbox\else
+ \smashbox\scratchbox
+ #2\box\scratchbox
+ \fi}
+
+\def\flushsyncresets {\flushsyncxxsets\resetsyncpositions \relax}
+\def\flushsyncpresets{\flushsyncxxsets\presetsyncpositions\prewordbreak} % check prewordbreak
+
+\protect \endinput
+
+% \definesyncpositions[1]
+
+% \startuseMPgraphic{sync}
+% StartPage ;
+% \getsyncpositions{1} ;
+% SyncThreshold := 2LineHeight ; % maybe 3
+% SyncLeftOffset := -.5LeftMarginDistance ;
+% SetSyncThreshold(1,3,3LineHeight) ;
+% SyncWidth := - (BackSpace + SyncLeftOffset + 3mm) ;
+% SetSyncColor(1,1,\MPcolor{theorie:middel}) ;
+% SetSyncColor(1,2,\MPcolor{praktijk:middel}) ;
+% SetSyncColor(1,3,\MPcolor{samenvatting:middel}) ;
+% SetSyncColor(1,4,\MPcolor{voorbeeld:middel}) ;
+% PrepareSyncTasks(1,true,true,false) ;
+% for i = 1 upto NOfSyncPaths :
+% fill SyncPaths[i] topenlarged (LineHeight+StrutDepth) bottomenlarged LineHeight withcolor white ;
+% fill SyncPaths[i] topenlarged StrutDepth withcolor TheSyncColor(CurrentSyncClass,sync_t[CurrentSyncClass][SyncTasks[i]]) ;
+% endfor ;
+% setbounds currentpicture to Page ;
+% StopPage ;
+% \stopuseMPgraphic
+
+% \defineoverlay[tempoverlay][\useMPgraphic{sync}] \ No newline at end of file
diff --git a/tex/context/base/core-spa.tex b/tex/context/base/core-spa.tex
index 09823c6f7..9b4864445 100644
--- a/tex/context/base/core-spa.tex
+++ b/tex/context/base/core-spa.tex
@@ -47,6 +47,23 @@
\def\softbreak
{\relax\ifhmode\hskip\parfillskip\break\fi}
+\let\poplastnode\relax
+
+\def\pushlastnode
+ {\ifdim\lastskip=\zeropoint
+ \ifnum\lastpenalty=\zerocount
+ \ifnum\lastkern=\zerocount
+ \let\poplastnode\relax
+ \else
+ \edef\poplastnode{\kern\the\lastkern\relax}\kern-\lastkern % untested
+ \fi
+ \else
+ \edef\poplastnode{\penalty\the\lastpenalty\relax}\nobreak % untested
+ \fi
+ \else
+ \edef\poplastnode{\vskip\the\lastskip\relax}\vskip-\lastskip % \removelastskip
+ \fi}
+
%D The dreadful sequence \type {\bgroup} \unknown\
%D \type {\carryoverpar} \unknown\ \type {\egroup} is needed
%D when for instance sidefloats are used in combination with
@@ -126,9 +143,9 @@
\def\setupspecifiedinterlinespace[#1]%
{\getparameters[\??it][#1]%
- \scratchdimen0\@@ithoogte\s!pt
- \advance\scratchdimen 0\@@itdiepte\s!pt
- \ifdim\scratchdimen>1\s!pt
+ \scratchdimen0\@@ithoogte\points
+ \advance\scratchdimen 0\@@itdiepte\points
+ \ifdim\scratchdimen>\onepoint
\showmessage\m!layouts{10}{\@@ithoogte,\@@itdiepte}%
\let\@@ithoogte\strutheightfactor
\let\@@itdiepte\strutdepthfactor
@@ -178,6 +195,8 @@
% \type{\normalskipamount} equals the current baseline
% distance.
+% can be conditionals
+
\newif\ifblankoreset \blankoresetfalse
\newif\ifblankoblokkeer \blankoblokkeerfalse
\newif\ifblankogeenwit \blankogeenwitfalse
@@ -185,6 +204,7 @@
\newif\ifblankoflexibel \blankoflexibeltrue
\newif\ifblankobuiten
\newif\ifblankoforceer
+\newif\ifblankogoback
\newskip\blankoskip \blankoskip=\bigskipamount
\newskip\blankoskipamount
@@ -437,7 +457,7 @@
\defineblankmethod [\v!reset ]{\global\blankoresettrue}
\defineblankmethod [\v!flexibel ]{\global\lokaalblankoflexibeltrue}
\defineblankmethod [\v!vast ]{\global\lokaalblankovasttrue}
-\defineblankmethod [\v!back ]{\geenblanko}
+\defineblankmethod [\v!back ]{\global\blankogobacktrue} % {\geenblanko}
\defineblankmethod [\v!halveregel ]{\ifgridsnapping\global\fuzzyvskiptrue\fi
\global\advance\blankoskip .5\lineheight}
@@ -538,6 +558,220 @@
\newsignal\noblanksignal
+% \def\doinhibitblank
+% {\kern\noblanksignal}
+
+% \def\inhibitblank% the fast, local way
+% {\endgraf\ifvmode\prevdepth\newprevdepth\fi}
+
+% \def\docomplexdoblanko[#1]% pas op \relax's zijn nodig ivm volgende \if
+% {\global\blankoresetfalse
+% \global\blankoblokkeerfalse
+% \global\blankogeenwitfalse
+% \global\lokaalblankoflexibelfalse
+% \global\lokaalblankovastfalse
+% \global\blankoskip\zeropoint
+% \global\blankoforceerfalse
+% \global\blankogobackfalse
+% \blankobuitenfalse
+% \expanded{\rawprocesscommalist[#1]}\doblanko
+% \ifdim\blankoskip=\zeropoint\relax
+% \iflokaalblankoflexibel
+% \doglobal\advance\blankoskip \currentblanko
+% \else\iflokaalblankovast
+% \doglobal\advance\blankoskip \currentblanko
+% \fi\fi
+% \fi
+% \ifblankobuiten
+% \else
+% \par
+% \ifvmode
+% \ifblankogoback
+% \removelastskip
+% \fi
+% \ifblankoforceer
+% % dit gaat mis in pos fonts
+% % \ifdim\prevdepth>\zeropoint\else ...
+% % -1000pt signals top of page or column (\ejectcolumn)
+% \bgroup\forgeteverypar\verticalstrut\egroup\kern-\struttotal
+% \fi
+% \ifblankoblokkeer
+% \global\doeblankofalse
+% \ifgridsnapping
+% \ifdim\prevdepth<\zeropoint
+% % brrr
+% \else
+% % dirty trick: smaller blanks are ignored after
+% % a larger one, so 10 lines is probably safe; first make
+% % sure that we honor penalties
+% \scratchcounter\lastpenalty
+% % now comes the trick (cross our fingers that this works
+% % well in multi columns; maybe an ifinner test is needed
+% % \vskip-10\lineheight
+% % \ifnum\scratchcounter=\zerocount \else \penalty\lastpenalty \fi
+% % \vskip 10\lineheight
+% % allas, this leads to overfull pages, so we try this:
+% \kern-\noblanksignal
+% \ifnum\scratchcounter=\zerocount
+% \else
+% \penalty\lastpenalty
+% \fi
+% \kern\noblanksignal
+% % end-of-dirty-trick
+% \fi
+% \else
+% \ifdim\prevdepth<\zeropoint
+% % brrr
+% \else
+% % ensure at least a proper prevdepth, this should be
+% % an option
+% \vskip-\prevdepth
+% \vskip\strutdepth
+% \prevdepth\strutdepth
+% \fi
+% % the old crappy piece of code
+% \edef\oldprevdepth{\the\prevdepth}%
+% \prevdepth\newprevdepth
+% \fi
+% \else
+% \global\doeblankotrue
+% \fi
+% \ifblankoreset
+% \global\doeblankotrue
+% \ifgridsnapping
+% % let's play safe and not fool around with the depth, if
+% % only because it took a lot of effort to sort out the grid
+% % stuff in the first place
+% \else
+% \ifdim\prevdepth=\newprevdepth
+% \prevdepth\oldprevdepth
+% \fi
+% \fi
+% \fi
+% \ifdoeblanko
+% \ifdim1\lastskip<1\blankoskip\relax
+% % else when \blanko[2*groot] + \blanko[3*groot] with parskip
+% % equaling 1*groot, gives a groot=\parskip so adding a small
+% % value makes it distinguishable; can also be done at parskip
+% % setting time (better)
+% \global\advance\blankoskip \mindimen\relax % = skip
+% % test this on 2* + 3* and parskip groot
+% \ifblankogeenwit
+% \global\advance\blankoskip -\parskip
+% \else
+% \ifdim\lastskip=\parskip
+% \else % force this due to previous comment
+% \ifdim\parskip>\zeropoint\relax
+% \ifdim\blankoskip<\parskip\relax
+% \global\blankoskip\zeropoint
+% \else
+% \global\advance\blankoskip -\parskip
+% \fi
+% \fi
+% \fi
+% \fi
+% \ifblankoflexibel \else
+% \blankoskip1\blankoskip
+% \fi
+% \iflokaalblankovast
+% \blankoskip1\blankoskip
+% \fi
+% \iflokaalblankoflexibel
+% \blankoskip1\blankoskip
+% \!!plus\skipgluefactor\blankoskip
+% \!!minus\skipgluefactor\blankoskip
+% \fi
+% \ifdim\lastkern=\noblanksignal % controled and grid
+% \global\doeblankofalse
+% \else\ifgridsnapping\else\ifdim\prevdepth=\newprevdepth
+% \global\doeblankofalse
+% \fi\fi\fi
+% \ifdoeblanko
+% \iffuzzyvskip
+% \removelastfuzzyvskip
+% \fuzzyvskip\blankoskip\relax
+% \else
+% \removelastskip
+% \vskip\blankoskip\relax
+% \fi
+% \fi
+% \else
+% \iffuzzyvskip
+% \removelastfuzzyvskip
+% \fuzzyvskip\blankoskip\relax
+% \else
+% % new, test this on pascal
+% \ifdim\blankoskip<\zeropoint
+% \advance\blankoskip-\lastskip
+% \removelastskip
+% \ifdim\blankoskip>\zeropoint
+% \vskip\blankoskip
+% \else
+% \vskip\zeropoint
+% \fi
+% \else
+% % also new
+% \ifdim\blankoskip=\zeropoint
+% \ifblankogeenwit
+% \geenwitruimte
+% \fi
+% \fi
+% \fi
+% \fi
+% \fi
+% \fi
+% \fi
+% \fi
+% \global\fuzzyvskipfalse
+% \presetindentation}
+
+% goback was broken:
+
+% \def\doinhibitblank
+% {\kern\noblanksignal}
+
+% \def\inhibitblank% the fast, local way
+% {\endgraf\ifvmode\prevdepth\newprevdepth\fi}
+
+% problem: we cannot look back in the mvl so we need 3 kinds of signals
+
+\def\noblankpsignal{1010101}
+
+\def\inhibitgridblank % was doinhibitblank
+ {\ifnum\lastpenalty<10000
+ \kern-\noblanksignal % new
+ \kern \noblanksignal
+ \else
+ \penalty\noblankpsignal
+ \fi}
+
+\def\inhibittextblank % was inhibitblank
+ {\endgraf
+ \ifvmode
+ \prevdepth\newprevdepth
+ \fi}
+
+% new macro
+%
+% \def\inhibitblank % need some work
+% {\endgraf
+% \ifvmode
+% \ifgridsnapping
+% \inhibitgridblank
+% \else
+% % this one spoils the grid
+% \inhibittextblank
+% \fi
+% \fi}
+
+\def\doinhibitblank{\inhibitgridblank}
+\def\inhibitblank {\inhibittextblank}
+
+% will become obsolete
+
+\ifx\undefined\savedlastskip \newskip \savedlastskip \fi
+\ifx\undefined\savedlastpenalty \newcount\savedlastpenalty \fi
+
\def\docomplexdoblanko[#1]% pas op \relax's zijn nodig ivm volgende \if
{\global\blankoresetfalse
\global\blankoblokkeerfalse
@@ -546,6 +780,7 @@
\global\lokaalblankovastfalse
\global\blankoskip\zeropoint
\global\blankoforceerfalse
+ \global\blankogobackfalse
\blankobuitenfalse
\expanded{\rawprocesscommalist[#1]}\doblanko
\ifdim\blankoskip=\zeropoint\relax
@@ -558,34 +793,40 @@
\ifblankobuiten
\else
\par
- \ifvmode %in pos fonts gaat dit mis
- \ifblankoforceer%\ifdim\prevdepth>\zeropoint\else
+ \ifvmode
+ \ifblankogoback
+ \ifdim\lastskip>\zeropoint \vskip-\lastskip \fi
+ \savedlastskip\zeropoint
+ \else\ifdim\lastskip>\zeropoint
+ \savedlastskip\lastskip
+ \else % todo: lastnode, dan namelijk geen skip !
+ \savedlastskip\zeropoint
+ \fi\fi
+ \ifblankoforceer
+ % dit gaat mis in pos fonts
+ % \ifdim\prevdepth>\zeropoint\else ...
% -1000pt signals top of page or column (\ejectcolumn)
\bgroup\forgeteverypar\verticalstrut\egroup\kern-\struttotal
+ \savedlastskip\zeropoint
\fi
+\savedlastpenalty\lastpenalty
\ifblankoblokkeer
\global\doeblankofalse
\ifgridsnapping
\ifdim\prevdepth<\zeropoint
% brrr
\else
- % dirty trick: smaller blanks are ignored after
- % a larger one, so 10 lines is probably safe; first make
- % sure that we honor penalties
- \scratchcounter\lastpenalty
- % now comes the trick (cross our fingers that this works
- % well in multi columns; maybe an ifinner test is needed
- % \vskip-10\lineheight
- % \ifnum\scratchcounter=\zerocount \else \penalty\lastpenalty \fi
- % \vskip 10\lineheight
- % allas, this leads to overfull pages, so we try this:
- \kern-\noblanksignal
- \ifnum\scratchcounter=\zerocount
- \else
- \penalty\lastpenalty
- \fi
- \kern\noblanksignal
- % end-of-dirty-trick
+ % dirty trick: smaller blanks are ignored after a
+ % larger one, so 10 lines is probably safe; we need
+ % to make sure that we honor penalties; here comes the
+ % trick (cross our fingers that this works well in
+ % multi columns; maybe an ifinner test is needed
+ % \scratchcounter\lastpenalty
+ % \vskip-10\lineheight
+ % \ifnum\scratchcounter=\zerocount \else \penalty\lastpenalty \fi
+ % \vskip 10\lineheight
+ % alas, this leads to overfull pages, so we try this:
+ \inhibitgridblank
\fi
\else
\ifdim\prevdepth<\zeropoint
@@ -599,7 +840,7 @@
\fi
% the old crappy piece of code
\edef\oldprevdepth{\the\prevdepth}%
- \prevdepth\newprevdepth
+ \prevdepth\newprevdepth % == \inhibittextblank
\fi
\else
\global\doeblankotrue
@@ -617,7 +858,7 @@
\fi
\fi
\ifdoeblanko
- \ifdim1\lastskip<1\blankoskip\relax
+ \ifdim1\savedlastskip<1\blankoskip\relax
% else when \blanko[2*groot] + \blanko[3*groot] with parskip
% equaling 1*groot, gives a groot=\parskip so adding a small
% value makes it distinguishable; can also be done at parskip
@@ -627,7 +868,7 @@
\ifblankogeenwit
\global\advance\blankoskip -\parskip
\else
- \ifdim\lastskip=\parskip
+ \ifdim\savedlastskip=\parskip
\else % force this due to previous comment
\ifdim\parskip>\zeropoint\relax
\ifdim\blankoskip<\parskip\relax
@@ -649,28 +890,21 @@
\!!plus\skipgluefactor\blankoskip
\!!minus\skipgluefactor\blankoskip
\fi
-% \ifgridsnapping
-% \ifdim\lastkern=\noblanksignal
-% \global\doeblankofalse
-% \fi
-% \else
-% \ifdim\prevdepth=\newprevdepth
-% \global\doeblankofalse
-% \fi
-% \fi
-%
- \ifdim\lastkern=\noblanksignal % controled and grid
+ \ifdim\lastkern=\noblanksignal\relax % controlled and grid
+ \global\doeblankofalse
+ \else\ifnum\savedlastpenalty=\noblankpsignal\relax % controlled and grid
\global\doeblankofalse
\else\ifgridsnapping\else\ifdim\prevdepth=\newprevdepth
\global\doeblankofalse
- \fi\fi\fi
-%
+ \fi\fi\fi\fi
\ifdoeblanko
\iffuzzyvskip
\removelastfuzzyvskip
\fuzzyvskip\blankoskip\relax
\else
- \removelastskip
+ \relax\ifdim\savedlastskip=\zeropoint\else
+ \vskip-\savedlastskip
+ \fi
\vskip\blankoskip\relax
\fi
\fi
@@ -681,8 +915,10 @@
\else
% new, test this on pascal
\ifdim\blankoskip<\zeropoint
- \advance\blankoskip-\lastskip
- \removelastskip
+ \relax\ifdim\savedlastskip=\zeropoint\else
+ \advance\blankoskip-\savedlastskip
+ \vskip-\savedlastskip
+ \fi
\ifdim\blankoskip>\zeropoint
\vskip\blankoskip
\else
@@ -704,9 +940,6 @@
\global\fuzzyvskipfalse
\presetindentation}
-\def\doinhibitblank
- {\kern\noblanksignal}
-
%D For a long time we had:
%D
%D \starttypen
@@ -819,9 +1052,6 @@
\noexpand\blankoflexibelfalse
\fi}}
-\def\inhibitblank% the fast, local way
- {\endgraf\ifvmode\prevdepth\newprevdepth\fi}
-
%D Now.
\definieerblanko [\s!default] [\v!wit]
@@ -1262,7 +1492,7 @@
\newif\ifopelkaar
-\def\noparskipsignal {0.00001pt}
+\newsignal \noparskipsignal % \def\noparskipsignal {0.00001pt}
\def\lastdoneparskip {0pt}
\def\startopelkaar
@@ -1433,14 +1663,26 @@
% korpsgrootte 12pt is en (2) de fonts nog niet geladen zijn
% en de instellingen bij het laden nogmaals plaatsvinden.
+% \def\topskipcorrection
+% {\ifdim\topskip>\openstrutheight
+% % == \vskip\topskipgap
+% \vskip\topskip
+% \vskip-\openstrutheight
+% \fi
+% \verticalstrut
+% \vskip-\struttotal}
+
\def\topskipcorrection
+ {\simpletopskipcorrection
+ \vskip-\struttotal
+ \verticalstrut}
+
+\def\simpletopskipcorrection
{\ifdim\topskip>\openstrutheight
% == \vskip\topskipgap
\vskip\topskip
\vskip-\openstrutheight
- \fi
- \verticalstrut
- \vskip-\struttotal}
+ \fi}
\def\settopskip % the extra test is needed for the lbr family
{\topskip\systemtopskipfactor\globalbodyfontsize
@@ -1472,19 +1714,19 @@
\normalbaselineskip\openlineheight
\!!plus\baselinegluefactor\openlineheight
\!!minus\baselinegluefactor\openlineheight
- \normallineskip\minimallinedistance\relax % \!!onepoint\relax
+ \normallineskip\minimallinedistance\relax % \onepoint\relax
\normallineskiplimit\zeropoint\relax
\normalbaselines}
\def\setspacingfactor#1\to#2\by#3\\%
- {\strutdimen#2\s!pt
+ {\strutdimen#2\points
\strutdimen#3\strutdimen
\edef#1{\withoutpt{\the\strutdimen}}}
\def\spacing#1%
{\ifgridsnapping
%\doifnot{#1}{1}{\showmessage\m!layouts{11}{#1}}%
- \ifdim#1\s!pt=1\s!pt\else\showmessage\m!layouts{11}{#1}\fi
+ \ifdim#1\points=\onepoint\else\showmessage\m!layouts{11}{#1}\fi
\edef\spacingfactor{1}%
\else
\edef\spacingfactor{#1}%
@@ -1597,7 +1839,7 @@
%D \NC \NC a normal strut \NC {\showstruts\setupstrut\strut} \NC \NR
%D \stoptabulatie
-\def\setupstrut%
+\def\setupstrut
{\dosingleempty\dosetupstrut}
\def\dosetupstrut[#1]% yet undocumented, todo: fontstrut
@@ -1703,7 +1945,7 @@
\let\pseudoendstrut\removeunwantedspaces
\def\resetteststrut
- {\let\strutwidth\!!zeropoint
+ {\let\strutwidth\zeropoint
\setstrut}
\ifx\setfontparameters\undefined
@@ -1772,7 +2014,7 @@
% expands to \widowpenalty \maxdimen \maxdimen \zeropoint
\def\setpenalties#1#2#3%
- {#1\numexpr(#2+1)\space\doexpandedrecurse{\numexpr(#2)}{#3}\zeropoint\relax}
+ {#1\numexpr(#2+1)\space\doexpandedrecurse{\numexpr(#2)}{#3}\zerocount\relax}
\def\doexpandedrecurse#1#2%
{\ifnum#1>\zerocount#2\@EA\doexpandedrecurse\@EA{\the\numexpr(#1-1)}{#2}\fi}
@@ -1798,6 +2040,8 @@
%
% However, we will use setups:
+% to be documented
+
\def\setdefaultpenalties
{\setups[\systemsetupsprefix\s!default]}
@@ -2027,6 +2271,7 @@
{\let\raggedcommand\relax
\let\raggedtopcommand\empty
\let\raggedbottomcommand\empty
+ \chardef\raggedoneliner\zerocount
\doifsomething{#1}
{\doifinsetelse\v!ruim {#1}\!!doneatrue\!!doneafalse
\doifinsetelse\v!breed{#1}\!!donebtrue\!!donebfalse
@@ -2092,6 +2337,34 @@
\doifrightpageelse
{\getvalue{\@@ragged@@command\v!links}}
{\getvalue{\@@ragged@@command\v!rechts}}}
+
+\chardef\raggedoneliner\zerocount
+
+\setvalue{\@@ragged@@command\v!regel}%
+ {\chardef\raggedoneliner\plusone}
+
+\def\@@startraggedoneliner
+ {\ifcase\raggedoneliner\else
+ \dontleavehmode\hbox\bgroup
+ \ifcase\raggedstatus\or\hss\or\hss\fi
+ \ignorespaces
+ \bgroup
+ \aftergroup\removeunwantedspaces
+ \fi}
+
+\def\@@stopraggedoneliner
+ {\ifcase\raggedoneliner\else
+ \egroup
+ \ifcase\raggedstatus\or\hss\or\or\hss\fi
+ \egroup
+ \ignorespaces
+ \fi}
+
+\def\@@handleoneliner
+ {\ifcase\raggedoneliner\else
+ \@@startraggedoneliner
+ \aftergroup\@@stopraggedoneliner
+ \fi}
% Nodig i.v.m. inspringen eerste alineas
@@ -2355,9 +2628,11 @@
\let\dostopattributes\@@nostopattributes
\fi
\ifcsname#1#2\endcsname
- \@EAEAEA\doconvertfont\@EA\@EA\csname#1#2\endcsname
+ % \@EAEAEA\doconvertfont\@EA\@EA\csname#1#2\endcsname
+ \@EA\doconvertfont\csname#1#2\@EA\endcsname
\fi}
+
\unexpanded\def\@@dostopattributes
{\doglobalstopcolor
\endgroup}
@@ -2382,7 +2657,8 @@
\unexpanded\def\dosetfontattribute#1#2%
{\ifcsname#1#2\endcsname
- \@EAEAEA\doconvertfont\@EA\@EA\csname#1#2\endcsname
+ % \@EAEAEA\doconvertfont\@EA\@EA\csname#1#2\endcsname
+ \@EA\doconvertfont\csname#1#2\@EA\endcsname
\fi\empty}
\endETEX
@@ -2405,7 +2681,8 @@
\let\dostopattributes\endgroup
\fi
\ifcsname#1#2\endcsname
- \@EAEAEA\doconvertfont\@EA\@EA\csname#1#2\endcsname
+ % \@EAEAEA\doconvertfont\@EA\@EA\csname#1#2\endcsname
+ \@EA\doconvertfont\csname#1#2\@EA\endcsname
\fi
{#4}%
\dostopattributes}
@@ -2816,6 +3093,14 @@
\newif\if@@asragged \@@asraggedtrue % old method
+
+% todo
+%
+% \setuplayout[grid=yes,lines=44] \showgrid
+% \starttext
+% test \vfill test \endgraf \strut \endgraf \vskip-\lineheight \removedepth \pagina test
+% \stoptext
+
\def\dodosetupalign[#1]%
{\doifinsetelse\v!ruim {#1}\!!doneatrue\!!doneafalse
\doifinsetelse\v!breed{#1}\!!donebtrue\!!donebfalse
@@ -3202,14 +3487,39 @@
\let\normalvadjust\vadjust
+% \def\graphicvadjust % bad, those low level color calls here
+% {\dowithnextbox
+% {\normalvadjust
+% {\dostartgraphicgroup
+% \localstarttextcolor
+% \unvbox\nextbox
+% \localstoptextcolor
+% \dostopgraphicgroup}}%
+% \vbox}
+
+% test this prikkels/pascal margin text before heads (mode
+% 1) as well as uitwerkingen (mode 2)
+
+%chardef\graphicvadjustmode=0 % fake
+%chardef\graphicvadjustmode=1 % normal
+\chardef\graphicvadjustmode=2 % normal + compensate (== default)
+
\def\graphicvadjust % bad, those low level color calls here
- {\dowithnextbox
- {\normalvadjust
+ {\dowithnextboxcontent
+ {\forgetall}
+ {\ifcase\graphicvadjustmode \@EA \fakedvadjust \else \@EA\normalvadjust \fi
{\dostartgraphicgroup
\localstarttextcolor
\unvbox\nextbox
\localstoptextcolor
- \dostopgraphicgroup}}%
+ \dostopgraphicgroup
+ \ifcase\graphicvadjustmode \or \or
+ % corrects for one line paragraphs
+ \nointerlineskip
+ \kern-\struttotal
+ \nointerlineskip
+ \verticalstrut
+ \fi}}%
\vbox}
%D This works only in a properly strutted line, and is meant
diff --git a/tex/context/base/core-syn.tex b/tex/context/base/core-syn.tex
index 5d151dd69..2481f8a2f 100644
--- a/tex/context/base/core-syn.tex
+++ b/tex/context/base/core-syn.tex
@@ -403,4 +403,4 @@
[\v!eenheid]
[\c!tekstletter=\dimension]
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/core-sys.tex b/tex/context/base/core-sys.tex
index 18c38da72..5c1b12638 100644
--- a/tex/context/base/core-sys.tex
+++ b/tex/context/base/core-sys.tex
@@ -2,7 +2,7 @@
%D [ file=core-sys, % moved from main-001
%D version=1997.03.31,
%D title=\CONTEXT\ Core Macros,
-%D subtitle=System,
+%D subtitle=System,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
@@ -13,10 +13,10 @@
\writestatus{loading}{Context Core Macros (System)}
-\unprotect
+\unprotect
-\def\outputfilename{\@@svfile}
-\def\inputfilename {\@@svinputfile}
+\def\outputfilename{\@@svfile}
+\def\inputfilename {\@@svinputfile}
\let\jobfilesuffix\c!tex
@@ -31,19 +31,19 @@
\appendtoks \splitjobfilename \to \everyjob
-% Some mechanisms (see x-res-01) use either \jobfilename or
-% \jobfilename.somesuffix, in which case we need to use the
-% full name if given or a default (like \jobfilename.xml);
-% this comes down to replacing the default tex suffix.
+% Some mechanisms (see x-res-01) use either \jobfilename or
+% \jobfilename.somesuffix, in which case we need to use the
+% full name if given or a default (like \jobfilename.xml);
+% this comes down to replacing the default tex suffix.
-\def\jobfullname{\jobfilename.\jobfilesuffix}
+\def\jobfullname{\jobfilename.\jobfilesuffix}
-\def\setjobfullname#1% #1 = default if not given
+\def\setjobfullname#1% #1 = default if not given
{\doifelsenothing\jobfilename
- {\let\jobfullname\empty}
+ {\let\jobfullname\empty}
{\doif\jobfilesuffix\c!tex{\edef\jobfullname{\jobfilename.#1}}}}
-% ...
+% ...
\def\dosetupsystem[#1]%
{\getparameters[\??sv][#1]%
@@ -51,57 +51,57 @@
\beforesplitstring\@@svresolutie\at dpi\to\@@svresolutie
\let\outputresolution\@@svresolutie
\ifcase\@@svn
- % % 0 : unknown
- \or
- \setsystemmode\v!eerste % 1 : first run
- \or
- % % 2 : successive run
- \or
- \setsystemmode\v!eerste % 3 : first and only run
+ % % 0 : unknown
\or
- \setsystemmode\v!laatste % 4 : extra last run
- \fi
+ \setsystemmode\v!eerste % 1 : first run
+ \or
+ % % 2 : successive run
+ \or
+ \setsystemmode\v!eerste % 3 : first and only run
+ \or
+ \setsystemmode\v!laatste % 4 : extra last run
+ \fi
\splitjobfilename}
\def\setupsystem
{\dosingleargument\dosetupsystem}
-%D The system modes set by the setup command can be used in
-%D situations like:
+%D The system modes set by the setup command can be used in
+%D situations like:
%D
%D \starttypen
%D \startmode[*first]
%D \executesystemcommand{cleanupxml text.xml clean-text.xml}
-%D \stopmode
-%D
-%D \starttext
+%D \stopmode
+%D
+%D \starttext
%D \typefile{clean-text.xml}
%D \stoptext
-%D \stoptypen
+%D \stoptypen
\def\setuprandomize[#1]%
{\doifsomething{#1}
{\bgroup
\setrandomseed\minusone % signals thrd-ran to reseed
- % tex's time is in minutes
+ % tex's time is in minutes
\processaction
[#1]
- [ \v!klein=>\divide\normaltime 15, % 900,
- \v!middel=>\divide\normaltime 30, % 1800,
- \v!groot=>\divide\normaltime 60, % 3600,
+ [ \v!klein=>\divide\normaltime 15, % 900,
+ \v!middel=>\divide\normaltime 30, % 1800,
+ \v!groot=>\divide\normaltime 60, % 3600,
\v!normaal=>,
\s!default=>,
- \s!unknown=>\normaltime=#1]%
- \nextrandom
+ \s!unknown=>\normaltime=#1]%
+ \nextrandom
\egroup}}
\setupsystem
[\c!gebied=,
- \c!n=0, % 0:unknown 1: one run 2: first 3: successive 4: final run
+ \c!n=0, % 0:unknown 1: one run 2: first 3: successive 4: final run
\c!resolutie=600dpi,
\c!willekeur=,
\c!file=\jobname,
- \c!inputfile=\outputfilename,
+ \c!inputfile=\outputfilename,
\c!korps=\normalizedlocalbodyfontsize] % of iets anders
%D
@@ -133,11 +133,12 @@
\definecomplexorsimple\start
\definecomplexorsimple\stop
-\def\dododefinestartstop[#1][#2]%
+\def\dododefinestartstop[#1][#2]% todo: use indirect commands
{\getparameters
[\??be#1]
[\c!voor=,
\c!na=,
+ \c!tussen=,
\c!commandos=,
\c!letter=,
#2]%
@@ -145,7 +146,8 @@
{\groupedcommand
{\getvalue{\??be#1\c!commandos}%
\dostartattributes{\??be#1}\c!letter\c!kleur}
- {\dostopattributes}}%
+ {\dostopattributes
+ \getvalue{\??be#1\c!tussen}}}%
\setvalue{\e!start#1}%
{\getvalue{\??be#1\c!voor}%
\bgroup
@@ -230,13 +232,13 @@
\processcommalist[#1]\docommando
\egroup}
-\newif\ifforcefileexpansion % handy for document level overload
+\newif\ifforcefileexpansion % handy for document level overload
-% \def\convertexpanded#1#2#3% watch the double \v!ja expansion !
+% \def\convertexpanded#1#2#3% watch the double \v!ja expansion !
% {\ExpandFirstAfter\processaction
% [\ifforcefileexpansion\v!ja\else\getvalue{#1\c!expansie}\fi]
% [ \v!ja=>{{\honorunexpanded
-% \dontexpandencoding % new
+% \dontexpandencoding % new
% \xdef\@@globalexpanded{#2}%
% \xdef\@@globalexpanded{\@@globalexpanded}}%
% \convertcommand\@@globalexpanded\to#3},
@@ -244,18 +246,18 @@
% \s!default=>{\convertargument#2\to#3},
% \s!unknown=>{\convertargument#2\to#3}]}
-%D The next implementation is about 4 times as fast on an
-%D string of average length. Since this feature is used in
-%D XML processing, it made sense to support this faster
+%D The next implementation is about 4 times as fast on an
+%D string of average length. Since this feature is used in
+%D XML processing, it made sense to support this faster
%D alternative.
\def\installexpander#1{\setvalue{\s!do\c!expansie#1}}
-\long\def\convertexpanded#1#2#3% hm, first we need to make sure
- {\csname % that we assign all exp a value
+\long\def\convertexpanded#1#2#3% hm, first we need to make sure
+ {\csname % that we assign all exp a value
\s!do\c!expansie
- \ifforcefileexpansion
- \v!ja
+ \ifforcefileexpansion
+ \v!ja
\else\@EA\ifx\csname\s!do\c!expansie\csname#1\c!expansie\endcsname\endcsname\relax
\s!default
\else
@@ -270,10 +272,10 @@
\installexpander\empty {\convertargument}
\installexpander\v!nee {\convertargument}
-\def\convertmeaning#1\to % watch the double expansion !
+\def\convertmeaning#1\to % watch the double expansion !
{\bgroup
\honorunexpanded
- \dontexpandencoding % new
+ \dontexpandencoding % new
\xdef\@@globalexpanded{#1}%
\xdef\@@globalexpanded{\@@globalexpanded}%
\egroup
@@ -294,4 +296,4 @@
\def\herhaler {\repeater}
\def\herhaalmetcommando {\dorepeatwithcommand}
-\protect \endinput
+\protect \endinput
diff --git a/tex/context/base/core-tab.tex b/tex/context/base/core-tab.tex
index 035f9dc15..81c357dbb 100644
--- a/tex/context/base/core-tab.tex
+++ b/tex/context/base/core-tab.tex
@@ -472,7 +472,7 @@
\blanko[\v!blokkeer]% % added
\the\EveryTableParBox}
-\def\EndTableParBox
+\def\EndTableParBox
{\removelastskip % itemize or so
\par
\ifnum\prevgraf>\zerocount % we want at least
@@ -480,15 +480,15 @@
\egroup
\ifdim\dp\scratchbox>\lineheight % see (*) for an
\getnoflines{\dp\scratchbox}% % example of where
- \dp\scratchbox\zeropoint % saving can go
- \setbox\scratchbox % terrible wrong
+ \dp\scratchbox\zeropoint % saving can go
+ \setbox\scratchbox % terrible wrong
\vtop to \noflines\lineheight{\box\scratchbox}%
\fi % esp between rows
\else % of paragraphs
\egroup
\fi
\getboxheight\scratchdimen\of\box\scratchbox\relax% compensate for
- \ifdim\scratchdimen>\TABLEparheight % funny depth of
+ \ifdim\scratchdimen>\TABLEparheight % funny depth of
\global\TABLEparheight\scratchdimen % multi-line box
\fi % i.e. vtop
\box\scratchbox}
@@ -716,15 +716,15 @@
\NewFormatKey l%
{\prependtoks\raggedright\to\!taDataColumnTemplate
- \ReadFormatKeys \LeftGlue{} \RightGlue\hfil}
+ \ReadFormatKeys \LeftGlue\empty \RightGlue\hfil}
\NewFormatKey r%
{\prependtoks\raggedleft\to\!taDataColumnTemplate
- \ReadFormatKeys \LeftGlue\hfil \RightGlue{}}
+ \ReadFormatKeys \LeftGlue\hfil \RightGlue\empty}
\NewFormatKey x%
{\prependtoks\notragged\to\!taDataColumnTemplate
- \ReadFormatKeys \LeftGlue\hfil \RightGlue{}}
+ \ReadFormatKeys \LeftGlue\hfil \RightGlue\empty}
\appendtoks \TABLEparalignment \to \EveryTableParBox
@@ -750,21 +750,56 @@
\let\TABLEbeforebar\empty
\let\TABLEafterbar \empty
+% \def\!ttInsertVrule
+% {\hfil
+% \TABLEbeforebar % added
+% \startglobalTABLEcolor % added
+% \vrule \!thWidth
+% \ifnum\!tgCode=\plusone
+% \ifx\!tgValue\empty
+% \LineThicknessFactor
+% \else
+% \!tgValue
+% \fi
+% \LineThicknessUnit
+% \else
+% \!tgValue
+% \fi
+% \stopglobalTABLEcolor % added
+% \TABLEafterbar % added
+% \hfil
+% &}
+
+\def\@VLn{1}
+\def\@VLd{.125em}
+
+\def\do!ttInsertVrule % will be merged in 2005
+ {\vrule \!thWidth
+ \ifnum\!tgCode=\plusone
+ \ifx\!tgValue\empty
+ \LineThicknessFactor
+ \else
+ \!tgValue
+ \fi
+ \LineThicknessUnit
+ \else
+ \!tgValue
+ \fi
+ \hskip\@VLd}
+
\def\!ttInsertVrule
{\hfil
\TABLEbeforebar % added
\startglobalTABLEcolor % added
- \vrule \!thWidth
- \ifnum\!tgCode=\plusone
- \ifx\!tgValue\empty
- \LineThicknessFactor
- \else
- \!tgValue
- \fi
- \LineThicknessUnit
- \else
- \!tgValue
- \fi
+ % we could do without this speedup, some day merge 'm
+ \ifcase\@VLn\or
+ \do!ttInsertVrule
+ \unskip
+ \else
+ \dorecurse\@VLn\do!ttInsertVrule
+ \gdef\@VLn{1}%
+ \unskip
+ \fi
\stopglobalTABLEcolor % added
\TABLEafterbar % added
\hfil
@@ -815,7 +850,7 @@
%D extensions concern the second level check, the first
%D subbranch and advancing the column.
-\ifx\mscount\undefined \newcount\mscount \fi
+\ifx\mscount\undefined \newcount\mscount \fi
\def\!ttuse#1%
{\ifnum#1>\plusone
@@ -832,10 +867,10 @@
{\global\advance\currentTABLEcolumn #1% % added
\global\advance\currentTABLEcolumn \minusone % added
\mscount#1% \mscount is in Plain
- \advance\mscount \m@ne
+ \advance\mscount \minusone
\advance\mscount \mscount
\!thLoop
- \ifnum\mscount>\@ne
+ \ifnum\mscount>\plusone
\sp@n % from Plain (\span\omit \advance\mscount\m@ne)
\repeat
\span}%
@@ -897,7 +932,7 @@
\stopbaselinecorrection
\goodbreak % compensates all the nobreaks
\fi}
- {\stopframedcontent}%
+ \stopframedcontent
\egroup}
%D Before we can grab the argument, we have to make sure that
@@ -1015,16 +1050,16 @@
%D The third stage involves a lot of (re)sets, which we will
%D explain later.
-%D The next definition is convenient and more in tune with
-%D \CONTEXT.
+%D The next definition is convenient and more in tune with
+%D \CONTEXT.
-\let \everytable \EveryTable
+\let \everytable \EveryTable
-%D We immediately use this register:
+%D We immediately use this register:
\appendtoks \fixedspaces \to \everytable
-%D Now we can start the table.
+%D Now we can start the table.
\def\thirdstagestartTABLE#1%
{\global\setTABLEactiontrue
@@ -1051,7 +1086,7 @@
\forgetall % added
\doifsomething{#1}
{\def\TABLEformat{#1}%
- \getTABLEnofcolumns\TABLEformat
+ \getTABLEnofcolumns\TABLEformat
\expandafter\BeginFormat\TABLEformat\EndFormat}}
\def\finishTABLE
@@ -1553,7 +1588,7 @@
\def\handleTABLEbreak#1#2%
{\ifsplittables
\setbox0\hbox{\AugmentedTableStrut{#1}{#2}}%
- \getboxheight\dimen0\of\box0\relax
+ \getboxheight\dimen0\of\box0\relax
\ifdim\TABLEparheight>\dimen0 % new
\advance\dimen0-\lineheight % newer
\ifdim\dimen0<\zeropoint % newer
@@ -1632,7 +1667,7 @@
% \egroup
\fi\fi
\globalletempty\TABLEgraylinestatus
- \globalletempty\TABLEgraylineerror
+ \globalletempty\TABLEgraylineerror
\expandafter\normalTABLElineformat#4#5\crcr % \crcr nodig ?
\TABLEnoalign{\nobreak\global\setTABLEactiontrue}}
@@ -1653,17 +1688,17 @@
%D \TABLE\ changes the catcode when needed.}
\bgroup
-\catcode`\|=\@@active
-\gdef\protectTABLEbar{\let|\letterbar}
-\catcode`\|=\@@other
+\catcode`\|=\@@active
+\gdef\protectTABLEbar{\let|\letterbar}
+\catcode`\|=\@@other
\gdef\getTABLEnofcolumns#1%
{\bgroup
- \cleanupfeatures % needed !
- \protectTABLEbar % is still a feature
+ \cleanupfeatures % needed !
+ \protectTABLEbar % is still a feature
\expanded{\convertargument#1}\to\ascii
\@EA\doglobal\@EA\counttoken\@EA|\@EA\in\ascii\to\maxTABLEcolumn
\global\advance\maxTABLEcolumn \minusone
- % in case of & counting, divide by 2
+ % in case of & counting, divide by 2
\egroup}
\egroup
@@ -1685,11 +1720,21 @@
%D \sym{\type{\HC}} a horizontal colored line
%D \stopopsomming
+% \def\defineTABLErules
+% {\let\VL\TableVL
+% \let\VC\TableVC
+% \let\HL\TableHL
+% \let\HC\TableHC}
+
\def\defineTABLErules
{\let\VL\TableVL
\let\VC\TableVC
\let\HL\TableHL
- \let\HC\TableHC}
+ \let\HC\TableHC
+ \let\VS\TableVS
+ \let\VD\TableVD
+ \let\VT\TableVT
+ \let\VN\TableVN}
\def\TableVL
{\checkTABLEautorow
@@ -1725,6 +1770,19 @@
\letgvalueempty{eVL\the\currentTABLEcolumn}}%
\edef\@@tiVLwidth{\getvalue{wVL\the\currentTABLEcolumn}}%
\expanded{\normalTABLEcomplexbar\@@tiVLwidth\space}}% \relax breaks \use
+
+% \starttable[|||]
+% \HL
+% \VL test \VS test \VL \FR
+% \VL test \VD test \VL \MR
+% \VL test \VT test \VL \LR
+% \HL
+% \stoptable
+
+\def\TableVS {\VN1}
+\def\TableVD {\VN2}
+\def\TableVT {\VN3}
+\def\TableVN#1{\gdef\@VLn{#1}\VL}
\def\resetVLvalues
{\dostepwiserecurse\zerocount\maxTABLEcolumn\plusone
@@ -1751,10 +1809,8 @@
{\docomplexorsimpleTable\complexTableVC\simpleTableVC}
\def\complexTableVC[#1]%
- {\global\setvalue{bVC\the\currentTABLEcolumn}%
- {\localstartcolor[#1]}%
- \global\setvalue{eVC\the\currentTABLEcolumn}%
- {\localstopcolor}%
+ {\global\setvalue{bVC\the\currentTABLEcolumn}{\localstartcolor[#1]}%
+ \global\setvalue{eVC\the\currentTABLEcolumn}{\localstopcolor}%
\simpleTableVC}
\def\simpleTableVC
@@ -1780,7 +1836,7 @@
\def\complexTableHL[#1]%
{\TABLEnoalign
- {\scratchcounter=0#1%
+ {\scratchcounter0#1%
\multiply\scratchcounter \@@tiHLheight
\edef\@@tiHLheight{\the\scratchcounter}%
\simpleTableHL}}
@@ -1800,7 +1856,7 @@
\expandafter\normalTABLEfullrule\@@tiHLheight
\stopHLcommand
\globalletempty\startHLcommand
- \globalletempty\stopHLcommand
+ \globalletempty\stopHLcommand
\accountTABLElinewidth
\fi
\setTABLEaction\TABLErule
@@ -1900,12 +1956,19 @@
\newif\ifTABLEdivision
+% \def\defineTABLEdivisions
+% {\global\TABLEdivisionfalse % in start
+% \let\DL\TableDL
+% \let\DC\TableDC
+% \let\DV\TableDV
+% \let\VD\TableDV
+% \let\DR\TableDR}
+
\def\defineTABLEdivisions
{\global\TABLEdivisionfalse % in start
\let\DL\TableDL
\let\DC\TableDC
\let\DV\TableDV
- \let\VD\TableDV
\let\DR\TableDR}
\def\checkTABLEdivision
@@ -1938,7 +2001,7 @@
\fi
%\startHLcommand
\ifnum#1=\plusone
- \global\advance\currentTABLEcolumn 2
+ \global\advance\currentTABLEcolumn \plustwo
\let\next\normalTABLEsinglerule
\else
\ifnum#1<\maxTABLEcolumn
@@ -1952,7 +2015,7 @@
\next
%\stopHLcommand
%\globalletempty\startHLcommand
- %\globalletempty\stopHLcommand
+ %\globalletempty\stopHLcommand
\fi}
\def\TableDV
@@ -2018,9 +2081,9 @@
\let\RASTER \TableRASTER
\globallet\lastTABLEc\@@tiachtergrondkleur
\globallet\lastTABLEr\@@tiachtergrondraster
- \doifinsetelse\@@tiachtergrond{c,color}
- {\global\chardef\TABLEcr1 }
- {\global\chardef\TABLEcr2 }}
+ \doifinsetelse\@@tiachtergrond{c,color} % \v!kleur
+ {\global\chardef\TABLEcr\plusone}
+ {\global\chardef\TABLEcr\plustwo}}
\def\TableBC
{\ifTABLEgrayline
@@ -2199,12 +2262,10 @@
% kan simpeler
\def\docomplexTableCOLOR[#1]%
- {\dodocomplexTableGL\localstartcolor\localstopcolor
- [#1,\lastTABLEc,,]}
+ {\dodocomplexTableGL\localstartcolor \localstopcolor [#1,\lastTABLEc,,]}
\gdef\docomplexTableRASTER[#1]%
- {\dodocomplexTableGL\localstartraster\localstopraster
- [#1,\lastTABLEr,,]}
+ {\dodocomplexTableGL\localstartraster\localstopraster[#1,\lastTABLEr,,]}
\def\dodocomplexTableGL#1#2[#3,#4,#5,#6]%
{\doifelsenothing{#4}{#1[#5]}{#1[#4]}%
@@ -2221,23 +2282,13 @@
\def\TableBACKGROUND
{\TableBR}
-\def\simpleTableRASTER#1%
- {\docomplexTableRASTER[1]#1}
-
-\def\complexTableRASTER[#1]%
- {\docomplexTableRASTER[#1]}
-
-\def\simpleTableCOLOR
- {\docomplexTableCOLOR[1]}
-
-\def\complexTableCOLOR[#1]%
- {\docomplexTableCOLOR[#1]}
-
-\def\TableRASTER
- {\complexorsimpleTable{RASTER}}
+\def\simpleTableRASTER #1{\docomplexTableRASTER[1]#1}
+\def\complexTableRASTER[#1]{\docomplexTableRASTER[#1]}
+\def\simpleTableCOLOR {\docomplexTableCOLOR [1]}
+\def\complexTableCOLOR [#1]{\docomplexTableCOLOR [#1]}
-\def\TableCOLOR
- {\complexorsimpleTable{COLOR}}
+\def\TableRASTER{\complexorsimpleTable{RASTER}}
+\def\TableCOLOR {\complexorsimpleTable{COLOR}}
\def\addtoTABLEgrayline#1%
{\TABLEgraytoks\expandafter{\TABLEgrayline}%
@@ -2274,7 +2325,7 @@
\let\endTABLErow\endTABLEgrayrow
\currentTABLEcolumn\zerocount
\TABLEgrayline\TABLEendBCL % determine n of columns and height
- \advance\currentTABLEcolumn \minusone
+ \advance\currentTABLEcolumn \minusone
\ifnum\currentTABLEcolumn>\maxTABLEcolumn
% error message too long line
\globalletempty\TABLEgrayline
@@ -2322,20 +2373,20 @@
\def\defineTABLEshorthands%
{\def\SPAN##1{\use{##1}}%
- \def\TWO {\use{2}}%
- \def\THREE {\use{3}}%
- \def\FOUR {\use{4}}%
- \def\FIVE {\use{5}}%
- \def\SIX {\use{6}}%
+ \def\TWO {\use2}%
+ \def\THREE {\use3}%
+ \def\FOUR {\use4}%
+ \def\FIVE {\use5}%
+ \def\SIX {\use6}%
\def\REF {\ReFormat}}
\def\defineTABLEunits
{\processaction
[\@@tiafstand]
- [ \v!geen=>\OpenUp{0}{0}\def\LOW{\Lower6 },
- \v!klein=>\OpenUp{0}{0}\def\LOW{\Lower6 }, % == baseline
- \v!middel=>\OpenUp{1}{1}\def\LOW{\Lower7 },
- \v!groot=>\OpenUp{2}{2}\def\LOW{\Lower8 }]%
+ [ \v!geen=>\OpenUp00\def\LOW{\Lower6 },
+ \v!klein=>\OpenUp00\def\LOW{\Lower6 }, % == baseline
+ \v!middel=>\OpenUp11\def\LOW{\Lower7 },
+ \v!groot=>\OpenUp22\def\LOW{\Lower8 }]%
\doifelse\@@tiafstand\v!geen
{\chardef\TABLErowfactor\zerocount}
{\chardef\TABLErowfactor\plustwo }}
@@ -2403,18 +2454,18 @@
\doifelse\@@tidiepte\v!strut
{\let\StrutDepthFactor\@@itdiepte}
{\let\StrutDepthFactor\@@tidiepte}%
- \scratchdimen\StrutHeightFactor \s!pt \multiply\scratchdimen 10%
+ \scratchdimen\StrutHeightFactor\points \multiply\scratchdimen 10%
\edef\StrutHeightFactor{\@EA\withoutpt\the\scratchdimen}%
- \scratchdimen\StrutDepthFactor \s!pt \multiply\scratchdimen 10%
+ \scratchdimen\StrutDepthFactor \points \multiply\scratchdimen 10%
\edef\StrutDepthFactor{\@EA\withoutpt\the\scratchdimen}%
% units
\NormalTSU{\normalbaselineskip\divide\StrutUnit 12 }%
\NormalTableUnits}
\def\OpenUp#1#2%
- {\scratchdimen\StrutHeightFactor \s!pt \advance\scratchdimen #1\s!pt
+ {\scratchdimen\StrutHeightFactor \points \advance\scratchdimen #1\points
\edef\StrutHeightFactor{\@EA\withoutpt\the\scratchdimen}%
- \scratchdimen\StrutDepthFactor \s!pt \advance\scratchdimen #2\s!pt
+ \scratchdimen\StrutDepthFactor \points \advance\scratchdimen #2\points
\edef\StrutDepthFactor{\@EA\withoutpt\the\scratchdimen}}
%D As one can see, we didn't only add color, but also more
@@ -2486,4 +2537,4 @@
\def\ifintabel{\ifintable} % upward compatible
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/core-tbl.tex b/tex/context/base/core-tbl.tex
index 3dadc6a90..490f6688e 100644
--- a/tex/context/base/core-tbl.tex
+++ b/tex/context/base/core-tbl.tex
@@ -567,17 +567,17 @@
{\copyparameters
[\??tt#1::][\??tt\v!tabulate::]%
[\c!kader,\c!afstand,\c!eenheid,\c!voor,\c!korps,\c!na,
- \c!binnen,\c!inspringen,\c!marge,\c!uitlijnen,
+ \c!binnen,\c!inspringen,\c!marge,\c!uitlijnen,\c!hoofd,\c!titel,
\c!lijnkleur,\c!lijndikte,\c!splitsen,EQ]}%
\copyparameters
[\??tt#1::#2][\??tt#1::]%
[\c!eenheid,\c!afstand,\c!voor,\c!korps,\c!na,
- \c!binnen,\c!inspringen,\c!kader,\c!splitsen,
+ \c!binnen,\c!inspringen,\c!kader,\c!splitsen,\c!hoofd,\c!titel,
\c!marge,\c!uitlijnen,\c!lijnkleur,\c!lijndikte,EQ]%
\setvalue{\e!start#1::#2}{\dofinalstarttabulate[#1][#2][#3]}%
\setvalue{\e!start#1}{\bgroup\dosubstarttabulate[#1]}%
- \letvalue{\??tt#1\v!hoofd}\empty
- \letvalue{\??tt#1\v!voet }\empty
+ \letvalue{\??tt#1-\v!hoofd}\empty
+ \letvalue{\??tt#1-\v!voet }\empty
\else\ifsecondargument
\definetabulate[#1][][#2]%
\else
@@ -587,56 +587,23 @@
\let\tabulateheadcontent\empty
\let\tabulatetailcontent\empty
-% \def\checkfulltabulatecontent
-% {\ifundefined{\??tt\currenttabulate\v!hoofd}%
-% \let\tabulateheadcontent\empty
-% \else
-% \@EA\let\@EA\tabulateheadcontent
-% \csname\??tt\currenttabulate\v!hoofd\endcsname
-% \fi
-% \ifundefined{\??tt\currenttabulate\v!voet}%
-% \let\tabulatetailcontent\empty
-% \else
-% \@EA\let\@EA\tabulatetailcontent
-% \csname\??tt\currenttabulate\v!voet\endcsname
-% \fi}
-%
-% \newconditional\tabulatesomeamble
-%
-% % \def\fulltabulatecontent
-% % {\tabulatecontent}
-%
-% \def\fulltabulatecontent
-% {\ifx\tabulateheadcontent\empty\else
-% \TABLEnoalign{\global\settrue\tabulatesomeamble}%
-% \tabulateheadcontent
-% \TABLEnoalign{\global\setfalse\tabulatesomeamble}%
-% \fi
-% \ignorespaces\tabulatecontent
-% \ifx\tabulatetailcontent\empty\else
-% \TABLEnoalign{\global\settrue\tabulatesomeamble}%
-% \tabulatetailcontent
-% \fi}
-%
-% the previous code breaks on first \HL
-
\newconditional\tabulatesomeamble
-\def\checkfulltabulatecontent
- {\ifundefined{\??tt\currenttabulate\v!hoofd}%
+\def\checkfulltabulatecontent % - needed, else confusion with \c!hoofd
+ {\ifundefined{\??tt\currenttabulate-\v!hoofd}%
\let\tabulateheadcontent\empty
\else
\def\tabulateheadcontent
{\TABLEnoalign{\global\settrue\tabulatesomeamble}%
- \csname\??tt\currenttabulate\v!hoofd\endcsname
+ \csname\??tt\currenttabulate-\v!hoofd\endcsname
\TABLEnoalign{\global\setfalse\tabulatesomeamble}}%
\fi
- \ifundefined{\??tt\currenttabulate\v!voet}%
+ \ifundefined{\??tt\currenttabulate-\v!voet}%
\let\tabulatetailcontent\empty
\else
\def\tabulatetailcontent
{\TABLEnoalign{\global\settrue\tabulatesomeamble}%
- \csname\??tt\currenttabulate\v!voet\endcsname
+ \csname\??tt\currenttabulate-\v!voet\endcsname
\TABLEnoalign{\global\setfalse\tabulatesomeamble}}%
\fi}
@@ -651,19 +618,25 @@
\tabulatetailcontent
\removefunnytabulateline}
+\def\removefunnytabulateline
+ {\ifhmode
+ \strut\crcr
+ \TABLEnoalign{\kern-\lineheight}%
+ \fi}
+
\setvalue{\e!start\v!tabulatehead}%
{\dosingleempty\dostartstarttabulatehead}
\def\dostartstarttabulatehead[#1]%
{\processcontent{\e!stop\v!tabulatehead}\next
- {\letvalue{\??tt\iffirstargument#1\else\v!tabulate\fi::\v!hoofd}\next}}
+ {\letvalue{\??tt\iffirstargument#1\else\v!tabulate\fi::-\v!hoofd}\next}}
\setvalue{\e!start\v!tabulatetail}%
{\dosingleempty\dostartstarttabulatetail}
\def\dostartstarttabulatetail[#1]%
{\processcontent{\e!stop\v!tabulatetail}\next
- {\letvalue{\??tt\iffirstargument#1\else\v!tabulate\fi::\v!voet}\next}}
+ {\letvalue{\??tt\iffirstargument#1\else\v!tabulate\fi::-\v!voet}\next}}
\def\dosubstarttabulate
{\dodoubleempty\dodosubstarttabulate}
@@ -907,8 +880,6 @@
% \s!unknown=>\def\@@tabulatealign{0}]%
% \let\pretabskip\!!zeropoint
% \def\postabskip{.5\tabulateunit}%
-% %\doglobal\newcounter\tabulatecolumns
-% %\doglobal\newcounter\nofautotabulate
% \global\tabulatecolumns\zerocount
% \global\nofautotabulate\zerocount
% \doglobal\newcounter\noftabulatelines
@@ -926,20 +897,12 @@
% \unexpanded \def\NG{\NC\handletabulatecharalign}%
% \unexpanded \def\NN{\NC\handletabulatedigits}% new, undocumented, test first
% \unexpanded \def\ND{\NC\handletabulatedigits}% same, for old times sake
-% \def\HR % horizontal rule line (break untested)
-% {\TABLEnoalign
-% {\ifnum\noftabulatelines=\totalnoftabulatelines
-% \@EA\dotabulatenobreak
-% \else
-% \@EA\allowbreak
-% \fi}%
-% \dotabulatelinerule
-% \TABLEnoalign
-% {\ifnum\noftabulatelines=\zerocount
-% \@EA\dotabulatenobreak
-% \else
-% \@EA\allowbreak
-% \fi}}%
+% \def\tabulaterule{\HR}% a rule with lineheight
+% \def\tabulateline{\HL}% just a spaced rule
+% \def\tabulateautorule{\doHR\plusone}%
+% \def\tabulateautoline{\doHL\plusone}%
+% \def\HR{\doHR\zerocount}
+% \def\HL{\doHL\zerocount}
% \unexpanded \def\NR % next row
% {\doglobal\increment\noftabulatelines
% \global\tabulatefirstflushedfalse
@@ -951,23 +914,24 @@
% {\iftolerantTABLEbreak\else
% \ifnum\noftabulatelines=\plusone
% \dotabulatenobreak
-% \else
-% \ifnum\noftabulatelines=\minusnoftabulatelines
-% \ifnum\tabulatemaxplines<\plustwo
-% \dotabulatenobreak
-% \else
-% \allowbreak % needed with pbreak prevention
-% \fi
+% \else\ifnum\noftabulatelines=\minusnoftabulatelines
+% \ifnum\tabulatemaxplines<\plustwo
+% \dotabulatenobreak
% \else
% \allowbreak % needed with pbreak prevention
% \fi
-% \fi
+% \else
+% \allowbreak % needed with pbreak prevention
+% \fi\fi
% \fi
% \global\tabulatefirstflushedfalse}}%
-% \let\HL\empty \let\SR\NR \let\AR\NR
+% \let\HL\empty % not needed
+% \let\SR\NR \let\AR\NR
% \let\FL\empty \let\FR\NR
% \let\ML\empty \let\MR\NR
% \let\LL\empty \let\LR\NR
+% \let\doHR\gobbleoneargument
+% \let\doHL\gobbleoneargument
% \global\let\flushtabulated\empty
% \let\savedbar|\let|\nexttabulate
% \tabskip\zeropoint
@@ -1019,7 +983,7 @@
% \dontcomplain
% \forgetall
% \setbox0\vbox % outside \if because of line counting
-% {\footnotesenabledfalse
+% {\notesenabledfalse
% \let\tabulateindent\!!zeropoint
% \trialtypesettingtrue % very important
% \@EA\halign\@EA{\the\!!toksa\crcr\fulltabulatecontent\crcr}}%
@@ -1090,12 +1054,47 @@
% \let\minusnoftabulatelines\noftabulatelines
% \decrement\minusnoftabulatelines
% \doglobal\newcounter\noftabulatelines
-% \def\HL{\TABLEnoalign
-% {\ifnum\noftabulatelines=\zerocount \@EA \FL\else
-% \ifnum\noftabulatelines<\totalnoftabulatelines\relax\@EAEAEA\ML\else
-% \@EAEAEA\LL\fi\fi}}%
-% \doifvalue{\??tt\currenttabulate\c!lijn}\v!regel
-% {\let\HL\HR}%
+% \def\doHL##1%
+% {\TABLEnoalign
+% {\ifnum\noftabulatelines=\zerocount
+% \ifcase##1\or
+% \@EAEAEA\FL
+% \fi
+% \else\ifnum\noftabulatelines=\totalnoftabulatelines
+% \ifcase##1\or
+% \@EA\@EAEAEA\@EA\LL
+% \fi
+% \else
+% \@EAEAEA\ML
+% \fi\fi}}%
+% \def\doHR##1% horizontal rule line (break untested)
+% {\TABLEnoalign
+% {\globallet\TABLEautoline\dotabulatelinerule
+% \ifcase##1\or
+% \ifnum\noftabulatelines=\zerocount
+% \gdef\TABLEautoline{\TABLEnoalign{}}%
+% \else\ifnum\noftabulatelines=\totalnoftabulatelines
+% \gdef\TABLEautoline{\TABLEnoalign{}}%
+% \fi\fi
+% \fi
+% \dotabulatenobreak}%
+% \TABLEautoline
+% \TABLEnoalign
+% {\nobreak
+% \ifx\TABLEautoline\dotabulatelinerule\kern-\lineheight\fi
+% \ifnum\noftabulatelines=\totalnoftabulatelines
+% \@EA\dotabulatenobreak
+% \else
+% \@EA\allowbreak
+% \fi}%
+% \TABLEautoline
+% \TABLEnoalign
+% {\dotabulatenobreak}}%
+% \doifelsevalue{\??tt\currenttabulate\c!lijn}\v!regel
+% {\let\HL \HR
+% \let\tabulateautoline\tabulateautorule
+% \let\tabulateline \tabulaterule}%
+% {\def\HL{\doHL\zerocount}}%
% \def\tablebaselinecorrection
% {\def\dobaselinecorrection
% {\vskip-\prevdepth
@@ -1136,14 +1135,12 @@
% \fi}}%
% \chardef\tabulatepass\plustwo
% %
-% \startframedcontent[\getvalue{\??tt\currenttabulate\c!kader}]%
-% %
-% \@EA\halign\@EA{\the\!!toksa\crcr\fulltabulatecontent\crcr}%
-% \prevdepth\strutdp % nog eens beter, temporary hack
-% \doifvalue{\??tt\currenttabulate\c!afstand}\v!grid
-% {\vskip-\strutdp}% experimental tm-prikkels
-% %
-% \stopframedcontent
+% \startflushtabulate
+% \@EA\halign\@EA{\the\!!toksa\crcr\fulltabulatecontent\crcr}%
+% \prevdepth\strutdp % nog eens beter, temporary hack
+% \doifvalue{\??tt\currenttabulate\c!afstand}\v!grid
+% {\vskip-\strutdp}% experimental tm-prikkels
+% \stopflushtabulate
% %
% \egroup
% \ifinsidefloat \else
@@ -1151,9 +1148,13 @@
% \fi
% \egroup}
+\chardef\tabulaterepeathead\zerocount
+
\def\processtabulate[|#1|]% in the process of optimizing
{\tabulateunit\getvalue{\??tt\currenttabulate\c!eenheid}%
\checkfulltabulatecontent
+\globallet\tabulateruledepth \!!zeropoint
+\globallet\tabulateruleheight\!!zeropoint
\ExpandFirstAfter\processaction % use \setalignmentswitch instead
[\getvalue{\??tt\currenttabulate\c!uitlijnen}]
[\v!normaal=>\def\@@tabulatealign{0},% = default value
@@ -1172,6 +1173,12 @@
\global\tabulatepwidth\zeropoint
\global\tabulateequalfalse
\resettabulatepheight
+\ifinsidefloat \else
+ \processaction
+ [\getvalue{\??tt\currenttabulate\c!hoofd}]
+ [\v!herhaal=>\chardef\tabulaterepeathead\plusone,
+ \v!tekst=>\chardef\tabulaterepeathead\plustwo]%
+\fi
\unexpanded \def\NC{\tabulatenormalcolumn0}%
\unexpanded \def\RC{\tabulatenormalcolumn1}%
\unexpanded \def\HC{\tabulatenormalcolumn2}%
@@ -1196,6 +1203,9 @@
\unskip\unskip\crcr\flushtabulated
\TABLEnoalign
{\iftolerantTABLEbreak\else
+\ifconditional\tabulatesomeamble \ifcase\tabulaterepeathead \else
+ \allowbreak
+\fi \fi
\ifnum\noftabulatelines=\plusone
\dotabulatenobreak
\else\ifnum\noftabulatelines=\minusnoftabulatelines
@@ -1255,7 +1265,7 @@
\global\let\tabulatehook\notabulatehook}%
\def\xeskip
{\par\egroup\egroup
- \global\let\tabulatehook\dotabulatehook}%
+ \global\let\tabulatehook\dotabulatehook}%
\let|\savedbar
\global\let\tabulatehook\dotabulatehook
\doifvalue{\??tt\currenttabulate\c!inspringen}\v!nee\forgetparindent
@@ -1265,9 +1275,9 @@
\setlocalhsize \hsize\localhsize
\fi
\dontcomplain
- \forgetall
+ \forgetall % hm, interference with \forgetparindent ^^^ probably bug, to be solved
\setbox0\vbox % outside \if because of line counting
- {\footnotesenabledfalse
+ {\notesenabledfalse
\let\tabulateindent\!!zeropoint
\trialtypesettingtrue % very important
\@EA\halign\@EA{\the\!!toksa\crcr\fulltabulatecontent\crcr}}%
@@ -1419,14 +1429,22 @@
\fi}}%
\chardef\tabulatepass\plustwo
%
- \startframedcontent[\getvalue{\??tt\currenttabulate\c!kader}]%
+ \ifcase\tabulaterepeathead
+ \startframedcontent[\getvalue{\??tt\currenttabulate\c!kader}]%
+ \else
+ \setbox\tabulatebox\vbox \bgroup
+ \fi
%
\@EA\halign\@EA{\the\!!toksa\crcr\fulltabulatecontent\crcr}%
\prevdepth\strutdp % nog eens beter, temporary hack
\doifvalue{\??tt\currenttabulate\c!afstand}\v!grid
{\vskip-\strutdp}% experimental tm-prikkels
%
- \stopframedcontent
+ \ifcase\tabulaterepeathead
+ \stopframedcontent
+ \else
+ \egroup \splittabulatebox\tabulatebox
+ \fi
%
\egroup
\ifinsidefloat \else
@@ -1434,6 +1452,63 @@
\fi
\egroup}
+% \setuptabulate[split=yes,header=text,title=Vervolg van Tabel]
+%
+% % \starttabulatehead
+% % \NC test \NC hans\NC \NR
+% % \stoptabulatehead
+%
+% \starttabulate
+% \NC test \NC \input tufte \relax \NC \NR
+% \NC test \NC \input knuth \relax \NC \NR
+% \NC test \NC \input knuth \relax \NC \NR
+% \NC test \NC \input tufte \relax \NC \NR
+% \NC test \NC \input tufte \relax \NC \NR
+% \NC test \NC \input tufte \relax \NC \NR
+% \stoptabulate
+
+\def\splittabulatebox#1% #1 <> 0/2 / derived from the one in core-ntb.tex
+ {\ifinsidefloat
+ \unvbox#1%
+ \else
+ \ifcase\tabulaterepeathead\or
+ \setbox2\copy#1%
+ \setbox2\vsplit2 to \lineheight
+ \setbox2\vbox{\unvbox2}%
+ \fi
+ \doloop
+ {\setbox0\vsplit#1 to \onepoint % \lineheight
+ \ifdim\pagegoal<\maxdimen
+ \donetrue
+ \else\ifdim\pagetotal=\zeropoint
+ \donetrue
+ \else
+ \donefalse
+ \fi\fi
+ \ifdone
+ \setbox0\vbox{\unvbox0}%
+ \dimen0\pagetotal
+ \advance\dimen0\dp0
+ \advance\dimen0\ht0
+ \ifdim\dimen0>\pagegoal
+ \bgroup \pagina \egroup % make sure that local vars are kept
+ \ifcase\tabulaterepeathead\or
+ \unvcopy2
+ \or
+ \hbox{\strut\getvalue{\??tt\currenttabulate\c!titel}}%
+ \fi
+ \fi
+ \fi
+ % test this on icare checklists / quite hacky ! ! !
+ \ifdim\ht0>\getvalue{\??tt\currenttabulate\c!lijndikte}\else
+ \kern-2\ht0 % brrrr
+ \fi
+ %
+ \unvbox0
+ \allowbreak
+ \ifvoid#1 \exitloop \fi}%
+ \fi}
+
%D \startypen
%D \setuptabulate[split=no,rule=line]
%D
@@ -1514,6 +1589,8 @@
\c!uitlijnen=\v!normaal,
\c!marge=\!!zeropoint,
\c!splitsen=\v!ja,
+ \c!hoofd=\v!ja,
+ \c!titel=,
\c!inspringen=\v!nee]
\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/core-uti.tex b/tex/context/base/core-uti.tex
index 1503782f9..50f6a4cb3 100644
--- a/tex/context/base/core-uti.tex
+++ b/tex/context/base/core-uti.tex
@@ -8,15 +8,15 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
\writestatus{loading}{Context Core Macros / Utility File Handling}
-\unprotect
+\unprotect
-% todo : safe lan etc too
-% todo : load all commands at once (tok)
+% todo : safe lan etc too
+% todo : load all commands at once (tok)
% Utility-file
%
@@ -55,13 +55,13 @@
{\checksectionseparator}
{\@@utilityerrormessage\resetutilities\endinput}}
-\def\checksectionseparator % catches backward compatibility conflict
+\def\checksectionseparator % catches backward compatibility conflict
{\doifnot\sectionseparator:\endinput}
\def\thisissectionseparator#1%
{\bgroup
\globallet\checksectionseparator\relax
- \convertcommand \sectionseparator\to\asciiA
+ \convertcommand \sectionseparator\to\asciiA
\convertargument #1\to\asciiB
\ifx\asciiA\asciiB
\egroup
@@ -75,17 +75,17 @@
\def\writeutility {\write\uti}
\def\writeutilitycommand#1{\write\uti{c \string#1}}
-% less tokens
+% less tokens
%
% \def\immediatewriteutility {\immediate\writeutility}
% \def\immediatewriteutilitycommand{\immediate\writeutilitycommand}
%
-% more flexible (for overloading)
+% more flexible (for overloading)
\def\immediatewriteutility {\immediate\write\uti}
\def\immediatewriteutilitycommand#1{\immediate\write\uti{c \string#1}}
-% as in:
+% as in:
\def\cwriteutility#1%
{\write\uti{\noexpand\checkedutility{\number\nofshipouts}{#1}}}
@@ -103,7 +103,7 @@
\def\docheckedutility#1#2{\ifnum#1=\nofshipouts#2\else\letterpercent\fi}
-\prependtoks
+\prependtoks
\let\checkedutility\docheckedutility
\to \everybeforeshipout
@@ -116,7 +116,7 @@
%\let\immediatewriteutilitycommand\cimmediatewriteutilitycommand
\let\checkutilities \relax}
-% this trickery is used in s-pre-50
+% this trickery is used in s-pre-50
\def\openutilities
{\immediate\openout\uti=\jobname.\f!inputextension
@@ -124,9 +124,9 @@
\immediatewriteutilitycommand{\thisisutilityversion {\utilityversion}}}
\def\closeutilities
- {\immediate\closeout\uti % niet echt nodig
+ {\immediate\closeout\uti % niet echt nodig
\reportutilityproblems
- % should be a message :
+ % should be a message :
\let\writeutilitycommand \gobbleoneargument
\let\writeutility \gobbleoneargument
\let\immediatewriteutilitycommand\gobbleoneargument
@@ -166,7 +166,7 @@
% \def\resetutilities%
% {\processcommacommand[\utilityresetlist]\getvalue}
%
-% the more efficient
+% the more efficient
%
% \def\addutilityreset#1%
% {\addtocommalist{#1}\utilityresetlist}
@@ -177,8 +177,8 @@
% \def\resetutilities%
% {\processcommacommand[\utilityresetlist]\doresetutility}
%
-% the fastest, about two times, but who cares, since this
-% can be neglected
+% the fastest, about two times, but who cares, since this
+% can be neglected
\newtoks\utilityresetlist
@@ -247,11 +247,11 @@
\resetutilities
%\message{#1}%
\def\docommando##1% % more than one utility thing
- {\csname\s!set##1\endcsname}% % can be handled in one pass,
- \processcommacommand[#1]\docommando % for instance lists
+ {\csname\s!set##1\endcsname}% % can be handled in one pass,
+ \processcommacommand[#1]\docommando % for instance lists
\begingroup
\def\currentutilityfilename{#2}%
- \footnotesenabledfalse
+ \notesenabledfalse
\doinpututilitiestrue
\global\utilitydonefalse
\catcode`\\=\@@escape
@@ -290,10 +290,10 @@
\disableinitializevariables
\endgroup}
-% Saving the sort vector:
+% Saving the sort vector:
\def\savesortkeys
- {\startnointerference
+ {\startnointerference
\def\flushsortkey##1##2##3##4%
{\convertargument{##1}{##2}{##3}{##4}\to\ascii
\immediatewriteutility{k {\currentlanguage}{\currentencoding}\ascii}}%
@@ -302,7 +302,7 @@
\globallet\savesortkeys\relax
\stopnointerference}
-\prependtoks \savesortkeys \to \everystarttext
+\prependtoks \savesortkeys \to \everystarttext
% Commando's ten behoeve van two-pass lists. In principe
% kan alles in een keer worden ingelezen. Omdat de macro's
@@ -320,13 +320,13 @@
%
% \twopassentry{\s!xxx}{nr}{data} nr alleen voor testdoeleinden
%
-% also:
+% also:
%
-% \definerawpasslist{\s!xxx}
-% \moverawpasslist\s!xxx\to\somemacro
+% \definerawpasslist{\s!xxx}
+% \moverawpasslist\s!xxx\to\somemacro
\let\alltwopasslists\empty % with 0,0 -> stepwise commalist
-\let\allrawpasslists\empty % without 0,0 -> raw commalist
+\let\allrawpasslists\empty % without 0,0 -> raw commalist
\newif\iftwopassdatafound
@@ -372,9 +372,9 @@
\def\doloadtwopassdata#1%
{\doifundefined{#1:\s!list}
- {\startnointerference
+ {\startnointerference
\letgvalueempty{#1:\s!list}%
- \protectlabels
+ \protectlabels
\doutilities{#1\s!pass}\jobname\empty\relax\relax
\ifx\twopassdata\empty\else
\appendtwopasselement{#1}{0}\twopassdata
@@ -383,7 +383,7 @@
\def\loadtwopassdata
{\ifx\alltwopasslists\empty\else
- \def\twopassdata{0,0}% end condition
+ \def\twopassdata{0,0}% end condition
\processcommacommand[\alltwopasslists]\doloadtwopassdata
\globallet\alltwopassdata\empty
\fi
@@ -415,22 +415,22 @@
% \ifx\twopassdata\notwopassdata
% \twopassdatafoundfalse
% \let\twopassdata\empty
-% \else
+% \else
% \twopassdatafoundtrue
% \setxvalue{#3:\s!list}{#2}%
% \fi}
-%
+%
% \def\gettwopassdata#1%
% {\loadtwopassdata
% %\edef\!!stringa{\csname#1:\s!list\endcsname}%
% %\debuggerinfo{\m!systems}{twopass get #1 - \!!stringa}%
% %\expandafter\dogettwopassdata\expandafter[\!!stringa]{#1}}
% \expanded{\dogettwopassdata[\csname#1:\s!list\endcsname]}{#1}}
-%
+%
% \def\findtwopassdata#1#2%
% {\loadtwopassdata
% \expanded{\dofindtwopassdata{#1}{#2}}}
-%
+%
% \def\dofindtwopassdata#1#2%
% {\edef\!!stringa{,\csname#1:\s!list\endcsname}%
% %\debuggerinfo{\m!systems}{twopass find #2 - \!!stringa}%
@@ -447,14 +447,14 @@
% {\loadtwopassdata
% \edef\!!stringa{\getvalue{#1:\s!list}}%
% \expandafter\dogetfirsttwopassdata\expandafter[\!!stringa]{#1}}
-%
+%
% \def\dogetfirsttwopassdata[#1,#2]#3%
% {\doifelse{#1}{0}
% {\twopassdatafoundfalse
% \let\twopassdata\empty}
% {\twopassdatafoundtrue
% \edef\twopassdata{#1}}}
-%
+%
% \def\getlasttwopassdata#1%
% {\loadtwopassdata
% \edef\twopassdata{0}\twopassdatafoundfalse
@@ -464,7 +464,7 @@
% {\increment\noftwopassitems
% \edef\twopassdata{##1}\twopassdatafoundtrue}}%
% \processcommacommand[\getvalue{#1:\s!list}]\docommando}
-%
+%
% \def\getfromtwopassdata#1#2%
% {\loadtwopassdata
% \getfromcommacommand[\csname#1:\s!list\endcsname][#2]%
@@ -546,14 +546,14 @@
% Default-instellingen (verborgen)
-\prependtoks \resetutilities \to \everyjob
+\prependtoks \resetutilities \to \everyjob
-% left over
+% left over
\def\plaatsvolledig#1#2#3#4% kop, ref, tit, do
{#1[#2]{#3}#4\pagina[\v!ja]}
-% Experiment
+% Experiment
%
%\installprogram{Hello World}
@@ -564,9 +564,9 @@
% \writeplugindata{texutil}{{beta}}
% \writeplugindata{texutil}{{gamma}}
% \writeplugindata{texutil}{{delta}}
-%
+%
% \loadplugindata {plugintest}
-
+
\def\immediatewriteplugindata#1#2%
{\immediatewriteutility{p u {#1} #2}}
@@ -578,7 +578,7 @@
% \plugincommand{\command{}{}{}}
%
-% this way we can catch undefined commands
+% this way we can catch undefined commands
\long\def\plugincommand#1%
{\doplugincommand#1\relax}
@@ -594,10 +594,10 @@
{}
% \addutilityreset{plugintest}
-%
+%
% \def\resetplugintest{\let\plugintest\gobbletwoarguments}
% \def\setplugintest {\let\plugintest\writestatus}
-%
+%
% \installplugin
% {plugintest}
% {\let\plugintest\gobbletwoarguments}
@@ -608,4 +608,4 @@
\long\setvalue{\s!reset#1}{#2}%
\long\setvalue{\s!set #1}{#3}}
-\protect \endinput
+\protect \endinput
diff --git a/tex/context/base/core-var.tex b/tex/context/base/core-var.tex
index ef15b3622..1cc72ee50 100644
--- a/tex/context/base/core-var.tex
+++ b/tex/context/base/core-var.tex
@@ -8,53 +8,71 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
\writestatus{loading}{Context Core Macros / Variables}
\unprotect
-%D \macros
+%D \macros
%D {every...}
%D
-%D A few every's.
-
-\newevery \everyshipout \relax
-\newevery \everybeforeshipout \relax
-\newevery \everyaftershipout \relax
-\newevery \everylastshipout \relax
-\newevery \everybye \relax
-\newevery \everygoodbye \relax
-\newevery \everystarttext \relax
-\newevery \everystoptext \relax
-\newevery \everyforgetall \relax
-
-\newevery \everybeforepagebody \relax
-\newevery \everyafterpagebody \relax
+%D A few every's.
+
+\newevery \everyshipout \relax
+\newevery \everybeforeshipout \relax
+\newevery \everyaftershipout \relax
+\newevery \everylastshipout \relax
+\newevery \everybye \relax
+\newevery \everygoodbye \relax
+\newevery \everystarttext \relax
+\newevery \everystoptext \relax
+\newevery \everyforgetall \relax
+\newevery \everybeforepagebody \relax
+\newevery \everyafterpagebody \relax \let \everypagebody \everybeforepagebody % backward compatible
+\newevery \everybeforeutilityread \relax
+\newevery \everyafterutilityread \relax
+
+%newevery \everybeforeutilitywrite \relax
+
+\newevery \everycleanupfeatures \relax \def\cleanupfeatures{\the\everycleanupfeatures}
+\newevery \everyinsidefloat \relax
+\newevery \everyheadstart \relax
+\newevery \everyendoftextbody \relax
+\newevery \everybeginofpar \relax
+\newevery \everyendofpar \relax
+
+%D Experimental (used in xml <p> .. </p>
+
+\def\bpar{\the\everybeginofpar\ignorespaces} % may interfere with \everypar
+\def\epar{\ifhmode\removeunwantedspaces\the\everyendofpar\fi} % test prevents problems with \bpar\epar
-\let \everypagebody \everybeforepagebody % backward compatible
-
-\newevery \everybeforeutilityread \relax
-\newevery \everyafterutilityread \relax
+%D \macros
+%D {defineinputmode,setinputmode}
+%D
+%D New. Some work needs to be done.
-\newevery \everycleanupfeatures \relax
+\def\defineinputmode[#1]{\@EA\newtoks\csname every#1inputmode\endcsname}
+%def\setinputmode [#1]{\the \csname every#1inputmode\endcsname}
+\def\setinputmode [#1]{\the\executeifdefined{every#1inputmode}\emptytoks}
-\def\cleanupfeatures{\the\everycleanupfeatures}
+\defineinputmode [TEX]
+\defineinputmode [XML]
-\newevery \everyinsidefloat \relax
+\setinputmode [TEX]
-%D \macros
-%D {trialtypesetting}
+%D \macros
+%D {trialtypesetting}
%D
-%D We disable trial typesetting in the output routine,
-%D just to be sure.
+%D We disable trial typesetting in the output routine,
+%D just to be sure.
-\prependtoks
+\prependtoks
\trialtypesettingfalse
-\to \everybeforepagebody
+\to \everybeforepagebody
-%D \macros
+%D \macros
%D {starttextdata}
\newtoks \collectedtextdata
@@ -67,29 +85,29 @@
\global\collectedtextdata\emptytoks
\globallet\flushtextdata\donothing}
-%D \macros
+%D \macros
%D {ifprocessingXML}
%D
-%D We need this one even if no \XML\ is supported.
+%D We need this one even if no \XML\ is supported.
\newif\ifprocessingXML
%D \macros
%D {ifproductionrun}
%D
-%D This boolean can be used to bypass certain
-%D initializations.
+%D This boolean can be used to bypass certain
+%D initializations.
-\newif\ifproductionrun
+\newif\ifproductionrun
\appendtoks \productionruntrue \to \everydump
-%D \macros
+%D \macros
%D {everyboxedcontent, ifboxedcontent,
%D startboxedcontent, stopboxedcontent}
%D
-%D This one is relatively new and will be used as a more
-%D robust test for inner situations.
+%D This one is relatively new and will be used as a more
+%D robust test for inner situations.
\newif \ifboxedcontent
\newevery \everyboxedcontent \relax
@@ -99,18 +117,18 @@
\def\startboxedcontent{\bgroup\the\everyboxedcontent}
\let\stopboxedcontent \egroup
-%D \macros
+%D \macros
%D {fastmode}
%D
-%D The command \type {\fastmode} disables some time consuming
-%D typesetting.
+%D The command \type {\fastmode} disables some time consuming
+%D typesetting.
\newevery \everyfastmode \relax
-\newif\iffastmode
+\newif\iffastmode
\def\fastmode
- {\fastmodetrue
+ {\fastmodetrue
\the\everyfastmode}
\def\silentmode % ook hier \everysilentmode net als \fastmode
@@ -118,7 +136,7 @@
\showwarningsfalse
\let\writestatus\gobbletwoarguments}
-%D \macros
+%D \macros
%D {pdfoutput}
%D
%D There are some fundamental differences between producing
@@ -127,25 +145,25 @@
%D postprocessing stage. Because we must make sure that
%D \CONTEXT\ knows what it's up to, we always default to \DVI\
%D mode, even when users explicitly ask for \PDF\ output in the
-%D \PDFTEX\ configuration file.
+%D \PDFTEX\ configuration file.
\ifx\pdfoutput\undefined \else
- \prependtoks \pdfoutput=0 \to \everyjob
+ \prependtoks \pdfoutput=0 \to \everyjob
\fi
%D \macros
%D {setvariables,getvariable}
%D
-%D \starttyping
+%D \starttyping
%D \setvariables[xx][titel=]
%D \setvariables[xx][titel=test test]
%D \setvariables[xx][titel=test $x=1$ test] % fatal error reported
%D \setvariables[xx][titel=test {$x=1$} test]
%D \setvariables[xx][titel] % fatal error reported
%D \setvariables[xx][titel=e]
-%D \stoptyping
+%D \stoptyping
\def\??vars{@@vars}
@@ -154,7 +172,7 @@
\def\setgvariables{\dotripleargument\dosetvariables[\getrawgparameters]}
\def\setxvariables{\dotripleargument\dosetvariables[\getrawxparameters]}
-\def\globalsetvariables % obsolete
+\def\globalsetvariables % obsolete
{\dotripleargument\dosetvariables[\globalgetrawparameters]}
\def\dosetvariables[#1][#2][#3]%
@@ -186,8 +204,8 @@
\let\currentvariableclass\empty
-%D We store some original meanings, maybe in \type
-%D {math-ini}.
+%D We store some original meanings, maybe in \type
+%D {math-ini}.
\let\normalin \in
\let\normalover \over
@@ -197,9 +215,9 @@
\let\normalabovewithdelims\abovewithdelims
\let\normalatopwithdelims \atopwithdelims
-%D Add-ons:
+%D Add-ons:
\let\startlayoutcomponent\gobbletwoarguments
\let\stoplayoutcomponent \relax
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/core-ver.tex b/tex/context/base/core-ver.tex
index f7327cf59..ed77e9c3b 100644
--- a/tex/context/base/core-ver.tex
+++ b/tex/context/base/core-ver.tex
@@ -8,24 +8,24 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
\writestatus{loading}{Context Core Macros / Verbatim}
\startmessages dutch library: verbatims
title: typen
- 1: file -- bestaat niet
+ 1: file -- bestaat niet
\stopmessages
\startmessages english library: verbatims
title: verbatim
- 1: file -- does not exist
+ 1: file -- does not exist
\stopmessages
\startmessages german library: verbatims
title: verbatim
- 1: Datei -- existiert nicht
+ 1: Datei -- existiert nicht
\stopmessages
\startmessages czech library: verbatims
@@ -40,7 +40,7 @@
\startmessages norwegian library: verbatims
title: verbatim
- 1: fil -- eksisterer ikke
+ 1: fil -- eksisterer ikke
\stopmessages
\startmessages romanian library: verbatims
@@ -64,20 +64,20 @@
\def\installprettytype%
{\dodoubleargument\doinstallprettytype}
-\def\doinstallprettytype[#1][#2]% map #1 onto #2
+\def\doinstallprettytype[#1][#2]% map #1 onto #2
{\uppercasestring#1\to\asciiA
\uppercasestring#2\to\asciiB
\setevalue{\??ty\??ty\asciiA}{\asciiB}}
\def\setupprettiesintype#1%
- {\uppercasestring#1\to\ascii
+ {\uppercasestring#1\to\ascii
\edef\prettyidentifier%
{\ifundefined{\??ty\??ty\ascii}TEX%
\else\getvalue{\??ty\??ty\ascii}\fi}%
\doifundefined{setuppretty\prettyidentifier type}%
{\bgroup
\setbox0\hbox % get rid of spaces when in-line \newpretty loading
- {\restorecatcodes % also needed when loading during \newpretty
+ {\restorecatcodes % also needed when loading during \newpretty
\startreadingfile % restore < and > if needed
\lowercasestring verb-\prettyidentifier.tex\to\filename
\readsysfile\filename\donothing\donothing
@@ -87,7 +87,7 @@
{\let\uncatcodecharacters\uncatcodeallcharacters % ugly, should be switch
\def\setupprettytype{\getvalue{setuppretty\prettyidentifier type}}}
{\let\setupprettytype\relax}}
-
+
\installprettytype [RAW] [RAW]
\installprettytype [TEX] [TEX]
@@ -129,7 +129,7 @@
\installnewpretty X {\setupprettiesintype{XML}\setupprettytype}
\def\setupcommonverbatim#1%
- {\eightbitcharactersfalse % obey regime / encoding
+ {\eightbitcharactersfalse % obey regime / encoding
%
\def\prettyidentifier{TEX}%
%
@@ -143,10 +143,10 @@
\doifvalue{#1\c!spatie}\v!aan{\def\obeyspaces{\setcontrolspaces}}%
%doifvalue{#1\c!tab} \v!aan{\def\obeytabs {\settabskips}}%
\doifnotvalue{#1\c!tab}\v!uit{\def\obeytabs {\settabskips}}%
- \doifvalue{#1\c!tab} \s!ascii{\chardef\tabskipmode2}% quit on >127
+ \doifvalue{#1\c!tab} \s!ascii{\chardef\tabskipmode2}% quit on >127
\doifvalue{#1\c!pagina}\v!nee{\def\obeypages {\ignorepages}}%
%
- \ignorehyphens % default
+ \ignorehyphens % default
\ExpandFirstAfter\processaction
[\getvalue{#1\c!regels}]
[ \v!ja=>\obeybreakpoints,
@@ -197,7 +197,7 @@
%D \type{<<} and \type{>>} as delimiters. This alternative can
%D be used in situations where slanted typeseting is needed.
-% todo: we can use \letter... here:
+% todo: we can use \letter... here:
\def\lesscharacter {<}
\def\morecharacter {>}
@@ -221,7 +221,7 @@
\unexpanded\def\type%
{\dotype\empty}
-
+
\def\dotype#1%
{\bgroup
\strut % new, enables leading space in \type { abc } at par start
@@ -259,7 +259,7 @@
% \fi\fi
% \verbatimcolor
% \next}
-%
+%
% \def\dodotype%
% {\ifx\next\bgroup
% \initializetype
@@ -293,25 +293,25 @@
\def\dodotypeA
{\initializetype
\initializetypegrouping
- \verbatimcolor
+ \verbatimcolor
\afterassignment\protectfirsttype\let\next=}
\def\dodotypeB
{\initializetype
\setupnotypegrouping
- \verbatimcolor
+ \verbatimcolor
\let\next=}
\def\dodotypeC<#1%
{\initializetype
- \verbatimcolor
+ \verbatimcolor
\if#1<\else
\setupalternativetypegrouping#1%
\fi}
\def\dodotypeD#1%
{\initializetype
- \verbatimcolor
+ \verbatimcolor
\catcode`#1=\@@endgroup}
\def\dodotype%
@@ -337,10 +337,10 @@
\egroup]%
\def\activeleftargument%
[\bgroup
- \leftargument %% this way TeXEdit can check: {
+ \leftargument %% this way TeXEdit can check: {
\catcode`\}=\@@active % ... in alignments (tables)
\let}=\activerightargument]%
- \let{=\activeleftargument]% %% this way TeXEdit can check: }
+ \let{=\activeleftargument]% %% this way TeXEdit can check: }
\egroup
\bgroup
@@ -357,14 +357,14 @@
{\catcode`\<=\@@begingroup
\catcode`\>=\@@endgroup}
-%D When writing the manual to \CONTEXT\ and documenting this
-%D source we needed to typeset \type{<<} and \type{>>}. Because
-%D we wanted to do this in the natural way, we've adapted the
-%D original definition a bit. We still show the original
-%D because we think it's shows a bit better what we are
-%D doing.
-%D
-%D \starttypen
+%D When writing the manual to \CONTEXT\ and documenting this
+%D source we needed to typeset \type{<<} and \type{>>}. Because
+%D we wanted to do this in the natural way, we've adapted the
+%D original definition a bit. We still show the original
+%D because we think it's shows a bit better what we are
+%D doing.
+%D
+%D \starttypen
%D \bgroup
%D \catcode`\<=\@@active
%D \catcode`\>=\@@active
@@ -392,14 +392,14 @@
%D \egroup
%D \stoptypen
%D
-%D The final implementation looks a bit further and treats the
-%D lone \type{<<} and \type{>>} a bit different. The \type
-%D {\hbox{}} prevents ligatures, which unfortunately turn up
-%D in Lucida fonts.
+%D The final implementation looks a bit further and treats the
+%D lone \type{<<} and \type{>>} a bit different. The \type
+%D {\hbox{}} prevents ligatures, which unfortunately turn up
+%D in Lucida fonts.
\def\doenterdoublelesstype
{\ifx\next\egroup
- \lesscharacter\hbox{}\lesscharacter
+ \lesscharacter\hbox{}\lesscharacter
\else
\bgroup\switchslantedtype
\let\doenterdoublemoretype\egroup
@@ -460,17 +460,17 @@
% \edef\!!stringa{\getvalue{#1\c!escape}}%
% \@EA\catcode\@EA`\!!stringa=\@@escape}
-\def\setupcommandsintype#1% can also be \string\
+\def\setupcommandsintype#1% can also be \string\
{\setupgroupedtype
\edef\\{\getvalue{#1\c!escape}}%
- \letvalue{\\}=\\% for instance \/=/
+ \letvalue{\\}=\\% for instance \/=/
\@EA\catcode\@EA`\\=\@@escape
- \def\BTEX##1\ETEX##2% ##2 gobbles active space
+ \def\BTEX##1\ETEX##2% ##2 gobbles active space
{\naturaltextext##1\unskip\relax}}
-%D The following lines show what happens when we set
-%D \type {option=commands}.
-%D
+%D The following lines show what happens when we set
+%D \type {option=commands}.
+%D
%D \startbuffer
%D \starttyping
%D test//test test/BTEX \footnote{test test test}/ETEX test
@@ -479,11 +479,11 @@
%D test test test /BTEX \bf(nota bene)/ETEX test
%D \stoptyping
%D \stopbuffer
-%D
+%D
%D % \bgroup\setuptyping[option=commands]\getbuffer\egroup
-%D
-%D this was keyed in as:
-%D
+%D
+%D this was keyed in as:
+%D
%D \typebuffer
\def\setupslantedtype
@@ -498,7 +498,7 @@
\let\next\relax
\else\ifx\next\bgroup
\let\next\relax
- \else\ifx\next\egroup % takes care of \type{}
+ \else\ifx\next\egroup % takes care of \type{}
\let\next\relax
\else\ifx\next\activeleftargument
\let\next\relax
@@ -508,7 +508,7 @@
\next}
\egroup
-\def\protectfirsttype%
+\def\protectfirsttype
{\futurelet\next\doprotectfirsttype}
%D The neccessary initializations are done by calling
@@ -558,13 +558,13 @@
%D \macros
%D {typ,obeyhyphens,obeybreakpoints}
-%D
+%D
%D Although it's not clear from the macros, one character
%D trait of this macros, which are build on top of the support
%D module, is that they don't hyphenate. We therefore offer
%D the alternative \type{\typ}. The current implementation
%D works all right, but a decent hyphenation support of
-%D \type{\tt} text will be implemented soon.
+%D \type{\tt} text will be implemented soon.
% \def\obeyhyphens
% {\def\obeyedspace{\hskip\spaceskip}%
@@ -573,7 +573,7 @@
% \tttf\hyphenchar\font45
% \savedfont
% \spaceskip.5em\!!plus.25em\!!minus.25em\relax}
-%
+%
% \def\obeybreakpoints
% {\def\obeyedspace{\hskip\spaceskip}%
% \spaceskip.5em
@@ -592,7 +592,7 @@
{\def\obeyedspace {\null\hskip\spaceskip\null}%
\def\controlspace{\null\hskip\zeropoint\hbox{\char32}\hskip\zeropoint\null}%
\spaceskip.5em\relax}
-
+
%\unexpanded\def\typ
% {\bgroup
% \obeyhyphens
@@ -642,9 +642,9 @@
%D \unexpanded\def\dis{\dospecialtype{\$\$}{\$\$}}
%D \stoptypen
%D
-% %D For sometime we used the better but less readable is
+% %D For sometime we used the better but less readable is
% %D alternative
-% %D
+% %D
% %D \starttypen
% %D \def\doprocessgroup#1#2#3%
% %D {\bgroup
@@ -656,18 +656,18 @@
% %D #2}%
% %D \afterassignment\doprocessgroup
% %D \let\next=}
-% %D
+% %D
% %D \def\setgroupedtype%
% %D {\initializetype
% %D \catcode`\{=\@@begingroup
% %D \catcode`\}=\@@endgroup}
-% %D
+% %D
% %D \unexpanded\def\tex{\doprocessgroup\setgroupedtype\texescape\relax}
% %D \unexpanded\def\arg{\doprocessgroup\setgroupedtype\leftargument\rightargument}
% %D \unexpanded\def\mat{\doprocessgroup\setgroupedtype\$\$}
% %D \unexpanded\def\dis{\doprocessgroup\setgroupedtype{\$\$}{\$\$}}
% %D \stoptypen
-% %D
+% %D
%D
%D But since \type{\groupedcommand} became available, we use
%D however
@@ -689,7 +689,7 @@
%D due to the fact that we use \type{\stop...} as delimiter.
%D The implementation inherits some features, for instance the
%D support of linenumbering, which can best be studied in the
-%D documented support module.
+%D documented support module.
\def\initializetyping#1%
{%\donefalse
@@ -700,9 +700,9 @@
\scratchskip\getvalue{\??tp#1\c!evenmarge}\relax
\ifzeropt\scratchskip\else\donetrue\fi
\ifdone
- \def\doopenupverbatimline%
+ \def\doopenupverbatimline
{\getpagestatus
- \ifrightpage
+ \ifrightpage
\hskip\getvalue{\??tp#1\c!onevenmarge}\relax
\else
\hskip\getvalue{\??tp#1\c!evenmarge}\relax
@@ -724,13 +724,13 @@
\v!geen=>\scratchskip\zeropoint,
\s!unknown=>\scratchskip\commalistelement]%
\ifgridsnapping
- \ifdim\scratchskip=.5\baselineskip\relax
- \edef\verbatimbaselineskip{\the\scratchskip}% new
+ \ifdim\scratchskip=.5\baselineskip\relax
+ \edef\verbatimbaselineskip{\the\scratchskip}% new
\else
- \edef\verbatimbaselineskip{\the\baselineskip}%
+ \edef\verbatimbaselineskip{\the\baselineskip}%
\fi
\else
- \edef\verbatimbaselineskip{\the\scratchskip}%
+ \edef\verbatimbaselineskip{\the\scratchskip}%
\fi
\setupcommonverbatim{\??tp#1}}
@@ -785,27 +785,27 @@
%D The setups for display verbatim and file verbatim are
%D shared. One can adapt the extra defined typing environments,
-%D but they also default to the values below. Watch the
-%D alternative escape character.
+%D but they also default to the values below. Watch the
+%D alternative escape character.
\setuptyping
[ \c!voor=\blanko,
\c!na=\blanko,
\c!korps=,
\c!kleur=,
- \c!spatie=\v!uit,
+ \c!spatie=\v!uit,
\c!pagina=\v!nee,
\c!tab=\s!ascii,
\c!optie=\v!geen,
\c!palet=colorpretty,
\c!tekst=\v!nee,
- \c!letter=\tttf,
+ \c!letter=\tttf,
\c!icommando=\ttsl,
\c!vcommando=,
\c!ccommando=\tttf,
\c!springvolgendein=\v!ja,
\c!marge=\!!zeropoint,
- \c!evenmarge=\!!zeropoint,
+ \c!evenmarge=\!!zeropoint,
\c!onevenmarge=\!!zeropoint,
\c!blanko=\v!regel,
\c!escape=/, % beware \string\ , should also be accepted
@@ -815,8 +815,8 @@
%D \macros
%D {definetype}
%D
-%D Specific inline verbatim commands can be defined with the
-%D following command.
+%D Specific inline verbatim commands can be defined with the
+%D following command.
\def\definetype
{\dodoubleempty\dodefinetype}
@@ -843,9 +843,9 @@
%D \stopextratyping
%D \stoptypen
%D
-%D The definitions default to the standard typing values.
+%D The definitions default to the standard typing values.
-\def\presettyping[#1][#2]%
+\def\presettyping[#1][#2]%
{\copyparameters
[\??tp#1][\??tp]
[\c!voor,\c!na,\c!spatie,\c!pagina,\c!tab,\c!kleur,\c!letter,
@@ -909,7 +909,7 @@
prettythree=grayprettythree,
prettyfour=grayprettyfour]
-% ---> naar verb-* ? of predefine als undefined?
+% ---> naar verb-* ? of predefine als undefined?
\definepalet [TEXcolorpretty] [colorpretty]
\definepalet [TEXgraypretty] [graypretty]
@@ -935,7 +935,7 @@
% Some real in-depth knowlegde of palets: `palet:color' it is!
%D We can use some core color commands. These are faster than
-%D the standard color switching ones and work ok on a line by
+%D the standard color switching ones and work ok on a line by
%D line basis.
%D
%D \starttypen
@@ -945,17 +945,17 @@
%D \def\endofpretty {\stopcolormode}}
%D \stoptypen
%D
-%D Since we support a global color too, the folowing
-%D definition is better:
+%D Since we support a global color too, the folowing
+%D definition is better:
-\def\setupverbatimcolor#1% fast and local versus slow and global
- {\doifelsevaluenothing{#1\c!kleur}
+\def\setupverbatimcolor#1% fast and local versus slow and global
+ {\doifelsevaluenothing{#1\c!kleur}
{\def\beginofpretty[##1]{\startcolormode{\prettypalet:##1}}%
\let\endofpretty \restorecolormode % \stopcolormode
\let\startverbatimcolor \relax
\let\stopverbatimcolor \relax
\let\verbatimcolor \relax}
- {\def\beginofpretty[##1]{\startcolor[\prettypalet:##1]}%
+ {\def\beginofpretty[##1]{\startcolor[\prettypalet:##1]}%
\let\endofpretty \stopcolor
\def\startverbatimcolor{\startcolor[\getvalue{#1\c!kleur}]}%
\let\stopverbatimcolor \stopcolor
@@ -971,7 +971,7 @@
\let\stopverbatimcolor \relax
\let\verbatimcolor \relax
-%D In the verbatim module, there are some examples given of
+%D In the verbatim module, there are some examples given of
%D the more obscure features of the verbatim environments.
%D
%D \startbuffer
@@ -980,14 +980,14 @@
%D {\ifmmode#1\else$#1$\fi} % becomes: \mathematics{x^2}
%D \stopTEX
%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D This gives, as can be expected:
-%D
+%D
+%D \typebuffer
+%D
+%D This gives, as can be expected:
+%D
%D \haalbuffer
-%D
-%D When we want to see some typeset \TEX\ too, we can say:
+%D
+%D When we want to see some typeset \TEX\ too, we can say:
%D
%D \startbuffer
%D \startTEX
@@ -996,57 +996,57 @@
%D \stopTEX
%D \stopbuffer
%D
-%D \typebuffer
+%D \typebuffer
%D
-%D or:
+%D or:
%D
%D \haalbuffer
%D
-%D In a similar way:
+%D In a similar way:
%D
%D \startbuffer
%D \startSQL
-%D select * -- indeed, here we {\em do} select
+%D select * -- indeed, here we {\em do} select
%D from tableA
%D where 1 = 2
%D \stopSQL
%D \stopbuffer
%D
-%D \typebuffer
+%D \typebuffer
%D
-%D gives:
+%D gives:
%D
-%D \haalbuffer
+%D \haalbuffer
%D
%D The next examples sow how we can directly call for natural
-%D \TEX\ comments:
-%D
+%D \TEX\ comments:
+%D
%D \startbuffer
%D \setuptyping
%D [TEX]
%D [tekst=ja]
-%D
+%D
%D \startTEX
%D \def\mathematics#1% % usage: \type {\mathematics{x^2}}
%D {\ifmmode#1\else$#1$\fi} % becomes: \mathematics{x^2}
%D \stopTEX
-%D
+%D
%D \setuptyping
%D [SQL]
%D [tekst=ja,palet=,icommando=\bf,vcommando=,ccommando=\it]
-%D
+%D
%D \startSQL
-%D select * -- indeed, here we {\em do} select
+%D select * -- indeed, here we {\em do} select
%D from tableA
%D where 1 = 2
%D \stopSQL
-%D
+%D
%D \setuptyping
%D [SQL]
%D [ccommando=\tf\underbar]
-%D
+%D
%D \startSQL
-%D select * -- indeed, here we {\em do} select
+%D select * -- indeed, here we {\em do} select
%D from tableA
%D where 1 = 2
%D \stopSQL
@@ -1054,11 +1054,11 @@
%D
%D \typebuffer
%D
-%D Now watch:
+%D Now watch:
%D
%D \haalbuffer
%D
-%D The natural \TEX\ typesetting was introduced when Tobias
+%D The natural \TEX\ typesetting was introduced when Tobias
%D and Berend started using verbatim \JAVASCRIPT\ and \SQL.
%D \macros
@@ -1078,7 +1078,7 @@
%D setup values are inherited from display verbatim.
%D The implementation of \type{\typefile} is straightforward:
-% new feature (not yet 100\% ok)
+% new feature (not yet 100\% ok)
%
% \setuptyping[file][numbering=file]
%
@@ -1173,26 +1173,26 @@
\egroup}%
\getvalue{\??tp#1\c!na}}
-%D \macros
+%D \macros
%D {filename}
%D
%D Typesetting filenames in monospaced fonts is possible with
-%D
+%D
%D \starttypen
%D \filename{here/there/filename.suffix}
%D \stoptypen
%D
-%D The definition is not that spectacular.
+%D The definition is not that spectacular.
\unexpanded\def\filename#1{{\tttf\hyphenatedfile{#1}}}
-%D This leaves some settings:
+%D This leaves some settings:
\permitshiftedendofverbatim
\optimizeverbatimtrue
-%D And a bonus macro:
+%D And a bonus macro:
\def\verbatim#1{\convertargument#1\to\ascii\ascii}
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/core-vis.tex b/tex/context/base/core-vis.tex
index 3b5c6a5d5..81299a8b7 100644
--- a/tex/context/base/core-vis.tex
+++ b/tex/context/base/core-vis.tex
@@ -8,12 +8,12 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
-%D This module adds some more visualization cues to the ones
-%D supplied in the support module.
-%D
+%D This module adds some more visualization cues to the ones
+%D supplied in the support module.
+%D
%D %\everypar dual character, \the\everypar and \everypar=
%D %\hrule cannot be grabbed in advance, switches mode
%D %\vrule cannot be grabbed in advance, switches mode
@@ -33,20 +33,20 @@
%D {indent, noindent,
%D leavevmode,
%D par}
-%D
-%D \TeX\ acts upon paragraphs. In mosts documents paragraphs
+%D
+%D \TeX\ acts upon paragraphs. In mosts documents paragraphs
%D are separated by empty lines, which internally are handled as
%D \type{\par}. Paragraphs can be indented or not, depending on
-%D the setting of \type{\parindent}, the first token of a
-%D paragraph and/or user suppressed or forced indentation.
-%D
+%D the setting of \type{\parindent}, the first token of a
+%D paragraph and/or user suppressed or forced indentation.
+%D
%D Because the actual typesetting is based on both explicit
%D user and implicit system actions, visualization is only
%D possible for the user supplied \type{\indent},
%D \type{\noindent}, \type{\leavevmode} and \type{\par}. Other
%D 'clever' tricks will quite certainly lead to more failures
-%D than successes, so we only support these three explicit
-%D primitives and one macro:
+%D than successes, so we only support these three explicit
+%D primitives and one macro:
\let\normalnoindent = \noindent
\let\normalindent = \indent
@@ -59,7 +59,7 @@
\scratchdimen#1\relax
\dontinterfere
\dontcomplain
- \boxrulewidth5\testrulewidth
+ \boxrulewidth5\testrulewidth
#3#4\relax
\setbox0\normalhbox to \scratchdimen
{#2{\ruledhbox to \scratchdimen
@@ -73,7 +73,7 @@
\def\ruledhanging
{\ifdim\hangindent>\zeropoint
\ifnum\hangafter<\zerocount
- \normalhbox
+ \normalhbox
{\boxrulewidth5\testrulewidth
\setbox0\ruledhbox to \hangindent
{\scratchdimen\strutht
@@ -106,8 +106,8 @@
\def\ruledpar
{\relax
- \ifhmode
- \showparagraphcue{40\testrulewidth}\relax\rightrulefalse\relax\!!height
+ \ifhmode
+ \showparagraphcue{40\testrulewidth}\relax\rightrulefalse\relax\!!height
\fi
\normalpar}
@@ -117,14 +117,14 @@
\ruledparagraphcues
\showparagraphcue{40\testrulewidth}\llap\leftrulefalse\relax\!!height}
-\def\ruledindent
- {\relax
- \normalnoindent
+\def\ruledindent
+ {\relax
+ \normalnoindent
\ruledparagraphcues
\ifdim\parindent>\zeropoint
- \showparagraphcue\parindent\relax\relax\relax\!!height
+ \showparagraphcue\parindent\relax\relax\relax\!!height
\else
- \showparagraphcue{40\testrulewidth}\llap\relax\relax\!!height
+ \showparagraphcue{40\testrulewidth}\llap\relax\relax\!!height
\fi
\normalhskip\parindent}
@@ -134,61 +134,61 @@
\ifdim\parindent>\zeropoint
\normalhskip-\parindent
\ruledparagraphcues
- \showparagraphcue\parindent\relax\leftrulefalse\rightrulefalse\!!height
+ \showparagraphcue\parindent\relax\leftrulefalse\rightrulefalse\!!height
\normalhskip\parindent
\else
\ruledparagraphcues
- \showparagraphcue{40\testrulewidth}\llap\leftrulefalse\rightrulefalse\!!height
+ \showparagraphcue{40\testrulewidth}\llap\leftrulefalse\rightrulefalse\!!height
\fi}
\def\dontshowimplicits
- {\let\noindent \normalnoindent
- \let\indent \normalindent
+ {\let\noindent \normalnoindent
+ \let\indent \normalindent
\let\leavevmode \normalleavevmode
\let\par \normalpar}
\def\showimplicits
{\testrulewidth \defaulttestrulewidth
- \let\noindent \rulednoindent
- \let\indent \ruledindent
+ \let\noindent \rulednoindent
+ \let\indent \ruledindent
\let\leavevmode \ruledleavevmode
\let\par \ruledpar}
-%D The next few||line examples show the four cues. Keep in
+%D The next few||line examples show the four cues. Keep in
%D mind that we only see them when we explicitly open or close
-%D a paragraph.
-%D
+%D a paragraph.
+%D
%D \bgroup
%D \def\voorbeeld#1%
%D {#1Visualizing some \TeX\ primitives and Plain \TeX\
%D macros can be very instructive, at least it is to me.
%D Here we see {\tt\string#1} and {\tt\string\ruledpar} in
%D action, while {\tt\string\parindent} equals
-%D {\tt\the\parindent}.\ruledpar}
-%D
+%D {\tt\the\parindent}.\ruledpar}
+%D
%D \showimplicits
-%D
-%D \voorbeeld \indent
-%D \voorbeeld \noindent
-%D \voorbeeld \leavevmode
-%D
+%D
+%D \voorbeeld \indent
+%D \voorbeeld \noindent
+%D \voorbeeld \leavevmode
+%D
%D \parindent=60pt
-%D
-%D \voorbeeld \indent
-%D \voorbeeld \noindent
-%D \voorbeeld \leavevmode
+%D
+%D \voorbeeld \indent
+%D \voorbeeld \noindent
+%D \voorbeeld \leavevmode
%D
%D \startsmaller
-%D \voorbeeld \indent
-%D \voorbeeld \noindent
-%D \voorbeeld \leavevmode
+%D \voorbeeld \indent
+%D \voorbeeld \noindent
+%D \voorbeeld \leavevmode
%D \stopsmaller
%D \egroup
%D
-%D These examples also demonstrate the visualization of
-%D \type {\leftskip} and \type {\rightskip}. The macro
+%D These examples also demonstrate the visualization of
+%D \type {\leftskip} and \type {\rightskip}. The macro
%D \type {\nofruledbaselines} determines the number of lines
-%D shown.
+%D shown.
\newcounter\ruledbaselines
@@ -231,61 +231,63 @@
{\testrulewidth\defaulttestrulewidth
\EveryPar{\ruledbaseline}}
-%D \macros
+%D \macros
%D {showpagebuilder}
%D
%D The next tracing option probaly is only of use to me and a
-%D few \CONTEXT\ hackers.
+%D few \CONTEXT\ hackers.
\def\showpagebuilder
{\EveryPar{\doshowpagebuilder}}
\def\doshowpagebuilder
- {\strut\llap{\blue \vl
- \high{\infofont v:\the\vsize }\vl
- \high{\infofont g:\the\pagegoal }\vl
+ {\strut\llap{\blue \vl
+ \high{\infofont v:\the\vsize }\vl
+ \high{\infofont g:\the\pagegoal }\vl
\high{\infofont t:\the\pagetotal}\vl}}
-%D \macros
+%D \macros
%D {makecutbox, cuthbox, cutvbox, cutvtop}
-%D
-%D Although mainly used for marking the page, these macros can
-%D also serve local use.
-%D
+%D
+%D Although mainly used for marking the page, these macros can
+%D also serve local use.
+%D
%D \startbuffer
%D \setbox0=\vbox{a real \crlf vertical box} \makecutbox0
%D \stopbuffer
-%D
+%D
%D \typebuffer
-%D
+%D
%D This marked \type{\vbox} shows up as:
-%D
+%D
%D \startregelcorrectie
%D \haalbuffer
%D \stopregelcorrectie
-%D
+%D
%D The alternative macros are used as:
-%D
+%D
%D \startbuffer
%D \cuthbox{a made cut box}
%D \stopbuffer
-%D
+%D
%D \typebuffer
-%D
+%D
%D This is typeset as:
-%D
+%D
%D \startregelcorrectie
%D \haalbuffer
%D \stopregelcorrectie
-%D
+%D
%D By setting the next macros one can influence the length of
-%D the marks as well as the horizontal and vertical divisions.
+%D the marks as well as the horizontal and vertical divisions.
\def\cutmarklength {2\bodyfontsize}
\chardef\horizontalcutmarks = 2
\chardef\verticalcutmarks = 2
\chardef\cutmarkoffset = 1
\let\cutmarksymbol = \relax
+\let\cutmarktoptext = \empty
+\let\cutmarkbottomtext = \empty
\def\horizontalcuts
{\normalhbox to \ruledwidth
@@ -295,7 +297,7 @@
\def\verticalcuts
{\scratchdimen\ruledheight
- \advance\scratchdimen \ruleddepth
+ \advance\scratchdimen \ruleddepth
\normalvbox to \scratchdimen
{\hsize\cutmarklength
\dorecurse\verticalcutmarks
@@ -305,7 +307,7 @@
\def\baselinecuts
{\ifdim\ruleddepth>\zeropoint
\scratchdimen\ruledheight
- \advance\scratchdimen \ruleddepth
+ \advance\scratchdimen \ruleddepth
\normalvbox to \scratchdimen
{\scratchdimen\cutmarklength
\divide\scratchdimen 2
@@ -315,20 +317,94 @@
\normalvskip\zeropoint\!!plus\ruleddepth}%
\fi}
-\def\cutmarksymbols
- {\setbox\scratchbox\normalvbox to \cutmarklength
- {\normalvfill
- \normalhbox to \cutmarklength
- {\normalhfill\ssxx\cutmarksymbol\normalhfill}%
- \normalvfill}%
- \normalhbox to \ruledwidth
- {\scratchdimen\cutmarklength
- \divide\scratchdimen 2
- \llap{\copy\scratchbox\normalhskip\cutmarkoffset\scratchdimen}%
- \normalhfill
- \rlap{\normalhskip\cutmarkoffset\scratchdimen\copy\scratchbox}}}
-
-\def\makecutbox#1%
+% \def\cutmarksymbols
+% {\setbox\scratchbox\normalvbox to \cutmarklength
+% {\normalvfill
+% \normalhbox to \cutmarklength
+% {\normalhfill\ssxx\cutmarksymbol\normalhfill}%
+% \normalvfill}%
+% \normalhbox to \ruledwidth
+% {\scratchdimen\cutmarklength
+% \divide\scratchdimen 2
+% \llap{\copy\scratchbox\normalhskip\cutmarkoffset\scratchdimen}%
+% \normalhfill
+% \rlap{\normalhskip\cutmarkoffset\scratchdimen\copy\scratchbox}}}
+
+\def\cutmarksymbols#1%
+ {\normalhbox to \ruledwidth
+ {\setbox\scratchbox\normalhbox to \cutmarklength
+ {\normalhss\infofont\cutmarksymbol\normalhss}%
+ \normalhss
+ \normalvbox to \cutmarklength
+ {\scratchdimen\cutmarklength
+ \divide\scratchdimen \plustwo
+ \normalvss
+ \hbox to \ruledwidth
+ {\llap{\copy\scratchbox\normalhskip\cutmarkoffset\scratchdimen}%
+ \normalhskip\scratchdimen\hss\infofont#1\hss\normalhskip\scratchdimen
+ \rlap{\normalhskip\cutmarkoffset\scratchdimen\copy\scratchbox}}%
+ \normalvss}%
+ \normalhss}}
+
+% \def\makecutbox#1%
+% {\edef\ruledheight{\the\ht#1}%
+% \edef\ruleddepth {\the\dp#1}%
+% \edef\ruledwidth {\the\wd#1}%
+% \setbox#1\normalhbox
+% {\dontcomplain
+% \forgetall
+% \boxmaxdepth\maxdimen
+% \offinterlineskip
+% \scratchdimen\cutmarklength
+% \divide\scratchdimen 2
+% \hsize\ruledwidth
+% \setbox\scratchbox\normalvbox
+% {\setbox\scratchbox\normalhbox{\horizontalcuts}%
+% \normalvskip-\cutmarkoffset\scratchdimen
+% \normalvskip-2\scratchdimen
+% \copy\scratchbox
+% \normalvskip\cutmarkoffset\scratchdimen
+% \hbox to \ruledwidth
+% {\setbox\scratchbox\normalhbox{\verticalcuts}%
+% \llap{\copy\scratchbox\normalhskip\cutmarkoffset\scratchdimen}%
+% \bgroup
+% \setbox\scratchbox\normalhbox{\baselinecuts}%
+% \llap{\copy\scratchbox\normalhskip\cutmarkoffset\scratchdimen}%
+% \normalhfill
+% \rlap{\normalhskip\cutmarkoffset\scratchdimen\copy\scratchbox}%
+% \egroup
+% \rlap{\normalhskip\cutmarkoffset\scratchdimen\copy\scratchbox}}%
+% \normalvskip\cutmarkoffset\scratchdimen
+% \copy\scratchbox}%
+% \ht\scratchbox\ruledheight
+% \dp\scratchbox\ruleddepth
+% \wd\scratchbox\zeropoint
+% \resetcolorseparation
+% \localstartcolor[\defaulttextcolor]%
+% \box\scratchbox
+% \ifx\cutmarksymbol\relax \else
+% \setbox\scratchbox\normalvbox
+% {\setbox\scratchbox\normalhbox{\cutmarksymbols}%
+% \vskip-\cutmarkoffset\scratchdimen
+% \vskip-\cutmarklength
+% \copy\scratchbox
+% \vskip\cutmarkoffset\scratchdimen
+% \vskip\ruledheight
+% \vskip\ruleddepth
+% \vskip\cutmarkoffset\scratchdimen
+% \copy\scratchbox}%
+% \ht\scratchbox\ruledheight
+% \dp\scratchbox\ruleddepth
+% \wd\scratchbox\zeropoint
+% \box\scratchbox
+% \fi
+% \localstopcolor
+% \box#1}%
+% \wd#1=\ruledwidth
+% \ht#1=\ruledheight
+% \dp#1=\ruleddepth}
+
+\def\makecutbox#1% simplier with layers, todo
{\edef\ruledheight{\the\ht#1}%
\edef\ruleddepth {\the\dp#1}%
\edef\ruledwidth {\the\wd#1}%
@@ -340,7 +416,7 @@
\scratchdimen\cutmarklength
\divide\scratchdimen 2
\hsize\ruledwidth
- \setbox\scratchbox\normalvbox
+ \setbox\scratchbox\normalvbox
{\setbox\scratchbox\normalhbox{\horizontalcuts}%
\normalvskip-\cutmarkoffset\scratchdimen
\normalvskip-2\scratchdimen
@@ -365,16 +441,15 @@
\localstartcolor[\defaulttextcolor]%
\box\scratchbox
\ifx\cutmarksymbol\relax \else
- \setbox\scratchbox\normalvbox
- {\setbox\scratchbox\normalhbox{\cutmarksymbols}%
- \vskip-\cutmarkoffset\scratchdimen
+ \setbox\scratchbox\normalvbox
+ {\vskip-\cutmarkoffset\scratchdimen
\vskip-\cutmarklength
- \copy\scratchbox
+ \normalhbox{\cutmarksymbols\cutmarktoptext}%
\vskip\cutmarkoffset\scratchdimen
\vskip\ruledheight
\vskip\ruleddepth
\vskip\cutmarkoffset\scratchdimen
- \copy\scratchbox}%
+ \normalhbox{\cutmarksymbols\cutmarkbottomtext}}%
\ht\scratchbox\ruledheight
\dp\scratchbox\ruleddepth
\wd\scratchbox\zeropoint
@@ -401,7 +476,7 @@
%D \macros
%D {colormarkbox,rastermarkbox}
%D
-%D This macro is used in the pagebody routine. No other use
+%D This macro is used in the pagebody routine. No other use
%D is advocated here.
%D
%D \starttypen
@@ -415,32 +490,32 @@
{\vbox
{\scratchdimen-\colormarklength
\multiply\scratchdimen 4
- \advance\scratchdimen \ruledheight
+ \advance\scratchdimen \ruledheight
\advance\scratchdimen \ruleddepth
\divide\scratchdimen 21
\def\docommando##1%
{\vbox
{\hsize3em % \scratchdimen
- \definecolor
+ \definecolor
[\s!dummy]
- [\c!c=#2##1\else0\fi,
+ [\c!c=#2##1\else0\fi,
\c!m=#3##1\else0\fi,
\c!y=#4##1\else0\fi,
\c!k=0]%
\localstartcolor[\s!dummy]%
- \hrule
- \!!width 3em
- \!!height \scratchdimen
+ \hrule
+ \!!width 3em
+ \!!height \scratchdimen
\!!depth \zeropoint
\localstopcolor
\ifdim\scratchdimen>1ex
- \vskip-\scratchdimen
- \vbox to \scratchdimen
- {\vss
- \hbox to 3em
+ \vskip-\scratchdimen
+ \vbox to \scratchdimen
+ {\vss
+ \hbox to 3em
{\hss
\localstartcolor[white]%
- \ifdim##1\s!pt=\zeropoint#1\else##1\fi
+ \ifdim##1\points=\zeropoint#1\else##1\fi
\localstopcolor
\hss}%
\vss}%
@@ -455,26 +530,26 @@
\advance\scratchdimen \ruledwidth
\divide\scratchdimen 11
\def\docommando ##1 ##2 ##3##4##5##6%
- {\definecolor
+ {\definecolor
[\s!dummy]
[\c!c=##3##2\else0\fi,
\c!m=##4##2\else0\fi,
\c!y=##5##2\else0\fi,
\c!k=##6##2\else0\fi]%
\localstartcolor[\s!dummy]%
- \vrule
- \!!width \scratchdimen
+ \vrule
+ \!!width \scratchdimen
\!!height \colormarklength
\!!depth \zeropoint
\localstopcolor
- \ifdim\scratchdimen>2em
- \hskip-\scratchdimen
+ \ifdim\scratchdimen>2em
+ \hskip-\scratchdimen
\vbox to \colormarklength
- {\vss
+ {\vss
\hbox to \scratchdimen
{\hss
\localstartcolor[white]%
- \ifdim##2\s!pt=.5\s!pt##2~\fi##1%
+ \ifdim##2\points=.5\points##2~\fi##1%
\localstopcolor
\hss}
\vss}%
@@ -501,13 +576,13 @@
\def\docommando##1%
{\definecolor[\s!dummy][\c!s=##1]%
\localstartcolor[\s!dummy]%
- \vrule
- \!!width \scratchdimen
+ \vrule
+ \!!width \scratchdimen
\!!height \colormarklength
\!!depth \zeropoint
\localstopcolor
\ifdim\scratchdimen>2em
- \hskip-\scratchdimen
+ \hskip-\scratchdimen
\vbox to \colormarklength
{\vss
\localstartcolor[white]%
@@ -528,19 +603,19 @@
\divide\scratchdimen 2
\forgetall
\ssxx
- \setbox\scratchbox\vbox
+ \setbox\scratchbox\vbox
{\offinterlineskip
\vskip-\colormarkoffset\scratchdimen
- \vskip-2\scratchdimen\relax % relax needed
+ \vskip-2\scratchdimen\relax % relax needed
% beware: no \ifcase, due to nested \iftrue/\iffalse
- % and lacking \fi's
- \doifelse{#1}{0}%
+ % and lacking \fi's
+ \doifelse{#1}{0}%
{\vskip\colormarklength
\vskip\colormarkoffset\scratchdimen
- \vskip\ruledheight}
+ \vskip\ruledheight}
{\hbox to \ruledwidth{\hss\hbox{\colorrangeB}\hss}%
\vskip\colormarkoffset\scratchdimen
- \vbox to \ruledheight
+ \vbox to \ruledheight
{\vss
\hbox to \ruledwidth
{\llap{\colorrangeA C\iftrue\iffalse\iffalse\hskip\colormarkoffset\scratchdimen}%
@@ -548,7 +623,7 @@
\rlap{\hskip\colormarkoffset\scratchdimen\colorrangeA R\iffalse\iftrue\iftrue}}%
\vss
\hbox to \ruledwidth
- {\llap{\colorrangeA M\iffalse\iftrue\iffalse\hskip\colormarkoffset\scratchdimen}%
+ {\llap{\colorrangeA M\iffalse\iftrue\iffalse\hskip\colormarkoffset\scratchdimen}%
\hfill
\rlap{\hskip\colormarkoffset\scratchdimen\colorrangeA G\iftrue\iffalse\iftrue}}%
\vss
@@ -556,7 +631,7 @@
{\llap{\colorrangeA Y\iffalse\iffalse\iftrue\hskip\colormarkoffset\scratchdimen}%
\hfill
\rlap{\hskip\colormarkoffset\scratchdimen\colorrangeA B\iftrue\iftrue\iffalse}}%
- \vss}}%
+ \vss}}%
\vskip\colormarkoffset\scratchdimen
\hbox to \ruledwidth
{\hss\lower\ruleddepth\hbox{\colorrangeC}\hss}}%
@@ -569,32 +644,32 @@
\ht#2=\ruledheight
\dp#2=\ruleddepth}
-\def\colormarkbox % #1
+\def\colormarkbox % #1
{\ifincolor\@EA\docolormarkbox\else\@EA\gobbletwoarguments\fi1}
-\def\rastermarkbox % #1
+\def\rastermarkbox % #1
{\ifincolor\@EA\docolormarkbox\else\@EA\gobbletwoarguments\fi0}
%D \macros
%D {showwhatsits, dontshowwhatsits}
%D
-%D \TEX\ has three so called whatsits: \type {\mark}, \type
-%D {\write} and \type {\special}. The first one keeps track of
-%D the current state at page boundaries, the last two are used
-%D to communicate to the outside world. Due to fact that
-%D especially \type {\write} is often used in conjunction with
-%D \type {\edef}, we can only savely support that one in \ETEX.
+%D \TEX\ has three so called whatsits: \type {\mark}, \type
+%D {\write} and \type {\special}. The first one keeps track of
+%D the current state at page boundaries, the last two are used
+%D to communicate to the outside world. Due to fact that
+%D especially \type {\write} is often used in conjunction with
+%D \type {\edef}, we can only savely support that one in \ETEX.
%D
%D \bgroup \showwhatsits \stelkleurenin[status=start]
-%D
-%D Whatsits show up \color[blue]{in color} and are
+%D
+%D Whatsits show up \color[blue]{in color} and are
%D characterized bij their first character.\voetnoot [some note]
-%D {So we may encounter \type {w}, \type {m} and \type{s}.}
+%D {So we may encounter \type {w}, \type {m} and \type{s}.}
%D They are \writestatus{dummy}{demo}\color[yellow]{stacked}.
-%D
+%D
%D \egroup
-\newif\ifimmediatewrite
+\newif\ifimmediatewrite
\ifx\eTeXversion\undefined
@@ -614,9 +689,9 @@
\let\immediate\immediatewhatsit
\appendtoks\dontshowwhatsits\to\everystoptext}
- \def\immediatewhatsit
+ \def\immediatewhatsit
{\bgroup\futurelet\next\doimmediatewhatsit}
-
+
\def\doimmediatewhatsit
{\ifx\next\write
\egroup\immediatewritetrue
@@ -626,10 +701,10 @@
\def\dontshowwhatsits
{\let\immediate \normalimmediate
- \let\normalmark\supernormalmark
+ \let\normalmark\supernormalmark
\let\special \normalspecial
\let\write \normalwrite}
-
+
\def\visualwhatsit#1#2#3#4#5%
{\bgroup
\pushwhatsit
@@ -653,7 +728,7 @@
\else
\setbox\scratchbox\hbox
{\raise#4\scratchdimen\box\scratchbox}%
- \fi
+ \fi
\smashbox\scratchbox
\ifdone\nointerlineskip\fi
\box\scratchbox
@@ -678,7 +753,7 @@
\ifhmode
\edef\popwhatsit{\kern\the\lastkern}\unkern
\else
- \edef\popwhatsit{\kern\the\lastkern\prevdepth\the\prevdepth}
+ \edef\popwhatsit{\kern\the\lastkern\prevdepth\the\prevdepth}
\kern-\lastkern
\fi
\fi
@@ -695,17 +770,17 @@
\ifhmode
\edef\popwhatsit{\hskip\the\lastskip}\unskip
\else
- \edef\popwhatsit{\vskip\the\lastskip\prevdepth\the\prevdepth}
+ \edef\popwhatsit{\vskip\the\lastskip\prevdepth\the\prevdepth}
\vskip-\lastskip
\fi
\fi}
\fi
-%D The next macro can be used to keep track of classes of
-%D boxes (handy for development cq.\ tracing).
+%D The next macro can be used to keep track of classes of
+%D boxes (handy for development cq.\ tracing).
-\def\dodotagbox#1#2#3% can be reimplemented
+\def\dodotagbox#1#2#3% can be reimplemented
{\def\next##1##2##3##4%
{\vbox to \ht#2{##3\hbox to \wd#2{##1#3##2}##4}}%
\processaction
@@ -730,12 +805,12 @@
\dowithnextbox
{\setbox\scratchbox\flushnextbox
\setbox\nextbox\ifhbox\nextbox\hbox\else\vbox\fi
- \bgroup
+ \bgroup
\startoverlay
{\copy\scratchbox}
{\dodotagbox{#1}\scratchbox{\framed
[\c!achtergrond=\v!raster,\c!achtergrondraster=1]{#2}}}
- \stopoverlay
+ \stopoverlay
\egroup
\nextboxwd\the\wd\scratchbox
\nextboxht\the\ht\scratchbox
@@ -746,4 +821,30 @@
\def\tagbox
{\dosingleempty\dotagbox}
-\protect \endinput
+%D \macros
+%D {coloredhbox,coloredvbox,coloredvtop,
+%D coloredstrut}
+%D
+%D The following visualizations are used in some of the manuals:
+
+\definecolor[boxcolor:ht][r=.5,g=.75,b=.5]
+\definecolor[boxcolor:dp][r=.5,g=.5,b=.75]
+\definecolor[boxcolor:wd][r=.75,g=.5,b=.5]
+\definecolor[strutcolor] [r=.5,g=.25,b=.25]
+
+\def\coloredbox#1%
+ {\dowithnextbox{#1{\hbox
+ {\blackrule[\c!breedte=\nextboxwd,\c!hoogte=\nextboxht,\c!diepte=\zeropoint,\c!kleur=boxcolor:ht]%
+ \hskip-\nextboxwd
+ \blackrule[\c!breedte=\nextboxwd,\c!hoogte=\zeropoint,\c!diepte=\nextboxdp,\c!kleur=boxcolor:dp]%
+ \hskip-\nextboxwd
+ \box\nextbox}}}#1}
+
+\def\coloredhbox{\coloredbox\hbox}
+\def\coloredvbox{\coloredbox\vbox}
+\def\coloredvtop{\coloredbox\vtop}
+
+\def\coloredstrut
+ {\color[strutcolor]{\def\strutwidth{2pt}\setstrut\strut}}
+
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/enco-ec.tex b/tex/context/base/enco-ec.tex
index f202b4c99..a31fb6fe1 100644
--- a/tex/context/base/enco-ec.tex
+++ b/tex/context/base/enco-ec.tex
@@ -3,7 +3,7 @@
%D version=2000.05.07, % 1999.16.07,
%D title=\CONTEXT\ Encoding Macros,
%D subtitle=\LATEX\ EC Encoding,
-%D author={Patrick Gundlach, Hans Hagen, Taco Hoekwater},
+%D author={Patrick Gundlach, Hans Hagen, Taco Hoekwater},
%D date=\currentdate,
%D copyright=PRAGMA-ADE]
%C
@@ -41,10 +41,10 @@
%D So far for the mapping.
-%D The following characters are kind of dangerous,
-%D that is, they are normally not part of fonts, unless
-%D explicitly constructed.
-%D
+%D The following characters are kind of dangerous,
+%D that is, they are normally not part of fonts, unless
+%D explicitly constructed.
+%D
%D \startopsomming[columns,two]
%D \som \type{\dotlessj}
%D \som \type{\IJligature}
@@ -53,18 +53,18 @@
%D \som \type{\perthousand}
%D \som \type{\compoundwordmark}
% %D \som \type{\textvisiblespace}
-% %D \som \type{\tcaron}
+% %D \som \type{\tcaron}
% %D \som \type{\tcedilla }
% %D \som \type{\Tcedilla}
% %D \som \type{\ydiaeresis}
%D \stopopsomming
-%D So, for the moment we nil them; we can always create
-%D another vector if needed.
+%D So, for the moment we nil them; we can always create
+%D another vector if needed.
\stopmapping
-\startencoding[ec][ec] % second arg defines auto regime, needed here ?
+\startencoding[ec][ec] % second arg defines auto regime, needed here ?
\definecharacter textacute 1
\definecharacter textbreve 8
@@ -113,12 +113,12 @@
%definecharacter perthousand 24
\definecharacter softhyphen 127 % ?
-%definecharacter compoundwordmark 23
+%definecharacter compoundwordmark 23
\definecharacter textasciicircum 94
\definecharacter textasciitilde 126
\definecharacter textbackslash 92
-\definecharacter textbraceleft 123
+\definecharacter textbraceleft 123
\definecharacter textbraceright 125
\definecharacter textunderscore 95
%definecharacter textvisiblespace 32
@@ -128,7 +128,7 @@
\definecharacter quotedblleft 16
\definecharacter quotedblright 17
-\definecharacter quotesingle 17 % fake 'm
+\definecharacter quotesingle 39 % fake 'm
\definecharacter quotesinglebase 13
\definecharacter quoteleft 96
diff --git a/tex/context/base/enco-ini.tex b/tex/context/base/enco-ini.tex
index cf03888b3..70dd8836c 100644
--- a/tex/context/base/enco-ini.tex
+++ b/tex/context/base/enco-ini.tex
@@ -8,29 +8,29 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
%D This module is a reimplementation of the module that handled
%D composed characters and non \ASCII\ characters. The changed
%D are not that fundamental, and mainly concerns moving
%D definitions of specific glyphs and accents to other files as
%D well as moving plain handling of accents to this module
-%D instead of overloading plain \TEX\ commands.
+%D instead of overloading plain \TEX\ commands.
% \everyuppercase
% \dotlessi
-% single/double quotes
-% hyphens
-% characterencoding => encoding
-% charactermapping => mapping
+% single/double quotes
+% hyphens
+% characterencoding => encoding
+% charactermapping => mapping
%D Most of this module used to be part of the font and language
%D modules. While implementing Czech support, I decided to
%D isolate this code.
-%D Patterns are kind of mixed with font encodings and
-%D mappings. Alas.
+%D Patterns are kind of mixed with font encodings and
+%D mappings. Alas.
\ifx\synchronizepatterns\undefined \let\synchronizepatterns\relax \fi
@@ -47,11 +47,11 @@
%D \som When changing case, characters are mapped onto
%D themselves, their case||counterpart or a reasonable
%D alternative, like~\"e onto~e.
-%D \som Single character representations in a \DVI\ file can
+%D \som Single character representations in a \DVI\ file can
%D be mapped onto one or more characters, either of not
%D in more than one font file (virtual fonts).
-%D \som In the final format, fonts collections can be
-%D partially embedded, thereby losing the one||to||one
+%D \som In the final format, fonts collections can be
+%D partially embedded, thereby losing the one||to||one
%D relation between several instances of one font.
%D \som For special purposes, individual characters should be
%D mapped onto a dedicated encoding vector, for instance
@@ -64,7 +64,7 @@
\writestatus{loading}{Context Encoding Macros (ini)}
-\unprotect
+\unprotect
\startmessages dutch library: encodings
title: encoding
@@ -115,52 +115,52 @@
3: codificarea -- este necunoscuta
\stopmessages
-%D First we define a few local or not yet initialized constants.
+%D First we define a few local or not yet initialized constants.
-\def\@map@{@m@ap@} % mapping prefix
-\def\@reg@{@r@eg@} % regime prefix
-\def\@fha@{@f@ha@} % font prefix
+\def\@map@{@m@ap@} % mapping prefix
+\def\@reg@{@r@eg@} % regime prefix
+\def\@fha@{@f@ha@} % font prefix
\ifx\currentlanguage\undefined \let\currentlanguage\s!en \fi
%D \macros
%D {protectregime}
%D
-%D The next boolean is used later on to prevent unwanted
-%D catcode changes. Use it with care.
+%D The next boolean is used later on to prevent unwanted
+%D catcode changes. Use it with care.
\newif\ifprotectregime \protectregimetrue
\def\setregimecode#1#2%
{\ifprotectregime\ifnum\catcode#1=\active\else
\catcode#1=#2%\relax
- \fi\else
+ \fi\else
\catcode#1=#2%\relax
\fi
\relax}
-%D \macros
+%D \macros
%D {startregime, enableregime}
%D
-%D Sometimes it makes sense to activate the characters in the
-%D upper half of the character table. Such a bundle of
+%D Sometimes it makes sense to activate the characters in the
+%D upper half of the character table. Such a bundle of
%D characters can be packages in a regime. Later we will see
-%D encodings (that links characters slots to glyphs) and
-%D mappings (that take care of hyphenation and case changes).
+%D encodings (that links characters slots to glyphs) and
+%D mappings (that take care of hyphenation and case changes).
%D
-%D When character~231 is of category code letter, it
-%D directly maps to glyph~231 (unless of course some virtual
+%D When character~231 is of category code letter, it
+%D directly maps to glyph~231 (unless of course some virtual
%D font is used). By making character~231 active, we can map
-%D it onto for instance the glyph in slot 233. This mapping
-%D can in itself be indirect, in the sense that it is for
-%D instance handled by an accent command.
+%D it onto for instance the glyph in slot 233. This mapping
+%D can in itself be indirect, in the sense that it is for
+%D instance handled by an accent command.
%D
%D Regimes are implemented roughly the same as mappings, but
-%D enabled under different circumstances. In the future, the
-%D low level implementation may change.
+%D enabled under different circumstances. In the future, the
+%D low level implementation may change.
\def\startregime[#1]%
- {\localpushmacro\characterregime
+ {\pushmacro\characterregime
\edef\characterregime{@#1@}%
\checkregimetoks}
@@ -169,7 +169,7 @@
{\@EA\newtoks\csname\@reg@\characterregime\endcsname}}
\def\stopregime
- {\localpopmacro\characterregime}
+ {\popmacro\characterregime}
%\long\def\startregime[#1]#2\stopregime{}
@@ -177,7 +177,7 @@
{\checkregimetoks
\@EA\let\@EA\regimetoks\csname\@reg@\characterregime\endcsname}
-\let\enabledregime\empty
+\let\enabledregime\empty
\def\enableregime[#1]%
{\edef\characterregime{@#1@}%
@@ -187,34 +187,34 @@
\let\enabledregime\characterregime
\fi}
-%D \macros
-%D {defineactivedecimal, defineactivedecimals, defineactivetoken}
+%D \macros
+%D {defineactivedecimal, defineactivedecimals, defineactivetoken}
%D
%D The following commands are rather ugly ones. It makes a
-%D character active and assigns it a value. When expanded,
-%D the decimal number of the character is passed as first
-%D argument.
+%D character active and assigns it a value. When expanded,
+%D the decimal number of the character is passed as first
+%D argument.
%D
-%D \starttypen
+%D \starttypen
%D \def\decimalcharacter#1{\message{#1 is now active}}
%D
%D \defineactivedecimal 122 {\decimalcharacter}
%D
%D \defineactivedecimals 128 to 255 as {\decimalcharacter}
-%D \stoptypen
+%D \stoptypen
%D
-%D This command is typically used in coding definitions,
-%D like the \UNICODE\ one.
+%D This command is typically used in coding definitions,
+%D like the \UNICODE\ one.
-%\def\dodefineactivedecimal#1#2% \unexpanded ? pdfdoc encoding
+%\def\dodefineactivedecimal#1#2% \unexpanded ? pdfdoc encoding
% {\catcode#1=\active % maybe \protectregimetrue
% \scratchcounter=\the\uccode`~
% \uccode`~=#1\relax
% \uppercase{\unexpanded\edef~{\noexpand#2{\number#1}}}%
% \uccode`~=\scratchcounter}
-\def\dodefineactivedecimal#1#2% \unexpanded ? pdfdoc encoding
- {\catcode#1\active
+\def\dodefineactivedecimal#1#2% \unexpanded ? pdfdoc encoding
+ {\catcode#1\active
\scratchcounter\uccode\activehackcode
\uccode\activehackcode#1\relax
\uppercase{\unexpanded\edef~{\noexpand#2{\number#1}}}%
@@ -229,7 +229,7 @@
\dostepwiserecurse{#1}{#2}\plusone
{\@EA\appendtoks\@EA\dodefineactivedecimal\@EA{\recurselevel}{#3}\to\regimetoks}}
-% \long\def\defineactivetoken #1 #2% watch the {}
+% \long\def\defineactivetoken #1 #2% watch the {}
% {\setregimetoks
% \appendtoks\defineactivecharacter#1 {#2{}}\to\regimetoks}
@@ -237,20 +237,20 @@
{\setregimetoks
\appendtoks\defineactivecharacter#1 {#2}\to\regimetoks}
-\long\def\defineactiveinspector #1 #2% watch the missing {}
+\long\def\defineactiveinspector #1 #2% watch the missing {}
{\setregimetoks
\appendtoks\defineactivecharacter#1 {#2}\to\regimetoks}
%D ....
-
+
\edef\nocharacterregime{@\s!default @}
-\def\definetoken #1 % #1 = rawtoken or number
+\def\definetoken #1 % #1 = rawtoken or number
{\doifnumberelse{\string#1}
{\expanded{\dodefinetoken{\rawcharacter{#1}}}}
{\expanded{\dodefinetoken{\string#1}}}}
-\def\dodefinetoken#1#2%
+\def\dodefinetoken#1#2%
{\defineactivecharacter#1 {\dohandletoken{#1}} %
\setvalue{\characterregime#1}{#2}}
@@ -270,20 +270,20 @@
\endETEX
-%D ....
+%D ....
\def\doautosetregime#1#2%
{\ifnum#2>127
-% \def\!!stringa{#2 }%
-% \@EA\@EA\@EA\defineactivetoken\@EA\!!stringa\@EA{\csname#1\endcsname}%
-\expanded{\defineactivetoken #2 \@EA\noexpand\csname#1\endcsname}%
+ % \def\!!stringa{#2 }%
+ % \@EA\@EA\@EA\defineactivetoken\@EA\!!stringa\@EA{\csname#1\endcsname}%
+ \expanded{\defineactivetoken #2 \@EA\noexpand\csname#1\endcsname}%
\fi}
-%D \macros
+%D \macros
%D {setupencoding}
%D
-%D The following setup command is used to tune encoding
-%D handling.
+%D The following setup command is used to tune encoding
+%D handling.
\def\setupencoding
{\dosingleargument\dosetupencoding}
@@ -293,11 +293,11 @@
\edef\defaultencoding
{\ifx\@@ecdefault\empty\s!default\else\@@ecdefault\fi}}
-%D \macros
+%D \macros
%D {useencoding}
%D
-%D Encodings things are defined in separate files and are
-%D loaded only once, using:
+%D Encodings things are defined in separate files and are
+%D loaded only once, using:
%D
%D \showsetup{\y!useencoding}
@@ -324,17 +324,17 @@
%D
%D \starttypen
%D \startmapping [something]
-%D \definecasemap 165 181 165
-%D \definecasemap 171 187 171
+%D \definecasemap 165 181 165
+%D \definecasemap 171 187 171
%D ...
-%D \defineuppercasecom \i {I}
-%D \defineuppercasecom \l \L
+%D \defineuppercasecom \i {I}
+%D \defineuppercasecom \l \L
%D \definelowercasecom \AE \ae
%D ...
%D \stopmapping
%D \stoptypen
%D
-%D So, character 165 becomes 181 in uppercase and 165 in
+%D So, character 165 becomes 181 in uppercase and 165 in
%D lowercase. A mapping is activated with \type {\enablemapping}.
\def\startmapping[#1]%
@@ -356,10 +356,10 @@
{\appendtoks\setcasemap #1 #2 #3 \to\mappingtoks}%
\ignorespaces}
-%D Watch the \type {\definecasemap 127 to 255} option!
-%D Dedicated to Taco there is also:
+%D Watch the \type {\definecasemap 127 to 255} option!
+%D Dedicated to Taco there is also:
-\def\definecasemaps #1 to #2 lc #3 uc #4 % from to lc+ uc+
+\def\definecasemaps #1 to #2 lc #3 uc #4 % from to lc+ uc+
{\dostepwiserecurse{#1}{#2}{1}
{\!!counta\recurselevel\advance\!!counta #3\relax
\!!countb\recurselevel\advance\!!countb #4\relax
@@ -367,15 +367,15 @@
\recurselevel\space\the\!!counta\space\the\!!countb\space}}%
\ignorespaces}
-%D This can be used like:
+%D This can be used like:
%D
-%D \starttypen
-%D \definecasemaps 128 to 156 lc 32 uc 0
-%D \definecasemaps 160 to 188 lc -32 uc 0
-%D \definecasemaps 192 to 255 lc 32 uc 0
-%D \stoptypen
+%D \starttypen
+%D \definecasemaps 128 to 156 lc 32 uc 0
+%D \definecasemaps 160 to 188 lc -32 uc 0
+%D \definecasemaps 192 to 255 lc 32 uc 0
+%D \stoptypen
%D
-%D and saves a lot of typing (copying).
+%D and saves a lot of typing (copying).
% \def\resetcaserange #1 to #2
% {\dostepwiserecurse{#1}{#2}{1}
@@ -384,7 +384,7 @@
\def\resetcaserange #1 to #2
{\setmappingtoks
\dostepwiserecurse{#1}{#2}\plusone
- {\edef\@@expanded{\recurselevel\space}%
+ {\edef\@@expanded{\recurselevel\space}%
\@EA\appendtoks\@EA\setcasemap\@@expanded 0 0 \to\mappingtoks}%
\ignorespaces}
@@ -396,7 +396,7 @@
\def\setcasemap #1 #2 #3 %
{\setregimecode{#1}\@@letter
- \lccode #1=#2
+ \lccode #1=#2
\uccode #1=#3 }
\def\definespacemap #1 #2 % code sfcode
@@ -407,15 +407,15 @@
\def\setspacemap #1 #2 %
{\setregimecode{#1}\@@other
\lccode #1=\zerocount
- \uccode #1=\zerocount
- \sfcode #1=#2 }
+ \uccode #1=\zerocount
+ \sfcode #1=#2 }
-\def\defineuppercasecom#1#2%
+\def\defineuppercasecom#1#2%
{\setmappingtoks
\appendtoks\setuppercasecom#1{#2}\to\mappingtoks
\ignorespaces}
-\def\definelowercasecom#1#2%
+\def\definelowercasecom#1#2%
{\setmappingtoks
\appendtoks\setlowercasecom#1{#2}\to\mappingtoks
\ignorespaces}
@@ -433,12 +433,12 @@
\doifdefined{\@map@\charactermapping}
{\the\csname\@map@\charactermapping\endcsname}%
\edef\enabledmapping{\charactermapping}%
- \enablelanguagespecifics[\currentlanguage]% new
- % \edef\enabledmapping{\charactermapping\currentlanguage}% can be comma list
+ \enablelanguagespecifics[\currentlanguage]% new
+ % \edef\enabledmapping{\charactermapping\currentlanguage}% can be comma list
\fi
\synchronizepatterns}
-% on behalf of font switching:
+% on behalf of font switching:
\def\fastenablemapping#1%
{\edef\charactermapping{@#1@}%
@@ -447,10 +447,10 @@
\the\csname\@map@\charactermapping\endcsname
\fi
\let\enabledmapping\charactermapping
- \enablelanguagespecifics[\currentlanguage]% to faster
+ \enablelanguagespecifics[\currentlanguage]% to faster
\fi}
-%D This macro wil be implemented in \type {lang-ini.tex}.
+%D This macro wil be implemented in \type {lang-ini.tex}.
\ifx\enablelanguagespecifics\undefined
\def\enablelanguagespecifics[#1]{}
@@ -551,7 +551,7 @@
\edef\charactermapping {@\s!default @}
\edef\characterregime {@\s!default @}
-% todo, else \d j == \dj, print file and check
+% todo, else \d j == \dj, print file and check
\def\accentprefix {}%{*}
\def\commandprefix {}%{=}
@@ -563,21 +563,21 @@
%D Before we can redefine accents and special characters, we
%D have to tell \CONTEXT\ what encoding is in force. The next
%D command is responsible for doing this and also takes care of
-%D the definition of the recoding commands. We use the \type
-%D {\start}||\type {\stop}||commands for definitions and the
-%D \type {\reduceto}||command for local switching to
-%D simplified commands.
+%D the definition of the recoding commands. We use the \type
+%D {\start}||\type {\stop}||commands for definitions and the
+%D \type {\reduceto}||command for local switching to
+%D simplified commands.
-% etex : \ifcsname
+% etex : \ifcsname
-\def\justhandleaccent#1#2% \empty makes #2={} save % no \unexpanded
- {\ifundefined{\accentprefix\characterencoding#1\string#2\empty}%
+\def\justhandleaccent#1#2% \empty makes #2={} save % no \unexpanded
+ {\ifundefined{\accentprefix\characterencoding#1\string#2\empty}%
#2%
\else
\csname\accentprefix\characterencoding#1\string#2\empty\endcsname
\fi}
-\def\justhandlecommand#1% % no \unexpanded, otherwise pdfdoc will fail
+\def\justhandlecommand#1% % no \unexpanded, otherwise pdfdoc will fail
{\ifundefined{\commandprefix\characterencoding#1}% as well as hyph patterns
#1%
\else
@@ -587,14 +587,14 @@
\def\enableencoding
{\dodoubleempty\doenableencoding}
-\def\doenableencoding[#1][#2]% main fallback
+\def\doenableencoding[#1][#2]% main fallback
{\iffirstargument\edef\characterencoding{@#1@}\fi
\edef\nocharacterencoding{@\ifsecondargument#2\else\s!default\fi @}%
\synchronizepatterns}
%\def\enablesimpleencoding#1% e.g. \enableencoding{raw}
-% {\edef\characterencoding{@#1@}% handy for XML key=val's
-% \edef\nocharacterencoding{@\s!default @}} % evt noppes
+% {\edef\characterencoding{@#1@}% handy for XML key=val's
+% \edef\nocharacterencoding{@\s!default @}} % evt noppes
% in font switch and xml simple k/v remapping
@@ -607,7 +607,7 @@
\def\startencoding
{\dodoubleempty\dostartencoding}
-\def\dostartencoding[#1][#2]% encoding regime
+\def\dostartencoding[#1][#2]% encoding regime
{\doifelsenothing{#1}
{\let\stopencoding\relax}
{%\protectfontcharacters % problematic in language loading
@@ -631,11 +631,11 @@
\popmacro\dohandlecommand % still needed?
\popmacro\dohandleaccent % still needed?
\enableencoding[\s!default]%
- }}}% \unprotectfontcharacters}}} % ??
+ }}}% \unprotectfontcharacters}}} % ??
-% probably obsolete (hm, not yet)
+% probably obsolete (hm, not yet)
-\def\reducetocoding[#1]% use grouped!
+\def\reducetocoding[#1]% use grouped!
{\doifsomething{#1}
{\let\dohandleaccent \justhandleaccent
\let\dohandlecommand\justhandlecommand
@@ -646,36 +646,36 @@
\def\stopcoding {\stopencoding }
\let\enablecoding \enableencoding
-%D The use of these macros are not limited to font
-%D definition files, but may also be used when loading
-%D patterns.
+%D The use of these macros are not limited to font
+%D definition files, but may also be used when loading
+%D patterns.
-%D \macros
+%D \macros
%D {definesortkey,flushsortkeys,flushsortkey}
%D
-%D Yet another definition concerns sorting of indexes and
-%D lists.
+%D Yet another definition concerns sorting of indexes and
+%D lists.
%D
%D \starttypen
-%D \definesortkey {\'e} {e} {a} {\'e}
+%D \definesortkey {\'e} {e} {a} {\'e}
%D \stoptypen
%D
-%D The first argument denotes the string to be treated. The
-%D second argument is the raw replacement, while the third
-%D argument determines the sort order given the replacement.
+%D The first argument denotes the string to be treated. The
+%D second argument is the raw replacement, while the third
+%D argument determines the sort order given the replacement.
%D The last argument is used as entry in the index (a, b, etc).
%D
-%D The keys can be flushed using \type {\flushsortkeys}
-%D which in turn results in a sequence of calls to \type
-%D {\flushsortkey}, a macro taking 4~arguments.
+%D The keys can be flushed using \type {\flushsortkeys}
+%D which in turn results in a sequence of calls to \type
+%D {\flushsortkey}, a macro taking 4~arguments.
%D
%D This mechanism is currently being tested and subjected to
-%D changes!
+%D changes!
\def\savesortkey#1#2#3#4%
- {\let\flushsortkey\relax % important
+ {\let\flushsortkey\relax % important
\edef\!!stringa{sort:\characterencoding}%
- \ifundefined\!!stringa
+ \ifundefined\!!stringa
\let\!!stringb\empty
\else
\@EA\def\@EA\!!stringb\@EA{\csname\!!stringa\endcsname}%
@@ -717,7 +717,7 @@
\beginTEX
\def\dohandleaccent#1#2%
- {\@EA\ifx\csname\accentprefix\characterencoding#1\string#2\empty\endcsname\relax
+ {\@EA\ifx\csname\accentprefix\characterencoding#1\string#2\empty\endcsname\relax
\@EA\ifx\csname\accentprefix\nocharacterencoding#1\string#2\empty\endcsname\relax
\@EA\ifx\csname\accentprefix\characterencoding#1\endcsname\relax
% \@EA\ifx\csname\accentprefix\nocharacterencoding#1\endcsname\relax
@@ -740,7 +740,7 @@
\beginETEX \ifcsname
\def\dohandleaccent#1#2%
- {\ifcsname\accentprefix\characterencoding#1\string#2\empty\endcsname
+ {\ifcsname\accentprefix\characterencoding#1\string#2\empty\endcsname
\csname\accentprefix\characterencoding#1\string#2\empty\endcsname
\else\ifcsname\accentprefix\nocharacterencoding#1\string#2\empty\endcsname
\csname\accentprefix\nocharacterencoding#1\string#2\empty\endcsname
@@ -754,8 +754,8 @@
\endETEX
-%D In patterns, characters have to be bytes. These will be
-%D mapped onto the compact pattern arrays.
+%D In patterns, characters have to be bytes. These will be
+%D mapped onto the compact pattern arrays.
\let\normaldohandleaccent\dohandleaccent
@@ -776,15 +776,15 @@
\doautosetregime{#1}{#2}}
{\setvalue{\characterprefix\characterencoding\string#1}{#2}}}
-% better
-%
+% better
+%
% \def\definecharacter#1 #2 %
% {\ifundefined{#1}\setvalue{#1}{\dohandlecharacter{#1}}\fi
% \doifnumberelse{\string#2}
% {\setevalue{\characterprefix\characterencoding\string#1}{\noexpand\charofnum{\number#2}}% watch the space
% \doautosetregime{#1}{#2}}
% {\setvalue{\characterprefix\characterencoding\string#1}{#2}}}
-%
+%
% \def\charofnum#1{\char#1 }
% \def\byteofnum#1{\rawcharacter{#1}}
@@ -813,7 +813,7 @@
{\setvalue{\string#1}{\dohandlecommand{#1}}%
%\redefinecommand #1 % just to be sure
\setvalue{\commandprefix\characterencoding\string#1}{#2}}
-
+
%D Here we see that redefining accents is characters is more
%D or less the same as redefining commands. We also could have
%D said:
@@ -824,7 +824,7 @@
%D \stoptypen
% obsolete
-%
+%
% %D \macros
% %D {redefineaccent}
% %D
@@ -852,12 +852,12 @@
% \def\redefineaccent%
% {\protectfontcharacters
% \doredefineaccent}
-%
+%
% \def\doredefineaccent#1 %
% {\def\!!stringa{\nocharacterencoding\string#1}%
% \doifundefined{\!!stringa}
% {\@EA\letvalue\@EA\!!stringa\@EA=\csname\string#1\endcsname}%
-% % no \unexpanded, else pdfdoc fails
+% % no \unexpanded, else pdfdoc fails
% \setvalue{\string#1}{\dohandleaccent#1}%
% \unprotectfontcharacters}
%
@@ -869,7 +869,7 @@
%D {defineaccentcommand}
%D
%D When needed, one can overload the default positions of the
-%D accents. The \PLAIN\ \TEX\ defaults are:
+%D accents. The \PLAIN\ \TEX\ defaults are:
%D
%D \starttypen
%D \defineaccentcommand ` 18
@@ -879,30 +879,30 @@
%D \defineaccentcommand = 22
%D \defineaccentcommand ^ 94
%D \defineaccentcommand . 95
-%D \defineaccentcommand H 125 % "7D
-%D \defineaccentcommand ~ 126 % "7E
-%D \defineaccentcommand " 127 % "7F
+%D \defineaccentcommand H 125 % "7D
+%D \defineaccentcommand ~ 126 % "7E
+%D \defineaccentcommand " 127 % "7F
%D \stoptypen
\def\defineaccentcommand
{\protectfontcharacters
\dodefineaccentcommand}
-\def\dodefineaccentcommand#1 #2 % \string toegevoegd
+\def\dodefineaccentcommand#1 #2 % \string toegevoegd
{\doifnumberelse{\string#2}
{\setvalue{\accentprefix\characterencoding\string#1}##1{{\accent#2 ##1}}}
{\setvalue{\accentprefix\characterencoding\string#1}##1{{#2##1}}}%
\unprotectfontcharacters}
-%D We don't have to define them for the default \PLAIN\ case.
-%D Commands may be used instead of character codes.
+%D We don't have to define them for the default \PLAIN\ case.
+%D Commands may be used instead of character codes.
%D \macros
%D {normalaccent,normalchar}
%D
-%D Accents are either placed by \TEX's \type {\accent}
-%D primitive, or part of the glyph. By default the former
-%D method is used, unless overruled in the encoding
+%D Accents are either placed by \TEX's \type {\accent}
+%D primitive, or part of the glyph. By default the former
+%D method is used, unless overruled in the encoding
%D definitions.
\let\normalchar =\char
@@ -923,11 +923,11 @@
% \else
% \csname\nocharacterencoding#1\endcsname#2%
% \fi\fi\fi\fi
-% \relax} % prevents further reading
+% \relax} % prevents further reading
%
% \endETEX
%
-% \beginTEX
+% \beginTEX
%
% \unexpanded\def\dohandleaccent#1#2%
% {\def\glyph{#2}%
@@ -944,16 +944,16 @@
% \else
% \csname\characterencoding#1\string#2\endcsname
% \fi\fi\fi
-% \relax} % prevents further reading
-%
+% \relax} % prevents further reading
+%
% \endTEX
%
% %D The trick with \type{\\} is needed to prevent spaces from
% %D being gobbled after the accented character, should we have
-% %D used \type{\next}, we should have ended up with gobbled
+% %D used \type{\next}, we should have ended up with gobbled
% %D spaces. The \type {\empty} after \type {#2} takes care of
-% %D empty arguments, so that we can savely say~\type{\"{}}
-% %D and alike.
+% %D empty arguments, so that we can savely say~\type{\"{}}
+% %D and alike.
%D \macros
%D {redefinecommand}
@@ -972,12 +972,12 @@
%D
%D The \type{\next} construction permits handling of commands
%D that take arguments. This means that we can use this
-%D command to redefine accent handling commands too
-%D (although today the next is not needed any longer in test
-%D macros).
+%D command to redefine accent handling commands too
+%D (although today the next is not needed any longer in test
+%D macros).
\def\redefinecommand#1 %
- {% no \unexpanded, else pdfdoc fails
+ {% no \unexpanded, else pdfdoc fails
\setvalue{\string#1}{\dohandlecommand{#1}}}%
\beginETEX \ifcsname
@@ -990,10 +990,10 @@
\nocharacterencoding
\fi
#1\endcsname}
-
+
\endETEX
-\beginTEX
+\beginTEX
\def\dohandlecommand#1%
{\csname\commandprefix
@@ -1003,7 +1003,7 @@
\characterencoding
\fi
#1\endcsname}
-
+
\endTEX
% %D \macros
@@ -1022,11 +1022,11 @@
%
% \let\redefinecharacter=\redefinecommand
-%D \macros
+%D \macros
%D {currentencoding, currentregime, currentmapping}
%D
-%D When we show 'm, we don't want to see the protection
-%D measures.
+%D When we show 'm, we don't want to see the protection
+%D measures.
\def\currentencoding{\@EA\docurrentencoding\characterencoding}
\def\currentregime {\@EA\docurrentencoding\characterregime }
@@ -1034,30 +1034,30 @@
\def\docurrentencoding @#1@{#1}
-%D \macros
-%D {showaccents, showcharacters,
+%D \macros
+%D {showaccents, showcharacters,
%D showcharacterbounds, showhyphenations}
%D
-%D Encoding is a tricky business. Therefore we provide a
+%D Encoding is a tricky business. Therefore we provide a
%D a few macros that show most of the characters involved. The
%D next two tables show the result of \type {\showaccents}.
%D
%D \plaatstabel
-%D {The special glyphs in default encoding.}
+%D {The special glyphs in default encoding.}
%D {\showaccents}
%D
%D \plaatstabel
-%D {The special glyphs in texnansi encoding.}
+%D {The special glyphs in texnansi encoding.}
%D {\switchtobodyfont[lbr]\showaccents}
%D
-%D The command
-%D
-%D \starttypen
+%D The command
+%D
+%D \starttypen
%D \showhyphenations{doordefini\"eren}
-%D \stoptypen
+%D \stoptypen
%D
-%D can be used to check the correct loading of hyphenation
-%D patterns.
+%D can be used to check the correct loading of hyphenation
+%D patterns.
\fetchruntimecommand \showaccents {\f!encodingprefix\s!run}
\fetchruntimecommand \showcharacters {\f!encodingprefix\s!run}
@@ -1079,13 +1079,13 @@
\newevery \everyuppercase \EveryUppercase
\newevery \everylowercase \EveryLowercase
-%D This magic trick maps takes care of mapping from lower to
-%D upper case and reverse.
+%D This magic trick maps takes care of mapping from lower to
+%D upper case and reverse.
\appendtoks\let\setuppercasecom\setcasecom\to\everyuppercase
\appendtoks\let\setlowercasecom\setcasecom\to\everylowercase
-\newtoks\everyULmap
+\newtoks\everyULmap
\appendtoks\let\remapcase\remapuppercase\the\everyULmap\to\everyuppercase
\appendtoks\let\remapcase\remaplowercase\the\everyULmap\to\everylowercase
@@ -1113,7 +1113,7 @@
%
% \newif\ifuppercase \appendtoks\uppercasetrue\to\everyuppercase
% \newif\iflowercase \appendtoks\lowercasetrue\to\everylowercase
-%
+%
% \def\defineULcharacter #1 #2 %
% {\def\!!stringa{@#1}\@EA\letvalue\@EA\!!stringa\csname#1\endcsname
% \def\!!stringa{@#2}\@EA\letvalue\@EA\!!stringa\csname#2\endcsname
@@ -1154,23 +1154,23 @@
\repeat
\fi}
-\fi
+\fi
-% %D \macros
+% %D \macros
% %D {cc,CC}
% %D
-% %D Hm, not in plain at all, those \cc's and \CC's.
-%
-% \def\CC{\c{C}}
-% \def\cc{\c{c}}
-%
+% %D Hm, not in plain at all, those \cc's and \CC's.
+%
+% \def\CC{\c{C}}
+% \def\cc{\c{c}}
+%
% %D \macros
% %D {dotlessi,dotlessj}
% %D
% %D We also save both dotless~\dotlessi\ and~\dotlessj. This
% %D way we still have them were we expect them, even when
% %D macros of font providers redefine them.
-%
+%
% \let\dotlessi=\i
% \let\dotlessj=\j
@@ -1178,25 +1178,25 @@
%D {defineuclass,defineudigit,udigit}
%D
%D The next few macros are experimental and needed for unicoded
-%D chinese characters.
+%D chinese characters.
\def\defineuclass #1 #2 #3 {\setvalue{uc#2#3}{#1}}
\def\defineudigit #1 #2 #3 {\setvalue{\characterencoding uc#1}{\uchar{#2}{#3}}}
-%D It may look strange, but for the moment, we want the encoding
-%D to be part of the digit specification. This may change!
+%D It may look strange, but for the moment, we want the encoding
+%D to be part of the digit specification. This may change!
\unexpanded\def\udigit#1#2{\getvalue{@#1@uc\number#2}}
-%D \macros
-%D {uchar, octuchar, hexuchar}
+%D \macros
+%D {uchar, octuchar, hexuchar}
-\ifx\uchar\undefined \def\uchar#1#2{(\number#1,\number#2)} \fi
+\ifx\uchar\undefined \def\uchar#1#2{(\number#1,\number#2)} \fi
\def\octuchar#1#2{\uchar{`#1}{`#2}}
\def\hexuchar#1#2{\uchar{"#1}{"#2}}
-% %D Just to be sure, we save the original values of \type {\ss}.
+% %D Just to be sure, we save the original values of \type {\ss}.
%
% \ifx\undefined\SS \let\SS=\ss \fi
% \ifx\undefined\sz \let\sz=\ss \fi
@@ -1214,14 +1214,14 @@
% \redefineaccent H % hungarumlaut
% \redefineaccent t % ........
% \redefineaccent r % ........
-% \redefineaccent =
-% \redefineaccent b
-% \redefineaccent c
-% \redefineaccent d
-% \redefineaccent k
-
-% obsolete (moved)
-%
+% \redefineaccent =
+% \redefineaccent b
+% \redefineaccent c
+% \redefineaccent d
+% \redefineaccent k
+
+% obsolete (moved)
+%
% \redefinecharacter ae % ae
% \redefinecharacter AE % AE
% \redefinecharacter oe % oe
@@ -1239,12 +1239,12 @@
% \redefinecharacter NG
% \redefinecharacter ij
% \redefinecharacter IJ
-%
-% \redefinecharacter i \redefinecharacter dotlessi
-% \redefinecharacter j \redefinecharacter dotlessj
-%
-% \redefinecharacter l
-% \redefinecharacter L
+%
+% \redefinecharacter i \redefinecharacter dotlessi
+% \redefinecharacter j \redefinecharacter dotlessj
+%
+% \redefinecharacter l
+% \redefinecharacter L
% replaced
%
@@ -1254,37 +1254,37 @@
% \defineaccent ' i {\'\i} \defineaccent ' j {\'\j}
% \defineaccent ~ i {\~\i} \defineaccent ~ j {\~\j}
-% \redefinecharacter leftguillemot
-% \redefinecharacter rightguillemot
-% \redefinecharacter leftsubguillemot
-% \redefinecharacter rightsubguillemot
+% \redefinecharacter leftguillemot
+% \redefinecharacter rightguillemot
+% \redefinecharacter leftsubguillemot
+% \redefinecharacter rightsubguillemot
-% obsolete
-%
+% obsolete
+%
% %D Some more:
-%
-% \startmapping[\s!default]
-%
+%
+% \startmapping[\s!default]
+%
% \defineuppercasecom \i {I}
% \defineuppercasecom \j {J}
% \defineuppercasecom \sz {SS}
% \defineuppercasecom \SS {SS}
-% \defineuppercasecom \l \L
+% \defineuppercasecom \l \L
% \defineuppercasecom \ae \AE
% \defineuppercasecom \aa \AA
-% \defineuppercasecom \o \O
+% \defineuppercasecom \o \O
% \defineuppercasecom \oe \OE
-% \definelowercasecom \L \l
+% \definelowercasecom \L \l
% \definelowercasecom \AE \ae
% \definelowercasecom \AA \aa
-% \definelowercasecom \O \o
+% \definelowercasecom \O \o
% \definelowercasecom \OE \oe
-%
+%
% \stopmapping
%D Basics and fallbacks.
-\newif\ifignoreaccent
+\newif\ifignoreaccent
\let\textaccent \accent
@@ -1309,10 +1309,10 @@
\def\buildmathaccent#1%
{\mathaccent#1 }
-% will be overloaded later
+% will be overloaded later
%\def\definetextaccent#1 #2%
-% {\setvalue{\string#1}{#2}% will be overloaded
+% {\setvalue{\string#1}{#2}% will be overloaded
% \setvalue{normaltextaccent\string#1}{#2}}
%
%\def\donormaltextaccent#1%
@@ -1341,9 +1341,9 @@
\definecommand ~ {\buildtextaccent\texttilde}
\definecommand " {\buildtextaccent\textdiaeresis}
-% some fake ones, name will change into build
+% some fake ones, name will change into build
-\unexpanded\def\bottomaccent#1#2#3#4#5% down right slantcorrection accent char
+\unexpanded\def\bottomaccent#1#2#3#4#5% down right slantcorrection accent char
{\leavevmode
\vtop
{\forgetall
@@ -1359,7 +1359,7 @@
\hskip#2\wd0
\hskip-#3\fontdimen1\font % in plain 1ex * dimenless value
\vbox to .2ex{\box0\vss}\hidewidth
- \crcr}}}
+ \crcr}}}
\def\buildtextmacron {\bottomaccent{.25ex}{0}{15}{\textmacron}}
\def\buildtextbottomdot{\bottomaccent{.25ex}{0}{5}{\textbottomdot}}
@@ -1367,18 +1367,18 @@
\def\buildtextogonek {\bottomaccent{-.1ex}{.5}{0}{\textogonek}}
%\definetextaccent c {\buildtextcedilla}
-%\definetextaccent b {\buildtextmacron}
+%\definetextaccent b {\buildtextmacron}
%\definetextaccent d {\buildtextbottomdot}
%\definetextaccent k {\buildtextogonek}
\definecommand c {\buildtextcedilla}
-\definecommand b {\buildtextmacron}
+\definecommand b {\buildtextmacron}
\definecommand d {\buildtextbottomdot}
\definecommand k {\buildtextogonek}
-% math stuff, will change
+% math stuff, will change
-\def\definemathaccent#1 #2%
+\def\definemathaccent#1 #2%
{\setvalue{\string#1}{#2}%
\setvalue{normalmathaccent\string#1}{#2}}
@@ -1401,16 +1401,16 @@
%D Some precautions:
\ifx\usepdffontresource\undefined
- \def\usepdffontresource #1 {} % this will be defined elsewhere
+ \def\usepdffontresource #1 {} % this will be defined elsewhere
\fi
-%D Some day \unknown\
+%D Some day \unknown\
-% \def\useencodingvector #1 % file tag
+% \def\useencodingvector #1 % file tag
% {\pushmacro\definecharacter
% \pushmacro\startencoding
% \pushmacro\stopencoding
-% \def\definecharacter ##1 ##2 %
+% \def\definecharacter ##1 ##2 %
% {\doifnumberelse{##2}
% {\ifnum##2>127
% \def\!!stringa{##2 }%
@@ -1418,12 +1418,12 @@
% \fi}
% {}}%
% \def\startencoding[##1]{}
-% \def\stopencoding{\endinput}
+% \def\stopencoding{\endinput}
% \readfile{xxxx-#1}\donothing\donothing
% \popmacro\stopencoding
% \popmacro\startencoding
% \popmacro\definecharacter}
-%
+%
% \startregime[ec]
% \useencodingvector ec
% \stopregime
@@ -1457,11 +1457,11 @@
\unexpanded\def\uhandlecharacter#1{\csname#1\endcsname}
\def\dontexpandencodedtokens
- {\def\dohandleaccent {\uhandleaccent}%
- \def\dohandlecommand {\uhandlecommand}%
+ {\def\dohandleaccent {\uhandleaccent}%
+ \def\dohandlecommand {\uhandlecommand}%
\def\dohandlecharacter{\uhandlecharacter}}
-%D Still valid? To be checked:
+%D Still valid? To be checked:
\def\ignoreencoding
{\let\dohandleaccent \doignoreaccent
@@ -1472,20 +1472,20 @@
\def\doignorecommand #1{\string#1}
\def\doignorecharacter#1{\string#1}
-\appendtoks
+\appendtoks
\ignoreencoding
-\to \everycleanupfeatures
+\to \everycleanupfeatures
-\appendtoks
- \keepencodedtokens
+\appendtoks
+ \keepencodedtokens
\to \everysafeexpanded
-%D We preload several encodings:
+%D We preload several encodings:
-\useencoding[def,acc,raw,com,cas,mis] % mis shoudl come first
+\useencoding[def,acc,raw,com,cas,mis] % mis shoudl come first
-\useencoding[ans,il2,ec,tbo,pdf,uc,pol]
+\useencoding[ans,il2,ec,tbo,pdf,uc,pol]
\setupencoding[\s!default=ec] % was: [\s!default=\s!default]
-\protect \endinput
+\protect \endinput
diff --git a/tex/context/base/font-bfm.tex b/tex/context/base/font-bfm.tex
new file mode 100644
index 000000000..848f5728f
--- /dev/null
+++ b/tex/context/base/font-bfm.tex
@@ -0,0 +1,193 @@
+%D \module
+%D [ file=font-bfm,
+%D version=2003.11.25,
+%D title=\CONTEXT\ Font Macros,
+%D subtitle=Mixed Normal and Bold Math,
+%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 Font Macros / Mixed Bold Math Support}
+
+%D The following example demonstrates how to use normal, bold, and mixed
+%D normal|/|bold math. Since not everyone has the Lucida on his|/|her
+%D machine we don't show the result.
+%D
+%D \starttyping
+%D \setupformulas
+%D [method=bold]
+%D
+%D \definetypeface [mainface] [rm] [serif] [lucida] [default] [encoding=texnansi]
+%D \definetypeface [mainface] [tt] [mono] [lucida] [default] [encoding=texnansi]
+%D \definetypeface [mainface] [ss] [sans] [lucida] [default] [encoding=texnansi]
+%D \definetypeface [mainface] [mm] [math] [lucida] [default] [encoding=texnansi]
+%D \definetypeface [mainface] [mm] [bfmath] [lucida] [default] [encoding=texnansi]
+%D
+%D \definetypeface [boldmath] [rm] [serif] [lucida] [default] [encoding=texnansi]
+%D \definetypeface [boldmath] [tt] [mono] [lucida] [default] [encoding=texnansi]
+%D \definetypeface [boldmath] [ss] [sans] [lucida] [default] [encoding=texnansi]
+%D \definetypeface [boldmath] [mm] [boldmath] [lucida] [default] [encoding=texnansi]
+%D
+%D \switchtobodyfont[mainface]
+%D
+%D \startlines
+%D $\mainface x=10 \Gamma \Delta \alpha \delta \zeta$
+%D $\boldmath x=10 \Gamma \Delta \alpha \delta \zeta$
+%D \stoplines
+%D
+%D \startformula
+%D x=12=\fontbody \Gamma \Delta \alpha \delta \zeta
+%D \stopformula
+%D
+%D \startformula[mainface]
+%D x=12=\fontbody \Gamma \Delta \alpha \delta \zeta
+%D \stopformula
+%D
+%D \startformula[boldmath]
+%D x=12=\fontbody \Gamma \Delta \alpha \delta \zeta
+%D \stopformula
+%D
+%D \startformula[boldmath,8pt]
+%D x=8=\fontbody \Gamma \Delta \alpha \delta \zeta
+%D \stopformula
+%D
+%D \startformula[boldmath,12pt,small]
+%D x=12s=\fontbody \Gamma \Delta \alpha \delta \zeta
+%D \stopformula
+%D
+%D \startformula[boldmath,small]
+%D x=s=\fontbody \Gamma \Delta \alpha \delta \zeta
+%D \stopformula
+%D
+%D \startformula[boldmath,10pt]
+%D x=10=\fontbody \Gamma \Delta \alpha \delta \zeta
+%D \stopformula
+%D
+%D \startformula[boldmath,11pt,small]
+%D x=11s=\fontbody \Gamma \Delta \alpha \delta \zeta
+%D \stopformula
+%D
+%D \startformula[boldmath,9pt]
+%D x=9=\fontbody \Gamma \Delta \alpha \delta \zeta
+%D \stopformula
+%D
+%D \startlines
+%D \formula{1=2x}
+%D \formula[boldmath]{1=2x}
+%D \formula[mainface]{1=2x}
+%D \formula[mainface]{1 \theta \Gamma = \bfm 1 \beta \hbox{\sl test}\Gamma \alpha ' x x}
+%D \formula[mainface]{1 \theta \Gamma = {\bfm 1 \beta \hbox{\sl test}\Gamma \alpha ' x} x}
+%D \stoplines
+%D \stoptyping
+
+\unprotect
+
+%D \TEX\ has some hard wired expectations about where to look for
+%D certain characters. This means that we cannot overload the families
+%D 0 upto~3. Also, since we use C upto~F for math as well, we are left
+%D with the range 4 upto~B.
+
+\chardef\mrbffam\itfam \edef\c!mrbf{\c!mr\c!bf} \let\hexmrbffam\hexitfam % 4 it
+\chardef\exbffam\slfam \edef\c!exbf{\c!ex\c!bf} \let\hexexbffam\hexslfam % 5 sl
+\chardef\mibffam\bffam \edef\c!mibf{\c!mi\c!bf} \let\hexmibffam\hexbffam % 6 bf
+\chardef\sybffam\nnfam \edef\c!sybf{\c!sy\c!bf} \let\hexsybffam\hexnnfam % 7 nn
+\chardef\mabffam\bsfam \edef\c!mabf{\c!ma\c!bf} \let\hexmabffam\hexbsfam % 8 bs
+\chardef\mbbffam\bifam \edef\c!mbbf{\c!mb\c!bf} \let\hexmbbffam\hexbifam % 9 bi
+\chardef\mcbffam\scfam \edef\c!mcbf{\c!mc\c!bf} \let\hexmcbffam\hexscfam % A sc
+\chardef\mdbffam\scfam \edef\c!mdbf{\c!mc\c!bf} \let\hexmdbffam\hexscfam % B tf % tricky
+
+%D The next bunch of code looks horrible and tricky but one has to keep in
+%D mind that because \TEX\ makes several passes over the math list we need to
+%D make sure that grouping is handled well. Later assignments to a family
+%D overload previous ones, the last one counts.
+
+\newtoks \boldmathstrategies
+\newtoks \boldsymbstrategies
+
+\appendtoks
+ \dosetmathfamily\mrbffam\textface\scriptface\scriptscriptface\c!mrbf\mrfallback
+ \dosetmathfamily\mibffam\textface\scriptface\scriptscriptface\c!mibf\empty
+ \dosetskewchar\defaultskewcharmi
+ \dosetmathfamily\sybffam\textface\scriptface\scriptscriptface\c!sybf\empty
+ \dosetskewchar\defaultskewcharsy
+ \dosetmathfamily\exbffam\textface\textface \textface \c!exbf\empty
+ \dosetmathfamily\mabffam\textface\scriptface\scriptscriptface\c!mabf\empty
+ \dosetmathfamily\mbbffam\textface\scriptface\scriptscriptface\c!mbbf\empty
+ \dosetmathfamily\mcbffam\textface\scriptface\scriptscriptface\c!mcbf\empty
+\to \boldmathstrategies
+
+\appendtoks
+ \dosetsymbfamily\mrbffam\textface\scriptface\scriptscriptface\c!mrbf
+ \dosetsymbfamily\mibffam\textface\scriptface\scriptscriptface\c!mibf
+ \dosetsymbfamily\sybffam\textface\scriptface\scriptscriptface\c!sybf
+ \dosetsymbfamily\exbffam\textface\textface \textface \c!exbf
+ \dosetsymbfamily\mabffam\textface\scriptface\scriptscriptface\c!mabf
+ \dosetsymbfamily\mbbffam\textface\scriptface\scriptscriptface\c!mbbf
+ \dosetsymbfamily\mcbffam\textface\scriptface\scriptscriptface\c!mcbf
+\to \boldsymbstrategies
+
+%D Here comes the real mess (due to semi||global settings en multiple
+%D passes over the math list once the input is expanded.
+
+\newevery \everyboldfacemath \relax
+\chardef \boldfacemathmethod \zerocount
+
+\appendtoks
+ \ifcase\boldfacemathmethod \else \the\boldmathstrategies \fi
+\to \mathstrategies
+
+\appendtoks
+ \ifcase\boldfacemathmethod \else \the\boldsymbstrategies \fi
+\to \symbstrategies
+
+\appendtoks
+ \let\mrfam\mrbffam \let\c!mr\c!mrbf \let\hexmrfam\hexmrbffam
+ \let\mifam\mibffam \let\c!mi\c!mibf \let\hexmifam\hexmibffam
+ \let\syfam\sybffam \let\c!sy\c!sybf \let\hexsyfam\hexsybffam
+ \let\exfam\exbffam \let\c!ex\c!exbf \let\hexexfam\hexexbffam
+ \let\mafam\mabffam \let\c!ma\c!mabf \let\hexmafam\hexmabffam
+ \let\mbfam\mbbffam \let\c!mb\c!mbbf \let\hexmbfam\hexmbbffam
+ \let\mcfam\mcbffam \let\c!mc\c!mcbf \let\hexmcfam\hexmcbffam
+\to \everyboldfacemath
+
+\appendtoks
+ \let\mathsubfamily\c!bf
+\to \everyboldfacemath
+
+\appendtoks
+ \synchronizemath \aftergroup\synchronizemath
+\to \everyboldfacemath
+
+%D \macros
+%D {boldfacemath, bfm, autoboldfacemath}
+%D
+%D These are the user commands, with \type {\bfm} being the most comfortable.
+
+\def\boldfacemath {\ifcase\boldfacemathmethod\else\the\everyboldfacemath\fi}
+\def\bfm {\boldfacemath} % no \let, so that we can redefine
+\def\autoboldfacemath{\appendtoks\ifcase\boldfacemathmethod\else\let\bf\boldfacemath\fi\to\everymath}
+
+%D We hook this feature into the formula mechanism.
+
+\setupformulas
+ [\c!methode=\v!normaal]
+
+\appendtoks
+ \doifelse{\formulaparameter\c!methode}\v!vet
+ {\chardef\boldfacemathmethod\plusone}
+ {\chardef\boldfacemathmethod\zerocount}%
+\to \everysetupformulas
+
+%D Of course this only works when bfmath fonts are set up (see example at
+%D the top of this file) and bold math is enabled:
+%D
+%D \starttyping
+%D \setupformulas
+%D [method=bold]
+%D \stoptyping
+
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/font-ini.tex b/tex/context/base/font-ini.tex
index c69809dbf..a6acf4c09 100644
--- a/tex/context/base/font-ini.tex
+++ b/tex/context/base/font-ini.tex
@@ -875,7 +875,7 @@
%D
%D We can inhibit this slow||downer with:
-\def\textonly{\synchronizemathfontsfalse}
+\def\textonly{\synchronizemathfontsfalse} % document this
\appendtoks
\dosettextfamily\c!tf
@@ -993,6 +993,7 @@
\dosetmathfamily\mafam\textface\scriptface\scriptscriptface\c!ma\empty
\dosetmathfamily\mbfam\textface\scriptface\scriptscriptface\c!mb\empty
\dosetmathfamily\mcfam\textface\scriptface\scriptscriptface\c!mc\empty
+% \dosetmathfamily\mdfam\textface\scriptface\scriptscriptface\c!md\empty
\dosetmathfamily\nnfam\textface\scriptface\scriptscriptface\c!nn\empty
\to \mathstrategies
@@ -1097,6 +1098,7 @@
\dosetsymbfamily\mafam\textface\scriptface\scriptscriptface\c!ma
\dosetsymbfamily\mbfam\textface\scriptface\scriptscriptface\c!mb
\dosetsymbfamily\mcfam\textface\scriptface\scriptscriptface\c!mc
+% \dosetsymbfamily\mdfam\textface\scriptface\scriptscriptface\c!md % also ?
\to \symbstrategies
\def\dosetsymbfamily#1#2#3#4#5%
@@ -1272,7 +1274,7 @@
{\afterassignment\do@fs@scaled\scratchcounter}
\def\do@fs@scaled#1\relax
- {\scaledfont\number\scratchcounter\s!pt
+ {\scaledfont\number\scratchcounter\points
\scaledfont\localrelativefontsize\scaledfont
\ifautofontsize\scaledfont\currentfontbodyscale\scaledfont\fi
\scratchcounter\scaledfont % \scaledfont is now pretty large
@@ -2088,13 +2090,13 @@
\endETEX
-\def\bodyfontcsname%
+\def\bodyfontcsname
{\csname\bodyfontvariable}
-\def\bodyfontinterlinespecs%
+\def\bodyfontinterlinespecs
{\bodyfontvariable{\normalizedbodyfontsize\c!interlinie}}
-\def\bodyfontinterlinespace%
+\def\bodyfontinterlinespace
{\csname\bodyfontinterlinespecs\endcsname}
%D We default all parameters to the main bodyfont size (begin
@@ -2262,19 +2264,19 @@
\def\checkbodyfont#1#2#3#4% body style alt size / gdef % #4 can be empty
{\def\c!!mm{#2}%
\ifx\c!!mm\c!mm % prevents \max and alike (re)defs
- \unexpanded\setgvalue {#2}{\setcurrentfontstyle {#2}}% \rm
- \unexpanded\setgvalue {#3}{\setcurrentfontalternative {#3}}% \sl
+ \unexpanded\setgvalue {#2}{\setcurrentfontstyle {#2}}% \rm
+ \unexpanded\setgvalue {#3}{\setcurrentfontalternative {#3}}% \sl
\else
- \unexpanded\setgvalue {#2#4}{\setcurrentfontstylesize {#2}{#4}}% \rma
- \unexpanded\setgvalue {#3#4}{\setcurrentfontalternativesize {#3}{#4}}% \sla
+ \unexpanded\setgvalue {#2#4}{\setcurrentfontstylesize {#2}{#4}}% \rma
+ \unexpanded\setgvalue {#3#4}{\setcurrentfontalternativesize {#3}{#4}}% \sla
\unexpanded\setgvalue {#2#3#4}{\setcurrentfontstylealternativesize{#2}{#3}{#4}}% \rmsla
- \unexpanded\setgvalue {#2}{\setcurrentfontstyle {#2}}% \rm
- \unexpanded\setgvalue {#3}{\setcurrentfontalternative {#3}}% \sl
- \unexpanded\setgvalue {#2\c!x}{\setcurrentfontxstylealternative {#2}}% \rmx
- \unexpanded\setgvalue{#2\c!xx}{\setcurrentfontxxstylealternative {#2}}% \rmxx
- \unexpanded\setgvalue {#3\c!x}{\setcurrentfontxalternative {#3}}% \slx
- \unexpanded\setgvalue{#3\c!xx}{\setcurrentfontxxalternative {#3}}% \slxx
- \unexpanded\setgvalue {#2#3}{\setcurrentfontstylealternative {#2}{#3}}% \rmsl
+ \unexpanded\setgvalue {#2}{\setcurrentfontstyle {#2}}% \rm
+ \unexpanded\setgvalue {#3}{\setcurrentfontalternative {#3}}% \sl
+ \unexpanded\setgvalue {#2\c!x}{\setcurrentfontxstylealternative {#2}}% \rmx
+ \unexpanded\setgvalue{#2\c!xx}{\setcurrentfontxxstylealternative {#2}}% \rmxx
+ \unexpanded\setgvalue {#3\c!x}{\setcurrentfontxalternative {#3}}% \slx
+ \unexpanded\setgvalue{#3\c!xx}{\setcurrentfontxxalternative {#3}}% \slxx
+ \unexpanded\setgvalue {#2#3}{\setcurrentfontstylealternative {#2}{#3}}% \rmsl
\fi}
\def\dodefinedefaultbodyfont[#1][#2][#3]% sizes styles identifier
@@ -2454,11 +2456,11 @@
\def\normalizebodyfontsize#1\to#2%
{\scratchdimen#1\relax
- \ifcase\fontdigits\advance\scratchdimen.5\s!pt\fi
+ \ifcase\fontdigits\advance\scratchdimen.5\points\fi
\@EA\@EA\@EA\donormalizedbodyfontsize
\@EA\WITHOUTPT\the\scratchdimen00\to#2}
-\def\donormalizedbodyfontsize#1.#2#3#4\to#5%
+\def\donormalizedbodyfontsize#1.#2#3#4\to#5% \points ?
{\edef#5%
{#1%
\ifcase\fontdigits\or
@@ -2666,7 +2668,7 @@
\def\dosetsubstitutefont#1#2% #1 = set/switch state
{\scratchdimen#2\relax
- \advance\scratchdimen .499\s!pt
+ \advance\scratchdimen .499\points
\dimensiontocount\scratchdimen\scratchcounter
\advance\scratchcounter \minusone
\ifnum\scratchcounter>\plusthree
@@ -3190,8 +3192,19 @@
\scriptfont \mrfam\scriptfont \mffam
\scriptscriptfont\mrfam\scriptscriptfont\mffam}
-\def\domffam#1%
- {\csname\ifundefined{#1\s!fam}\c!nn\else#1\fi\s!fam\endcsname}
+\beginTEX
+
+ \def\domffam#1%
+ {\csname\ifundefined{#1\s!fam}\c!nn\else#1\fi\s!fam\endcsname}
+
+\endTEX
+
+\beginETEX \ifcsname
+
+ \def\domffam#1%
+ {\csname\ifcsname#1\s!fam\endcsname#1\else\c!nn\fi\s!fam\endcsname}
+
+\endETEX
\def\mffam
{\domffam\fontalternative}
@@ -3322,7 +3335,7 @@
{\setvalue{##1}{\switchtobodyfont[#2]}}%
\processcommalist[#1]\docommando}
-\def\definebodyfontswitch%
+\def\definebodyfontswitch
{\dodoubleargument\dodefinebodyfontswitch}
%D \macros
@@ -3464,7 +3477,7 @@
\setvalue{\@noletter@##1}{#3}}%
\processcommalist[#1]\docommando}
-\def\definealternativestyle%
+\def\definealternativestyle
{\dotripleempty\dodefinealternativestyle}
\def\definestyle{\definealternativestyle}
@@ -3653,11 +3666,13 @@
\def\dodoemphasiscorrection
{\setbox\scratchbox\hbox{\next}%
- \ifdim\ht\scratchbox<.3ex
- \expandafter\endgroup
- \else
+ \ifdim\ht\scratchbox=\zeropoint % probably a space
\expandafter\dododoemphasiscorrection
- \fi}
+ \else\ifdim\ht\scratchbox<.3ex
+ \expandafter\expandafter\expandafter\endgroup
+ \else
+ \expandafter\expandafter\expandafter\dododoemphasiscorrection
+ \fi\fi}
\def\dododoemphasiscorrection
{\scratchskip\lastskip
@@ -3703,17 +3718,10 @@
%D The next emphasis alternatives are for \THANH. They adapt
%D their style as good as possible.
-\def\emphbf
- {\groupedcommand{\bf\def\emphit{\bi}\def\emphsl{\bs}}{}}
-
-\def\emphit
- {\groupedcommand{\it\def\emphbf{\bi}\def\emphsl{\sl}}{}}
-
-\def\emphsl
- {\groupedcommand{\sl\def\emphbf{\bs}\def\emphit{\it}}{}}
-
-\def\emphtf
- {\groupedcommand{\tf\def\emphbf{\bf}\def\emphit{\it}\def\emphsl{\sl}}{}}
+\def\emphbf{\groupedcommand{\bf\def\emphit{\bi}\def\emphsl{\bs}}{}}
+\def\emphit{\groupedcommand{\it\def\emphbf{\bi}\def\emphsl{\sl}}{}}
+\def\emphsl{\groupedcommand{\sl\def\emphbf{\bs}\def\emphit{\it}}{}}
+\def\emphtf{\groupedcommand{\tf\def\emphbf{\bf}\def\emphit{\it}\def\emphsl{\sl}}{}}
%D \startbuffer
%D TEXT {\emphbf text \emphit text \emphtf text \emphsl text} TEXT
@@ -3769,7 +3777,7 @@
%D different fonts into a collection (typeface) and
%D determining optimal baseline distances.
%D
-%D \showfontstrip \blank \showminimalbaseline
+%D \showfontstrip \blanko \showminimalbaseline
\fetchruntimecommand \showfontstrip {\f!fontprefix\s!run}
\fetchruntimecommand \testminimalbaseline {\f!fontprefix\s!run}
@@ -3820,6 +3828,7 @@
\fetchruntimecommand \showfontstyle {\f!fontprefix\s!run}
\fetchruntimecommand \showligature {\f!fontprefix\s!run}
\fetchruntimecommand \showligatures {\f!fontprefix\s!run}
+\fetchruntimecommand \showcharratio {\f!fontprefix\s!run}
%D \macros
%D {getglyph, symbolicfont}
@@ -4300,15 +4309,18 @@
%D New or old?
% tzt proper \define...
-
-\def\tfmath{\tf\mf\synchronizesymb}
-\def\bfmath{\bf\mf\synchronizesymb}
-\def\slmath{\sl\mf\synchronizesymb}
-\def\itmath{\it\mf\synchronizesymb}
-\def\bsmath{\bs\mf\synchronizesymb}
-\def\bimath{\bi\mf\synchronizesymb}
-\def\scmath{\sc\mf\synchronizesymb}
-\def\nnmath{\nn\mf\synchronizesymb}
+%
+% watch out: \synchronizesymb resets the family so we need a second
+% \mf (or maybe \mr): messy and to be sorted out
+
+\def\tfmath{\tf\mf\synchronizesymb\mf}
+\def\bfmath{\bf\mf\synchronizesymb\mf}
+\def\slmath{\sl\mf\synchronizesymb\mf}
+\def\itmath{\it\mf\synchronizesymb\mf}
+\def\bsmath{\bs\mf\synchronizesymb\mf}
+\def\bimath{\bi\mf\synchronizesymb\mf}
+\def\scmath{\sc\mf\synchronizesymb\mf}
+\def\nnmath{\nn\mf\synchronizesymb\mf}
\def\textmath {\synchronizesymb}
@@ -4364,4 +4376,4 @@
%D
%D \def\abortiffontnotfound#1%
%D {\doiffontpresentelse{#1}{}{\showmessage{\m!fonts}{10}{\truefontname{#1}}\endinput}}
-%D \stoptypen
+%D \stoptypen \ No newline at end of file
diff --git a/tex/context/base/font-run.tex b/tex/context/base/font-run.tex
index 5f6352a81..ce43591d2 100644
--- a/tex/context/base/font-run.tex
+++ b/tex/context/base/font-run.tex
@@ -18,14 +18,14 @@
\unprotect
\gdef\dosetshowfonttitle#1%
- {\tabskip\!!zeropoint
- \parindent\!!zeropoint
+ {\tabskip\zeropoint
+ \parindent\zeropoint
\setlocalhsize
\doifelsenothing{#1}
{\def\title{[\the\korpsgrootte]}}
{\switchtobodyfont[#1]\def\title{[#1]}}
- \doifsomething{\fontclass}
- {\doifnot{[\fontclass]}{\title}
+ \doifsomething\fontclass
+ {\doifnot{[\fontclass]}\title
{\edef\title{[\fontclass]\space\title}}}}
\gdef\showbodyfont%
@@ -179,7 +179,7 @@
\stopoverlay
\nointerlineskip
\vskip2pt
- \edef\ascii % \noexpand needed for non etex
+ \edef\ascii % \noexpand needed for non etex
{name: {\noexpand\black\fontname\font }\quad
encoding: {\noexpand\black\currentencoding}\quad
mapping: {\noexpand\black\currentmapping }\quad
@@ -223,52 +223,60 @@
{\hbox{\type{#1}\enspace\red\ruledhbox{\black#1}}}
\gdef\showligatures[#1]%
- {\bgroup
- \setupcolors[\c!status=\v!lokaal]%
- \def\show##1{\hbox{\red\ruledhbox{\black##1}}}%
- \definefont[\s!dummy][#1]\dummy
- \starttabulate[|*{9}{c|}]
- \NC\type{ff}\NC\type{fi}\NC\type{fl}\NC\type{ffi}\NC\type{ffl}\NC
- \type{``}\NC\type{''}\NC\type{--}\NC\type{---}\NC\NR
- \NC\show{ff}\NC\show{fi}\NC\show{fl}\NC\show{ffi}\NC\show{ffl}\NC
- \show{``}\NC\show{''}\NC\show{--}\NC\show{---}\NC\NR
- \stoptabulate
- \egroup}
+ {\ifx\starttabulate\undefined
+ \blanko{\tttf \type {\showligatures} is only available in thr english interface}\blanko
+ \else
+ \bgroup
+ \setupcolors[\c!status=\v!lokaal]%
+ \def\show##1{\hbox{\red\ruledhbox{\black##1}}}%
+ \definefont[\s!dummy][#1]\dummy
+ \starttabulate[|*{9}{c|}]
+ \NC\type{ff}\NC\type{fi}\NC\type{fl}\NC\type{ffi}\NC\type{ffl}\NC
+ \type{``}\NC\type{''}\NC\type{--}\NC\type{---}\NC\NR
+ \NC\show{ff}\NC\show{fi}\NC\show{fl}\NC\show{ffi}\NC\show{ffl}\NC
+ \show{``}\NC\show{''}\NC\show{--}\NC\show{---}\NC\NR
+ \stoptabulate
+ \egroup
+ \fi}
\gdef\showfontstrip
{\dosingleempty\doshowfontstrip}
\gdef\doshowfontstrip[#1]%
- {\bgroup
- \def\dofontstripa##1##2%
- {\tttf\string##1}
- \def\dofontstripb##1##2%
- {\ruledhbox{\switchtobodyfont[#1]##1{##2}}}
- \def\dofontstripc##1##2%
- {\setbox\scratchbox\hbox{\switchtobodyfont[#1]##1{##2}}%
- \tt\tfx\the\ht\scratchbox}%
- \def\dofontstripd##1##2%
- {\setbox\scratchbox\hbox{\switchtobodyfont[#1]##1{##2}}%
- \tt\tfx\the\wd\scratchbox}%
- \def\fontstrip##1##2##3%
- {\NC##2\rm{##3}\NC
- ##2\ss{##3}\NC
- ##2\tt{##3}\NC
- ##2\mathematics{##3}\NC
- \tttf##1\NR}
- \starttabulate[|c|c|c|c|c|]
- \fontstrip\relax\dofontstripa\empty
- \TB
- \fontstrip\relax\dofontstripb{xxxx}
- \fontstrip\relax\dofontstripb{12345}
- \fontstrip\relax\dofontstripb{(Agw)}
- \TB
- \fontstrip{(x height)}\dofontstripc{x}
- \fontstrip{(m width)}\dofontstripd{m}
- \stoptabulate
- \egroup}
+ {\ifx\starttabulate\undefined
+ \blanko{\tttf \type {\showfontstrip} is only available in thr english interface}\blanko
+ \else
+ \bgroup
+ \def\dofontstripa##1##2%
+ {\tttf\string##1}
+ \def\dofontstripb##1##2%
+ {\ruledhbox{\switchtobodyfont[#1]##1{##2}}}
+ \def\dofontstripc##1##2%
+ {\setbox\scratchbox\hbox{\switchtobodyfont[#1]##1{##2}}%
+ \tt\tfx\the\ht\scratchbox}%
+ \def\dofontstripd##1##2%
+ {\setbox\scratchbox\hbox{\switchtobodyfont[#1]##1{##2}}%
+ \tt\tfx\the\wd\scratchbox}%
+ \def\fontstrip##1##2##3%
+ {\NC##2\rm{##3}\NC
+ ##2\ss{##3}\NC
+ ##2\tt{##3}\NC
+ ##2\mathematics{##3}\NC
+ \tttf##1\NR}
+ \starttabulate[|c|c|c|c|c|]
+ \fontstrip\relax\dofontstripa\empty
+ \TB
+ \fontstrip\relax\dofontstripb{xxxx}
+ \fontstrip\relax\dofontstripb{12345}
+ \fontstrip\relax\dofontstripb{(Agw)}
+ \TB
+ \fontstrip{(x height)}\dofontstripc{x}
+ \fontstrip{(m width)}\dofontstripd{m}
+ \stoptabulate
+ \egroup
+ \fi}
-\ifx\databox\undefined \newbox\databox \fi
+\ifx\databox\undefined \newbox\databox \fi
\gdef\testminimalbaseline#1%
{\setbox\databox\ruledhbox{#1}%
@@ -285,17 +293,21 @@
\noexpand \NC \the\dp\databox
\noexpand \NC \ifdim\scratchdimen<\baselineskip <
\else\ifdim\scratchdimen=\baselineskip =
- \else > \fi\fi
+ \else > \fi\fi
\noexpand \NC \the\baselineskip
- \noexpand \NC (\ifdim\scratchdimen>\baselineskip not \fi ok)
+ \noexpand \NC (\ifdim\scratchdimen>\baselineskip not \fi ok)
\noexpand \NC \noexpand \NR }}
\gdef\showminimalbaseline
- {\starttabulate[||T|T|T|T|T|T|T|T|T|]
- \testminimalbaseline{\hbox to 1em{\hss\showstruts\strut\hss}}%
- \testminimalbaseline{(/)}%
- \testminimalbaseline{$\frac{1}{2}x^2_3$}
- \stoptabulate}
+ {\ifx\starttabulate\undefined
+ \blanko{\tttf \type {\showminimalbaseline} is only available in thr english interface}\blanko
+ \else
+ \starttabulate[||T|T|T|T|T|T|T|T|T|]
+ \testminimalbaseline{\hbox to 1em{\hss\showstruts\strut\hss}}%
+ \testminimalbaseline{(/)}%
+ \testminimalbaseline{$\frac{1}{2}x^2_3$}
+ \stoptabulate
+ \fi}
\gdef\showkerning#1%
{\bgroup
@@ -304,4 +316,11 @@
\startMPcode draw textext(\MPstring\s!dummy);\stopMPcode
\egroup}
-\protect \endinput
+\def\showcharratio
+ {\dowithnextboxcontent
+ {\switchtobodyfont[10pt]}%
+ {(\expanded{\withoutpt{\the\nextboxht}},%
+ \expanded{\withoutpt{\the\nextboxdp}})}%
+ \hbox}
+
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/font-uni.tex b/tex/context/base/font-uni.tex
index baca33983..a9f87e28c 100644
--- a/tex/context/base/font-uni.tex
+++ b/tex/context/base/font-uni.tex
@@ -8,8 +8,8 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
\writestatus{loading}{Context Font Macros / UNICODE Support}
@@ -20,17 +20,17 @@
%D characters $>127$, so as long as the two byte characters
%D have a first character with code $>127$, we can use active
%D characters to handle them. In an optimistic mood, I called
-%D this module the \UNICODE\ font module. In the module that
-%D handles Chinese, we will see that some more interpretation
-%D is involved, which is why the macros handling those
-%D characters look ahead.
+%D this module the \UNICODE\ font module. In the module that
+%D handles Chinese, we will see that some more interpretation
+%D is involved, which is why the macros handling those
+%D characters look ahead.
\startmessages dutch library: fonts
21: het is veiliger om (pdf)eTeX te gebruiken
\stopmessages
\startmessages english library: fonts
- 21: using (pdf)eTeX is more save
+ 21: using (pdf)eTeX is more save
\stopmessages
\startmessages german library: fonts
@@ -42,22 +42,22 @@
\stopmessages
\startmessages norwegian library: fonts
- 21: å bruke (pdf)eTeX er tryggere
+ 21: å bruke (pdf)eTeX er tryggere
\stopmessages
-\unprotect
+\unprotect
-%D \macros
-%D {handleunicodeflowglyph, uchar,
+%D \macros
+%D {handleunicodeflowglyph, uchar,
%D handleunicodeglyph, insertunicodeglyph,
%D unicodeposition, unicodeone, unicodetwo}
%D
-%D For the moment \UNICODE\ support is rather primitive but
-%D nevertheless effective. The reference to \UNICODE\ is not
-%D entirely correct, since in many cases one will use \quote
-%D {older} mappings, but in principle, \UNICODE\ can be
-%D supported.
-%D
+%D For the moment \UNICODE\ support is rather primitive but
+%D nevertheless effective. The reference to \UNICODE\ is not
+%D entirely correct, since in many cases one will use \quote
+%D {older} mappings, but in principle, \UNICODE\ can be
+%D supported.
+%D
%D We expect each character to come as two eight bit
%D characters. Those doubles are handled by making all
%D characters in the range $>127$ active, so that they can
@@ -67,64 +67,64 @@
%D pair with \type {\string} or \type {\char}, but this was
%D not that handy when it came to testing those values.
%D Because in principle we are dealing with an encoding, the
-%D making active is handled in \type {enco-uni}.
-%D
-%D There are two commands to handle unicode characters:
-%D
-%D \starttypen
+%D making active is handled in \type {enco-uni}.
+%D
+%D There are two commands to handle unicode characters:
+%D
+%D \starttypen
%D \handleunicodeflowglyph{number}{character}
%D \uchar{number}{number}
%D \stoptypen
-%D
-%D The first one can be assigned to an active character, the
-%D second one can be used to directly access a glyph. Both
-%D command call \type {\handleunicodeglyph} that in turn
-%D calls \type {\insertunicodeglyph}. Both can be overruled
-%D in specialized modules. The low level command \type
-%D {\unicodeglyph} can best be left untouched, which is not
+%D
+%D The first one can be assigned to an active character, the
+%D second one can be used to directly access a glyph. Both
+%D command call \type {\handleunicodeglyph} that in turn
+%D calls \type {\insertunicodeglyph}. Both can be overruled
+%D in specialized modules. The low level command \type
+%D {\unicodeglyph} can best be left untouched, which is not
%D so much a problem because there is a hook into this macro:
-%D \type {\unicodecharcommand}.
-%D
+%D \type {\unicodecharcommand}.
+%D
%D In most cases one will redefine \type {\handleunicodeglyph}
%D in such a way that it identifies special situations first,
%D takes some actions next, calls \type {\insertunicodeglyph},
%D if needed with \type {\unicodecharcommand} changed, and
-%D finally does some finishing:
-%D
-%D \starttyping
+%D finally does some finishing:
+%D
+%D \starttyping
%D \def\handleunicodeglyph
-%D {take actions based on \unicodeone-two-position cq. \nextglyph
+%D {take actions based on \unicodeone-two-position cq. \nextglyph
%D redefine \unicodecharcommand if needed
-%D expand \insertunicodeglyph
+%D expand \insertunicodeglyph
%D take some final actions}
-%D \stoptyping
+%D \stoptyping
\newcount\unicodeposition
% \def\handleunicodeflowglyph#1#2%
% {\def\dohandleunicodeflowglyph{\dodohandleunicodeflowglyphA{#1}{#2}}%
% \futurelet\nextglyph\dohandleunicodeflowglyph}
-%
-% %D The first alternative (A) takes a character as second
-% %D argument and is used in the primary handler introduced
-% %D earlier.
-%
+%
+% %D The first alternative (A) takes a character as second
+% %D argument and is used in the primary handler introduced
+% %D earlier.
+%
% \def\dodohandleunicodeflowglyphA#1#2%
% {\bgroup
-% \def\unicodeone{#1}%
-% \edef\unicodetwo{\number\expandafter`\string#2}% takes also <128 !
+% \def\unicodeone{#1}%
+% \edef\unicodetwo{\number\expandafter`\string#2}% takes also <128 !
% \unicodeposition=\unicodeone\unicodetwo\relax
% \handleunicodeglyph
% \egroup}
-%
-% %D The second alternative (B) takes numbers and is used in
-% %D the \type {\uchar} command. This command takes two
-% %D decimal numbers.
-%
+%
+% %D The second alternative (B) takes numbers and is used in
+% %D the \type {\uchar} command. This command takes two
+% %D decimal numbers.
+%
% \def\dodohandleunicodeflowglyphB#1#2%
% {\bgroup
-% \def\unicodeone{#1}%
-% \def\unicodetwo{#2}%
+% \def\unicodeone{#1}%
+% \def\unicodetwo{#2}%
% \unicodeposition=\unicodeone\unicodetwo\relax
% \handleunicodeglyph
% \egroup}
@@ -133,9 +133,9 @@
% {\let\nextglyph\relax
% \dodohandleunicodeflowglyphB}
-%D The multistep approach is needed to pick up the second
-%D token, since this token can have any value and any
-%D catcode.
+%D The multistep approach is needed to pick up the second
+%D token, since this token can have any value and any
+%D catcode.
%\def\handleunicodeflowglyph#1%
% {\bgroup
@@ -147,12 +147,12 @@
% {\futurelet\nextglyph\dodohandleunicodeflowglyph}
%
%\def\dodohandleunicodeflowglyph%
-% {\edef\unicodetwo{\the\nexttoken}%
+% {\edef\unicodetwo{\the\nexttoken}%
% \unicodeposition\unicodeone\unicodetwo\relax
% \handleunicodeglyph
% \egroup}
-% the \relax trick prevents eating up the space (needed for
+% the \relax trick prevents eating up the space (needed for
% korean
\def\handleunicodeflowglyph#1#2%
@@ -170,11 +170,11 @@
\handleunicodeglyph
\egroup}
-\unexpanded\def\uchar#1#2% use as standalone glyph
+\unexpanded\def\uchar#1#2% use as standalone glyph
{\bgroup
\let\nextglyph\relax
- \edef\unicodeone{#1}%
- \edef\unicodetwo{#2}%
+ \edef\unicodeone{#1}%
+ \edef\unicodetwo{#2}%
% \unicodeposition=\unicodeone\unicodetwo\relax
\unicodeposition\unicodeone\unicodetwo\relax
\handleunicodeglyph
@@ -192,105 +192,105 @@
\edef\unicodetwo{#2}%
\futurelet\nextglyph\dohandleucflowglyph}
-% Alternative, handles [char >127]{number} too.
+% Alternative, handles [char >127]{number} too.
%
% \def\handleunicodeflowglyph#1%
% {\bgroup
% \edef\unicodeone{#1}%
% \futurelet\nexttoken\dohandleunicodeflowglyph}
-%
+%
% \def\dohandleunicodeflowglyph%
% {\ifx\nexttoken\bgroup
% \expandafter\dohandleunicodeflowglyphA
% \else
% \expandafter\dohandleunicodeflowglyphB
% \fi}
-%
+%
% \def\dohandleunicodeflowglyphA#1%
% {\chardef\nexttoken=#1\relax
% \dodohandleunicodeflowglyph}
-%
+%
% \def\dohandleunicodeflowglyphB%
% {\@EA\afterassignment\@EA\dodohandleunicodeflowglyph
% \@EA\chardef\@EA\nexttoken\@EA=\@EA`\string}
-%
+%
% \def\dodohandleunicodeflowglyph%
% {\futurelet\nextglyph\dododohandleunicodeflowglyph}
-%
-% \def\dododohandleunicodeflowglyph%
-% {\edef\unicodetwo{\the\nexttoken}%
+%
+% \def\dododohandleunicodeflowglyph%
+% {\edef\unicodetwo{\the\nexttoken}%
% \unicodeposition=\unicodeone\unicodetwo\relax
% \handleunicodeglyph
% \egroup}
%
-% Can be used with (the less byte hungry alternative):
+% Can be used with (the less byte hungry alternative):
%
% sub unirecode
% { my ($a,$b) = @_ ;
% if ((ord($b)<0x80)&&($b !~ /[a-zA-Z0-9]/))
-% { print "$b" ; ++$recoded ;
-% #return "\\uc\{" . ord($a) . "\}\{". ord($b) . "\}" }
-% return "$a\{". ord($b) . "\}" }
+% { print "$b" ; ++$recoded ;
+% #return "\\uc\{" . ord($a) . "\}\{". ord($b) . "\}" }
+% return "$a\{". ord($b) . "\}" }
% else
-% { return "$a$b" } }
+% { return "$a$b" } }
\def\insertunicodeglyph
{\unicodeglyph\unicodeone\unicodetwo}
\let\handleunicodeglyph=\insertunicodeglyph
-%D One can use the \type {\unicodeposition} in the macros
-%D that handle pre and post material.
+%D One can use the \type {\unicodeposition} in the macros
+%D that handle pre and post material.
-%D \macros
+%D \macros
%D {unicodestyle, unicodecharcommand}
%D
-%D Each character pair will become one glyph. Because \TEX\
-%D cannot handle fonts with more that 256 characters, we use
-%D \TFM\ files for each range. The first character of the pair
+%D Each character pair will become one glyph. Because \TEX\
+%D cannot handle fonts with more that 256 characters, we use
+%D \TFM\ files for each range. The first character of the pair
%D is appended to the name of a font, and the second is used to
-%D access the glyph in that font. This means that a particular
-%D font is split up in subfonts with names in the range:
-%D
+%D access the glyph in that font. This means that a particular
+%D font is split up in subfonts with names in the range:
+%D
%D \starttypen
%D <filename>80 ... <filename>ff
%D \stoptypen
-%D
+%D
%D The \type {<filename>} as well as the composed name are
%D mapped ones. The next macros take care of this mapping.
-%D Let us assume that the next mapping has taken place,
-%D
-%D \starttyping
-%D \definefontsynonym [UnicodeRegular] [gbsong]
+%D Let us assume that the next mapping has taken place,
+%D
+%D \starttyping
+%D \definefontsynonym [UnicodeRegular] [gbsong]
%D \stoptyping
-%D
+%D
%D Let us also assume that we are dealing with the range \type
-%D {b1}. Given that a font name results from:
-%D
-%D \starttyping
+%D {b1}. Given that a font name results from:
+%D
+%D \starttyping
%D \truefontname{\truefontname{UnicodeRegular}b1}
%D \stoptyping
-%D
-%D we get \type {gbsongb1}. The outer \type {\truefontname}
-%D takes care of additional mapping, so when we say:
-%D
-%D \starttyping
-%D \definefontsynonym [gbsongb1] [gbsong-b1]
+%D
+%D we get \type {gbsongb1}. The outer \type {\truefontname}
+%D takes care of additional mapping, so when we say:
+%D
+%D \starttyping
+%D \definefontsynonym [gbsongb1] [gbsong-b1]
%D \stoptyping
-%D
-%D the filename used will be \type {gbsong-b1}. From the next
-%D definition it will be clear that other fontshapes are also
-%D supported. The prefix \type {Unicode} is mapped!
%D
-%D The command \type {\unicodecharcommand} can be used to
-%D handle special cases. At that moment \type {1em} is known.
+%D the filename used will be \type {gbsong-b1}. From the next
+%D definition it will be clear that other fontshapes are also
+%D supported. The prefix \type {Unicode} is mapped!
+%D
+%D The command \type {\unicodecharcommand} can be used to
+%D handle special cases. At that moment \type {1em} is known.
\def\unicodestyle
{\truefontname\s!Unicode\fontstylesuffix}
\let\unicodecharcommand\firstofoneargument
-% \unexpanded\def\unicodeglyph#1#2% watch the double mapping
+% \unexpanded\def\unicodeglyph#1#2% watch the double mapping
% {\bgroup
% \bodyfontsize=\unicodescale\bodyfontsize
% \font\unicodefont=\truefontname{\truefontname\unicodestyle\lchexnumbers{#1}}
@@ -307,12 +307,12 @@
\unicodestrut\unicodefont\unicodecharcommand{\char\unicodetwo\relax}%
\egroup}
-%D \macros
+%D \macros
%D {currentucharmapping,defineucharmapping}
%D
-%D A (plane,char) pair can be remapped using a uchar mapping
+%D A (plane,char) pair can be remapped using a uchar mapping
%D function. The default mapping is to convert the plane to a
-%D lowercase hexadecimal number, and leave the number
+%D lowercase hexadecimal number, and leave the number
%D untouched. The current remapping is kept in a macro.
\let\currentucharmapping\s!default
@@ -323,9 +323,9 @@
\defineucharmapping{\s!default}#1#2%
{\edef\unicodeone{\lchexnumbers{#1}}\edef\unicodetwo{#2}}
-%D An example of a remapping is the following:
-%D
-%D \starttypen
+%D An example of a remapping is the following:
+%D
+%D \starttypen
%D \defineucharmapping{GBK}#1#2%
%D {\unicodeposition=#1
%D \advance\unicodeposition -129
@@ -334,36 +334,38 @@
%D \advance\unicodeposition-\ifnum#2>127 65\else64\fi
%D \dorepositionunicode}
%D \stoptypen
-%D
-%D This maps the GBK vector onto a compact GBK one. The
-%D auxiliary macro is defined here as a goody.
+%D
+%D This maps the GBK vector onto a compact GBK one. The
+%D auxiliary macro is defined here as a goody.
\def\dorepositionunicode
- {\DoDiv\unicodeposition by256to\scratchcounter
- \advance\scratchcounter 1
+ {\dosetdivision\unicodeposition{256}\scratchcounter
+ %\DoDiv\unicodeposition by256to\scratchcounter
+ \advance\scratchcounter \plusone
\edef\unicodeone{\ifnum\scratchcounter<10 0\fi\the\scratchcounter}%
- \DoMod\unicodeposition by256to\scratchcounter
+ \dosetmodulo\unicodeposition{256}\scratchcounter
+ %\DoMod\unicodeposition by256to\scratchcounter
\edef\unicodetwo{\the\scratchcounter}}
-%D \macros
-%D {setunicodestrut, setunicodescale, nextglyph,
+%D \macros
+%D {setunicodestrut, setunicodescale, nextglyph,
%D handleunicodeglyph, insertunicodeglyph}
%D
-%D A careful analysis of the previous macros, learns that the
-%D process of mapping comes down to:
-%D
+%D A careful analysis of the previous macros, learns that the
+%D process of mapping comes down to:
+%D
%D \startopsomming[opelkaar,n]
-%D \som taking care of preceding material (and spacing)
-%D \som defining the font at \type {\currentfontscale} $\times$
-%D \type {\unicodescale} $\times$ \type {\bodyfontsize}
+%D \som taking care of preceding material (and spacing)
+%D \som defining the font at \type {\currentfontscale} $\times$
+%D \type {\unicodescale} $\times$ \type {\bodyfontsize}
%D \som inserting a \type {\unicodestrut}
-%D \som inserting the character (glyph)
+%D \som inserting the character (glyph)
%D \som executing some actions afterwards
%D \stopopsomming
%D
-%D The actions before and after placing the glyph, is up to
-%D the user supplied handler. This handler (\type
-%D {\handleunicodeglpyh}) must, at a certain moment, insert
+%D The actions before and after placing the glyph, is up to
+%D the user supplied handler. This handler (\type
+%D {\handleunicodeglpyh}) must, at a certain moment, insert
%D the glyph using \type {\insertunicodeglyph}
\def\setunicodescale#1%
@@ -386,26 +388,26 @@
\let\unicodestrut\empty
\fi\fi}
-%D The additional scaling and strut default to:
+%D The additional scaling and strut default to:
\setunicodescale{1}
\setunicodestrut{1}{1}
-%D The actual code for the additional actions as well as
-%D specific spacing is handled outside these routines. The
-%D character after the two that are under treatment is
+%D The actual code for the additional actions as well as
+%D specific spacing is handled outside these routines. The
+%D character after the two that are under treatment is
%D available in \type {\nextglyph}.
-%D \macros
+%D \macros
%D {defineunicodefont, setupunicodefont}
%D
-%D Apart from this rather low level implementation, we also
-%D provide a more user friendly alternative. Given that one
-%D has defined:
-%D
-%D \starttypen
+%D Apart from this rather low level implementation, we also
+%D provide a more user friendly alternative. Given that one
+%D has defined:
+%D
+%D \starttypen
%D \defineunicodefont
-%D [SimChi] [SimplifiedChinese]
+%D [SimChi] [SimplifiedChinese]
%D [ \c!schaal=0.85,
%D \c!hoogte=1.25,
%D \c!diepte=1.00,
@@ -413,25 +415,25 @@
%D \c!conversie=\chinesenumber,
%D \c!commando=\handlechineseunicodeglyph]
%D \stoptypen
-%D
-%D Together with:
-%D
-%D \starttypen
-%D \definefontsynonym [SimplifiedChineseRegular] [gbsong]
-%D \definefontsynonym [SimplifiedChineseSlanted] [gbsongsl]
+%D
+%D Together with:
+%D
+%D \starttypen
+%D \definefontsynonym [SimplifiedChineseRegular] [gbsong]
+%D \definefontsynonym [SimplifiedChineseSlanted] [gbsongsl]
%D \stoptypen
-%D
-%D we can now switch to Simplified Chinese by saying \type
-%D {SimChi}. Some values can be changed afterwards with
%D
-%D \starttypen
+%D we can now switch to Simplified Chinese by saying \type
+%D {SimChi}. Some values can be changed afterwards with
+%D
+%D \starttypen
%D \setupunicodefont[SimChi][...=...]
%D \stoptypen
%D
-%D Specific initializations can be assigned to \type
-%D {commands}.
+%D Specific initializations can be assigned to \type
+%D {commands}.
-\beginTEX
+\beginTEX
\def\unicodeTEXwarning
{\writeline\showmessage\m!fonts{21}\empty\writeline
@@ -473,14 +475,14 @@
\def\setupunicodefont
{\dodoubleempty\dosetupunicodefont}
-\def\dosetupunicodefont[#1][#2]% also predefines
+\def\dosetupunicodefont[#1][#2]% also predefines
{\doifundefined{\??uc#1\c!commando}
{\copyparameters
[\??uc#1][\??uc\s!default]
[\c!hoogte,\c!diepte,\c!schaal,\c!commandos,
\c!interlinie,\c!commando,\c!conversie]}%
\getparameters[\??uc#1][#2]}
-
+
\def\enableunicodefont#1%
{\definefontsynonym[\s!Unicode][\getvalue{\??uc#1\c!file}]%
\def\unicodescale {\getvalue{\??uc#1\c!schaal}}%
@@ -492,16 +494,16 @@
\doifvalue{\??uc#1\c!interlinie}\v!ja\setupinterlinespace\relax
\getvalue{\??uc#1\c!commandos}\relax}
-%D \macros
+%D \macros
%D {unicodedigits}
-%D
-%D For convenience we also predefine a number conversion
-%D macro:
+%D
+%D For convenience we also predefine a number conversion
+%D macro:
\let\unicodedigits\number
-%D Because we cannot be sure of the pressence of all font
-%D styles, we remap some by default.
+%D Because we cannot be sure of the pressence of all font
+%D styles, we remap some by default.
\definefontsynonym [\s!Unicode\s!Bold] [\s!Unicode\s!Regular]
\definefontsynonym [\s!Unicode\s!Slanted] [\s!Unicode\s!Regular]
@@ -518,4 +520,4 @@
\c!commando=\insertunicodeglyph,
\c!conversie=\number]
-\protect \endinput
+\protect \endinput
diff --git a/tex/context/base/java-fld.tex b/tex/context/base/java-fld.tex
index 6c77cdf55..5ef34bd58 100644
--- a/tex/context/base/java-fld.tex
+++ b/tex/context/base/java-fld.tex
@@ -131,8 +131,8 @@
\startJSpreamble {Field} used now
-function PresetFields ()
- { this.syncAnnotScan() }
+function PresetFields ()
+ { this.syncAnnotScan() }
var visible_field = new Array() ; % no garbage collection !
var visible_fields = 0 ;
@@ -146,7 +146,7 @@ function Hide_Field ( Name )
if (v)
{ v.hidden = true ;
% { v.display = display.hidden ;
- v.readonly = true ;
+ v.readonly = true ;
this.dirty = false } }
function Do_Vide_Field ( Name, Closable )
@@ -156,16 +156,16 @@ function Do_Vide_Field ( Name, Closable )
visible_field[visible_fields] = Name ;
v.hidden = false ;
% v.display = display.visible ;
- if (Closable)
- { v.readonly = false ;
- v.value = "On" }
+ if (Closable)
+ { v.readonly = false ;
+ v.value = "On" }
this.dirty = false } }
function Vide_Field ( Name )
- { Do_Vide_Field(Name,false) }
+ { Do_Vide_Field(Name,false) }
function Vide_Hide_Field ( Name )
- { Do_Vide_Field(Name,true) }
+ { Do_Vide_Field(Name,true) }
function Hide_Fields ()
{ while (visible_fields>0)
@@ -182,12 +182,12 @@ function Vide_Hide_Fields ( Name ) % show only one field
function Toggle_Hide ( Name )
{ var v = this.getField(Name) ;
- if (v)
- { v.hidden = !v.hidden ;
+ if (v)
+ { v.hidden = !v.hidden ;
% if v.display == display.hidden
- % { v.display = display.visible }
- % else
- % { v.display = display.hidden }
+ % { v.display = display.visible }
+ % else
+ % { v.display = display.hidden }
this.dirty = false } }
function Field_On ( Name )
@@ -204,7 +204,7 @@ function Toggle_Value ( Name )
{ if (v.value=="On")
{ v.value = "Off" }
else
- { v.value = "On" } }
+ { v.value = "On" } }
this.dirty = false }
function Toggle_Read ( Name )
@@ -218,9 +218,9 @@ function Flip_Fields ( Name )
if (v)
{ v.hidden = !v.hidden ;
% if v.display == display.hidden
- % { v.display = display.visible }
- % else
- % { v.display = display.hidden }
+ % { v.display = display.visible }
+ % else
+ % { v.display = display.hidden }
v.value = "On" } } }
function Forget_Changes ()
@@ -297,4 +297,4 @@ function Walk_Field ( FieldSet )
\stopJSpreamble
-\endinput
+\endinput \ No newline at end of file
diff --git a/tex/context/base/lang-ger.tex b/tex/context/base/lang-ger.tex
index 4a46f8755..7e95f5936 100644
--- a/tex/context/base/lang-ger.tex
+++ b/tex/context/base/lang-ger.tex
@@ -83,7 +83,8 @@
\c!rightquote=\upperrightsinglesixquote,
\c!leftquotation=\lowerleftdoubleninequote,
\c!rightquotation=\upperrightdoublesixquote,
- \c!datum={\v!dag,{.},\ ,\v!maand,\ ,\v!jaar}]
+ \c!datum={\v!dag,{.},\ ,\v!maand,\ ,\v!jaar},
+ \c!status=\v!stop]
\installlanguage
[\s!sv]
diff --git a/tex/context/base/lang-ini.tex b/tex/context/base/lang-ini.tex
index caf6229d7..223531299 100644
--- a/tex/context/base/lang-ini.tex
+++ b/tex/context/base/lang-ini.tex
@@ -206,6 +206,7 @@
%D values are set.
\let\preloadedpatterns\empty
+\let\preloadedpmessage\empty
\def\showpatterns#1%
{\getvalue{\??la#1\s!lefthyphenmin}%
@@ -213,8 +214,8 @@
\getvalue{\??la#1\s!righthyphenmin} }
\def\preloadlanguages
- {\doifsomething\preloadedpatterns
- {\showmessage\m!linguals{10}\preloadedpatterns}}
+ {\doifsomething\preloadedpmessage
+ {\showmessage\m!linguals{10}\preloadedpmessage}}
\let\installedlanguages\empty
@@ -349,13 +350,15 @@
%\def\patterns##1{\message{#1/#2/#3/#4/##1}\normalpatterns{##1}}%
\readsysfile{\truefilename{\f!languageprefix#2.\f!patternsextension}}
{\setxvalue{\??la#1\s!patterns}{#2}%
- \xdef\preloadedpatterns
- {\preloadedpatterns
+ \xdef\preloadedpmessage
+ {\preloadedpmessage
\number\normallanguage:\showpatterns{#2}}%
+ \doglobal\addtocommalist{#2}\preloadedpatterns
\showmessage\m!linguals1{#2,#1,\loadedlanguage}}
{\readsysfile{\f!languageprefix#2.\f!patternsextension}
{\setxvalue{\??la#1\s!patterns}{#2}%
- \xdef\preloadedpatterns{\preloadedpatterns\showpatterns{#2}}%
+ \xdef\preloadedpmessage{\preloadedpmessage\showpatterns{#2}}%
+ \doglobal\addtocommalist{#2}\preloadedpatterns
\showmessage\m!linguals1{#2,#1,\loadedlanguage}}
{\showmessage\m!linguals2{#2,#1,\loadedlanguage}}}%
\readsysfile{\truefilename{\f!languageprefix#2.\f!hyphensextension}}
@@ -370,6 +373,9 @@
\egroup
\increment\loadedlanguage}
+\def\doifpatternselse#1%
+ {\expanded{\doifinsetelse{#1}{\preloadedpatterns}}}
+
%D Since we can only load patterns in ini\TeX, we nil the
%D loading before dumping (which saves a bit of memory, but
%D strangely enough not in the format).
@@ -386,12 +392,24 @@
%D
%D \showsetup{\y!setuplanguage}
-\def\setuplanguage
- {\dodoubleargument\dosetuplanguage}
+% \def\setuplanguage
+% {\dodoubleargument\dosetuplanguage}
+
+% \def\dosetuplanguage[#1][#2]%
+% {\getparameters[\??la#1][#2]%
+% \doif{#1}\currentlanguage\docomplexlanguage}
+
+\unprotected \def\setuplanguage
+ {\dodoubleempty\dosetuplanguage}
-\def\dosetuplanguage[#1][#2]%
- {\getparameters[\??la#1][#2]%
- \doif{#1}\currentlanguage\docomplexlanguage}
+\def\dosetuplanguage[#1][#2]% handy patch for testing
+ {\ifsecondargument
+ \getparameters[\??la#1][#2]%
+ \doif{#1}\currentlanguage\docomplexlanguage
+ \else
+ \getparameters[\??la\currentlanguage][#1]%
+ \docomplexlanguage
+ \fi}
%D The values \type {\c!leftsentence} and \type
%D {\c!rightsentence} can be (and are) used to implement
@@ -464,7 +482,7 @@
\@EAEAEA\firstofoneargument
\else
\donetrue
- \global\@EA\xdef\csname\??la\currentlanguage\s!patterns\endcsname{#2}%
+ \@EA\xdef\csname\??la\currentlanguage\s!patterns\endcsname{#2}%
\normallanguage\csname\??la\??la#1#2\endcsname\relax % \relax is needed for lookahead problems
\@EAEAEA\gobbleoneargument
\fi\fi}
@@ -480,7 +498,7 @@
\@EAEAEA\firstofoneargument
\else
\donetrue
- \global\@EA\xdef\csname\??la\currentlanguage\s!patterns\endcsname{#2}%
+ \@EA\xdef\csname\??la\currentlanguage\s!patterns\endcsname{#2}%
\normallanguage\thenormallanguage\relax % \relax is needed for lookahead problems
\@EAEAEA\gobbleoneargument
\fi
@@ -845,4 +863,4 @@
\appendtoks\showmessage\m!linguals9\currentlanguage\to\everyjob
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/lang-lab.tex b/tex/context/base/lang-lab.tex
index 4e3886770..47913874c 100644
--- a/tex/context/base/lang-lab.tex
+++ b/tex/context/base/lang-lab.tex
@@ -8,8 +8,8 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
\writestatus{loading}{Language Head and Label Texts}
@@ -22,13 +22,13 @@
%D
%D This module is dedicated to the grandfather of Tobias
%D Burnus, who's extensive languages oriented library helped us
-%D a lot in finding the right translations. All those labels
+%D a lot in finding the right translations. All those labels
%D are collected in files that reflect their common ancestor.
%D
%D Not all languages can be satisfied with the labeling
%D mechanism as provided here. Chinese for instance put a label
-%D in front as well as after a part number. This is why the
-%D current implementation of labels supports two labels too.
+%D in front as well as after a part number. This is why the
+%D current implementation of labels supports two labels too.
%D \macros
%D {setupheadtext, setuplabeltext}
@@ -66,11 +66,11 @@
\def\xdosetupsometextprefix[#1][#2=#3]%
{\doassignsometextprefix[#1#2][#3,,]}
-%D By changing the meaning of \type {\handletextprefix} we
-%D can filter the left and right labeltext as well as convert
-%D labels to uppercase.
+%D By changing the meaning of \type {\handletextprefix} we
+%D can filter the left and right labeltext as well as convert
+%D labels to uppercase.
%D
-%D These commands accept all kind of inputs:
+%D These commands accept all kind of inputs:
%D
%D \starttypen
%D \setuplabeltext [language] [label=text]
@@ -78,11 +78,11 @@
%D \setuplabeltext [label=text]
%D \setuplabeltext [label=text,label=text,...]
%D \stoptypen
-%D
-%D The last two cases concern the current language.
+%D
+%D The last two cases concern the current language.
%D \macros
-%D {headtext,
+%D {headtext,
%D labeltext, leftlabeltext, rightlabeltext, labeltexts,
%D LABELTEXT, LEFTLABELTEXT, RIGHTLABELTEXT, LABELTEXTS}
%D
@@ -138,7 +138,7 @@
\unexpanded\def\LABELTEXTS#1#2{\LEFTLABELTEXT{#1}#2\RIGHTLABELTEXT{#1}}
\newif\iflabeltextdone % needs to be reset elsewhere
-\newif\iftracelabels % shows missing labels
+\newif\iftracelabels % shows missing labels
\def\doreporttextprefixerror#1#2#3%
{\iftracelabels{\tttf[#2:~#3/#1]~}\fi}
@@ -147,8 +147,8 @@
{\bgroup
\let\handletextprefix\firstoftwoarguments
\let\reporttextprefixerror\gobblethreearguments
- \keepencodedtokens % test on multilingual pascal, ok in stretched
- %\dontexpandencodedtokens % not usable in token handler
+ \keepencodedtokens % test on multilingual pascal, ok in stretched
+ %\dontexpandencodedtokens % not usable in token handler
\expanded
{\egroup\noexpand\def\noexpand#2% watch out, no \edef
{\dogetupsometextprefix{\headlanguage}{#1}{#3}}}}
@@ -192,17 +192,17 @@
\endTEX
-\ifx\simplifiedcommands\undefined \newtoks\simplifiedcommands \fi
-
-\appendtoks
- \let \headtext \firstofoneargument
- \let \labeltext \firstofoneargument
- \let \leftlabeltext \firstofoneargument
- \let \rightlabeltext \firstofoneargument
- \let \HEADTEXT \firstofoneargument
- \let \LABELTEXT \firstofoneargument
- \let \LEFTLABELTEXT \firstofoneargument
- \let \RIGHTLABELTEXT \firstofoneargument
+\ifx\simplifiedcommands\undefined \newtoks\simplifiedcommands \fi
+
+\appendtoks
+ \let \headtext \firstofoneargument
+ \let \labeltext \firstofoneargument
+ \let \leftlabeltext \firstofoneargument
+ \let \rightlabeltext \firstofoneargument
+ \let \HEADTEXT \firstofoneargument
+ \let \LABELTEXT \firstofoneargument
+ \let \LEFTLABELTEXT \firstofoneargument
+ \let \RIGHTLABELTEXT \firstofoneargument
\to \simplifiedcommands
%D \macros
@@ -240,7 +240,7 @@
%D which expands to {\em something} or {\em iets}, depending on
%D de current language.
-\def\dotranslate[#1]% don't group! SLOW if really used: speed up
+\def\dotranslate[#1]% don't group! SLOW if really used: speed up
{\getparameters[\??lg][#1]%
\doifdefinedelse{\??lg\currentlanguage}%
{\getvalue{\??lg\currentlanguage}}
@@ -274,4 +274,4 @@
{\getparameters[\??lg][#1]%
\edef#2{\csname\??lg\currentlanguage\endcsname}}
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/m-pstric.tex b/tex/context/base/m-pstric.tex
index 34aee9cbe..bd87e9f13 100644
--- a/tex/context/base/m-pstric.tex
+++ b/tex/context/base/m-pstric.tex
@@ -71,7 +71,7 @@
{\bgroup
\setbuffer[pstricks]%
\usemodule[pstric]%
- \setbox\scratchbox=\hbox{#2}%
+ \setbox\scratchbox\hbox{#2}%
% There is probably a nicer way to handle this
\immediate\openout\scratchwrite=\bufferprefix dim.tmp
\immediate\write\scratchwrite{\dimen0=\the\ht\scratchbox}%
@@ -91,9 +91,9 @@
\readlocfile{\bufferprefix pstricks-dim.tmp}{}{}%
% Since the graphic is put on a page (sigh) by dvips/gs
% we need to shift it around a bit.
- \setbox\scratchbox=\hbox
+ \setbox\scratchbox\hbox
{\externalfigure[\bufferprefix pstricks.pdf][\c!object=\v!nee]}%
- \setbox\scratchbox=\hbox
+ \setbox\scratchbox\hbox
{\lower\ht\scratchbox\hbox{\raise\dimen2\box\scratchbox}}%
\wd\scratchbox\dimen0
\ht\scratchbox\dimen2
@@ -101,10 +101,10 @@
\box\scratchbox
\egroup}}
-\fi
+\fi
\long\def\dostartPSTRICKS[#1]#2\stopPSTRICKS
- {\doifelse{\jobsuffix}{dvi} % will some day move to app as switch
+ {\doifelse{\jobsuffix}{dvi} % will some day move to app as switch
{\hbox{#2}}
{\startTEXapplication[#1]{\usemodule[pstric]}#2\stopTEXapplication}}
diff --git a/tex/context/base/m-tryout.tex b/tex/context/base/m-tryout.tex
index 0a5374562..23fc56c8c 100644
--- a/tex/context/base/m-tryout.tex
+++ b/tex/context/base/m-tryout.tex
@@ -2,29 +2,29 @@
%D [ file=m-tryout,
%D version=2002.05.10,
%D title=\CONTEXT\ Extra Modules,
-%D subtitle=Tryout Features,
+%D subtitle=Tryout Features,
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
-\unprotect
+\unprotect
-%D The following macros make sure that active colons work well
-%D in French, a feature enabled with:
-%D
+%D The following macros make sure that active colons work well
+%D in French, a feature enabled with:
+%D
%D \starttypen
%D \useencoding[ffr] \mainlanguage[fr]
-%D \stoptypen
-%D
-%D This trick will disappear when proved robust.
+%D \stoptypen
+%D
+%D This trick will disappear when proved robust.
\startmode[activecolon]
-\gdef\sectionseparator{-}
+\gdef\sectionseparator{-}
\gdef\@@filterfirstpart [#1--#2]{#1}
\gdef\@@filtersecondpart [#1--#2]{#2}
@@ -48,4 +48,4 @@
\stopmode
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/math-fou.tex b/tex/context/base/math-fou.tex
index 4d21ff887..9d4fed216 100644
--- a/tex/context/base/math-fou.tex
+++ b/tex/context/base/math-fou.tex
@@ -69,6 +69,7 @@
\definemathcharacter [91] [nothing] [mr] ["5B] [ex] ["A3] % [
\definemathcharacter [93] [nothing] [mr] ["5D] [ex] ["A4] % ]
\definemathcharacter [/] [nothing] [mr] ["2F] [ex] ["B1]
+
\definemathcharacter [124] [nothing] [sy] ["6A] [ex] ["AF] % |
\definemathcharacter [92] [nothing] [sy] ["6E] [ex] ["B2] % \
diff --git a/tex/context/base/math-ini.tex b/tex/context/base/math-ini.tex
index 009c33df0..a18309c74 100644
--- a/tex/context/base/math-ini.tex
+++ b/tex/context/base/math-ini.tex
@@ -1,8 +1,8 @@
%D \module
%D [ file=math-ini,
-%D version=2001.04.12,
+%D version=2001.04.12,
%D title=\CONTEXT\ Math Macros,
-%D subtitle=Basic Macros,
+%D subtitle=Basic Macros,
%D author={Hans Hagen \& Taco Hoekwater},
%D date=\currentdate,
%D copyright=\PRAGMA]
@@ -11,6 +11,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+% todo: make all definitions global since file loaded only once
+
%D This module provides namespaces for math fonts, thereby
%D permitting mixed usage of math fonts. Although not strictly
%D needed, we also provide a family name mapping mechanism as
@@ -21,13 +23,13 @@
%D fallback. We've tried to follow a couple of conventions
%D from plain and AMS math in order to achieve backward
%D compatinility. We also kept an eye on future usage of these
-%D modules in the perspective of MathML and unicode fonts.
+%D modules in the perspective of MathML and unicode fonts.
\unprotect
-\def\@ml@{@ml@} % math list (used for collection)
+\def\@ml@{@ml@} % math list (used for collection)
\def\@mf@{@mf@} % math family
-%def\@mh@{@mh@} % math handler (not used)
+%def\@mh@{@mh@} % math handler (not used)
\def\@mt@{@mt@} % math token
\def\@mc@{@mc@} % math collection
@@ -45,10 +47,10 @@
\chardef\mathalphacode = 7 \let\mathalphacomm \firstofoneargument
\chardef\mathinnercode = 0 \let\mathinnercomm \mathinner
\chardef\mathnothingcode= 0 \let\mathnothingcomm \firstofoneargument
-\chardef\mathlimopcode = 1 \let\mathlimopcomm \@@mathlimopcomm
-\chardef\mathnolopcode = 1 \let\mathnolopcomm \@@mathnolopcomm
-\chardef\mathchoicecode = 0 \let\mathchoicecomm \@@mathchoicecomm
-\chardef\mathboxcode = 0 \let\mathboxcomm \@@mathboxcomm
+\chardef\mathlimopcode = 1 \let\mathlimopcomm \@@mathlimopcomm
+\chardef\mathnolopcode = 1 \let\mathnolopcomm \@@mathnolopcomm
+\chardef\mathchoicecode = 0 \let\mathchoicecomm \@@mathchoicecomm
+\chardef\mathboxcode = 0 \let\mathboxcomm \@@mathboxcomm
\chardef\mathaccentcode = 8
\chardef\mathradicalcode= 9
@@ -73,12 +75,12 @@
\endETEX
-\beginTEX
+\beginTEX
\def\dohandlemathtoken#1%
{\csname\@mt@
\@EA\ifx\csname\@mt@\mathcollection#1\endcsname\relax
- \@EA\ifx\csname\@mt@\nomathcollection#1\endcsname\relax
+ \@EA\ifx\csname\@mt@\nomathcollection#1\endcsname\relax
\else
\nomathcollection
\fi
@@ -89,12 +91,12 @@
\endTEX
-%D Because a command can have a different meaning in math
-%D and in text mode, we provide a selector. We also provide
+%D Because a command can have a different meaning in math
+%D and in text mode, we provide a selector. We also provide
%D the pure alternatives as \type {\mathcharacter} and \type
-%D {\textcharacter}.
+%D {\textcharacter}.
-\ifx\dohandlecommand\undefined \wait \fi % troubles !
+\ifx\dohandlecommand\undefined \wait \fi % troubles !
\let\mathcharacter\dohandlemathtoken
\let\textcharacter\dohandlecommand % better \dohandletexttoken
@@ -124,13 +126,13 @@
\endETEX
-\beginTEX
+\beginTEX
\def\dohandlemathtoken#1%
{\csname
\ifmmode
\@EA\ifx\csname\@mt@\mathcollection#1\endcsname\relax
- \@EA\ifx\csname\@mt@\nomathcollection#1\endcsname\relax
+ \@EA\ifx\csname\@mt@\nomathcollection#1\endcsname\relax
\@EA\ifx\csname\characterencoding#1\endcsname
\nocharacterencoding
\else
@@ -153,7 +155,7 @@
\endTEX
-%D Now we redefine the text encoding handler.
+%D Now we redefine the text encoding handler.
\let\dohandlecommand\dohandlemathtoken
@@ -167,8 +169,10 @@
\setvalue{\@mf@ #1}{#2}%
\fi}
-\def\purefamily #1{\csname \truefamily{#1}\s!fam\endcsname}
-\def\purefamilyhex#1{\csname hex\truefamily{#1}\s!fam\endcsname}
+\let\mathsubfamily\empty
+
+\def\purefamily #1{\csname \truefamily{#1}\mathsubfamily\s!fam\endcsname}
+\def\purefamilyhex#1{\csname hex\truefamily{#1}\mathsubfamily\s!fam\endcsname}
\beginETEX \ifcsname
@@ -204,13 +208,13 @@
\endTEX
-\newif\ifdynamicmathfamilies \dynamicmathfamiliesfalse % true ?
+\newif\ifdynamicmathfamilies \dynamicmathfamiliestrue % true per 2003.11.25; needed for mixed bold math
\let\normalpurefamilyhex\purefamilyhex
-% todo: reset collection (tok legen) en opnieuw laden met true
+% todo: reset collection (tok legen) en opnieuw laden met true
-\def\definemathsymbol%
+\def\definemathsymbol
{\dosixtupleempty\dodefinemathsymbol}
\def\dodefinemathsymbol[#1][#2][#3][#4][#5][#6]%
@@ -229,7 +233,7 @@
\else\iffourthargument
\ifnum\puremathcode{#2}=\mathaccentcode
\mathaccent\else\mathchar
- \fi
+ \fi
"\ifnum\puremathcode{#2}>7 0\else\puremathcode{#2}\fi
\purefamilyhex{#3}\uchexnumbers{#4}\space
\fi\fi}%
@@ -335,7 +339,7 @@
\setmathcollection{#1}%
\the\csname\@ml@\mathcollection\endcsname}
-% hook 'm into the font mechanism
+% hook 'm into the font mechanism
\definefilesynonym[\f!mathprefix\s!default][\f!mathprefix tex]
@@ -353,40 +357,46 @@
\fetchruntimecommand \showmathcharacters {\f!mathprefix\s!run}
\fetchruntimecommand \showmathtoken {\f!mathprefix\s!run}
-%D \macros
-%D {ifmathpunctuation, enablemathpunctuation,
+\def\resetmathcollection[#1]%
+ {\def\mathcollection{#1}%
+ \forgetdoingonce{\f!mathprefix\mathcollection}%
+ \setmathtoks
+ \ifx\mathtoks\relax\else\mathtoks\emptytoks\fi}
+
+%D \macros
+%D {ifmathpunctuation, enablemathpunctuation,
%D definemathpunctuation}
%D
-%D \starttypen
+%D \starttypen
%D \definemathpunctuation . mathperiod textperiod
-%D \definemathpunctuation , mathcomma textcomma
-%D \stoptypen
+%D \definemathpunctuation , mathcomma textcomma
+%D \stoptypen
\newif\ifmathpunctuation
\def\enablemathpunctuation{\mathpunctuationtrue}
\def\definemathpunctuation #1 #2 #3 %
- {\appendtoks
+ {\appendtoks
\initializemathpunctuation{#1}{#2}{#3}%
- \to\everymath}
+ \to\everymath}
-\def\initializemathpunctuation#1#2#3% sloowww
+\def\initializemathpunctuation#1#2#3% sloowww
{\ifmathpunctuation
- \mathcode`#1="8000
+ \mathcode`#1="8000
\defineactivecharacter #1 {\dohandlemathpunctuation{#2}{#3}}%
\fi}
\unexpanded\def\dohandlemathpunctuation#1#2% \if fails in mathml interval
{\def\next{\csname\ifx\space\nexttoken#2\else#1\fi\endcsname}%
\futurelet\nexttoken\next}
-
+
%D \startbuffer
%D \enablemathpunctuationtrue$(1,2) (1, 2) (1{,}2) \hbox{foo, not bar}$
%D \stopbuffer
-%D
+%D
%D \typebuffer
-%D
+%D
%D \blanko{\getbuffer}\blanko
%D needed for sin, cos etc
@@ -416,39 +426,39 @@
\definefamilysynonym [default] [3] [ex]
\enablemathcollection[default]
-
\usemathcollection[default]
+\enablemathcollection[default]
-%D Some goodies:
+%D Some goodies:
\def\Angstrom{\nomathematics{\Aring}}
-%D Bold math:
-%D
-%D \starttypen
+%D Bold math:
+%D
+%D \starttypen
%D \usetypescript [lucida] [texnansi]
-%D
-%D \definetypeface [boldmath] [rm] [serif]
+%D
+%D \definetypeface [boldmath] [rm] [serif]
%D [lucida] [default] [encoding=texnansi]
-%D \definetypeface [boldmath] [tt] [mono]
+%D \definetypeface [boldmath] [tt] [mono]
%D [lucida] [default] [encoding=texnansi]
-%D \definetypeface [boldmath] [ss] [sans]
+%D \definetypeface [boldmath] [ss] [sans]
%D [lucida] [default] [encoding=texnansi]
-%D \definetypeface [boldmath] [mm] [boldmath]
+%D \definetypeface [boldmath] [mm] [boldmath]
%D [lucida] [default] [encoding=texnansi]
-%D
-%D \switchtobodyfont[lucida,10pt]
-%D
+%D
+%D \switchtobodyfont[lucida,10pt]
+%D
%D \showmathtoken{Gamma} $\Gamma \Delta \alpha \delta \zeta$
-%D
-%D \switchtobodyfont[boldmath,10pt]
-%D
+%D
+%D \switchtobodyfont[boldmath,10pt]
+%D
%D \showmathtoken{Gamma} $\Gamma \Delta \alpha \delta \zeta$
-%D \stoptypen
+%D \stoptypen
\protect \endinput
-\tracemathcollectiontrue
+\tracemathcollectiontrue
\input math-tex \page
\setupbodyfont[ams] \enablemathcollection[ams] \input math-ams \page
diff --git a/tex/context/base/math-run.tex b/tex/context/base/math-run.tex
index 3e1cdbf6a..e24acb4d5 100644
--- a/tex/context/base/math-run.tex
+++ b/tex/context/base/math-run.tex
@@ -1,17 +1,17 @@
%D \module
%D [ file=math-run,
-%D version=2001.23.04,
+%D version=2001.23.04,
%D title=\CONTEXT\ Math Macros,
-%D subtitle=Runtime Macros,
+%D subtitle=Runtime Macros,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright=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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
-\unprotect
+\unprotect
\gdef\showmathcharacters% nearly \showcharacters
{\par
@@ -33,7 +33,7 @@
{%\doifcolorelse{math \purefamilyhex{##3}}{}
% {\increment\mathcolor
% \definecolor[math \purefamilyhex{##3}][\mathcolor]}%
- \setbox0=\hbox spread 1em
+ \setbox0=\hbox spread 1em
{$\getvalue{##1}{}$}%
\ifdim\wd0>\dimen0 \dimen0=\wd0 \fi
\setbox2=\hbox spread 1em
@@ -46,7 +46,7 @@
\dimen0=\hsize
\advance\dimen0 2em
\advance\dimen2 2em
- \divide \dimen0 by \dimen2 \advance\dimen0 1sp
+ \divide \dimen0 by \dimen2 \advance\dimen0 1sp
\edef\enccols{\number\dimen0}
\startcolumns[\c!n=\enccols,\c!afstand=2em]
\def\dodefinemathsymbol[##1][##2][##3][##4][##5][##6]%
@@ -74,18 +74,18 @@
\gdef\showmathtoken#1%
{\starttabulate[|lT|lT|lT|l|]
- \NC token \NC #1 \NC \NR
- \NC collection \NC \ifcsname\@mt@\mathcollection#1\endcsname
- \mathcollection
- \else\ifcsname\@mt@\nomathcollection#1\endcsname
+ \NC token \NC #1 \NC \NR
+ \NC collection \NC \ifcsname\@mt@\mathcollection#1\endcsname
+ \mathcollection
+ \else\ifcsname\@mt@\nomathcollection#1\endcsname
\nomathcollection
\else
?%
- \fi\fi \NC \NR
+ \fi\fi \NC \NR
\NC visualization \NC \mathematics{\getvalue{#1}} \NC \NR
- \NC definition \NC \tttf \@EA\convertcommand
+ \NC definition \NC \tttf \@EA \convertcommand
\csname\@mt@\mathcollection#1\endcsname
- \to \ascii \ascii \NC \NR
+ \to \ascii \ascii \NC \NR
\stoptabulate}
-
+
\protect \endinput
diff --git a/tex/context/base/math-tex.tex b/tex/context/base/math-tex.tex
index b5d1760b9..5112cdf0b 100644
--- a/tex/context/base/math-tex.tex
+++ b/tex/context/base/math-tex.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=math-tex,
-%D version=2001.04.12,
+%D version=2001.04.12,
%D title=\CONTEXT\ Math Macros,
%D subtitle=Plain Specials,
%D author={Hans Hagen \& Taco Hoekwater},
@@ -11,14 +11,14 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\unprotect
+\unprotect
-\mathcode`\ ="8000 \mathcode`\_="8000 \mathcode`\'="8000
+\mathcode`\ ="8000 \mathcode`\_="8000 \mathcode`\'="8000
\definefamilysynonym [default] [lcgreek] [mi]
\definefamilysynonym [default] [ucgreek] [mr]
\definefamilysynonym [default] [vargreek] [mi]
-%definefamilysynonym [default] [blackboard] [mb] % extra font
+%definefamilysynonym [default] [blackboard] [mb] % extra font
\startmathcollection [default]
@@ -76,7 +76,7 @@
\definemathsymbol [Mu] [alpha] [ucgreek] ["4D] % M
\definemathsymbol [Nu] [alpha] [ucgreek] ["4E] % N
\definemathsymbol [Xi] [alpha] [ucgreek] ["04]
-\definemathsymbol [Omicron] [alpha] [ucgreek] ["4F] % O
+\definemathsymbol [Omicron] [alpha] [ucgreek] ["4F] % O
\definemathsymbol [Pi] [alpha] [ucgreek] ["05]
\definemathsymbol [Rho] [alpha] [ucgreek] ["52] % R
\definemathsymbol [Sigma] [alpha] [ucgreek] ["06]
@@ -89,8 +89,8 @@
\stopmathcollection
-% The \mfunction macro is an alternative for \hbox with a
-% controlable font switch.
+% The \mfunction macro is an alternative for \hbox with a
+% controlable font switch.
\startmathcollection[default]
@@ -163,9 +163,9 @@
\definemathcharacter [91] [open] [mr] ["5B] % [
\definemathcharacter [92] [ord] [sy] ["6E] % \
\definemathcharacter [93] [close] [mr] ["5D] % ]
-\definemathcharacter [123] [open] [sy] ["66] % {
-\definemathcharacter [124] [ord] [sy] ["6A] % |
-\definemathcharacter [125] [close] [sy] ["67] % }
+\definemathcharacter [123] [open] [sy] ["66] % {
+\definemathcharacter [124] [ord] [sy] ["6A] % |
+\definemathcharacter [125] [close] [sy] ["67] % }
\stopmathcollection
@@ -178,12 +178,12 @@
\definemathcharacter [<] [nothing] [sy] ["68] [ex] ["0A]
\definemathcharacter [>] [nothing] [sy] ["69] [ex] ["0B]
\definemathcharacter [/] [nothing] [mr] ["2F] [ex] ["0E]
-\definemathcharacter [124] [nothing] [sy] ["6A] [ex] ["0C] % |
-\definemathcharacter [92] [nothing] [sy] ["6E] [ex] ["0F] % \
+\definemathcharacter [124] [nothing] [sy] ["6A] [ex] ["0C] % |
+\definemathcharacter [92] [nothing] [sy] ["6E] [ex] ["0F] % \
\stopmathcollection
-\def\PLAINangle%
+\def\PLAINangle
{{\vbox{\ialign{$\m@th\scriptstyle##$\crcr
\not\mathrel{\mkern14mu}\crcr
\noalign{\nointerlineskip}
@@ -207,7 +207,7 @@
\definemathsymbol [bot] [nothing] [sy] ["3F]
\definemathcommand [hbar] {{\mathchar'26\mkern-9muh}}
-\definemathcommand [surd] {{\mathchar"1270}} % ?
+\definemathcommand [surd] {{\mathchar"1270}} % ?
\definemathcommand [angle] {\PLAINangle}
\stopmathcollection
@@ -364,22 +364,22 @@
\definemathsymbol [leftharpoondown] [rel] [mi] ["29]
\definemathsymbol [rightharpoonup] [rel] [mi] ["2A]
\definemathsymbol [rightharpoondown] [rel] [mi] ["2B]
-\definemathsymbol [lhook] [rel] [mi] ["2C]
+\definemathsymbol [lhook] [rel] [mi] ["2C]
\definemathsymbol [rhook] [rel] [mi] ["2D]
\stopmathcollection
-\def\PLAINldots%
+\def\PLAINldots
{\ldotp\ldotp\ldotp}
-\def\PLAINcdots%
+\def\PLAINcdots
{\cdotp\cdotp\cdotp}
-\def\PLAINvdots%
+\def\PLAINvdots
{\vbox{\baselineskip4\p@ \lineskiplimit\z@
\kern6\p@\hbox{.}\hbox{.}\hbox{.}}}
-\def\PLAINddots%
+\def\PLAINddots
{\mkern1mu\raise7\p@\vbox{\kern7\p@\hbox{.}}\mkern2mu
\raise4\p@\hbox{.}\mkern2mu\raise\p@\hbox{.}\mkern1mu}
@@ -404,16 +404,16 @@
\startmathcollection[default]
-\definemathsymbol [acute] [accent] [mr] ["13]
-\definemathsymbol [grave] [accent] [mr] ["12]
-\definemathsymbol [ddot] [accent] [mr] ["7F]
-\definemathsymbol [tilde] [accent] [mr] ["7E]
-\definemathsymbol [bar] [accent] [mr] ["16]
-\definemathsymbol [breve] [accent] [mr] ["15]
-\definemathsymbol [check] [accent] [mr] ["14]
-\definemathsymbol [hat] [accent] [mr] ["5E]
+\definemathsymbol [acute] [accent] [mr] ["13]
+\definemathsymbol [grave] [accent] [mr] ["12]
+\definemathsymbol [ddot] [accent] [mr] ["7F]
+\definemathsymbol [tilde] [accent] [mr] ["7E]
+\definemathsymbol [bar] [accent] [mr] ["16]
+\definemathsymbol [breve] [accent] [mr] ["15]
+\definemathsymbol [check] [accent] [mr] ["14]
+\definemathsymbol [hat] [accent] [mr] ["5E]
\definemathsymbol [vec] [accent] [mi] ["7E] % [ord]
-\definemathsymbol [dot] [accent] [mr] ["5F]
+\definemathsymbol [dot] [accent] [mr] ["5F]
\definemathsymbol [widetilde] [accent] [ex] ["65] % [ord]
\definemathsymbol [widehat] [accent] [ex] ["62] % [ord]
@@ -421,30 +421,30 @@
\startmathcollection[default]
-\definemathsymbol [lmoustache] [open] [ex] ["7A] [ex] ["40]
-\definemathsymbol [rmoustache] [close] [ex] ["7B] [ex] ["41]
+\definemathsymbol [lmoustache] [open] [ex] ["7A] [ex] ["40]
+\definemathsymbol [rmoustache] [close] [ex] ["7B] [ex] ["41]
\definemathsymbol [lgroup] [open] [mr] ["28] [ex] ["3A] % ?
\definemathsymbol [rgroup] [close] [mr] ["29] [ex] ["3B] % ?
-\definemathsymbol [arrowvert] [nothing] [sy] ["6A] [ex] ["3C]
+\definemathsymbol [arrowvert] [nothing] [sy] ["6A] [ex] ["3C]
\definemathsymbol [Arrowvert] [nothing] [sy] ["6B] [ex] ["3D]
-\definemathsymbol [bracevert] [nothing] [ex] ["3E] % ?
-\definemathsymbol [Vert] [nothing] [sy] ["6B] [ex] ["0D]
-\definemathsymbol [vert] [nothing] [sy] ["6A] [ex] ["0C]
+\definemathsymbol [bracevert] [nothing] [ex] ["3E] % ?
+\definemathsymbol [Vert] [nothing] [sy] ["6B] [ex] ["0D]
+\definemathsymbol [vert] [nothing] [sy] ["6A] [ex] ["0C]
\definemathsymbol [uparrow] [rel] [sy] ["22] [ex] ["78]
\definemathsymbol [downarrow] [rel] [sy] ["23] [ex] ["79]
-\definemathsymbol [updownarrow] [rel] [sy] ["6C] [ex] ["3F]
-\definemathsymbol [Uparrow] [rel] [sy] ["2A] [ex] ["7E]
-\definemathsymbol [Downarrow] [rel] [sy] ["2B] [ex] ["7F]
-\definemathsymbol [Updownarrow] [rel] [sy] ["6D] [ex] ["77]
-\definemathsymbol [backslash] [nothing] [sy] ["6E] [ex] ["0F]
-\definemathsymbol [rangle] [close] [sy] ["69] [ex] ["0B]
-\definemathsymbol [langle] [open] [sy] ["68] [ex] ["0A]
-\definemathsymbol [rbrace] [close] [sy] ["67] [ex] ["09]
-\definemathsymbol [lbrace] [open] [sy] ["66] [ex] ["08]
-\definemathsymbol [rceil] [close] [sy] ["65] [ex] ["07]
-\definemathsymbol [lceil] [open] [sy] ["64] [ex] ["06]
-\definemathsymbol [rfloor] [close] [sy] ["63] [ex] ["05]
-\definemathsymbol [lfloor] [open] [sy] ["62] [ex] ["04]
+\definemathsymbol [updownarrow] [rel] [sy] ["6C] [ex] ["3F]
+\definemathsymbol [Uparrow] [rel] [sy] ["2A] [ex] ["7E]
+\definemathsymbol [Downarrow] [rel] [sy] ["2B] [ex] ["7F]
+\definemathsymbol [Updownarrow] [rel] [sy] ["6D] [ex] ["77]
+\definemathsymbol [backslash] [nothing] [sy] ["6E] [ex] ["0F]
+\definemathsymbol [rangle] [close] [sy] ["69] [ex] ["0B]
+\definemathsymbol [langle] [open] [sy] ["68] [ex] ["0A]
+\definemathsymbol [rbrace] [close] [sy] ["67] [ex] ["09]
+\definemathsymbol [lbrace] [open] [sy] ["66] [ex] ["08]
+\definemathsymbol [rceil] [close] [sy] ["65] [ex] ["07]
+\definemathsymbol [lceil] [open] [sy] ["64] [ex] ["06]
+\definemathsymbol [rfloor] [close] [sy] ["63] [ex] ["05]
+\definemathsymbol [lfloor] [open] [sy] ["62] [ex] ["04]
\definemathsymbol [sqrt] [radical] [sy] ["70] [ex] ["70]
@@ -455,7 +455,7 @@
\def\PLAINbigg{\@@dobig{1.45}}
\def\PLAINBigg{\@@dobig{1.75}}
-\startrawmathcollection [default]
+\startrawmathcollection [default]
\definemathcommand [bigl] [open] [one] {\big}
\definemathcommand [bigm] [rel] [one] {\big}
@@ -505,19 +505,19 @@
\definemathcommand [r@@t] {\PLAINroot}
\definemathcommand [matrix] {\PLAINmatrix}
-\definemathcommand [over] {\normalover} % hack, to do
+\definemathcommand [over] {\normalover} % hack, to do
\stoprawmathcollection
-\def\{{\lbrace}
-\def\}{\rbrace}
+\def\{{\lbrace}
+\def\}{\rbrace}
-%def\bbd{\fam\purefamily{blackboard}}
+%def\bbd{\fam\purefamily{blackboard}}
%def\cal{\fam\purefamily{calfamily}}
\def\mit{\fam\purefamily{mitfamily}}
-\def\Bbb{\blackboard} % conforming amstex
+\def\Bbb{\blackboard} % conforming amstex
\startmathcollection[default]
@@ -530,6 +530,6 @@
\stopmathcollection
\definemathpunctuation . mathperiod textperiod
-\definemathpunctuation , mathcomma textcomma
+\definemathpunctuation , mathcomma textcomma
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/meta-ini.tex b/tex/context/base/meta-ini.tex
index ee0354d52..dd1f193c3 100644
--- a/tex/context/base/meta-ini.tex
+++ b/tex/context/base/meta-ini.tex
@@ -1,24 +1,25 @@
%D \module
+%D \module
%D [ file=meta-ini,
%D version=1999.07.10,
-%D title=\METAPOST\ Graphics,
-%D subtitle=Initialization,
+%D title=\METAPOST\ Graphics,
+%D subtitle=Initialization,
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
-% currently the running color influences the mp graphic in
-% pdftex, but this will change [i.e. become optional]; one
-% problem is that pdf has no grouping with regards to the
-% color
+% currently the running color influences the mp graphic in
+% pdftex, but this will change [i.e. become optional]; one
+% problem is that pdf has no grouping with regards to the
+% color
\writestatus{loading}{MetaPost Graphics / Initializations}
-\unprotect
+\unprotect
\startmessages dutch library: metapost
title: metapost
@@ -60,17 +61,17 @@
%D \METAPOST\ inclusion in \CONTEXT. Some basic macros will be
%D extended. Since some support is depends on \METAPOST\
%D macros. so let's first preload a few auxiliary \METAPOST\
-%D files.
+%D files.
-\maxnofMPgraphics = 4000 % metafun disables the 4K boundary
+\maxnofMPgraphics = 4000 % metafun disables the 4K boundary
-\appendtoks
- if unknown context_tool : input mp-tool ; fi ;
- if unknown context_spec : input mp-spec ; fi ;
- if unknown context_grph : input mp-grph ; fi ;
-\to \MPinitializations
+\appendtoks
+ if unknown context_tool : input mp-tool ; fi ;
+ if unknown context_spec : input mp-spec ; fi ;
+ if unknown context_grph : input mp-grph ; fi ;
+\to \MPinitializations
-%D Since we want lables to follow the document settings, we
+%D Since we want lables to follow the document settings, we
%D also set the font related variables.
\appendtoks
@@ -78,36 +79,36 @@
defaultscale := \the\bodyfontsize/10pt ; % not good yet
\to \MPinitializations
-%D In order to support fancy text features (like outline
-%D fonts), we set:
+%D In order to support fancy text features (like outline
+%D fonts), we set:
\appendtoks
- graphictextformat := "context" ;
- graphictextdirective "\the\everyMPTEXgraphic" ;
+ graphictextformat := "context" ;
+ graphictextdirective "\the\everyMPTEXgraphic" ;
\to \MPinitializations
-%D A signal that we're in combines \CONTEXT||\METAFUN mode:
+%D A signal that we're in combines \CONTEXT||\METAFUN mode:
\appendtoks
- string contextversion ; contextversion := "\contextversion" ;
+ string contextversion ; contextversion := "\contextversion" ;
\to \MPinitializations
-%D Some safeguards:
+%D Some safeguards:
\appendtoks \cleanupfeatures \to \everyMPgraphic
-%D Another one:
+%D Another one:
\prependtoks \MPstaticgraphictrue \to \everyoverlay
\prependtoks \MPstaticgraphictrue \to \everypagebody
%D We save the number of graphics for the sake of \TEXEXEC.
-\newcounter\totalnofMPgraphics
+\newcounter\totalnofMPgraphics
-\def\thenofMPgraphics{\the\nofMPgraphics} % from supp-mps
+\def\thenofMPgraphics{\the\nofMPgraphics} % from supp-mps
-\appendtoks
+\appendtoks
\savecurrentvalue\totalnofMPgraphics\thenofMPgraphics
\to \everybye
@@ -166,49 +167,49 @@
\def\MPrawvar#1#2{\csname#1:#2\endcsname}
-%D \macros
+%D \macros
%D {startuniqueMPgraphic, uniqueMPgraphic}
%D
%D This macros is probably of most use to myself, since I like
%D to use graphics that adapt themselves. The next \METAPOST\
-%D kind of graphic is both unique and reused when possible.
-%D
-%D \starttypen
+%D kind of graphic is both unique and reused when possible.
+%D
+%D \starttypen
%D \defineoverlay[example][\uniqueMPgraphic{test}]
%D
%D \startuniqueMPgraphic {test}
-%D draw unitsquare xscaled \overlaywidth yscaled \overlayheight ;
-%D \stopuniqueMPgraphic
+%D draw unitsquare xscaled \overlaywidth yscaled \overlayheight ;
+%D \stopuniqueMPgraphic
%D \stoptypen
-%D For educational purposes, we show the original version
-%D first. This one used a rather simple method for determining
-%D the uniqueness.
+%D For educational purposes, we show the original version
+%D first. This one used a rather simple method for determining
+%D the uniqueness.
%D
-%D \starttypen
+%D \starttypen
%D \long\def\startuniqueMPgraphic#1#2\stopuniqueMPgraphic%
%D {\setvalue{\@@MPG#1}%
%D {\startreusableMPgraphic{\overlaystamp:#1}#2\stopreusableMPgraphic
%D \reuseMPgraphic{\overlaystamp:#1}}}
-%D
+%D
%D \def\uniqueMPgraphic#1%
%D {\getvalue{\@@MPG#1}}
-%D \stoptypen
-
+%D \stoptypen
+
%\def\overlaystamp% watch the \MPcolor, since colors can be redefined
% {\overlaywidth:\overlayheight:\overlaydepth
% :\MPcolor{\overlaycolor}:\MPcolor{\overlaylinecolor}}
-
+
\def\overlaystamp% watch the \MPcolor, since colors can be redefined
{\overlaywidth:\overlayheight:\overlaydepth
- :\MPcolor\overlaycolor:\MPcolor\overlaylinecolor}
+ :\MPcolor\overlaycolor:\MPcolor\overlaylinecolor}
%D A better approach is to let additional variables play a role
%D in determining the uniqueness. In the next macro, the
%D second, optional, argument is used to guarantee the
%D uniqueness, as well as prepare variables for passing them to
-%D \METAPOST.
-%D
+%D \METAPOST.
+%D
%D \starttypen
%D \startuniqueMPgraphic{meta:hash}{gap,angle,...}
%D \stoptypen
@@ -261,7 +262,7 @@
\prepareMPvariables{#2}%
\enableincludeMPgraphics
\startMPgraphic#3\stopMPgraphic
- \ifMPrun \else % see mfun-004 : processing buffer
+ \ifMPrun \else % see mfun-004 : processing buffer
\loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{}%
\placeMPgraphic
\fi
@@ -271,15 +272,15 @@
\long\def\startuseMPgraphic
{\dodoublegroupempty\dostartuseMPgraphic}
-\long\def\dostartuseMPgraphic#1#2#3\stopuseMPgraphic%
+\long\def\dostartuseMPgraphic#1#2#3\stopuseMPgraphic%
{\blabelgroup
\long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}{#3}}%
\elabelgroup}
-\long\def\startusableMPgraphic % redundant but handy
+\long\def\startusableMPgraphic % redundant but handy
{\dodoublegroupempty\dostartusableMPgraphic}
-\long\def\dostartusableMPgraphic#1#2#3\stopusableMPgraphic%
+\long\def\dostartusableMPgraphic#1#2#3\stopusableMPgraphic%
{\blabelgroup
\long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}{#3}}%
\elabelgroup}
@@ -327,12 +328,12 @@
{\let\handleuseMPgraphic \thirdofthreearguments
\let\handlereusableMPgraphic\thirdofthreearguments}
-% todo: each code/page/buffer a var class
+% todo: each code/page/buffer a var class
-%D \macros
+%D \macros
%D {startuniqueMPpagegraphic,uniqueMPpagegraphic}
%D
-%D Experimental.
+%D Experimental.
\def\MPpageprefix{\doifoddpageelse oe:}
@@ -354,19 +355,19 @@
\def\douniqueMPpagegraphic#1#2%
{\blabelgroup
- \let\overlaystamp\overlaypagestamp
+ \let\overlaystamp\overlaypagestamp
\setupMPvariables[#1][#2]%
\getvalue{\@@MPG\MPpageprefix#1}{}%
\elabelgroup}
-%D One way of defining a stamp is:
-%D
-%D \starttypen
+%D One way of defining a stamp is:
+%D
+%D \starttypen
%D \def\extendMPoverlaystamp#1%
%D {\def\docommando##1%
%D {\edef\overlaystamp{\overlaystamp:\MPvariable{##1}}}%
%D \processcommalist[#1]\docommando}
-%D \stoptypen
+%D \stoptypen
%D Since we need to feed \METAPOST\ with expanded dimensions,
%D we introduce a dedicated expansion engine.
@@ -378,20 +379,31 @@
\doprepareMPvariable{\@@framed\@@meta#1}%
\fi}
+% \startlines
+% \def\xxx{\lineheight} \doprepareMPvariable{xxx} \xxx
+% \def\xxx{2pt} \doprepareMPvariable{xxx} \xxx
+% \def\xxx{2} \doprepareMPvariable{xxx} \xxx
+% \def\xxx{\scratchcounter} \doprepareMPvariable{xxx} \xxx
+% \def\xxx{red} \doprepareMPvariable{xxx} \xxx
+% \def\xxx{0.4} \doprepareMPvariable{xxx} \xxx
+% \stoplines
+
\def\doprepareMPvariable#1%
- {\doifelsenothing{\getvalue{#1}}
+ {\edef\theMPvariable{\getvalue{#1}}%
+ \doifelsenothing\theMPvariable
{\setevalue{#1}{\MPcolor{black}}}
- {\edef\!!stringa{\getvalue{#1}}%
- \convertcommand\!!stringa\to\ascii % otherwise problems
+ {\convertcommand\theMPvariable\to\ascii % otherwise problems
\doifcolorelse \ascii % with 2\bodyfontsize
- {\setevalue{#1}{\MPcolor{\getvalue{#1}}}}
- {% can be aux macro
- \setbox\scratchbox\hbox{\scratchdimen\getvalue{#1}sp}%
+ {\setevalue{#1}{\MPcolor\theMPvariable}}
+ {% can be aux macro
+ \setbox\scratchbox\hbox{\scratchdimen\theMPvariable sp}%
\ifdim\wd\scratchbox=\zeropoint
- \scratchcounter\getvalue{#1}\relax
- \setevalue{#1}{\the\scratchcounter}%
+ % \scratchcounter\theMPvariable
+ % \setevalue{#1}{\the\scratchcounter}%
+ % also accepts 0.number :
+ \setevalue{#1}{\number\theMPvariable}%
\else
- \scratchdimen\getvalue{#1}\relax
+ \scratchdimen\theMPvariable
\setevalue{#1}{\the\scratchdimen}%
\fi}}}
@@ -411,44 +423,44 @@
%D \macros
%D {MPdatafile}
%D
-%D We redefine a macro from \type {supp-mps.tex}:
+%D We redefine a macro from \type {supp-mps.tex}:
\def\MPdatafile
{\bufferprefix mpd-\the\currentMPgraphic.mpd}
-%D \macros
-%D {MPrunfile}
+%D \macros
+%D {MPrunfile}
%D
-%D This one is more abstract and does not assume knowledge
-%D of buffer prefixes.
+%D This one is more abstract and does not assume knowledge
+%D of buffer prefixes.
-\def\MPrunfile#1%
+\def\MPrunfile#1%
{\bufferprefix mprun.#1}
-%D We also have to make sure that \METAPOST\ knows this:
+%D We also have to make sure that \METAPOST\ knows this:
-\appendtoks
+\appendtoks
if not known _data_prefix_ :
- string _data_prefix_ , _data_suffix_ ;
+ string _data_prefix_ , _data_suffix_ ;
fi ;
- _data_prefix_ := "\bufferprefix mpd-" ;
- _data_suffix_ := ".mpd" ;
-\to \MPinitializations
+ _data_prefix_ := "\bufferprefix mpd-" ;
+ _data_suffix_ := ".mpd" ;
+\to \MPinitializations
%D \macros
%D {getMPdata}
%D
-%D The current data is loaded with:
+%D The current data is loaded with:
\def\getMPdata
{\startreadingfile
\readlocfile\MPdatafile\donothing\donothing
\stopreadingfile}
-%D When we collect graphics in one file, we run into
-%D troubles, since \METAPOST\ has a built in limit (of 4)
-%D on the number of files it can handle. It's therefore
-%D better to collect all data in one file and filter it.
+%D When we collect graphics in one file, we run into
+%D troubles, since \METAPOST\ has a built in limit (of 4)
+%D on the number of files it can handle. It's therefore
+%D better to collect all data in one file and filter it.
\def\getMPdata
{\long\def\MPdata##1##2%
@@ -457,14 +469,14 @@
\readlocfile{\MPgraphicfile.mpd}\donothing\donothing
\stopreadingfile}
-%D We have to enable this mechanism with:
+%D We have to enable this mechanism with:
-\appendtoks
+\appendtoks
boolean collapse_data ; collapse_data := true ;
- _data_suffix_ := ".mpd" ; % overloads previous one
-\to \MPinitializations
+ _data_suffix_ := ".mpd" ; % overloads previous one
+\to \MPinitializations
-%D For the moment, the next one is a private macro:
+%D For the moment, the next one is a private macro:
\def\processMPbuffer
{\dosingleempty\doprocessMPbuffer}
@@ -474,32 +486,32 @@
{\doprocessMPbuffer[\jobname]}
{\bgroup
\setnormalcatcodes
- %\let\par\empty % oeps, this makes dvi mode graphics hang when not found
+ %\let\par\empty % oeps, this makes dvi mode graphics hang when not found
\!!toksa\emptytoks
\def\copyMPbufferline{\expandafter\appendtoks\fileline\to\!!toksa}%
\def\dodoprocessMPbuffer##1%
{\doprocessfile\scratchread{\TEXbufferfile{##1}}\copyMPbufferline}%
\processcommalist[#1]\dodoprocessMPbuffer
- \@EA\startMPcode\the\!!toksa\stopMPcode % more efficient
+ \@EA\startMPcode\the\!!toksa\stopMPcode % more efficient
\egroup}}
\def\runMPbuffer
{\dosingleempty\dorunMPbuffer}
-\def\dorunMPbuffer[#1]% processing only
- {{\MPruntrue\doprocessMPbuffer[#1]}}
+\def\dorunMPbuffer[#1]% processing only
+ {{\MPruntrue\doprocessMPbuffer[#1]}}
-%D \macros
+%D \macros
%D {startMPenvironment, resetMPenvironment}
%D
-%D In order to synchronize the main \TEX\ run and the runs
-%D local to \METAPOST, environments can be passed.
+%D In order to synchronize the main \TEX\ run and the runs
+%D local to \METAPOST, environments can be passed.
\ifx\everyMPTEXgraphic\undefined
\newtoks\everyMPTEXgraphic
-\fi
+\fi
-%D A more generar of passing environments is:
+%D A more generar of passing environments is:
\def\startMPenvironment% % second arg gobbles spaces, so
{\dodoubleempty\dostartMPenvironment} % that reset gives \emptytoks
@@ -512,38 +524,38 @@
\expandafter\appendtoks\ascii\to\everyMPTEXgraphic}
\def\resetMPenvironment
- {\everyMPTEXgraphic\emptytoks % = is really needed !
+ {\everyMPTEXgraphic\emptytoks % = is really needed !
\startMPenvironment
\global\loadfontfileoncetrue
- \stopMPenvironment}
+ \stopMPenvironment}
\startMPenvironment
\global\loadfontfileoncetrue
\stopMPenvironment
-%D This command takes \type {[reset]} as optional
-%D argument.
+%D This command takes \type {[reset]} as optional
+%D argument.
%D
-%D \starttypen
+%D \starttypen
%D \startMPenvironment
%D \setupbodyfont[pos,14.4pt]
%D \stopMPenvironment
%D
%D \startMPcode
-%D draw btex \sl Hans Hagen etex scaled 5 ;
+%D draw btex \sl Hans Hagen etex scaled 5 ;
%D \stopMPcode
-%D \stoptypen
+%D \stoptypen
%D
-%D The \type {\resetMPenvironment} is a quick way to erase
-%D the token list.
+%D The \type {\resetMPenvironment} is a quick way to erase
+%D the token list.
-%D We don't want spurious files, do we?
+%D We don't want spurious files, do we?
%\def\initializeMPgraphics
-% {%\ifx\bufferprefix\empty \else
+% {%\ifx\bufferprefix\empty \else
% \immediate\openout\MPwrite\MPgraphicfile.mp
% \immediate\write\MPwrite{end.}%
-% \immediate\closeout\MPwrite
+% \immediate\closeout\MPwrite
% }%\fi}
\def\initializeMPgraphicfile
@@ -567,8 +579,8 @@
\fi
\egroup}
-%D Loading specific \METAPOST\ related definitions is
-%D accomplished by:
+%D Loading specific \METAPOST\ related definitions is
+%D accomplished by:
\def\douseMPlibrary#1%
{\doifundefined{\c!file\f!javascriptprefix#1}
@@ -585,7 +597,7 @@
%D \macros
%D {setMPtext, MPtext, MPstring, MPbetex}
%D
-%D To be documented:
+%D To be documented:
%D
%D \starttyping
%D \setMPtext{identifier}{text}
@@ -593,51 +605,51 @@
%D \MPtext {identifier}
%D \MPstring{identifier}
%D \MPbetex {identifier}
-%D \stoptyping
+%D \stoptyping
\def\@@MPT{@MPT@}
\def\forceMPTEXgraphic
{\long\def\checkMPTEXgraphic##1{\global\MPTEXgraphictrue}}
-\def\setMPtext#1#2% todo : #1 must be made : safe
+\def\setMPtext#1#2% todo : #1 must be made : safe
{%\forceMPTEXgraphic
\convertargument#2\to\ascii
\dodoglobal\letvalue{\@@MPT#1}\ascii}
-\def\MPtext #1{\getvalue{\@@MPT#1}}
-\def\MPstring #1{"\getvalue{\@@MPT#1}"}
+\def\MPtext #1{\getvalue{\@@MPT#1}}
+\def\MPstring #1{"\getvalue{\@@MPT#1}"}
\def\MPbetex #1{btex \getvalue{\@@MPT#1} etex}
-%D Unfortunately \METAPOST\ does not have \CMYK\ support
-%D built in, but by means of specials we can supply the
-%D information needed to handle them naturaly.
+%D Unfortunately \METAPOST\ does not have \CMYK\ support
+%D built in, but by means of specials we can supply the
+%D information needed to handle them naturaly.
-\newif\ifMPcmykcolors \MPcmykcolorstrue
-\newif\ifMPspotcolors \MPspotcolorstrue
+\newif\ifMPcmykcolors \MPcmykcolorstrue
+\newif\ifMPspotcolors \MPspotcolorstrue
\appendtoks
- cmykcolors := \ifMPcmykcolors true \else false \fi ;
- spotcolors := \ifMPspotcolors true \else false \fi ;
-\to \MPinitializations
+ cmykcolors := \ifMPcmykcolors true \else false \fi ;
+ spotcolors := \ifMPspotcolors true \else false \fi ;
+\to \MPinitializations
-%D In order to communicate conveniently with the \TEX\
-%D engine, we introduce some typesetting variables.
+%D In order to communicate conveniently with the \TEX\
+%D engine, we introduce some typesetting variables.
-% todo : backgroundoffsets
+% todo : backgroundoffsets
\startuseMPgraphic{init data}
color OverlayColor, OverlayLineColor ;
%
- OverlayWidth := \overlaywidth ;
- OverlayHeight := \overlayheight ;
- OverlayDepth := \overlayheight ;
- OverlayColor := \MPcolor{\overlaycolor} ;
+ OverlayWidth := \overlaywidth ;
+ OverlayHeight := \overlayheight ;
+ OverlayDepth := \overlayheight ;
+ OverlayColor := \MPcolor{\overlaycolor} ;
OverlayLineWidth := \overlaylinewidth ;
- OverlayLineColor := \MPcolor{\overlaylinecolor} ;
+ OverlayLineColor := \MPcolor{\overlaylinecolor} ;
%
BaseLineSkip := \the\baselineskip ;
- LineHeight := \the\baselineskip ;
+ LineHeight := \the\baselineskip ;
BodyFontSize := \the\bodyfontsize ;
%
TopSkip := \the\topskip ;
@@ -649,27 +661,27 @@
%
EmWidth := \the\fontdimen6\font ;
ExHeight := \the\fontdimen5\font ;
- %
+ %
PageNumber := \the\pageno ;
RealPageNumber := \the\realpageno ;
- LastPageNumber := \lastpage ;
+ LastPageNumber := \lastpage ;
\stopuseMPgraphic
-\appendtoks
- \includeMPgraphic{init data}
+\appendtoks
+ \includeMPgraphic{init data}
\to \MPinitializations
\appendtoks
\baselineskip1\baselineskip
- \lineheight 1\lineheight
+ \lineheight 1\lineheight
\topskip 1\topskip
\to \everyMPgraphic
-% this will become (more efficient)
+% this will become (more efficient)
%
% \startuseMPgraphic{init data}
% tx1 := \the\baselineskip ;
-% tx2 := \the\baselineskip ;
+% tx2 := \the\baselineskip ;
% tx3 := \the\bodyfontsize ;
% tx4 := \strutheight ;
% tx5 := \strutdepth ;
@@ -678,8 +690,8 @@
% tx8 := \the\fontdimen6\font ;
% tx9 := \the\fontdimen5\font ;
% \stopuseMPgraphic
-%
-% def map_tx_variables =
+%
+% def map_tx_variables =
% BaseLineSkip := tx1 ;
% LineHeight := tx2 ;
% BodyFontSize := tx3 ;
@@ -689,16 +701,16 @@
% Currentheight := tx7 ;
% EmWidth := tx8 ;
% ExHeight := tx9 ;
-% enddef ;
+% enddef ;
%
-% extra_begin_fig ....
+% extra_begin_fig ....
-%D Alas, the prologue settings differ per driver.
+%D Alas, the prologue settings differ per driver.
-\ifx\undefined\MPprologues \def\MPprologues{0} \fi
+\ifx\undefined\MPprologues \def\MPprologues{0} \fi
-\appendtoks
- prologues := \MPprologues ;
+\appendtoks
+ prologues := \MPprologues ;
\to \MPinitializations
\appendtoks
@@ -706,36 +718,36 @@
\def\MPOSTdriver{dvips}%
\to \everyresetspecials
-%D \macros
+%D \macros
%D {PDFMPformoffset}
%D
-%D In \PDF, forms are clipped and therefore we have to take
-%D precautions to get this right. Since this is related to
-%D objects, we use the same offset as used there.
+%D In \PDF, forms are clipped and therefore we have to take
+%D precautions to get this right. Since this is related to
+%D objects, we use the same offset as used there.
\def\PDFMPformoffset{\objectoffset}
-%D \macros
+%D \macros
%D {insertMPfile}
%D
%D Bypassing the special driver and figure mechanism is not
%D that nice but saves upto 5\% time in embedding \METAPOST\
%D graphics by using the low level \PDF\ converter directly,
%D given of course that we use \PDFTEX. As a result we need to
-%D fool around with the object trigger.
+%D fool around with the object trigger.
\newtoks\everyinsertMPfile
%D First we present the reasonable fast alternative that we
-%D happily used for some time.
-%D
-%D \starttypen
+%D happily used for some time.
+%D
+%D \starttypen
%D \def\insertMPfile#1#2%
%D {\ifx\undefined\externalfigure
%D \message{[insert file #1 here]}%
%D \else
%D \bgroup
-%D \the\everyinsertMPfile
+%D \the\everyinsertMPfile
%D \externalfigure
%D [#1]
%D [\c!type=\c!mps,\c!object=\v!nee,%
@@ -745,9 +757,9 @@
%D #2]%
%D \egroup
%D \fi}
-%D \stoptypen
+%D \stoptypen
%D
-%D However, on a 1 Gig Pentium, the next alternative saves
+%D However, on a 1 Gig Pentium, the next alternative saves
%D us 20 seconds run time for the 300 page \METAFUN\ manual:
\def\insertMPfile#1#2%
@@ -784,21 +796,21 @@
%D optimizations are a bit tricky since we must make sure that
%D special resources end up in the (PDF) files. Because the
%D \METAPOST\ to \PDF\ can handle objects itself, it is not
-%D that complicated.
+%D that complicated.
-%D We hook a couple of initializations into the graphic
-%D macros.
+%D We hook a couple of initializations into the graphic
+%D macros.
-\appendtoks
+\appendtoks
\let\figuretypes\c!mps
- \runutilityfilefalse
+ \runutilityfilefalse
\consultutilityfilefalse
\to \everyinsertMPfile
-%D One more: (still needed?)
+%D One more: (still needed?)
-\appendtoks
- def initialize_form_numbers =
+\appendtoks
+ def initialize_form_numbers =
do_initialize_numbers ;
enddef ;
\to \MPinitializations
@@ -810,36 +822,36 @@
unitsquare xysized(HSize,VSize)
enddef ;
vardef PageFraction =
- if \lastpage>1 : (\realfolio-1)/(\lastpage-1) else : 1 fi
- enddef ;
+ if \lastpage>1 : (\realfolio-1)/(\lastpage-1) else : 1 fi
+ enddef ;
\to \MPinitializations
-%D And some more. These are not really needed since we
-%D don't use the normal figure inclusion macros any longer.
+%D And some more. These are not really needed since we
+%D don't use the normal figure inclusion macros any longer.
-\appendtoks
- \externalfigurepostprocessors\emptytoks % safeguard
+\appendtoks
+ \externalfigurepostprocessors\emptytoks % safeguard
\to \everyinsertMPfile
%D We also take care of disabling fancy figure features, that
-%D can terribly interfere when dealing with symbols,
-%D background graphics and running (postponed) graphics.
-%D You won't believe me if I tell you what funny side effects
-%D can occur. One took me over a day to uncover when
-%D processing the screen version of the \METAFUN\ manual.
+%D can terribly interfere when dealing with symbols,
+%D background graphics and running (postponed) graphics.
+%D You won't believe me if I tell you what funny side effects
+%D can occur. One took me over a day to uncover when
+%D processing the screen version of the \METAFUN\ manual.
-%D For my eyes only:
+%D For my eyes only:
\def\doifelseMPgraphic#1{\doifdefinedelse{\@@MPG#1}}
-%D New:
+%D New:
-% \appendtoks \closeMPgraphicfiles \to \everystoptext
+% \appendtoks \closeMPgraphicfiles \to \everystoptext
\protect \endinput
-% also:
+% also:
%
% linecap := rounded ;
-% linejoin := rounded ;
+% linejoin := rounded ;
% drawoptions () ;
diff --git a/tex/context/base/meta-nav.tex b/tex/context/base/meta-nav.tex
index 41067a998..bb409f7fc 100644
--- a/tex/context/base/meta-nav.tex
+++ b/tex/context/base/meta-nav.tex
@@ -12,23 +12,23 @@
%C details.
\startuniqueMPgraphic{navplus}{size,color,type,mode}
- color c ; numeric s, t ; path p ;
+ color c ; numeric s, t ; path p ;
t := \MPvar{type} ; c := \MPvar{color} ; s := \MPvar{size} ;
- if \MPvar{mode} = 1 : c := .5[c,white] fi ;
- if t = 1 :
+ if \MPvar{mode} = 1 : c := .5[c,white] fi ;
+ if t = 1 :
p := ((0,0)--(1/2,0)--(1,1/3)--(1,1)--(0,1)--(0,0)--cycle)
xyscaled (3,4) ;
elseif t = 2 :
- p := ((0,0)--(1,0)--(1,1)--(0,1)--(1/2,2/5)--(1,1)--(0,1)--cycle)
+ p := ((0,0)--(1,0)--(1,1)--(0,1)--(1/2,2/5)--(1,1)--(0,1)--cycle)
xyscaled (4,3) ;
- else :
- p := fullsquare xyscaled (3,3) ;
+ else :
+ p := fullsquare xyscaled (3,3) ;
fi ;
- draw p withpen pencircle scaled (1/2) withcolor .75white ;
- fill p withcolor c ;
- draw p withpen pencircle scaled (1/3) withcolor .5c ;
- currentpicture := currentpicture scaled s ;
- currentpicture := currentpicture shifted -center currentpicture ;
+ draw p withpen pencircle scaled (1/2) withcolor .75white ;
+ fill p withcolor c ;
+ draw p withpen pencircle scaled (1/3) withcolor .5c ;
+ currentpicture := currentpicture scaled s ;
+ currentpicture := currentpicture shifted -center currentpicture ;
\stopuniqueMPgraphic
\setupMPvariables
@@ -47,7 +47,7 @@
[comment-normal]
[\uniqueMPgraphic{navplus}{type=1,color=navplus:comment}]
\definesymbol
- [comment-down]
+ [comment-down]
[\uniqueMPgraphic{navplus}{type=1,color=navplus:comment,mode=1}]
\definesymbol
@@ -57,9 +57,9 @@
[attach-down]
[\uniqueMPgraphic{navplus}{type=2,color=navplus:attach,mode=1}]
-\unprotect
+\unprotect
\setupcomment [\c!symbool={comment-normal,comment-down}]
-\setupattachments[\c!symbool={attach-normal,attach-down}]
+\setupattachments[\c!symbool={attach-normal,attach-down}]
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/meta-pag.tex b/tex/context/base/meta-pag.tex
index dd1ef6506..65a62f3dc 100644
--- a/tex/context/base/meta-pag.tex
+++ b/tex/context/base/meta-pag.tex
@@ -141,27 +141,27 @@
%D See \type {mp-page.mp} for the definition of the macros:
%D
%D \startabulatie[|tl|l|p|]
-%D \NC ResetTextAreas \NC no arguments \NC
+%D \NC ResetTextAreas \NC no arguments \NC
%D reset areas on page \NC \NR
-%D \NC RegisterTextArea \NC x, y, w, h \NC
+%D \NC RegisterTextArea \NC x, y, w, h \NC
%D adds area to the list \NC \NR
-%D \NC TextAreaX,Y,W,H,XY,WH \NC x and/or y \NC
-%D reports offsets and dimensions \NC \NR
+%D \NC TextAreaX,Y,W,H,XY,WH \NC x and/or y \NC
+%D reports offsets and dimensions \NC \NR
%D \stoptabulatie
%D
-%D The \type {TextArea*} macros can be used to determine
-%D overlap.
+%D The \type {TextArea*} macros can be used to determine
+%D overlap.
\newcounter\currentMPtextareadata
-\newtoks\MPsavedtextareadata
-\newtoks\MPtextareadata
-\newtoks\MPlocaltextareadata
+\newtoks\MPsavedtextareadata
+\newtoks\MPtextareadata
+\newtoks\MPlocaltextareadata
-% optimaliseren voor herhaling
+% optimaliseren voor herhaling
\def\registerMPtextarea#1%
- {\ifpositioning
+ {\ifpositioning
\bgroup
\doglobal\increment\currentMPtextareadata
%\hpos{gbd:\currentMPtextareadata}{#1}%
@@ -178,7 +178,7 @@
\fi}
\def\registerMPlocaltextarea#1%
- {\ifpositioning
+ {\ifpositioning
\bgroup
\doglobal\increment\currentMPtextareadata
%\hpos{gbd:\currentMPtextareadata}{#1}%
@@ -202,12 +202,15 @@
\to \MPinitializations
\startuseMPgraphic{area data}
- ResetTextAreas ;
+ ResetTextAreas ;
\the\MPsavedtextareadata
- SaveTextAreas ;
- ResetTextAreas ;
+ SaveTextAreas ;
+ ResetTextAreas ;
\the\MPtextareadata
\the\MPlocaltextareadata
+ % maybe tzt somewhere else
+ path PlainTextArea ; PlainTextArea :=
+ boundingbox(\MPxy{text:\realfolio}--\MPxy{text:\realfolio} shifted (\MPw{text:\realfolio},\MPh{text:\realfolio})) ;
\stopuseMPgraphic
\appendtoks
diff --git a/tex/context/base/mult-com.tex b/tex/context/base/mult-com.tex
index 0bf586071..0db0f2201 100644
--- a/tex/context/base/mult-com.tex
+++ b/tex/context/base/mult-com.tex
@@ -713,6 +713,12 @@ emptylines: legeregels emptylines
setuppagenumbering: stelpaginanummeringin setuppagenumbering
stelleseitennummeriernungein nastavcislovanistran
impostanumerazionepagina seteazanumerotarepagina
+ resetnumber: resetnummer resetnumber
+ resetnumber resetnumber
+ resetnumber resetnumber
+ setnumber: setnummer setnumber
+ setnumber setnumber
+ setnumber setnumber
stelnummerin: stelnummerin setupnumber
setupnumber setupnumber
impostanumerazione setupnumber
@@ -804,9 +810,13 @@ stelnummerin: stelnummerin setupnumber
ran ran
ran ran
% new
- defineitemgroup: definieeritemgroep defineitemgroup
- defineitemgroup defineitemgroup
- defineitemgroup defineitemgroup
+ headsym: kopsym headsym
+ headsym headsym
+ headsym headsym
+% new
+ defineitemgroup: definieeritemgroep defineitemgroup
+ defineitemgroup defineitemgroup
+ defineitemgroup defineitemgroup
setupitemgroup: stelitemgroepin setupitemgroup
setupitemgroup setupitemgroup
setupitemgroup setupitemgroup
@@ -1826,7 +1836,7 @@ definecolumnbreak: definieerkolomovergang definecolumnbreak
% ^ ^ ^ nadenken over \settextvariable vs \setuptextvariable in nl
-%D For downward compatibilities sake:
+%D For downward compatibilities sake:
\startcommands dutch english
german czech
diff --git a/tex/context/base/mult-con.tex b/tex/context/base/mult-con.tex
index 7c26c04f1..0ca131b07 100644
--- a/tex/context/base/mult-con.tex
+++ b/tex/context/base/mult-con.tex
@@ -808,6 +808,9 @@ component: component component
menu: menu menu
menue menu
menu meniu
+ splitsmethode: splitsmethode splitmethod
+ splitmethod splitmethod
+ splitmethod splitmethod
tekstmethode: tekstmethode textmethod
textmethod textmethod
textmethod textmethod
@@ -1913,6 +1916,9 @@ proces: proces process
schuinvet: schuinvet slantedbold
geneigtfett sklonenetucne
inclinatograssetto inclinataldin
+ synchroniseer: synchroniseer synchronize
+ synchronize synchronize
+ synchronize synchronize
italicvet: italicvet italicbold
italicfett kurzivnitucne
corsivograssetto italicaldin
diff --git a/tex/context/base/mult-ini.tex b/tex/context/base/mult-ini.tex
index 9902b6b55..154c604bd 100644
--- a/tex/context/base/mult-ini.tex
+++ b/tex/context/base/mult-ini.tex
@@ -13,17 +13,17 @@
%D This module implements the multi||lingual interface to
%D \CONTEXT. These capabilities concern messages, commands and
-%D parameters. Currently the following interfaces are
-%D supported:
-%D
+%D parameters. Currently the following interfaces are
+%D supported:
+%D
%D \starttabulatie[|l|l|c|c|]
%D \NC\bf language\NC\bf translator \NC\bf messages\NC\bf interface\NC\NR
-%D \NC dutch \NC Hans Hagen \NC yes \NC yes \NC\NR
-%D \NC english \NC Hans Hagen \NC yes \NC yes \NC\NR
-%D \NC german \NC Tobias Burnus \NC yes \NC yes \NC\NR
-%D \NC czech \NC Tom Hudec \NC yes \NC yes \NC\NR
-%D \NC italian \NC Giuseppe Bilotta \NC yes \NC yes \NC\NR
-%D \NC norwegian \NC Hans Fredrik Nordhaug\NC yes \NC no \NC\NR
+%D \NC dutch \NC Hans Hagen \NC yes \NC yes \NC\NR
+%D \NC english \NC Hans Hagen \NC yes \NC yes \NC\NR
+%D \NC german \NC Tobias Burnus \NC yes \NC yes \NC\NR
+%D \NC czech \NC Tom Hudec \NC yes \NC yes \NC\NR
+%D \NC italian \NC Giuseppe Bilotta \NC yes \NC yes \NC\NR
+%D \NC norwegian \NC Hans Fredrik Nordhaug\NC yes \NC no \NC\NR
%D \stoptabulatie
\writestatus{loading}{Context Multilingual Macros / Initialization}
@@ -196,10 +196,10 @@
\immediate\openin\scratchread=mult-def.tex % may overload the defaults
-\ifeof\scratchread % no high level commands yet
+\ifeof\scratchread % no high level commands yet
\immediate\closein\scratchread
-\else
- \immediate\closein\scratchread \input mult-def.tex
+\else
+ \immediate\closein\scratchread \input mult-def.tex
\fi
\ifx\defaultinterface\undefined
@@ -406,7 +406,7 @@
\def\getinterfacemessage
{\ifx\next\stopmessages
- \egroup\expandafter\gobbleoneargument
+ \egroup\expandafter\gobbleoneargument
\else
\expandafter\addinterfacemessage
\fi}
@@ -493,7 +493,7 @@
\fi}
%D \macros
-%D {dosetvalue,dosetevalue,dosetgvalue,docopyvalue,doresetvalue} % dogetvalue
+%D {dosetvalue,dosetevalue,dosetgvalue,dosetxvalue,docopyvalue,doresetvalue} % dogetvalue
%D
%D We already defined these auxiliary macros in the system
%D modules. Starting with this module however, we have to take
@@ -518,7 +518,7 @@
%D These macros are called upon quite often and so we optimized
%D them a bit.
%D
-%D \starttypen
+%D \starttypen
%D \def\dosetvalue#1#2#3%
%D {\let\c!internal!\c!internal!n
%D \p!doifundefined{\k!prefix!#2}%
@@ -530,7 +530,7 @@
%D \let\donottest\doprocesstest
%D \@EA\def\csname#1\csname\k!prefix!#2\endcsname\endcsname{#3}%
%D \fi}
-%D
+%D
%D \def\dosetevalue#1#2#3%
%D {\let\c!internal!\c!internal!n
%D \p!doifundefined{\k!prefix!#2}%
@@ -542,7 +542,7 @@
%D \let\donottest\doprocesstest
%D \@EA\edef\csname#1\csname\k!prefix!#2\endcsname\endcsname{#3}%
%D \fi}
-%D
+%D
%D \def\dosetgvalue#1#2#3%
%D {\let\c!internal!\c!internal!n
%D \p!doifundefined{\k!prefix!#2}%
@@ -554,21 +554,21 @@
%D \let\donottest\doprocesstest
%D \@EA\gdef\csname#1\csname\k!prefix!#2\endcsname\endcsname{#3}%
%D \fi}
-%D
-%D \def\docopyvalue#1#2#3%
+%D
+%D \def\docopyvalue#1#2#3%
%D {\let\c!internal!\c!internal!n
%D \p!doifundefined{\k!prefix!#3}%
%D \let\c!internal!\c!internal!y
-%D \let\donottest\doprocesstest % still needed ?
+%D \let\donottest\doprocesstest % still needed ?
%D \@EA\def\csname#1#3\endcsname%
%D {\csname#2#3\endcsname}%
%D \else
%D \let\c!internal!\c!internal!y
-%D \let\donottest\doprocesstest % still needed ?
+%D \let\donottest\doprocesstest % still needed ?
%D \@EA\def\csname#1\csname\k!prefix!#3\endcsname\endcsname%
%D {\csname#2\csname\k!prefix!#3\endcsname\endcsname}%
%D \fi}
-%D \stoptypen
+%D \stoptypen
\def\doresetvalue#1#2%
{\dosetvalue{#1}{#2}{}}
@@ -583,8 +583,8 @@
%D considerable profit in further optimization. By expanding
%D the embedded \type {\csname} we can reduce the format file
%D by about 5\% (60~KB out of 1.9~MB).
-%D
-%D \starttypen
+%D
+%D \starttypen
%D \def\docopyvalue#1#2#3% c -> k
%D {\p!doifundefined{\k!prefix!#3}%
%D \let\donottest\doprocesstest
@@ -598,7 +598,7 @@
%D \endcsname\@EA{\csname#2\csname\k!prefix!#3\endcsname\endcsname}%
%D \fi}
%D \stoptypen
-%D
+%D
%D The next alternatives are slightly faster.
\beginTEX
@@ -612,7 +612,7 @@
% \let\c!internal!\c!internal!y
% \@EA\def\csname#1\csname\k!prefix!#2\endcsname\endcsname{#3}%
% \fi}
-%
+%
% \def\dosetevalue#1#2#3%
% {\let\c!internal!\c!internal!n
% \@EA\ifx\csname\k!prefix!#2\endcsname\relax
@@ -622,7 +622,7 @@
% \let\c!internal!\c!internal!y
% \@EA\edef\csname#1\csname\k!prefix!#2\endcsname\endcsname{#3}%
% \fi}
-%
+%
% \def\dosetgvalue#1#2#3%
% {\let\c!internal!\c!internal!n
% \@EA\ifx\csname\k!prefix!#2\endcsname\relax
@@ -632,8 +632,8 @@
% \let\c!internal!\c!internal!y
% \@EA\gdef\csname#1\csname\k!prefix!#2\endcsname\endcsname{#3}%
% \fi}
-%
-% cleaner (not that much faster) don't pass #3 yet:
+%
+% cleaner (not that much faster) don't pass #3 yet:
\def\dosetvalue#1#2%
{\let\c!internal!\c!internal!n
@@ -665,7 +665,17 @@
\@EAEAEA\gdef\@EA\@EA\csname#1\csname\k!prefix!#2\endcsname\endcsname
\fi}
-% so far
+\def\dosetxvalue#1#2%
+ {\let\c!internal!\c!internal!n
+ \@EA\ifx\csname\k!prefix!#2\endcsname\relax
+ \let\c!internal!\c!internal!y
+ \@EAEAEA\xdef\@EA\@EA\csname#1#2\endcsname
+ \else
+ \let\c!internal!\c!internal!y
+ \@EAEAEA\xdef\@EA\@EA\csname#1\csname\k!prefix!#2\endcsname\endcsname
+ \fi}
+
+% so far
\def\docopyvalue#1#2#3%
{\let\c!internal!\c!internal!n
@@ -694,7 +704,7 @@
% \let\c!internal!\c!internal!y
% \@EA\def\csname#1#2\endcsname{#3}%
% \fi}
-%
+%
% \def\dosetevalue#1#2#3%
% {\let\c!internal!\c!internal!n
% \ifcsname\k!prefix!#2\endcsname
@@ -704,7 +714,7 @@
% \let\c!internal!\c!internal!y
% \@EA\edef\csname#1#2\endcsname{#3}%
% \fi}
-%
+%
% \def\dosetgvalue#1#2#3%
% {\let\c!internal!\c!internal!n
% \ifcsname\k!prefix!#2\endcsname
@@ -714,8 +724,18 @@
% \let\c!internal!\c!internal!y
% \@EA\gdef\csname#1#2\endcsname{#3}%
% \fi}
-%
-% cleaner (not that much faster) don't pass #3 yet:
+%
+% \def\dosetxvalue#1#2#3%
+% {\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{#3}%
+% \else
+% \let\c!internal!\c!internal!y
+% \@EA\xdef\csname#1#2\endcsname{#3}%
+% \fi}
+%
+% cleaner (not that much faster) don't pass #3 yet:
%
% \def\dosetvalue#1#2%
% {\let\c!internal!\c!internal!n
@@ -726,7 +746,7 @@
% \let\c!internal!\c!internal!y
% \@EAEAEA\def\@EA\@EA\csname#1#2\endcsname
% \fi}
-%
+%
% \def\dosetevalue#1#2%
% {\let\c!internal!\c!internal!n
% \ifcsname\k!prefix!#2\endcsname
@@ -736,7 +756,7 @@
% \let\c!internal!\c!internal!y
% \@EAEAEA\edef\@EA\@EA\csname#1#2\endcsname
% \fi}
-%
+%
% \def\dosetgvalue#1#2%
% {\let\c!internal!\c!internal!n
% \ifcsname\k!prefix!#2\endcsname
@@ -746,7 +766,17 @@
% \let\c!internal!\c!internal!y
% \@EAEAEA\gdef\@EA\@EA\csname#1#2\endcsname
% \fi}
-%
+%
+% \def\dosetxvalue#1#2%
+% {\let\c!internal!\c!internal!n
+% \ifcsname\k!prefix!#2\endcsname
+% \let\c!internal!\c!internal!y
+% \@EAEAEA\xdef\@EA\@EA\csname#1\csname\k!prefix!#2\endcsname\endcsname
+% \else
+% \let\c!internal!\c!internal!y
+% \@EAEAEA\xdef\@EA\@EA\csname#1#2\endcsname
+% \fi}
+%
% \def\docopyvalue#1#2#3%
% {\let\c!internal!\c!internal!n
% \ifcsname\k!prefix!#3\endcsname
@@ -760,8 +790,8 @@
% \csname\@EA#1\@EA#3\@EA
% \endcsname\@EA{\csname#2#3\endcsname}%
% \fi}
-%
-% slightly more efficient (but not faster in day to day runs)
+%
+% slightly more efficient (but not faster in day to day runs)
\def\dosetvalue#1#2%
{\let\c!internal!\c!internal!n
@@ -793,22 +823,35 @@
\@EA\gdef\csname#1#2%\endcsname
\fi\endcsname}
-\def\docopyvalue#1#2#3%
+\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
- \@EAEAEA\def\@EA\@EA
- \csname#1\csname\k!prefix!#3\endcsname
- \endcsname\@EA{\csname#2\csname\k!prefix!#3\endcsname\endcsname}%
+ % \@EAEAEA\def\@EA\@EA
+ % \csname#1\csname\k!prefix!#3\endcsname
+ % \endcsname\@EA{\csname#2\csname\k!prefix!#3\endcsname\endcsname}%
+ \@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
- \@EAEAEA\def\@EA\@EA\csname#1#3\endcsname\@EA{\csname#2#3\endcsname}%
+ %\@EAEAEA\def\@EA\@EA\csname#1#3\endcsname\@EA{\csname#2#3\endcsname}%
+ \@EA\def\csname#1#3\@EA\endcsname\@EA{\csname#2#3\endcsname}%
\fi}
\endETEX
-%D We can now redefine some messages that will be
-%D introduced in the multi||lingual system module.
+%D We can now redefine some messages that will be
+%D introduced in the multi||lingual system module.
\def\showassignerror #1#2{\showmessage\m!check1{#1,#2}\waitonfatalerror}
\def\showargumenterror#1#2{\showmessage\m!check2{#1,#2}\waitonfatalerror}
@@ -1198,8 +1241,8 @@
%D those reference cards for each language without further
%D interference.
-%D Anno 2003 I've forgotten why the \type {\c!internal} is
-%D still in there; it's probably a left over from an experiment.
+%D Anno 2003 I've forgotten why the \type {\c!internal} is
+%D still in there; it's probably a left over from an experiment.
\let\c!internal!y \string
\def\c!internal!n {-}
@@ -1357,7 +1400,9 @@
{\doifdefinedelse{#2}
{\debuggerinfo{command}{core command #2 redefined as #1}}%
{\debuggerinfo{command}{#2 defined as #1}}%
- \@EAEAEA\def\@EA\csname\@EA#2\@EA\endcsname
+ %\@EAEAEA\def\@EA\csname\@EA#2\@EA\endcsname
+ % \@EA{\csname#1\endcsname}}%
+ \@EA\def\csname#2\@EA\endcsname % ugly but faster
\@EA{\csname#1\endcsname}}%
\setinterfacesetupvariable{#1}{#2}}}
@@ -1379,7 +1424,7 @@
\newif\ifinterfacetranslation
-% for a long time:
+% for a long time:
%
% \def\getinterfaceconstant#1%
% {\ifinterfacetranslation
@@ -1389,7 +1434,7 @@
% \else
% #1%
% \fi}
-%
+%
% \def\getinterfacevariable#1%
% {\ifinterfacetranslation
% \doifdefinedelse{\y!prefix!#1}
@@ -1398,8 +1443,8 @@
% \else
% #1%
% \fi}
-%
-% more compact
+%
+% more compact
\def\getinterfaceconstant#1%
{\ifinterfacetranslation
diff --git a/tex/context/base/mult-sys.tex b/tex/context/base/mult-sys.tex
index 4a726a15d..45e9c53c9 100644
--- a/tex/context/base/mult-sys.tex
+++ b/tex/context/base/mult-sys.tex
@@ -328,7 +328,8 @@
\def\!!twelvepoint {12pt}
\def\!!fourteenpointfour {14.4pt}
-\ifx\z@\undefined \newdimen\zeropoint \else \let\zeropoint\z@ \fi
+\ifx\z@\undefined \newdimen\zeropoint \else \let\zeropoint\z@ \fi \zeropoint = 0pt
+\ifx\p@\undefined \newdimen\onepoint \else \let\onepoint \p@ \fi \onepoint = 1pt
\newcount\medcard \medcard\!!medcard % used in font module
\newcount\maxcard \maxcard\!!maxcard % used in font module
@@ -337,6 +338,28 @@
\thousandpoint=1000pt
+%D Another optimization is:
+
+\let\points\onepoint
+
+%D A rough test is:
+%D
+%D \starttypen
+%D \def\TestMe % 7.75 sec on a P4/2G
+%D {\dimen0=10\points\dimen0=10\points\dimen0=10\points\dimen0=10\points\dimen0=10\points
+%D \dimen0=10\points\dimen0=10\points\dimen0=10\points\dimen0=10\points\dimen0=10\points}
+%D
+%D \def\TestMe % 11.5 sec on a P4/2G
+%D {\dimen0=10pt\dimen0=10pt\dimen0=10pt\dimen0=10pt\dimen0=10pt%
+%D \dimen0=10pt\dimen0=10pt\dimen0=10pt\dimen0=10pt\dimen0=10pt}
+%D
+%D \def\TestMe % 12.5 sec on a P4/2G
+%D {\dimen0=10\s!pt\dimen0=10\s!pt\dimen0=10\s!pt\dimen0=10\s!pt\dimen0=10\s!pt%
+%D \dimen0=10\s!pt\dimen0=10\s!pt\dimen0=10\s!pt\dimen0=10\s!pt\dimen0=10\s!pt}
+%D
+%D \testfeatureonce {500000}{\TestMe}
+%D \stoptypen
+
%D Variables are composed of a command specific tag and a user
%D supplied variable (system constant). The first tag \type{ag}
%D for instance is available as \type{\??ag} and expands to
@@ -644,6 +667,9 @@
\definefileconstant {privateprefix} {p-}
\definefileconstant {thirdprefix} {t-}
+%definefileconstant {beforeprefix} {b-}
+%definefileconstant {afterprefix} {a-}
+
%D \CONTEXT\ follows different strategies for finding files.
%D The macros that are responsible for this 'clever' searching
%D make use of two (very important) path specifiers.
diff --git a/tex/context/base/page-app.tex b/tex/context/base/page-app.tex
index 76a056a50..f3011934a 100644
--- a/tex/context/base/page-app.tex
+++ b/tex/context/base/page-app.tex
@@ -1,8 +1,8 @@
%D \module
-%D [ file=page-app, % from meta-fig
+%D [ file=page-app, % from meta-fig
%D version=1998.01.15,
%D title=\CONTEXT\ Core Macros,
-%D subtitle=Independent page building,
+%D subtitle=Independent page building,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
@@ -11,16 +11,16 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\writestatus{loading}{Context Page Macros / Applications}
+\writestatus{loading}{Context Page Macros / Applications}
-%D The fitting page code is moved from \type {meta-fig} to
-%D here.
+%D The fitting page code is moved from \type {meta-fig} to
+%D here.
-\unprotect
+\unprotect
\def\dostartfittingpage[#1][#2]%
- {\pagina % this is kind of tricky! there can be preceding page refs
- \bgroup % resulting in a zero height page; test fig-make !
+ {\pagina % this is kind of tricky! there can be preceding page refs
+ \bgroup % resulting in a zero height page; test fig-make !
\dontcomplain
\setbox\scratchbox\hbox
\bgroup
@@ -45,8 +45,8 @@
\edef\fittingwd{\the\wd\scratchbox}%
\edef\fittinght{\the\ht\scratchbox}%
\startlocallayout
- \ifdim\fittinght<\lineheight
- % write status : too small
+ \ifdim\fittinght<\lineheight
+ % write status : too small
\setbox\scratchbox\vbox to \lineheight{\vss\box\scratchbox\vss}%
\edef\fittinght{\the\lineheight}%
\fi
@@ -60,7 +60,7 @@
\stoplocallayout
\egroup}
-%D \TEX\ pages (for \METAPOST\ pages, see \type {meta-fig}):
+%D \TEX\ pages (for \METAPOST\ pages, see \type {meta-fig}):
\presetlocalframed[\??tg]
@@ -86,7 +86,7 @@
\c!hoogte=\v!passend,
\c!kader=\v!uit]
-%D Application pages (for an example, see \type {m-pstric}):
+%D Application pages (for an example, see \type {m-pstric}):
\def\@@texapp{texapp}
\def\@@texdim{texdim}
@@ -108,26 +108,26 @@
\bgroup
\let\f!temporaryextension\c!tex
\setbuffer[\@@texapp]%
- \starttext
- #2% preamble
+ \starttext
+ #2% preamble
\startTEXpage[#1]%
-\topskip\zeropoint
+ \topskip\zeropoint
\setbox\scratchbox\hbox{#3}%
- \saveTEXapplication02% dimensions
+ \saveTEXapplication02% dimensions
\box\scratchbox
\stopTEXpage
- \stoptext
+ \stoptext
\endbuffer
\egroup
\doifelse\jobsuffix{dvi}\donetrue\donefalse
\executesystemcommand{texexec \bufferprefix\@@texapp.tex --once --batch}%
- \ifdone % eps
+ \ifdone % eps
\executesystemcommand{dvips -E* -o \@@texapp.eps \@@texapp}%
- \else % pdf
+ \else % pdf
\executesystemcommand{dvips \bufferprefix\@@texapp}%
\executesystemcommand{ps2pdf \bufferprefix\@@texapp.ps \bufferprefix\@@texapp.pdf}%
\fi
- \restoreTEXapplication % dimensions
+ \restoreTEXapplication % dimensions
\setbox\scratchbox\hbox
{\expanded{\externalfigure
[\bufferprefix\@@texapp.\ifdone eps\else pdf\fi]
@@ -140,4 +140,4 @@
\box\scratchbox
\egroup}
-\protect \endinput
+\protect \endinput
diff --git a/tex/context/base/page-bck.tex b/tex/context/base/page-bck.tex
index 1c7a6a96f..58bf4922b 100644
--- a/tex/context/base/page-bck.tex
+++ b/tex/context/base/page-bck.tex
@@ -96,6 +96,22 @@
%D (On the 824 pages maps bibliography runtime went down from
%D 309 to 299 seconds.)
+% \def\checkbackground#1%
+% {\edef\!!stringe{\??ma#1}%
+% \doifelsevaluenothing{\!!stringe\c!achtergrond }
+% {\doifelsevaluenothing{\!!stringe\c!voorgrondkleur}
+% {\doifelsevalue{\!!stringe\c!kader }\v!aan\!!doneatrue
+% {\doifelsevalue{\!!stringe\c!linkerkader }\v!aan\!!doneatrue
+% {\doifelsevalue{\!!stringe\c!rechterkader}\v!aan\!!doneatrue
+% {\doifelsevalue{\!!stringe\c!bovenkader }\v!aan\!!doneatrue
+% {\doifelsevalue{\!!stringe\c!onderkader }\v!aan\!!doneatrue
+% \!!doneafalse}}}}}
+% \!!doneatrue}
+% \!!doneatrue
+% \if!!donea
+% \expandafter\setusage\else\expandafter\resetusage
+% \fi{\??ma#1}}
+
\def\checkbackground#1%
{\edef\!!stringe{\??ma#1}%
\doifelsevaluenothing{\!!stringe\c!achtergrond }
@@ -109,8 +125,10 @@
\!!doneatrue}
\!!doneatrue
\if!!donea
- \expandafter\setusage\else\expandafter\resetusage
- \fi{\??ma#1}}
+ \setusage \!!stringe
+ \else
+ \resetusage\!!stringe
+ \fi}
\def\ifsomebackgroundfound#1%
{\ifusage{\??ma#1}}
@@ -131,10 +149,9 @@
\def\addsomebackground#1#2#3#4% area box width height / zero test added
{\ifsomebackgroundfound#1\ifdim#3>\zeropoint\ifdim#4>\zeropoint
- \setbox#2\vbox\localframed
+ \setbox#2\vbox\fastlocalframed
[\??ma#1]
- [\c!component=#1,
- \c!strut=\v!nee,\c!offset=\v!overlay,
+ [\c!component=#1,\c!strut=\v!nee,\c!offset=\v!overlay,%
\c!breedte=#3,\c!hoogte=#4]
{\dp#2\zeropoint\box#2}%
\fi\fi\fi}
@@ -188,14 +205,14 @@
\def\addtextbackground#1%
{\ifconditional\hiddenbackgroundenabled
- \addsomebackground\v!verborgen#1\zetbreedte\teksthoogte % mine !
- \fi
+ \addsomebackground\v!verborgen#1\zetbreedte\teksthoogte % mine !
+ \fi
\addsomebackground\v!tekst#1\zetbreedte\teksthoogte}
% \def\addtextbackground#1%
% {\ifconditional\hiddenbackgroundenabled
-% \addsomebackground\v!verborgen #1\zetbreedte\teksthoogte % mine !
-% \fi
+% \addsomebackground\v!verborgen #1\zetbreedte\teksthoogte % mine !
+% \fi
% \doifbothsidesoverruled
% \addsomebackground\v!rechtertekst#1\zetbreedte\teksthoogte
% \orsideone
@@ -209,8 +226,8 @@
%D As said, these are cached in dedicated boxes. The offsets
%D and depth of the page are used for alignment purposes.
-\newdimen\pageoffset % bleed
-\newdimen\pagedepth
+\newdimen\pageoffset % bleed
+\newdimen\pagedepth
\let\pagebackgroundhoffset = \!!zeropoint
\let\pagebackgroundvoffset = \!!zeropoint
@@ -227,7 +244,7 @@
%D We need a bit more clever mechanism in order to handle
%D layers well. This means that we cannot calculate both
%D background at the same time since something may have
-%D changed halfway a page.
+%D changed halfway a page.
\chardef\newrightbackground0
\chardef\newleftbackground 0
@@ -241,24 +258,24 @@
\global\chardef\newleftbackground\plusone
\global\setbox\leftbackground\emptybox
\global\setbox\rightbackground\emptybox
- \fi
+ \fi
\doifbothsides
\ifcase\newleftbackground \else
- \showmessage\m!layouts8\empty
+ % \showmessage\m!layouts8\empty
\setbackgroundbox\leftbackground\relax
\global\chardef\newleftbackground\zerocount
\global\chardef\newrightbackground\zerocount
\fi
\orsideone
\ifcase\newleftbackground \else
- \showmessage\m!layouts8\empty
+ % \showmessage\m!layouts8\empty
\setbackgroundbox\leftbackground\relax
\global\chardef\newleftbackground\zerocount
%\global\chardef\newrightbackground\zerocount
\fi
\orsidetwo
\ifcase\newrightbackground \else
- \showmessage\m!layouts8\empty
+ % \showmessage\m!layouts8\empty
\setbackgroundbox\rightbackground\doswapmargins
\global\chardef\newrightbackground\zerocount
\fi
@@ -267,7 +284,7 @@
\def\addmainbackground#1% todo: dimension spec
{\ifsomebackground
- \setbackgroundboxes
+ \setbackgroundboxes
\setbox#1\vbox
{\offinterlineskip
\doifmarginswapelse
@@ -277,7 +294,7 @@
\fi}
\def\setbackgroundoffsets
- {\ifsomebackground \ifnewbackground
+ {\ifsomebackground \ifnewbackground
\global\let\pagebackgroundhoffset\!!zeropoint
\global\let\pagebackgroundvoffset\!!zeropoint
\global\let\pagebackgrounddepth \!!zeropoint
@@ -321,7 +338,7 @@
\smashbox#1}
\def\dodopagebodybackground#1#2%
- {\ifdim#2>\zeropoint % added, faster
+ {\ifdim#2>\zeropoint % added, faster
\setbox\scratchbox\vbox to #2
\bgroup\hbox\bgroup
\swapmargins
@@ -344,10 +361,9 @@
{\ifsomebackgroundfound{#3#4}%
\ifdim#2>\zeropoint\relax
\ifdim#1>\zeropoint\relax
- \localframed
+ \fastlocalframed
[\??ma#3#4]
- [\c!component=#3-#4,
- \c!breedte=#1,\c!hoogte=#2,\c!offset=\v!overlay]
+ [\c!component=#3-#4,\c!breedte=#1,\c!hoogte=#2,\c!offset=\v!overlay]
{\getvalue{\??ma#3#4\c!commando}}% {\hsize=#1\vsize=#2....}
\else
\hskip#1%
@@ -533,17 +549,17 @@
\let\docommando\relax
-%D The hidden layer can be populated by extending the
+%D The hidden layer can be populated by extending the
%D following comma separated list. This only happens in core
-%D modules.
+%D modules.
-% todo page-2 .. page+2 achter pagina -> bleed
+% todo page-2 .. page+2 achter pagina -> bleed
% spread-2 .. spread+2 achter spread -> spread (repeat 2 times)
\def\enablehiddenbackground
{\global\settrue\hiddenbackgroundenabled
- \global\somebackgroundtrue
- \recalculatebackgrounds}
+ \global\somebackgroundtrue
+ \recalculatebackgrounds}
\def\disablehiddenbackground
{\global\setfalse\hiddenbackgroundenabled}
@@ -555,8 +571,8 @@
[\v!verborgen]
[\c!achtergrond=\hiddenbackground]
-% The next series is used in local (for instance floating)
-% backgrounds.
+% The next series is used in local (for instance floating)
+% backgrounds.
\presetlocalframed
[\??ma\v!lokaal]
@@ -584,16 +600,16 @@
% \noexpand\dodoglobal\dp#1\the\dp#1}%
% \dp#1\zeropoint
% \redoglobal\setbox#1\hbox
-% {\localframed
+% {\fastlocalframed
% [\??ma\v!lokaal]
% [\c!kader=\v!uit,
% \c!offset=\v!overlay,
% \c!achtergrond=\localbackground]%
% {\registerMPlocaltextarea{\box#1}}}%
-% \ifdim\naturalfloatdepth>\zeropoint % maybe take difference
+% \ifdim\naturalfloatdepth>\zeropoint % maybe take difference
% \redoglobal\setbox#1\hbox{\lower\scratchdimen\box#1}%
-% \fi
-% \doglobal\increment\localpositionnumber % afterwards !
+% \fi
+% \doglobal\increment\localpositionnumber % afterwards !
% \next}
\def\doaddlocalbackground#1%
@@ -602,17 +618,15 @@
\noexpand\redoglobal\ht#1\the\ht#1%
\noexpand\dodoglobal\dp#1\the\dp#1}%
\dodoglobal\setbox#1\hbox
- {\localframed
+ {\fastlocalframed
[\??ma\v!lokaal]
- [\c!component=local,
- \c!kader=\v!uit,
- \c!offset=\v!overlay,
+ [\c!component=local,\c!kader=\v!uit,\c!offset=\v!overlay,%
\c!achtergrond=\localbackground]%
{\registerMPlocaltextarea{\box#1}}}%
\next
- \doglobal\increment\localpositionnumber\relax} % afterwards !
+ \doglobal\increment\localpositionnumber\relax} % afterwards !
-% Test how previous macro behaves with depth:
+% Test how previous macro behaves with depth:
%
% \startcolumnset
% \input tufte
diff --git a/tex/context/base/page-flt.tex b/tex/context/base/page-flt.tex
index d410a5ab8..a76d17e63 100644
--- a/tex/context/base/page-flt.tex
+++ b/tex/context/base/page-flt.tex
@@ -255,6 +255,69 @@
\let\floatrotation\!!zerocount
+% \def\presetfloatvariables#1#2#3#4%
+% {\doifcommonelse
+% {#2}
+% {\v!links,\v!rechts,\v!binnen,\v!buiten,%
+% \v!inlinker,\v!inrechter,\v!inmarge,%
+% \v!rugwit,\v!snijwit,%
+% \v!binnenmarge,\v!buitenmarge,\v!binnenrand,\v!buitenrand,%
+% \v!linkermarge,\v!linkerrand,\v!rechtermarge,\v!rechterrand}
+% {\global\parfloattrue}
+% {\global\parfloatfalse}%
+% \ifbinnenkolommen
+% \global\parfloatfalse
+% \fi
+% \global\sidefloatshift\zeropoint
+% \global\sidefloatmaximum\zeropoint
+% \global\chardef\sidefloatmethod\getvalue{\??fl#1\c!zijmethode}%
+% \global\chardef\textfloatmethod\getvalue{\??fl#1\c!tekstmethode}%
+% \global\chardef\sidefloatalign\zerocount
+% \globallet\floatrotation\!!zerocount
+% \calculatefloatskips{#1}%
+% \ifparfloat
+% \processaction
+% [\getvalue{\??fl#1\c!zijuitlijnen}]
+% [\v!hoogte=>\global\chardef\sidefloatalign\plusone,%
+% \v!regel=>\global\chardef\sidefloatalign\plustwo,% (***)
+% \v!diepte=>\global\chardef\sidefloatalign\plusthree,%
+% \v!grid=>\global\chardef\sidefloatalign4]%
+% \ifcase\sidefloatalign\relax
+% \doifinset\v!hoogte{#2}{\global\chardef\sidefloatalign\plusone}%
+% \doifinset\v!regel {#2}{\global\chardef\sidefloatalign\plustwo}%
+% \doifinset\v!diepte{#2}{\global\chardef\sidefloatalign\plusthree}%
+% \doifinset\v!grid {#2}{\global\chardef\sidefloatalign4}%
+% \fi
+% \doifinset\v!hoog{#2}{\global\sidefloattopskip \zeropoint}%
+% \doifinset\v!laag{#2}{\global\sidefloatbottomskip\zeropoint}%
+% \doifinset\v!passend{#2}
+% {\global\sidefloattopskip \zeropoint
+% \global\sidefloatbottomskip\zeropoint
+% \global\floatsideskip \zeropoint}%
+% \else
+% \processallactionsinset
+% [#2]
+% [ 90=>\globallet\floatrotation\commalistelement,%
+% 180=>\globallet\floatrotation\commalistelement,%
+% 270=>\globallet\floatrotation\commalistelement]%
+% \fi
+% \doifinsetelse\v!geennummer{#2}
+% {\global\nofloatnumbertrue}
+% {\doifelsevalue{\??kj#1\c!nummer}\v!ja
+% {\global\nofloatnumberfalse}
+% {\global\nofloatnumbertrue}}%
+% \ConvertToConstant\doifelse{#4}{}
+% {\global\emptyfloatcaptiontrue}
+% {\global\emptyfloatcaptionfalse}%
+% \doifinsetelse\v!geen{#2}
+% {\global\nofloatcaptiontrue}
+% {\ConvertToConstant\doifelse{#4}\v!geen
+% {\global\nofloatcaptiontrue}
+% {\global\nofloatcaptionfalse}}%
+% \ifemptyfloatcaption \ifnofloatnumber
+% \global\nofloatcaptiontrue
+% \fi \fi}
+
\def\presetfloatvariables#1#2#3#4%
{\doifcommonelse
{#2}
@@ -281,12 +344,14 @@
[\v!hoogte=>\global\chardef\sidefloatalign\plusone,%
\v!regel=>\global\chardef\sidefloatalign\plustwo,% (***)
\v!diepte=>\global\chardef\sidefloatalign\plusthree,%
- \v!grid=>\global\chardef\sidefloatalign4]%
+ \v!grid=>\global\chardef\sidefloatalign4,%
+ \v!halveregel=>\global\chardef\sidefloatalign5]%
\ifcase\sidefloatalign\relax
- \doifinset\v!hoogte{#2}{\global\chardef\sidefloatalign\plusone}%
- \doifinset\v!regel {#2}{\global\chardef\sidefloatalign\plustwo}%
- \doifinset\v!diepte{#2}{\global\chardef\sidefloatalign\plusthree}%
- \doifinset\v!grid {#2}{\global\chardef\sidefloatalign4}%
+ \doifinset\v!hoogte {#2}{\global\chardef\sidefloatalign\plusone}%
+ \doifinset\v!regel {#2}{\global\chardef\sidefloatalign\plustwo}%
+ \doifinset\v!diepte {#2}{\global\chardef\sidefloatalign\plusthree}%
+ \doifinset\v!grid {#2}{\global\chardef\sidefloatalign4}%
+ \doifinset\v!halveregel{#2}{\global\chardef\sidefloatalign5}% meant for 'none'
\fi
\doifinset\v!hoog{#2}{\global\sidefloattopskip \zeropoint}%
\doifinset\v!laag{#2}{\global\sidefloatbottomskip\zeropoint}%
@@ -1206,7 +1271,7 @@
\def\docheckcaptioncontent#1#2#3#4%
{\ifnofloatcaption \else
\setbox\tempcaptionbox\hbox
- {\trialtypesettingtrue\footnotesenabledfalse\putcompletecaption{#4}{#2}{#3}{0}}%
+ {\trialtypesettingtrue\notesenabledfalse\putcompletecaption{#4}{#2}{#3}{0}}%
% new, \placefigure{\XMLflush{somecaption}}{} passes earlier empty check
% so here we misuse the scratch box; actually this means that the previous
% test can go away (some day, when i redo this module)
@@ -1314,7 +1379,7 @@
\dosetraggedvbox\@@kjkjuitlijnen
\setbox\scratchbox\raggedbox % trial run
{\hsize\wd\tempfloatbox
- \footnotesenabledfalse
+ \notesenabledfalse
\putcompletecaption{#4}{#2}{#3}{0}}%
\ifdim\ht\scratchbox>\lineheight % more lines
\dosetraggedvbox\@@kjkjuitlijnen
@@ -1341,7 +1406,7 @@
{\advance\scratchdimen \captionovershoot
\advance\scratchdimen 3em % an average word length
\ifdim\scratchdimen<\hsize \hsize\scratchdimen \fi
- \footnotesenabledfalse
+ \notesenabledfalse
\putcompletecaption{#4}{#2}{#3}{0}}%
\ifdim\ht\scratchbox>\lineheight
% at least an average word longer than a line
@@ -1972,7 +2037,7 @@
\bgroup
\insidefloattrue
\getparameters[\??si][#1]%
- \resetnummer[\??si]%
+ \resetnumber[\??si]%
\def\floatcaptionsuffix{\nummer[\??si]}%
\TABLEcaptionheight=\@@siregels\lineheight % brrr
\simplifypagebreak % \page becomes \goodbreak
diff --git a/tex/context/base/page-flw.tex b/tex/context/base/page-flw.tex
index 65d18c49c..8d69b5d53 100644
--- a/tex/context/base/page-flw.tex
+++ b/tex/context/base/page-flw.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=page-flw,
-%D version=2003.04.19, % from test-002 (1997) profile experiment
+%D version=2003.04.19, % from test-002 (1997) profile experiment
%D title=\CONTEXT\ OTR Macros,
%D subtitle=Text Flows,
%D author=Hans Hagen,
@@ -13,13 +13,16 @@
\writestatus{loading}{Context OTR Macros / Text Flows}
-\unprotect
+%D This is high experimental and especially flushing may change (proper
+%D spacing is the driving force here).
+
+\unprotect
\def\definetextflow
{\dodoubleempty\dodefinetextflow}
\def\dodefinetextflow[#1][#2]% flow settings
- {\iffirstargument
+ {\iffirstargument
\doiftextflowcollectorelse{#1}
{\setbox\textflowcollector{#1}\emptybox}
{\@EA\newbox\csname\??tx:c:#1\endcsname}%
@@ -64,30 +67,30 @@
\unvbox\textflowcollector{#1}%
\fi}}
-\protect \endinput
+\protect \endinput
-% Example (dutch)
-%
+% Example (dutch)
+%
% \stelpapierformaatin [S6]
% \steltolerantiein [soepel,rek]
% \stelkleurenin [status=start]
% \stelvoetin [strut=nee]
% \stelwitruimtein [groot]
-%
+%
% \stellayoutin
% [rechterrand=5cm,breedte=passend,marge=0pt,randafstand=1cm,
% voet=4cm,voetafstand=1cm,hoofd=0cm]
-%
-% \stelteksttekstenin[rand][][\flushtextflow{first}]
-% \stelvoettekstenin [rand][][\flushtextflow{second}]
-% \stelvoettekstenin [\flushtextflow{third}][]
-%
-% \definetextflow [first] [alfa] [breedte=\rechterrandbreedte]
-% \definetextflow [second] [beta] [breedte=\rechterrandbreedte]
-% \definetextflow [third] [gamma] [breedte=\voethoogte]
-%
+%
+% \stelteksttekstenin[rand][][\vbox{\flushtextflow{alpha}}]
+% \stelvoettekstenin [rand][][\vbox{\flushtextflow{beta}}]
+% \stelvoettekstenin [\vbox{\flushtextflow{gamma}}][]
+%
+% \definetextflow [alfa] [breedte=\rechterrandbreedte]
+% \definetextflow [beta] [breedte=\rechterrandbreedte]
+% \definetextflow [gamma] [breedte=\voethoogte]
+%
% \starttekst
-%
+%
% \dorecurse{50}
% {\getrandomnumber{\funny}{0}{8}
% \ifcase\funny \starttextflow[alfa] \input tufte.tex \stoptextflow
@@ -100,5 +103,5 @@
% \or {\bf MATERIE}\quad \input materie \par
% \else {\bf MATERIE}\quad \input materie \par
% \fi}
-%
-% \stoptekst
+%
+% \stoptekst \ No newline at end of file
diff --git a/tex/context/base/page-imp.tex b/tex/context/base/page-imp.tex
index 8d318b4b0..64eb21949 100644
--- a/tex/context/base/page-imp.tex
+++ b/tex/context/base/page-imp.tex
@@ -243,7 +243,7 @@
270=>\gdef\arrangedrotationO{270}\gdef\arrangedrotationE{90},
\s!reset=>\global\arrangingpagesfalse,
\s!unknown=>\checkinstalledpagearrangement\commalistelement]%
- % no \s!default=> we can have aaa,,bbb
+ % no \s!default=> we can have aaa,,bbb
\doifcommonelse{#1}{90,270,\v!geroteerd}
{\swapmacros\horizontalcutmarks\verticalcutmarks}{}% ugly solution
\setuppapersize
@@ -256,7 +256,7 @@
{\setgvalue{\??pp\??pp#1}}
\def\checkinstalledpagearrangement#1% can be empty: aaa,,bbb
- {\executeifdefined{\??pp\??pp#1}\donothing}
+ {\executeifdefined{\??pp\??pp#1}\donothing}
\def\dosetuparrangement#1#2#3#4#5#6#7#8%
{\global\chardef\arrangedpageX #1%
@@ -314,6 +314,10 @@
\installpagearrangement 2*2*4 % onother one of Willy Egger
{\dosetuparrangement{2}{1}{8}{3}{2}%
\pusharrangedpageSIXTEENFOUR\poparrangedpagesAtoH\relax}
+
+\installpagearrangement 4SIDE
+ {\dosetuparrangement{1}{2}{4}{2}{3}%
+ \pusharrangedpageFOURSIDE\poparrangedpagesFOURSIDE\handlearrangedpageTOP}
% \def\filluparrangedpages % beware: \realpageno is 1 ahead
% {\ifarrangingpages
@@ -327,9 +331,9 @@
\def\filluparrangedpages % beware: \realpageno is 1 ahead
{\ifarrangingpages
- \scratchcounter\realpageno
+ \scratchcounter\realpageno
\advance\scratchcounter \minusone
- \dosetmodulo\scratchcounter\arrangedpageT\scratchcounter
+ \dosetmodulo\scratchcounter\arrangedpageT\scratchcounter
\ifcase\scratchcounter\else
\advance\scratchcounter \plusone
\dostepwiserecurse\scratchcounter\arrangedpageT\plusone
@@ -516,10 +520,10 @@
\def\splitoffarrangedpagesTWO
{\splittopskip\zeropoint
- \global\setbox\arrangedpageA\vsplit\arrangedpageB to \!!onepoint
+ \global\setbox\arrangedpageA\vsplit\arrangedpageB to \onepoint
\scratchdimen\ht\arrangedpageB
- \advance\scratchdimen -\!!onepoint
- \ifdim\scratchdimen>\!!onepoint
+ \advance\scratchdimen -\onepoint
+ \ifdim\scratchdimen>\onepoint
\setbox\scratchbox\vsplit\arrangedpageB to \scratchdimen
\fi}
@@ -597,10 +601,31 @@
\offinterlineskip
\unvbox\arrangedpageB
\allowbreak
- \ht#1=\!!onepoint
- \dp#1=\zeropoint
+ \ht#1\onepoint
+ \dp#1\zeropoint
\vbox{\box#1}}}
+\def\poparrangedpagesFOURSIDE
+ {\bgroup
+ \gdef\arrangedpageN{2}%
+ \poparrangedpagesTWO
+ \let\arrangedpageA\arrangedpageC
+ \let\arrangedpageB\arrangedpageD
+ \gdef\arrangedpageN{2}%
+ \poparrangedpagesTWO
+ \egroup}
+
+\def\pusharrangedpageFOURSIDE#1%
+ {\doglobal\increment\arrangedpageN
+ \reportarrangedpage\arrangedpageN
+ \ifcase\arrangedpageN
+ \or \handlearrangedpageXandY{#1}000\arrangedpageA % 1
+ \or \handlearrangedpageXandY{#1}000\arrangedpageC % 2
+ \or \handlearrangedpageXandY{#1}000\arrangedpageB % 1
+ \or \handlearrangedpageXandY{#1}000\arrangedpageD % 2
+ \poparrangedpages
+ \fi}
+
%D Willy Egger's sheet simulations:
\def\poparrangedpagesAtoH
@@ -684,15 +709,15 @@
\fi}
% % handy for stickers etc, this way we can treat them as page
-%
+%
% \setuppapersize [XY][A4]
% \setuppaper [topspace=5mm,backspace=5mm,dx=1mm,dy=1mm,nx=2,ny=6]
% \setuplayout [page] [topspace=5mm,backspace=5mm]
-% \setuplayout [page]
+% \setuplayout [page]
% \setuplayout [location=middle]
% \setuparranging [XY]
% \showframe
-%
+%
% \starttext \dorecurse{30}{test \recurselevel \page} \stoptext
\def\pusharrangedpageXY#1%
@@ -700,21 +725,21 @@
\reportarrangedpage\arrangedpageN
\doglobal\increment\arrangedpageM
\global\setbox\arrangedpageB\hbox
- \ifdim\@@ppbreedte>\zeropoint to \@@ppbreedte \fi
+ \ifdim\@@ppbreedte>\zeropoint to \@@ppbreedte \fi
{\ifvoid\arrangedpageB\else
\unhbox\arrangedpageB\hss\hskip\@@ppdx\hss
\fi
\box#1}%
\ifnum\arrangedpageM<\arrangedpageX\else
\global\setbox\arrangedpageA\vbox
- \ifdim\@@pphoogte>\zeropoint to \@@pphoogte \fi
+ \ifdim\@@pphoogte>\zeropoint to \@@pphoogte \fi
{\offinterlineskip
\ifvoid\arrangedpageA\else
\unvbox\arrangedpageA\vss\vskip\@@ppdy\vss
\fi
\box\arrangedpageB}%
\doglobal\newcounter\arrangedpageM
- \fi
+ \fi
\ifnum\arrangedpageN<\arrangedpageT\else
\poparrangedpages
\fi}
@@ -733,7 +758,7 @@
{\dosetuparrangement\@@ppnx\@@ppny\@@ppxy\!!zerocount\!!zerocount
\pusharrangedpageXY\poparrangedpagesXY\relax}
-\beginETEX \dimexpr
+\beginETEX \dimexpr
\definepapersize
[XY]
@@ -744,7 +769,7 @@
[\c!breedte=\dimexpr(\printpapierbreedte-2\dimexpr(\@@pprugwit)),
\c!hoogte =\dimexpr(\printpapierhoogte -2\dimexpr(\@@ppkopwit))]
-\endETEX
+\endETEX
% \definepageshift[test][horizontal][10pt,20pt,30pt,40pt,50pt]
% \definepageshift[test][vertical] [10pt,20pt,30pt,40pt,50pt]
@@ -1028,6 +1053,7 @@
\hfilneg}
\vfil}%
\vfilneg}%
+ \pagina
\ifnum\combinedpagescounter>\@@ipn \exitloop\fi}
\else
\doloop
@@ -1133,7 +1159,7 @@
\vskip\@@pcoffset
\hsize\@@pcbreedte
\ifpagecomment
- \getbuffer[\v!pagecomment]%
+ \getbuffer[\v!pagecomment]%
\global\pagecommentfalse
\fi
\vss}%
@@ -1221,4 +1247,4 @@
% \starttext \slicepages[slice1.pdf][n=3] \stoptext
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/page-ini.tex b/tex/context/base/page-ini.tex
index 3100aded7..9bf9d5fe3 100644
--- a/tex/context/base/page-ini.tex
+++ b/tex/context/base/page-ini.tex
@@ -654,8 +654,8 @@
\def\synchronizehsize {\OTRcommand\synchronizehsize}
-\def\gotonextpage {\OTRcommand\gotonextpage }
-\def\gotonextpageX {\OTRcommand\gotonextpageX} % will become obsolete
+\def\gotonextpage {\OTRcommand\gotonextpage }
+\def\gotonextpageX{\OTRcommand\gotonextpageX} % will become obsolete
% beter een \installotr#1 met #1 = macro en auto test
@@ -863,8 +863,13 @@
%D on the baseline, as is the case with preceding pages.
%D Also, a \type {\vfil} better than a \type {\vfill}.
-\def\eject {\par\penalty-\@M } % == {\par\break} % plain
-\def\supereject {\par\penalty-\@MM} % also plain
+% to be replaced by \page[now] \page[final] / merged
+
+% \def\eject {\par\penalty-\@M } % == {\par\break} % plain
+% \def\supereject {\par\penalty-\@MM} % also plain
+
+\def\eject {\par\penalty-\@M \resetpagebreak} % == {\par\break} % plain
+\def\supereject {\par\penalty-\@MM\resetpagebreak} % also plain
\def\doejectpage {\par\ifdim\pagetotal>\pagegoal\else\normalvfil\fi}
\def\ejectpage {\doejectpage\eject}
@@ -1025,7 +1030,7 @@
[ \v!concept=>\chardef\conceptmode\plusone,% simple banner
\v!file=>\chardef\conceptmode\plustwo,% full banner
\v!voorlopig=>\chardef\conceptmode\plustwo % full banner plus
- \overfullrule5\s!pt]} % info in the margin
+ \overfullrule5\points]} % info in the margin
\def\versie
{\dosingleargument\doversie}
@@ -1198,11 +1203,23 @@
\box#1}%
\dp#1\zeropoint}
-\newif\ifpagebodyornaments \pagebodyornamentstrue
+% \newif\ifpagebodyornaments \pagebodyornamentstrue
+%
+% \appendtoks
+% \global\pagebodyornamentstrue
+% \to \everyaftershipout
+
\newif\ifarrangingpages \arrangingpagesfalse
+\chardef\pageornamentstate\zerocount % 0=on 1=one-off 2=always-off
+
+\def\pagebodyornamentstrue {\chardef\pageornamentstate\zerocount} % for a while
+\def\pagebodyornamentsfalse{\chardef\pageornamentstate\plusone} % for a while
+
\appendtoks
- \global\pagebodyornamentstrue
+ \ifcase\pageornamentstate\or
+ \chardef\pageornamentstate\zerocount
+ \fi
\to \everyaftershipout
\let\poparrangedpages\relax
@@ -1223,59 +1240,6 @@
\newif\ifsavepagebody \newbox\savedpagebody
-% \def\buildpagebody#1#2%
-% {\ifsavepagebody\global\setbox\savedpagebody\fi
-% \vbox
-% {\beginrestorecatcodes
-% \forgetall % igv problemen, check: \boxmaxdepth\maxdimen
-% \boxmaxdepth\maxdimen % new
-% \mindermeldingen
-% \setbox\pagebox\vbox
-% {\offinterlineskip
-% \ifpagebodyornaments
-% % \getbackgroundbox
-% % \getlogobox
-% \bgroup % else footnotes get inconsistent font/baseline
-% % \doconvertfont\@@lyletter\empty
-% \dostartattributes\??ly\c!letter\c!kleur\empty
-% \offinterlineskip
-% \gettextboxes
-% \dostopattributes
-% \egroup
-% \fi
-% \getmainbox#1#2}% including footnotes
-% \ifpagebodyornaments
-% \addmainbackground \pagebox
-% \addlogobackground \pagebox
-% \fi
-% \buildpagebox \pagebox
-% \addstatusinfo \pagebox
-% \ifpagebodyornaments
-% \addpagebackground \pagebox
-% \fi
-% \registerpageposition\pagebox
-% \ifarrangingpages
-% \shiftpaperpagebox \pagebox % \v!papier
-% \else
-% \clippagebox \pagebox
-% \addpagecutmarks \pagebox
-% \replicatepagebox \pagebox
-% \scalepagebox \pagebox
-% \mirrorpaperbox \pagebox
-% \rotatepaperbox \pagebox
-% \addpagecolormarks \pagebox
-% \centerpagebox \pagebox
-% \addprintbackground\pagebox
-% \mirrorprintbox \pagebox
-% \rotateprintbox \pagebox
-% \shiftprintpagebox \pagebox % \v!pagina
-% \offsetprintbox \pagebox
-% \negateprintbox \pagebox
-% \fi
-% \box\pagebox
-% \endrestorecatcodes}%
-% \ifsavepagebody\copy\savedpagebody\fi}
-
% beware, \??ly is used before defined, i.e. bad module design
\setuplayout[\c!methode=\v!normaal]
@@ -1292,7 +1256,7 @@
\executeifdefined{\??ly\c!methode\@@lymethode}%
{\getvalue{\??ly\c!methode\v!normaal}}#1#2%
% the finishing touch
- \ifpagebodyornaments
+ \ifcase\pageornamentstate
\addpagebackground \pagebox
\fi
\registerpageposition\pagebox
@@ -1321,7 +1285,7 @@
\setvalue{\??ly\c!methode\v!normaal}#1#2%
{\setbox\pagebox\vbox
{\offinterlineskip
- \ifpagebodyornaments
+ \ifcase\pageornamentstate
\bgroup % else footnotes get inconsistent font/baseline
\dostartattributes\??ly\c!letter\c!kleur\empty
\offinterlineskip
@@ -1330,7 +1294,7 @@
\egroup
\fi
\getmainbox#1#2}% including footnotes
- \ifpagebodyornaments
+ \ifcase\pageornamentstate
\addmainbackground \pagebox
\addlogobackground \pagebox
\fi
@@ -1371,7 +1335,7 @@
\dotoks\aftereverypage
\resetpagebreak
\updatelistreferences
- \resetlayoutlines % will go to \aftereverypage
+ \resetlayouttextlines % will go to \aftereverypage
\stopcolorpage
\the\everyafterpagebody}
@@ -1385,6 +1349,8 @@
\newif\ifpaginageblokkeerd \paginageblokkeerdfalse
+\chardef\testpagemethod=0
+
\def\testpage
{\dodoubleempty\dotestpage}
@@ -1403,8 +1369,21 @@
\advance\scratchdimen#2\relax
\fi
% quite inaccurate, better pagegoal 1pt or so
- \ifdim\scratchdimen>.99\pagegoal
- \penalty-\!!tenthousand\relax
+ \ifcase\testpagemethod
+ \ifdim\scratchdimen>.99\pagegoal
+ \penalty-\!!tenthousand\relax
+ \fi
+ \or
+ \advance\scratchdimen-\pagegoal
+ \ifdim\scratchdimen>-\lineheight
+ \penalty-\!!tenthousand\relax
+ \fi
+ \or
+ \getnoflines\pagegoal
+ \advance\scratchdimen-\noflines\lineheight \relax
+ \ifdim\scratchdimen>-\lineheight
+ \penalty-\!!tenthousand\relax
+ \fi
\fi
\fi
\else
@@ -1446,7 +1425,7 @@
{\global\paginageblokkeerdfalse}
\def\simplifypagebreak
- {\def\pagebreak{\goodbreak}}
+ {\def\dopagebreak[##1]{\goodbreak}}
\def\executepagebreakhandler#1%
{\edef\@@pagespecification{#1}%
@@ -1459,19 +1438,46 @@
\long\def\installpagebreakhandler#1#2%
{\long\setvalue{\??pe:#1}{#2}}
-\definecomplexorsimple\pagebreak
+% \definecomplexorsimple\pagebreak
-\def\simplepagebreak
- {\flushnotes
- \executepagebreakhandler\v!ja}
+% \def\simplepagebreak
+% {\executepagebreakhandler\v!ja}
+
+% \def\complexpagebreak[#1]% if empty, do nothing and avoid processing,
+% {\flushnotes % see head's; watch how we group
+% \doifsomething{#1}{\bgroup\executepagebreakhandlers{#1}\egroup}}
+
+\def\pagebreak
+ {\dosingleempty\dopagebreak}
-\def\complexpagebreak[#1]% if empty, do nothing and avoid processing,
- {\flushnotes % see head's; watch how we group
- \doifsomething{#1}{\bgroup\executepagebreakhandlers{#1}\egroup}}
+\def\dopagebreak[#1]% so, page ornaments are reset after a pagebreak command, unless set
+ {\bgroup
+ \edef\prevrealpageno{\the\realpageno}%
+ \ifcase\pageornamentstate \or
+ % disable reset after shipout
+ \global\chardef\pageornamentstate\plustwo
+ \fi
+ \iffirstargument % or if empty i.e. []
+ \flushnotes\executepagebreakhandlers{#1}%
+ \else % so, no pagebreak when \pagebreak[] ! ! !
+ \flushnotes\executepagebreakhandler\v!ja
+ \fi
+ \ifnum\prevrealpageno<\realpageno
+ \global\chardef\pageornamentstate\zerocount
+ \fi
+ \egroup}
\def\executepagebreakhandlers#1%
{\processcommacommand[#1]\executepagebreakhandler}
+\installpagebreakhandler \s!dummy
+ {\ejectinsert
+ \gotonextpage
+ \ejectdummypage}
+
+\installpagebreakhandler \v!kader
+ {\page\bgroup\showframe\page[\v!leeg]\egroup}
+
\installpagebreakhandler \s!unknown
{\doifinstringelse{+}\@@pagespecification
{\ejectinsert
@@ -1492,7 +1498,8 @@
{} % do nothing if empty
\installpagebreakhandler \v!reset
- {\global\paginageblokkeerdfalse}
+ {% better not: \global\chardef\pageornamentstate\zerocount
+ \resetpagebreak}
\installpagebreakhandler \v!blokkeer
{\global\paginageblokkeerdtrue}
@@ -1512,7 +1519,9 @@
\fi}
\installpagebreakhandler \v!blanko
- {\global\pagebodyornamentsfalse}
+ {\ifcase\pageornamentstate
+ \global\chardef\pageornamentstate\plusone
+ \fi}
\installpagebreakhandler \v!nee
{\ifpaginageblokkeerd\else
@@ -1540,10 +1549,8 @@
\installpagebreakhandler \v!leeg
{\ejectinsert
\gotonextpage
- \doifnotvalue{\??tk\v!hoofd\c!status}\v!stop
- {\setupheader[\c!status=\v!leeg]}%
- \doifnotvalue{\??tk\v!voet\c!status}\v!stop
- {\setupfooter[\c!status=\v!leeg]}%
+ \doifnotvalue{\??tk\v!hoofd\c!status}\v!stop{\setupheader[\c!status=\v!leeg]}%
+ \doifnotvalue{\??tk\v!voet \c!status}\v!stop{\setupfooter[\c!status=\v!leeg]}%
\ejectdummypage}
\installpagebreakhandler \v!links
@@ -1568,13 +1575,11 @@
\installpagebreakhandler \v!even
{\pagina
- \doifoddpageelse
- {\resetcurrentsectionmarks\ejectdummypage}\donothing}
+ \doifoddpageelse{\resetcurrentsectionmarks\ejectdummypage}\donothing}
\installpagebreakhandler \v!oneven
{\pagina
- \doifoddpageelse
- \donothing{\resetcurrentsectionmarks\ejectdummypage}}
+ \doifoddpageelse\donothing{\resetcurrentsectionmarks\ejectdummypage}}
\installpagebreakhandler \v!viertal % not yet ok inside columnsets
{\ifdubbelzijdig
@@ -1606,12 +1611,10 @@
% nb: \executepagebreakhandler\v!hoofd in other ones
\installpagebreakhandler \v!hoofd
- {\doifnotvalue{\??tk\v!hoofd\c!status}\v!stop
- {\setupheader[\c!status=\v!leeg]}}
+ {\doifnotvalue{\??tk\v!hoofd\c!status}\v!stop{\setupheader[\c!status=\v!leeg]}}
\installpagebreakhandler \v!voet
- {\doifnotvalue{\??tk\v!voet\c!status}\v!stop
- {\setupfooter[\c!status=\v!leeg]}}
+ {\doifnotvalue{\??tk\v!voet \c!status}\v!stop{\setupfooter[\c!status=\v!leeg]}}
% \definepagebreak
% [chapter]
diff --git a/tex/context/base/page-lay.tex b/tex/context/base/page-lay.tex
index 373b65d67..1716614b3 100644
--- a/tex/context/base/page-lay.tex
+++ b/tex/context/base/page-lay.tex
@@ -377,10 +377,10 @@
\global\printpapierhoogte\getvalue{\??pp##1\c!hoogte}%
\xdef\printpapersize{##1}}}}%
\processcommacommand[#2]\docommando
- \global\setdimentoatleast\papierbreedte \!!onepoint
- \global\setdimentoatleast\papierhoogte \!!onepoint
- \global\setdimentoatleast\printpapierbreedte\!!onepoint
- \global\setdimentoatleast\printpapierhoogte \!!onepoint
+ \global\setdimentoatleast\papierbreedte \onepoint
+ \global\setdimentoatleast\papierhoogte \onepoint
+ \global\setdimentoatleast\printpapierbreedte\onepoint
+ \global\setdimentoatleast\printpapierhoogte \onepoint
\ifcase\paperlandscape\else
\doglobal\swapdimens\papierbreedte\papierhoogte
\fi
@@ -535,6 +535,10 @@
% inconsistent specification
\fi}}%
\else
+ % beware, when the bodyfont changes (switched) this wil lchange as well; implementing
+ % a global lineheight is tricky: should we take the bodyfont ils or the one set
+ % independent of the bodyfont (before or after a layout spec); way too fuzzy, so we
+ % stick to the current method (after a night of experimenting ...2003/10/13)
\global\zethoogte\layoutparameter\c!regels\lineheight
% new, cleaner
\global\advance\zethoogte-\strutheight
@@ -548,8 +552,8 @@
\fi
\rugoffset\layoutparameter\c!rugoffset
\kopoffset\layoutparameter\c!kopoffset
- \global\setdimentoatleast\zetbreedte\!!onepoint
- \global\setdimentoatleast\zethoogte \!!onepoint
+ \global\setdimentoatleast\zetbreedte\onepoint
+ \global\setdimentoatleast\zethoogte \onepoint
% \checkcurrentlayout % here ?
\calculatehsizes
\calculatevsizes
@@ -587,24 +591,44 @@
\appendtoks \checklayout \to \everystarttext
+% \def\checkcurrentlayout % public and used in naw, so keep this name
+% {\ifundefined{\??ly\realfolio\c!status}%
+% \doifoddpageelse\checkcurrentoddlayout\checkcurrentevenlayout
+% \else
+% \doifvalue{\??ly\realfolio\c!status}\v!start
+% {\edef\currentlayout{\realfolio}\recalculatelayout}%
+% \fi}
+
+% \def\checkcurrentoddlayout
+% {\ifundefined{\??ly\v!oneven\c!status}\else
+% \doifvalue{\??ly\v!oneven\c!status}\v!start
+% {\let\currentlayout\v!oneven\recalculatelayout}%
+% \fi}
+
+% \def\checkcurrentevenlayout
+% {\ifundefined{\??ly\v!even\c!status}\else
+% \doifvalue{\??ly\v!even\c!status}\v!start
+% {\let\currentlayout\v!even\recalculatelayout}%
+% \fi}
+
\def\checkcurrentlayout % public and used in naw, so keep this name
{\ifundefined{\??ly\realfolio\c!status}%
\doifoddpageelse\checkcurrentoddlayout\checkcurrentevenlayout
\else
\doifvalue{\??ly\realfolio\c!status}\v!start
- {\edef\currentlayout{\realfolio}\recalculatelayout}%
+ {\xdef\currentlayout{\realfolio}\recalculatelayout}% new, global
\fi}
\def\checkcurrentoddlayout
{\ifundefined{\??ly\v!oneven\c!status}\else
\doifvalue{\??ly\v!oneven\c!status}\v!start
- {\let\currentlayout\v!oneven\recalculatelayout}%
+ {\globallet\currentlayout\v!oneven\recalculatelayout}% new, global
\fi}
\def\checkcurrentevenlayout
{\ifundefined{\??ly\v!even\c!status}\else
\doifvalue{\??ly\v!even\c!status}\v!start
- {\let\currentlayout\v!even\recalculatelayout}%
+ {\globallet\currentlayout\v!even\recalculatelayout}% new, global
\fi}
\appendtoks \checkcurrentlayout \to \everyaftershipout
@@ -634,14 +658,29 @@
{\getparameters[\??ly#1][#2]%
\checkforems[#2]}}
+% \def\dosetuplayout[#1][#2]%
+% {\let\currentlayout\empty
+% \ifsecondargument
+% \dodosetuplayout[#1][#2]%
+% \else\iffirstargument
+% \doifassignmentelse{#1}
+% {\dodosetuplayout[][#1]}
+% {\doifnot{#1}\v!reset{\def\currentlayout{#1}}}%
+% \fi\fi
+% \recalculatelayout
+% \checkcurrentlayout % here ?
+% \presetcenterpagebox}
+
+% global needed for non-doublesided standardmakeup
+
\def\dosetuplayout[#1][#2]%
- {\let\currentlayout\empty
+ {\globallet\currentlayout\empty % new, global
\ifsecondargument
\dodosetuplayout[#1][#2]%
\else\iffirstargument
\doifassignmentelse{#1}
{\dodosetuplayout[][#1]}
- {\doifnot{#1}\v!reset{\def\currentlayout{#1}}}%
+ {\doifnot{#1}\v!reset{\xdef\currentlayout{#1}}}% new, global
\fi\fi
\recalculatelayout
\checkcurrentlayout % here ?
@@ -835,7 +874,7 @@
{\mirrorpagebodybox{#1}\printmirror}
\def\scalepagebox#1%
- {\ifdim\@@lyschaal pt=1pt \else
+ {\ifdim\@@lyschaal\points=\onepoint \else
\setbox#1\vbox
{\schaal[\c!sx=\@@lyschaal,\c!sy=\@@lyschaal]{\box#1}}%
\papierbreedte\@@lyschaal\papierbreedte
@@ -847,29 +886,60 @@
\negatecolorbox{#1}%
\fi}
-\def\pagecutmarksymbol
- {\the\realpageno}
-
-\def\pagecutmarklength
- {.5cm}
-
-\def\addpagecutmarks#1%
- {\doif\@@lymarkering\v!aan
- {\let\cutmarksymbol\pagecutmarksymbol
- \let\cutmarklength\pagecutmarklength
- \makecutbox{#1}}}
+\def\pagecutmarksymbol {\the\realpageno}
+\def\pagecutmarklength {.5cm}
+\let\pagecutmarktoptext \empty
+\let\pagecutmarkbottomtext \empty
+
+% \def\addpagecutmarks#1%
+% {\doif\@@lymarkering\v!aan
+% {\let\cutmarksymbol\pagecutmarksymbol
+% \let\cutmarklength\pagecutmarklength
+% \makecutbox{#1}}}
+
+% \def\addpagecolormarks % #1
+% {\doifelse\@@lymarkering\v!kleur
+% {\doaddpagecolormarks\colormarkbox}
+% {\doifelse\@@lymarkering\v!raster
+% {\doaddpagecolormarks\rastermarkbox}
+% {\gobbleoneargument}}}
+
+% \def\doaddpagecolormarks#1#2%
+% {\let\cutmarksymbol\pagecutmarksymbol
+% \let\cutmarklength\pagecutmarklength
+% \makecutbox{#2}%
+% \ifnum\horizontalcutmarks>2 \chardef\colormarkoffset4 \fi
+% \ifnum\verticalcutmarks >2 \chardef\colormarkoffset4 \fi
+% #1{#2}}
+
+\def\extrapagecutmarkbottomtext
+ {\rlap{\jobname}\hfill\currentdate\space-\space\currenttime\hfill\llap{\realfolio}}
+
+\def\makepagecutbox % #1
+ {\let\cutmarksymbol \pagecutmarksymbol
+ \let\cutmarklength \pagecutmarklength
+ \let\cutmarktoptext \pagecutmarktoptext
+ \let\cutmarkbottomtext\pagecutmarkbottomtext
+ \makecutbox}
+
+\def\addpagecutmarks % #1
+ {\doifelse\@@lymarkering\v!aan
+ \makepagecutbox
+ {\doifelse\@@lymarkering\v!tekst
+ {\let\pagecutmarksymbol\empty
+ \let\pagecutmarkbottomtext\extrapagecutmarkbottomtext
+ \makepagecutbox}
+ \gobbleoneargument}}
\def\addpagecolormarks % #1
{\doifelse\@@lymarkering\v!kleur
{\doaddpagecolormarks\colormarkbox}
{\doifelse\@@lymarkering\v!raster
{\doaddpagecolormarks\rastermarkbox}
- {\gobbleoneargument}}}
+ \gobbleoneargument}}
\def\doaddpagecolormarks#1#2%
- {\let\cutmarksymbol\pagecutmarksymbol
- \let\cutmarklength\pagecutmarklength
- \makecutbox{#2}%
+ {\makepagecutbox{#2}%
\ifnum\horizontalcutmarks>2 \chardef\colormarkoffset4 \fi
\ifnum\verticalcutmarks >2 \chardef\colormarkoffset4 \fi
#1{#2}}
@@ -1115,12 +1185,12 @@
%D versions.
\def\startlocallayout
- {\pushmacro\restorepapersize
- \pushmacro\currentlayout}
+ {\globalpushmacro\restorepapersize
+ \globalpushmacro\currentlayout}
\def\stoplocallayout
- {\popmacro\currentlayout
- \popmacro\restorepapersize
+ {\globalpopmacro\currentlayout
+ \globalpopmacro\restorepapersize
\restorepapersize
\setuplayout}
diff --git a/tex/context/base/page-lin.tex b/tex/context/base/page-lin.tex
index 28c759d3b..1d69d18e1 100644
--- a/tex/context/base/page-lin.tex
+++ b/tex/context/base/page-lin.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=page-lin, % copied from main-001
-%D version=1997.03.31,
+%D version=1997.03.31,
%D title=\CONTEXT\ Core Macros,
%D subtitle=Line Numbering,
%D author=Hans Hagen,
@@ -13,7 +13,7 @@
\writestatus{loading}{Context Core Macros / Line Numbering}
-\unprotect
+\unprotect
\newif\ifinregels % \newif\ifregelnummersinmarge
@@ -54,7 +54,7 @@
\global\let\afterfirstobeyedline\relax}}%
\def\obeyedline
{\par
- \let\checkindentation\relax % else problems with odd/even
+ \let\checkindentation\relax % else problems with odd/even
\afterfirstobeyedline
\ifdim\lastskip>\zeropoint
\globallet\@@rglinesteptoggle\!!zerocount
@@ -72,8 +72,8 @@
% \def\dobetweenthelines%
% {\convertcommand \next \to\!!stringa % very ugly and fuzzy
% \convertargument\obeyedline\to\!!stringb % but needed anyway
-% \ifx\!!stringa\!!stringb % but alas, it fails
-% \@@rgtussen % hopelessly in non
+% \ifx\!!stringa\!!stringb % but alas, it fails
+% \@@rgtussen % hopelessly in non
% \fi} % etex
\def\dobetweenthelines
@@ -89,7 +89,7 @@
% het gebruik van \setlocalreference scheelt een hash entry
-\def\dodoshowlinenumber % for use elsewhere, to be extended
+\def\dodoshowlinenumber % for use elsewhere, to be extended
{\doschrijfregelnummer
\global\advance\linenumber \plusone}
@@ -103,7 +103,7 @@
\def\stelregelnummerenin
{\dosingleargument\dostelregelnummerenin}
-\def\dostartnummerenLINE
+\def\dostartnummerenLINE
{\EveryPar{\schrijfregelnummer}}
\def\dostopnummerenLINE
@@ -120,20 +120,20 @@
\newevery \everylinenumber \relax
\def\dodoschrijfregelnummer
- {% beware of em's, the font is already switched !
+ {% beware of em's, the font is already switched !
\setbox\scratchbox\hbox
{\setbox0\hbox{\@@rncommando{\regelweergave}}\vsmashbox0%
\ifcase\linenumberlocation
- \rlap{\hbox to \@@rnbreedte{\box0\hss}}% was \llap, nog testen !!
+ \rlap{\hbox to \@@rnbreedte{\box0\hss}}% was \llap, nog testen !!
\or
\inleftmargin
- {\forgetall
+ {\forgetall
\doifelse\@@rnbreedte\v!marge
{\hsize\linkermargebreedte}{\hsize\@@rnbreedte}%
\alignedline\@@rnuitlijnen\v!rechts{\box0\hskip\@@rnafstand}}%
\else
\inrightmargin
- {\forgetall
+ {\forgetall
\doifelse\@@rnbreedte\v!marge
{\hsize\rechtermargebreedte}{\hsize\@@rnbreedte}%
\alignedline\@@rnuitlijnen\v!links{\hskip\@@rnafstand\box0}}%
@@ -159,7 +159,7 @@
% \v!tekst=>\chardef\linenumberlocation0,
%\s!unknown=>\chardef\linenumberlocation0,
%\s!default=>\chardef\linenumberlocation0]%
- \ifcase\linenumberlocation % text
+ \ifcase\linenumberlocation % text
\advance\leftskip \@@rnbreedte\relax
\fi
\chardef\@@rn@@rnmethod
@@ -170,26 +170,26 @@
\v!regel=>\chardef\@@rn@@rnmethod1,
\v!tekst=>\chardef\@@rn@@rnmethod2,
\v!file=>\chardef\@@rn@@rnmethod3]%
- \ifcase\@@rn@@rnmethod % verbatim, line by line
+ \ifcase\@@rn@@rnmethod % verbatim, line by line
\inregelstrue
\let\dostartnummeren\dostartnummerenVERB
\let\stopregelnummeren\dostopnummerenVERB
\def\schrijfregelnummer
{\doschrijfregelnummer
\global\advance\linenumber \plusone}%
- \or % text, line by line
+ \or % text, line by line
\let\dostartnummeren\dostartnummerenLINE
\let\stopregelnummeren\dostopnummerenLINE
\def\schrijfregelnummer
{\doschrijfregelnummer
\global\advance\linenumber \plusone}%
- \or % text, whole lot
+ \or % text, whole lot
\let\dostartnummeren\dostartnummerenPAR
\let\stopregelnummeren\dostopnummerenPAR
\def\schrijfregelnummer
{\global\advance\linenumber \minusone
\doschrijfregelnummer}%
- \or % verbatim, selective line by line
+ \or % verbatim, selective line by line
\inregelstrue
\let\dostartnummeren\dostartnummerenVERB
\let\stopregelnummeren\dostopnummerenVERB
@@ -229,13 +229,13 @@
% {\doifinstringelse{--}{#1}
% {\labeltext{\v!regels}}
% {\labeltext{\v!regel}}}
-%
+%
% \def\inregel#1[#2]%
% {\doifelsenothing{#1}
% {\in{\inregellabel{\currenttextreference}}[\@@rnprefix#2]}
% {\in{#1}[\@@rnprefix#2]}}
%
-% double labels:
+% double labels:
\def\inregel#1[#2]%
{\doifelsenothing{#1}
@@ -389,12 +389,12 @@
[\v!start=>\let\showparagraphnumber\doshowparagraphnumberA,
\v!stop=>\let\showparagraphnumber\relax,
\v!regel=>\let\showparagraphnumber\doshowparagraphnumberB,
- \v!reset=>\global\internalparagraphnumber\zerocount
+ \v!reset=>\global\internalparagraphnumber\zerocount
\let\showparagraphnumber\doshowparagraphnumberA]}
\def\dodoshowparagraphnumber
{\global\advance\internalparagraphnumber \plusone
- \inleftmargin % \tf normalizes em
+ \inleftmargin % \tf normalizes em
{\tf{\doattributes\??ph\c!letter\c!kleur{\the\internalparagraphnumber}}%
\kern\@@phafstand}}
@@ -410,162 +410,6 @@
\doshowparagraphnumberA
\fi}
-% new, to be documented
-
-\newcounter\linenotecounter
-\newtoks \collectedlinenotes
-\newif \iftracelinenotes
-
-\appendtoks
- \the\collectedlinenotes
-\to \everylinenumber
-
-\appendtoks
- \global\collectedlinenotes\emptytoks
-\to \beforeeverylinenumbering
-
-\def\handlelinenote#1#2%
- {\bgroup
- \expanded{\beforesplitstring#1}\at--\to\linenotelinenumber
- \ifnum\linenotelinenumber=\linenumber\relax
- % todo: \onlyfootnote{#1}{#2}% == configurable
- \setupfootnotes[\c!nummercommando=\gobbleoneargument]%
- \footnotetext{#1: #2}%
- \fi
- \egroup}
-
-\def\tracedlinenote#1%
- {\iftracelinenotes
- \hbox to \zeropoint
- {\forgetall
- \localcolortrue
- \hsize\zeropoint
- \hss
- \vbox to \strutheight{\llap{\red\infofont\setstrut\linenotecounter}\vss}%
- {\blue\vl}%
- \vbox to \strutheight{\rlap{\red\infofont\setstrut#1}\vss}%
- \hss}%
- \prewordbreak
- \fi}
-
-\def\linenote#1%
- {\doglobal\increment\linenotecounter
- \doifreferencefoundelse{\??rr:\linenotecounter}%
- {\doglobal\@EA\appendtoks\@EA\handlelinenote\@EA
- {\currenttextreference}{#1}\to\collectedlinenotes}
- \donothing
- \tracedlinenote\empty
- \expanded{\eenregel[\??rr:\linenotecounter]}}
-
-\def\startlinenote[#1]#2%
- {\doifreferencefoundelse{\??rr:#1}%
- {\doglobal\@EA\appendtoks\@EA\handlelinenote\@EA
- {\currenttextreference}{#2}\to\collectedlinenotes}
- \donothing
- \tracedlinenote{#1}%
- \startregel[\??rr:#1]}
-
-\def\stoplinenote[#1]%
- {\stopregel[\??rr:#1]}
-
-% \startbuffer[test]
-% \startlinenumbering[100]
-% test \linenote {oeps} test test test test test test
-% test \startlinenote [well] {oeps} test test test test test test
-% test \linenote {oeps} test test test test test test
-% test \linenote {oeps} test test test test test test
-% test \linenote {oeps} test test test test test test
-% test \linenote {oeps} test test test test test test
-% test \stoplinenote [well] test test test test test test
-% \stoplinenumbering
-% \stopbuffer
-%
-% {\typebuffer[test] \getbuffer[test]} \page
-%
-% \startbuffer[setup]
-% \setuplinenumbering
-% [align=left]
-% \stopbuffer
-%
-% {\typebuffer[setup] \getbuffer[setup,test]} \page
-%
-% \startbuffer[setup]
-% \setuplinenumbering
-% [width=1em,
-% align=left]
-% \stopbuffer
-%
-% {\typebuffer[setup] \getbuffer[setup,test]} \page
-%
-% \startbuffer[setup]
-% \setuplinenumbering
-% [width=2em,
-% distance=.5em,
-% align=left]
-% \stopbuffer
-%
-% {\typebuffer[setup] \getbuffer[setup,test]} \page
-%
-% \startbuffer[setup]
-% \setuplinenumbering
-% [width=2em,
-% align=middle]
-% \stopbuffer
-%
-% {\typebuffer[setup] \getbuffer[setup,test]} \page
-%
-% \startbuffer[setup]
-% \setuplinenumbering
-% [conversion=romannumerals,
-% start=1,
-% step=1,
-% location=text,
-% style=slanted,
-% color=blue,
-% width=1.5em]
-% \stopbuffer
-%
-% {\typebuffer[setup] \startnarrower\getbuffer[setup,test]\stopnarrower} \page
-%
-% \startbuffer[setup]
-% \setuplinenumbering
-% [width=4em,
-% left=--,
-% right=--,
-% align=middle]
-% \stopbuffer
-%
-% {\typebuffer[setup] \getbuffer[setup,test]} \page
-%
-% \startbuffer[setup-1]
-% \setuplinenumbering
-% [style=\bfxx,
-% command=\WatchThis]
-% \stopbuffer
-%
-% \startbuffer[setup-2]
-% \def\WatchThis#1%
-% {\ifodd\linenumber
-% \definecolor[linecolor][red]%
-% \else
-% \definecolor[linecolor][green]%
-% \fi
-% \inframed
-% [offset=1pt,frame=off,background=color,backgroundcolor=linecolor]
-% {#1}}
-% \stopbuffer
-%
-% {\typebuffer[setup-1,setup-2] \getbuffer[setup-1,setup-2,test]} \page
-%
-% \startbuffer[setup-1]
-% \setuplinenumbering
-% [location=inright,
-% style=\bfxx,
-% command=\WatchThis]
-% \stopbuffer
-%
-% {\typebuffer[setup-1] \getbuffer[setup-1,setup-2,test]} \page
-
\stelregelnummerenin
[\c!methode=,
\c!conversie=\v!cijfers,
@@ -578,7 +422,7 @@
\c!prefix=,
\c!refereren=\v!aan]
-% new
+% new
\stelregelnummerenin
[\c!breedte=\ifcase\linenumberlocation2em\else\v!marge\fi,
@@ -592,7 +436,7 @@
[\c!status=\v!stop,
\c!letter=,
\c!kleur=,
- \c!afstand=\ifcase\linenumberlocation2em\else\!!zeropoint\fi]
+ \c!afstand=\ifcase\linenumberlocation2em\else\!!zeropoint\fi]
\stelregelsin
[\c!voor=\blanko,
@@ -600,4 +444,4 @@
\c!tussen=\blanko,
\c!inspringen=\v!nee]
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/page-log.tex b/tex/context/base/page-log.tex
index 39686727f..58cab81df 100644
--- a/tex/context/base/page-log.tex
+++ b/tex/context/base/page-log.tex
@@ -13,7 +13,7 @@
\writestatus{loading}{Context Page Macros / Logos}
-\unprotect
+\unprotect
\startmessages dutch library: layouts
7: beeldmerken berekenen
@@ -49,60 +49,60 @@
%D interfere with the other ones, but an even more important
%D reason is that logos are kind of special in the sense that
%D they have a short life span and may change after the first
-%D page.
+%D page.
%D \macros
%D {recalculatelogos,addlogobackground}
%D
%D The interface to the other low level page building routines
%D is provided by a macro that signals changes in layout
-%D specifications:
-%D
-%D \starttypen
+%D specifications:
+%D
+%D \starttypen
%D \recalculatelogos
-%D \stoptypen
+%D \stoptypen
%D
-%D as well as a simple placement macro:
+%D as well as a simple placement macro:
%D
-%D \starttypen
-%D \addlogobackground <box>
-%D \stoptypen
+%D \starttypen
+%D \addlogobackground <box>
+%D \stoptypen
%D
-%D In no way the following boolean switch should be used
-%D directly.
+%D In no way the following boolean switch should be used
+%D directly.
\newif\ifnewlogos
\def\recalculatelogos
- {\global\newlogostrue}
+ {\global\newlogostrue}
-%D The current state of logos is registered in a status
-%D variable \type {\logostatus}.
-%D
+%D The current state of logos is registered in a status
+%D variable \type {\logostatus}.
+%D
%D \starttabulatie[|l|l|l|]
-%D \NC 0 \NC don't place \NC remains 0 \NC \NR
-%D \NC 1 \NC place now \NC remains 1 \NC \NR
-%D \NC 2 \NC calulate and place \NC becomes 1 \NC \NR
-%D \NC 3 \NC calculate and place once \NC becomes 2 \NC \NR
-%D \stoptabulatie
+%D \NC 0 \NC don't place \NC remains 0 \NC \NR
+%D \NC 1 \NC place now \NC remains 1 \NC \NR
+%D \NC 2 \NC calulate and place \NC becomes 1 \NC \NR
+%D \NC 3 \NC calculate and place once \NC becomes 2 \NC \NR
+%D \stoptabulatie
\chardef\logostatus=0
-\def\addlogobackground#1% todo: dimension spec
+\def\addlogobackground#1% todo: dimension spec
{\ifcase\logostatus \else
\ifcase\logostatus
- % no logos to take care of
- \or % 1
- \ifnewlogos
+ % no logos to take care of
+ \or % 1
+ \ifnewlogos
\chardef\logostatus2
\setlogoboxes
\chardef\logostatus1
\global\newlogosfalse
- \fi
- \or % 2
+ \fi
+ \or % 2
\setlogoboxes
\chardef\logostatus1
- \or % 3
+ \or % 3
\setlogoboxes
\global\chardef\logostatus2
\fi
@@ -123,7 +123,7 @@
%D bottom} touch the bounding box of the paper and are
%D therefore not the sams as their background adn text
%D counterparts. In addition there are {\em left}, {\em right}
-%D and {\em middle} areas as well as a {\em page} one.
+%D and {\em middle} areas as well as a {\em page} one.
\newbox\leftlogos
\newbox\rightlogos
@@ -137,28 +137,28 @@
\def\dosetlogobox#1#2%
{\global\setbox#1\vbox to \papierhoogte
- {\dontcomplain % needed here ?
- \calculatereducedvsizes % needed here ?
+ {\dontcomplain % needed here ?
+ \calculatereducedvsizes % needed here ?
\offinterlineskip
#2\relax
\vskip-\kopwit
- \dodosetlogobox\v!boven\blap
+ \dodosetlogobox\v!boven\blap
\vskip\kopwit
- \dodosetlogobox\v!hoofd\blap
- \vskip\hoofdhoogte
+ \dodosetlogobox\v!hoofd\blap
+ \vskip\hoofdhoogte
\vskip\hoofdafstand
- \dodosetlogobox\v!tekst\blap
+ \dodosetlogobox\v!tekst\blap
\vskip\teksthoogte
- \vskip\voetafstand
+ \vskip\voetafstand
\vskip\voethoogte
- \dodosetlogobox\v!voet \tlap
+ \dodosetlogobox\v!voet \tlap
\vfilll
- \dodosetlogobox\v!onder\tlap
- \vskip\kopwit}
+ \dodosetlogobox\v!onder\tlap
+ \vskip\kopwit}
\smashbox#1}
\def\dodosetlogobox#1#2%
- {\hbox % width equals \zetbreedte
+ {\hbox % width equals \zetbreedte
{\def\docommando##1%
{\donefalse
\ifnum\logostatus=3 \ExpandBothAfter
@@ -207,9 +207,9 @@
\v!links \v!linkermarge \v!linkerrand
\od}}
-%D The user interface is relatively simple and provides
-%D macros for assigning logos to logo areas as well as
-%D forcing placement.
+%D The user interface is relatively simple and provides
+%D macros for assigning logos to logo areas as well as
+%D forcing placement.
%D
%D \showsetup{\y!definelogo}
%D \showsetup{\y!placelogos}
@@ -233,4 +233,4 @@
{\xdef\requestedlogos{\iffirstargument#1\else\definedlogos\fi}%
\global\chardef\logostatus3 }
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/page-lyr.tex b/tex/context/base/page-lyr.tex
index bd76ab558..d469c9361 100644
--- a/tex/context/base/page-lyr.tex
+++ b/tex/context/base/page-lyr.tex
@@ -125,12 +125,32 @@
\def\setlayer
{\dotripleempty\dosetlayer}
-\def\dosetlayer[#1][#2][#3]%
- {\ifthirdargument
- \doifnotvalue{\??ll#1\c!status}\v!stop{\dodosetlayer[#1][#2][#3]}%
- \else
- \doifnotvalue{\??ll#1\c!status}\v!stop{\dodosetlayer[#1][][#2]}%
- \fi}
+\def\dosetlayer[#1][#2][#3]% #4 == box do \fi is ok
+ {\doifelsevalue{\??ll#1\c!status}\v!stop
+ {\dowithnextbox\donothing\hbox}
+ {\ifthirdargument
+ \dodosetlayer[#1][#2][#3]%
+ \else
+ \dodosetlayer[#1][][#2]%
+ \fi}}
+
+% \def\dodosetlayer[#1][#2][#3]% #2 = links/rechts
+% {\bgroup
+% \recalculatebackgrounds
+% \recalculatelogos
+% \doglobal\increment\currentlayerdata
+% \forgetall
+% \dontcomplain
+% \doifvalue{\??ll#1\c!optie}\v!test\tracelayerstrue
+% \iftracelayers\traceboxplacementtrue\fi
+% \dowithnextbox % sneller als aparte macro
+% {\ifundefined{\@@layerbox#1}%
+% \writestatus{layer}{unknown layer #1}%
+% \else
+% \dododosetlayer[#1][#2][#3]%
+% \fi
+% \egroup}
+% \hbox}
\def\dodosetlayer[#1][#2][#3]% #2 = links/rechts
{\bgroup
@@ -145,7 +165,19 @@
{\ifundefined{\@@layerbox#1}%
\writestatus{layer}{unknown layer #1}%
\else
- \dododosetlayer[#1][#2][#3]%
+ \doifelse{#2}\v!even
+ {\ifodd\realpageno
+ % discard nextbox
+ \else
+ \dododosetlayer[#1][\v!links][#3]%
+ \fi}%
+ {\doifelse{#2}\v!oneven
+ {\ifodd\realpageno
+ \dododosetlayer[#1][\v!rechts][#3]%
+ %\else
+ % discard nextbox
+ \fi}%
+ {\dododosetlayer[#1][#2][#3]}}%
\fi
\egroup}
\hbox}
@@ -157,6 +189,9 @@
\let\lastlayerxpos\!!zeropoint
\let\lastlayerypos\!!zeropoint
+\let\lastlayerwd \!!zeropoint
+\let\lastlayerht \!!zeropoint
+\let\lastlayerdp \!!zeropoint
% todo left/right
@@ -289,14 +324,17 @@
\doifnotvalue{\layerparameter\c!richting}\v!omgekeerd
{\box\csname\@@layerbox#2#1\layerpage\endcsname}%
\fi
-\doifelsevalue{\??ll#1\c!plaats}\v!grid\donetrue\donefalse
-\ifdone
- \nextboxht\strutheight
- \nextboxdp\strutdepth
-\else
- \setbox\nextbox\hbox
- {\alignedbox[\layerparameter\c!plaats]\vbox{\flushnextbox}}%
-\fi
+ \xdef\lastlayerwd{\the\wd\nextbox}%
+ \xdef\lastlayerht{\the\ht\nextbox}% % not entirely ok when grid !
+ \xdef\lastlayerdp{\the\dp\nextbox}% % not entirely ok when grid !
+ \doifelsevalue{\??ll#1\c!plaats}\v!grid\donetrue\donefalse
+ \ifdone
+ \nextboxht\strutheight
+ \nextboxdp\strutdepth
+ \else
+ \setbox\nextbox\hbox
+ {\alignedbox[\layerparameter\c!plaats]\vbox{\flushnextbox}}%
+ \fi
\ifnum\layerparameter\c!regel=\zerocount\else % no \ifcase, can be negative
\advance\@@layerypos \layerparameter\c!regel\lineheight
\advance\@@layerypos \topskip
@@ -369,18 +407,33 @@
% \vss}%
% \fi}
+% \unexpanded\def\flushlayer[#1]%
+% {\doifelsevalue{\??ll#1\c!dubbelzijdig}\v!ja
+% {\doifundefinedelse{\@@layerbox#1}%
+% {\dodoflushlayerA[#1]}
+% {\doifbothsidesoverruled
+% \dodoflushlayerB[#1][\v!links]% left
+% \orsideone
+% \dodoflushlayerB[#1][\v!rechts]% right
+% \orsidetwo
+% \dodoflushlayerB[#1][\v!links]% left
+% \od}}
+% {\dodoflushlayerA[#1]}}
+
\unexpanded\def\flushlayer[#1]%
- {\doifelsevalue{\??ll#1\c!dubbelzijdig}\v!ja
- {\doifundefinedelse{\@@layerbox#1}%
- {\dodoflushlayerA[#1]}
- {\doifbothsidesoverruled
- \dodoflushlayerB[#1][\v!links]% left
- \orsideone
- \dodoflushlayerB[#1][\v!rechts]% right
- \orsidetwo
- \dodoflushlayerB[#1][\v!links]% left
- \od}}
- {\dodoflushlayerA[#1]}}
+ {\doifelsevalue{\??ll#1\c!status}\v!volgende
+ {\global\letvalue{\??ll#1\c!status}\v!start} % dangerous, stack-built-up
+ {\doifelsevalue{\??ll#1\c!dubbelzijdig}\v!ja
+ {\doifundefinedelse{\@@layerbox#1}%
+ {\dodoflushlayerA[#1]}
+ {\doifbothsidesoverruled
+ \dodoflushlayerB\v!links [#1]% left
+ \orsideone
+ \dodoflushlayerB\v!rechts[#1]% right
+ \orsidetwo
+ \dodoflushlayerB\v!links [#1]% left
+ \od}}
+ {\dodoflushlayerA[#1]}}}
\def\dodoflushlayerA[#1]%
{\doifnotvalue{\??ll#1\c!status}\v!stop
@@ -389,13 +442,22 @@
{\dodoflushlayer0{#1}{#1:\realfolio}}
\stopoverlay}}
-\def\dodoflushlayerB[#1][#2]%
- {\doifnotvalue{\??ll#1\c!status}\v!stop
+% \def\dodoflushlayerB[#1][#2]%
+% {\doifnotvalue{\??ll#1\c!status}\v!stop
+% {\startoverlay
+% {\dodoflushlayer1{#1}{#1}}
+% {\dodoflushlayer0{#1}{#1:\realfolio}}
+% {\dodoflushlayer1{#1}{#2#1}}
+% {\dodoflushlayer0{#1}{#2#1:\realfolio}}
+% \stopoverlay}}
+
+\def\dodoflushlayerB#1[#2]%
+ {\doifnotvalue{\??ll#2\c!status}\v!stop
{\startoverlay
- {\dodoflushlayer1{#1}{#1}}
- {\dodoflushlayer0{#1}{#1:\realfolio}}
- {\dodoflushlayer1{#1}{#2#1}}
- {\dodoflushlayer0{#1}{#2#1:\realfolio}}
+ {\dodoflushlayer1{#2}{#2}}
+ {\dodoflushlayer0{#2}{#2:\realfolio}}
+ {\dodoflushlayer1{#2}{#1#2}}
+ {\dodoflushlayer0{#2}{#1#2:\realfolio}}
\stopoverlay}}
% \def\dodoflushlayer#1#2#3%
@@ -506,7 +568,7 @@
%D register ("somepos-3",0cm,0cm,(-2cm,2cm)) ;
%D \stopuseMPgraphic
%D
-%D \getMLlayer[test]{\useMPgraphic{oeps}}
+%D \getMPlayer[test]{\useMPgraphic{oeps}}
%D \stoptypen
%D
%D The last line is equivalent to
@@ -570,19 +632,19 @@
\vfill}%
\egroup}
-\def\resetpositioning%
+\def\resetpositioning
{\getparameters[\??ps]
- [\c!status=\v!start,
- \c!eenheid=\s!cm,
- \c!factor=1,
- \c!schaal=1,
- \c!xfactor=\@@psfactor,
- \c!yfactor=\@@psfactor,
- \c!xschaal=\@@psschaal,
- \c!yschaal=\@@psschaal,
- \c!xstap=\v!absoluut,
- \c!ystap=\v!absoluut,
- \c!xoffset=\!!zeropoint,
+ [\c!status=\v!start,%
+ \c!eenheid=\s!cm,%
+ \c!factor=1,%
+ \c!schaal=1,%
+ \c!xfactor=\@@psfactor,%
+ \c!yfactor=\@@psfactor,%
+ \c!xschaal=\@@psschaal,%
+ \c!yschaal=\@@psschaal,%
+ \c!xstap=\v!absoluut,%
+ \c!ystap=\v!absoluut,%
+ \c!xoffset=\!!zeropoint,%
\c!yoffset=\!!zeropoint]}
\def\setuppositioning%
@@ -626,7 +688,7 @@
\flushnextbox
\hss}
\vss}%
- \xdef\dopoppositioning%
+ \xdef\dopoppositioning
{\xposition\the\xposition
\yposition\the\yposition
\noexpand\def\noexpand\@@psxoffset{\@@psxoffset}%
@@ -647,5 +709,5 @@
\c!offset=\v!ja,
\c!xoffset=\!!zeropoint,
\c!yoffset=\!!zeropoint]
-
-\protect \endinput
+
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/page-mak.tex b/tex/context/base/page-mak.tex
index 4461e021a..229a6ca1b 100644
--- a/tex/context/base/page-mak.tex
+++ b/tex/context/base/page-mak.tex
@@ -13,23 +13,23 @@
\writestatus{loading}{Context Page Macros / MakeUp}
-\unprotect
+\unprotect
-%D \macros
+%D \macros
%D {definemakeup, setupmakeup, startmakeup}
-%D
+%D
%D A makeup is a separate page, like a title page or colofon.
%D There is one standard makeup page, but you can define more
-%D if needed.
-%D
-%D \starttypen
+%D if needed.
+%D
+%D \starttypen
%D \startstandardmakeup
-%D My Fancy Title
+%D My Fancy Title
%D \stopstandardmakeup
-%D \stoptypen
-%D
-%D The associated commands are:
-%D
+%D \stoptypen
+%D
+%D The associated commands are:
+%D
%D \showsetup{\y!definemakeup}
%D \showsetup{\y!setupmakeup}
%D \showsetup{\y!startmakeup}
@@ -40,11 +40,12 @@
\def\dodefinemakeup[#1][#2]%
{\getparameters
[\??do#1]%
- [\c!breedte=\zetbreedte,
- \c!hoogte=\teksthoogte,
- \c!voffset=\!!zeropoint,
- \c!hoffset=\!!zeropoint,
+ [\c!breedte=\zetbreedte, % example in manual
+ \c!hoogte=\teksthoogte, % example in manual
+ \c!voffset=\!!zeropoint, % example in manual
+ \c!hoffset=\!!zeropoint, % example in manual
\c!commandos=,
+ \c!setups=,
\c!pagina=\v!rechts,
\c!dubbelzijdig=\v!leeg,
\c!voor=,
@@ -56,7 +57,7 @@
\c!tekststatus=\v!normaal,
\c!hoofdstatus=\v!stop,
\c!voetstatus=\v!stop,
- \c!paginastatus=\v!stop,
+ \c!paginastatus=\v!stop, % in manual ! ! !
\c!kleur=,
\c!uitlijnen=,
#2]%
@@ -69,17 +70,17 @@
\def\dosetupmakeup[#1]%
{\getparameters[\??do#1]}
-%D This will save us some 375 bytes in the format file.
+%D This will save us some 375 bytes in the format file.
\def\makeupparameter#1{\getvalue{\??do\currentmakeup#1}}
%D The \type{\start}||\type{\stop} macros are used for both
-%D the direct and indirect way. The parameterless call will
-%D build a simple box.
+%D the direct and indirect way. The parameterless call will
+%D build a simple box.
-\newtoks\everymakeup
+\newtoks\everymakeup
-\appendtoks \postponemarks \to \everymakeup
+\appendtoks \postponemarks \to \everymakeup
\let\currentmakeup\empty
@@ -99,7 +100,7 @@
\expandafter \donostartmakeup
\fi}
-%D The simple case:
+%D The simple case:
\def\donostartmakeup
{\pagina
@@ -110,13 +111,13 @@
\def\donostopmakeup
{\egroup
- \flushmarks % new, here, else empty pages
+ \flushmarks % new, here, else empty pages
\pagina
\egroup}
-%D The normal one:
+%D The normal one:
-\newbox\makeupbox
+\newbox\makeupbox
\def\dodostartmakeup
{\doifvaluesomething{\??do\currentmakeup\c!pagina}
@@ -124,11 +125,12 @@
\soortpagina[\currentmakeup]%
\setsystemmode\v!opmaak
\setupmakeuplayout
- \makeupparameter\c!commandos
+ \makeupparameter\c!commandos % hm, what is this one doing here ?
\startregistercolor[\makeupparameter\c!kleur]%
\global\setbox\makeupbox\vbox to \makeupparameter\c!hoogte
\bgroup
- \forgetall
+ \forgetall
+ \setups[\makeupparameter\c!setups]%
\hsize\makeupparameter\c!breedte
\doifsomething{\makeupparameter\c!uitlijnen}
{\setupalign[\makeupparameter\c!uitlijnen]}%
@@ -138,7 +140,7 @@
{\endgraf
\makeupparameter\c!onder
\egroup
- \flushmarks % new, here, else empty pages
+ \flushmarks % new, here, else empty pages
\stopregistercolor
\doflushmakeup
\egroup
@@ -162,33 +164,34 @@
\fi}
\def\doshipoutmakeup
- {\pushmacro\@@pnstatus % new
- \makeupparameter\c!voor
+ {\globalpushmacro\@@pnstatus % new
+ \makeupparameter\c!voor
\vbox{\hbox{\color[\makeupparameter\c!kleur]{\box\makeupbox}}}%
- \stelpaginanummerin[\c!status=\makeupparameter\c!paginastatus]%
+ \stelpaginanummerin[\c!status=\makeupparameter\c!paginastatus]%
\setupmakeuplayout
\pagina
\makeupparameter\c!na
- \relax % voor fi
+ \relax % voor fi
\ifdubbelzijdig \ifodd\realpageno\else
\processaction
[\makeupparameter\c!dubbelzijdig]
[ \v!ja=>\null
\pagina,
- % \verlaagpaginanummer, % new
- \v!leeg=>\setupmakeuplayout
- \global\pagebodyornamentsfalse
- \null\pagina]%
- % \verlaagpaginanummer]% % new
+ % \verlaagpaginanummer, % new
+ \v!leeg=>{\setupmakeuplayout
+ \pagina[\v!blanko]%
+ \null
+ \pagina}]%
+ % \verlaagpaginanummer]% % new
\fi \fi
- % \verlaagpaginanummer % new
- \popmacro\@@pnstatus} % new
+ % \verlaagpaginanummer % new
+ \globalpopmacro\@@pnstatus} % new
%D The text surrounding the main body text can be influenced
%D by setting their associated status variables. The
-%D connection between them is made by the following macro
+%D connection between them is made by the following macro
+
-
\def\setupmakeuplayout
{\setupfooter[\c!status=\makeupparameter\c!voetstatus ]%
\setupheader[\c!status=\makeupparameter\c!hoofdstatus]%
@@ -196,9 +199,9 @@
\setupbottom[\c!status=\makeupparameter\c!onderstatus]%
\setuptop [\c!status=\makeupparameter\c!bovenstatus]%
% this is needed, but no \setuplayout here; fails in texexec --fig=c
- \recalculatelayout}
+ \recalculatelayout}
-%D The standard page template is defined as follows:
+%D The standard page template is defined as follows:
\definemakeup
[\v!standaard]
@@ -209,4 +212,16 @@
\c!pagina=\v!rechts,
\c!dubbelzijdig=\v!leeg]
-\protect \endinput
+\definemakeup
+ [\v!tekst]
+ [\c!bovenstatus=\v!start,
+ \c!hoofdstatus=\v!start,
+ \c!tekststatus=\v!start,
+ \c!voetstatus=\v!start,
+ \c!onderstatus=\v!start,
+ \c!dubbelzijdig=\v!nee,
+ \c!pagina=,
+ \c!boven=\pseudostrut,
+ \c!onder=\obeydepth\vss]
+
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/page-mar.tex b/tex/context/base/page-mar.tex
index 6456e8af3..78118a418 100644
--- a/tex/context/base/page-mar.tex
+++ b/tex/context/base/page-mar.tex
@@ -11,11 +11,13 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D This module is still to be split and documented.
+%D This module is still to be split and documented.
\writestatus{loading}{Context Core Macros / Maginal Things}
-\unprotect
+% todo: compensate distance when setuplayout[textwidth=..]
+
+\unprotect
\newif\iflowinmargin
@@ -71,7 +73,7 @@
\fi}
\donothing
\doifnumberelse\margetekstnummer
- {\ifnum\margetekstnummer>25 % to be translated
+ {\ifnum\margetekstnummer>25 % to be translated
\writestatus\m!systems{potential margin stack overflow (\margetekstnummer)}%
\fi}
\donothing
@@ -97,28 +99,29 @@
\begstrut#6\endstrut\endgraf
\dostopattributes
\@@imna}%
- \doif\@@imstapel\v!ja
- {\setbox0\vbox{\stackeddown\vbox{\box0}}}% new
+ \doif\@@imstapel\v!ja
+ {\def\overlappingmargin{-2\s!sp}% test value, maybe .25\strutboxdp, maybe configurable
+ \setbox0\vbox{\stackeddown\vbox{\box0}}}% new
\ht0\strutht
\box0
\egroup
#5\relax}
%D The stacker permits constructs like:
-%D
-%D \starttypen
+%D
+%D \starttypen
%D \stelinmargein[stapel=ja]
-%D
+%D
%D \inlinker{test 1}test\break
%D \inlinker{test 2}test\break
-%D \inlinker{test 1}
+%D \inlinker{test 1}
%D \input tufte
-%D \inlinker{test 1}
-%D \inlinker{test 2}
+%D \inlinker{test 1}
+%D \inlinker{test 2}
%D \inlinker{test 3}
%D \input tufte
-%D \inlinker{test 1}
-%D \inlinker{test 2\endgraf test 3}
+%D \inlinker{test 1}
+%D \inlinker{test 2\endgraf test 3}
%D \inlinker{test 4}
%D \input tufte
%D \inlinker{test 1}
@@ -126,7 +129,7 @@
%D \inlinker{test 4\endgraf test 5\endgraf test 6}
%D \inlinker{test 7\endgraf test 8\endgraf test 9}
%D \input tufte
-%D \stoptypen
+%D \stoptypen
\def\plaatsmargetekstscheider
{\ifnum\margincontent>\zerocount
@@ -167,21 +170,21 @@
\ht0\zeropoint
\dp0\zeropoint
\gdef\margestrutheight{\the\strutht}%
- %\graphicvadjust{\box0}} % fails in high math lines, let it be
- %\hbox{\lower\strutdp\box0}} % alas, wrong lapping, therefore useless
+ %\graphicvadjust{\box0}} % fails in high math lines, let it be
+ %\hbox{\lower\strutdp\box0}} % alas, wrong lapping, therefore useless
\dopositionmarginbox0}
-%D This approach permits us to implement a better mechanism
-%D later. We need the \type {\graphicvadjust} in order to
-%D handle:
-%D
-%D \starttypen
+%D This approach permits us to implement a better mechanism
+%D later. We need the \type {\graphicvadjust} in order to
+%D handle:
+%D
+%D \starttypen
%D \inlinker{test} {\red \dorecurse{40}{test }\par}
%D {\red \inlinker{test} \dorecurse{40}{test }\par}
%D \stoptypen
-%D
-%D The outer margin color is either black or color set as
-%D main text color.
+%D
+%D The outer margin color is either black or color set as
+%D main text color.
\ifx\dopositionmarginbox\undefined
\def\dopositionmarginbox#1{\graphicvadjust{\box#1}}
@@ -270,7 +273,7 @@
#2{#6}%
\fi]%
\rawpagereference\s!mar{#5}%
- \flushnotes\egroup % don't forget the group
+ \flushnotes\egroup % don't forget the group
\ignorespaces}
\def\inlinker
@@ -298,7 +301,7 @@
\let\restoreinterlinepenalty=\relax
-\def\flushmargincontents % plural
+\def\flushmargincontents % plural
{\restoreinterlinepenalty % here?
\ifcase\margincontent\else % called quite often, so we
\expandafter\doflushmargincontents % speed up the \fi scan by
@@ -306,13 +309,21 @@
% for a manual flush in for instance headers
+% \def\placemargintexts % to be documented and translated
+% {\ifcase\margincontent\else
+% \bgroup
+% \let\normalvadjust\fakedvadjust
+% \doflushmargincontents
+% \egroup
+% \fi}
+
\def\placemargintexts % to be documented and translated
- {\ifcase\margincontent\else
+ {\ifcase\margincontent\else
\bgroup
- \let\normalvadjust\fakedvadjust
- \doflushmargincontents
+ \chardef\graphicvadjustmode\zerocount
+ \doflushmargincontents
\egroup
- \fi}
+ \fi}
% \def\doflushmargincontents% % links + rechts
% {\bgroup
@@ -362,11 +373,11 @@
\getvalue{\??im\recurselevel}%
\letgvalue{\??im\recurselevel}\empty
\egroup}%
-\ifbinnenkolommen
- \donetrue % how fuzzy
-\else\ifdim\marginheight>\lineheight\relax
- \donetrue % how dirty
-\else
+\ifbinnenkolommen
+ \donetrue % how fuzzy
+\else\ifdim\marginheight>\lineheight\relax
+ \donetrue % how dirty
+\else
\donefalse % how needed
\fi\fi
\ifdone
@@ -432,14 +443,14 @@
{\mindermeldingen
\setbox0\vtop{\forgetall\strut#1}%
\getboxheight\dimen0\of\box0
- \vskip-\dimen0 % waarom stond hier een \ ?
+ \vskip-\dimen0 % waarom stond hier een \ ?
\box0}}
\def\resetmargincontent % quick hack
{\doglobal\newcounter\margincontent}
\def\resetmargetitels
- {\resetmargincontent}
+ {\resetmargincontent}
%D \macros
%D {inleftside,inleftmargin,inrightmargin,inrightside}
@@ -450,30 +461,67 @@
%D therefore embed them in some macro's that (force and)
%D remove the indentation and restore it afterwards.
-% beware: no \hsize is set (yet)!
+% beware: no \hsize is set (yet)!
+
+% \def\inleftmargin#1%
+% {\pushindentation
+% \llap{#1\hskip\leftskip\hskip\leftmargintextdistance}%
+% \popindentation
+% \ignorespaces}
+
+% \def\inrightmargin#1%
+% {\pushindentation
+% \rlap{\hskip\hsize\hskip-\rightskip\hskip\rightmargintextdistance#1}%
+% \popindentation
+% \ignorespaces}
+
+% \def\inleftedge#1%
+% {\inleftmargin
+% {#1\relax
+% \hskip\linkermargebreedte
+% \hskip\linkerrandafstand}}
+
+% \def\inrightedge#1%
+% {\inrightmargin
+% {\hskip\rechtermargebreedte
+% \hskip\rechterrandafstand
+% #1}}
+
+% \hsize added per August 2003:
\def\inleftmargin#1%
{\pushindentation
- \llap{#1\hskip\leftskip\hskip\leftmargintextdistance}%
+ \llap
+ {\hsize\linkermargebreedte
+ #1\relax
+ \hskip\leftskip
+ \hskip\linkermargeafstand}%
\popindentation
\ignorespaces}
\def\inrightmargin#1%
{\pushindentation
- \rlap{\hskip\hsize\hskip-\rightskip\hskip\rightmargintextdistance#1}%
+ \rlap
+ {\hskip\hsize
+ \hskip-\rightskip
+ \hskip\rechtermargeafstand
+ \hsize\rechtermargebreedte
+ #1}%
\popindentation
\ignorespaces}
\def\inleftedge#1%
{\inleftmargin
- {#1\relax
- \hskip\linkermargebreedte
- \hskip\linkerrandafstand}}
+ {\hsize\linkermargebreedte
+ #1\relax
+ \hskip\linkermargebreedte
+ \hskip\linkerrandafstand}}
\def\inrightedge#1%
{\inrightmargin
{\hskip\rechtermargebreedte
\hskip\rechterrandafstand
+ \hsize\rechtermargebreedte
#1}}
\let\inleftside \inleftedge
@@ -500,16 +548,16 @@
%D \egroup
%D New, yet undocumented:
-%D
-%D used for pascal:
%D
-%D \starttypen
-%D \index {test} test \index {west} west \index {rest} rest
-%D
+%D used for pascal:
+%D
+%D \starttypen
+%D \index {test} test \index {west} west \index {rest} rest
+%D
%D \startnarrower
%D \placeregister[index][alternative=b,command=\atleftmargin]
%D \stopnarrower
-%D \stoptypen
+%D \stoptypen
\def\atleftmargin#1%
{\pushindentation
@@ -566,7 +614,7 @@
{\iffacingpages
\ifnum\realpageno>\plusone
\bgroup
- \global\pagebodyornamentsfalse
+ \chardef\pageornamentstate\plusone
\setbox\facingpage\vbox to \zethoogte
{\unvbox\facingpage\vfil}%
\myshipout{\buildpagebody\box\facingpage}%
@@ -614,4 +662,4 @@
\stelnaastplaatsenin
[\c!status=\v!stop]
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/page-mul.tex b/tex/context/base/page-mul.tex
index 4ee48d37d..0aa377f81 100644
--- a/tex/context/base/page-mul.tex
+++ b/tex/context/base/page-mul.tex
@@ -16,13 +16,13 @@
%D This module is mostly a copy from the original multi column
%D routine as implemented in \type {core-mul}. When the main
%D OTR macro's were isolated in modules and column sets were
-%D introduced, this module became part of the OTR modules. As
-%D a result this module is no longer generic. It also needs
-%D an overhaul.
+%D introduced, this module became part of the OTR modules. As
+%D a result this module is no longer generic. It also needs
+%D an overhaul.
\unprotect
-% TO DO !
+% TO DO !
\let\OTRMULsetvsize \OTRONEsetvsize
\let\OTRMULsethsize \OTRONEsethsize
@@ -36,25 +36,25 @@
\let\OTRMULdobotinsertions \relax
\let\OTRMULdosetbothinserts \relax
\let\OTRMULflushsavedfloats \relax
-
+
\newtoks \OTRMULoutput
\def\OTRMULgotonextpage
{\ejectpage}
-\def\OTRMULgotonextpageX % will become obsolete
+\def\OTRMULgotonextpageX % will become obsolete
{\superejectpage}
-% check \count<insert> multiplications
+% check \count<insert> multiplications
-% some day try this in balancing routine
+% some day try this in balancing routine
%
% \ifdim\pagetotal>\pagegoal
% \eject
% \else
% \goodbreak
% \fi
-
+
%D The following macro's implement a multi||column output
%D routine. The original implementation was based on Donald
%D Knuth's implementation, which was adapted by Craig Platt to
@@ -102,7 +102,7 @@
%D \interface \type{\nofcolumns} \\
%D the number of columns \\
%D \interface \type{\minbalancetoplines} \\
-%D the minimum number op balanced top lines \\
+%D the minimum number op balanced top lines \\
%D \interface \type{\betweencolumns} \\
%D the stuff between columns \\
%D \interface \type{\finaloutput{action}{box}} \\
@@ -205,9 +205,9 @@
%D are applied to columns. The final values are used when
%D flushing the columns.
-\newtoks\singlecolumnout % remove that one
+\newtoks\singlecolumnout % remove that one
-%D It's more convenient to use \type {\columnwidth} instead
+%D It's more convenient to use \type {\columnwidth} instead
%D of messing around with boxes each time.
\newdimen\columnwidth
@@ -263,9 +263,8 @@
%D The local column width is available in the dimension
%D register \type{\localcolumnwidth}, which is calculated as:
-\def\setcolumnhsize % beware, this one is available for use in macros
- {\setbox0\hbox
- {\parindent\zeropoint\betweencolumns}%
+\def\setcolumnhsize % beware, this one is available for use in macros
+ {\setbox0\hbox{\parindent\zeropoint\betweencolumns}%
\intercolumnwidth\wd0
\localcolumnwidth\columntextwidth
\advance\localcolumnwidth -\leftskip
@@ -275,8 +274,8 @@
\advance\localcolumnwidth -\colrightskip
%
\advance\localcolumnwidth -\nofcolumns\intercolumnwidth
- \advance\localcolumnwidth \intercolumnwidth
- \divide\localcolumnwidth \nofcolumns
+ \advance\localcolumnwidth \intercolumnwidth
+ \divide \localcolumnwidth \nofcolumns
\dimen0=\columntextoffset
\multiply\dimen0 2
\advance\localcolumnwidth -\dimen0
@@ -284,63 +283,63 @@
\hsize\localcolumnwidth} % we don't do it \global
%D Torture test:
-%D
+%D
%D \startbuffer
%D \startbuffer[b]
%D \startkolommen
-%D \input tufte
+%D \input tufte
%D \stopkolommen
%D \stopbuffer
-%D \typebuffer[b] \haalbuffer[b]
-%D
+%D \typebuffer[b] \haalbuffer[b]
+%D
%D \startbuffer[b]
-%D \startsmaller
-%D \input tufte
+%D \startsmaller
+%D \input tufte
%D \stopsmaller
%D \stopbuffer
-%D \typebuffer[b] \haalbuffer[b]
-%D
+%D \typebuffer[b] \haalbuffer[b]
+%D
%D \startbuffer[b]
-%D \startkolommen \startsmaller
-%D \input tufte
+%D \startkolommen \startsmaller
+%D \input tufte
%D \stopsmaller \stopkolommen
%D \stopbuffer
-%D \typebuffer[b] \haalbuffer[b]
-%D
+%D \typebuffer[b] \haalbuffer[b]
+%D
%D \startbuffer[b]
%D \startsmaller \startkolommen
-%D \input tufte
+%D \input tufte
%D \stopkolommen \stopsmaller
%D \stopbuffer
-%D \typebuffer[b] \haalbuffer[b]
-%D
+%D \typebuffer[b] \haalbuffer[b]
+%D
%D \startbuffer[b]
-%D \startkolommen \startsmaller[left]
-%D \input tufte
+%D \startkolommen \startsmaller[left]
+%D \input tufte
%D \stopsmaller \stopkolommen
%D \stopbuffer
-%D \typebuffer[b] \haalbuffer[b]
-%D
+%D \typebuffer[b] \haalbuffer[b]
+%D
%D \startbuffer[b]
%D \startsmaller[left] \startkolommen
-%D \input tufte
+%D \input tufte
%D \stopkolommen \stopsmaller
%D \stopbuffer
-%D \typebuffer[b] \haalbuffer[b]
-%D
+%D \typebuffer[b] \haalbuffer[b]
+%D
%D \startbuffer[b]
-%D \startsmaller \startkolommen \startsmaller
-%D \input tufte
+%D \startsmaller \startkolommen \startsmaller
+%D \input tufte
%D \stopsmaller\stopkolommen \stopsmaller
%D \stopbuffer
-%D \typebuffer[b] \haalbuffer[b]
-%D
+%D \typebuffer[b] \haalbuffer[b]
+%D
%D \startbuffer[b]
-%D \startsmaller[left] \startkolommen \startsmaller
-%D \input tufte
+%D \startsmaller[left] \startkolommen \startsmaller
+%D \input tufte
%D \stopsmaller\stopkolommen \stopsmaller
%D \stopbuffer
-%D \typebuffer[b] \haalbuffer[b]
+%D \typebuffer[b] \haalbuffer[b]
%D \stopbuffer
%D
%D \start
@@ -361,11 +360,11 @@
\ifdim\precolumnboxheight>\zeropoint
\global\advance\vsize -\precolumnboxheight
\fi
- %\getinsertionheights\to\dimen0\\%
+ %\getinsertionheights\to\dimen0\\%
%\global\advance\vsize -\dimen0
\settotalinsertionheight
\global\advance\vsize -\totalinsertionheight
-%%%\ifgridsnapping % evt altijd, nog testen, testing now, see columned tocs
+%%%\ifgridsnapping % evt altijd, nog testen, testing now, see columned tocs
\getnoflines\vsize
\vsize\noflines\openlineheight
\advance\vsize .5\openlineheight % collect enough data
@@ -395,14 +394,14 @@
\flushnotes
\xdef\precolumndepth{\the\prevdepth}%
\begingroup
- % new
+ % new
\leftskip1\leftskip
\rightskip1\rightskip
\edef\colleftskip {\the\leftskip}%
\edef\colrightskip{\the\rightskip}%
\leftskip\zeropoint
\rightskip\zeropoint
- %
+ %
\dontshowcomposition
%\setcolumntextwidth\relax
%\setcolumntextheight\relax
@@ -442,7 +441,7 @@
\global\singlecolumnout\output
%\global\output{\global\setbox\precolumnbox\vbox{\unvbox\normalpagebox}}%
\global\output{\global\setbox\precolumnbox\vbox{\dotopinsertions\unvbox\normalpagebox}}%
- \eject % no \holdinginserts=1, can make footnote disappear !
+ \eject % no \holdinginserts=1, can make footnote disappear !
\global\precolumnboxheight\ht\precolumnbox
\global\output{\continuousmulticolumnsout}%
\setcolumnfloats
@@ -477,7 +476,7 @@
\dontshowcomposition
\doflushcolumnfloat % added recently
%\doflushcolumnfloats % no, since it results in wrong top floats
- \flushnotes % before start of columns
+ \flushnotes % before start of columns
\par
\ifbalancecolumns
\global\output{\continuousmulticolumnsout}%
@@ -489,7 +488,7 @@
\eject % the prevdepth is important, try e.g. toclist in
\prevdepth\zeropoint % columns before some noncolumned text text
\global\output\singlecolumnout
- \global\output{\the\mainoutput}% % % % % todo
+ \global\output{\the\mainoutput}% % % % % todo
\ifvoid\precolumnbox\else
\unvbox\precolumnbox
\fi
@@ -583,7 +582,7 @@
\box\currentcolumnbox}}%
\hfil}%
\unskip
- \hskip\colrightskip}}% new
+ \hskip\colrightskip}}% new
\scratchdimen\zeropoint
\dohandleallcolumns
{\ifdim-\ht\currenttopcolumnbox<\scratchdimen
@@ -602,11 +601,11 @@
\hskip-\columntextwidth
\restoretextcolor{\box\scratchbox}}%
\postprocesscolumnpagebox % new, acts upon \box\columnpagebox
- \ifvoid\precolumnbox
+ \ifvoid\precolumnbox
\else
% next some incredible crappy code
- \ifgridsnapping
- % somehow this junk fails in pascal
+ \ifgridsnapping
+ % somehow this junk fails in pascal
\scratchdimen\savedpagetotal
\advance\scratchdimen -\ht\precolumnbox
\advance\scratchdimen -\dp\precolumnbox
@@ -620,14 +619,14 @@
\global\precolumnboxheight\zeropoint
\setvsize
\dosomebreak\nobreak
- % wrong, but keep it as a reminder
+ % wrong, but keep it as a reminder
% \ifgridsnapping \else
% \scratchdimen\topskip
% \advance\scratchdimen -\openstrutheight
% \nointerlineskip
% \vskip-\scratchdimen
% \fi
- % so that we don't add it again
+ % so that we don't add it again
\prevdepth\openstrutdepth
\nointerlineskip
\dp\columnpagebox\zeropoint
@@ -720,14 +719,14 @@
\let\postprocesscolumnpagebox=\relax
%D \macros
-%D {reversecolumnstrue}
+%D {reversecolumnstrue}
%D
-%D We can force the macro that takes care of combining
-%D the columns, to flush them in the revere order. Of
-%D course, by default we don't reverse.
+%D We can force the macro that takes care of combining
+%D the columns, to flush them in the revere order. Of
+%D course, by default we don't reverse.
+
+\newif\ifreversecolumns
-\newif\ifreversecolumns
-
%D Here comes the simple splitting routine. It's a bit
%D longer than expected because of ragging bottoms or not.
%D This part can be a bit shorter but I suppose that I will
@@ -757,7 +756,7 @@
\fuzzysnappedbox\unvbox0
\fakecolumnfootnotes{#1}}%
\else
- \ifcleverfootnotes
+ \ifclevernotes
\columnfootnotecorrection{#1}{\dimen#3}%
\setbox0\vsplit#2 to \dimen#3%
\global\setbox#1\vbox to \dimen#3%
@@ -787,15 +786,15 @@
\def\fakecolumnfootnotes#1%
{\relax
- \ifcleverfootnotes
+ \ifclevernotes
\ifnum#1=\lastcolumnbox
- \fakefootnotes
+ \fakenotes
\fi
\fi}
\def\columnfootnotecorrection#1#2%
{\relax
- \ifcleverfootnotes
+ \ifclevernotes
\ifnum#1=\lastcolumnbox\relax
\calculatetotalnoteheight
\advance#2 -\totalnoteheight
@@ -804,7 +803,7 @@
\def\overlaycolumnfootnotes % VERVANGEN !!!
{\relax
- \ifcleverfootnotes
+ \ifclevernotes
\checknotepresence
\ifnotespresent
\bgroup
@@ -815,7 +814,7 @@
\scratchdimen\noflines\lineheight
\advance\scratchdimen \topskip
\setbox0\hbox
- {\lower\scratchdimen\vbox{\placefootnoteinserts}}%
+ {\lower\scratchdimen\vbox{\placenoteinserts}}%
\ht0=\openstrutheight % \strutht
\dp0=\openstrutdepth % \strutdp
\scratchdimen\ht\lastcolumnbox
@@ -850,7 +849,7 @@
{\splitcurrentcolumn from \box\normalpagebox to \dimen0}
\setbox\restofpage\vbox{\unvbox\normalpagebox}%
\ifinheritcolumns
- \ifr@ggedbottom % vreemd
+ \ifr@ggedbottom % vreemd
\dohandleallcolumns
{\global\setbox\currentcolumnbox\vbox to \ht\firstcolumnbox
{\dimen0\dp\currentcolumnbox
@@ -907,29 +906,29 @@
\dontshowcomposition
\widowpenalty\zerocount
\setbox0\vbox{\unvbox\normalpagebox}%
-\ifdim\ht0>\openlineheight % at least one line
- \ifnum\minbalancetoplines<2 % balance anyway
- \donetrue
- \else % check criterium to available lines
+\ifdim\ht0>\openlineheight % at least one line
+ \ifnum\minbalancetoplines<2 % balance anyway
+ \donetrue
+ \else % check criterium to available lines
\getnoflines{\ht0}%
\divide\noflines \nofcolumns \relax
\ifnum\noflines<\minbalancetoplines \relax
- \dimen0\ht0
+ \dimen0\ht0
\advance\dimen0 \ht\firsttopcolumnbox
\advance\dimen0 \openlineheight \relax % let's play safe
- \ifdim\dimen0>\columntextheight % column exceeding text height
+ \ifdim\dimen0>\columntextheight % column exceeding text height
\donetrue
- \else % it seems to fit
- \donefalse
+ \else % it seems to fit
+ \donefalse
\fi
\else % balance indeed
\donetrue
\fi
\fi
-\else % balancing does not make sense
+\else % balancing does not make sense
\donefalse
\fi
-\ifdone % start balancing
+\ifdone % start balancing
%\ifdim\ht0>\openlineheight
\dimen0\ht0
\advance\dimen0 \topskip
@@ -943,7 +942,7 @@
\ifgridsnapping
\dimen2\lineheight
\else
- \dimen2=\!!onepoint % RUBISH
+ \dimen2=\onepoint % RUBISH
\dimen2=\spacingfactor\dimen2
\fi
\loop
@@ -956,14 +955,14 @@
\setbox2\vbox{\unvcopy\firstcolumnbox}%
\dimen4\zeropoint
\dohandleallcolumns
- {\setbox4\vbox
+ {\setbox4\vbox
{\unvcopy\currentcolumnbox
%rather new, test this on pdftex-z.tex
\unpenalty\unskip\unpenalty\unskip}% maybe better in main splitter
%\writestatus{balance}{\the\currentcolumnbox: \the\ht4}%
\dimen6\ht4
\ifdim\dimen6>\dimen4 \dimen4=\dimen6 \fi}%
- \advance\dimen4 -.0005pt % get rid of accurracy problem, pretty new
+ \advance\dimen4 -.0005pt % get rid of accurracy problem, pretty new
\ifnum\count255>100
\donefalse
\else\ifdim\dimen4>\ht2
@@ -1167,7 +1166,7 @@
\fi}
\def\docolumnroomfloat
- {\ifpostponecolumnfloats
+ {\ifpostponecolumnfloats
\global\roomforfloatfalse
\else\ifnofloatpermitted
\global\roomforfloatfalse
@@ -1222,7 +1221,7 @@
% \setbox2=\vbox
% {\blanko[\@@bkvoorwit]
% \snaptogrid\vbox{\copy\floatbox}}%
-% \advance\dimen0 by \ht2
+% \advance\dimen0 by \ht2
% \ifdim\dimen0>\dimen2
% \ifnum\count255<\nofcolumns
% \advance\count255 by 1
@@ -1280,7 +1279,7 @@
\setbox2=\vbox
{\blanko[\@@bkvoorwit]
\snaptogrid\vbox{\copy\floatbox}}%
- \advance\dimen0 \ht2
+ \advance\dimen0 \ht2
\ifdim\dimen0>\dimen2
\ifnum\mofcolumns<\nofcolumns
\advance\mofcolumns \plusone
@@ -1353,7 +1352,7 @@
\blanko[\@@bknawit]}%
\else
\dogetfloat
- \ifdim\wd\floatbox>\finalcolumntextwidth % better somewhere else too
+ \ifdim\wd\floatbox>\finalcolumntextwidth % better somewhere else too
\global\setbox\floatbox\hbox to \finalcolumntextwidth{\hss\box\floatbox\hss}%
\fi % otherwise the graphic may disappear
\ifdim\wd\floatbox>\hsize
@@ -1361,7 +1360,7 @@
\advance\dimen0 \intercolumnwidth
\dimen2\hsize
\advance\dimen2 \intercolumnwidth
- \advance\dimen0 .5pt % hm, why 1
+ \advance\dimen0 .5pt % hm, why 1
\advance\dimen2 .5pt % hm, why 2
\divide\dimen0 \dimen2
\count0\dimen0
@@ -1375,7 +1374,7 @@
\advance\dimen0 -\intercolumnwidth
\global\setbox\floatbox\hbox to \dimen0
%{\hss\hbox{\copy\floatbox}\hss}%
- {\processaction[\@@bkplaats] % how easy to forget
+ {\processaction[\@@bkplaats] % how easy to forget
[ \v!links=>\copy\floatbox\hss,
\v!rechts=>\hss\copy\floatbox,
\s!default=>\hss\copy\floatbox\hss,
@@ -1421,14 +1420,14 @@
%D \normalizevbox{...}
%D \stoptypen
-% border case, should fit on one page
+% border case, should fit on one page
+%
+% \startkolommen
%
-% \startkolommen
-%
% 1 \input tufte \par \plaatsfiguur{}{\omlijnd[breedte=\hsize,hoogte=3cm]{1}}
% 2 \input tufte \par \plaatsfiguur{}{\omlijnd[breedte=\hsize,hoogte=3cm]{2}}
% 3 \input tufte \par \plaatsfiguur{}{\omlijnd[breedte=\hsize,hoogte=3cm]{3}}
-%
+%
% \stopkolommen
\newif\ifbinnenkolommen
@@ -1549,12 +1548,12 @@
\fi
\fi}
-\installcolumnbreakhandler {MUL} \v!voorkeur
+\installcolumnbreakhandler {MUL} \v!voorkeur
{\goodbreak}
\installcolumnbreakhandler {MUL} \v!ja
- {\par % todo: since
- {\testrulewidth\zeropoint\ruledvskip\teksthoogte} % we misuse a
+ {\par % todo: since
+ {\testrulewidth\zeropoint\ruledvskip\teksthoogte} % we misuse a
\penalty-200 % side effect
\vskip-\teksthoogte
\prevdepth-\thousandpoint} % signals top of column to \blanko
@@ -1591,9 +1590,9 @@
\forgetall} % \blanko[\v!blokkeer]
\def\stopsimplecolumns
- {\removebottomthings
+ {\removebottomthings
\egroup
\rigidcolumnbalance\scratchbox
\egroup}
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/page-not.tex b/tex/context/base/page-not.tex
index 505b1a5c1..ea4c444f7 100644
--- a/tex/context/base/page-not.tex
+++ b/tex/context/base/page-not.tex
@@ -1,8 +1,8 @@
%D \module
-%D [ file=page-not,
+%D [ file=page-nnt,
%D version=2002.04.16,
%D title=\CONTEXT\ Page Macros,
-%D subtitle=Footnotes,
+%D subtitle=Footnotes,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
@@ -13,102 +13,58 @@
\writestatus{loading}{Context Page Macros / Footnotes}
-%D Terrible hacks: we need to share save/restore
+%D Terrible hacks: we need to share save/restore
-%D We've moved some footnote handling to a separate page
+%D We've moved some footnote handling to a separate page
%D module. The macros below are used in the single and multi
-%D column page handlers and permit mixed usage of column and
-%D page notes.
+%D column page handlers and permit mixed usage of column and
+%D page notes.
-\unprotect
+\unprotect
-\installbackupinsertion\footins
-
-\def\checkbegincolumnfootnotes % should happen inside otr
- {\ifcleverfootnotes
+\def\checkbegincolumnfootnotes % should happen inside otr
+ {\ifclevernotes
\doflushnotes
- \saveinsertionbox\footins
+ \savenotecontent
\else
- \eraseinsertionbackup\footins
+ \erasenotebackup
\fi
- \saveinsertiondata\footins
+ \savenotedata
\checknotes}
\def\checkendcolumnfootnotes
- {\restoreinsertiondata\footins % maybe better just \checknotes
- \ifcleverfootnotes
- \restoreinsertionbox\footins
+ {\restorenotedata % maybe better just \checknotes
+ \ifclevernotes
+ \restorenotecontent
\fi}
\def\checksinglecolumnfootnotes
- {\checknotes} % njet : \restoreinsertiondata\footins
-
-\def\columnfootins % expands to an insert number
- {\ifcleverfootnotes
- \backupinsertion\footins
- \else
- \footins
- \fi}
-
-% wrong place
+ {\checknotes} % njet : \restorenotedata
\newdimen\totalinsertionheight
\def\settotalinsertionheight
- {\totalinsertionheight\zeropoint
- \addinsertionheight\topins \to\totalinsertionheight
- \addinsertionheight\botins \to\totalinsertionheight
- \addinsertionheight\columnfootins\to\totalinsertionheight}
-
-% idem
-
-\def\enablenotes
- {\global\count\footins1000
- \global\skip\footins1\baselineskip\relax}
-
-\def\disablenotes
- {\global\count\footins\zerocount
- \global\skip\footins \zeropoint}
+ {\calculatetotalnoteheight
+ \totalinsertionheight\totalnoteheight
+ \addinsertionheight\topins\to\totalinsertionheight
+ \addinsertionheight\botins\to\totalinsertionheight}
-% also
+% hm
-%\def\flushsavedcolumnfootnotes
-% {\insert\footins{\unvbox\OTRSETsavedfootnotes}}
-%
-%\def\savecolumnfootnotes
-% {\global\setbox\OTRSETsavedfootnotes\vbox
-% {\unvbox\OTRSETsavedfootnotes\box\footins}}
-
-\newbox\savednotes
-
-\def\flushsavednotes
- {\ifvoid\savednotes\else
- \insert\footins{\unvbox\savednotes}%
- \fi}
-
-\def\savenotes
- {\global\setbox\savednotes\vbox
- {\ifvoid\savednotes\else\unvbox\savednotes\fi
- \box\footins}}
-
-% hm
-
-\installbackupinsertion\footins
-
-\def\checkbegincolumnfootnotes % should happen inside otr
- {\ifcleverfootnotes
+\def\checkbegincolumnfootnotes % should happen inside otr
+ {\ifclevernotes
\doflushnotes
- \saveinsertionbox\footins
+ \savenotecontent
\else
- \eraseinsertionbackup\footins
+ \erasenotebackup
\fi
- \saveinsertiondata\footins
+ \savenotedata
\checknotes}
\def\checkendcolumnfootnotes
- {\restoreinsertiondata\footins
- \ifcleverfootnotes
- \restoreinsertionbox\footins
+ {\restorenotedata
+ \ifclevernotes
+ \restorenotecontent
\fi}
-
-\protect \endinput
+
+\protect \endinput
diff --git a/tex/context/base/page-one.tex b/tex/context/base/page-one.tex
index f236a411e..c5707a0e7 100644
--- a/tex/context/base/page-one.tex
+++ b/tex/context/base/page-one.tex
@@ -73,6 +73,23 @@
% \egroup
% \fi}
+% \def\OTRONEsetvsize
+% {\ifgridsnapping
+% \ifcase\layoutlines
+% \getrawnoflines\teksthoogte
+% \else
+% \noflines\layoutlines
+% \fi
+% \global\vsize\noflines\openlineheight
+% \else
+% \global\vsize\teksthoogte
+% \fi
+% \ifdim\pagegoal<\maxdimen
+% \global\pagegoal\vsize
+% \fi}
+
+\newdimen\oldvsize
+
\def\OTRONEsetvsize
{\ifgridsnapping
\ifcase\layoutlines
@@ -85,7 +102,16 @@
\global\vsize\teksthoogte
\fi
\ifdim\pagegoal<\maxdimen
- \global\pagegoal\vsize
+ \ifdim\oldvsize=\vsize
+ % let's assume that the layout didn't change
+ \else
+ \bgroup
+ \global\oldvsize\vsize
+ \advance\vsize-\topinserted
+ \advance\vsize-\botinserted
+ \global\pagegoal\vsize
+ \egroup
+ \fi
\fi}
% \def\OTRONEdopagecontents#1#2% \box<n> \unvbox<n>
@@ -112,7 +138,7 @@
% \kern\maxdepth
% \dobotinsertions
% \fi\fi\fi
-% \fakefootnotes}%
+% \fakenotes}%
% \ifbottomnotes
% \ifgridsnapping
% \getnoflines\teksthoogte
@@ -196,7 +222,7 @@
\pushcolor % moved from just after #1#2
\dobotinsertions % added
\fi\fi\fi
- \fakefootnotes}%
+ \fakenotes}%
\ifbottomnotes
\ifgridsnapping
\getnoflines\teksthoogte
@@ -253,6 +279,48 @@
\fi
\egroup}
+% \def\OTRONEdodosettopinserts
+% {\ifnum\noffloatinserts<\noftopfloats
+% \dogetfloat
+% \ifdim\topinserted=\zeropoint
+% \topofinserttrue
+% \else
+% \topofinsertfalse
+% \fi
+% \global\advance\topinserted \ht\floatbox
+% \global\advance\topinserted \dp\floatbox
+% \global\advance\topinserted \floatbottomskip\relax
+% \ifdim\topinserted<\teksthoogte\relax
+% \xdef\totaltopinserted{\the\topinserted}%
+% \insert\topins
+% {\forgetall
+% \iftopofinsert
+% \kern-\lineskip\par
+% \prevdepth\maxdimen
+% \else
+% %\blanko[-\@@bknawit,\@@bkvoorwit]% inserts can't look back
+% \betweenfloatblanko
+% \fi
+% \flushfloatbox
+% \blanko[\@@bknawit]}%
+% \ifsomefloatwaiting
+% \advance\noffloatinserts \plusone
+% \else
+% \noffloatinserts\noftopfloats\relax
+% \fi
+% \dofloatflushedinfo
+% \else
+% \doresavefloat
+% \noffloatinserts\noftopfloats\relax
+% \fi
+% \else
+% \ifsomefloatwaiting
+% \showmessage\m!floatblocks6{\the\noftopfloats}%
+% \fi
+% \let\OTRONEdodosettopinserts\relax
+% \fi
+% \OTRONEdodosettopinserts}
+
\def\OTRONEdodosettopinserts
{\ifnum\noffloatinserts<\noftopfloats
\dogetfloat
@@ -269,6 +337,7 @@
\insert\topins
{\forgetall
\iftopofinsert
+ \topskipcorrection % [xx] new: see icare topbleed
\kern-\lineskip\par
\prevdepth\maxdimen
\else
@@ -334,12 +403,11 @@
\OTRONEdodosetbotinserts}
\def\OTRONEdosetbothinserts
- {\ifflushingfloats
- \global\topinserted\zeropoint
- \global\botinserted\zeropoint
- \else
- \global\topinserted\zeropoint \OTRONEdosettopinserts
- \global\botinserted\zeropoint \OTRONEdosetbotinserts
+ {\global\topinserted\zeropoint
+ \global\botinserted\zeropoint
+ \ifflushingfloats \else
+ \OTRONEdosettopinserts
+ \OTRONEdosetbotinserts
\fi}
% \def\OTRONEdotopinsertions
@@ -374,11 +442,23 @@
\global\botinserted\zeropoint
\global\nofloatpermittedfalse}
+% \def\OTRONEdoflushfloats
+% {\global\flushingfloatstrue
+% \ifsomefloatwaiting
+% \par
+% \ifvmode \prevdepth\maxdimen \fi % prevents whitespace
+% \OTRONEdodoflushfloats
+% \fi
+% \global\savednoffloats\zerocount
+% \global\somefloatwaitingfalse
+% \global\flushingfloatsfalse}
+
\def\OTRONEdoflushfloats
{\global\flushingfloatstrue
\ifsomefloatwaiting
\par
- \ifvmode \prevdepth\maxdimen \fi % prevents whitespace
+ % if kept, then option and definitely off in gridmode ! ! ! !
+ % \ifvmode \prevdepth\maxdimen \fi % prevents whitespace; problematic in icare tests
\OTRONEdodoflushfloats
\fi
\global\savednoffloats\zerocount
@@ -492,7 +572,7 @@
\dimen2 .99\pagegoal
\or
% method 2 : tight
- \advance\dimen0 -\!!onepoint
+ \advance\dimen0 -\onepoint
\fi
\relax % really needed ! ! ! !
\ifdim\dimen0>\dimen2
@@ -505,8 +585,11 @@
\def\OTRONEflushsavedfloats
{\dosetbothinserts}
+% TODO: TEST FIRST, NO CORRECTION NEEDED IN GRID MODE, EVT OPTION
+
\def\OTRONEsomeherefloat[#1]% spacing between two successive must be better
- {\baselinecorrection
+ {\baselinecorrection % not really needed in grid mode:
+ %\ifgridsnapping \else \baselinecorrection \fi % ! ! ! test test test ! ! ! !
\doplacefloatbox
\doinsertfloatinfo
\dochecknextindentation\??bk}
diff --git a/tex/context/base/page-set.tex b/tex/context/base/page-set.tex
index 518da3132..a4e98abc3 100644
--- a/tex/context/base/page-set.tex
+++ b/tex/context/base/page-set.tex
@@ -1619,7 +1619,7 @@
% no, extra page \pagebreak % (test on pascal toc)
\dostopcolumnset
\egroup
- \global\footnotelimittrue
+ \global\notelimittrue % brrr, untested and fuzzy
\setvsize
\sethsize
\ifvoid\OTRfinalpagebox\else
diff --git a/tex/context/base/page-sid.tex b/tex/context/base/page-sid.tex
index e61b9ff99..0c2506eac 100644
--- a/tex/context/base/page-sid.tex
+++ b/tex/context/base/page-sid.tex
@@ -247,7 +247,7 @@
\iftracesidefloats
\color[darkgray]%
{\baselinerulefalse
- \boxrulewidth.5\s!pt
+ \boxrulewidth.5\points
\ruledhbox{\strut\kern\sidefloatwidth}}%
\fi
\par
@@ -385,6 +385,118 @@
\fi
+% \def\putsidefloat#1% grid (4) is rather experimental
+% {\par
+% \witruimte
+% % moved here dec 2001
+% {\everypar\emptytoks\forgetall\verticalstrut\vskip-\struttotal}% moved
+% \checksidefloatshift
+% \ifdim\sidefloatshift=\zeropoint \relax
+% \ifnum\sidefloattype=4
+% \global\advance\sidefloatshift\sidefloatextrashift
+% \global\sidefloatextrashift\zeropoint
+% \else\ifnum\sidefloattype=5
+% \global\advance\sidefloatshift\sidefloatextrashift
+% \global\sidefloatextrashift\zeropoint
+% \fi\fi
+% \else
+% \ifnum\sidefloattype<4
+% \global\chardef\sidefloattype4
+% \else\ifnum\sidefloattype>5
+% \global\chardef\sidefloattype5
+% \fi\fi
+% \fi
+% \previoussidefloat
+% \stallsidefloat
+% %\global\setbox\floatbox\hbox
+% % {\ifmarginfloat\else\ifrightfloat\else\kern\sidefloatleftshift\fi\fi
+% % \hskip\ifrightfloat-\sidefloatextrashift\else\sidefloatshift\fi
+% % \vbox{#1\ifnum\sidefloatalign=4 \removedepth\fi}%
+% % \kern\ifrightfloat\sidefloatshift\else-\sidefloatextrashift\fi
+% % \ifmarginfloat\else\ifrightfloat\kern\sidefloatrightshift\fi\fi}%
+% \global\setbox\floatbox\hbox % no \hskip, but \kern here
+% {\ifnum\sidefloattype=4
+% \hskip\sidefloatleftshift
+% \else\ifnum\sidefloattype=1
+% \hskip\sidefloatleftshift
+% \fi\fi
+% \ifnum\sidefloattype>4
+% \hskip-\sidefloatextrashift
+% \else
+% \hskip\sidefloatshift
+% \fi
+% \vbox{#1\ifnum\sidefloatalign=4 \removedepth\fi}%
+% \ifnum\sidefloattype>4
+% \kern\sidefloatshift
+% \else
+% \kern-\sidefloatextrashift
+% \fi
+% \ifnum\sidefloattype=8
+% \kern\sidefloatrightshift
+% \else\ifnum\sidefloattype=5
+% \kern\sidefloatrightshift
+% \fi\fi}%
+% \ifnum\sidefloatalign=4
+% \getnoflines{\ht\floatbox}%
+% \scratchdimen\noflines\lineheight
+% \advance\scratchdimen-\strutdepth
+% \getrawnoflines\sidefloattopskip
+% \advance\scratchdimen\noflines\lineheight
+% % todo: maybe rounding problem here
+% % \global\setbox\floatbox\hbox{\lower\lineheight\box\floatbox}%
+% \global\setbox\floatbox\hbox{\lower\strutdepth\box\floatbox}%
+% \global\ht\floatbox\scratchdimen
+% \global\dp\floatbox\zeropoint
+% \fi
+% \ifcase\sidefloatalign \else
+% \global\sidefloattopskip\zeropoint
+% \fi
+% \scratchdimen
+% \ifnum\sidefloattype<4
+% \sidefloattopskip
+% \else\ifnum\sidefloattype>5
+% \sidefloattopskip
+% \else
+% \zeropoint
+% \fi\fi
+% % the top of the box is at the previous baseline
+% \ifcase\sidefloatalign
+% % 0 normal
+% \advance\scratchdimen\strutdepth % == \sidefloattopoffset
+% \or % 1 height
+% \advance\scratchdimen\strutdepth % == \sidefloattopoffset
+% \or % 2 line
+% \or % 3 depth
+% \advance\scratchdimen\lineheight
+% \advance\scratchdimen\strutdepth
+% \or % 4 grid
+% \scratchdimen\zeropoint
+% \fi
+% % new
+% \global\sidefloatlinesdone\zerocount
+% \ifnum\sidefloatsidelines>\zerocount
+% \advance\scratchdimen\sidefloatsidelines\lineheight
+% \fi
+% % new
+% \global\setbox\floatbox\hbox
+% {\vbox{\vskip\scratchdimen\nointerlineskip\box\floatbox}}%
+% \ifnum\sidefloattype<4
+% \global\sidefloattopskip\zeropoint
+% \else\ifnum\sidefloattype>5
+% \global\sidefloattopskip\zeropoint
+% \fi\fi
+% \global\sidefloatdownshift\zeropoint
+% \measuresidefloat
+% \ifroomforfloat \else
+% \tosssidefloat
+% \measuresidefloat
+% \stallsidefloat
+% \fi
+% \setsidefloat}
+
+% externfiguur -> grid =ja|hoogte|diepte|halveregel|passend -> helemaal in details
+% stelplaatsblokin -> zijuitlijnen=hoogte|diepte|regel|halveregel|grid -> halveregel in 'details'
+
\def\putsidefloat#1% grid (4) is rather experimental
{\par
\witruimte
@@ -471,6 +583,8 @@
\advance\scratchdimen\strutdepth
\or % 4 grid
\scratchdimen\zeropoint
+ \or
+ \advance\scratchdimen\strutheight
\fi
% new
\global\sidefloatlinesdone\zerocount
@@ -479,7 +593,11 @@
\fi
% new
\global\setbox\floatbox\hbox
- {\vbox{\vskip\scratchdimen\nointerlineskip\box\floatbox}}%
+ {\vbox
+ {\vskip\scratchdimen
+ \nointerlineskip
+ \box\floatbox
+ \ifnum\sidefloatalign=5 \vskip-\lineheight \fi}}%
\ifnum\sidefloattype<4
\global\sidefloattopskip\zeropoint
\else\ifnum\sidefloattype>5
@@ -539,7 +657,7 @@
\dimen2 .99\pagegoal
\or
% method 2 : tight
- \advance\dimen0 -\!!onepoint
+ \advance\dimen0 -\onepoint
\fi
\relax % really needed ! ! ! !
\ifdim\dimen0>\dimen2
@@ -625,7 +743,7 @@
% \iftracesidefloats
% \hskip-\sidefloatwidth
% \color[darkgray]%
-% {\vrule\!!height.5\s!pt\!!depth.5\s!pt\!!width\sidefloatwidth
+% {\vrule\!!height.5\points\!!depth.5\points\!!width\sidefloatwidth
% %\hskip-.25\bodyfontsize\showstruts\strut\hskip.25\bodyfontsize}%
% \llap{\showstruts\strut\hskip.25\bodyfontsize}}%
% \fi}
@@ -678,7 +796,7 @@
\iftracesidefloats
\hskip-\sidefloatwidth
\color[darkgray]%
- {\vrule\!!height.5\s!pt\!!depth.5\s!pt\!!width\sidefloatwidth
+ {\vrule\!!height.5\points\!!depth.5\points\!!width\sidefloatwidth
%\hskip-.25\bodyfontsize\showstruts\strut\hskip.25\bodyfontsize}%
\llap{\showstruts\strut\hskip.25\bodyfontsize}}%
\fi}
@@ -727,4 +845,4 @@
\kern-\!!counta\baselineskip
\penalty\zerocount }
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/page-spr.tex b/tex/context/base/page-spr.tex
index 7ee01cd09..315176a07 100644
--- a/tex/context/base/page-spr.tex
+++ b/tex/context/base/page-spr.tex
@@ -2,7 +2,7 @@
%D [ file=page-spr,
%D version=2002.11.11,
%D title=\CONTEXT\ Page Macros,
-%D subtitle=Spreading,
+%D subtitle=Spreading,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
@@ -11,11 +11,11 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\writestatus{loading}{Context Page Macros / Spreading}
+\writestatus{loading}{Context Page Macros / Spreading}
% This module is experimental and not yet official!
-\unprotect
+\unprotect
\newbox\spreadbox
\newif \ifinspread
@@ -32,28 +32,28 @@
\noindent % content can be < \hsize
\dopagecontents#2#3}}%
\dp#1\zeropoint
- \setbox#1\hbox to \zetbreedte
+ \setbox#1\hbox to \zetbreedte
{\ifinspread
\ifvoid\spreadbox
\global\setbox\spreadbox\box#1%
- \copy\spreadbox\hss % left page
+ \copy\spreadbox\hss % left page
\else
- % prevent duplicate writes in normal run
+ % prevent duplicate writes in normal run
\ifarrangingpages \else \ifcase\showspreadmode
\global\setbox\spreadbox\null
\wd\spreadbox\zetbreedte
\ht\spreadbox\teksthoogte
\fi \fi
- \hss\box\spreadbox % right page
+ \hss\box\spreadbox % right page
\fi
\else
\hss\box#1\hss % never change the \hss's
\fi}}
\def\doflushspread
- {\ifinspread \ifvoid\spreadbox\else
- % this page will be discarded later
- \null \pagina
+ {\ifinspread \ifvoid\spreadbox\else
+ % this page will be discarded later
+ \null \pagina
\fi \fi }
\def\startspread
@@ -80,7 +80,7 @@
\pagina[\v!links]
\egroup}
-\protect \endinput
+\protect \endinput
% texexec --arr --pdf test
%
@@ -88,15 +88,15 @@
% \setuppapersize[A4][A3,landscape]
% \setuppagenumbering[alternative=doublesided]
% \setuparranging[2UP]
-%
-% \starttext
-%
+%
+% \starttext
+%
% \dorecurse{3}{\input tufte }
-%
-% \startspread
+%
+% \startspread
% \dorecurse{10}{\input tufte }
% \stopspread
-%
+%
% \dorecurse{3}{\input tufte }
-%
-% \stoptext
+%
+% \stoptext \ No newline at end of file
diff --git a/tex/context/base/page-txt.tex b/tex/context/base/page-txt.tex
index 5b1d21713..44d9ec1f8 100644
--- a/tex/context/base/page-txt.tex
+++ b/tex/context/base/page-txt.tex
@@ -21,27 +21,27 @@
%D Interfacing between this and other modules is handled by
%D the following macros. The current state of a text line
-%D (header, footer, etc.) is checked by:
-%D
-%D \starttypen
-%D \resetlayoutlines
-%D \stoptypen
-%D
-%D The main text box is finished by the following macro:
-%D
-%D \starttypen
+%D (header, footer, etc.) is checked by:
+%D
+%D \starttypen
+%D \resetlayouttextlines
+%D \stoptypen
+%D
+%D The main text box is finished by the following macro:
+%D
+%D \starttypen
%D \getmainbox <box> <\vbox|\unvbox>
-%D \stoptypen
-%D
-%D The text lines are collected with:
-%D
-%D \starttypen
+%D \stoptypen
+%D
+%D The text lines are collected with:
+%D
+%D \starttypen
%D \gettextboxes
-%D \stoptypen
-%D
-%D It is possible to extens the default content of the text
-%D areas by appending content to the following token list
-%D registers:
+%D \stoptypen
+%D
+%D It is possible to extens the default content of the text
+%D areas by appending content to the following token list
+%D registers:
\newtoks\toptextcontent \newtoks\leftedgetextcontent
\newtoks\headertextcontent \newtoks\leftmargintextcontent
@@ -51,9 +51,9 @@
\newtoks\texttextcontent
%D \macros
-%D {setuptop, setupheader, setuptext,
+%D {setuptop, setupheader, setuptext,
%D setupfooter, setupbottom}
-%D
+%D
%D The macros in this module sometimes look a bit more complicated
%D than needed, which is a direct result of the fact that their
%D ancestors are quite old and upward compatibility is a must.
@@ -74,7 +74,7 @@
%\getparameters[\??tk#1\v!tekst][#2]%
\getparameters[\??tk#1][#2]%
\fi
- %\checkcurrentlayout % no
+ %\checkcurrentlayout % no
\calculatevsizes}
\def\setuptop {\dotripleempty\dosetuplayouttext[\v!boven]}
@@ -85,7 +85,7 @@
%D \macros
%D {noheaderandfooterlines,notopandbottomlines}
-%D
+%D
%D Although not really needed, the following shortcuts
%D sometimes come in handy.
%D
@@ -101,9 +101,9 @@
\setupbottom[\c!status=\v!leeg]}
%D \macros
-%D {setuptoptexts, setupheadertexts, setuptexttexts,
+%D {setuptoptexts, setupheadertexts, setuptexttexts,
%D setupfootertexts, setupbottomtexts}
-%D
+%D
%D The next macros take one or more arguments. The exact setup
%D depends on the number of arguments. Although not that
%D intuitive, the current scheme evolved out of the original.
@@ -199,8 +199,8 @@
{\ConvertConstantAfter\doifelse{\v!paginanummer}{#6}
{\@@plaatspaginanummer}
{\ConvertConstantAfter\doifelse{\v!datum}{#6}
- {\currentdate}
- {% #6{}{}{} -> {} needed for macros that look
+ {\currentdate}
+ {% #6{}{}{} -> {} needed for macros that look
% ahead, like \uniqueMPgraphic
\opeenregel\dolimitatetexts{#1#2#5}{#6{}{}{}}}}}}}%
\egroup}
@@ -211,8 +211,8 @@
\def\dolimitatetexts#1#2%
{\doifelsevaluenothing{#1}{#2}{\limitatetext{#2}{\getvalue{#1}}{\unknown}}}
-%D The placement of text is hooked into the token lists
-%D associated to the area at hand.
+%D The placement of text is hooked into the token lists
+%D associated to the area at hand.
\appendtoks \placelayouttextline\v!boven\bovenhoogte \to \toptextcontent
\appendtoks \placelayouttextline\v!hoofd\hoofdhoogte \to \headertextcontent
@@ -256,28 +256,28 @@
% {\getvalue{\string\placelayouttextline\textlinestatus}{#1}{#2}}
% {\getvalue{\string\placelayouttextline\s!unknown}{#1}{#2}}}
%
-%\def\placelayouttextline#1% #2
+%\def\placelayouttextline#1% #2
% {\settextlinestatus{#1}%
% \doifundefined{\string\placelayouttextline\textlinestatus}
% {\let\textlinestatus\s!unknown}%
% \getvalue{\string\placelayouttextline\textlinestatus}{#1}} % {#2}
-% recently bugged
+% recently bugged
%
-% \def\placelayouttextline#1% #2
+% \def\placelayouttextline#1% #2
% {\settextlinestatus{#1}%
% \ifundefined{\string\placelayouttextline\textlinestatus}%
% \let\textlinestatus\s!unknown
% \fi
% \csname\string\placelayouttextline\textlinestatus\endcsname{#1}} % {#2}
-\def\placelayouttextline#1% #2
+\def\placelayouttextline#1% #2
{\settextlinestatus{#1}%
\csname\string\placelayouttextline
\ifundefined{\string\placelayouttextline\textlinestatus}%
\s!unknown
\else
- \textlinestatus
+ \textlinestatus
\fi
\endcsname{#1}} % {#2}
@@ -306,10 +306,6 @@
\setvalue{\string\placelayouttextline\s!unknown}#1#2%
{\bgroup % new
\resettextlinestatus{#1}%
- %\setlocallayoutline{#1\textlinestatus}%
- %\setlocallayoutline{#1\v!tekst\textlinestatus}%
- %\setlocallayoutline{#1\v!marge\textlinestatus}%
- %\setlocallayoutline{#1\v!rand\textlinestatus}%
\getvalue{\??tk#1\textlinestatus}%
\getvalue{\??tk#1\v!tekst\textlinestatus}%
\getvalue{\??tk#1\v!marge\textlinestatus}%
@@ -317,29 +313,21 @@
\doplacelayouttextline{#1}{#2}%
\egroup}
-% \def\setlocallayoutline#1%
-% {\ifundefined{\??tk#1}\else\getvalue{\??tk#1}\fi}
-
%D The following macro has to be called after a page
%D is flushed.
-%\def\resetlayoutline#1% beware: global assignment
-% {\doifvalue{\??tk#1\v!tekst\c!status}\v!hoog
-% {\resettextlinestatus{#1}%
-% \donetrue}}
-
-\def\resetlayoutline#1% beware: global assignment
+\def\resetlayouttextline#1% beware: global assignment
{\doifvalue{\??tk#1\c!status}\v!hoog
{\resettextlinestatus{#1}%
\donetrue}}
-\def\resetlayoutlines
+\def\resetlayouttextlines
{\donefalse
- \resetlayoutline\v!boven
- \resetlayoutline\v!hoofd
- \resetlayoutline\v!tekst
- \resetlayoutline\v!voet
- \resetlayoutline\v!onder
+ \resetlayouttextline\v!boven
+ \resetlayouttextline\v!hoofd
+ \resetlayouttextline\v!tekst
+ \resetlayouttextline\v!voet
+ \resetlayouttextline\v!onder
\ifdone
\doglobal\calculatevsizes
\recalculatebackgrounds
@@ -375,6 +363,7 @@
\vskip-\teksthoogte
\the\texttextcontent
\vskip\teksthoogte
+ \the\everyendoftextbody
\vskip\voetafstand
\ifdim\voethoogte>\zeropoint
\the\footertextcontent
@@ -440,10 +429,10 @@
\box\scratchpagebox}
%D The main text area has to be combined with some additional
-%D (tracing) information.
+%D (tracing) information.
\def\settextpagecontent#1#2#3% #2 and #3 will disappear
- {\setbox#1\hbox to \zetbreedte
+ {\setbox#1\hbox to \zetbreedte
{\hss % so don't change this
\vbox to \teksthoogte
{\offinterlineskip
@@ -455,12 +444,12 @@
\hss}%
\dp#1\zeropoint}
-\def\addtextgridlayer#1% tzt run time
+\def\addtextgridlayer#1% tzt run time
{\ifcase\showgridstate\else % 1=bottom 2=top
\setgridbox\scratchbox\zetbreedte\teksthoogte
\setbox#1\hbox
{\ifcase\showgridstate\or\or\box#1\hskip-\zetbreedte\fi
- \bgroup % color
+ \bgroup % color
\startlayoutcomponent{gridcolumns}{grid columns}%
\incolortrue
\ifcase\layoutcolumns\else
@@ -485,9 +474,9 @@
\ifcase\showgridstate\or\hskip-\zetbreedte\box#1\fi}%
\fi}
-%D The placement of a whole line is handled by the next two
+%D The placement of a whole line is handled by the next two
%D macros. These are hooked into the general purpose token
-%D list registers mentioned before.
+%D list registers mentioned before.
\def\ignoredlinebreak{\unskip\space\ignorespaces}
@@ -581,35 +570,35 @@
\stoplayoutcomponent
\getvalue{\??tk#2#3\c!na}}}
-%D Although it is far better to use backgrounds for this
-%D purpose, one can add a rule in the following way. This
-%D method makes the rules disappear in case of an empty text
-%D line. Consider this a feature.
+%D Although it is far better to use backgrounds for this
+%D purpose, one can add a rule in the following way. This
+%D method makes the rules disappear in case of an empty text
+%D line. Consider this a feature.
%D
-%D \starttypen
+%D \starttypen
%D \setupheadertexts[left][right]
-%D
+%D
%D \setupheader[text][after=\hrule,style=bold]
-%D
+%D
%D \starttext
%D \input tufte \page
%D \setupheader[state=empty]
%D \input tufte \page
%D \stoptext
-%D \stoptypen
+%D \stoptypen
-%D The next twosome will be done differently (using an
+%D The next twosome will be done differently (using an
%D existing auxiliary macro).
% \def\@@nmpre#1{\setbox0\hbox{#1}\ifdim\wd0=\zeropoint\else\unhbox0\tfskip\fi}
% \def\@@nmpos#1{\setbox0\hbox{#1}\ifdim\wd0=\zeropoint\else\tfskip\unhbox0\fi}
-% cleaner
+% cleaner
\def\@@nmpre#1{\doiftext{#1}{{#1}\tfskip}}
\def\@@nmpos#1{\doiftext{#1}{\tfskip{#1}}}
-% newer
+% newer
\def\@@nmprepos#1#2#3#4#5%
{\doifelsenothing\@@nmbreedte
@@ -619,7 +608,7 @@
\def\@@nmpre{\@@nmprepos\empty\tfskip\relax\hss}
\def\@@nmpos{\@@nmprepos\tfskip\empty\hss\relax}
-%D This code will move to \type {page-flt.tex}.
+%D This code will move to \type {page-flt.tex}.
\appendtoks
\plaatsrechtermargeblok \hskip-\rechtermargebreedte
@@ -629,9 +618,9 @@
\plaatslinkermargeblok \hskip-\linkermargebreedte
\to \leftmargintextcontent
-%D The next hook will later be used for keeping track of
-%D positions, i.e.\ it will provide a proper (page
-%D dependent) reference point.
+%D The next hook will later be used for keeping track of
+%D positions, i.e.\ it will provide a proper (page
+%D dependent) reference point.
\ifx\undefined\placepositionanchors
\def\placepositionanchors{\vskip\teksthoogte}
@@ -639,24 +628,24 @@
%D \macros
%D {definetext}
-%D
+%D
%D Some macros ago, we implemented the \type {status} option
-%D \type {unknown}. This one is used to take care of
-%D symbolic texts handlers.
+%D \type {unknown}. This one is used to take care of
+%D symbolic texts handlers.
%D
%D \showsetup{\y!definetext}
-%D
-%D The next example demonstrates how we can use this
-%D mechanism to provide page (event) dependent text lines.
-%D
-%D \starttypen
+%D
+%D The next example demonstrates how we can use this
+%D mechanism to provide page (event) dependent text lines.
+%D
+%D \starttypen
%D \definetext[hoofdstuk][voet][paginanummer]
%D \stelkopin[hoofdstuk][hoofd=hoog,voet=hoofdstuk]
%D \setupheadertexts[paginanummer]
%D \setupfootertexts[links][rechts]
%D \hoofdstuk{eerste} \dorecurse{20}{\input tufte \relax}
%D \hoofdstuk{tweede} \dorecurse{20}{\input tufte \relax}
-%D \stoptypen
+%D \stoptypen
\def\definetext
{\doseventupleempty\dodefinetext}
@@ -674,8 +663,8 @@
\setvalue{\??tk #2#1}{\dosixtupleempty\dosetuptexts[#2][#3]}%
\fi\fi\fi\fi}
-%D The rest of this file is dedicated to setting up the
-%D texts. This code is not that impressive.
+%D The rest of this file is dedicated to setting up the
+%D texts. This code is not that impressive.
\setupheadertexts [\v!tekst] [] []
\setupheadertexts [\v!marge] [] []
@@ -718,15 +707,15 @@
% \resetlayouttekst[#1][\v!rand]}
%D We combine a lot of similar settings in a macro that
-%D we will later dispose.
+%D we will later dispose.
\def\dodocommando[#1][#2]%
{\getparameters
[\??tk#1#2]
- [%\c!status=\v!normaal, % moved
- \c!voor=, % both global and local are used
- \c!na=, % both global and local are used
- \c!strut=, % the local one, not (yet) used
+ [%\c!status=\v!normaal, % moved
+ \c!voor=, % both global and local are used
+ \c!na=, % both global and local are used
+ \c!strut=, % the local one, not (yet) used
\c!letter=\getvalue{\??tk#1\c!letter},% hm, got lost
\c!kleur=\getvalue{\??tk#1\c!kleur}, % hm, got lost
\c!linkertekst=,
@@ -734,8 +723,8 @@
\c!rechtertekst=,
\c!kantlijntekst=,
\c!margetekst=,
- \c!breedte=]%
- \inheritparameter[\??tk#1#2][\c!linkerletter ][\c!letter ]%
+ \c!breedte=]%
+ \inheritparameter[\??tk#1#2][\c!linkerletter ][\c!letter ]%
\inheritparameter[\??tk#1#2][\c!rechterletter ][\c!letter ]%
\inheritparameter[\??tk#1#2][\c!linkerkleur ][\c!kleur ]%
\inheritparameter[\??tk#1#2][\c!rechterkleur ][\c!kleur ]%
@@ -757,7 +746,7 @@
\let\dodocommando\relax
%D While the header and footer lines are moved away from the
-%D main text, the top and bottom lines are centered.
+%D main text, the top and bottom lines are centered.
\setuptop [\c!status=\v!normaal,\c!voor=\vss,\c!na=\vss,\c!strut=]
\setupheader[\c!status=\v!normaal,\c!voor=, \c!na=\vss,\c!strut=\v!ja]
diff --git a/tex/context/base/plus-rul.tex b/tex/context/base/plus-rul.tex
index 8b5652485..15f919fcc 100644
--- a/tex/context/base/plus-rul.tex
+++ b/tex/context/base/plus-rul.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=plus-rul,
-%D version=2003.03.16,
+%D version=2003.03.16,
%D title=\CONTEXT\ Plus Macros,
%D subtitle=Ruled Stuff Handling,
%D author=Hans Hagen,
@@ -8,19 +8,19 @@
%D copyright=PRAGMA-ADE]
%C
%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
\writestatus{loading}{Context Plus Macros / Ruled Content Handling}
-\unprotect
+\unprotect
%D \definesidebar[whow][rulecolor=green,distance=]
-%D
-%D \starttext
-%D
+%D
+%D \starttext
+%D
%D \input tufte \par
-%D \startsidebar
+%D \startsidebar
%D \input tufte \par
%D \input tufte \par
%D \startsidebar[whow]
@@ -31,7 +31,7 @@
%D \input tufte \stopsidebar \par
%D \input tufte \par
%D \input tufte \par
-%D \startsidebar
+%D \startsidebar
%D \input tufte \par
%D \input tufte \par
%D \input tufte \par
@@ -39,12 +39,12 @@
%D \input tufte \stopsidebar \par
%D \input tufte \par
%D \input tufte \par
-%D \startsidebar
-%D \input tufte
-%D \input tufte
-%D \input tufte
-%D \input tufte
-%D \input tufte
+%D \startsidebar
+%D \input tufte
+%D \input tufte
+%D \input tufte
+%D \input tufte
+%D \input tufte
%D \stopsidebar
\newcounter\currentsidebar
@@ -52,7 +52,7 @@
\definesystemvariable{sr}
-\def\setupsidebars
+\def\setupsidebars
{\dodoubleargument\dosetupsidebars}
\def\dosetupsidebars[#1][#2]%
@@ -97,7 +97,7 @@
{\advance\sidebardistance\@@srafstand}
{\sidebardistance\getvalue{\??sr#1\c!afstand}}}%
\startpositionoverlay{text-1}%
- \expanded{\setMPpositiongraphicrange
+ \expanded{\setMPpositiongraphicrange
{b:side:\currentsidebar}%
{e:side:\currentsidebar}%
{mpos:bar}%
@@ -115,31 +115,31 @@
\startMPpositionmethod{mpos:bar}
\startMPpositiongraphic{mpos:bar}{linecolor,linewidth,distance}%
StartPage ;
- path p ; p :=
- if \MPp\MPbself=\MPp\MPeself :
+ path p ; p :=
+ if \MPp\MPbself=\MPp\MPeself :
(xpart ulcorner Field[Text][Text],\MPy\MPbself+\MPh\MPbself) --
(xpart llcorner Field[Text][Text],\MPy\MPeself-\MPd\MPeself) ;
- elseif RealPageNumber=\MPp\MPbself :
+ elseif RealPageNumber=\MPp\MPbself :
(xpart ulcorner Field[Text][Text],\MPy\MPbself+\MPh\MPbself) --
(llcorner Field[Text][Text]) ;
- elseif RealPageNumber=\MPp\MPeself :
+ elseif RealPageNumber=\MPp\MPeself :
(ulcorner Field[Text][Text]) --
(xpart llcorner Field[Text][Text],\MPy\MPeself-\MPd\MPeself) ;
- else :
+ else :
(ulcorner Field[Text][Text]) --
(llcorner Field[Text][Text]) ;
- fi ;
- p := p shifted (-llcorner Field[Text][Text]-(\MPvar{distance},0)) ;
- interim linecap := butt ;
- draw p
- withpen pencircle scaled \MPvar{linewidth}
- withcolor \MPvar{linecolor} ;
+ fi ;
+ p := p shifted (-llcorner Field[Text][Text]-(\MPvar{distance},0)) ;
+ interim linecap := butt ;
+ draw p
+ withpen pencircle scaled \MPvar{linewidth}
+ withcolor \MPvar{linecolor} ;
StopPage ;
\stopMPpositiongraphic
\MPpositiongraphic{mpos:bar}{}%
\stopMPpositionmethod
-%D We now reimplement the margin rules handler defined in
+%D We now reimplement the margin rules handler defined in
%D \type {core-rul}:
%D
%D \setupmarginrules[level=5]
@@ -172,7 +172,7 @@
\let\stopmarginrule\egroup
\else
\def\@@kadefaultwidth{#1}%
- \let\stopmarginrule\dostopmarginrule
+ \let\stopmarginrule\dostopmarginrule
\@EA\startsidebar\@EA[\@EA\v!marge\@EA]%
\fi}
@@ -180,4 +180,4 @@
{\stopsidebar
\egroup}
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/ppchtex.tex b/tex/context/base/ppchtex.tex
index 9ab0754f5..3a8a556f7 100644
--- a/tex/context/base/ppchtex.tex
+++ b/tex/context/base/ppchtex.tex
@@ -5,7 +5,7 @@
% constante van phantom in definitie ONE: \setchemicaltextwidth 300
%
% it would be interesting to rewrite this module with todays
-% experiences and new context functionality, mybe ...
+% experiences and new context functionality, mybe ...
%D \module
%D [ file=ppchtex (m-chemie),
@@ -18,8 +18,8 @@
%D suggestions={Tobias Burnus, Dirk Kuypers \& 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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
% Deze module ondersteunt het zetten van chemische
% (structuur)formules. Hoewel de macro' zijn afgestemd op
@@ -82,13 +82,13 @@
\startcommands dutch english german
- gotochemical: naarchemie gotochemical zurchemie
- setupchemical: stelchemiein setupchemical stellechemieein
- startchemical: startchemie startchemical startchemie
- stopchemical: stopchemie stopchemical stopchemie
- definechemical: definieerchemie definechemical definierechemie
- chemical: chemie chemical chemie
- toptext: boventekst toptext textueber
+ gotochemical: naarchemie gotochemical zurchemie
+ setupchemical: stelchemiein setupchemical stellechemieein
+ startchemical: startchemie startchemical startchemie
+ stopchemical: stopchemie stopchemical stopchemie
+ definechemical: definieerchemie definechemical definierechemie
+ chemical: chemie chemical chemie
+ toptext: boventekst toptext textueber
bottext: ondertekst bottext textunter
midtext: middentekst midtext textmitte
@@ -97,10 +97,10 @@
\doifundefined{fiverm} % In the more recent LaTeX versions
{\font\fiverm=cmr5 } % \fiverm is no longer (pre)defined.
-\doifdefinedelse{beginpicture} % PiCTeX
+\doifdefinedelse{beginpicture} % PiCTeX
{\doifdefinedelse{startMPdrawing}
{\chardef\chemicaldrawingmode=2 } % MetaPost
- {\chardef\chemicaldrawingmode=0 }} % raw
+ {\chardef\chemicaldrawingmode=0 }} % raw
{\doifdefinedelse{psaxes}
{\chardef\chemicaldrawingmode=1 } % PSTricks
{\chardef\chemicaldrawingmode=3 }} % unknown
@@ -418,24 +418,16 @@
\def\setupchemicalformat[#1]%
{\processaction
[\getvalue{#1\c!formaat}]
- [ \v!klein=>\def\@@localchemicalformat%
- {\scriptscriptstyle},
- \v!middel=>\def\@@localchemicalformat%
- {\ifsmallchemicaltext\scriptscriptstyle\else\scriptstyle\fi},
- \v!groot=>\def\@@localchemicalformat
- {\ifsmallchemicaltext\scriptstyle\else\textstyle\fi},
- \s!unknown=>\def\@@localchemicalformat%
- {\getvalue{#1\c!formaat}}]%
+ [ \v!klein=>\def\@@localchemicalformat{\scriptscriptstyle},
+ \v!middel=>\def\@@localchemicalformat{\ifsmallchemicaltext\scriptscriptstyle\else\scriptstyle\fi},
+ \v!groot=>\def\@@localchemicalformat{\ifsmallchemicaltext\scriptstyle\else\textstyle\fi},
+ \s!unknown=>\def\@@localchemicalformat{\getvalue{#1\c!formaat}}]%
\processaction
[\getvalue{#1\c!tekstformaat}]
- [ \v!klein=>\def\@@localchemicalstyle%
- {\scriptscriptstyle},
- \v!middel=>\def\@@localchemicalstyle%
- {\ifsmallchemicaltext\scriptscriptstyle\else\scriptstyle\fi},
- \v!groot=>\def\@@localchemicalstyle%
- {\ifsmallchemicaltext\scriptstyle\else\textstyle\fi},
- \s!unknown=>\def\@@localchemicalstyle%
- {\getvalue{#1\c!tekstformaat}}]%
+ [ \v!klein=>\def\@@localchemicalstyle{\scriptscriptstyle},
+ \v!middel=>\def\@@localchemicalstyle{\ifsmallchemicaltext\scriptscriptstyle\else\scriptstyle\fi},
+ \v!groot=>\def\@@localchemicalstyle{\ifsmallchemicaltext\scriptstyle\else\textstyle\fi},
+ \s!unknown=>\def\@@localchemicalstyle{\getvalue{#1\c!tekstformaat}}]%
\processaction
[\getvalue{#1\c!schaal}]
[ \v!klein=>\def\@@localchemicalscale{500},
@@ -443,7 +435,7 @@
\v!groot=>\def\@@localchemicalscale{750},
\s!unknown=>\def\@@localchemicalscale{\getvalue{#1\c!schaal}}]}
-\def\@@currentchemicalformat%
+\def\@@currentchemicalformat
{\ifinchemical
\@@localchemicalformat
\else
@@ -458,14 +450,14 @@
\setupchemicalformat[\??chemical\s!chemical]%
\ignorespaces}
-\def\setupchemical%
+\def\setupchemical
{\dosingleargument\dosetupchemical}
-\def\@@dochemicalstyle% % default mapping
- {\@@chemicalletter}
-
-\def\@@dochemicalcolor% % no mapping yet
- {}
+\def\@@dochemicalstyle% % default mapping
+ {\@@chemicalletter}
+
+\def\@@dochemicalcolor% % no mapping yet
+ {}
\def\@@chemicalletter % $inner-style$ % (overloaded)
{\@@chemicalchemicalletter} % $$outer-style$$
@@ -473,7 +465,7 @@
\def\@@writechemicalstatus#1#2%
{}
-\def\@@beginchemicallocalpicture%
+\def\@@beginchemicallocalpicture
{\ifcase\chemicaldrawingmode
\beginpicture
\or
@@ -481,11 +473,11 @@
\or
\pushMPdrawing
\startMPdrawing
- %prologues := 1 ;
- %input mp-tool ;
+ %prologues := 1 ;
+ %input mp-tool ;
u := 10*\@@chemicalunit;
- bboxmargin := 0pt ;
- pickup pencircle scaled 2u ; % ???
+ bboxmargin := 0pt ;
+ pickup pencircle scaled 2u ; % ???
\stopMPdrawing
\beginpicture
\fi}
@@ -500,8 +492,8 @@
\setbox2=\hbox
{\MPshiftdrawingtrue\MPstaticgraphictrue\getMPdrawing}%
\wd2=\!!zeropoint\ht2=\!!zeropoint\dp2=\!!zeropoint
- \put {\box2} at 0 0
- \endpicture
+ \put {\box2} at 0 0
+ \endpicture
\popMPdrawing
\fi}
@@ -554,11 +546,11 @@
\or
\setcoordinatesystem units <\@@chemicalunit,\@@chemicalunit> %
\startMPdrawing
- %input mp-tool ;
- %prologues := 1 ;
+ %input mp-tool ;
+ %prologues := 1 ;
u := 10*#1;
- bboxmargin := 0pt ;
- pickup pencircle scaled 2u ; % ???
+ bboxmargin := 0pt ;
+ pickup pencircle scaled 2u ; % ???
\stopMPdrawing
\fi}
@@ -581,10 +573,10 @@
d := 50u ; dd := 10u ;
draw (x1,0)--(x2,0) ;
draw (0,y1)--(0,y2) ;
- for i=d step -d until x1: draw (i,dd)--(i,-dd) ; endfor ;
- for i=d step d until x2: draw (i,dd)--(i,-dd) ; endfor ;
- for i=d step -d until y1: draw (-dd,i)--(dd,i) ; endfor ;
- for i=d step d until y2: draw (-dd,i)--(dd,i) ; endfor ;
+ for i=d step -d until x1: draw (i,dd)--(i,-dd) ; endfor ;
+ for i=d step d until x2: draw (i,dd)--(i,-dd) ; endfor ;
+ for i=d step -d until y1: draw (-dd,i)--(dd,i) ; endfor ;
+ for i=d step d until y2: draw (-dd,i)--(dd,i) ; endfor ;
\stopMPdrawing
\fi}
@@ -596,7 +588,7 @@
\setplotsymbol({\vrule\!!height\!!widtha\!!width\!!widtha})%
\fi}
-% Something for Dirk:
+% Something for Dirk:
\newcount \currentchemical
@@ -624,7 +616,7 @@
% {\bgroup
% \writestatus{ppchtex}{saving dimensions in ppchtex.dim}%
% \def\docommando##1##2##3%
-% {\immediate\write\scratchwrite
+% {\immediate\write\scratchwrite
% {\noexpand\setchemicaldimensions{##1}{##2}{##3}}}%
% \immediate\openout\scratchwrite=ppchtex.dim
% \scratchcounter=0
@@ -637,10 +629,10 @@
% \egroup}
%
%\def\loadchemicaldimensions% oh, how nice it would be to use
-% {\bgroup % one of the context read commands
+% {\bgroup % one of the context read commands
% \global\currentchemical=0
% \immediate\openin\scratchread=./ppchtex.dim
-% \ifeof\scratchread
+% \ifeof\scratchread
% \immediate\closein\scratchread
% \global\skipchemicalfalse
% \else
@@ -678,7 +670,7 @@
\ifnum\chemicaldrawingmode=2
\resetMPdrawing
\fi
- %
+ %
\doif{\@@chemicalvariant}{2}
{\@@setsecondchemicalplotsymbol}%
%
@@ -760,7 +752,7 @@
{-\the\!!counta}{\the\!!countb}
{-\the\!!countc}{\the\!!countd}}}%
\doifelse{\@@chemicaloptie}{\v!test}
- {\def\@@writechemicalstatus##1##2%
+ {\def\@@writechemicalstatus##1##2%
{\convertargument##2\to\ascii
\writestatus{##1}{\ascii}}}
{\def\@@writechemicalstatus##1##2{}}%
@@ -811,7 +803,7 @@
\fi
\dimen0=\ht0
\advance\dimen0 by \dp0
- \inchemicalfalse % enables \chemie{} in text
+ \inchemicalfalse % enables \chemie{} in text
\setbox4=\alignedchemical\themidtext
\setbox6=\alignedchemical\thetoptext
\setbox8=\alignedchemical\thebottext
@@ -824,8 +816,8 @@
\vss}% disables the depth
\wd0=0pt \wd4=0pt
\ht2=\ht0 \dp2=\dp0
- \ht4=\ht0 \dp4=\dp0
- %\setchemicaldimensions{\wd2}{\ht2}{\dp2}%
+ \ht4=\ht0 \dp4=\dp0
+ %\setchemicaldimensions{\wd2}{\ht2}{\dp2}%
\@@chemicalborder{\box0\box4\box2}% text on top of chemicals
\endgroup
%\fi
@@ -864,8 +856,8 @@
\checkchemicaldirection{#1}{#2}%
\!!counta=-\horchemical\edef\chemicalxoffset{\the\!!counta}%
\!!countb=-\verchemical\edef\chemicalyoffset{\the\!!countb}%
- \ifnum\chemicaldrawingmode=1
- % njet
+ \ifnum\chemicaldrawingmode=1
+ % njet
\else
\setcoordinatesystem point at {\the\horchemical} {\the\verchemical}
\fi}
@@ -875,8 +867,8 @@
\verchemical=0
\edef\chemicalxoffset{0}%
\edef\chemicalyoffset{0}%
- \ifnum\chemicaldrawingmode=1
- % njet
+ \ifnum\chemicaldrawingmode=1
+ % njet
\else
\setcoordinatesystem point at 0 0
\fi}
@@ -885,8 +877,8 @@
{%\writestatus{ppchtex}{restoring \the\horchemical,\the\verchemical}%
\edef\chemicalxoffset{\the\horchemical}%
\edef\chemicalyoffset{\the\verchemical}%
- \ifnum\chemicaldrawingmode=1
- % njet
+ \ifnum\chemicaldrawingmode=1
+ % njet
\else
\setcoordinatesystem point at {\the\horchemical} {\the\verchemical}
\fi}
@@ -993,9 +985,9 @@
\def\undochemicaloffset{}}%
\fi}
-\def\processchemicalphantom#1#2%
+\def\processchemicalphantom#1#2%
{\setbox0=\hbox
- {\def\splitoff##1????{##1}%
+ {\def\splitoff##1????{##1}%
$\@@dochemicalstyle{\@@localchemicalformat\splitoff#2}$}%
\dimen0=.25\wd0
\divide\dimen0 by \@@localchemicalscale
@@ -1052,15 +1044,15 @@
{\def\chemicalangle{#1}}
\def\dosetchemicalrotation#1#2%
- {\ifnum\chemicaldrawingmode=1
- % njet
+ {\ifnum\chemicaldrawingmode=1
+ % njet
\else
\startrotation by {#1} {#2} %% \stoprotation (t.b.v. testen)
\fi}
\def\doresetchemicalrotation%
- {\ifnum\chemicaldrawingmode=1
- % njet
+ {\ifnum\chemicaldrawingmode=1
+ % njet
\else
\stoprotation
\fi}
@@ -1095,22 +1087,22 @@
\setchemicallocation{}%
\else
\iffixedchemicaltext
- \!!counta=#2
+ \!!counta#2
\else
\!!counta=\chemicalrotation
- \advance\!!counta by -1
- \multiply\!!counta by #2
- \advance\!!counta by #1
+ \advance\!!counta -1
+ \multiply\!!counta #2
+ \advance\!!counta #1
\fi
\getfromcommalist[#3][\the\!!counta]%
\setchemicallocation\commalistelement
\fi
\ifchemicalpicture
- \let\chemicaltext=\relax
+ \let\chemicaltext\relax
\else
- \advance\txtchemical by 1
+ \advance\txtchemical 1
\getfromcommalist[#4][\txtchemical]%
- \let\chemicaltext=\commalistelement
+ \let\chemicaltext\commalistelement
\fi
\fi
\fixedchemicaltextfalse}
@@ -1290,7 +1282,7 @@
\or
% 3 : unrotated line
\put {\stoprotation \setcoordinatesystem point at 0 0
- \plot 0 0 {\!!counte} {\!!countf} /}
+ \plot 0 0 {\!!counte} {\!!countf} /}
[\chemicallineposition] at {\!!counta} {\!!countb}
\else
% 4 : dashed line
@@ -1348,7 +1340,7 @@
shifted z0 ;
\or
% 3 : unrotated line % nog \chemicalineposition: t/b
- draw (origin--z3)
+ draw (origin--z3)
shifted (z1 rotatedaround(origin,-\chemicalangle))
shifted z0 ;
\else
@@ -1380,7 +1372,7 @@
x2 := \MPdivten[\the\!!countc]u ;
y2 := \MPdivten[\the\!!countd]u ;
filldraw ((
- \ifnum\chemicalangle>180
+ \ifnum\chemicalangle>180
z1--z2
\else\ifnum\chemicalangle<90
z1--(z2 shifted (-2u,+2u))--(z2 shifted (+2u,-2u))
@@ -1425,7 +1417,7 @@
x2 := \MPdivten[\the\!!countc]u ;
y2 := \MPdivten[\the\!!countd]u ;
filldraw ((z1--(z2 rotatedaround(z1,5))--(z2 rotatedaround(z1,-5))
- --cycle) rotatedaround(origin,-\chemicalangle))
+ --cycle) rotatedaround(origin,-\chemicalangle))
shifted z0 ;
\stopMPdrawing
\account{#1}{#2}%
@@ -1543,7 +1535,7 @@
\startMPdrawing
x0 := \MPdivten[\chemicalxoffset]u ;
y0 := \MPdivten[\chemicalyoffset]u ;
- draw
+ draw
(((30.0u,0)--(50.0u,0){up}..(55.0u,7.5u)..
(60.0u,0)..(65.0u,-7.5u)..(70.0u,0)..
(75.0u,7.5u)..(80.0u,0)..(85.0u,-7.5u)..{up}
@@ -1587,10 +1579,10 @@
r := \MPdivten[#3]*2u;
x0 := \MPdivten[\chemicalxoffset]u ;
y0 := \MPdivten[\chemicalyoffset]u ;
- draw ((subpath (#1/45,#2/45) of (fullcircle scaled (r)))
+ draw ((subpath (#1/45,#2/45) of (fullcircle scaled (r)))
rotatedaround (origin,\chemicalangle+150))
shifted z0 \ifchemicaldotted dashed withdots \fi ;
- \stopMPdrawing
+ \stopMPdrawing
\fi
\egroup}
@@ -1659,7 +1651,7 @@
\@@beginchemicallocalpicture
% alternatief: gewoon accounting, en zelf l,r afhandelen
\ifnum\chemicaldrawingmode=1
- % njet
+ % njet
\else
\accountingon
\let\nomoreaccounting=\accountingoff
@@ -1671,7 +1663,7 @@
\def\skipchemical%
{\dodoubleargument\doskipchemical}
-\def\complexchemical% met \expandafter
+\def\complexchemical% met \expandafter
{\ifinchemical
\expandafter\dochemical
\else
@@ -1700,8 +1692,8 @@
\disablechemicalspecials
\unexpandedprocessallactionsinset
[#1]
- [ HIGH=>\sethighsubscripts,
- LOW=>\setlowsubscripts,
+ [ HIGH=>\sethighsubscripts,
+ LOW=>\setlowsubscripts,
PLUS=>\chemicalsign{+},
GIVES=>\chemicalsinglearrow{#2}{#3},
EQUILIBRIUM=>\chemicaldoublearrow{#2}{#3},
@@ -1727,7 +1719,7 @@
% \egroup}
\def\dosimplechemicalA#1#2#3% % evt: {#1,\relax}
- {\let\chemicalspace=\relax
+ {\let\chemicalspace=\relax
\@EA\dosimplechemical\@EA{\@@chemicalchemicaloffset,#1}{#2}{#3}%
\egroup}
@@ -1825,14 +1817,15 @@
\def\localdodochemical[#1][#2]%
{\@@writechemicalstatus{ppchtex}{[#1][#2]}%
%\bgroup % koppelen en afmetingen gaat fout, vandaar:
- \advance\levchemical by 1
+ \advance\levchemical 1
\letvalue{\??chemical\s!unknown\the\levchemical}\unknownchemical
\setevalue{\??chemical\c!tekst\the\levchemical}{\the\txtchemical}%
\txtchemical=0
\dodochemical[#1][#2]%
- \@EA\txtchemical\@EA\csname\??chemical\c!tekst\the\levchemical\endcsname
+ % \@EA\txtchemical\@EA\csname\??chemical\c!tekst\the\levchemical\endcsname
+ \txtchemical\csname\??chemical\c!tekst\the\levchemical\endcsname
\@EA\let\@EA\unknownchemical\csname\??chemical\s!unknown\the\levchemical\endcsname
- \advance\levchemical by -1
+ \advance\levchemical -1
%\egroup
\ignorespaces}
@@ -1880,7 +1873,7 @@
\def\dochemicaltop#1#2#3#4%
{\vbox
- {\@@dochemicalcolor
+ {\@@dochemicalcolor
\baselineskip=\chemicaltfraction\baselineskip \lineskip0pt
\halign
{#1###2\cr
@@ -1889,7 +1882,7 @@
\def\dochemicalbottom#1#2#3#4%
{\vtop
- {\@@dochemicalcolor
+ {\@@dochemicalcolor
\baselineskip=\chemicalbfraction\baselineskip \lineskip0pt
\halign
{#1###2\cr
@@ -1898,19 +1891,19 @@
\def\chemicalleft#1#2%
{\hbox
- {\@@dochemicalcolor
+ {\@@dochemicalcolor
$\@@dochemicalstyle{\scriptscriptstyle#1}$%
$\@@dochemicalstyle{\@@currentchemicalformat\hskip\chemicallfraction em#2}$}}
\def\chemicalright#1#2%
{\hbox
- {\@@dochemicalcolor
+ {\@@dochemicalcolor
$\@@dochemicalstyle{\@@currentchemicalformat#2\hskip\chemicalrfraction em}$%
$\@@dochemicalstyle{\scriptscriptstyle#1}$}}
\def\chemicalcentered#1%
{\setbox0=\hbox{$\@@dochemicalstyle{\scriptscriptstyle#1}$}%
- \setbox2=\hbox{$\@@dochemicalstyle{\@@currentchemicalformat C}$}%
+ \setbox2=\hbox{$\@@dochemicalstyle{\@@currentchemicalformat C}$}%
\dimen0=.5\ht2
\advance\dimen0 by -.5\ht0
\advance\dimen0 by \dp0
@@ -1918,13 +1911,13 @@
\def\chemicalleftcentered#1#2%
{\hbox
- {\@@dochemicalcolor
+ {\@@dochemicalcolor
\chemicalcentered{#1}%
$\@@dochemicalstyle{\@@currentchemicalformat\hskip\chemicallfraction em#2}$}}
\def\chemicalrightcentered#1#2%
{\hbox
- {\@@dochemicalcolor
+ {\@@dochemicalcolor
$\@@dochemicalstyle{\@@currentchemicalformat#2\hskip\chemicalrfraction em}$%
\chemicalcentered{#1}}}
@@ -1942,7 +1935,7 @@
\def\chemicalsmashedleft#1%
{\hbox\bgroup
- \@@dochemicalcolor
+ \@@dochemicalcolor
\setbox0=\hbox{$\@@dochemicalstyle{\@@currentchemicalformat C}$}%
\setbox2=\hbox{$\@@dochemicalstyle{\@@currentchemicalformat#1}$}%
\wd2=\wd0
@@ -1951,7 +1944,7 @@
\def\chemicalsmashedmiddle#1%
{\hbox\bgroup
- \@@dochemicalcolor
+ \@@dochemicalcolor
\setbox0=\hbox{$\@@dochemicalstyle{\@@currentchemicalformat C}$}%
\setbox2=\hbox{$\@@dochemicalstyle{\@@currentchemicalformat#1}$}%
\hbox{\hskip-.5\wd2\hskip.5\wd0\box2}
@@ -1959,7 +1952,7 @@
\def\chemicalsmashedright#1%
{\hbox\bgroup
- \@@dochemicalcolor
+ \@@dochemicalcolor
\setbox0=\hbox{$\@@dochemicalstyle{\@@currentchemicalformat C}$}%
\setbox2=\hbox{$\@@dochemicalstyle{\@@currentchemicalformat#1}$}%
\hbox to \wd0{\hskip-\wd2\hskip\wd0\box2}%
@@ -1970,7 +1963,7 @@
\def\chemicalforever#1#2%
{\bgroup
\setbox0=\hbox
- {\@@dochemicalcolor
+ {\@@dochemicalcolor
$\@@dochemicalstyle{\scriptscriptstyle\hskip-.15em#2}$}%
\wd0=0pt
\big#1_{\hskip.1em\box0}%
@@ -2055,7 +2048,7 @@
\@@chemicalpostponed}
{\getpredefinedchemical{#1}}]}
-\newcount\chemicalstack % tzt \newwounter
+\newcount\chemicalstack % tzt \newwounter
\setvalue{\s!chemical\c!x1}{0}
\setvalue{\s!chemical\c!y1}{0}
@@ -2099,7 +2092,7 @@
{\setbox0=\hbox{$#1+$}%
\raise\dp0\hbox{$#1#2$}}}
-\def\chemicalinnersign#1% todo: \@@chemicaltextcolor
+\def\chemicalinnersign#1% todo: \@@chemicaltextcolor
{\chemicalraise{\@@localchemicalstyle}{#1}}
\def\chemicaloutersign#1%
@@ -2108,14 +2101,14 @@
\def\chemicalsingleinnerarrow#1#2%
{\chemicalraise{\@@localchemicalstyle}{\longrightarrow}}
-\def\chemicaldoubleinnerarrow#1#2% todo: \@@chemicaltextcolor
+\def\chemicaldoubleinnerarrow#1#2% todo: \@@chemicaltextcolor
{\chemicalinnerclip
{\lower.2ex\hbox
{\setbox0=\hbox{$\@@localchemicalstyle\longrightarrow$}%
\setbox2=\hbox{$\@@localchemicalstyle\longleftarrow$}%
\wd0=0pt\raise\ht0\box0\box2}}}
-\def\chemicaltwintipinnerarrow#1#2% todo: \@@chemicaltextcolor
+\def\chemicaltwintipinnerarrow#1#2% todo: \@@chemicaltextcolor
{\chemicalinnerclip
{\setbox0=\hbox{\chemicalraise{\@@localchemicalstyle}{\longrightarrow}}%
\setbox2=\hbox{\chemicalraise{\@@localchemicalstyle}{\longleftarrow}}%
@@ -2184,7 +2177,7 @@
\def\chemicalsinglepicturearrow#1%
{\lower.5ex\hbox
- {\@@dochemicalstyle
+ {\@@dochemicalstyle
$\chemicalspace
\buildrel
\@@dochemicalstyle{\scriptstyle\quad#1\quad}%
@@ -2194,7 +2187,7 @@
\def\chemicaldoublepicturearrow#1%
{\lower.5ex\hbox
- {\@@dochemicalstyle
+ {\@@dochemicalstyle
$\chemicalspace
\buildrel
\@@dochemicalstyle{\scriptstyle\quad#1\quad}%
@@ -2209,11 +2202,11 @@
\def\somechemicalbond%
{\hrule width \wd0 height .4pt}
-\def\dochemicalbonds#1#2#3% todo: \@@chemicaltextletter
+\def\dochemicalbonds#1#2#3% todo: \@@chemicaltextletter
{{\setbox0=\hbox
{${\@@localchemicalstyle M}$}%
\vbox to \ht0
- {\@@dochemicalcolor
+ {\@@dochemicalcolor
\hsize\wd0
\vskip.1\wd0#1\vfill#2\vfill#3\vskip.1\wd0}}}
@@ -2604,7 +2597,7 @@ CCD##4##5=>\processchemicaldottsegment{CC}{##4##5},
\setchemicaltextelement ZN 468 350
\setchemicaltextelement RN 860 625 % 1.25 Z
\setchemicaltextelement RTN 785 728 % .12 / 103 75
- \setchemicaltextelement RBN 935 522
+ \setchemicaltextelement RBN 935 522
%
\def\processchemical[##1##2##3##4]%
{\processaction
@@ -2731,8 +2724,8 @@ RT##3##4=>\processchemicaltextelement{RN}{##3##4}{#1}{0}{},
%
\setchemicaltextelement ZN 589 350
\setchemicaltextelement RN 1083 625 % 1.25 Z
- \setchemicaltextelement RTN 1008 755 % .12 / 130 75
- \setchemicaltextelement RBN 1158 495
+ \setchemicaltextelement RTN 1008 755 % .12 / 130 75
+ \setchemicaltextelement RBN 1158 495
%
\def\processchemical[##1##2##3##4##5]%
{\processaction
@@ -2795,7 +2788,7 @@ RT##3##4##5=>\processchemicaltextelement{RN}{##3##4##5}{#1}{0}{},
Z##2##3##4##5=>\processchemicaltextelement{Z}{##2##3##4##5}{#1}{0}{},
\s!unknown=>\unknownchemical{##1##2##3##4##5}]}}
-\def\executechemicalSEVEN[#1]% incomplete !
+\def\executechemicalSEVEN[#1]% incomplete !
{\setchemicalname SEVEN
%
\setchemicalmaximum 7
@@ -2818,7 +2811,7 @@ RT##3##4##5=>\processchemicaltextelement{RN}{##3##4##5}{#1}{0}{},
\setchemicalangle 6 257.143 - - -
\setchemicalangle 7 308.571 - - -
%
- \setchemicaltranslate 1 - -
+ \setchemicaltranslate 1 - -
\setchemicaltranslate 2 - -
\setchemicaltranslate 3 - -
\setchemicaltranslate 4 - -
@@ -3238,7 +3231,7 @@ RT##3##4##5=>\processchemicaltextelement{RN}{##3##4##5}{#1}{0}{},
\putrule from {#1} {#2} to {#3} {#4}
\or
\psline(#1,#2)(#3,#4)%
- \or
+ \or
\bgroup
\!!counta=#1\!!countb=#2\!!countc=#3\!!countd=#4\relax
\global\MPdrawingdonetrue
@@ -3279,7 +3272,7 @@ RT##3##4##5=>\processchemicaltextelement{RN}{##3##4##5}{#1}{0}{},
\dimen0=\scratchcounter\dimen0
\vcenter to \dimen0{}
\dimen2=\@@chemicalunit
- \dimen2=\@@chemicalrechts\dimen0
+ \dimen2=\@@chemicalrechts\dimen0
\vcenter{\leftskip1em\hsize\dimen2\relax\strut#2\strut}%
\right.$]}%
@@ -3351,35 +3344,35 @@ RT##3##4##5=>\processchemicaltextelement{RN}{##3##4##5}{#1}{0}{},
\noalign{\vskip.5ex}%
$\@@dochemicalstyle{\@@localchemicalformat#2}$\cr}}}
-%D Here are a couple of \CONTEXT\ goodies:
+%D Here are a couple of \CONTEXT\ goodies:
%D
%D \startopsomming
-%D \som styles hooked into \CONTEXT\ style mechanism
+%D \som styles hooked into \CONTEXT\ style mechanism
%D \som support for color and rulethickness (mp mode only)
-%D \som position tracking
+%D \som position tracking
%D \stopopsoming
-\ifCONTEXT
+\ifCONTEXT
\def\setchemicalattributes
- {\scratchdimen\@@chemicalchemicallijndikte
+ {\scratchdimen\@@chemicalchemicallijndikte
\def\chemicalattributes
{withpen pencircle scaled \the\scratchdimen\space
- withcolor }%
+ withcolor }%
\doifelsenothing\@@chemicalchemicallijnkleur
{\edef\chemicalattributes{\chemicalattributes black}}
{\edef\chemicalattributes
{\chemicalattributes \MPcolor{\@@chemicalchemicallijnkleur}}}%
\startMPdrawing
- drawoptions (\chemicalattributes) ;
+ drawoptions (\chemicalattributes) ;
\stopMPdrawing}
\let\@@chemicalkleur\empty
-\def\@@dochemicalcolor
- {\doifsomething\@@chemicalkleur{\color[\@@chemicalkleur]}}
+\def\@@dochemicalcolor
+ {\doifsomething\@@chemicalkleur{\color[\@@chemicalkleur]}}
-\def\@@dochemicalstyle
+\def\@@dochemicalstyle
{\doconvertfont\@@chemicalletter}
\setupchemical
@@ -3394,6 +3387,6 @@ RT##3##4##5=>\processchemicaltextelement{RN}{##3##4##5}{#1}{0}{},
#2%
\egroup}
-\fi
+\fi
\protect \endinput
diff --git a/tex/context/base/regi-utf.tex b/tex/context/base/regi-utf.tex
index 0e33ebb58..2a441f19d 100644
--- a/tex/context/base/regi-utf.tex
+++ b/tex/context/base/regi-utf.tex
@@ -2,7 +2,7 @@
%D [ file=regi-utf,
%D version=2002.12.03,
%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=UTF-8,
+%D subtitle=UTF-8,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright=PRAGMA-ADE]
@@ -11,35 +11,35 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D This regime activates the characters $>192$ and let them
+%D This regime activates the characters $>192$ and let them
%D handle \UTF\ encoded content streams. This regime runs on
-%D top of the \type {unic} modules. We use an active inspector
+%D top of the \type {unic} modules. We use an active inspector
%D instead of a active token handler because here we don't want
%D the \type {{}}. We only support this in \ETEX.
\beginTEX
- \expandafter \endinput
+ \expandafter \endinput
\endTEX
-\unprotect
+\unprotect
\startregime[utf]
\dostepwiserecurse{192}{223}{1}
- {\expanded{\defineactiveinspector{\recurselevel} % space delimited
+ {\expanded{\defineactiveinspector{\recurselevel} % space delimited
{\noexpand\utftwouniglph{\recurselevel}}}%
}%\letvalue{\@@univector\recurselevel}\gobbleoneargument}
\dostepwiserecurse{224}{239}{1}
- {\expanded{\defineactiveinspector{\recurselevel} % space delimited
+ {\expanded{\defineactiveinspector{\recurselevel} % space delimited
{\noexpand\utfthreeuniglph{\recurselevel}}}%
}%\letvalue{\@@univector\recurselevel}\gobbetwoarguments}
\dostepwiserecurse{240}{247}{1}
- {\expanded{\defineactiveinspector{\recurselevel} % space delimited
+ {\expanded{\defineactiveinspector{\recurselevel} % space delimited
{\noexpand\utffouruniglph{\recurselevel}}}%
}%\letvalue{\@@univector\recurselevel}\gobblethreearguments}
\stopregime
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/s-abr-01.tex b/tex/context/base/s-abr-01.tex
index deed0a7f5..34cfa06df 100644
--- a/tex/context/base/s-abr-01.tex
+++ b/tex/context/base/s-abr-01.tex
@@ -8,8 +8,8 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
\unprotect
@@ -82,7 +82,7 @@
\logo [IBM] {ibm}
\logo [IMAGEMAGICK]{ImageMagick}
\logo [INRSTEX] {inrs\TeX}
-\logo [IRCNET] {IRCnet}
+\logo [IRCNET] {IRCnet}
\logo [JAVASCRIPT] {Java\-Script}
\logo [JAVA] {Java}
\logo [JPEG] {jpeg}
@@ -137,13 +137,14 @@
\logo [RELAXNG] {Relax\kern.125emNG}
\logo [RUBY] {Ruby}
\logo [RGB] {rgb}
+\logo [SCITE] {SciTE}
\logo [SGML] {sgml}
\logo [SI] {si}
\logo [SQL] {sql}
\logo [TABLE] {\TaBlE}
\logo [TCPIP] {tcp/ip}
-\logo [TDS] {tds} % no sc te
-\logo [TETEX] {te\TeX} % no sc te
+\logo [TDS] {tds} % no sc te
+\logo [TETEX] {te\TeX} % no sc te
\logo [TEXADRES] {\TeX adress}
\logo [TEXBASE] {\TeX base}
\logo [TEXEDIT] {\TeX edit}
@@ -167,13 +168,13 @@
\logo [TUGBOAT] {Tug\-Boat}
\logo [TUGNEWS] {Tug\-News}
\logo [TUG] {tug}
-\logo [UNICODE] {Uni\-code}
-\logo [UNIX] {unix}
+\logo [UNICODE] {Uni\-code}
+\logo [UNIX] {unix}
\logo [URI] {uri}
\logo [URL] {url}
\logo [USA] {usa}
-\logo [USENET] {usenet}
-\logo [UTF] {utf}
+\logo [USENET] {usenet}
+\logo [UTF] {utf}
\logo [WDT] {wdt}
\logo [WEBC] {web2c}
\logo [WEB] {web}
diff --git a/tex/context/base/s-fnt-02.tex b/tex/context/base/s-fnt-02.tex
new file mode 100644
index 000000000..5e7171a32
--- /dev/null
+++ b/tex/context/base/s-fnt-02.tex
@@ -0,0 +1,95 @@
+% output=pdftex modes=demo
+
+% nice example:
+%
+% \usemodule[s-fnt-02]
+%
+% \usetypescriptfile[type-ghz.tex]
+%
+% \usetypescript [sans] [optima,optima-nova] [texnansi]
+%
+% \setvariables
+% [glyphs]
+% [name-1=OptimaLT,
+% name-2=OptimaNovaLT-Regular]
+%
+% \starttext
+%
+% \setups[show-glyphs]
+%
+% \stoptext
+%
+% see end, for other example (or run texexec s-fnt-02 --mode=demo)
+
+\setvariables
+ [glyphs]
+ [frame=on,
+ name-1=cmr10,
+ name-2=cmtt10,
+ map-1=,
+ map-2=]
+
+\setuppapersize[S4][S4]
+
+\setupcolors[state=start]
+
+\setuplayout[page]
+
+\definecolor[Gray] [s=.2]
+\definecolor[ColorNone][s=1,t=.5,a=1]
+\definecolor[ColorOne] [r=1,t=.5,a=1]
+\definecolor[ColorTwo] [g=1,t=.5,a=1]
+\definecolor[BackOne] [b=1,t=.5,a=1]
+\definecolor[BackTwo] [r=1,g=1,t=.5,a=1]
+
+\setupbackgrounds
+ [page]
+ [background=color,
+ backgroundcolor=Gray]
+
+\startsetups[show-glyphs]
+
+ \doifnothing{\getvariable{glyphs}{name-1}}{\endinput}
+ \doifnothing{\getvariable{glyphs}{name-2}}{\endinput}
+
+ \doifsomething{\getvariable{glyphs}{map-1}}{\loadmapfile[\getvariable{glyphs}{map-1}]}
+ \doifsomething{\getvariable{glyphs}{map-2}}{\loadmapfile[\getvariable{glyphs}{map-2}]}
+
+ \definefont[FontOne][\getvariable{glyphs}{name-1} at 280pt]
+ \definefont[FontTwo][\getvariable{glyphs}{name-2} at 280pt]
+
+ \dostepwiserecurse{0}{255}{1}
+ {\doiffontcharelse{\getvariable{glyphs}{name-1}}{\recurselevel}
+ {\doiffontcharelse{\getvariable{glyphs}{name-2}}{\recurselevel}
+ {\startstandardmakeup
+ \boxrulewidth=2pt
+ \setbox 0=\hbox{\white\ruledhbox{\FontOne \char\recurselevel}}
+ \setbox 2=\hbox{\white\ruledhbox{\FontTwo \char\recurselevel}}
+ \setbox 4=\hbox{\FontOne \ColorOne \char\recurselevel}
+ \setbox 6=\hbox{\FontTwo \ColorTwo \char\recurselevel}
+ \setbox 8=\hbox{\BackOne \ruledhbox{\FontOne \phantom{\char\recurselevel}}}
+ \setbox10=\hbox{\BackTwo \ruledhbox{\FontTwo \phantom{\char\recurselevel}}}
+ \vfill
+ \doifelse{\getvariable{glyphs}{frame}}{on} % too many box calculations when off, but who cares
+ {\hbox{\dostepwiserecurse{0}{10}{2}{\hbox to \hsize{\hss\box\recurselevel\hss}\hskip-\hsize}}}
+ {\hbox{\dostepwiserecurse{4} {6}{2}{\hbox to \hsize{\hss\box\recurselevel\hss}\hskip-\hsize}}}
+ \vfill
+ \tttf
+ \setstrut
+ \hbox to \hsize{\strut\hss
+ {\ColorOne \getvariable{glyphs}{name-1}}\quad
+ {\ColorTwo \getvariable{glyphs}{name-2}}\quad
+ {\ColorNone char \recurselevel }\hss}
+ \stopstandardmakeup}
+ {}}
+ {}}
+
+\stopsetups
+
+\doifnotmode{demo}{\endinput}
+
+\starttext
+
+ \setups[show-glyphs]
+
+\stoptext \ No newline at end of file
diff --git a/tex/context/base/s-mod-01.tex b/tex/context/base/s-mod-01.tex
index bb901bf93..5bb42c988 100644
--- a/tex/context/base/s-mod-01.tex
+++ b/tex/context/base/s-mod-01.tex
@@ -8,20 +8,20 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
-%D This module looks like crap, is not documented, will
-%D change, and used to be called modu-*.tex.
+%D This module looks like crap, is not documented, will
+%D change, and used to be called modu-*.tex.
-\input s-mod-00.tex
+\usemodule[mod-00]
\unprotect
\setupbodyfont
[10pt,ams]
-\mainlanguage
+\mainlanguage
[en]
\setupwhitespace
@@ -68,7 +68,7 @@
\setupfootertexts
[\v!marge]
- [\tt\Modulefile][]
+ [\tt\Modulefile][]
\stopmode
@@ -76,8 +76,8 @@
\setupfootertexts
[\v!marge]
- [\tt\Modulefile][]
- [\tt\Modulefile][]
+ [\tt\Modulefile][]
+ [\tt\Modulefile][]
\stopnotmode
@@ -132,7 +132,7 @@
\startnotmode[color]
- \setupcolors
+ \setupcolors
[\c!conversie=\v!altijd]
\setuptyping
@@ -145,4 +145,4 @@
\c!kleur=,
\c!letter=]
-\protect \endinput
+\protect \endinput
diff --git a/tex/context/base/s-mod-02.tex b/tex/context/base/s-mod-02.tex
index c65bad451..6eabe7329 100644
--- a/tex/context/base/s-mod-02.tex
+++ b/tex/context/base/s-mod-02.tex
@@ -8,29 +8,29 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
-%D This module looks like crap, is not documented, will
-%D change, and used to be called modu-*.tex.
+%D This module looks like crap, is not documented, will
+%D change, and used to be called modu-*.tex.
% Macro's
-\input s-mod-00.tex
+\usemodule[mod-00]
-% todo: internationalize + setups
+% todo: internationalize + setups
\stelkopin[paragraaf][expansie=commando]
\def\complexmodule[#1]% redefined
- {\startglobaal % i.v.m. \bgroup in \startdocumentation
+ {\startglobaal % i.v.m. \bgroup in \startdocumentation
\getparameters[Module][#1]
- \stopglobaal % i.v.m. \bgroup in \startdocumentation
+ \stopglobaal % i.v.m. \bgroup in \startdocumentation
\paragraaf{\Modulesubtitle}
\SchrijfLijstenWeg}
\def\stopmodule% redefined
- {\pagina
+ {\pagina
\bepaalregisterkenmerken
[index]
[criterium=paragraaf]
@@ -119,7 +119,7 @@
\MaakLijstMetGroups
\plaatsinhoud[criterium=hoofdstuk,niveau=paragraaf]}
-% Layout
+% Layout
\stelkorpsin
[9pt,ams]
@@ -153,11 +153,14 @@
\stelsetupin
[verwijzing=3]
-\definieerkleur [texprettyone] [r=.8, g=0, b=0] % red
-\definieerkleur [texprettytwo] [r=0, g=.6, b=0] % green
+\definieerkleur [AchtergrondKleur] [s=.6]
+\definieerkleur [ButtonKleur] [r=.2,g=.2,b=.6]
+\definieerkleur [TekstKleur] [r=.6,g=.2,b=.2]
-\definieerkleur [AchtergrondKleur] [s=.5] % [r=1,g=1,b=.7]
-\definieerkleur [ButtonKleur] [s=.85] % [r=.1,g=.5,b=.8]
+\definieerkleur [colorprettyone] [r=.6,g=.0,b=.0] % red
+\definieerkleur [colorprettytwo] [r=.0,g=.6,b=.0] % green
+\definieerkleur [colorprettythree] [r=.0,g=.0,b=.6] % blue
+\definieerkleur [colorprettyfour] [r=.6,g=.6,b=.0] % yellow
\stelinteractiein
[status=start,
@@ -169,14 +172,14 @@
\stelachtergrondenin
[pagina]
[achtergrond=kleur,
- kleur=AchtergrondKleur,
- offset=2.5pt] % this offset influences the menus!
+ achtergrondkleur=AchtergrondKleur,
+ offset=2.5pt] % this offset influences the menus!
\stelachtergrondenin
[tekst,voet]
[tekst,linkermarge]
[achtergrond=kleur,
- kleur=wit]
+ achtergrondkleur=wit]
\stelsubpaginanummerin
[wijze=perparagraaf,
@@ -240,24 +243,24 @@
\def\TitelBlad#1%
{\startstandaardopmaak
- \definefont[GrootFont] [SansBold at 72pt]
- \definefont[MiddelFont][Sans at 32pt]
- \definefont[KleinFont] [Sans at 24pt]
+ \definefont[GrootFont] [SansBold at 72pt]
+ \definefont[MiddelFont][Sans at 32pt]
+ \definefont[KleinFont] [Sans at 24pt]
\startkleur[AchtergrondKleur]
- \vskip12pt
+ \vskip12pt
\regelmidden{\GrootFont\setstrut\strut Con\TeX t}
- \vskip24pt
- \regelmidden{\MiddelFont\setstrut\strut #1}
+ \vskip24pt
+ \regelmidden{\MiddelFont\setstrut\strut #1}
\vskip24pt
\regelmidden{\KleinFont\setstrut\strut Hans Hagen}
\vfilll
- \regelmidden{\KleinFont\setstrut\strut PRAGMA ADE}
- \vskip24pt
+ \regelmidden{\KleinFont\setstrut\strut PRAGMA ADE}
+ \vskip24pt
\regelmidden{\KleinFont\setstrut\strut www.pragma-ade.nl --- \currentdate}
- \vskip12pt
+ \vskip12pt
\stopkleur
\stopstandaardopmaak}
-
+
\def\ColofonBlad%
{\startmode[atpragma]
\pagina
@@ -271,9 +274,9 @@
\PlaatsPragmaLogo[ADE]
\vfill
\startsmaller[3*midden]
- This is the official documentation of \CONTEXT\ version
+ This is the official documentation of \CONTEXT\ version
\kenmerkdatum, a \TEX\ macropackage developed by J.~Hagen
- \& A.F.~Otten, who both hold the copyrights.
+ \& A.F.~Otten, who both hold the copyrights.
\stopsmaller
\vfill
\pagina
@@ -297,40 +300,39 @@
\stellijstin
[FileNames]
[commando=\FileNameEntry,
+ na=\endgraf,
variant=geen]
\stellijstin
[FileGroups]
[commando=\FileGroupEntry,
- na=\hss,
+ na=\hss,
variant=geen]
\def\FileNameEntry#1#2#3%
- {\strut\hbox{#2}}
+ {\strut\hbox{#2}\endgraf}
\def\FileGroupEntry#1#2#3%
- {\strut#2}
+ {\strut#2\endgraf}
\def\MaakLijstMetItems%
{\setbox\LijstMetItems=\vbox
{\ss\bf
- \stelinteractiein[kleur=ButtonKleur]
- \plaatslijst[GroupItems][criterium=hoofdstuk]}}
+ \plaatslijst[GroupItems][kleur=ButtonKleur,contrastkleur=wit,criterium=hoofdstuk]}}
\def\MaakLijstMetNames%
- {\setbox\LijstMetNames=\vbox
+ {\setbox\LijstMetNames=\vbox
{\hsize\rechterrandbreedte
- \ss\bf\stelinterliniein
- \stelinteractiein[kleur=ButtonKleur]
+ \ss\bf\stelinterliniein
\startsimplecolumns[afstand=10pt]
- \plaatslijst[FileNames][criterium=hoofdstuk]
+ \plaatslijst[FileNames][kleur=ButtonKleur,contrastkleur=wit,criterium=hoofdstuk]
\stopsimplecolumns}}
\def\MaakLijstMetGroups%
{\setbox\LijstMetGroups=\hbox to \tekstbreedte
{\ss\bf
\stelinteractiein[kleur=ButtonKleur]%
- \plaatslijst[FileGroups][criterium=alles]\unskip\unskip}}
+ \plaatslijst[FileGroups][kleur=ButtonKleur,contrastkleur=wit,criterium=alles]\unskip\unskip}}
\setbox\LijstMetGroups=\hbox{}
@@ -344,6 +346,7 @@
[status=start,
kader=uit,
kleur=AchtergrondKleur,
+ contrastkleur=wit,
letter=\ss\bf,
hoogte=15pt,
offset=0pt,
@@ -353,7 +356,7 @@
\startinteractiemenu[rechts]
\boxofsize \vbox \teksthoogte \voetafstand \voethoogte 5pt
- \bgroup
+ \bgroup
\copy\LijstMetNames
\vfill
\but [\FileGroup:inhoud] local contents \\
@@ -396,7 +399,7 @@
\stelvoettekstenin
[marge]
[\tt\Modulefile]
- []
+ []
\stelvoettekstenin
[tekst]
@@ -408,4 +411,4 @@
\steltolerantiein
[zeersoepel]
-\endinput
+\endinput \ No newline at end of file
diff --git a/tex/context/base/setupb.tex b/tex/context/base/setupb.tex
index 3822dad26..4dfda5fa1 100644
--- a/tex/context/base/setupb.tex
+++ b/tex/context/base/setupb.tex
@@ -814,9 +814,21 @@
[\c!oneargument!]
[]
\variable
+ [\c!tekstcommando]
+ [\c!oneargument!]
+ []
+ \variable
[\c!splitsen]
[\v!soepel,\v!streng,\v!zeerstreng,\c!number!]
[\v!soepel]
+ \variable
+ [\c!tekstletter]
+ [\v!normaal,\v!vet,\v!schuin,\v!vet\v!schuin,\v!type,\v!kap,\v!klein...,\c!command!]
+ []
+ \variable
+ [\c!tekstkleur]
+ [\c!identifier!]
+ []
\inheritvariables
[\y!framed]
[]
@@ -3255,7 +3267,7 @@
[]
\variable
[\c!markering]
- [\v!aan,\v!uit,\v!kleur,\v!raster]
+ [\v!aan,\v!uit,\v!kleur,\v!raster,\v!tekst]
[\v!uit]
\variable
[\c!plaats]
@@ -5420,6 +5432,10 @@
[\c!onbekendeverwijzing]
[\v!leeg,\v!geen]
[\v!leeg]
+ \variable
+ [\c!variant]
+ [a,b,A,B]
+ [a]
\stopsetup
\startsetup
@@ -7446,6 +7462,10 @@
[\c!rotatie]
[\c!number!]
[90]
+ \variable
+ [\c!plaats]
+ [\v!normaal,\v!hoog,\v!passend,\v!ruim,\v!diepte]
+ [\v!normaal]
\inheritvariables
[\y!setupframed]
[]
diff --git a/tex/context/base/spec-dvi.tex b/tex/context/base/spec-dvi.tex
index 78fb734f4..150d4bdb1 100644
--- a/tex/context/base/spec-dvi.tex
+++ b/tex/context/base/spec-dvi.tex
@@ -8,24 +8,24 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
\unprotect
%D \macros
-%D {dostartobject,
+%D {dostartobject,
%D dostopobject,
%D doinsertobject}
%D
-%D Reuse of object is not supported by the \DVI\ format. We
-%D therefore just duplicate them using boxes.
+%D Reuse of object is not supported by the \DVI\ format. We
+%D therefore just duplicate them using boxes.
\startspecials[tex]
\newbox\DVIobjects \newcounter\DVIobjectcounter
-\definespecial\dostartobject#1#2#3#4#5%
+\definespecial\dostartobject#1#2#3#4#5%
{\setbox\nextbox=\vbox\bgroup
\def\dodostopobject%
{\egroup
@@ -37,7 +37,7 @@
\setbox\nextbox\hbox{\box\nextbox}
\wd\nextbox\zeropoint
\dp\nextbox\zeropoint
- \ht\nextbox=\!!onepoint
+ \ht\nextbox\onepoint
\allowbreak
\box\nextbox}%
\dosetobjectreference{#1}{#2}{\DVIobjectcounter}}}
@@ -51,10 +51,10 @@
\splittopskip\zeropoint
\setbox0=\copy\DVIobjects
\dimen0=\DVIobjectreference pt
- \advance\dimen0 -\!!onepoint
+ \advance\dimen0 -\onepoint
\setbox2=\vsplit0 to \dimen0
- \ifdim\ht0>\!!onepoint
- \setbox0=\vsplit0 to \!!onepoint
+ \ifdim\ht0>\onepoint
+ \setbox0\vsplit0 to \onepoint
\fi
\unvbox0\setbox0=\lastbox\unhbox0
\egroup}
@@ -64,24 +64,24 @@
%D dosetpositionwhd,
%D dosetpositionplus}
%D
-%D The next specials only identify a position. It is up to
+%D The next specials only identify a position. It is up to
%D a \DVI\ postprocessing utility to merge the right commands
-%D into the utility file. Since in \CONTEXT, we only deal
-%D with relative positions, the reference point is not so
-%D important.
+%D into the utility file. Since in \CONTEXT, we only deal
+%D with relative positions, the reference point is not so
+%D important.
+%D
+%D The postprocessor should translate the specials into
+%D commands and append these to \type {jobname.tuo} using the
+%D format:
%D
-%D The postprocessor should translate the specials into
-%D commands and append these to \type {jobname.tuo} using the
-%D format:
-%D
%D \starttypen
-%D \pospxy {identifier}{page}{x}{y}
+%D \pospxy {identifier}{page}{x}{y}
%D \pospxywhd {identifier}{page}{x}{y}{w}{h}{d}
%D \pospxyplus{identifier}{page}{x}{y}{w}{h}{d}{list}
%D \stoptypen
-%D
-%D The postprocessor should, of course, provide the \type
-%D {page}, \type {x}, and \type {y} values.
+%D
+%D The postprocessor should, of course, provide the \type
+%D {page}, \type {x}, and \type {y} values.
\definespecial\dosetposition#1%
{\special{pos:pxy "#1"}}
@@ -92,8 +92,8 @@
\definespecial\dosetpositionplus#1#2#3#4#5%
{\special{pos:pxyplus "#1" #2 #3 #4 #5}}
-%D The next special tells the position postprocessor what
-%D page dimensions were used.
+%D The next special tells the position postprocessor what
+%D page dimensions were used.
\let\flushDVIpositionpapersize\relax
@@ -101,14 +101,14 @@
% {\xdef\flushDVIpositionpapersize%
% {\special{pos:papersize #1 #2}%
% \global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}}
-%
+%
% \appendtoksonce
% \ifspecialbasedsettings
% \ifpositioning\installprogram{dvipos \jobname}\fi
% \fi
% \to \everystoptext
%
-% less tokens:
+% less tokens:
\definespecial\dosetpositionpapersize#1#2%
{\xdef\flushDVIpositionpapersize%
diff --git a/tex/context/base/spec-fdf.tex b/tex/context/base/spec-fdf.tex
index 7b6a4b6fc..993d60235 100644
--- a/tex/context/base/spec-fdf.tex
+++ b/tex/context/base/spec-fdf.tex
@@ -914,7 +914,7 @@
\def\doPDFfilestreamobject class #1 name #2 file #3 source #4%
{}
-\def\doPDFattachfile#1#2#3#4#5#6#7#8%
+\def\doPDFattachfile#1#2#3#4#5#6#7#8%
{\bgroup % title width height color symbol file
\edef\PDFfile{#8}\convertcommand\PDFfile\to\PDFfile
% beware: the symbol may (indirectly) use the file
@@ -2084,7 +2084,7 @@
\def\enablePDFdocencoding
{\enablecoding[pdfdoc]
- \enablelanguagespecifics[\currentlanguage]% redundant ?
+ \enablelanguagespecifics[\currentlanguage]% redundant ?
\simplifycommands}
\long\def\sanitizePDFdocencoding#1\to#2%
@@ -2435,14 +2435,53 @@
%D four elements of the transform matrix. We only support some
%D fixed angles. The \type{q}'s take care of grouping.
-\def\doPDFstartrotation#1%
+% The original:
+%
+% \def\doPDFstartrotation#1%
+% {\PDFcode{q}%
+% \processaction
+% [#1]
+% [ 90=>\PDFcode{ 0 1 -1 0 0 0 cm},
+% 180=>\PDFcode{-1 0 0 -1 0 0 cm},
+% 270=>\PDFcode{ 0 -1 1 0 0 0 cm},
+% 360=>\PDFcode{ 1 0 0 1 0 0 cm}]}
+%
+% We cannot directly pass an angle, but have to calculate
+% factors (rx and ry). As in the \METAPOST\ to \PDF\
+% converter module we need to compensate the deformation
+% by setting (sx and sy).
+%
+% Optimized but bigger:
+%
+% \def\doPDFstartrotation#1%
+% {\PDFcode{q}%
+% \processaction
+% [#1]
+% [ 0=>\PDFcode{ 1 0 0 1 0 0 cm},
+% 90=>\PDFcode{ 0 1 -1 0 0 0 cm},
+% 180=>\PDFcode{-1 0 0 -1 0 0 cm},
+% 270=>\PDFcode{ 0 -1 1 0 0 0 cm},
+% 360=>\PDFcode{ 1 0 0 1 0 0 cm},
+% #1=>%\calculatecos{#1}% already calculated in core macro
+% %\calculatesin{#1}% already calculated in core macro
+% \edef\cos{\calculatedcos{#1}}%
+% \edef\sin{\calculatedsin{#1}}%
+% \PDFcode{\cos \space % cos
+% \sin \space % sin
+% \negated\sin\space % -sin
+% \cos \space % cos
+% 0 0 cm}]}
+%
+% Since the sine and cosine values are preset and rounded we
+% can use the next alternative without running into inaccuracies.
+
+\def\doPDFstartrotation#1% grouped
{\PDFcode{q}%
- \processaction
- [#1]
- [ 90=>\PDFcode{ 0 1 -1 0 0 0 cm},
- 180=>\PDFcode{-1 0 0 -1 0 0 cm},
- 270=>\PDFcode{ 0 -1 1 0 0 0 cm},
- 360=>\PDFcode{ 1 0 0 1 0 0 cm}]}
+ \calculatecos{#1}% already calculated in core macro
+ \calculatesin{#1}% already calculated in core macro
+ \edef\cos{\calculatedcos{#1}}%
+ \edef\sin{\calculatedsin{#1}}%
+ \PDFcode{\cos\space\sin\space\negated\sin\space\cos\space0 0 cm}}
\def\doPDFstoprotation
{\PDFcode{Q}}
@@ -2602,24 +2641,24 @@
{\ifx\PDFtextlayers\empty \else
\driverreferenced \doPDFarrayobject class PDF name textlayers data {\PDFtextlayers}%
\doPDFgetobjectreference{PDF}{textlayers}\!!stringa
- \ifx\PDFhidelayers\empty
+ \ifx\PDFvidelayers\empty
\def\!!stringb{[null]}%
\else
- \driverreferenced \doPDFarrayobject class PDF name hidelayers data {\PDFhidelayers}%
- \doPDFgetobjectreference{PDF}{hidelayers}\!!stringb
+ \driverreferenced \doPDFarrayobject class PDF name videlayers data {\PDFvidelayers}%
+ \doPDFgetobjectreference{PDF}{videlayers}\!!stringb
\fi
- \ifx\PDFvidelayers\empty
+ \ifx\PDFhidelayers\empty
\def\!!stringc{[null]}%
\else
- \driverreferenced \doPDFarrayobject class PDF name videlayers data {\PDFvidelayers}%
- \doPDFgetobjectreference{PDF}{videlayers}\!!stringc
+ \driverreferenced \doPDFarrayobject class PDF name hidelayers data {\PDFhidelayers}%
+ \doPDFgetobjectreference{PDF}{hidelayers}\!!stringc
\fi
\doPDFaddtocatalog
{/OCProperties
<< % display in menu
/D << /Order \!!stringa
- /On \!!stringb
- /Off \!!stringc >>
+ /ON \!!stringb
+ /OFF \!!stringc >>
% used properties
/OCGs \!!stringa >>}%
\globallet\flushPDFtextlayers\relax
diff --git a/tex/context/base/spec-tpd.tex b/tex/context/base/spec-tpd.tex
index bf062854b..ed8ae3ac1 100644
--- a/tex/context/base/spec-tpd.tex
+++ b/tex/context/base/spec-tpd.tex
@@ -11,15 +11,15 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-% method = auto
+% method = auto
%
% \definefileinsertion{tpd}{auto}#1#2#3#4#5#6#7#8#9%
-% {\executesystemcommand{t:/ruby/pstopdf.rb #2}%
+% {\executesystemcommand{t:/ruby/pstopdf.rb #2}%
% \dodoinsertfile{tpd}{pdf}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}
-
+
% \let\PDFdestvoffset\zeropoint
% \newbox\pdfdestbox
-%
+%
% \def\doPDFdestination name #1%
% {\ifdim\PDFdestvoffset=\zeropoint\relax
% \pdfdest name {#1}\PDFpageviewkey
@@ -29,7 +29,7 @@
% \ht\pdfdestbox\zeropoint
% \box\pdfdestbox
% \fi}
-%
+%
% \def\PDFdestvoffset{2\lineheight} % {1.5\strutht}
%D \macros
@@ -88,20 +88,32 @@
\newcount\pdflastximagepages \pdflastximagepages=1
\fi
-%D And:
+%D And:
-\ifx\pdfpageresources\undefined
+\ifx\pdfpageresources\undefined
\newtoks\pdfpageresources
\fi
%D In order to get high quality \METAPOST\ inclusion, we set
-%D the number of digits to~5 (prevents rounding errors).
+%D the number of digits to~5 (prevents rounding errors).
\ifx\pdfdecimaldigits\undefined
\newcount\pdfdecimaldigits
\fi
-\pdfdecimaldigits=5
+\pdfdecimaldigits=5
+
+\ifx\pdfoptionpdfinclusionerrorlevel\undefined
+ \newcount\pdfoptionpdfinclusionerrorlevel
+\fi
+
+\pdfoptionpdfinclusionerrorlevel=0
+
+\ifx\pdfoptionpdfminorversion\undefined
+ \newcount\pdfoptionpdfminorversion
+\fi
+
+\pdfoptionpdfminorversion=4
% %D Why are the Acrobat viewers so buggy? To prevent font cache
% %D mismatches, we say:
@@ -210,8 +222,8 @@
\definefileinsertion{tpd}{mps}#1#2#3#4#5#6#7#8#9%
{\hbox
{%\convertMPcolors{#1}% plugged in supp-mpe
- \scratchdimen#3\s!pt \PointsToReal{.01\scratchdimen}\xscale
- \scratchdimen#4\s!pt \PointsToReal{.01\scratchdimen}\yscale
+ \scratchdimen#3\points \PointsToReal{.01\scratchdimen}\xscale
+ \scratchdimen#4\points \PointsToReal{.01\scratchdimen}\yscale
\convertMPtoPDF{#1}\xscale\yscale
\global\let\PDFimagereference\empty}}
@@ -477,7 +489,7 @@
%D \macros
%D {dostarttransparency,dostoptransparency}
%D
-%D For transparency, we need to implement a couple of
+%D For transparency, we need to implement a couple of
%D auxiliary macros. If needed, we will generalize tham later.
\definespecial\dostarttransparency{\doPDFstarttransparency}
@@ -487,24 +499,24 @@
\def\@@PDT{@PDT@}
-\newcount\PDFcurrenttransparency \PDFcurrenttransparency=0 % -1
+\newcount\PDFcurrenttransparency \PDFcurrenttransparency=0 % -1
\def\assignPDFtransparency#1#2%
{\def\PDFtransparencyidentifier{/Tr#1}%
- \def\PDFtransparencyreference{#2 0 R}}
+ \def\PDFtransparencyreference{#2 0 R}}
-\def\presetPDFtransparency#1#2%
- {\initializePDFtransparency
+\def\presetPDFtransparency#1#2%
+ {\initializePDFtransparency
\executeifdefined{\@@PDT#1:#2}{\dopresetPDFtransparency{#1}{#2}}}
-\def\dopresetPDFtransparency#1#2%
+\def\dopresetPDFtransparency#1#2%
{\global\advance\PDFcurrenttransparency \plusone
\immediate\pdfobj{\PDFtransparancydictionary{#1}{#2}{}}%
\edef\PDFtransparencyidentifier{/Tr\the\PDFcurrenttransparency}%
\edef\PDFtransparencyreference {\the\pdflastobj\space 0 R}%
\setxvalue{\@@PDT#1:#2}%
{\noexpand\assignPDFtransparency{\the\PDFcurrenttransparency}{\the\pdflastobj}}%
- \appendtoPDFdocumentextgstates
+ \appendtoPDFdocumentextgstates
{\PDFtransparencyidentifier\space
\PDFtransparencyreference\space}}
@@ -730,11 +742,11 @@
\def\dodostopobject
{\egroup
\ifx\PDFimagereference\empty
- % We also flush page resources, since shared
- % resources end up there; otherwise transparencies
- % won't work in xforms; some day I will optimize
- % this.
- \immediate\pdfxform
+ % We also flush page resources, since shared
+ % resources end up there; otherwise transparencies
+ % won't work in xforms; some day I will optimize
+ % this.
+ \immediate\pdfxform
resources {\currentPDFresources\the\pdfpageresources}%
\nextbox
\global\let\currentPDFresources\empty
@@ -866,10 +878,10 @@
% \pdfsavepos
% \doTPDsetposition
% \egroup}
-%
+%
% \definespecial\dosetposition#1%
% {\doTPDsetposition{\pospxy}{#1}{}}
-%
+%
% \definespecial\dosetpositionwhd#1#2#3#4%
% {\doTPDsetposition{\pospxywhd}{#1}{{#2}{#3}{#4}}}
@@ -918,14 +930,14 @@
\newif\ifsharePDFactions \sharePDFactionstrue
-% hm, due to some stupid optimization this feature has been
-% disabled for some time, watch out \lastPDFaction is to be
+% hm, due to some stupid optimization this feature has been
+% disabled for some time, watch out \lastPDFaction is to be
% persistent
\ifnum\pdftexversion>13
\def\doPDFaction width #1 height #2 action #3%
- {\ifcollectreferenceactions
+ {\ifcollectreferenceactions
\xdef\lastPDFaction{#3}%
\else
\ifsharePDFactions
@@ -935,7 +947,7 @@
\immediate\pdfobj{<<#3>>}%
\xdef\lastPDFaction{\the\pdflastobj\space0 R}%
\else
- % leave \lastPDFaction untouched
+ % leave \lastPDFaction untouched
\fi
\else
\xdef\lastPDFaction{<<#3>>}%
@@ -948,11 +960,11 @@
/A \lastPDFaction}%
\fi}
- % less #2 passing
-
+ % less #2 passing
+
\def\doPDFaction width #1 height #2 action #3%
{\xdef\lastPDFcontent{#3}%
- \ifcollectreferenceactions
+ \ifcollectreferenceactions
\global\let\lastPDFaction\lastPDFcontent
\else
\ifsharePDFactions
@@ -962,7 +974,7 @@
\immediate\pdfobj{<<\lastPDFcontent>>}%
\xdef\lastPDFaction{\the\pdflastobj\space0 R}%
\else
- % leave \lastPDFaction untouched
+ % leave \lastPDFaction untouched
\fi
\else
\xdef\lastPDFaction{<<\lastPDFcontent>>}%
@@ -978,7 +990,7 @@
\else
\def\doPDFaction width #1 height #2 action #3%
- {\ifcollectreferenceactions
+ {\ifcollectreferenceactions
\xdef\lastPDFaction{#3}%
\else
\ifsharePDFactions
@@ -988,7 +1000,7 @@
\immediate\pdfobj{<<#3>>}%
\xdef\lastPDFaction{\the\pdflastobj\space0 R}%
\else
- % leave \lastPDFaction untouched
+ % leave \lastPDFaction untouched
\fi
\else
\xdef\lastPDFaction{<<#3>>}%
@@ -1139,9 +1151,9 @@
\appendtoPDFdocumentextgstates{/GSpositive \the\pdflastobj\space0 R}%
\global\let\initializePDFnegative\relax}
-%D File embedding. Storing the stream identifier is needed
-%D to get access to the number. When typeset, the user can
-%D use feed this number to \type {pdftosrc} and filter the
+%D File embedding. Storing the stream identifier is needed
+%D to get access to the number. When typeset, the user can
+%D use feed this number to \type {pdftosrc} and filter the
%D file from the \PDF\ file.
\let\PDFlaststreamobject\s!unknown
@@ -1153,7 +1165,7 @@
\doPDFdictionaryobject class {#1} name {#2} data
{/Type /Filespec /F (#3) /EF <</F \PDFlaststreamobject\space0 R>>}}
-\def\doPDFfilestreamidentifier#1%
+\def\doPDFfilestreamidentifier#1%
{\doifsomething{#1}
{\doPDFgetobjectreference{PDFFS}{#1}\PDFobjectreference
\@EA\beforesplitstring\PDFobjectreference\at{ }\to\PDFlaststreamobject
diff --git a/tex/context/base/supp-box.tex b/tex/context/base/supp-box.tex
index a0e26d29e..9a8e36874 100644
--- a/tex/context/base/supp-box.tex
+++ b/tex/context/base/supp-box.tex
@@ -19,38 +19,40 @@
\unprotect
-%D First a couple of hacks to make this module loadable
-%D in plain \TEX.
+% watch this: \setbox4\emptybox \wd4\onepoint \the\wd4, no dimensions for void
-\ifx\myalloc@\undefined % seems like we're not in context
- \def\newbox{\alloc@4\box\chardef\insc@unt}
-\fi
+%D First a couple of hacks to make this module loadable
+%D in plain \TEX.
+
+\ifx\myalloc@\undefined % seems like we're not in context
+ \def\newbox{\alloc@4\box\chardef\insc@unt}
+\fi
\ifx \scratchbox\undefined \newbox \scratchbox \fi
\ifx\globalscratchbox\undefined \newbox\globalscratchbox \fi
-\ifx\normalhbox \undefined \let\normalhbox \hbox \fi
-\ifx\normalvbox \undefined \let\normalvbox \vbox \fi
-\ifx\normalvtop \undefined \let\normalvtop \vtop \fi
-\ifx\normalvcenter\undefined \let\normalvcenter\vcenter \fi
+\ifx\normalhbox \undefined \let\normalhbox \hbox \fi
+\ifx\normalvbox \undefined \let\normalvbox \vbox \fi
+\ifx\normalvtop \undefined \let\normalvtop \vtop \fi
+\ifx\normalvcenter\undefined \let\normalvcenter\vcenter \fi
%D \macros
%D {strutdp,strutht,strutwd}
%D
-%D The next shortcuts save memory and keying. The width is
-%D normally zero points (if not, you're in trouble). These
-%D shortcuts can be used like a dimension, opposite to the
-%D core macros \type {\strutdepth} and alike, which are
+%D The next shortcuts save memory and keying. The width is
+%D normally zero points (if not, you're in trouble). These
+%D shortcuts can be used like a dimension, opposite to the
+%D core macros \type {\strutdepth} and alike, which are
%D values.
\def\strutdp{\dp\strutbox}
\def\strutht{\ht\strutbox}
-\def\strutwd{\wd\strutbox}
+\def\strutwd{\wd\strutbox}
%D \macros
%D {resetbox, emptybox}
%D
-%D Let's start with an easy one. The next macro hides the
+%D Let's start with an easy one. The next macro hides the
%D ugly \type {@} in \type {\voidb@x}.
\def\emptybox {\box\voidb@x}
@@ -95,8 +97,8 @@
{\ht#1\zeropoint
\dp#1\zeropoint}
-%D The next implementation is less sensitive for spurious
-%D spaces.
+%D The next implementation is less sensitive for spurious
+%D spaces.
\newcount\registercount
@@ -153,7 +155,7 @@
%
% The best:
-\def\dosomesmash#1% (begin|end)group ipv (b|e)group ?
+\def\dosomesmash#1% (begin|end)group ipv (b|e)group ?
{\bgroup\dowithnextbox{#1\nextbox\flushnextbox\egroup}}
\def\hsmash {\dosomesmash\hsmashbox\normalhbox}
@@ -161,14 +163,14 @@
\def\hsmashed{\dosomesmash\smashbox \normalhbox}
\def\vsmashed{\dosomesmash\smashbox \normalvbox}
-%D \macros
+%D \macros
%D {smashedhbox,smashedvbox}
-%D
-%D Also handy (all dimensions zeroed):
-%D
+%D
+%D Also handy (all dimensions zeroed):
+%D
%D \starttypen
-%D \smashedhbox to ... {...}
-%D \smashedvbox to ... {...}
+%D \smashedhbox to ... {...}
+%D \smashedvbox to ... {...}
%D \stoptypen
\def\dosmashedbox#1%
@@ -178,12 +180,12 @@
\def\smashedhbox{\dosmashedbox\hbox}
\def\smashedvbox{\dosmashedbox\vbox}
-%D \macros
+%D \macros
%D {smash}
%D
-%D This smash alternative takes an optional arg [whdtb] as
-%D well as is potentially catcode safer. It is needed by the
-%D math module (although the \type {\leavevmode} is not added
+%D This smash alternative takes an optional arg [whdtb] as
+%D well as is potentially catcode safer. It is needed by the
+%D math module (although the \type {\leavevmode} is not added
%D here).
\def\smash
@@ -192,7 +194,7 @@
\def\dosmash
{\ifx\nexttoken[\@EA\dodosmash\else\@EA\donosmash\fi}
-\def\donosmash
+\def\donosmash
{\dodosmash[hd]}
\def\dodosmash[#1]%
@@ -208,17 +210,17 @@
\fi\fi
\next}
-\def\mathsm@sh#1#2% redefined plain macro
+\def\mathsm@sh#1#2% redefined plain macro
{\finsm@sh{$\m@th#1{#2}$}}
-\def\makesm@sh#1% redefined plain macro (handles t b h d w)
+\def\makesm@sh#1% redefined plain macro (handles t b h d w)
{\if#1w\nextboxwd\zeropoint\else
\if#1h\nextboxht\zeropoint\else
\if#1d\nextboxdp\zeropoint\else
\if#1t\nextboxht\zeropoint\else
\if#1b\nextboxdp\zeropoint\fi\fi\fi\fi\fi}
-\def\finsm@sh % redefined plain macro
+\def\finsm@sh % redefined plain macro
{\dowithnextbox
{\@EA\handletokens\@@smash\with\makesm@sh\flushnextbox}\normalhbox}
@@ -231,9 +233,9 @@
%D \stoptabulatie
%D \macros
-%D {phantom, hphantom, vphantom, mathstrut}
+%D {phantom, hphantom, vphantom, mathstrut}
%D
-%D The next implementation of \type {\phantom} cum suis does
+%D The next implementation of \type {\phantom} cum suis does
%D not grab an argument in the non||math case, which is better.
\def\phantom {\ph@nt\nextbox\nextbox\nextbox}
@@ -241,8 +243,8 @@
\def\hphantom{\ph@nt\voidb@x\voidb@x\nextbox}
%D Due to a complicated call to \type {\mathpallete} and
-%D thereby \type {\mathchoice}, the next macro looks ugly.
-%D We also take care of non||braced arguments.
+%D thereby \type {\mathchoice}, the next macro looks ugly.
+%D We also take care of non||braced arguments.
\def\ph@nt#1#2#3%
{\def\doph@nt
@@ -268,12 +270,12 @@
% used in table
%
-% \let\ifv@\undefined \let\v@true\undefined \let\v@false\undefined
-% \let\ifh@\undefined \let\h@true\undefined \let\h@false\undefined
+% \let\ifv@\undefined \let\v@true\undefined \let\v@false\undefined
+% \let\ifh@\undefined \let\h@true\undefined \let\h@false\undefined
-\let\finph@nt\undefined
+\let\finph@nt\undefined
-%D We also define plain's \type {\mathstrut}.
+%D We also define plain's \type {\mathstrut}.
\def\mathstrut{\vphantom{(}}
@@ -300,24 +302,24 @@
%D \getboxheight \someheight \of \box \tempbox
%D \stoptypen
%D
-%D The implementation is rather stupid:
+%D The implementation is rather stupid:
%D
%D \starttypen
%D \def\getboxheight#1\of#2\box#3%
%D {#1\ht#3\advance#1\dp#3\relax}
%D \stoptypen
-%D
-%D The next alternative is slightly more clever, since
-%D it accepts \type {{12}} as well as \type {12} as box
+%D
+%D The next alternative is slightly more clever, since
+%D it accepts \type {{12}} as well as \type {12} as box
%D number.
-\def\getboxheight#1\of#2\box#3%
+\def\getboxheight#1\of#2\box#3%
{\def\next{#1\ht\registercount\advance#1\dp\registercount}%
\afterassignment\next\registercount=#3}
-%D For a long time the following three macros were part of
+%D For a long time the following three macros were part of
%D the grid snapping core module, but it makes more sense to
-%D have them here so that users can see them.
+%D have them here so that users can see them.
%D
%D \macros
%D {getnoflines, getrawnoflines}
@@ -331,8 +333,8 @@
%D \stoptypen
%D
%D Er wordt gedeeld door \type{\openlineheight} en een hoogte
-%D van~0pt komt overeen met 0~regels. The raw alternative
-%D does not round.
+%D van~0pt komt overeen met 0~regels. The raw alternative
+%D does not round.
\newcount\noflines
\newdimen\noflinesheight
@@ -345,20 +347,20 @@
\divide\noflinesheight \openlineheight
\noflines\noflinesheight
#1\ifdim\noflines\openlineheight=#2\relax \else
- \advance\noflines\ifdim#2>\zeropoint\plusone\else\minusone\fi
+ \advance\noflines\ifdim#2>\zeropoint\plusone\else\minusone\fi
\fi\fi
\fi}
-\def\getnoflines {\dogetnoflines\iftrue } % compensated
-\def\getrawnoflines{\dogetnoflines\iffalse} % no compensation
+\def\getnoflines {\dogetnoflines\iftrue } % compensated
+\def\getrawnoflines{\dogetnoflines\iffalse} % no compensation
%D \macros
%D {determinenoflines}
-%D
-%D The next macro determines the number of lines and
-%D returns it it \type {\noflines}. The macro works
+%D
+%D The next macro determines the number of lines and
+%D returns it it \type {\noflines}. The macro works
%D reasonable well as long as the content can be unboxed.
-%D
+%D
%D \starttypen
%D \determinenoflines{test\\test}
%D \determinenoflines{\bfd test\\test}
@@ -367,7 +369,7 @@
\def\determinenoflines
{\bgroup
- \forgetall
+ \forgetall
\let\crlf\endgraf
\let\\\endgraf
\dowithnextbox
@@ -400,9 +402,18 @@
% \egroup#3%
% \fi}
+% \def\doiftextelse#1%
+% {\bgroup
+% \setbox0\normalhbox{#1}%
+% \ifdim\wd0>\zeropoint
+% \egroup\@EA\firstoftwoarguments
+% \else
+% \egroup\@EA\secondoftwoarguments
+% \fi}
+
\def\doiftextelse#1%
{\bgroup
- \setbox0\normalhbox{#1}%
+ \setbox0\normalhbox{\ignorespaces#1\removeunwantedspaces}%
\ifdim\wd0>\zeropoint
\egroup\@EA\firstoftwoarguments
\else
@@ -492,13 +503,13 @@
%D \stoptypen
%D
%D This alternative also accepts \type{\box0} and alike, but
-%D we don't really need this functionality now.
+%D we don't really need this functionality now.
%D \macros
%D {nextboxht,nextboxwd,nextboxdp,flushnextbox}
%D
-%D The next couple of shortcuts saves us memory as well as
-%D \type {{}}'s in passing parameters.
+%D The next couple of shortcuts saves us memory as well as
+%D \type {{}}'s in passing parameters.
\def\nextboxht{\ht\nextbox}
\def\nextboxwd{\wd\nextbox}
@@ -509,32 +520,32 @@
%D \macros
%D {dowithnextboxcontent}
%D
-%D But, occasionally we do need to pass some local settings
-%D without wanting to use additional grouping. Therefore we
-%D provide:
+%D But, occasionally we do need to pass some local settings
+%D without wanting to use additional grouping. Therefore we
+%D provide:
%D
%D \starttypen
%D \dowithnextboxcontent{inside}{after}{box content}
%D \stoptypen
%D
-%D {\em todo: Search source for potential usage!}
+%D {\em todo: Search source for potential usage!}
-\long\def\dowithnextboxcontent#1#2% inside, after
+\long\def\dowithnextboxcontent#1#2% inside, after
{\long\def\dodowithnextbox{#2}%
\def\dododowithnextbox{#1\aftergroup\dodowithnextbox}%
\afterassignment\dododowithnextbox
\setbox\nextbox}
-%D Now we can redefine \type {\dowithnextbox} as follows:
+%D Now we can redefine \type {\dowithnextbox} as follows:
\def\dowithnextbox
{\dowithnextboxcontent\empty}
%D \macros
-%D {llap, rlap, tlap, blap, clap}
+%D {llap, rlap, tlap, blap, clap}
%D
-%D Some well known friends, but we implement them our own
-%D way.
+%D Some well known friends, but we implement them our own
+%D way.
\def\rlap{\begingroup\dowithnextbox{\normalhbox to \zeropoint
{\flushnextbox\normalhss}\endgroup}\normalhbox}
@@ -689,7 +700,9 @@
\def\shapesignal{.12345678pt}
-\def\reshapebox#1%
+% todo: in etex lastnode
+
+\def\reshapebox#1%
{\doreshapebox
{#1}%
{\penalty\shapepenalty}%
@@ -752,8 +765,8 @@
{\setbox\oldshapebox\normalvbox
\bgroup
\reshapingboxtrue
- \the\everyshapebox
- \normalhbox to \shapesignal{\strut\hss}% plus \strut
+ \the\everyshapebox
+ \normalhbox to \shapesignal{\strut\hss}% plus \strut
\prevdepth\strutdp} % never \nointerlineskip
\def\endofshapebox%
@@ -793,7 +806,7 @@
\scratchdimen\dp\newshapebox
\unvbox\newshapebox
% \prevdepth=0pt and \dp\newshapebox depend on last line
- \kern-\scratchdimen % ??
+ \kern-\scratchdimen % ??
% now \prevdepth=0pt
\ifdone
\kern\strutdp
@@ -811,8 +824,8 @@
%D This one is used in \type{\framed}.
% The kern fails on for instance:
-%
-% \omlijnd[offset=0pt,hoogte=8mm,uitlijnen={rechts,laho}]{\bfa test}
+%
+% \omlijnd[offset=0pt,hoogte=8mm,uitlijnen={rechts,laho}]{\bfa test}
\def\innerflushshapebox
{\ifdim\ht\newshapebox=\zeropoint\relax \else
@@ -834,10 +847,10 @@
%D \macros
%D {shapedhbox}
%D
-%D When constructing a new box, using the content of \type
-%D {\shapebox}, one can best use \type {\shapedhbox} instead
+%D When constructing a new box, using the content of \type
+%D {\shapebox}, one can best use \type {\shapedhbox} instead
%D of \type {\normalhbox}, since it manages the height and depth of
-%D the line.
+%D the line.
\def\shapedhbox
{\dowithnextbox
@@ -848,6 +861,7 @@
%D \macros
%D {hyphenatedword,
+%D hyphenatedpar,
%D dohyphenateword}
%D
%D The next one is a tricky one. \PLAIN\ \TEX\ provides
@@ -888,37 +902,63 @@
{\bgroup
\setbox\scratchbox\normalhbox
{\mindermeldingen
- \widowpenalty\zerocount
- \clubpenalty\zerocount
+ \widowpenalty \zerocount % not really needed
+ \clubpenalty \zerocount % not really needed
+ \brokenpenalty \zerocount
+ \hyphenpenalty \zerocount
+ \exhyphenpenalty \zerocount
+ \doublehyphendemerits\zerocount
+ \finalhyphendemerits \zerocount
+ \adjdemerits \zerocount
\setbox0\normalvbox
- {\hsize\zeropoint \ #3}%
- \ifnum#1>0
+ {\hsize\zeropoint \space
+ \ifnum#1=\minusone
+ \obeyspaces
+ \obeylines
+ \def\obeyedspace{\hskip\zeropoint\hbox to \onepoint{}\hskip\zeropoint}%
+ \let\obeyedline \obeyedspace
+ \def\next{#3}\scantokens{\next}%
+ \else
+ #3%
+ \fi}%
+ \ifnum#1>\zerocount
\dorecurse{#1}
{\setbox2\normalhbox
{\splittopskip\openstrutheight
\vsplit0 to \baselineskip}}%
#2%
\fi
- \loop
- \setbox2\normalhbox
- {\splittopskip\openstrutheight
- \vsplit0 to \baselineskip}%
- \normalhbox
- {\unhbox2
- \setbox2\lastbox
- \normalvbox
- {\unvbox2
- \setbox2\lastbox
- \normalhbox{\unhbox2}}}%
- \ifdim\ht0>\zeropoint
- \repeat}%
- \ht\scratchbox\strutht
- \dp\scratchbox\strutdp
- \box\scratchbox
+ \doloop
+ {\setbox2\normalhbox
+ {\splittopskip\openstrutheight
+ \vsplit0 to \baselineskip}%
+ \setbox2\normalhbox
+ {\unhbox2
+ \setbox2\lastbox
+ \normalvbox
+ {\unvbox2
+ \setbox2\lastbox
+ \normalhbox{\unhbox2}}}%
+ \ifnum#1=\minusone\ifdim\wd2=\onepoint\space\else\box2\allowbreak\fi\else\box2\fi
+ \ifdim\ht0=\zeropoint\exitloop\fi}%
+ \removeunwantedspaces}%
+ \ifnum#1>\zerocount
+ \ht\scratchbox\strutht
+ \dp\scratchbox\strutdp
+ \box\scratchbox
+ \else
+ \unhbox\scratchbox
+ \fi
\egroup}
-\def\hyphenatedword%
- {\dohyphenateword{0}{}}
+\def\hyphenatedword{\dohyphenateword\zerocount\empty}
+\def\hyphenatedpar {\dohyphenateword\minusone \empty}
+
+%D You may want to give the following call a try:
+%D
+%D \starttypen
+%D \hyphenatedpar{\readfile{zapf}{}{}}\endgraf
+%D \stoptypen
%D \macros
%D {doboundtext}
@@ -945,7 +985,7 @@
% \else
% #1\relax
% \fi}
-%
+%
% \def\doboundtext#1#2#3%
% {\normalhbox
% {\setbox0=\normalhbox{#1}%
@@ -999,15 +1039,15 @@
\ifx\fakecompoundhyphen\undefined \let\fakecompoundhyphen\relax \fi
-%D The simple alternative is as follows:
+%D The simple alternative is as follows:
%D
%D \starttypen
%D \unexpanded\def\limitatetext%
-%D {\bgroup % evt \setstrut
+%D {\bgroup % evt \setstrut
%D \forgetall
%D \fakecompoundhyphen % dangerous ! ! ! ! ! ! ! ! !
%D \dowithnextbox\dolimitatetext\normalhbox}
-%D
+%D
%D \def\dolimitatetext#1#2%
%D {\doifelsenothing{#1}
%D {\unhbox\nextbox}
@@ -1023,7 +1063,7 @@
%D \veryraggedright
%D \strut\unhcopy\nextbox}%
%D \ifdim\nextboxht>\strutht \else
-%D \setbox\scratchbox\null % overfull and not split
+%D \setbox\scratchbox\null % overfull and not split
%D \fi
%D \setbox\nextbox=\normalvbox % if omitted: missing brace reported
%D {\splittopskip=\openstrutheight
@@ -1037,28 +1077,28 @@
%D \unhbox\nextbox
%D \fi}%
%D \egroup}
-%D \stoptypen
+%D \stoptypen
%D
%D The next alternative accepts a negative width. A negative
%D value crops the beginning. The macro thereby becomes less
-%D readable, which is why we kept the original here too.
+%D readable, which is why we kept the original here too.
\unexpanded\def\limitatetext%
- {\bgroup % evt \setstrut
- \forgetall % otherwise indentation and so
- %\def\limitatetext##1##2##3{##1}% \def !
+ {\bgroup % evt \setstrut
+ \forgetall % otherwise indentation and so
+ %\def\limitatetext##1##2##3{##1}% \def !
\let\limitatetext\firstofthreearguments
\fakecompoundhyphen % dangerous ! ! ! ! ! ! ! ! !
\dowithnextbox\dolimitatetext\normalhbox}
-
+
\def\dolimitatetext#1#2%
{\doifelsenothing{#1}
{\unhbox\nextbox}
{\widowpenalty\zerocount
\clubpenalty\zerocount
\scratchdimen#1\relax
- \ifdim\scratchdimen<\zeropoint\relax % we'll take the last line
- \donefalse
+ \ifdim\scratchdimen<\zeropoint\relax % we'll take the last line
+ \donefalse
\scratchdimen-\scratchdimen
\else
\donetrue
@@ -1075,10 +1115,10 @@
\ifdone \else
\parfillskip\zeropoint
\rightskip\zeropoint
- \hskip\zeropoint \!!plus 1\!!fill % \hsize
- \fi
+ \hskip\zeropoint \!!plus 1\!!fill % \hsize
+ \fi
\unhcopy0}%
- \ifdim\nextboxht>\strutht
+ \ifdim\nextboxht>\strutht
\setbox\nextbox\normalvbox % if omitted: missing brace reported
{\splittopskip\openstrutheight
\ifdone
@@ -1106,13 +1146,13 @@
\fi}%
\egroup}
-%D We can also limit a text with more control:
-%D
-%D \startbuffer
-%D \limitatetext {\input tufte } {2cm,5mm} {\unknown}
-%D \limitatetext {ton en hans} {2cm,5mm} {\unknown}
-%D \limitatetext {ton en hans zijn eikels} {2cm,5mm} {\unknown}
-%D \limitatetext {ton} {2cm,5mm} {\unknown}
+%D We can also limit a text with more control:
+%D
+%D \startbuffer
+%D \limitatetext {\input tufte } {2cm,5mm} {\unknown}
+%D \limitatetext {ton en hans} {2cm,5mm} {\unknown}
+%D \limitatetext {ton en hans zijn eikels} {2cm,5mm} {\unknown}
+%D \limitatetext {ton} {2cm,5mm} {\unknown}
%D \stopbuffer
%D
%D \typebuffer \getbuffer
@@ -1124,10 +1164,10 @@
\def\speciallimitatetext#1#2#3#4% text left right placeholder
{%\dontleavehmode
\bgroup
- %\def\speciallimitatetext##1##2##3##4{##1}% \def !
+ %\def\speciallimitatetext##1##2##3##4{##1}% \def !
\let\speciallimitatetext\firstoffourarguments
\setbox0\normalhbox
- {\nohyphens
+ {\nohyphens
\normallimitatetext{#1}{+#2}{}#4%
\normallimitatetext{#1}{-#3}{}}%
\setbox2\normalhbox
@@ -1135,7 +1175,7 @@
\ifdim\wd2<\wd0 #1\else\unhbox0\fi
\egroup}
-\def\limitatetext#1#2#3% \expanded added 2003/01/16
+\def\limitatetext#1#2#3% \expanded added 2003/01/16
{\expanded{\beforesplitstring#2}\at,\to\leftlimit
\expanded{\aftersplitstring #2}\at,\to\rightlimit
\ifx\rightlimit\empty
@@ -1237,31 +1277,31 @@
{\hskip\currentspaceskip}
%D In order to prevent problems with nested isolated words, we
-%D do process them, but only split at the outermost level.
+%D do process them, but only split at the outermost level.
\newskip\isolatedlastskip
\def\processisolatedwords#1#2% todo: vbox ipv hbox ivm afbreken!
- {\bgroup % todo: doloop
+ {\bgroup % todo: doloop
\fakecompoundhyphen
\mindermeldingen
\forgetall
\widowpenalty\zerocount
\clubpenalty\zerocount
\def\processisolatedwords##1##2{##2{##1}}% we split only once
- \global\let\localbetweenisolatedwords\betweenisolatedwords
+ \global\let\localbetweenisolatedwords\betweenisolatedwords
\setbox0\normalhbox % we default to spaces, but from inside out
- {\ignorespaces#1% \localbetweenisolatedwords can be overruled
+ {\ignorespaces#1% \localbetweenisolatedwords can be overruled
\global\isolatedlastskip\lastskip}%
\setbox2\normalvbox
- {%\hyphenpenalty10000 % this one fails in \url breaking,
+ {%\hyphenpenalty10000 % this one fails in \url breaking,
\lefthyphenmin\maxcard % but this trick works ok, due to them
\righthyphenmin\maxcard % total>63, when no hyphenation is done
\hsize\zeropoint
\unhcopy0}% == #1
\ifdim\ht0=\ht2
\isolatedwordsfalse
- #2{\unhbox0}% == #2{#1} % was \unhcopy0
+ #2{\unhbox0}% == #2{#1} % was \unhcopy0
\else
\isolatedwordstrue
\setbox0\normalhbox
@@ -1271,16 +1311,16 @@
{\splittopskip\openstrutheight
\vsplit2 to \baselineskip}%
\normalhbox
- {\unhbox4\unskip % recently added
+ {\unhbox4\unskip % recently added
\setbox4\lastbox
- \normalvbox % outer \normalhbox needed
- {\unvbox4 % for nested use
+ \normalvbox % outer \normalhbox needed
+ {\unvbox4 % for nested use
\setbox4\lastbox
\normalhbox{#2{\normalhbox
{\unhbox4
\unskip\unpenalty % remove end of line stuff
- \global\dimen1\lastkern}}}}}%
- \ifdim\ht2>\zeropoint\relax
+ \global\dimen1\lastkern}}}}}%
+ \ifdim\ht2>\zeropoint\relax
\ifdim\dimen1=\compoundbreakpoint
\allowbreak
\else
@@ -1299,8 +1339,8 @@
%D material. An example can be found in the \type {\url}
%D macro. The innermost setting is used. In the url case, it
%D means that either very small spaces are used or no spaces
-%D at all. So, the innermost settings are used, while the
-%D outermost split takes place.
+%D at all. So, the innermost settings are used, while the
+%D outermost split takes place.
\def\setbetweenisolatedwords#1%
{\gdef\localbetweenisolatedwords{#1}}
@@ -1333,7 +1373,7 @@
%D and footers and|/|or margin material.
\def\sbox% in handleiding, voorbeeld \inlinker{xx} \extern..
- {\normalvbox\bgroup % new ! ! !
+ {\normalvbox\bgroup % new ! ! !
\dowithnextbox
{\setbox\scratchbox\normalhbox
{\strut
@@ -1347,12 +1387,12 @@
%D \macros
%D {struttedbox}
-%D
+%D
%D This boxing macro limits the height and depth to those of
-%D a strut.
+%D a strut.
\def\struttedbox
- {\normalhbox\bgroup % new ! ! !
+ {\normalhbox\bgroup % new ! ! !
\dowithnextbox
{\nextboxdp\strutdepth
\nextboxht\strutheight
@@ -1364,11 +1404,11 @@
%D {topskippedbox}
%D
%D This macro compensates the difference between the topskip
-%D and strutheight. Watch how we preserve the depth when it
+%D and strutheight. Watch how we preserve the depth when it
%D equals strutdepth.
\def\topskippedbox
- {\normalhbox\bgroup
+ {\normalhbox\bgroup
\dowithnextbox
{\edef\next
{\ifdim\strutdepth=\nextboxdp\nextboxdp\the\nextboxdp\fi}%
@@ -1536,21 +1576,21 @@
\def\rigidcolumnbalance#1%
{\ifnum\rigidcolumns=1 % tzt ook h/d correctie
- \ifinner\ifhmode\box\else\unvbox\fi\else\unvbox\fi#1\relax
+ \ifinner\ifhmode\box\else\unvbox\fi\else\unvbox\fi#1\relax
\else
\normalvbox
{\forgetall
\dontcomplain
\setbox\rigidcolumnbox\normalvbox
{\line{}\goodbreak\unvbox#1\removebottomthings}%
- \splittopskip\openstrutheight
+ \splittopskip\openstrutheight
\setbox\scratchbox\vsplit\rigidcolumnbox to \zeropoint
\ifcase\rigidcolumnlines\relax
- \scratchdimen\ht\rigidcolumnbox
- \divide\scratchdimen \rigidcolumns
- \getnoflines\scratchdimen
+ \scratchdimen\ht\rigidcolumnbox
+ \divide\scratchdimen \rigidcolumns
+ \getnoflines\scratchdimen
\else
- \noflines\rigidcolumnlines % to be sure
+ \noflines\rigidcolumnlines % to be sure
\fi
\scratchdimen\noflines\lineheight
\setbox\scratchbox\normalhbox to \savedrigidhsize
@@ -1558,7 +1598,7 @@
{\setbox\scratchbox\vsplit\rigidcolumnbox to \scratchdimen
\dp\scratchbox\openstrutdepth
\setbox\scratchbox\normalvtop
- \ifalignrigidcolumns to
+ \ifalignrigidcolumns to
\ifstretchrigidcolumns\vsize\else\scratchdimen\fi
\fi
{\unvbox\scratchbox}%
@@ -1650,13 +1690,13 @@
% \box0
% \egroup}
-\def\convertvboxtohbox%
+\def\convertvboxtohbox
{\setvboxtohbox
\makehboxofhboxes
\setbox0\normalhbox{\unhbox0 \removehboxes}%
\noindent\unhbox0\par}
-\def\makehboxofhboxes%
+\def\makehboxofhboxes
{\setbox0\normalhbox{}%
\loop % \doloop { .. \exitloop .. }
\setbox2\lastbox
@@ -1664,7 +1704,7 @@
\setbox0\normalhbox{\box2\unhbox0}%
\repeat}
-\def\removehboxes%
+\def\removehboxes
{\setbox0\lastbox
\ifhbox0
{\removehboxes}\unhbox0
@@ -2020,17 +2060,17 @@
\egroup}
\normalhbox}
-%D \macros
+%D \macros
%D {lhbox,mhbox,rhbox}
%D
-%D A few more boxes.
+%D A few more boxes.
\def\lhbox{\dowithnextbox{\normalhbox to \hsize{\flushnextbox\hss }}\normalhbox}
\def\mhbox{\dowithnextbox{\normalhbox to \hsize{\hss\flushnextbox\hss}}\normalhbox}
\def\rhbox{\dowithnextbox{\normalhbox to \hsize{\hss\flushnextbox }}\normalhbox}
-\let\lefthbox =\lhbox
-\let\midhbox =\mhbox
+\let\lefthbox =\lhbox
+\let\midhbox =\mhbox
\let\righthbox=\rhbox
%D \macros
@@ -2111,7 +2151,7 @@
\setbox\fakedboxcursor\normalhbox
{\vrule\!!width\zeropoint\!!height\zeropoint\!!depth\zeropoint}
-\def\boxcursor % overloaded in core-vis
+\def\boxcursor % overloaded in core-vis
{\iftraceboxplacement
\bgroup
\scratchdimen2pt
@@ -2122,7 +2162,7 @@
\!!height\scratchdimen
\!!depth \scratchdimen
\hss}%
- \smashedbox\scratchbox
+ \smashedbox\scratchbox
\egroup
\else
\copy\fakedboxcursor
@@ -2183,7 +2223,7 @@
% {\setbox0=\placedbox{#1}%
% \dimen0=\boxoffset\advance\dimen0 \ht0
% \boxcursor\hskip-.5\wd0\lower\dimen0\box0}}
-
+
\def\bottombox#1%
{\normalhbox
{\setbox0\placedbox{#1}%
@@ -2260,10 +2300,10 @@
\def\middlebox#1%
{\normalhbox{\setbox0\placedbox{#1}\boxoffset=-.5\wd0\rightbox{\box0}}}
-%D \macros
-%D {toplinebox}
+%D \macros
+%D {toplinebox}
%D
-%D See core-tbl.tex for an example of its usage:
+%D See core-tbl.tex for an example of its usage:
\def\toplinebox
{\dowithnextbox
@@ -2278,32 +2318,32 @@
\fi}%
\tbox}
-%D \macros
+%D \macros
%D {initializeboxstack,savebox,foundbox}
%D
-%D At the cost of some memory, but saving box registers, we
-%D have implemented a box repository.
+%D At the cost of some memory, but saving box registers, we
+%D have implemented a box repository.
%D
-%D \starttypen
+%D \starttypen
%D \initializeboxstack{one}
-%D
+%D
%D \savebox{one}{a}{test a}
%D \savebox{one}{p}{test p}
%D \savebox{one}{q}{test q}
-%D
+%D
%D \normalhbox{a:\foundbox{one}{a}} \par
%D \normalhbox{q:\foundbox{one}{q}} \par
%D \normalhbox{p:\foundbox{one}{p}} \par
%D \normalhbox{x:\foundbox{one}{x}} \par
%D \normalhbox{y:\foundbox{two}{a}} \par
-%D \stoptypen
+%D \stoptypen
-% a first version
+% a first version
%
% \def\@@stackbox{boxstack:b:}
% \def\@@stackmax{boxstack:m:}
% \def\@@stacktag{boxstack:t:}
-%
+%
% \def\initializeboxstack#1%
% {\ifundefined{\@@stackbox#1}%
% \@EA\newbox\csname\@@stackbox#1\endcsname
@@ -2312,8 +2352,8 @@
% \fi
% % actually we should erase the old values
% \setgvalue{\@@stackmax#1}{0}}
-%
-% \def\savebox#1#2% stack name
+%
+% \def\savebox#1#2% stack name
% {\dowithnextbox
% {\doifdefined{\@@stackbox#1}
% {\@EA\doglobal\@EA\increment\csname\@@stackmax#1\endcsname
@@ -2321,14 +2361,14 @@
% \global\setbox\csname\@@stackbox#1\endcsname=\normalvbox
% {\forgetall
% \setbox\scratchbox=\normalvbox{\flushnextbox}
-% \ht\scratchbox=\!!onepoint
+% \ht\scratchbox=\onepoint
% \dp\scratchbox=\zeropoint
% \unvbox\csname\@@stackbox#1\endcsname
% \offinterlineskip
% \allowbreak
% \box\scratchbox}}}%
% \normalvbox}
-%
+%
% \def\foundbox#1#2%
% {\normalvbox
% {\doifdefined{\@@stackbox#1}
@@ -2336,16 +2376,16 @@
% {\setbox\scratchbox=\normalvbox
% {\splittopskip\zeropoint
% \setbox0=\copy\csname\@@stackbox#1\endcsname
-% \dimen0=\getvalue{\@@stacktag#2}pt
-% \advance\dimen0 by -\!!onepoint
+% \dimen0=\getvalue{\@@stacktag#2}pt
+% \advance\dimen0 by -\onepoint
% \setbox2=\vsplit0 to \dimen0
-% \ifdim\ht0>\!!onepoint
-% \setbox0=\vsplit0 to \!!onepoint
+% \ifdim\ht0>\onepoint
+% \setbox0=\vsplit0 to \onepoint
% \fi
% \unvbox0\setbox0=\lastbox\unvbox0}%
% \unvbox\scratchbox}}}}
-\beginTEX \newbox
+\beginTEX \newbox
\def\@@stackbox{boxstack:b:}
\def\@@stackmax{boxstack:m:}
@@ -2372,7 +2412,7 @@
\global\setbox\csname\@@stackbox#1\endcsname\normalvbox
{\forgetall
\setbox\scratchbox\normalvbox{\flushnextbox}
- \ht\scratchbox\!!onepoint
+ \ht\scratchbox\onepoint
\dp\scratchbox\zeropoint
\unvbox\csname\@@stackbox#1\endcsname
\offinterlineskip
@@ -2387,11 +2427,11 @@
{\setbox\scratchbox\normalvbox
{\splittopskip\zeropoint
\setbox0\copy\csname\@@stackbox#1\endcsname
- \dimen0=\getvalue{\@@stacktag#1:#2}\s!pt
- \advance\dimen0 -\!!onepoint
+ \dimen0=\getvalue{\@@stacktag#1:#2}\points
+ \advance\dimen0 -\onepoint
\setbox2\vsplit0 to \dimen0
- \ifdim\ht0>\!!onepoint
- \setbox0\vsplit0 to \!!onepoint
+ \ifdim\ht0>\onepoint
+ \setbox0\vsplit0 to \onepoint
\fi
\unvbox0\setbox0\lastbox\unvbox0}%
\unvbox\scratchbox}}}}
@@ -2414,7 +2454,7 @@
\def\initializeboxstack#1%
{\def\docommando##1{\setstackbox{#1}{##1}{}}%
- \ifcsname\@@stacklst#1\endcsname
+ \ifcsname\@@stacklst#1\endcsname
\processcommacommand[\getvalue{\@@stacklst#1}]\docommando
\fi
\setgvalue{\@@stacklst#1}{}}
@@ -2454,7 +2494,7 @@
%D \macros
%D {removebottomthings, removelastskip}
%D
-%D A funny (but rather stupid) one, plus a redefinition.
+%D A funny (but rather stupid) one, plus a redefinition.
\def\removebottomthings
{\dorecurse5{\unskip\unkern\unpenalty}}
@@ -2464,9 +2504,9 @@
%D \macros
%D {makestrutofbox}
-%D
-%D This macro sets the dimensions of a box to those of a
-%D strut.
+%D
+%D This macro sets the dimensions of a box to those of a
+%D strut.
\def\domakestrutofbox
{\ht\registercount\strutht
@@ -2479,18 +2519,18 @@
%D \macros
%D {raisebox,lowerbox}
%D
-%D Some more box stuff, related to positioning (under
-%D construction). Nice stuff for a tips and tricks maps
-%D article.
+%D Some more box stuff, related to positioning (under
+%D construction). Nice stuff for a tips and tricks maps
+%D article.
%D
-%D \starttypen
-%D \raisebox{100pt}\normalhbox{test}
-%D \raisebox50pt\normalhbox{test}
-%D \hsmash{\raisebox{100pt}\normalhbox{test}}
-%D \stoptypen
+%D \starttypen
+%D \raisebox{100pt}\normalhbox{test}
+%D \raisebox50pt\normalhbox{test}
+%D \hsmash{\raisebox{100pt}\normalhbox{test}}
+%D \stoptypen
-\def\doraiselowerbox#1#2% a nice trick us used to accept
- {\def\next % both direct and {} dimensions
+\def\doraiselowerbox#1#2% a nice trick us used to accept
+ {\def\next % both direct and {} dimensions
{\dowithnextbox
{\setbox\nextbox\normalhbox{#1\scratchdimen\flushnextbox}%
\nextboxht\strutht
@@ -2575,36 +2615,36 @@
\flushnextbox}
\normalhbox}
-%D New:
+%D New:
\def\setdimentoatleast#1#2%
{\ifdim#1>\zeropoint\else#1=#2\fi}
-%D We need'm raw.
+%D We need'm raw.
-\ifx \normalhbox \undefined \let \normalhbox = \hbox \fi
-\ifx \normalvbox \undefined \let \normalvbox = \vbox \fi
-\ifx \normalvtop \undefined \let \normalvtop = \vtop \fi
-\ifx \normalvcenter \undefined \let \normalvcenter = \vcenter \fi
+\ifx \normalhbox \undefined \let \normalhbox = \hbox \fi
+\ifx \normalvbox \undefined \let \normalvbox = \vbox \fi
+\ifx \normalvtop \undefined \let \normalvtop = \vtop \fi
+\ifx \normalvcenter \undefined \let \normalvcenter = \vcenter \fi
-%D And even rawer:
+%D And even rawer:
-\let\naturalhbox \normalhbox
-\let\naturalvbox \normalvbox
+\let\naturalhbox \normalhbox
+\let\naturalvbox \normalvbox
%let\naturalvtop \normalvtop
-\beginOMEGA dir
+\beginOMEGA dir
\def\naturalhbox{\normalhbox dir TLT}
\def\naturalvbox{\normalvbox dir TLT}
%def\naturalvtop{\normalvtop dir TLT}
-\endOMEGA
+\endOMEGA
-%D \macros
+%D \macros
%D {vcenter}
%D
-%D Also new: tex mode \type {\vcenter}.
+%D Also new: tex mode \type {\vcenter}.
\let\verynormalvcenter \vcenter % since \vcenter can be visualized
@@ -2615,7 +2655,7 @@
\prependtoks \let\vcenter\normalvcenter \to \everymath
-%D \macros
+%D \macros
%D {frozenhbox}
%D
%D A not so well unhboxable bxo can be made with:
@@ -2623,4 +2663,4 @@
\def\frozenhbox
{\hbox\bgroup\dowithnextbox{\hbox{\hbox{\flushnextbox}}\egroup}\hbox}
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/supp-fil.tex b/tex/context/base/supp-fil.tex
index 396718e6b..8d7655f06 100644
--- a/tex/context/base/supp-fil.tex
+++ b/tex/context/base/supp-fil.tex
@@ -8,8 +8,8 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
%D \TEX\ operates on files, so one wouldn't wonder that there
%D is a separate module for file support. In \CONTEXT\ files
@@ -24,7 +24,7 @@
%D
%D When dealing with files we can load them as a whole, using
%D the \type{\input} primitive or load them on a line||by||line
-%D basis, using \type{\read}. Writing is always done line by
+%D basis, using \type{\read}. Writing is always done line by
%D line, using \type{\write}.
\writestatus{loading}{Context Support Macros / Files}
@@ -32,15 +32,15 @@
\unprotect
\ifx\undefined\f!pathseparator
- \def\f!pathseparator{/}
+ \def\f!pathseparator{/}
\def\f!currentpath {.}
\def\f!parentpath {..}
\fi
-%D \macros
+%D \macros
%D {normalwrite, normalimmediate}
%D
-%D We save a few primitives first.
+%D We save a few primitives first.
\let\normalwrite\write
\let\normalimmediate\immediate
@@ -61,8 +61,8 @@
%D \popendofline
%D \stoptypen
%D
-%D Just to be sure, we save the current meaning of \type{^^M}
-%D in \type{\poppedendofline}.
+%D Just to be sure, we save the current meaning of \type{^^M}
+%D in \type{\poppedendofline}.
\chardef\poppedendofline\catcode`\^^M
@@ -78,24 +78,24 @@
%D
%D We define a scratch file for reading. Keep in mind that
%D the number of files is limited to~16, so use this one when
-%D possible. We also define a scratch output file.
+%D possible. We also define a scratch output file.
\ifx\undefined\scratchread \newread \scratchread \fi
\ifx\undefined\scratchwrite \newwrite\scratchwrite \fi
-%D \macros
-%D {unlinkfile}
+%D \macros
+%D {unlinkfile}
%D
%D Sometimes we want to make sure a file is deleted, so here
-%D is a macro that does the job. It's named after the \PERL\
-%D one.
+%D is a macro that does the job. It's named after the \PERL\
+%D one.
-\def\unlinkfile#1%
+\def\unlinkfile#1%
{\immediate\openout\scratchwrite=#1\immediate\closeout\scratchwrite}
-%D \macros
+%D \macros
%D {writeln}
-%D
+%D
%D This saves a few tokens:
\def\writeln#1{\write#1{}}
@@ -115,17 +115,17 @@
%D \macros
%D {doprocessfile,fileline,fileprocessedtrue,dofinishfile}
%D
-%D The next macro offers a framework for processing files on a
-%D line by line basis.
-%D
+%D The next macro offers a framework for processing files on a
+%D line by line basis.
+%D
%D \starttypen
%D \doprocessfile \identifier {name} \action
%D \stoptypen
-%D
+%D
%D The first argument can for instance be \type{\scratchread}.
%D The action must do something with \type{\fileline}, which
-%D holds the current line. One can halfway step out using
-%D \type{\dofinishfile} and ise \type{\iffileprocessed} to
+%D holds the current line. One can halfway step out using
+%D \type{\dofinishfile} and ise \type{\iffileprocessed} to
%D see if indeed some content was found.
\newif\iffileprocessed
@@ -153,35 +153,35 @@
\expandafter\doprocessline
\fi}
-%D \macros
+%D \macros
%D {pathplusfile,assignfullfilename,sanitizefilename}
-%D
+%D
%D Use \type{\pathplusfile} to compose a full file name, like
-%D in:
+%D in:
%D
%D \starttypen
%D \pathplusfile{path}{file}
%D \stoptypen
%D
-%D By default, this expands into {\tt \pathplusfile{path}{file}}.
+%D By default, this expands into {\tt \pathplusfile{path}{file}}.
\def\pathplusfile#1#2{#1\f!pathseparator#2}
-%D This one constructs a filename from a (possible empty)
-%D path and filename.
+%D This one constructs a filename from a (possible empty)
+%D path and filename.
\def\assignfullfilename#1#2\to#3%
{\doifelsenothing{#1}
{\edef#3{#2}}
{\edef#3{#1\f!pathseparator#2}}}
-%D For the moment, we limit sanitizing to taking care of
-%D active \type {/}.
+%D For the moment, we limit sanitizing to taking care of
+%D active \type {/}.
-\bgroup % todo: _ cleanup
-
-\catcode`\/=\@@active
-\catcode`\:=\@@active
+\bgroup % todo: _ cleanup
+
+\catcode`\/=\@@active
+\catcode`\:=\@@active
\gdef\sanitizefilename#1\to#2%
{\bgroup
@@ -198,7 +198,7 @@
\chardef\kindoffile=0 % 0=normal 1=full path spec (or http)
\def\checkfilename#1%
- {\doifinstringelse{@@/}{@@#1}% unix: /full/path
+ {\doifinstringelse{@@/}{@@#1}% unix: /full/path
{\chardef\kindoffile\plusone}
{\doifinstringelse{:/}{#1}% windows: e:/full/path or http://
{\chardef\kindoffile\plusone}
@@ -221,14 +221,14 @@
%D Many \TEX\ implementations have laid out some strategy for
%D locating files. This can lead to unexpected results,
%D especially when one loads files that are not found in the
-%D current directory. Let's give an example of this. In
-%D \CONTEXT\ illustrations can be defined in an external file.
+%D current directory. Let's give an example of this. In
+%D \CONTEXT\ illustrations can be defined in an external file.
%D The resizing macro first looks if an illustration is defined
-%D in the local definitions file. When no such file is found,
-%D it searches for a global file and when this file is not
-%D found either, the illustration itself is scanned for
+%D in the local definitions file. When no such file is found,
+%D it searches for a global file and when this file is not
+%D found either, the illustration itself is scanned for
%D dimensions. One can imagine what happens if an adapted,
-%D localy stored illustration, is scaled according to
+%D localy stored illustration, is scaled according to
%D dimensions stored somewhere else.
%D
%D When some \TEX\ implementation starts looking for a file, it
@@ -248,25 +248,25 @@
%D We first present an earlier implementation of
%D \type{\readfile}. This command backtracks parent
%D directories, upto a predefined level. Users can change this
-%D level, but we default to~3.
+%D level, but we default to~3.
%D
%D \starttypen
%D \def\maxreadlevel {3}
%D \stoptypen
%D
-%D This is a pseudo \COUNTER.
+%D This is a pseudo \COUNTER.
%D
-%D We use \type{\normalinput} instead of \type{\input}
-%D because we want to be able to redefine the original
-%D \type{\input} when needed, for instance when loading third
-%D party libraries.
+%D We use \type{\normalinput} instead of \type{\input}
+%D because we want to be able to redefine the original
+%D \type{\input} when needed, for instance when loading third
+%D party libraries.
\newevery \everybeforereadfile \EveryBeforeReadFile
\newevery \everyafterreadfile \EveryAfterReadFile
\let \everyreadfile \everybeforereadfile
-\ifx\normalinput\undefined \let\normalinput\input \fi
+\ifx\normalinput\undefined \let\normalinput\input \fi
\newif\iftracefiles
@@ -277,39 +277,39 @@
% \checkfilename\readfilename
% \ifcase\kindoffile
% \iftracefiles\writestatus\m!systems{searching for \readfilename\space on #1}\fi
-% % not a full path or url, check for existence
+% % not a full path or url, check for existence
% \doifelsenothing{#1}
% {\def\next{\redoreadfile\readfilename{#3}{#4}}}%
% {\def\next{\redoreadfile{\pathplusfile{#1}{\readfilename}}{#3}{#4}}}%
% \else
-% % a full path or url, no further checking done
+% % a full path or url, no further checking done
% \iftracefiles\writestatus\m!systems{assuming present \readfilename}\fi
% \def\next{#3\dodoreadfile}%
% \fi
% \next}
-\newconditional\trackfilenames \settrue\trackfilenames
+\newconditional\trackfilenames \settrue\trackfilenames
\let\trackedfilename\empty
\def\doreadfile#1#2#3#4%
{\sanitizefilename#2\to\readfilename
- \let\trackedfilename\readfilename
+ \let\trackedfilename\readfilename
\ifconditional\trackfilenames
\ifundefined{fn..\trackedfilename}\donetrue\else\donefalse\fi
\else
\donetrue
- \fi
+ \fi
\ifdone
\checkfilename\readfilename
\ifcase\kindoffile
\iftracefiles\writestatus\m!systems{searching for \readfilename\space on #1}\fi
- % not a full path or url, check for existence
+ % not a full path or url, check for existence
\doifelsenothing{#1}
{\def\next{\redoreadfile\readfilename{#3}{#4}}}%
{\def\next{\redoreadfile{\pathplusfile{#1}{\readfilename}}{#3}{#4}}}%
\else
- % a full path or url, no further checking done
+ % a full path or url, no further checking done
\doiffileexistselse\readfilename
{\iftracefiles\writestatus\m!systems{located \readfilename}\fi
\def\next{#3\dodoreadfile}}%
@@ -336,12 +336,12 @@
% \def\next{#3}%
% \fi
% \else
-% \immediate\closein\scratchread
+% \immediate\closein\scratchread
% \edef\readfilename{#1}%
% \iftracefiles\writestatus\m!systems{#1 located}\fi
% \def\next{#2\dodoreadfile}%
% \fi
-% \next}
+% \next}
\def\redoreadfile#1#2#3%
{\doiffileexistselse{#1}%
@@ -356,20 +356,20 @@
\else
\def\next{#3}%
\fi}%
- \next}
+ \next}
-% \def\dodoreadfile % we provide hooks, for instance for \enableXML
-% {\the\everybeforereadfile
+% \def\dodoreadfile % we provide hooks, for instance for \enableXML
+% {\the\everybeforereadfile
% \normalinput\readfilename\relax
-% \the\everyafterreadfile}
+% \the\everyafterreadfile}
-\def\dodoreadfile % we provide hooks, for instance for \enableXML
+\def\dodoreadfile % we provide hooks, for instance for \enableXML
{\ifconditional\trackfilenames
\setxvalue{fn..\trackedfilename}{\readfilename}%
\fi
- \the\everybeforereadfile
+ \the\everybeforereadfile
\normalinput\readfilename\relax
- \the\everyafterreadfile}
+ \the\everyafterreadfile}
\def\readfile% #1%
{\let\readlevel\maxreadlevel
@@ -382,8 +382,8 @@
%D \macros
%D {readjobfile,readlocfile,readsysfile,
%D readfixfile,readsetfile}
-%D
-%D This implementation honnors the third situation, but we
+%D
+%D This implementation honnors the third situation, but we
%D still can get unwanted files loaded and/or can get involved
%D in extensive searching.
%D
@@ -393,12 +393,12 @@
%D backtracks~\readlevel\ directories, including the current
%D one.
-\def\readjobfile#1% current path, no backtracking
+\def\readjobfile#1% current path, no backtracking
{\newcounter\readlevel
%\doreadfile{\pathplusfile{\f!currentpath}{#1}}}
\doreadfile\f!currentpath{#1}}
-\def\readlocfile#1% current path, backtracking
+\def\readlocfile#1% current path, backtracking
{\let\readlevel\maxreadlevel
%\doreadfile{\pathplusfile{\f!currentpath}{#1}}}
\doreadfile\f!currentpath{#1}}
@@ -407,26 +407,26 @@
%D \type{\readsysfile} is not bound to the current directory
%D and obeys the \TEX\ implementation.
-% \def\readsysfile#1% current path, obeys tex search
+% \def\readsysfile#1% current path, obeys tex search
% {\let\readlevel\maxreadlevel
% %\doreadfile{#1}}
% \doreadfile\empty{#1}}
-\def\readsysfile#1% current path, obeys tex search
+\def\readsysfile#1% current path, obeys tex search
{\newcounter\readlevel
%\doreadfile{#1}}
\doreadfile\empty{#1}}
%D Of the last two, \type{\readfixfile} searches on the
%D directory specified and backtracks too, while
-%D \type{\readsetfile} does only search on the specified path.
+%D \type{\readsetfile} does only search on the specified path.
-\def\readfixfile#1#2% specified path, backtracking
+\def\readfixfile#1#2% specified path, backtracking
{\let\readlevel\maxreadlevel
%\doreadfile{\pathplusfile{#1}{#2}}}
\doreadfile{#1}{#2}}
-\def\readsetfile#1#2% specified path, no backtracking
+\def\readsetfile#1#2% specified path, no backtracking
{\newcounter\readlevel
%\doreadfile{\pathplusfile{#1}{#2}}}
\doreadfile{#1}{#2}}
@@ -440,7 +440,7 @@
{\readjobfile{#1}{#2}
{\readsysfile{#1}{#2}{#3}}}}
-%D So now we've got ourselves five file loading commands:
+%D So now we've got ourselves five file loading commands:
%D
%D \starttypen
%D \readfile {filename} {before loading} {not found}
@@ -501,9 +501,9 @@
%D \doiffileelse {filename} {before loading} {not found}
%D \stoptypen
%D
-%D We use \type{\next} here, because we want to close the
-%D file first. We also provide the alternatives:
-%D
+%D We use \type{\next} here, because we want to close the
+%D file first. We also provide the alternatives:
+%D
%D \starttypen
%D \doiflocfileelse {filename} {before loading} {not found}
%D \stoptypen
@@ -546,11 +546,11 @@
%D \macros
%D {doonlyonce, doinputonce, doendinputonce}
-%D
+%D
%D Especially macropackages need only be loaded once.
%D Repetitive loading not only costs time, relocating registers
%D often leads to abortion of the processing because \TEX's
-%D capacity is limited. One can prevent multiple execution and
+%D capacity is limited. One can prevent multiple execution and
%D loading by using one of both:
%D
%D \starttypen
@@ -559,7 +559,7 @@
%D \doendinputonce{filename}
%D \stoptypen
%D
-%D This command obeys the standard method for locating files.
+%D This command obeys the standard method for locating files.
\long\def\doonlyonce#1#2%
{\doifundefined{@@@#1@@@}{\setgvalue{@@@#1@@@}{}#2}}
@@ -570,21 +570,24 @@
\def\doendinputonce#1%
{\doifdefined{@@@#1@@@}\endinput}
+\def\forgetdoingonce#1%
+ {\global\letbeundefined{@@@#1@@@}}
+
%D \macros
%D {doifparentfileelse}
%D
-%D The test \type{\doifelse{\jobname}{filename}} does not give
-%D the desired result, simply because \type{\jobname} expands
-%D to characters with \CATCODE~12, while the characters in
-%D \type{filename} have \CATCODE~11. So we can better use:
-%D
-%D \starttypen
+%D The test \type{\doifelse{\jobname}{filename}} does not give
+%D the desired result, simply because \type{\jobname} expands
+%D to characters with \CATCODE~12, while the characters in
+%D \type{filename} have \CATCODE~11. So we can better use:
+%D
+%D \starttypen
%D \doifparentfileelse{filename}{yes}{no}
%D \stoptypen
-%D
+%D
%D Since \TEXEXEC\ (and thereby \CONTEXT) supports renaming of
%D the outputfile, we also need to check on that alternative
-%D name.
+%D name.
\ifx\outputfilename\undefined \def\outputfilename{\jobname} \fi
@@ -593,10 +596,10 @@
{\doifsamestringelse{#1}{\jobname.\c!tex}{#2}
{\doifsamestringelse{#1}{\outputfilename}{#2}{#3}}}}
-\def\normalless {<} % geen \let !
-\def\normalmore {>} % geen \let !
-\def\normalequal {=} % geen \let !
-\def\normaldblquote{"} % geen \let !
+\def\normalless {<} % geen \let !
+\def\normalmore {>} % geen \let !
+\def\normalequal {=} % geen \let !
+\def\normaldblquote{"} % geen \let !
\newcounter\readingfilelevel
@@ -608,9 +611,9 @@
\ifx\\\undefined \let\\\relax \fi
-%D This changing catcodes is a direct result from the fact
-%D that we support some long standing conventions with
-%D regards to active characters (german ", polish /,
+%D This changing catcodes is a direct result from the fact
+%D that we support some long standing conventions with
+%D regards to active characters (german ", polish /,
%D french : and ;).
\def\startreadingfile% beter een every en \setnormalcatcodes
@@ -643,51 +646,51 @@
{\getvalue{\string\readingfilelevel::\readingfilelevel}%
\doglobal\decrement\readingfilelevel}
-%% % gebruikt voor normale (!) files, will change to proper
+%% % gebruikt voor normale (!) files, will change to proper
%% % installer maybe combined with verb module push/popper
-%%
-%% \def\startreadingfile% beter een every
+%%
+%% \def\startreadingfile% beter een every
%% {\doglobal\increment\readingfilelevel
%% \setxvalue{popfilecharacters::\readingfilelevel}%
%% {%\expnormalcatcodes
%% \expspecialcatcodes}%
%% %\setnormalcatcodes
%% \setspecialcatcodes}
-%%
+%%
%% \def\stopreadingfile%
%% {\getvalue{popfilecharacters::\readingfilelevel}%
%% \doglobal\decrement\readingfilelevel}
-%%
+%%
%% \ifx\\\undefined \let\\\relax \fi
%% \ifx\!\undefined \let\!\relax \fi
%% \ifx\?\undefined \let\?\relax \fi
-%%
+%%
%% \def\expnormalcatcodes%
%% {\catcode`\noexpand\!=\the\catcode`\! \catcode`\noexpand\?=\the\catcode`\?%
-%% \catcode`\noexpand\&=\the\catcode`\&
+%% \catcode`\noexpand\&=\the\catcode`\&
%% \catcode`\noexpand\#=\the\catcode`\# \catcode`\noexpand\$=\the\catcode`\$%
%% \catcode`\noexpand\%=\the\catcode`\% \catcode`\noexpand\\=\the\catcode`\\%
%% \catcode`\noexpand\^=\the\catcode`\^ \catcode`\noexpand\_=\the\catcode`\_%
%% \catcode`\noexpand\{=\the\catcode`\{ \catcode`\noexpand\}=\the\catcode`\}}
-%%
+%%
%% \def\setnormalcatcodes%
%% {%\ifcase\protectionlevel
%% \catcode`\!=\@@other \catcode`\?=\@@other
%% %\else
%% % \catcode`\!=\@@letter \catcode`\?=\@@letter
%% %\fi
-%% \catcode`\&=\@@alignment
-%% \catcode`\#=\@@parameter \catcode`\$=\@@mathshift
+%% \catcode`\&=\@@alignment
+%% \catcode`\#=\@@parameter \catcode`\$=\@@mathshift
%% \catcode`\%=\@@comment \catcode`\\=\@@escape
-%% \catcode`\^=\@@superscript \catcode`\_=\@@subscript
+%% \catcode`\^=\@@superscript \catcode`\_=\@@subscript
%% \catcode`\{=\@@begingroup \catcode`\}=\@@endgroup}
-%%
+%%
%% \def\expspecialcatcodes%
%% {\catcode`\noexpand/=\the\catcode`/%
%% \catcode`\noexpand"=\the\catcode`"%
%% \catcode`\noexpand<=\the\catcode`<%
%% \catcode`\noexpand>=\the\catcode`>}
-%%
+%%
%% \def\setspecialcatcodes%
%% {\catcode`/=\@@other
%% \catcode`"=\@@other
diff --git a/tex/context/base/supp-fun.tex b/tex/context/base/supp-fun.tex
index 4cbdf359f..2da73e625 100644
--- a/tex/context/base/supp-fun.tex
+++ b/tex/context/base/supp-fun.tex
@@ -8,15 +8,15 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
\unprotect
-%D This module implements some typographics tricks that can
+%D This module implements some typographics tricks that can
%D be fun when designing document layouts. The examples use
%D macros that are typical to \CONTEXT, but non \CONTEXT\
-%D users can use the drop caps and first line treatment
+%D users can use the drop caps and first line treatment
%D macros without problems. This module will be extended
%D when the need for more of such tricks arises.
@@ -30,17 +30,17 @@
%D \macros
%D {DroppedCaps, DroppedString, DroppedIndent, DroppedLines}
-%D
+%D
%D \startbuffer
-%D \DroppedCaps
-%D {\color[green]} {cmbx12}
-%D {2.2\baselineskip} {2pt} {\baselineskip} {2}
+%D \DroppedCaps
+%D {\color[green]} {cmbx12}
+%D {2.2\baselineskip} {2pt} {\baselineskip} {2}
%D Let's start
%D \stopbuffer
%D
%D \haalbuffer with dropped caps, those blown up first
%D characters of a paragraph. It's hard to implement a general
-%D mechanism that suits all situations, but dropped caps are so
+%D mechanism that suits all situations, but dropped caps are so
%D seldomly used that we can permit ourselves a rather user
%D unfriendly implementation.
%D
@@ -57,9 +57,9 @@
%D natural position in the encoding vector.
%D
%D \startbuffer
-%D \DroppedCaps
-%D {\color[red]} {cmbx12}
-%D {\baselineskip} {0pt} {0pt} {1}
+%D \DroppedCaps
+%D {\color[red]} {cmbx12}
+%D {\baselineskip} {0pt} {0pt} {1}
%D This simple
%D \stopbuffer
%D
@@ -69,26 +69,26 @@
%D \typebuffer
%D
%D \startbuffer
-%D \DroppedCaps
-%D {\color[red]} {cmbx12}
-%D {2\baselineskip} {0pt} {\baselineskip} {2}
-%D Is this ugly
+%D \DroppedCaps
+%D {\color[red]} {cmbx12}
+%D {2\baselineskip} {0pt} {\baselineskip} {2}
+%D Is this ugly
%D \stopbuffer
-%D
-%D \haalbuffer example the third argument tells
-%D this macro that we want a dropped capital scaled to the
-%D baseline distance. The two zero point arguments are the
+%D
+%D \haalbuffer example the third argument tells
+%D this macro that we want a dropped capital scaled to the
+%D baseline distance. The two zero point arguments are the
%D horizontal and vertical offsets and the last arguments
-%D determines the hanging indentation. In this paragraph we
-%D set the height to two times the baselinedistance and use
-%D two hanging lines:
-%D
+%D determines the hanging indentation. In this paragraph we
+%D set the height to two times the baselinedistance and use
+%D two hanging lines:
+%D
%D \typebuffer
-%D
+%D
%D Here, the first character is moved down one baseline. Here
%D we also see why the horizontal offset is important. The
%D first example (showing the~L) sets this to a few points and
-%D also used a slightly larger height.
+%D also used a slightly larger height.
%D
%D Of course common users (typist) are not supposed to see this
%D kind of fuzzy definitions, but fortunately \TEX\ permits us
@@ -97,15 +97,15 @@
%D
%D \startbuffer
%D \def\MyDroppedCaps%
-%D {\DroppedCaps
-%D {\color[green]} {cmbx12}
+%D {\DroppedCaps
+%D {\color[green]} {cmbx12}
%D {5\baselineskip} {3pt} {3\baselineskip} {4}}
%D
%D \MyDroppedCaps The implementation
%D \stopbuffer
-%D
+%D
%D \typebuffer
-%D
+%D
%D \haalbuffer of the general macro is rather simple and only
%D depends on the arguments given and the dimensions of the
%D strut box. We explicitly load the font, which is no problem
@@ -113,16 +113,16 @@
%D combined some arguments, like the height, vertical offset
%D and the number of lines, but the current implementation
%D proved to be the most flexible. One should be aware of the
-%D fact that the offsets depend on the design of the glyphs
-%D used.
+%D fact that the offsets depend on the design of the glyphs
+%D used.
\let\DroppedIndent\!!zeropoint \def\DroppedLines{0}
\def\DroppedString%
{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
-% \def\DroppedCaps#1#2#3#4#5#6#7%
-% {\ExpandBothAfter\doifinstringelse{#7}{\DroppedString} %
+% \def\DroppedCaps#1#2#3#4#5#6#7%
+% {\ExpandBothAfter\doifinstringelse{#7}{\DroppedString} %
% {\ifvmode % this one is \EveryPar save, precede by \par if needed
% \vskip#6\baselineskip
% \penalty-200
@@ -149,7 +149,7 @@
% \hskip-\DroppedIndent
% \vbox{\forgetall\box0}%
% \nobreak
-% \ignorespaces} % Could be a one character word !
+% \ignorespaces} % Could be a one character word !
% {\edef\DroppedIndent{0pt}%
% \edef\DroppedLines {\number\maxdimen}%
% #7}}
@@ -196,10 +196,10 @@
% \globaldropcaps\edef\DroppedLines{\number\maxdimen}%
% \globaldropcaps\chardef\DroppedStatus3
% \def\next{#7}}%
-% \let\globaldropcaps\global
+% \let\globaldropcaps\global
% \next}
-\chardef\DropMode=0 % 1 == marginhang
+\chardef\DropMode=0 % 1 == marginhang
\def\DroppedCaps#1#2#3#4#5#6#7% does not yet handle accented chars
{\convertargument #7\to\asciia
@@ -248,20 +248,20 @@
\globaldropcaps\edef\DroppedLines{\number\maxdimen}%
\globaldropcaps\chardef\DroppedStatus3
\def\next{#7}}%
- \let\globaldropcaps\global
+ \let\globaldropcaps\global
\next}
%D Before we go to the next topic, we summarize this command:
%D
%D \starttypen
-%D \DroppedCaps
-%D {command} {font}
+%D \DroppedCaps
+%D {command} {font}
%D {height} {hoffset} {voffset} {lines}
%D \stoptypen
-%D
+%D
%D Sometimes you need to make sure that the global settings are
-%D kept local, as in:
-%D
+%D kept local, as in:
+%D
% %D \startbuffer
% %D \defineparagraphs[SomePar][n=2,rule=on]
% %D \setupparagraphs [SomePar][1][width=.5\textwidth]
@@ -270,26 +270,26 @@
%D \definieeralineas[SomePar][n=2,rule=on]
%D \stelalineasin [SomePar][1][width=.5\textwidth]
%D \stelalineasin [SomePar][2][width=.5\textwidth]
-%D
+%D
%D \startSomePar
%D \localdropcaps\NiceDroppedCaps{}{cmr12}{0pt}{2}Here we need
%D to explicitly keep the hanging indentation local, like it or
-%D not.
+%D not.
%D \SomePar
%D \localdropcaps\NiceDroppedCaps{}{cmr12}{0pt}{2}Here we need
%D to explicitly keep the hanging indentation local, like it or
-%D not.
+%D not.
%D \stopSomePar
%D \stopbuffer
-%D
+%D
%D \typebuffer \getbuffer
-%D \macros
+%D \macros
%D {AutoDroppedCaps, CheckDroppedCaps}
%D
%D {\em To be documented.}
-% example usage
+% example usage
%
% \def\bpar{\ifvmode\CheckDroppedCaps\fi}
% \def\epar{\ifhmode\par\fi\CheckDroppedCaps}
@@ -307,17 +307,17 @@
\EveryPar{\doAutoDroppedCaps}}
\let\AutoDroppedNext\relax
-
+
\def\doAutoDroppedCaps
{\ifcase\DroppedStatus % done
- \let\next\relax
+ \let\next\relax
\or % starting
- % \ifnum\lastprevgraf>0 % tricky, probably a wrong par
+ % \ifnum\lastprevgraf>0 % tricky, probably a wrong par
% \globaldropcaps\chardef\DroppedStatus=3 % and inhibits dropped
% \let\next\relax % caps after titles and more than once
- % \else % so let's nill this rubishly code fragment
+ % \else % so let's nill this rubishly code fragment
\def\next{\NiceDroppedCaps{}{\@@dcfont}{.125em}{\@@dcn}}%
- % \fi % and hope for the best
+ % \fi % and hope for the best
\or % doing
\global\advance\droppedlines \lastprevgraf
\ifnum\droppedlines=\zerocount
@@ -344,21 +344,21 @@
\fi
\next}
-%D \macros
+%D \macros
%D {LineDroppedCaps, NiceDroppedCaps}
%D
-%D To save definitions, we also provide:
+%D To save definitions, we also provide:
%D
%D \starttypen
%D \LineDroppedCaps {command} {font} {hoffset} {lines}
%D \NiceDroppedCaps {command} {font} {hoffset} {lines}
%D \stoptypen
%D
-%D The first command scales the font to the exact height, while
-%D the second command scales the font to a nice 2.5 times the
-%D line height, a value that gives a pleasant grayness.
+%D The first command scales the font to the exact height, while
+%D the second command scales the font to a nice 2.5 times the
+%D line height, a value that gives a pleasant grayness.
-\def\DoLineDroppedCaps#1#2#3#4#5% compensation command font offset lines
+\def\DoLineDroppedCaps#1#2#3#4#5% compensation command font offset lines
{\scratchcounter#5%
\advance\scratchcounter \minusone
\scratchdimen\scratchcounter\baselineskip
@@ -398,15 +398,15 @@
%D \haalbuffer
%D
%D \typebuffer
-%D
+%D
%D Before we explain the third and fourth argument, we show the
-%D implementation. Those who know a bit about the way \TEX\
+%D implementation. Those who know a bit about the way \TEX\
%D treats tokens, will probably see in one glance that this
%D alternative works all right for most text||only situations
%D in which there is enough text available for the first line,
%D but that more complicated things will blow. One has to live
%D with that. A workaround is rather trivial but obscures the
-%D principles used.
+%D principles used.
\def\TreatFirstLine#1#2#3#4% before, after, first, next
{\leavevmode
@@ -429,7 +429,7 @@
\@EA\grabfirstline
\else\ifdim\wd2>\hsize
\hbox to \hsize{\strut\unhbox0}#2\egroup
- \break##1\
+ \break##1\
\egroup
\else
\setbox0\box2
@@ -444,19 +444,19 @@
%D \getrandomfloat\FunnyB{0}{1}%
%D \definecolor[FunnyColor][r=\FunnyR,g=\FunnyG,b=\FunnyB]%
%D \color[FunnyColor]}
-%D
+%D
%D \TreatFirstLine {\bf} {} {\FunnyCommand} {\FunnyCommand}
-%D The third and fourth argument can be used to gain special
+%D The third and fourth argument can be used to gain special
%D effects on the individual words. Of course one needs ...
%D \stopbuffer
-%D
-%D \haalbuffer
-%D to know a bit more about the macro package used to get real
-%D nice effects, but this example probably demonstrates the
-%D principles well.
-%D
+%D
+%D \haalbuffer
+%D to know a bit more about the macro package used to get real
+%D nice effects, but this example probably demonstrates the
+%D principles well.
+%D
%D \typebuffer
-%D
+%D
%D Like in dropped caps case, one can hide such treatments in a
%D macro, like:
%D
@@ -465,38 +465,38 @@
%D {\TreatFirstLine{\bf}{}{\FunnyCommand}{\FunnyCommand}}
%D \stoptypen
-%D \macros
+%D \macros
%D {reshapebox}
-%D
-%D \startbuffer
+%D
+%D \startbuffer
%D \beginofshapebox
-%D When using \CONTEXT, one can also apply this funny command
-%D to whole lines by using the reshape mechanism. Describing
-%D this interesting mechanism falls outside the scope of this
-%D module, so we only show the trick. This is an example of
-%D low level \CONTEXT\ functionality: it's all there, and it's
-%D stable, but not entirely meant for novice users.
+%D When using \CONTEXT, one can also apply this funny command
+%D to whole lines by using the reshape mechanism. Describing
+%D this interesting mechanism falls outside the scope of this
+%D module, so we only show the trick. This is an example of
+%D low level \CONTEXT\ functionality: it's all there, and it's
+%D stable, but not entirely meant for novice users.
%D \endofshapebox
-%D
+%D
%D \reshapebox{\FunnyCommand{\box\shapebox}} \flushshapebox
%D \stopbuffer
-%D
+%D
%D \haalbuffer
-%D
+%D
%D \typebuffer
%D
-%D This mechanism permits hyphenation and therefore gives
-%D better results than the previously discussed macro
-%D \type{\TreatFirstLine}.
+%D This mechanism permits hyphenation and therefore gives
+%D better results than the previously discussed macro
+%D \type{\TreatFirstLine}.
%D \macros
%D {TreatFirstCharacter}
%D
%D \startbuffer
-%D \TreatFirstCharacter{\bf\color[green]} Just to be
+%D \TreatFirstCharacter{\bf\color[green]} Just to be
%D \stopbuffer
%D
-%D \haalbuffer complete we also offer a very simple one
+%D \haalbuffer complete we also offer a very simple one
%D character alternative, that is not that hard to understand:
\def\TreatFirstCharacter#1#2% command, character
@@ -523,9 +523,9 @@
%D \startbuffer
%D \StackCharacters{CONTEXT}{}{\vskip.2ex}{\FunnyCommand}
%D \stopbuffer
-%D
+%D
%D Such a stack looks like:
-%D
+%D
%D \startregelcorrectie
%D \hbox to \hsize
%D {$\hss\bfd
@@ -538,7 +538,7 @@
%D \vcenter{\StackCharacters{CONTEXT}{}{\vskip.2ex}{\FunnyCommand}}
%D \hss$}
%D \stopregelcorrectie
-%D
+%D
%D and is typeset by saying:
%D
%D \typebuffer
@@ -560,18 +560,18 @@
%D \stoptypen
%D
%D \startbuffer[a]
-%D \processtokens
-%D {\hbox to .5\hsize\bgroup} {\hfill}
+%D \processtokens
+%D {\hbox to .5\hsize\bgroup} {\hfill}
%D {\egroup} {\space} {LET'S HAVE}
%D \stopbuffer
-%D
+%D
%D \startbuffer[b]
-%D \processtokens
-%D {\vbox\bgroup\raggedcenter\hsize1em}
+%D \processtokens
+%D {\vbox\bgroup\raggedcenter\hsize1em}
%D {\vskip.25ex} {\egroup} {\strut} {FUN}
%D \stopbuffer
%D
-%D This macro is able to typeset:
+%D This macro is able to typeset:
%D
%D \leavevmode\hbox to \hsize
%D {$\hfil\hfil
@@ -586,24 +586,24 @@
%D \typebuffer[b]
%D \macros
-%D {NormalizeFontHeight, NormalizeFontWidth,
+%D {NormalizeFontHeight, NormalizeFontWidth,
%D TheNormalizedFontSize}
%D
%D Next we introduce some font manipulation macros. When we
%D want to typeset some text spread in a well defined area, it
%D can be considered bad practice to manipulate character and
%D word spacing. In such situations the next few macros can be
-%D of help:
-%D
+%D of help:
+%D
%D \starttypen
%D \NormalizeFontHeight \name {sample text} {height} {font}
%D \NormalizeFontWidth \name {sample text} {width} {font}
%D \stoptypen
-%D
+%D
%D These are implemented using an auxilliary macro:
\def\NormalizeFontHeight{\NormalizeFontSize\ht}
-\def\NormalizeFontWidth {\NormalizeFontSize\wd}
+\def\NormalizeFontWidth {\NormalizeFontSize\wd}
% \def\NormalizeFontSize#1#2#3#4#5%
% {\bgroup
@@ -624,9 +624,9 @@
% \egroup
% \expandafter\font\expandafter#2\fontname\font\relax}
%
-% the familiar struggle with accuracy forces us to use:
+% the familiar struggle with accuracy forces us to use:
-\def\NormalizeFontSize#1#2#3#4#5%
+\def\NormalizeFontSize#1#2#3#4#5%
{\bgroup
\dimen0=#4% #4 can be \ht0 or so
\setbox0\hbox{\definedfont[#5 at 5pt]#3}% 10pt
@@ -646,62 +646,62 @@
\egroup
\expandafter\font\expandafter#2\fontname\font\relax}
-%D Afterwards, we have access to the calculated size by:
+%D Afterwards, we have access to the calculated size by:
\let\TheNormalizedFontSize\!!zeropoint
-%D Extra:
+%D Extra:
-\def\WidthSpanningText#1#2#3% text width font
+\def\WidthSpanningText#1#2#3% text width font
{\hbox{\NormalizeFontWidth\temp{#1}{#2}{#3}\temp\the\everydefinedfont#1}}
%D Consider for instance:
-%D
+%D
%D \startbuffer
%D \NormalizeFontHeight \tmp {X} {2\baselineskip} {cmr10}
-%D
+%D
%D {\tmp To Be Or Not To Be}
%D \stopbuffer
-%D
+%D
%D \typebuffer
-%D
+%D
%D This shows up as (we also show the baselines):
-%D
+%D
%D {\showbaselines\haalbuffer}
-%D
+%D
%D The horizontal counterpart is:
-%D
+%D
%D \startbuffer
%D \NormalizeFontWidth \tmp {This Line Fits} {\hsize} {cmr10}
-%D
+%D
%D \hbox{\tmp This Line Fits}
%D \stopbuffer
-%D
+%D
%D \typebuffer
-%D
-%D The calculated font scale is avaliable in the macro
-%D \type{\NormalizedFontSize}.
+%D
+%D The calculated font scale is avaliable in the macro
+%D \type{\NormalizedFontSize}.
%D
%D \startregelcorrectie
%D \ruledhbox{\haalbuffer}
%D \stopregelcorrectie
%D
-%D One can of course combine these macros with the ones
+%D One can of course combine these macros with the ones
%D described earlier, like in:
-%D
+%D
%D \starttypen
%D \NormalizeFontHeight {text} \DroppedFont {2\baselineskip} {cmbx12}
-%D
+%D
%D \def\NicelyDroppedCaps
-%D {\DroppedCaps
-%D {\kleur[groen]}
-%D {\DroppedFont}
-%D {2pt}
-%D {\baselineskip}
+%D {\DroppedCaps
+%D {\kleur[groen]}
+%D {\DroppedFont}
+%D {2pt}
+%D {\baselineskip}
%D {2}}
%D \stoptypen
%D
-%D It's up to the reader to test this one.
+%D It's up to the reader to test this one.
\unexpanded\def\FirstNCharacters#1#2% \FirstNCharacters{3}{fr{\"o}beln}
{\bgroup
@@ -714,15 +714,15 @@
\handletokens#2\with\docommando
\egroup}
-%D \macros
+%D \macros
%D {FittingText}
%D
-%D First used in Pascal (demo-bbv):
-%D
+%D First used in Pascal (demo-bbv):
+%D
%D \startbuffer
%D \ruledvbox{\FittingText{3cm}{1cm}{Serif}{24pt}{1pt}{1}
%D {\veryraggedright
-%D \hangindent1em\hangafter1\relax
+%D \hangindent1em\hangafter1\relax
%D \begstrut \dorecurse{8}{Bram Marta }\unskip \endstrut}}
%D
%D \ruledvbox{\FittingText{3cm}{1cm}{Serif}{24pt}{1pt}{1}
@@ -735,19 +735,19 @@
%D \getbuffer
%D \stoplinecorrection
-% #1 width #2 height #3 font #4 size #5 step #6 interlinie #7 text
+% #1 width #2 height #3 font #4 size #5 step #6 interlinie #7 text
-\long\def\FittingText#1#2#3#4#5#6#7%
+\long\def\FittingText#1#2#3#4#5#6#7%
{\bgroup
\forgetall
\dontcomplain
\setuptolerance[\v!zeersoepel]% == \tolerance4500
- \hsize#1%
+ \hsize#1%
\def\\{\softbreak}%
\!!heighta#4%
\!!heightb#2%
\doloop
- {\ifdim\!!heighta>\!!onepoint
+ {\ifdim\!!heighta>\onepoint
\expanded{\definefont[\s!dummy][#3 at \the\!!heighta][\c!interlinie=#6]}%
\getvalue\s!dummy
\setbox\scratchbox\vbox{#7\endgraf}%
@@ -760,14 +760,14 @@
\global\dimen1\hsize
\reshapebox
{\setbox\shapebox\hbox{\unhbox\shapebox}%
- \ifdim\wd\shapebox>\dimen1
+ \ifdim\wd\shapebox>\dimen1
\global\dimen1\wd\shapebox
\fi}%
- \ifdim\dimen1>\hsize
+ \ifdim\dimen1>\hsize
\advance\!!heighta-#5%
\else
\exitloop
- \fi
+ \fi
\fi
\else
\exitloop
@@ -776,25 +776,25 @@
\unvbox\scratchbox
\egroup}
-%D New:
+%D New:
-% \font width gap font spec text
+% \font width gap font spec text
-\def\NormalizeFontWidthSpread#1#2#3#4#5#6%
+\def\NormalizeFontWidthSpread#1#2#3#4#5#6%
{\global\setfalse\NFSpread
\scratchdimen#3%
\scratchdimen-.5\scratchdimen
\advance\scratchdimen#2\relax
- \NormalizeFontWidth
+ \NormalizeFontWidth
#1%
{\def\+{\global\settrue\NFSpread\gobbleuntil\relax}%
- \def\\{\gobbleuntil\relax}% newline
+ \def\\{\gobbleuntil\relax}% newline
\setupspacing
#6\relax}%
{\scratchdimen}%
{#4}%
\ifconditional\NFSpread
- % de gap valt in de binding
+ % de gap valt in de binding
\else
\definefont[\strippedcsname#1][#4 #5]%
\fi}
diff --git a/tex/context/base/supp-lan.tex b/tex/context/base/supp-lan.tex
index 777c99454..460cb02f1 100644
--- a/tex/context/base/supp-lan.tex
+++ b/tex/context/base/supp-lan.tex
@@ -501,7 +501,7 @@
{\ifx,\nextnext
\def\nextnextnext{\afterassignment\egroup\let\next=}%
\else
- \let\nextnext=\relax
+ \let\nextnext\relax
\fi}
%D The macro \type{\checkbeforediscretionary} takes care of
@@ -1350,13 +1350,17 @@
\flushurl\splitafter:%
\else\if#1.%
\flushurl\splitafter.%
+ \else\if#1(%
+ \flushurl\splitbefore(%
+ \else\if#1)%
+ \flushurl\splitafter)%
\else
\ifx\savedurl\empty\else
\splitbefore\savedurl
\let\savedurl\empty
\fi
#1%
- \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
%D When Joop Susan asked (on the \CONTEXT\ mailing list) how
%D to handle url's passed as argument, the following solutions
diff --git a/tex/context/base/supp-mis.tex b/tex/context/base/supp-mis.tex
index a5865f9c4..5503f371f 100644
--- a/tex/context/base/supp-mis.tex
+++ b/tex/context/base/supp-mis.tex
@@ -8,8 +8,8 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
%D Some support modules are more or less independant. This
%D module, which is not part of plain \CONTEXT, provides the
@@ -17,20 +17,20 @@
\ifx \undefined \writestatus \else \expandafter \endinput \fi
-\ifx \undefined \pdfoutput \chardef\pdfoutput=0 \fi
+\ifx \undefined \pdfoutput \chardef\pdfoutput=0 \fi
%D Because \LATEX\ has no safe package loading mechanism, we
-%D need to take care of possible interference.
+%D need to take care of possible interference.
-\def\StartLatexHack%
+\def\StartLatexHack%
{\edef\StopLatexHack
- {\catcode`\noexpand/=\the\catcode`/
+ {\catcode`\noexpand/=\the\catcode`/
\catcode`\noexpand:=\the\catcode`:
\catcode`\noexpand;=\the\catcode`;
\catcode`\noexpand"=\the\catcode`"
- \catcode`\noexpand<=\the\catcode`<
+ \catcode`\noexpand<=\the\catcode`<
\catcode`\noexpand>=\the\catcode`>}%
- \catcode`/=12 \catcode`:=12 \catcode`;=12
+ \catcode`/=12 \catcode`:=12 \catcode`;=12
\catcode`"=12 \catcode`<=12 \catcode`>=12 }
%D This hack is needed especially for \LATEX\ users who use
@@ -40,7 +40,7 @@
%D pointing that out and testing). Potentially active \type
%D {?}'s and \type {!}'s are less dangerous since they are
%D handled by the \type {\protect} and \type {\unprotect}
-%D macros.
+%D macros.
\StartLatexHack
@@ -70,7 +70,7 @@
\expandafter\gobblecontextobject
\fi}
-%D \macros
+%D \macros
%D {beginETEX,beginTEX}
%D
%D Outside \CONTEXT\ we will not be \ETEX||aware.
@@ -160,15 +160,16 @@
\ifnocontextobject \scratchread \do \newread \scratchread \fi
\ifnocontextobject \scratchwrite \do \newwrite \scratchwrite \fi
-\ifnocontextobject \zeropoint \do \newdimen \zeropoint \fi
-\ifnocontextobject \zerocount \do \chardef \zerocount=0 \fi
-\ifnocontextobject \plusone \do \chardef \plusone =1 \fi
+\ifnocontextobject \zeropoint \do \let \zeropoint \z@ \fi
+\ifnocontextobject \onepoint \do \let \onepoint \p@ \fi
+\ifnocontextobject \zerocount \do \chardef \zerocount =0 \fi
+\ifnocontextobject \plusone \do \chardef \plusone =1 \fi
\ifnocontextobject \minusone \do \newcount \minusone \fi
\ifnocontextobject \thousandpoint \do \newdimen \thousandpoint \fi
-\thousandpoint=1000pt
-\minusone = -1
+\thousandpoint=1000pt
+\minusone = -1
\ifnocontextobject \emptytoks \do \newtoks \emptytoks \fi
@@ -203,10 +204,10 @@
\def\s!pt{pt}
\def\s!bp{bp}
-%D \macros
+%D \macros
%D {@EA,expanded,expandoneargafter,expandtwoargsafter}
%D
-%D Also needed:
+%D Also needed:
\let\@EA=\expandafter \let\@@expanded\empty
@@ -278,9 +279,9 @@
\ifnocontextobject \smashbox \do
\def\smashbox#1%
- {\wd#1=\!!zeropoint
- \ht#1=\!!zeropoint
- \dp#1=\!!zeropoint}
+ {\wd#1\zeropoint
+ \ht#1\zeropoint
+ \dp#1\zeropoint}
\fi
@@ -361,10 +362,10 @@
\ifnocontextobject \forgetall \do
- \def\forgetall%
- {\parskip\!!zeropoint
- \leftskip\!!zeropoint
- \parindent\!!zeropoint
+ \def\forgetall
+ {\parskip\zeropoint
+ \leftskip\zeropoint
+ \parindent\zeropoint
\everypar{}}
\fi
@@ -393,9 +394,9 @@
\scratchdimen=.996264\scratchdimen
\edef#2{\withoutpt{\the\scratchdimen}}}
- \def\ScaledPointsToWholeBigPoints#1#2%
+ \def\ScaledPointsToWholeBigPoints#1#2%
{\scratchdimen=#1sp
- \scratchdimen=.996264\scratchdimen
+ \scratchdimen=.996264\scratchdimen
\scratchcounter=\scratchdimen
\advance\scratchcounter by 32768
\divide\scratchcounter by 65536
@@ -421,7 +422,7 @@
\closein#1\relax
\else
\fileprocessedtrue
- \gdef\dofinishfile%
+ \gdef\dofinishfile%
{\closein#1\relax
\global\let\doprocessline\relax}%
\gdef\doprocessline%
@@ -449,9 +450,9 @@
\def\dospecials
{\do\ \do\\\do\{\do\}\do\$%
\do\#\do\^\do\_\do\&\do\%%
- \do\~\do\^^A\do\^^K}
-
-\fi
+ \do\~\do\^^A\do\^^K}
+
+\fi
\ifnocontextobject \uncatcodespecials \do
@@ -475,8 +476,8 @@
\catcode`\==\@@other \catcode`\<=\@@other \catcode`\>=\@@other
\catcode`\"=\@@other \catcode`\'=\@@other \catcode`\`=\@@other
\catcode`\:=\@@other \catcode`\;=\@@other
- \catcode`\,=\@@other \catcode`\.=\@@other \catcode`\~=\@@other
- \catcode`\(=\@@other \catcode`\)=\@@other
+ \catcode`\,=\@@other \catcode`\.=\@@other \catcode`\~=\@@other
+ \catcode`\(=\@@other \catcode`\)=\@@other
\catcode`\{=\@@other \catcode`\}=\@@other
\catcode`\\=\@@other \catcode`\%=\@@other }
@@ -513,19 +514,19 @@
%D \macros
%D {dostepwiserecurse, dorecurse, doloop, exitloop}
-%D
-%D The next loop macro is a real weak one, and does not offer
-%D the full \CONTEXT\ functionality, let alone nesting, but
-%D for simple purposes, its behaviour is acceptable.
+%D
+%D The next loop macro is a real weak one, and does not offer
+%D the full \CONTEXT\ functionality, let alone nesting, but
+%D for simple purposes, its behaviour is acceptable.
\newcount\recursecounter
-\def\dostepwiserecurse#1#2#3#4% very weak and rubishly version
+\def\dostepwiserecurse#1#2#3#4% very weak and rubishly version
{\ifnum#2<#1\relax\else\dodostepwiserecurse{#1}{#2}{#3}{#4}\fi}
-\def\dodostepwiserecurse#1#2#3#4% very weak and rubishly version
+\def\dodostepwiserecurse#1#2#3#4% very weak and rubishly version
{\recursecounter=#1\relax
- \loop
+ \loop
\edef\recurselevel{\the\recursecounter}%
#4\relax
\ifnum\recursecounter<#2\relax
@@ -541,12 +542,12 @@
\def\exitloop%
{\recursecounter=\maxdimen}
-%D \macros
+%D \macros
%D {ifundefined,doifdefined,doifundefined,
%D doifdefinedelse,doifundefinedelse}
%D
-%D These alteratives are not robust but suitable for simple
-%D usage. The official ones are a bit faster.
+%D These alteratives are not robust but suitable for simple
+%D usage. The official ones are a bit faster.
\ifnocontextobject \doifdefined \do
@@ -570,18 +571,18 @@
%D \macros
%D {doifinstringelse}
%D
-%D It seems like we end up with more and more macros here.
-%D Sigh.
+%D It seems like we end up with more and more macros here.
+%D Sigh.
\ifnocontextobject \doifinstringelse \do
\def\p!doifinstringelse#1#2%
{\def\pp!doifinstringelse##1#1##2##3\war%
{\csname if\if##2@fals\else tru\fi e\endcsname}%
- \expanded{\pp!doifinstringelse#2#1@@\noexpand\war}}
+ \expanded{\pp!doifinstringelse#2#1@@\noexpand\war}}
\long\def\doifinstringelse#1#2#3#4%
- {\edef\@@@instring{#1}%
+ {\edef\@@@instring{#1}%
\@EA\p!doifinstringelse\@EA{\@@@instring}{#2}#3\else#4\fi}
\fi
@@ -589,31 +590,31 @@
%D \macros
%D {twodigitrounding}
%D
-%D We don't support rounding outside \CONTEXT. Sorry.
+%D We don't support rounding outside \CONTEXT. Sorry.
\def\twodigitrounding#1{#1}
-%D \macros
+%D \macros
%D {lineheight}
%D
-%D In \CONTEXT\ we have \type{\lineheight}, which in many
-%D cases matches \type {\baselineskip}.
+%D In \CONTEXT\ we have \type{\lineheight}, which in many
+%D cases matches \type {\baselineskip}.
\ifnocontextobject \lineheight \do
\def\lineheight{\baselineskip}
-\fi
+\fi
-%D \macros
+%D \macros
%D {dohandletokens}
%D
-%D The following macro is the simplified version, but good
-%D enough for day to day hacks.
+%D The following macro is the simplified version, but good
+%D enough for day to day hacks.
%D
-%D \starttypen
+%D \starttypen
%D \dohandletokens some text\with\somemacro
-%D \stoptypen
+%D \stoptypen
\ifnocontextobject \dohandletokens \do
@@ -632,7 +633,7 @@
\fi
-%D Very reduced:
+%D Very reduced:
\long\def\appendtoks#1\to#2%
{\scratchtoks{#1}\expanded{#2{\the#2\the\scratchtoks}}}
@@ -649,11 +650,11 @@
\immediate\closein\scratchread
\next}
-%D New.
+%D New.
\let\donothing\empty
-%D Also new:
+%D Also new:
\def\letempty #1{\let#1\empty}
\def\globalletempty#1{\global\let#1\empty}
@@ -661,7 +662,7 @@
\def\letvalueempty #1{\expandafter\let\csname#1\endcsname\empty}
\def\letgvalueempty#1{\global\expandafter\let\csname#1\endcsname\empty}
-%D Sigh
+%D Sigh
\def\settrue #1{\chardef#1\zerocount}
\def\setfalse#1{\chardef#1\plusone}
diff --git a/tex/context/base/supp-mpe.tex b/tex/context/base/supp-mpe.tex
index 3d92961f9..a964b450e 100644
--- a/tex/context/base/supp-mpe.tex
+++ b/tex/context/base/supp-mpe.tex
@@ -12,10 +12,10 @@
%C details.
% fuzzy and complicating is the fact that we need to support
-% context as well as mptopdf, so we cannot fall back on the
-% special drivers and color module (although there may be
-% good reasons to use a smaller context instead); also,
-% shading is handled here while it should move to the special
+% context as well as mptopdf, so we cannot fall back on the
+% special drivers and color module (although there may be
+% good reasons to use a smaller context instead); also,
+% shading is handled here while it should move to the special
% driver - to do!
%D This module is still experimental and deals with some
@@ -180,7 +180,7 @@
%D \METAPOST strips trailing zeros, we have to padd the string.
\newif\ifMPcmykcolors
-\newif\ifMPspotcolors
+\newif\ifMPspotcolors
\ifx\normalhandleMPrgbcolor\undefined % in case we reload this module
@@ -308,14 +308,14 @@
% \writestatus{MPtoPDF}{unknown direct special}%
\fi}
-\def\dointerceptMPcmykcolor
+\def\dointerceptMPcmykcolor
{\revokeMPtransparencyspecial
\@EA\ifx\csname\@@MPSK\number\MPrgbnumber\lastMPbvalue\endcsname\relax\else
\@EA\@EA\@EA\setMPcmyk\csname\@@MPSK\number\MPrgbnumber\lastMPbvalue\endcsname
\normalhandleMPcmykcolor
\fi}
-\def\dointerceptMPspotcolor
+\def\dointerceptMPspotcolor
{\revokeMPtransparencyspecial
\@EA\ifx\csname\@@MPSP\number\MPrgbnumber\lastMPbvalue\endcsname\relax\else
\@EA\@EA\@EA\setMPspot\csname\@@MPSP\number\MPrgbnumber\lastMPbvalue\endcsname
@@ -323,7 +323,7 @@
\fi}
\def\handleMPrgbcolor
- {\resetMPcolor
+ {\resetMPcolor
\ifcase\MPspecialversion
\normalhandleMPrgbcolor
\else
@@ -331,18 +331,18 @@
\ifnum\MPrgbnumber\lastMPrvalue=\MPspecialsignal\relax
\interceptMPcmykcolor
\else
- \revokeMPtransparencyspecial
+ \revokeMPtransparencyspecial
\normalhandleMPrgbcolor
\fi
\fi}
\def\handleMPgraycolor
- {\resetMPcolor
+ {\resetMPcolor
\ifcase\MPspecialversion \else \revokeMPtransparencyspecial \fi
\normalhandleMPgraycolor}
\def\handleMPcmykcolor
- {\resetMPcolor
+ {\resetMPcolor
\ifcase\MPspecialversion \else \revokeMPtransparencyspecial \fi
\normalhandleMPcmykcolor}
@@ -557,7 +557,7 @@
\appendtoks \invokeMPshadespecial \to \invokeMPspecials
%D We need to convert the \CMYK\ specials into colors, because
-%D we have to do it twice, we define a macro.
+%D we have to do it twice, we define a macro.
% \def\checkMPshadingcolor#1#2#3#4#5%
% {\edef\tempMPrvalue{\csname\@@MP0#1\endcsname}%
@@ -569,9 +569,9 @@
% \ifx\tempMPgvalue\tempMPbvalue
% \tempMPbvalue
% \fi
-% \fi
+% \fi
% \fi}%
-% \edef#4% todo : spotcolors
+% \edef#4% todo : spotcolors
% {\ifnum\MPrgbnumber\tempMPrvalue=\MPspecialsignal\space
% \ifMPcmykcolors\getvalue{\@@MPSK\number\MPrgbnumber\tempMPbvalue}\fi
% \fi}}
@@ -584,26 +584,26 @@
\global\let\MPresolvedcolor\!!zerocount
\ifnum\MPrgbnumber\tempMPrvalue=\MPspecialsignal\relax
\ifcase\MPrgbnumber\tempMPgvalue
- \or % 1 = cmyk
+ \or % 1 = cmyk
\ifMPcmykcolors
\expanded{\resolveMPcmykcolor\getvalue{\@@MPSK\number\MPrgbnumber\tempMPbvalue}}\end
\fi
- \or % 2 = spot
+ \or % 2 = spot
\ifMPspotcolors
\expanded{\resolveMPspotcolor\getvalue{\@@MPSP\number\MPrgbnumber\tempMPbvalue}}\end
\fi
- \or
- % 3 = rgb transparency
- % to do
+ \or
+ % 3 = rgb transparency
+ % to do
\or
% 4 == cmyk transparency
- % \ifMPcmykcolors
- % to do
- % \fi
+ % \ifMPcmykcolors
+ % to do
+ % \fi
\or
% 5 == spot transparency
% \ifMPspotcolors
- % to do
+ % to do
% \fi
\fi
\else
@@ -620,10 +620,10 @@
\let#4\MPresolvedcolor
\let#5\MPresolvedspace}
-%D We also need to make sure that we have two \RGB\ or
-%D \CMYK colors, since we have to set the colorspace.
+%D We also need to make sure that we have two \RGB\ or
+%D \CMYK colors, since we have to set the colorspace.
-\def\setMPshadingcolors#1#2#3#4#5#6% color space
+\def\setMPshadingcolors#1#2#3#4#5#6% color space
{\checkMPshadingcolor{#1}{#2}{#3}\MPshadeAc\MPshadeAs
\checkMPshadingcolor{#4}{#5}{#6}\MPshadeBc\MPshadeBs
\ifx\MPshadeAs\MPshadeBs
@@ -649,7 +649,7 @@
\fi
\let\MPshadeC\MPshadeAs
\else
- % different color spaces
+ % different color spaces
\def\MPshadeA{1}%
\def\MPshadeB{1}%
\let\MPshadeC\MPgrayspace
@@ -661,9 +661,9 @@
%D The reason why this macro is a bit complicates is that we
%D handle black and white situations (otherwise we would have
-%D to use \CMYK\ b/w in case of a \CMYK\ shade).
+%D to use \CMYK\ b/w in case of a \CMYK\ shade).
-%D Here are the special handlers:
+%D Here are the special handlers:
\defineMPspecial{30}
{\startMPshading{14}% type 2
@@ -725,7 +725,7 @@
%
% better, since xform reuse
-\def\handleMPfigurespecial#1#2#3#4#5#6#7% todo : combine with ext fig
+\def\handleMPfigurespecial#1#2#3#4#5#6#7% todo : combine with ext fig
{\vbox to \zeropoint
{\vss
\hbox to \zeropoint
@@ -815,12 +815,12 @@
%D {\CMYK\ support disabled,
%D conversion to \RGB.}
%D {\setupcolors[cmyk=nee,status=start]\haalbuffer[cmyk]}
-%D
+%D
%D \plaatsfiguur
%D {\CMYK\ support enabled,
%D no support in \METAPOST.}
%D {\setupcolors[cmyk=ja,mpcmyk=nee,status=start]\haalbuffer[cmyk]}
-%D
+%D
%D \plaatsfiguur
%D {\CMYK\ support enabled,
%D no conversion to \RGB,
@@ -831,7 +831,7 @@
{\ifMPcmykcolors
\setxvalue{\@@MPSK\gMPs1}{\gMPs2 \gMPs3 \gMPs4 \gMPs5 }%
\fi}
-
+
\def\setMPcmyk#1 #2 #3 #4 %
{\setvalue{\@@MP01}{#1}%
\setvalue{\@@MP02}{#2}%
@@ -857,11 +857,11 @@
\def\checkMPspot#1#2%
{\expanded{\resolveMPspotcolor#1 #2}\end
\ifx\MPspotspace\MPresolvedspace
- \edef\MPspotspacespec{/\MPspotspace\space}%
+ \edef\MPspotspacespec{/\MPspotspace\space}%
\doifinstringelse\MPspotspacespec\currentMPcolorspaces
\donothing\registerMPcolorspace
\fi}
-
+
%D This special (number 50) passes positions to a tex file.
%D This method uses a two||pass approach an (mis|)|used the
%D context positioning macros. In \type {core-pos} we will
@@ -974,16 +974,16 @@
\def\PDFtransparencyspec
{\ifx\MPresolvedspace\MPgrayspace
\MPresolvedcolor\space g \MPresolvedcolor\space G%
- \else\ifx\MPresolvedspace\MPrgbspace
+ \else\ifx\MPresolvedspace\MPrgbspace
\MPresolvedcolor\space rg \MPresolvedcolor\space RG%
- \else\ifx\MPresolvedspace\MPcmykspace
+ \else\ifx\MPresolvedspace\MPcmykspace
\MPresolvedcolor\space k \MPresolvedcolor\space K%
\else\ifx\MPresolvedspace\empty\else
- /\MPresolvedspace\space cs \MPresolvedcolor\space sc
+ /\MPresolvedspace\space cs \MPresolvedcolor\space sc
/\MPresolvedspace\space CS \MPresolvedcolor\space SC%
- \fi\fi\fi\fi}
+ \fi\fi\fi\fi}
-\defineMPspecial{3} % rgb
+\defineMPspecial{3} % rgb
{\edef\currentMPspecial{\gMPs6}%
\presetPDFtransparency{\gMPs1}{\gMPs2}%
\expanded{\resolveMPrgbcolor\gMPs3 \gMPs4 \gMPs5}\end
@@ -993,7 +993,7 @@
{\PDFtransparencyreference}%
{\PDFtransparencyspec}}}
-\defineMPspecial{4} % cmyk
+\defineMPspecial{4} % cmyk
{\edef\currentMPspecial{\gMPs7}%
\presetPDFtransparency{\gMPs1}{\gMPs2}%
\expanded{\resolveMPcmykcolor\gMPs3 \gMPs4 \gMPs5 \gMPs6}\end
@@ -1003,12 +1003,12 @@
{\PDFtransparencyreference}%
{\PDFtransparencyspec}}}
-%\defineMPspecial{5} % spot
+%\defineMPspecial{5} % spot
% {\edef\currentMPspecial{\gMPs5}%
% \presetPDFtransparency{\gMPs1}{\gMPs2}%
% \expanded{\resolveMPspotcolor\gMPs3 \gMPs4}\end
% \ifx\MPspotspace\MPresolvedspace
-% \edef\MPspotspacespec{/\MPspotspace\space}%
+% \edef\MPspotspacespec{/\MPspotspace\space}%
% \doifinstringelse\MPspotspacespec\currentMPcolorspaces
% \donothing\registerMPcolorspace
% \fi
@@ -1018,7 +1018,7 @@
% {\PDFtransparencyreference}%
% {\PDFtransparencyspec}}}
-\defineMPspecial{5} % spot
+\defineMPspecial{5} % spot
{\edef\currentMPspecial{\gMPs5}%
\presetPDFtransparency{\gMPs1}{\gMPs2}%
\checkMPspot{\gMPs3}{\gMPs4}%
@@ -1028,7 +1028,7 @@
{\PDFtransparencyreference}%
{\PDFtransparencyspec}}}
-% beware: for the moment only supported in pdftex; needs a cleanup!
+% beware: for the moment only supported in pdftex; needs a cleanup!
\def\registerMPcolorspace
{\doifobjectreferencefoundelse{PDFCS}\MPspotspace
@@ -1036,8 +1036,8 @@
\xdef\currentMPcolorspaces
{\currentMPcolorspaces\MPspotspacespec\PDFobjectreference\space}}
\donothing}
-
-%D We need to add resource specifications!
+
+%D We need to add resource specifications!
\appendtoks
\global\let\currentMPcolorspaces\empty
@@ -1096,7 +1096,7 @@
\let\revokeMPtransparencyspecial\relax
-\appendtoks
+\appendtoks
\revokeMPtransparencyspecial
\to \MPstopresources
@@ -1171,14 +1171,14 @@
\edef\PDFtransparencyreference{\getvalue{\@@MPSTO#1:#2} 0 R}}
\def\PDFtransparencydictionary#1#2#3% type fraction extras
- {<</Type /ExtGState
+ {<</Type /ExtGState
/ca #2 /CA #2
- /BM /\ifcase#1 Normal\or Normal\or Multiply\or Screen\or
- Overlay\or SoftLight\or HardLight\or ColorDodge\or
- ColorBurn\or Darken\or Lighten\or Difference\or
+ /BM /\ifcase#1 Normal\or Normal\or Multiply\or Screen\or
+ Overlay\or SoftLight\or HardLight\or ColorDodge\or
+ ColorBurn\or Darken\or Lighten\or Difference\or
Exclusion\else Compatible\fi
#3>>}
-
+
\fi
\appendtoks
@@ -1195,17 +1195,17 @@
%D In all cases, we need to keep track of the resources
%D used.
-%D A few auxiliary macros:
+%D A few auxiliary macros:
\def\MPgrayspace{DeviceGray}
\def\MPrgbspace {DeviceRGB}
\def\MPcmykspace{DeviceCMYK}
\let\MPspotspace\MPgrayspace
-\def\MPcmykBlack{0 0 0 0}
-\def\MPcmykWhite{0 0 0 1}
+\def\MPcmykBlack{0 0 0 0}
+\def\MPcmykWhite{0 0 0 1}
-\ifCONTEXT
+\ifCONTEXT
\def\startMPcolorresolve
{\bgroup
@@ -1222,21 +1222,21 @@
{\global\let\MPspotspace\empty
\xdef\MPresolvedspace{##1}%
\xdef\MPresolvedcolor{##2}%
- \global\let\MPspotspace\MPresolvedspace}% signal
+ \global\let\MPspotspace\MPresolvedspace}% signal
\dostartgraycolormode\!!zerocount} % kind of hackery initialization
\let\stopMPcolorresolve\egroup
-
+
\def\resolveMPrgbcolor#1 #2 #3\end
{\startMPcolorresolve
\execcolorR#1:#2:#3:0:0\od
\stopMPcolorresolve}
-
+
\def\resolveMPcmykcolor#1 #2 #3 #4\end
{\startMPcolorresolve
\execcolorC#1:#2:#3:#4:0:0\od
\stopMPcolorresolve}
-
+
\def\resolveMPgraycolor#1\end
{\startMPcolorresolve
\execcolorS#1:0:0\od
@@ -1245,7 +1245,7 @@
\def\resolveMPspotcolor#1 #2\end
{\startMPcolorresolve
\execcolorP#1:#2:0:0\od
- \stopMPcolorresolve}
+ \stopMPcolorresolve}
\else
@@ -1256,11 +1256,11 @@
\def\resolveMPrgbcolor#1 #2 #3\end
{\global\let\MPresolvedspace\MPrgbspace
\xdef\MPresolvedcolor{#1 #2 #3}}
-
+
\def\resolveMPcmykcolor#1 #2 #3 #4\end
{\global\let\MPresolvedspace\MPcmykspace
\xdef\MPresolvedcolor{#1 #2 #3 #4}}
-
+
\def\resolveMPgraycolor#1\end
{\global\let\MPresolvedspace\MPgrayspace
\xdef\MPresolvedcolor{#1}} % should be inverted
diff --git a/tex/context/base/supp-mrk.tex b/tex/context/base/supp-mrk.tex
index 34d484946..725f3138a 100644
--- a/tex/context/base/supp-mrk.tex
+++ b/tex/context/base/supp-mrk.tex
@@ -8,23 +8,23 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
-%D Remark: due to the lack of \type {\clearmark}, the \ETEX\
-%D dedicated mechanism is not yet operational.
+%D Remark: due to the lack of \type {\clearmark}, the \ETEX\
+%D dedicated mechanism is not yet operational.
%D This module has deverted so much from the original that I
-%D can probably rewrite it to a more efficient one now and
+%D can probably rewrite it to a more efficient one now and
%D I will do so.
%D There are 256 \COUNTERS, \DIMENSIONS, \SKIPS, \MUSKIPS\ and
%D \BOXES, 16~in- and output buffers, but there is only one
%D \MARK. In TugBoat~8 (1987, no~1) Jim Fox presents a set of
%D macros that can be used to mimmick multiple marks. We
-%D gladly adopt them here. I may rewrite this module from
+%D gladly adopt them here. I may rewrite this module from
%D scratch some day, since some low level \CONTEXT\ commands
-%D can be used.
+%D can be used.
%D
%D This module was changed on behalf of \ETEX. The main
%D extension is that \type{\get..} and alike is used instead of
@@ -40,7 +40,7 @@
\let\normalsplitbotmark = \splitbotmark
\let\normalsplitfirstmark = \splitfirstmark
-\beginETEX \marks cum suis
+\beginETEX \marks cum suis
\let\normalmarks = \marks
\let\normaltopmarks = \topmarks
@@ -53,18 +53,18 @@
\unprotect
-%D We start with the presetting the interface macros.
-%D
+%D We start with the presetting the interface macros.
+%D
%D \starttabulatie[|||]
-%D \NC \type{\getmarks} \NC sets the marks to their values \NC \NR
-%D \NC \type{\getallmarks} \NC sets all marks to their values \NC \NR
-%D \NC \type{\getsplitmarks} \NC sets the splitmarks to their values\NC \NR
-%D \NC \type{\getallsplitmarks} \NC sets all splitmarks to their values\NC \NR
-%D \NC \type{\setmarks} \NC synchronizes topmarks (\ETEX) \NC \NR
+%D \NC \type{\getmarks} \NC sets the marks to their values \NC \NR
+%D \NC \type{\getallmarks} \NC sets all marks to their values \NC \NR
+%D \NC \type{\getsplitmarks} \NC sets the splitmarks to their values\NC \NR
+%D \NC \type{\getallsplitmarks} \NC sets all splitmarks to their values\NC \NR
+%D \NC \type{\setmarks} \NC synchronizes topmarks (\ETEX) \NC \NR
%D \stoptabulatie
%D
-%D Later we will overload these, dependent of the brand of
-%D \TEX\ that we use.
+%D Later we will overload these, dependent of the brand of
+%D \TEX\ that we use.
\let \getmarks \gobbleoneargument
\let \getallmarks \relax
@@ -82,7 +82,7 @@
%D
%D We can force expansion of marks with the following switch.
-\newif\ifexpandmarks \expandmarkstrue % hm, true indeed ?
+\newif\ifexpandmarks \expandmarkstrue % hm, true indeed ?
\beginTEX
@@ -188,7 +188,7 @@
%D command name constructors of Jim. This alternative leads to
%D a more readable source (we hope).
-\def\makemarknames#1% kan genest werken
+\def\makemarknames#1% kan genest werken
{\bgroup
\escapechar=-1
\xdef\markname{\string#1}%
@@ -204,7 +204,7 @@
%D make calls from outside the output routine a bit more
%D robust.
-\let\domark\relax % saves a restore on the stack
+\let\domark\relax % saves a restore on the stack
\def\definenewmark#1#2%
{\bgroup
@@ -266,7 +266,7 @@
\noexpand\domark
\the\currentmarker{#2}}%
\else
- \!!toksb\@EA{#2}% one level, why ? handy for cs
+ \!!toksb\@EA{#2}% one level, why ? handy for cs
\setxvalue\marklist
{\the\!!toksa
\noexpand\domark
@@ -290,36 +290,36 @@
%D found, this macro is reassigned and from then on serves
%D in building the new list.
-% Although the next couple of macros are already defined
-% in syst-gen.tex, we repeat them here.
+% Although the next couple of macros are already defined
+% in syst-gen.tex, we repeat them here.
-\let\normalfi \fi % replaces \@fi
+\let\normalfi \fi % replaces \@fi
\let\normalelse \else % replaces \@else
-\let\normalor \or % replaces \@or
+\let\normalor \or % replaces \@or
% Hm, resetting \!!toksa got lost and took me a half a day to
-% trace down ([] showed up in the pagebody); I really have
+% trace down ([] showed up in the pagebody); I really have
% to clean up this messy module (write it from scratch).
-\newif\ifnofirstmarker % an auxiliary switch
+\newif\ifnofirstmarker % an auxiliary switch
\def\getmarks#1%
{\bgroup
\makemarknames{#1}%
\edef\topmarker{0\normaltopmark}%
\edef\botmarker{0\normalbotmark}%
- \!!toksa\emptytoks
- \!!toksb\emptytoks
- \nofirstmarkertrue
- % does more worse than good
+ \!!toksa\emptytoks
+ \!!toksb\emptytoks
+ \nofirstmarkertrue
+ % does more worse than good
\let\fi\relax
\let\or\relax
\let\else\relax
%
\let\domark\doscanmarks
- \getvalue{\marklist}\lastmark
+ \getvalue\marklist\lastmark
%\message{markstatus : [\the\!!toksa\the\!!toksb\the\!!toksc]}%
- \long\setxvalue{\marklist}{\the\!!toksa\the\!!toksb\the\!!toksc}%
+ \long\setxvalue\marklist{\the\!!toksa\the\!!toksb\the\!!toksc}%
\egroup}
\def\getsplitmarks#1%
@@ -328,10 +328,10 @@
% \@EA\let\@EA\savedmarklist\@EA\csname\marklist\endcsname
\edef\topmarker{0\normalsplitfirstmark}%
\edef\botmarker{0\normalsplitbotmark}%
- \!!toksa\emptytoks
- \!!toksb\emptytoks
+ \!!toksa\emptytoks
+ \!!toksb\emptytoks
\nofirstmarkertrue
- % does more worse than good
+ % does more worse than good
\let\fi\relax
\let\or\relax
\let\else\relax
@@ -369,30 +369,30 @@
\def\doscanmarks%
{\afterassignment\dodoscanmarks\scratchcounter=}
-\long\def\dorecovermarks#1\lastmark% nice trick
+\long\def\dorecovermarks#1\lastmark% nice trick
{\!!toksc{\domark#1}}
-\def\lastmark% rest of trick
+\def\lastmark% rest of trick
{\!!toksc\emptytoks}
\endTEX
-%D The \ETEX\ way of doing things \unknown
+%D The \ETEX\ way of doing things \unknown
-\beginETEX \marks cum suis
+\beginETEX \marks cum suis
-\newtoks \listofmarks
+\newtoks \listofmarks
-\def\@@prk{prk:}
-\def\@@mrk{mrk:}
-\def\@@trk{trk:}
-\def\@@frk{frk:}
-\def\@@brk{brk:}
+\def\@@prk{prk:}
+\def\@@mrk{mrk:}
+\def\@@trk{trk:}
+\def\@@frk{frk:}
+\def\@@brk{brk:}
\def\@@crk{crk:}
-%D We will use two state variables per mark, one to signal
-%D that a new mark value is set, and one to trigger (on the
-%D next page) the setting of the top mark.
+%D We will use two state variables per mark, one to signal
+%D that a new mark value is set, and one to trigger (on the
+%D next page) the setting of the top mark.
\def\checkedtopmarks #1{\csname\@@trk\string#1\endcsname}
\def\checkedfirstmarks#1{\csname\@@frk\string#1\endcsname}
@@ -406,20 +406,20 @@
\@EA\normalmarks\csname\@@prk\string#1\endcsname{\realfolio}%
\ifexpandmarks\@EA\setexpandedmark\else\@EA\setnormalmark\fi#1}
-\def\setexpandedmark#1#2% % marks expand anyway
+\def\setexpandedmark#1#2% % marks expand anyway
{\@EA\xdef\csname\@@crk\string#1\endcsname{#2}%
- \normalmarks#1{#2}}
+ \normalmarks#1{#2}}
-\def\setnormalmark#1#2% using a tok prevents unwanted expansion in mark
- {\scratchtoks{#2}%
+\def\setnormalmark#1#2% using a tok prevents unwanted expansion in mark
+ {\scratchtoks{#2}%
\@EA\xdef\csname\@@crk\string#1\endcsname{\the\scratchtoks}%
- \normalmarks#1{\the\scratchtoks}} % one level expansion
+ \normalmarks#1{\the\scratchtoks}} % one level expansion
-\def\checktopmark#1%
+\def\checktopmark#1%
{%\writestatus{marks}{checking \string#1}\wait
\ifcase\csname\@@mrk\string#1\endcsname\else\dochecktopmark#1\fi}
-%\def\dochecktopmark#1%
+%\def\dochecktopmark#1%
% {\ifcase0\@EA\normalfirstmarks\csname\@@prk\string#1\endcsname\else
% \@EA\ifx\csname\@@frk\string#1\endcsname\empty
% \@EA\gdef\csname\@@frk\string#1\endcsname{\normalfirstmarks#1}%
@@ -441,7 +441,7 @@
\fi
\fi}
-%\def\resetmark#1% we cannot use \normalmarks#1{}
+%\def\resetmark#1% we cannot use \normalmarks#1{}
% {\global\@EA\chardef\csname\@@mrk\string#1\endcsname\zerocount
% \@EA\normalmarks\csname\@@prk\string#1\endcsname{0}%
% \global\@EA\let\csname\@@trk\string#1\endcsname\empty
@@ -458,28 +458,28 @@
\global\@EA\let\csname\@@crk\string#1\endcsname\empty}
\def\definenewmark#1%
- {\ifcsname\@@prk\string#1\endcsname\else % this is etex -)
- \newmarks#1\doglobal\appendtoks\checktopmark#1\to\listofmarks
- \@EA\newmarks\csname\@@prk\string#1\endcsname % status mark
+ {\ifcsname\@@prk\string#1\endcsname\else % this is etex -)
+ \newmarks#1\doglobal\appendtoks\checktopmark#1\to\listofmarks
+ \@EA\newmarks\csname\@@prk\string#1\endcsname % status mark
\fi
\global\@EA\mathchardef\csname\@@mrk\string#1\endcsname\zerocount
\global\@EA\let\csname\@@crk\string#1\endcsname\empty
- \@EA\gdef\csname\@@trk\string#1\endcsname{\normaltopmarks #1}%
+ \@EA\gdef\csname\@@trk\string#1\endcsname{\normaltopmarks #1}%
\@EA\gdef\csname\@@frk\string#1\endcsname{\normalfirstmarks#1}%
\@EA\gdef\csname\@@brk\string#1\endcsname{\normalbotmarks #1}}
-\let \newmark \definenewmark
-\let \newpersistentmark \newmarks % \definenewmark
+\let \newmark \definenewmark
+\let \newpersistentmark \newmarks % \definenewmark
\let \normalsetmark \setmark
\def\getallmarks{\the\listofmarks} % \def\setallmarks{\the\listofmarks}
-%D In \type {page-ini} or \type {core-mar} we should say:
+%D In \type {page-ini} or \type {core-mar} we should say:
%D
-%D \starttypen
-%D \appendtoks \getallmarks \to \everybeforepagebody
-%D \appendtoks \setallmarks \to \everyafterpagebody
-%D \stoptypen
+%D \starttypen
+%D \appendtoks \getallmarks \to \everybeforepagebody
+%D \appendtoks \setallmarks \to \everyafterpagebody
+%D \stoptypen
\let\getcurrentmark \thecurrentmarks
\let\gettopmark \checkedtopmarks
@@ -488,13 +488,13 @@
\let\getsplitbottommark \normalsplitbotmarks
\let\getsplitfirstmark \normalsplitfirstmarks
-\let\getbotmark \getbottommark
+\let\getbotmark \getbottommark
\let\getsplitbotmark \normalsplitbotmarks
\let\getsplittopmark \normalsplitfirstmarks
\endETEX
-%D A couple of goodies:
+%D A couple of goodies:
\let\getbotmark \getbottommark
\let\getsplitbotmark\getsplitbottommark
@@ -525,27 +525,27 @@
%D mechanism. In \ETEX\ we can however directly access more
%D marks than we will ever need.
-%D Resetting marks in not compatible with the old method.
-%D Here a node is inserted, which can interfere badly. In
-%D fact, a real \type {\clearmarks\name} is needed.
+%D Resetting marks in not compatible with the old method.
+%D Here a node is inserted, which can interfere badly. In
+%D fact, a real \type {\clearmarks\name} is needed.
%D
-%D \starttypen
+%D \starttypen
%D \def\resetmark#1{\marks#1{}}
%D \stoptypen
%D
%D A possible macro solution is presented here. When discussing
%D \type {\clearmarks} on the \ETEX\ discussion list, Chris
-%D Rowley suggested to use a reset flag. Unfortunately this
-%D is not enough since we need to keep track of both set and
+%D Rowley suggested to use a reset flag. Unfortunately this
+%D is not enough since we need to keep track of both set and
%D reset state then. This means that we must postpone resetting
-%D to the page following the set, and as a result we need
+%D to the page following the set, and as a result we need
%D another auxiliary macro. The current solution is the best
-%D I could come up with so far, especially given that we
-%D need a fast mechanism.
+%D I could come up with so far, especially given that we
+%D need a fast mechanism.
-%D For those who want to know the story behind resetting
-%D marks, here are some examples of interference
-%D
+%D For those who want to know the story behind resetting
+%D marks, here are some examples of interference
+%D
%D \startbuffer
%D \setbox0=\vbox{test}
%D \unvbox0\setbox0=\lastbox
@@ -580,8 +580,8 @@
%D One final advice. Use marks with care. When used in globally
%D assigned boxes, the list can grow quite big, and processing
-%D can slow down considerably. This drawback is removed in
-%D \ETEX\ mode.
+%D can slow down considerably. This drawback is removed in
+%D \ETEX\ mode.
\beginTEX
@@ -591,8 +591,8 @@
\let\rawgettopmark \gettopmark
\let\rawgetfirstmark \getfirstmark
\let\rawgetbotmark \getbotmark
-\let\rawgetsplitbotmark \normalsplitbotmark
-\let\rawgetsplitfirstmark\normalsplitfirstmark
+\let\rawgetsplitbotmark \normalsplitbotmark
+\let\rawgetsplitfirstmark\normalsplitfirstmark
\let\rawgetsplittopmark \normalsplitfirstmark
\endTEX
@@ -605,9 +605,9 @@
\let\rawgettopmark \normaltopmarks
\let\rawgetfirstmark \normalfirstmarks
\let\rawgetbotmark \normalbotmarks
-\let\rawgetsplitbotmark \normalsplitbotmarks
-\let\rawgetsplitfirstmark\normalsplitfirstmarks
-\let\rawgetsplittopmark \normalsplitfirstmarks
+\let\rawgetsplitbotmark \normalsplitbotmarks
+\let\rawgetsplitfirstmark\normalsplitfirstmarks
+\let\rawgetsplittopmark \normalsplitfirstmarks
\endETEX
diff --git a/tex/context/base/supp-num.tex b/tex/context/base/supp-num.tex
index 882196750..73ba3311b 100644
--- a/tex/context/base/supp-num.tex
+++ b/tex/context/base/supp-num.tex
@@ -245,8 +245,8 @@
% 0,=
% 0,== second = results in delta(00,=)
-% 0,- is invalid, should be = but we try to catch this error
-% 0,-- is invalid, but catched as ==
+% 0,- is invalid, should be =
+% 0,-- is invalid, should be ==
\def\digitzeroamount
{\digitsgn\zeroamount
diff --git a/tex/context/base/supp-pdf.tex b/tex/context/base/supp-pdf.tex
index 8cec1c646..aed57b32e 100644
--- a/tex/context/base/supp-pdf.tex
+++ b/tex/context/base/supp-pdf.tex
@@ -8,19 +8,19 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
% This method is not that accurate with small files that use
% penshapes. I tried several methods but so far I could not
% come up with a better alternative. \TEX's real calculation
% options are simply to simple. Using \ETEX's expression
-% mechanism does not lead to better results.
+% mechanism does not lead to better results.
-% beware, we cannot use \zeropoint here since it may be
-% defined in the range \dimen 0 - 20 which we happen to use
-% as scratch registers ; inside context we may consider
-% using dedicated registers
+% beware, we cannot use \zeropoint here since it may be
+% defined in the range \dimen 0 - 20 which we happen to use
+% as scratch registers ; inside context we may consider
+% using dedicated registers
%D These macros are written as generic as possible. Some
%D general support macro's are loaded from a small module
@@ -28,18 +28,20 @@
%D use a matrix transformation macro written by Tanmoy
%D Bhattacharya. Thanks to extensive testing by Sebastian
%D Ratz I was able to complete this module within reasonable
-%D time. This module has support for \METAPOST\ extensions
+%D time. This module has support for \METAPOST\ extensions
%D built in.
+% some optimizations are possible, but we need to be generic
+
%D First we take care of non||\CONTEXT\ use:
\ifx \undefined \writestatus \input supp-mis.tex \relax \fi
-\ifx \undefined \convertMPtoPDF \else \expandafter \endinput \fi
-\ifx \undefined \StartLatexHack \else \StartLatexHack \fi
+\ifx \undefined \convertMPtoPDF \else \expandafter \endinput \fi
+\ifx \undefined \StartLatexHack \else \StartLatexHack \fi
%D This module handles some \PDF\ conversion and insertions
%D topics. By default, the macros use the \PDFTEX\ primitive
-%D \type{\pdfliteral} when available.
+%D \type{\pdfliteral} when available.
\writestatus{loading}{Context Support Macros / PDF}
@@ -53,40 +55,40 @@
\fi
\fi
-%D First we define a handy constant:
+%D First we define a handy constant:
\bgroup \catcode`\%=\@@other \xdef\letterpercent{\string%} \egroup
-%D \macros
+%D \macros
%D {pdfimage,pdfimages,pdfclippedimage}
%D
%D Starting with pdftex version 14, images are included more
-%D natural to the form embedding. This enables alternative
-%D images to be embedded.
+%D natural to the form embedding. This enables alternative
+%D images to be embedded.
%D
%D \starttypen
%D \pdfimage <optional dimensions> {file}
%D \pdfimages <optional dimensions> {high res file} {low res file}
%D \stoptypen
%D
-%D The first one replaces the pre||version||14 original,
-%D while the latter provides alternative images.
-%D
-%D The next macro is dedicated to Maarten Gelderman, who
-%D needed to paste prepared \PDF\ pages into conference
+%D The first one replaces the pre||version||14 original,
+%D while the latter provides alternative images.
+%D
+%D The next macro is dedicated to Maarten Gelderman, who
+%D needed to paste prepared \PDF\ pages into conference
%D proceedings.
-%D
+%D
%D \starttypen
-%D \pdfclippedimage <optional dimensions> {file} {l} {r} {t} {b}
+%D \pdfclippedimage <optional dimensions> {file} {l} {r} {t} {b}
%D \stoptypen
\ifx\pdftexversion\undefined % no \m!systems for the sake of latex
\writestatus{systems}{Why not use pdf(e)TeX binaries?}
- \protect
- \expandafter\endinput
-\fi
+ \protect
+ \expandafter\endinput
+\fi
-\ifnum\pdftexversion>13
+\ifnum\pdftexversion>13
\def\pdfimage#1#%
{\dopdfimage{#1}}
@@ -101,38 +103,38 @@
\def\dopdfimages#1#2#3%
{\immediate\pdfximage#1{#2}%
\immediate\pdfobj
- {[ << /Image \the\pdflastximage\space0 R
+ {[ << /Image \the\pdflastximage\space0 R
/DefaultForPrinting true >> ]}%
- \immediate\pdfximage#1
+ \immediate\pdfximage#1
attr {/Alternates \the\pdflastobj\space0 R}{#3}%
\pdfrefximage\pdflastximage}
- \def\pdfclippedimage#1#% specs {file}{left}{right}{top}{bottom}
+ \def\pdfclippedimage#1#% specs {file}{left}{right}{top}{bottom}
{\dopdfclippedimage{#1}}
- \def\dopdfclippedimage#1#2#3#4#5#6%
+ \def\dopdfclippedimage#1#2#3#4#5#6%
{\bgroup
\pdfximage#1{#2}%
\setbox\scratchbox\hbox
{\pdfrefximage\pdflastximage}%
\hsize\wd\scratchbox
- \advance\hsize -#3
- \advance\hsize -#4
+ \advance\hsize -#3
+ \advance\hsize -#4
\vsize\ht\scratchbox
- \advance\vsize -#5
- \advance\vsize -#6
+ \advance\vsize -#5
+ \advance\vsize -#6
\setbox\scratchbox\vbox to \vsize
{\vskip-#5\hbox to \hsize{\hskip-#3\box\scratchbox\hss}}%
\pdfxform\scratchbox
\pdfrefxform\pdflastxform
\egroup}
-%D If you want to save a few hash entries, you may prefer the
-%D less readable alternatives, like:
-%D
-%D \starttypen
+%D If you want to save a few hash entries, you may prefer the
+%D less readable alternatives, like:
+%D
+%D \starttypen
%D \def\pdfimage#1#% This one is less readable but needs no additional
-%D {\bgroup % hash entry for the second stage macro.
+%D {\bgroup % hash entry for the second stage macro.
%D \def\pdfimage##1%
%D {\immediate\pdfximage##1{#2}%
%D \pdfrefximage\pdflastximage\egroup}}
@@ -201,7 +203,7 @@
%D dimensions. Beware: the user supplied values are not the
%D bounding box ones!
-% this will become obsolete
+% this will become obsolete
\newif\ifPDFmediaboxprefered
@@ -270,7 +272,7 @@
%D \forgetall
%D \scratchcounter=0
%D \let\stopPDFtoPDF=\dostopPDFtoPDF}
-%D
+%D
%D \def\dostopPDFtoPDF%
%D {\ifnum\scratchcounter<0 \scratchcounter=1 \fi
%D \message{(\the\scratchcounter\space lines)]}%
@@ -284,10 +286,10 @@
%D \PDFcode{\PDFxscale\space 0 0 \PDFyscale\space 0 0 cm}%
%D \box0
%D \PDFcode{Q}}}
-%D
+%D
%D \def\stopPDFtoPDF%
%D {\message{[PDF to PDF \PDFfilename\space not found]}}
-%D
+%D
%D \def\convertPDFtoPDF#1#2#3#4#5#6#7%
%D {\bgroup
%D \def\PDFfilename{#1}%
@@ -305,21 +307,21 @@
{\message{[PDF to PDF use \string\PDFcode instead]}%
\vbox{use the direct method instead}}
-%D \macros
+%D \macros
%D {dogetPDFmediabox}
%D
%D The next macro can be used to find the mediabox of a \PDF\
-%D illustration.
+%D illustration.
%D
%D \starttypen
%D \dogetPDFmediabox
%D {filename}
-%D {new dimen}{new dimen}{new dimen}{new dimen}
+%D {new dimen}{new dimen}{new dimen}{new dimen}
%D \stoptypen
%D
-%D Beware of dimen clashes: this macro uses the 5~default
-%D scratch registers! When no file or mediabox is found, the
-%D dimensions are zeroed.
+%D Beware of dimen clashes: this macro uses the 5~default
+%D scratch registers! When no file or mediabox is found, the
+%D dimensions are zeroed.
\def\dogetPDFmediabox#1#2#3#4#5%
{\bgroup
@@ -328,8 +330,8 @@
\uncatcodespecials
\endlinechar=-1
\def\checkPDFtypepage##1/Type /Page##2##3\done%
- {\ifx##2\relax
- \else\if##2s% accept /Page and /Pages
+ {\ifx##2\relax
+ \else\if##2s% accept /Page and /Pages
\let\doprocessPDFline\findPDFmediabox
\else
\let\doprocessPDFline\findPDFmediabox
@@ -347,7 +349,10 @@
\doprocessfile\scratchread{#1}\doprocessPDFline
\egroup
\ifx\PDFxoffset\undefined
- #2=\!!zeropoint #3=\!!zeropoint #4=\!!zeropoint #5=\!!zeropoint
+ #2\zeropoint
+ #3\zeropoint
+ #4\zeropoint
+ #5\zeropoint
\else
#2=\PDFxoffset bp #3=\PDFyoffset bp #4=\PDFwidth #5=\PDFheight
\fi}
@@ -361,11 +366,11 @@
%D uses. We don't define irrelevant ones, because these are
%D skipped anyway.
-%D The converter can be made a bit faster by replacing the
-%D two test macros (the ones with the many \type {\if's}) by
-%D a call to named branch macros (something \typ {\getvalue
-%D {xPSmoveto}}. For everyday documents with relatively
-%D small graphics the gain in speed can be neglected.
+%D The converter can be made a bit faster by replacing the
+%D two test macros (the ones with the many \type {\if's}) by
+%D a call to named branch macros (something \typ {\getvalue
+%D {xPSmoveto}}. For everyday documents with relatively
+%D small graphics the gain in speed can be neglected.
\def \PScurveto {curveto}
\def \PSlineto {lineto}
@@ -392,17 +397,17 @@
\def \PSconcat {concat}
\def \PSdtransform {dtransform}
-\def \PSnfont {nfont} % was needed for TUG98 proceedings
+\def \PSnfont {nfont} % was needed for TUG98 proceedings
\def \PSspecial {special} % extensions to MetaPost
-
-%D A previous version set \type {%} to ignore, which
-%D simplified the following definitions. At the start of
-%D conversion the percent character was made active again.
-%D Because the whole graphic is one paragraph (there are no
-%D empty lines) this does not give the desired effect. This
-%D went unnoticed untill Scott Pakin sent me a test file
-%D percent characters in a string. So, from now on we have
-%D to prefix the following strings with percentages.
+
+%D A previous version set \type {%} to ignore, which
+%D simplified the following definitions. At the start of
+%D conversion the percent character was made active again.
+%D Because the whole graphic is one paragraph (there are no
+%D empty lines) this does not give the desired effect. This
+%D went unnoticed untill Scott Pakin sent me a test file
+%D percent characters in a string. So, from now on we have
+%D to prefix the following strings with percentages.
\edef \PSBoundingBox {\letterpercent\letterpercent BoundingBox:}
\edef \PSHiResBoundingBox {\letterpercent\letterpercent HiResBoundingBox:}
@@ -499,7 +504,7 @@
\def\dogMPa#1%
{\@EAEAEA\do\csname\@@MP0\number#1\endcsname}
-\def\setMPkeyword#1 %
+\def\setMPkeyword#1 %
{\expandafter\def\csname\@@MP\the\nofMPsegments0\endcsname{#1}%
\advance\nofMPsegments1
\nofMParguments0 }
@@ -510,9 +515,9 @@
%D When we reset the stack, we can assume that all further
%D comment is to be ignored and handled in strings.
%D By redefining the reset macro after the first call, we
-%D save some run time. Only use this macro after all
-%D comments are processed and use the simple alternative
-%D when dealing with comments.
+%D save some run time. Only use this macro after all
+%D comments are processed and use the simple alternative
+%D when dealing with comments.
\def\doresetMPstack
{\nofMParguments0 }
@@ -568,7 +573,7 @@
\gdef\setMPspecials|
B\setnaturalcatcodes
\catcode`\\=\@@escape
- \catcode`\%=\@@active
+ \catcode`\%=\@@active
\catcode`\[=\@@active
\catcode`\]=\@@active
\catcode`\{=\@@active
@@ -589,9 +594,9 @@
\def\9B\octalMPcharacter9EE
\egroup
-%D We use the comment symbol as a sort of trigger. Beware!
-%D The whole graphic is seen as on eparagraph, which means
-%D that we cannot change the catcodes in between.
+%D We use the comment symbol as a sort of trigger. Beware!
+%D The whole graphic is seen as on eparagraph, which means
+%D that we cannot change the catcodes in between.
\bgroup
\catcode`\%=\@@active
@@ -621,23 +626,23 @@
%D speed up the conversion by handling the \type{path}
%D seperately.
-\def\@EAEAEA{\expandafter\expandafter\expandafter} % to be sure
+\def\@EAEAEA{\expandafter\expandafter\expandafter} % to be sure
\def\dohandleMPsequence#1%
{\ifdone
- \ifcase\lccode`#1\relax
+ \ifcase\lccode`#1\relax
\@EAEAEA\dohandleMPsequenceA
\else
\@EAEAEA\dohandleMPsequenceB
\fi
\else
\@EA\dohandleMPsequenceC
- \fi#1}
+ \fi#1}
%\def\dohandleMPsequenceA#1 %
% {\setMPargument{#1}%
% \handleMPsequence}
-
+
\let\dohandleMPsequenceA\setMPsequence
\def\dohandleMPsequenceB#1 %
@@ -682,7 +687,7 @@
\PDFcode{\gMPa1 M}%
\resetMPstack
\else\ifx\somestring\PSfshow
- \PDFcode{n}%
+ \PDFcode{n}%
\handleMPfshow
\resetMPstack
\else\ifx\somestring\PSsetlinecap
@@ -707,24 +712,24 @@
\handleMPgraphic % {#1}%
\handleMPsequence}
-%D Since colors are not sensitive to transformations, they
-%D are sometimes used for signaling. Therefore, we handle them
-%D separately. The next macro can be redefined if needed.
+%D Since colors are not sensitive to transformations, they
+%D are sometimes used for signaling. Therefore, we handle them
+%D separately. The next macro can be redefined if needed.
\def\handleMPrgbcolor
- {\PDFcode{\!MPgMPa1 \!MPgMPa2 \!MPgMPa3 rg
+ {\PDFcode{\!MPgMPa1 \!MPgMPa2 \!MPgMPa3 rg
\!MPgMPa1 \!MPgMPa2 \!MPgMPa3 RG}}
\def\handleMPcmykcolor
- {\PDFcode{\!MPgMPa1 \!MPgMPa2 \!MPgMPa3 \!MPgMPa4 k
+ {\PDFcode{\!MPgMPa1 \!MPgMPa2 \!MPgMPa3 \!MPgMPa4 k
\!MPgMPa1 \!MPgMPa2 \!MPgMPa3 \!MPgMPa4 K}}
\def\handleMPgraycolor
- {\PDFcode{\!MPgMPa1 g
+ {\PDFcode{\!MPgMPa1 g
\!MPgMPa1 G}}
\def\handleMPspotcolor
- {\PDFcode{0 g
+ {\PDFcode{0 g
0 G}}
%D Beginning and ending the graphics is taken care of by the
@@ -754,7 +759,7 @@
\else\ifx\somestring\PSMetaPostSpecial
\let\handleMPsequence\handleMPspecialcomment
\else
- \letMPargument\somestring % {#1}%
+ \letMPargument\somestring % {#1}%
\fi\fi\fi\fi\fi\fi\fi}
\let\handleMPgraphic=\handleMPbegingraphic
@@ -768,7 +773,7 @@
%D ExactBoundingBox: llx lly ucx ucy
%D \stoptypen
%D
-%D The original as well as the recalculated dimensions are
+%D The original as well as the recalculated dimensions are
%D saved for later use.
\newif\ifskipemptyMPgraphic \skipemptyMPgraphicfalse
@@ -789,7 +794,7 @@
\dimen0=\MPxscale\dimen0
\xdef\MPwidth{\the\dimen0}%
\advance\dimen2 #5bp
- \xdef\MPyshift{\the\dimen2}% unscaled
+ \xdef\MPyshift{\the\dimen2}% unscaled
\dimen2=\MPyscale\dimen2
\xdef\MPheight{\the\dimen2}%
\chardef\currentMPboundingbox=#1\relax
@@ -798,13 +803,13 @@
\let\handleMPsequence\dohandleMPsequence
\let\next\handleMPsequence
\ifskipemptyMPgraphic
- \ifdim\MPheight=\!!zeropoint\relax\ifdim\MPwidth=\!!zeropoint\relax
+ \ifdim\MPheight=\zeropoint\relax\ifdim\MPwidth=\zeropoint\relax
\def\next{\endinput\finishMPgraphic}%
\fi\fi
\fi
\next}
-%D Unless defined otherwise, we simply ignore specialcomments.
+%D Unless defined otherwise, we simply ignore specialcomments.
\def\handleMPspecialcomment
{\doresetMPstack
@@ -822,9 +827,9 @@
\let\handleMPsequence\dohandleMPsequence
\handleMPsequence}
-%D The same applies to the special extensions.
+%D The same applies to the special extensions.
-\def\handleMPspecialcommand
+\def\handleMPspecialcommand
{\doresetMPstack
\let\handleMPsequence\dohandleMPsequence
\handleMPsequence}
@@ -854,14 +859,14 @@
\setbox\scratchbox\hbox
{\obeyMPspecials
\edef\size{\gMPa\nofMParguments}%
- \ifx\size\PSnfont % round font size (to pt)
+ \ifx\size\PSnfont % round font size (to pt)
\advance\nofMParguments -1
\expandafter\scratchdimen\gMPa\nofMParguments pt\relax
\ifdim\scratchdimen<1pt
\def\size{1pt}%
\else
- \advance\scratchdimen .5pt
- \def\size##1.##2\relax{\def\size{##1pt}}%
+ \advance\scratchdimen .5pt
+ \def\size##1.##2\relax{\def\size{##1pt}}%
\expandafter\size\the\scratchdimen\relax
\fi
\else
@@ -869,7 +874,7 @@
\fi
\advance\nofMParguments -1
%\font\temp=\gMPa\nofMParguments\space at \size
- \let\temp\relax % to be sure
+ \let\temp\relax % to be sure
\setMPfshowfont{\gMPa\nofMParguments}\size
\advance\nofMParguments -1
\temp
@@ -878,13 +883,13 @@
\def\do(##1){##1}%
\dogMPa1%
\else
- % we need to catch ( a ) (a a a) (\123 \123 \123) etc
+ % we need to catch ( a ) (a a a) (\123 \123 \123) etc
\scratchcounter=1
- \def\dodo##1% Andreas Fieger's bug: (\304...)
- {\edef\!!stringa{##1\empty\empty}% and another one: ( 11) -> \ifx 11
+ \def\dodo##1% Andreas Fieger's bug: (\304...)
+ {\edef\!!stringa{##1\empty\empty}% and another one: ( 11) -> \ifx 11
\ifx\!!stringa\MPspacechar\MPspacechar\else\expandafter##1\fi}%
\def\do(##1{\dodo{##1}}%
- \dogMPa\scratchcounter\MPspacechar
+ \dogMPa\scratchcounter\MPspacechar
\let\do\relax
\loop
\advance\scratchcounter 1
@@ -895,7 +900,7 @@
\dogMPa\scratchcounter
\fi
\unskip}}%
- %
+ %
% this fails in latest pdftex's
%
% \dimen0=\lastMPmoveY bp
@@ -911,16 +916,16 @@
%
\setbox\scratchbox\hbox
{\hskip\lastMPmoveX bp\raise\lastMPmoveY bp\box\scratchbox}%
- \ht\scratchbox\!!zeropoint
- \dp\scratchbox\!!zeropoint
- \wd\scratchbox\!!zeropoint
+ \ht\scratchbox\zeropoint
+ \dp\scratchbox\zeropoint
+ \wd\scratchbox\zeropoint
\box\scratchbox
\egroup}
%D You could consider the following definition to be the most
-%D natural one.
+%D natural one.
-% \def\MPspacechar{\space} % normal case
+% \def\MPspacechar{\space} % normal case
\def\MPspacechar{\char32\relax} % old solution does not work with math
@@ -930,13 +935,13 @@
%D account and the \citeer {natural} space. This only happens in
%D labels, since \type {btex}||\type {etex} thingies don't have
%D spaces. This phenomena showed up when preparing the
-%D \METAFUN\ manual, where Palatino fonts are used. We can
-%D safely assume that \METAPOST\ considers \type {\char32} to
-%D be the space.
+%D \METAFUN\ manual, where Palatino fonts are used. We can
+%D safely assume that \METAPOST\ considers \type {\char32} to
+%D be the space.
\def\MPspacechar{\setbox\scratchbox\hbox{\char32}\kern\wd\scratchbox}
-%D Well, this does not work with math fonts, so:
+%D Well, this does not work with math fonts, so:
\def\MPspacechar{\char32\relax}
@@ -963,7 +968,7 @@
\egroup}
%D The \type{setlinewidth} commands looks a bit complicated. There are
-%D two alternatives, that result in a similar look in both
+%D two alternatives, that result in a similar look in both
%D $x$- and $y$-dorection. As John Hobby says:
%D
%D \startsmaller \switchtobodyfont[ss]
@@ -990,7 +995,7 @@
%D so we can use this one to trigger setting the linewidth.
\def\handleMPdtransform
- {\ifdim\gMPa1pt>\!!zeropoint
+ {\ifdim\gMPa1pt>\zeropoint
\PDFcode{\gMPa1 w}%
\def\next##1 ##2 ##3 ##4 ##5 ##6 {\handleMPsequence}%
\else
@@ -1117,15 +1122,19 @@
%D we converted them to pure points, simply because those can
%D be converted back.
-\def\MPconcatfactor{256}
+\mathchardef\MPconcatfactor=256 % beware don't remove spaces before it
+
+% \def\doMPreducedimen#1
+% {\count0\MPconcatfactor
+% \advance\dimen#1 \ifdim\dimen#1>\zeropoint .5\else -.5\fi\count0
+% \divide\dimen#1 \count0\relax}
\def\doMPreducedimen#1
- {\count0=\MPconcatfactor
- \advance\dimen#1 \ifdim\dimen#1>\!!zeropoint .5\else -.5\fi\count0
- \divide\dimen#1 \count0\relax}
+ {\advance\dimen#1 \ifdim\dimen#1>\zeropoint .5\else -.5\fi\MPconcatfactor
+ \divide\dimen#1 \MPconcatfactor}
-% too inaccurate (see old pragma logo)
-%
+% too inaccurate (see old pragma logo)
+%
% \def\doMPreducedimen#1
% {\count0=\MPconcatfactor
% \divide\dimen#1 \count0\relax}
@@ -1142,18 +1151,18 @@
\dimen10=\gMPs6 pt \doMPreducedimen10 } % t_y
\def\presetMPscale
- {\dimen 0=\gMPs1 pt \doMPreducedimen 0
- \dimen 2=\!!zeropoint
- \dimen 4=\!!zeropoint
- \dimen 6=\gMPs2 pt \doMPreducedimen 6
- \dimen 8=\!!zeropoint
- \dimen10=\!!zeropoint}
+ {\dimen 0=\gMPs1 pt \doMPreducedimen 0
+ \dimen 2=\zeropoint
+ \dimen 4=\zeropoint
+ \dimen 6=\gMPs2 pt \doMPreducedimen 6
+ \dimen 8=\zeropoint
+ \dimen10=\zeropoint}
\def\noMPtranslate % use this one grouped
- {\dimen 8=\!!zeropoint % t_x
- \dimen10=\!!zeropoint} % t_y
+ {\dimen 8=\zeropoint % t_x
+ \dimen10=\zeropoint} % t_y
-%D \starttypen
+%D \starttypen
%D \def\doMPconcat#1#2#3#4%
%D {\dimen12=#1 pt \doMPreducedimen12 % p_x
%D \dimen14=#3 pt \doMPreducedimen14 % p_y
@@ -1192,12 +1201,12 @@
%D %
%D \edef#2{\withoutpt{\the\dimen18}}% % p_x^\prime
%D \edef#4{\withoutpt{\the\dimen12}}} % p_y^\prime
-%D \stoptypen
+%D \stoptypen
-%D The following optimization resulted from some tests by
-%D and email exchanges with Sanjoy Mahajan.
+%D The following optimization resulted from some tests by
+%D and email exchanges with Sanjoy Mahajan.
%D
-%D \starttypen
+%D \starttypen
%D \def\doMPconcat#1#2#3#4%
%D {\dimen12=#1 pt \doMPreducedimen12 % p_x
%D \dimen14=#3 pt \doMPreducedimen14 % p_y
@@ -1244,9 +1253,9 @@
%D %
%D \edef#2{\withoutpt{\the\dimen18}}% % p_x^\prime
%D \edef#4{\withoutpt{\the\dimen12}}} % p_y^\prime
-%D \stoptypen
+%D \stoptypen
%D
-%D But, this one is still too inaccurate, so we now have:
+%D But, this one is still too inaccurate, so we now have:
% \def\doMPconcat#1#2#3#4%
% {\dimen12=#1pt % p_x
@@ -1306,24 +1315,26 @@
% \edef#2{\withoutpt{\the\dimen18}}% % p_x^\prime
% \edef#4{\withoutpt{\the\dimen12}}} % p_y^\prime
-%D We cannot use \type {\beginETEX} here since in plain we
-%D get \type {\outer} problems, sigh.
+%D We cannot use \type {\beginETEX} here since in plain we
+%D get \type {\outer} problems, sigh.
-% \beginTEX
+% \beginTEX
-\def\MPcriteriumA {512pt} % scale
-\def\MPcriteriumB {2pt} % scale
+\def\MPcriteriumA {512pt} % scale
+\def\MPcriteriumB {2pt} % scale
% \endTEX
%
% \ifx\MPcriteriumA\undefined
-%
+%
% \newdimen\MPcriteriumA \MPcriteriumA=512pt
% \newdimen\MPcriteriumB \MPcriteriumB= 2pt
-%
+%
% \fi
+% one day i'll rewrite this to etex's \dimexpr (internally double precission)
+
\def\doMPconcat#1#2#3#4%
{\dimen12=#1pt % p_x
\dimen14=#3pt % p_y
@@ -1338,7 +1349,7 @@
\fi\fi
\fi\fi
\fi\fi
- \ifcase\MPfactor0
+ \ifcase\MPfactor0
\chardef\MPfactor1
\ifdim\dimen12<\MPcriteriumA\ifdim\dimen12>-\MPcriteriumA
\ifdim\dimen14<\MPcriteriumA\ifdim\dimen14>-\MPcriteriumA
@@ -1397,7 +1408,7 @@
%
\edef#2{\withoutpt{\the\dimen18}}% % p_x^\prime
\edef#4{\withoutpt{\the\dimen12}}} % p_y^\prime
-
+
%D The following explanation of the conversion process was
%D posted to the \PDFTEX\ mailing list by Tanmoy. The original
%D macro was part of a set of macro's that included sinus and
@@ -1563,7 +1574,7 @@
%D Again matrix notation comes in handy (i.e. someone has
%D already solved the problem for us): we need the inverse
%D transformation matrix. The inverse transformation matrix can
-%D be calculated very easily:
+%D be calculated very easily:
%D
%D \plaatsformule
%D \startformule
@@ -1640,7 +1651,7 @@
\flushMPpath
\closeMPpath
\finishMPpath
- \fi
+ \fi
\let\handleMPsequence\dohandleMPsequence
\resetMPstack
\nofMPsegments0
@@ -1651,19 +1662,19 @@
%D unprintable on a Hewlett Packard printer (from Acrobat
%D $v<=5$). Who is to blame, the driver of the OS layer in
%D between, is hard to determine, so we add an additional
-%D check.
-%D
+%D check.
+%D
%D \starttypen
-%D clip currentpicture to origin -- cycle ;
-%D setbounds currentpicture to fullsquare scaled 5cm ;
+%D clip currentpicture to origin -- cycle ;
+%D setbounds currentpicture to fullsquare scaled 5cm ;
%D \stoptypen
\def\checkMPpath
- {\ifcase\finiMPpath
+ {\ifcase\finiMPpath
\ifnum\nofMPsegments<3 % n is one ahead
\message{omitting zero clip path}%
- \nofMPsegments0
- \fi
+ \nofMPsegments0
+ \fi
\fi}
%D In \PDF\ the \type{cm} operator must precede the path
@@ -1707,7 +1718,7 @@
\else\ifx\somestring\PSmoveto
\setMPkeyword3
\else\ifx\somestring\PSclip
- % \chardef\finiMPpath0 % already
+ % \chardef\finiMPpath0 % already
\let\handleMPsequence\processMPpath
\else\ifx\somestring\PSgsave
\chardef\finiMPpath3
@@ -1747,50 +1758,50 @@
%D \convertMPtoPDF{mp-pra-1.eps}{.5}{.5}
%D \stoptypen
-%D \macros
+%D \macros
%D {makeMPintoPDFobject,lastPDFMPobject}
%D
%D For experts there are a few more options. When attributes
-%D are to be added, the code must be embedded in an object
-%D accompanied with the appropriate directives. One can
+%D are to be added, the code must be embedded in an object
+%D accompanied with the appropriate directives. One can
%D influence this process with \type {\makeMPintoPDFobject}.
%D
-%D This option defaults to~0, because \CONTEXT\ takes care
-%D of objects at another level, which saves some bytes.
+%D This option defaults to~0, because \CONTEXT\ takes care
+%D of objects at another level, which saves some bytes.
%D
%D \starttabulatie[|l|l|p|]
%D \NC 0 \NC never \NC don't use an object \NC\NR
%D \NC 1 \NC always \NC always use an object \NC\NR
%D \NC 2 \NC optional \NC use object when needed \NC\NR
-%D \stoptabulatie
-%D
-%D The last object number used is avaliable in the macro
+%D \stoptabulatie
+%D
+%D The last object number used is avaliable in the macro
%D \type {\lastPDFMPobject}.
\chardef\makeMPintoPDFobject=0 \def\lastPDFMPobject{0}
-%D The additional code needed can be made available in the
+%D The additional code needed can be made available in the
%D (global) macro \type {\currentPDFresources}.
-\let\currentPDFresources\empty
+\let\currentPDFresources\empty
\newtoks\everyMPtoPDFconversion
\def\convertMPtoPDF#1#2#3%
{\bgroup
- \ifx\pdfdecimaldigits\undefined\else \pdfdecimaldigits=5 \fi % new
+ \ifx\pdfdecimaldigits\undefined\else \pdfdecimaldigits=5 \fi % new
\setbox\scratchbox\vbox\bgroup
\forgetall
\offinterlineskip
\startMPresources
- \doprocessMPtoPDFfile{#1}{#2}{#3}} % {#1}{0#2}{0#3} would be saver
+ \doprocessMPtoPDFfile{#1}{#2}{#3}} % {#1}{0#2}{0#3} would be saver
-\def\processMPtoPDFfile % file xscale yscale
+\def\processMPtoPDFfile % file xscale yscale
{\bgroup
\let\finishMPgraphic\egroup
\doprocessMPtoPDFfile}
-\def\doprocessMPtoPDFfile#1#2#3% file xscale yscale
+\def\doprocessMPtoPDFfile#1#2#3% file xscale yscale
{\setMPspecials
\the\everyMPtoPDFconversion
\catcode`\^^M=\@@endofline
@@ -1800,29 +1811,29 @@
\xdef\MPyscale{#3}%
\donefalse
\let\handleMPsequence\dohandleMPsequence
- \message{[MP to PDF]}% was: [MP to PDF #1] but there is a (#1) anyway
+ \message{[MP to PDF]}% was: [MP to PDF #1] but there is a (#1) anyway
\input#1\relax}
% strange rounding/clip in pdftex/viewer
-%
+%
% \def\finishMPgraphic
% {\stopMPresources
% \egroup
-% \ifx\pdftexversion\undefined\else\ifnum\pdftexversion<14 % for the moment
-% \chardef\makeMPintoPDFobject=0
+% \ifx\pdftexversion\undefined\else\ifnum\pdftexversion<14 % for the moment
+% \chardef\makeMPintoPDFobject=0
% \fi\fi
% \ifcase\makeMPintoPDFobject\or\or\ifx\currentPDFresources\empty\else
-% \chardef\makeMPintoPDFobject=1
+% \chardef\makeMPintoPDFobject=1
% \fi\fi
% \setbox\scratchbox=\vbox
% {\forgetall
% \hbox
% {\PDFcode{q \MPxscale\space 0 0 \MPyscale\space \MPxoffset\space \MPyoffset\space cm}%
-% \lower\MPyshift\box\scratchbox % unscaled shift
+% \lower\MPyshift\box\scratchbox % unscaled shift
% \PDFcode{Q}}}%
% \ht\scratchbox\MPheight
% \wd\scratchbox\MPwidth
-% \dp\scratchbox\!!zeropoint
+% \dp\scratchbox\zeropoint
% \ifcase\makeMPintoPDFobject
% \box\scratchbox
% \or
@@ -1842,42 +1853,42 @@
% \dimen0=\MPllx bp
% \dimen2=\MPlly bp
% \setbox\scratchbox=\hbox{\hskip-\dimen0\raise-\dimen2\box\scratchbox}%
-% \ht\scratchbox=\!!zeropoint
-% \dp\scratchbox=\!!zeropoint
-% \wd\scratchbox=\!!zeropoint
+% \ht\scratchbox=\zeropoint
+% \dp\scratchbox=\zeropoint
+% \wd\scratchbox=\zeropoint
% \hbox
% {\PDFcode{q \MPxscale\space 0 0 \MPyscale\space 0 0 cm}%
% \lower\MPshift\box\scratchbox
% \PDFcode{Q}}}%
-% \let\PDFMPformoffset\!!zeropoint
+% \let\PDFMPformoffset\zeropoint
\def\PDFMPformoffset
- {\ifx\objectoffset\undefined\!!zeropoint\else\objectoffset\fi}
+ {\ifx\objectoffset\undefined\zeropoint\else\objectoffset\fi}
\def\finishMPgraphic
{\stopMPresources
\egroup
- \ifx\pdftexversion\undefined\else\ifnum\pdftexversion<14 % for the moment
- \chardef\makeMPintoPDFobject0
+ \ifx\pdftexversion\undefined\else\ifnum\pdftexversion<14 % for the moment
+ \chardef\makeMPintoPDFobject0
\fi\fi
\ifcase\makeMPintoPDFobject\or\or\ifx\currentPDFresources\empty\else
- \chardef\makeMPintoPDFobject1
+ \chardef\makeMPintoPDFobject1
\fi\fi
- \setbox\scratchbox\vbox
+ \setbox\scratchbox\vbox
{\forgetall
- \hbox
+ \hbox
{\PDFcode{q \MPxscale\space 0 0 \MPyscale\space \MPxoffset\space \MPyoffset\space cm}%
- \lower\MPyshift\box\scratchbox % unscaled shift
+ \lower\MPyshift\box\scratchbox % unscaled shift
\PDFcode{Q}}}%
\ht\scratchbox\MPheight
\wd\scratchbox\MPwidth
- \dp\scratchbox\!!zeropoint\relax
+ \dp\scratchbox\zeropoint\relax
\ifcase\makeMPintoPDFobject
\box\scratchbox
\or
\scratchdimen\PDFMPformoffset\relax
- \ifdim\scratchdimen>\!!zeropoint % compensate for error
+ \ifdim\scratchdimen>\zeropoint % compensate for error
\setbox\scratchbox=\vbox spread 2\scratchdimen
{\forgetall
\vss
@@ -1889,8 +1900,8 @@
\fi
\immediate\pdfxform resources{\currentPDFresources}\scratchbox
\xdef\lastPDFMPobject{\the\pdflastxform}%
- \ifdim\scratchdimen>\!!zeropoint % compensate for error
- \vbox to \MPheight
+ \ifdim\scratchdimen>\zeropoint % compensate for error
+ \vbox to \MPheight
{\forgetall
\vss\hbox to \MPwidth{\hss\pdfrefxform\lastPDFMPobject\hss}\vss}%
\else
@@ -1903,12 +1914,12 @@
\egroup
\endinput}
-%D \macros
+%D \macros
%D {deleteMPgraphic,
%D startMPresources,
%D stopMPresources}
-%D
-%D Here are a few hooks for \CONTEXT\ specific things.
+%D
+%D Here are a few hooks for \CONTEXT\ specific things.
\ifx\deleteMPgraphic\undefined
\def\deleteMPgraphic#1{}
@@ -1922,14 +1933,14 @@
%D \macros
%D {twodigitMPoutput}
%D
-%D We can limit the precision to two digits after the comma
-%D by saying:
+%D We can limit the precision to two digits after the comma
+%D by saying:
%D
%D \starttypen
%D \twodigitMPoutput
%D \stoptypen
%D
-%D This option only works in \CONTEXT\ combined with \ETEX.
+%D This option only works in \CONTEXT\ combined with \ETEX.
\def\twodigitMPoutput
{\let\!MP \twodigitrounding
@@ -1944,6 +1955,6 @@
%D does all the calculations. Converting other \POSTSCRIPT\
%D files would drive both me and \TEX\ crazy.
-\ifx\undefined\StopLatexHack \else \StopLatexHack \fi
+\ifx\undefined\StopLatexHack \else \StopLatexHack \fi
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/supp-ran.tex b/tex/context/base/supp-ran.tex
index fc056813b..7e55988f0 100644
--- a/tex/context/base/supp-ran.tex
+++ b/tex/context/base/supp-ran.tex
@@ -8,39 +8,39 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
\writestatus{loading}{Third Party Macros / Random Number Generation}
%D \macros
-%D {getrandomcount, getrandomdimen,
+%D {getrandomcount, getrandomdimen,
%D getrandomfloat, getrandomnumber,
%D setrandomseed, getrandomseed}
-%D
+%D
%D This module load Donald Arseneau's generic file
%D \type{random.tex}. A small shell is needed because we
-%D redefine some \TEX\ primitives. We also use different names
+%D redefine some \TEX\ primitives. We also use different names
%D for the two generators and add an extra one.
-%D
+%D
%D \starttypen
%D \getrandomcount \countregister {minimum} {maximum}
%D \getrandomdimen \dimenregister {minimum} {maximum}
%D \getrandomnumber \macroname {minimum} {maximum}
%D \getrandomfloat \macroname {minimum} {maximum}
-%D \stoptypen
+%D \stoptypen
%D
%D Of course the file \type{random.tex} needs to be present.
-%D To prevent name clashes, the \CONTEXT\ distribution
+%D To prevent name clashes, the \CONTEXT\ distribution
%D contains a copy in \type {thrd-ran.tex}.
%D
-%D The randomseed can be set by:
+%D The randomseed can be set by:
%D
%D \starttypen
%d \setrandomseed{number>0}
%D \stoptypen
%D
-%D and get by:
+%D and get by:
%D
%D \starttypen
%D \getrandomseed\randomseed
@@ -65,9 +65,9 @@
\def\normalnextrandom
{\bgroup
- \let\time \normaltime
+ \let\time \normaltime
\let\day \normalday
- \let\month\normalmonth
+ \let\month\normalmonth
\let\year \normalyear
\verynormalnextrandom
\egroup}
@@ -81,16 +81,16 @@
\egroup}
% avoid scratch dimens 0 and 2 (already recoded in third-ran
- %
- % \unprotect
- %
+ %
+ % \unprotect
+ %
% \def\setrandim#1#2#3% dimen register, minimum length, maximum length
% {\scratchdimen#2\edef\!!stringa{\number\scratchdimen}%
% \scratchdimen#3\edef\!!stringb{\number\scratchdimen}%
% \setrannum\ranval\!!stringa\!!stringb
% #1\ranval\s!sp\relax}
- %
- % \protect
+ %
+ % \protect
\fi
@@ -112,7 +112,7 @@
\edef#1{\the\scratchcounter}}
\def\getrandomfloat#1#2#3%
- {\getrandomdimen\scratchdimen{#2\s!pt}{#3\s!pt}%
+ {\getrandomdimen\scratchdimen{#2\points}{#3\points}%
\edef#1{\withoutpt\the\scratchdimen}}
\unexpanded \def\setrandomseed#1%
diff --git a/tex/context/base/symb-mis.tex b/tex/context/base/symb-mis.tex
index e4f342fa7..10defdc4c 100644
--- a/tex/context/base/symb-mis.tex
+++ b/tex/context/base/symb-mis.tex
@@ -8,13 +8,13 @@
%D copyright=PRAGMA-ADE]
%C
%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
-\unprotect
+\unprotect
%D We predefine some common symbols and conversions that will
-%D be understood by many commands.
+%D be understood by many commands.
\definesymbol [\v!geen] []
\definesymbol [bullet] [\mathematics{\bullet}]
@@ -22,7 +22,7 @@
\definesymbol [star] [\mathematics{\star}]
\definesymbol [triangle] [\mathematics{\triangleright}]
\definesymbol [circle] [\mathematics{\circ}]
-\definesymbol [medcircle] [\hbox{\setsmallbodyfont\raise\!!onepoint\hbox{$\bigcirc$}}]
+\definesymbol [medcircle] [\hbox{\setsmallbodyfont\raise\onepoint\hbox{$\bigcirc$}}]
\definesymbol [bigcircle] [\mathematics{\bigcirc}]
\definesymbol [square] [\mathematics{\square}]
\definesymbol [diamond] [\mathematics{\diamond}]
@@ -36,8 +36,8 @@
\definesymbol [7] [{\symbol[bigcircle]}]
\definesymbol [8] [{\symbol[square]}]
-%D Special hyperlinks, namely those to pages or navigational
-%D properties, are associated with symbols.
+%D Special hyperlinks, namely those to pages or navigational
+%D properties, are associated with symbols.
\definesymbol [\v!eerstepagina] [\gotobegincharacter]
\definesymbol [\v!vorigepagina] [\gobackwardcharacter]
@@ -61,19 +61,19 @@
\definesymbol [\v!achteruit] [{\symbol[\v!vorigepagina]}]
\definesymbol [\v!vooruit] [{\symbol[\v!volgendepagina]}]
-%D The next two symbols (\symbol[P] and \symbol[S]) are
-%D variations in their math counterparts. The following ones
-%D {\em do} scale.
+%D The next two symbols (\symbol[P] and \symbol[S]) are
+%D variations in their math counterparts. The following ones
+%D {\em do} scale.
-% todo : hook this into \textsection
+% todo : hook this into \textsection
\definesymbol[S][\getglyph{MathSymbol}{\char"78}]
\definesymbol[P][\getglyph{MathSymbol}{\char"7B}]
%D These symbols are taken from the Computer Moders Roman
%D symbol set or, when present, from the additional symbols of
-%D the American Mathematical Society. Of course one can use
-%D his or her own symbols by redefining them.
+%D the American Mathematical Society. Of course one can use
+%D his or her own symbols by redefining them.
\def\dogotocharacter#1#2#3%
{\ifx#1\undefined#2\else#3\fi}
@@ -83,7 +83,7 @@
{\dogotocharacter\blacktriangleleft
{\setbox0=\hbox{\mathematics{\triangleleft}}%
\vrule\!!width.085ex\!!height1.075\ht0\!!depth\dp0
- \kern-.11ex\box0}
+ \kern-.11ex\box0}
{\setbox0=\hbox{\mathematics{\blacktriangleleft}}%
\setbox2=\hbox{\vrule\!!height\ht0\!!depth\dp0\!!width.25ex}%
\hbox{\lower.03ex\box2\kern-.35ex\box0}}}}
@@ -92,8 +92,8 @@
{\hbox
{\dogotocharacter\blacktriangleright
{\setbox0=\hbox{\mathematics{\triangleright}}%
- \copy0\kern-.11ex
- \vrule\!!width.085ex\!!height1.075\ht0\!!depth\dp0}
+ \copy0\kern-.11ex
+ \vrule\!!width.085ex\!!height1.075\ht0\!!depth\dp0}
{\setbox0=\hbox{\mathematics{\blacktriangleright}}%
\setbox2=\hbox{\vrule\!!height\ht0\!!depth\dp0\!!width.25ex}%
\hbox{\box0\kern-.35ex\lower.03ex\box2}}}}
@@ -124,7 +124,7 @@
\def\gobackjumpcharacter%
{\hbox{\gobackwardcharacter\kern-.5em\gobackwardcharacter}}
-%D The next two symbols are for Daniel Flipo:
+%D The next two symbols are for Daniel Flipo:
\definesymbol [Numero] [N\high{\nocap{o}\kern.2em}]
\definesymbol [numero] [n\high{\nocap{o}\kern.2em}]
@@ -132,4 +132,4 @@
\def\Numero{\symbol[Numero]}
\def\numero{\symbol[numero]}
-\protect \endinput
+\protect \endinput
diff --git a/tex/context/base/syst-ext.tex b/tex/context/base/syst-ext.tex
index 14c5beccc..2550ffc53 100644
--- a/tex/context/base/syst-ext.tex
+++ b/tex/context/base/syst-ext.tex
@@ -2855,8 +2855,11 @@
\endETEX
-\let\pushmacro\globalpushmacro
-\let\popmacro \globalpopmacro
+% \let\pushmacro\globalpushmacro
+% \let\popmacro \globalpopmacro
+
+\let\pushmacro\localpushmacro
+\let\popmacro \localpopmacro
%D \macros
%D {setlocalhsize}
@@ -3251,7 +3254,16 @@
\@EA\dostripcharacter\!!stringa#1\end
\dodoglobal\let#3\!!strippedstring}
-\def\stripspaces\from#1\to#2%
+\def\stripspaces\from#1\to#2% will become \unspacestring#1\from#2
+ {\stripcharacter{ }\from#1\to#2}
+
+%D \macros
+%D {unspacestring}
+%D
+%D The next macro does the same but is more compatible with other macros,
+%D like \type {\convert...}.
+
+\def\unspacestring#1\to#2%
{\stripcharacter{ }\from#1\to#2}
%D \macros
@@ -3469,10 +3481,10 @@
%D However, we want to handle all situations, like:
%D
%D \startbuffer
-%D \processseparatedlist[{aap noot}] [ ]{\def\xxx} \show\xxx
-%D \processseparatedlist[{aap} {noot}][ ]{\def\xxx} \show\xxx
-%D \processseparatedlist[aap {noot}] [ ]{\def\xxx} \show\xxx
-%D \processseparatedlist[aap noot] [ ]{\def\xxx} \show\xxx
+%D \processseparatedlist[{aap noot}] [ ]{\def\xxx} \convertcommand\xxx\to\ascii {\tttf\ascii}
+%D \processseparatedlist[{aap} {noot}][ ]{\def\xxx} \convertcommand\xxx\to\ascii {\tttf\ascii}
+%D \processseparatedlist[aap {noot}] [ ]{\def\xxx} \convertcommand\xxx\to\ascii {\tttf\ascii}
+%D \processseparatedlist[aap noot] [ ]{\def\xxx} \convertcommand\xxx\to\ascii {\tttf\ascii}
%D \stopbuffer
%D
%D \typebuffer \getbuffer
@@ -3600,11 +3612,11 @@
%D They remove braces and backslashes and give us something to
%D sort.
-\def\untexsomething%
+\def\untexsomething
{\begingroup
\catcode`\{=\@@ignore
\catcode`\}=\@@ignore
- \escapechar=\minusone
+ \escapechar\minusone
\dountexsomething}
\long\def\dountexsomething#1#2\to#3%
@@ -3680,7 +3692,7 @@
\def\dontleavehmode
{\ifhmode\else \ifmmode\else
- {\mathsurround\z@\everymath\emptytoks$ $}%
+ {\mathsurround\zeropoint\everymath\emptytoks$ $}%
\fi \fi}
%D \macros
@@ -4343,7 +4355,7 @@
%D \filterfromvalues{xx}{1}
%D \stoptypen
%D
-%D I'll implement this when I'm in \quotation {writing dirty
+%D I'll implement this when I'm in \citaat {writing dirty
%D macros mood}.
\def\filterfromvalue#1#2#3% value max n
diff --git a/tex/context/base/syst-gen.tex b/tex/context/base/syst-gen.tex
index cbf7b6ce5..ebc24ea16 100644
--- a/tex/context/base/syst-gen.tex
+++ b/tex/context/base/syst-gen.tex
@@ -2828,18 +2828,12 @@
\fi
\fi}
-\def\doassign[#1][#2]%
- {\p!doassign\dosetvalue[#1][#2==\relax]}
-
-\def\doeassign[#1][#2]%
- {\p!doassign\dosetevalue[#1][#2==\relax]}
-
-\def\undoassign[#1][#2]%
- {\p!doassign\doresetvalue[#1][#2==\relax]}
+\def\doassign [#1][#2]{\p!doassign\dosetvalue [#1][#2==\relax]}
+\def\doeassign [#1][#2]{\p!doassign\dosetevalue [#1][#2==\relax]}
+\def\undoassign[#1][#2]{\p!doassign\doresetvalue[#1][#2==\relax]}
\def\doassignempty[#1][#2=#3]%
- {\doifundefined{#1#2}
- {\dosetvalue{#1}{#2}{#3}}}
+ {\ifundefined{#1#2}\dosetvalue{#1}{#2}{#3}\fi}
%D \macros
%D {getparameters,geteparameters,getgparameters,
@@ -3944,8 +3938,8 @@
%D We will see some real applications of this command in the
%D core modules.
-\def\definestartstopcommand#1#2#3#4% can be done with \expanded
- {\def\!stringa{#3}%
+\def\definestartstopcommand#1#2#3#4% can be done with \expanded ot better, toks
+ {\def\!stringa{#3}% % but let's keep this unuded one crappy
\def\!stringb{\e!start#2}%
\def\!stringc{#4}%
\def\!stringd{\e!stop#2}%
diff --git a/tex/context/base/syst-new.tex b/tex/context/base/syst-new.tex
index 13a3f64be..183ad8cb4 100644
--- a/tex/context/base/syst-new.tex
+++ b/tex/context/base/syst-new.tex
@@ -8,15 +8,15 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
-%D Code from this module will move. For instance to
+%D Code from this module will move. For instance to
%D syst-dat.tex (datastructures).
\unprotect
-% moved from core-ntb
+% moved from core-ntb
\def\v!oddeven#1{\ifodd#1\v!oneven\else\v!even\fi}
@@ -34,7 +34,7 @@
{\global\advance\nofprofiled\plusone
\csname\string#1\string#1\endcsname}}
-% pretty ugly but fast
+% pretty ugly but fast
% \copycsname xxx\endcsname\csname ..\endcsname
@@ -50,7 +50,7 @@
% another one, add an item to a commalist
-\def\addvalue#1#2% cs item
+\def\addvalue#1#2% cs item
{\ifundefined{#1}\@EA\let\csname#1\endcsname\empty\fi
\expanded{\addtocommalist{#2}\@EA\noexpand\csname#1\endcsname}}
@@ -102,7 +102,7 @@
\def\setobeyedlccode#1{\lccode#1\obeyedlccode}
\def\obeylccodes
- {\let\withcharacter\setownlccode
+ {\let\withcharacter\setownlccode
\the\withlowercharacters
\let\withcharacter\setobeyedlccode
\the\withminorcharacters
@@ -126,47 +126,47 @@
\def\unspaceafter#1#2%
{\edef\ascii{\dounspaced#2\end}\@EA#1\@EA{\ascii}}
-% etex, much faster
+% etex, much faster
%
% \def\unspaceargument#1\to#2%
% {\scratchcounter\catcode'32\catcode32=\@@ignore
-% \scantokens{\edef#2{#1}}%
+% \scantokens{\edef#2{#1}}%
% \catcode32=\scratchcounter}
\def\unspaceafter#1#2%
{\edef\ascii{\dounspaced#2\end}\@EA#1\@EA{\ascii}}
-% this will replace loadfile once and alike !!! todo
+% this will replace loadfile once and alike !!! todo
\def\@flg@{@flg@}
\def\setflag#1%
- {\@EA\dodoglobal\@EA\chardef\csname\@flg@#1\endcsname\zerocount}
+ {\@EA\dodoglobal\@EA\chardef\csname\@flg@#1\endcsname\zerocount}
\def\resetflag#1%
- {\@EA\dodoglobal\@EA\chardef\csname\@flg@#1\endcsname\plusone}
+ {\@EA\dodoglobal\@EA\chardef\csname\@flg@#1\endcsname\plusone}
\let\ifflagged\ifcase
\def\flag#1{\csname\@flg@#1\endcsname}
\def\doifelseflagged#1%
- {\@EA\ifx\csname\@flg@#1\endcsname\relax
+ {\@EA\ifx\csname\@flg@#1\endcsname\relax
\@EA\secondoftwoarguments
- \else\ifcase\csname\@flg@#1\endcsname
+ \else\ifcase\csname\@flg@#1\endcsname
\@EAEAEA\firstoftwoarguments
\else
\@EAEAEA\secondoftwoarguments
- \fi\fi}
+ \fi\fi}
\def\doifnotflagged#1%
- {\@EA\ifx\csname\@flg@#1\endcsname\relax
+ {\@EA\ifx\csname\@flg@#1\endcsname\relax
\@EA\firstofoneargument
- \else\ifcase\csname\@flg@#1\endcsname
- \@EAEAEA\gobbleoneargument
+ \else\ifcase\csname\@flg@#1\endcsname
+ \@EAEAEA\gobbleoneargument
\else
\@EAEAEA\firstofoneargument
- \fi\fi}
+ \fi\fi}
\def\inheritparameter[#1]#2[#3]#4[#5]% tag tokey fromkey % [bypasses k!prefix]
{\@EAEAEA\def\@EA\csname\@EA#1\@EA#3\@EA\endcsname\@EA
@@ -176,21 +176,21 @@
% \setarrayelement{test}{1}{qq}
% \arrayelement{test}{1}
% \arraylength{test}
-%
+%
% \def\buildarray[#1][#2]%
-% {\scratchcounter=0
+% {\scratchcounter=0
% \def\docommando##1%
-% {\advance\scratchcounter by 1
+% {\advance\scratchcounter by 1
% \setvalue{@@aa#1\the\scratchcounter}{##1}}%
% \processcommalist[#2]\docommando
% \setevalue{@@aa#1}{\the\scratchcounter}}%
-%
+%
% \def\setarrayelement#1#2{\setvalue{@@aa#1#2}}
% \def\arrayelement #1#2{\getvalue{@@aa#1#2}}
% \def\arraylength #1{\getvalue{@@aa#1}}
% \newsignal\junksignal
-%
+%
% \def\setjunksignal%
% {\ifhmode
% \hskip\junksignal
@@ -198,7 +198,7 @@
% \else
% \let\removejunkspaces\relax
% \fi}
-%
+%
% \def\doremovejunkspaces%
% {\doloop{\ifdim\lastskip=\junksignal\unskip\else\exitloop\fi}}
@@ -223,7 +223,7 @@
\def\doifnonzeropositiveelse#1%
{\begingroup\afterassignment\dodoifnonzeropositiveelse\scratchcounter=0#1\relax\empty\end}
-% here ?
+% here ?
\def\dosetrawvalue #1#2#3{\@EA \def\csname#1#2\endcsname{#3}}
\def\dosetrawevalue#1#2#3{\@EA\edef\csname#1#2\endcsname{#3}}
@@ -235,7 +235,7 @@
\def\getrawgparameters {\dogetparameters\dosetrawgvalue}
\def\getrawxparameters {\dogetparameters\dosetrawxvalue}
-\def\globalgetrawparameters{\dogetparameters\dosetrawgvalue} % obsolete
+\def\globalgetrawparameters{\dogetparameters\dosetrawgvalue} % obsolete
\def\splitskip#1%
{\scratchskip\zeropoint \!!plus 1pt \!!minus 1pt
@@ -262,15 +262,15 @@
% \def\minimaxskip#1#2%
% {\splitskip#2\relax
% \scratchdimen=#2\relax
-% #2=\scratchdimen
+% #2=\scratchdimen
% \advance#2 by #1\relax}
-%
+%
% \def\maximizeskip%
% {\minimaxskip{-\dimen4}}
-%
+%
% \def\maximizeskip%
% {\minimaxskip{\dimen2}}
-%
+%
% \def\maximizespacing%
% {\maximizeskip\blankoskipamount
% \maximizeskip\parskip
@@ -378,17 +378,17 @@
%D {adddimenregister,adddimenmacro}
%D
%D Instead of using numerous \type {\advance}'s, one can use
-%D the next macros to add|/|subtract a series of dimensions
-%D to a register or macro.
+%D the next macros to add|/|subtract a series of dimensions
+%D to a register or macro.
%D
-%D \starttypen
+%D \starttypen
%D \adddimenregister 10pt 5pt \papierbreedte \to \somedimen
%D \adddimenmacro 10pt 5pt \papierbreedte \to \bagger
%D \stoptypen
\newdimen\dimentoaddto
-\def\adddimenregister#1\to#2% will be obsolete once full etex
+\def\adddimenregister#1\to#2% will be obsolete once full etex
{\begingroup
#2=\zeropoint
\dimentoaddto\zeropoint
@@ -410,25 +410,25 @@
%D \macros
%D {freezedimenmacro}
%D
-%D This macro is use as:
+%D This macro is use as:
%D
-%D \starttypen
+%D \starttypen
%D \freezedimenmacro\linkermargeafstand
-%D \stoptypen
+%D \stoptypen
\def\freezedimenmacro#1%
{\scratchdimen#1\edef#1{\the\scratchdimen}}
-%D The next one is slower:
+%D The next one is slower:
%D
%D \starttypen
-%D \def\freezedimenmacro#1{\edef#1{\the\dimexpr(#1)}}
-%D \stoptypen
+%D \def\freezedimenmacro#1{\edef#1{\the\dimexpr(#1)}}
+%D \stoptypen
% \newcount\rawrecursecounter
-%
+%
% \def\rawrecurselevel{\the\rawrecursecounter}%
-%
+%
% \def\dorawrecurse#1#2%
% {\rawrecursecounter\plusone
% \let\oldrecurselevel\recurselevel
@@ -442,6 +442,16 @@
% \fi}%
% \dodorawrecurse}
+%D The next macro negates a macro (dimension or number, or actually, whatever.
+%D It's a typical example of \if usage:
+%D
+%D \starttypen
+%D \if-\whatever \else-\whatever\fi => else => -whatever
+%D \if--\whatever\else-\whatever\fi => then => whatever
+%D \stoptypen
+
+\def\negated#1{\if-#1\else-#1\fi} % does only work in macros or text
+
% This permits things like ^\index{hans}^, where hans is
% duplicated in the text.
@@ -499,15 +509,15 @@
\endETEX
-%D Very handy, more efficient than \type{{}}, and more readable
-%D than \type {\empty}.
+%D Very handy, more efficient than \type{{}}, and more readable
+%D than \type {\empty}.
\let\donothing\empty
-% The following macros are used in XML handling.
+% The following macros are used in XML handling.
-\long\def\dowithstringed#1#2#3#4% " ' space
- {\if#4"\@EA#1\else\if#4'\@EAEAEA#2\else\@EAEAEA#3\fi\fi#4}
+\long\def\dowithstringed#1#2#3#4% " ' space
+ {\if#4"\@EA#1\else\if#4'\@EAEAEA#2\else\@EAEAEA#3\fi\fi#4}
\def\unstringed
{\dowithstringed\unstringdouble\unstringsingle\unstringnothing}
@@ -541,12 +551,12 @@
\ifx#3\relax
\@EAEAEAEAEAEA\@@if@@equal@@false
\else\ifx#1#3%
- % go on
+ % go on
\else
\@EAEAEAEAEAEA\@@if@@equal@@false
\fi\fi
\fi
- \@@ifequal#2\@@and}
+ \@@ifequal#2\@@and}
\long\def\@@if@@equal@@true #1\@@then#2#3{#2}
\long\def\@@if@@equal@@false#1\@@then#2#3{#3}
@@ -559,9 +569,9 @@
\let\notexpanded\empty
\@@expanded}
-% for Simon ; watch how we make them fully expandable (i.e.
+% for Simon ; watch how we make them fully expandable (i.e.
% no \type {\relax}es) popping up
-
+
\def\@@dothenumber#1\relax#2\end{#1}
\def\@@thenumber#1{\@EA\@@dothenumber\number#1\relax\end}
@@ -569,22 +579,22 @@
\def\doifnum#1#2%
{\ifnum#1=\@@thenumber{#2} % space needed
\expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
+ \else
+ \expandafter\gobbleoneargument
\fi}
\def\doifnotnum#1#2%
{\ifnum#1=\@@thenumber{#2} % space needed
\expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
+ \else
+ \expandafter\firstofoneargument
\fi}
\def\doifelsenum#1#2%
{\ifnum#1=\@@thenumber{#2} % space needed
\expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
+ \else
+ \expandafter\secondoftwoarguments
\fi}
% \edef\xxxx{\doifnum{1}{2}{no}} \show \xxxx
@@ -596,4 +606,4 @@
\def\appendvalue #1{\@EA\appended\@EA \def\csname#1\endcsname}
\def\appendgvalue#1{\@EA\appended\@EA\gdef\csname#1\endcsname}
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/thrd-trg.tex b/tex/context/base/thrd-trg.tex
new file mode 100644
index 000000000..8c60986c9
--- /dev/null
+++ b/tex/context/base/thrd-trg.tex
@@ -0,0 +1,114 @@
+%D In order to support rotation over arbitrary angles, we need a sine
+%D and cosine calculator. For this purpose we borrow a few macros by
+%D David Carlisle (his trig package). Because local variables are
+%D used, I patched the macros a bit. Also, I used a few different names
+%D for variabels and macros and use existing auxiliary macros.
+
+\unprotect
+
+\chardef \@iv = 4
+\chardef \@xc = 90 % was \nin@ty
+\chardef \@clxx = 180
+\chardef \@lxxi = 71
+\mathchardef \@mmmmlxviii = 4068
+\mathchardef \@xvi@k = 16384
+
+\chardef \tr@coeffz = 72
+\chardef \tr@coefb = 42
+\mathchardef \tr@coefc = 840
+\mathchardef \tr@coefd = 5040
+
+\def\tg@series
+ {\!!dimena\@lxxi\!!dimena
+ \divide\!!dimena\@mmmmlxviii
+ \edef\!!stringa{\withoutpt{\the\!!dimena}}%
+ \!!dimena\!!stringa\!!dimena
+ \edef\!!stringb{\withoutpt{\the\!!dimena}}%
+ \divide\!!dimena\tr@coeffz
+ \advance\!!dimena\minusone\onepoint
+ \!!dimena\!!stringb\!!dimena
+ \advance\!!dimena \tr@coefb\onepoint
+ \!!dimena\!!stringb\!!dimena
+ \advance\!!dimena -\tr@coefc\onepoint
+ \!!dimena\!!stringb\!!dimena
+ \advance\!!dimena \tr@coefd\onepoint
+ \!!dimena\!!stringa\!!dimena
+ \divide\!!dimena \tr@coefd}
+
+\def\tg@reduce#1#2%
+ {\!!dimena#1#2\@xc\onepoint
+ \advance\!!dimena#2-\@clxx\onepoint
+ \!!dimena-\!!dimena
+ \tg@@sin}
+
+\def\tg@@sin
+ {\ifdim\tg@reduce>+\else\ifdim\tg@reduce<-\else
+ \tg@series
+ \fi\fi}
+
+%D Calculating a sine is a two step process: first a value is
+%D calculated, and afterwards it can be used. This saves redundant
+%D calculations.
+
+\def\calculatesin#1%
+ {{\expandafter\ifx\csname sin \number#1\endcsname\relax
+ \!!dimena#1\onepoint
+ \tg@@sin
+ \expandafter\xdef\csname sin \number#1\endcsname{\withoutpt{\the\!!dimena}}%
+ \fi}}
+
+\def\calculatecos#1%
+ {{\expandafter\ifx\csname cos \number#1\endcsname\relax
+ \!!dimena\@xc\onepoint
+ \advance\!!dimena-#1\onepoint
+ \tg@@sin
+ \expandafter\xdef\csname cos \number#1\endcsname{\withoutpt{\the\!!dimena}}%
+ \fi}}
+
+\def\calculatetan#1%
+ {{\expandafter\ifx\csname tan \number#1\endcsname\relax
+ \calculatesin{#1}%
+ \calculatecos{#1}%
+ \!!dimena\calculatedcos{#1}\onepoint
+ \divide\!!dimena\@iv
+ \!!dimenb\calculatedsin{#1}\onepoint
+ \!!dimenb\@xvi@k\!!dimenb
+ \divide\!!dimenb\!!dimena
+ \expandafter\xdef\csname tan \number#1\endcsname{\withoutpt{\the\!!dimenb}}%
+ \fi}}
+
+%D The results are accessed with:
+
+\def\calculatedsin#1{\csname sin \number#1\endcsname}
+\def\calculatedcos#1{\csname cos \number#1\endcsname}
+\def\calculatedtan#1{\csname tan \number#1\endcsname}
+
+%D A more save implementation would be:
+
+\def\calculatedsin#1{\executeifdefined{sin \number#1}\!!zerocount}
+\def\calculatedcos#1{\executeifdefined{cos \number#1}\!!plusone}
+\def\calculatedtan#1{\executeifdefined{tan \number#1}\!!zerocount}
+
+%D A few values are predefined, although, on todays systems there
+%D is no real reason for that. I've added the 270 ones and changed
+%D the -90 tan. Also, I prefer text (\type {\!!..} instead of
+%D counters \type {\..}.
+
+\expandafter\let\csname sin 0\endcsname\!!zerocount
+\expandafter\let\csname cos 0\endcsname\!!plusone
+\expandafter\let\csname sin 90\endcsname\!!plusone
+\expandafter\let\csname cos 90\endcsname\!!zerocount
+\expandafter\let\csname sin 180\endcsname\!!zerocount
+\expandafter\let\csname cos 180\endcsname\!!minusone
+\expandafter\let\csname sin 270\endcsname\!!minusone
+\expandafter\let\csname cos 270\endcsname\!!zerocount
+
+\expandafter\let\csname sin -90\endcsname\!!minusone
+\expandafter\let\csname cos -90\endcsname\!!zerocount
+
+\expandafter\def\csname tan 90\endcsname{\writestatus\m!systems{infinite tan +90}}
+\expandafter\def\csname tan -90\endcsname{\writestatus\m!systems{infinite tan -90}}
+
+%D Usage: \type {\calculatesin{10}} and \type {\calculatedsin{10}}
+
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/type-enc.tex b/tex/context/base/type-enc.tex
index fd3bdc746..e8c1e6e2b 100644
--- a/tex/context/base/type-enc.tex
+++ b/tex/context/base/type-enc.tex
@@ -18,6 +18,7 @@
% Free fonts.
+% beter \typefacethree dan \typefaceencoding ! ! ! ! ! ! ander sgeen selectie op bv ec
% Computer & Latin Modern Roman (DEK/AMS/BJ)
@@ -116,80 +117,80 @@
% Regular
- \definefontsynonym [cmr5] [cork-lmr5] [encoding=cork]
- \definefontsynonym [cmr6] [cork-lmr6] [encoding=cork]
- \definefontsynonym [cmr7] [cork-lmr7] [encoding=cork]
- \definefontsynonym [cmr8] [cork-lmr8] [encoding=cork]
- \definefontsynonym [cmr9] [cork-lmr9] [encoding=cork]
- \definefontsynonym [cmr10] [cork-lmr10] [encoding=cork]
- \definefontsynonym [cmr12] [cork-lmr12] [encoding=cork]
- \definefontsynonym [cmr17] [cork-lmr17] [encoding=cork]
-
- \definefontsynonym [cmbx5] [cork-lmbx5] [encoding=cork]
- \definefontsynonym [cmbx6] [cork-lmbx6] [encoding=cork]
- \definefontsynonym [cmbx7] [cork-lmbx7] [encoding=cork]
- \definefontsynonym [cmbx8] [cork-lmbx8] [encoding=cork]
- \definefontsynonym [cmbx9] [cork-lmbx9] [encoding=cork]
- \definefontsynonym [cmbx10] [cork-lmbx10] [encoding=cork]
- \definefontsynonym [cmbx12] [cork-lmbx12] [encoding=cork]
-
- \definefontsynonym [cmsl10] [cork-lmro10] [encoding=cork]
- \definefontsynonym [cmsl12] [cork-lmro12] [encoding=cork]
- \definefontsynonym [cmsl8] [cork-lmro8] [encoding=cork]
- \definefontsynonym [cmsl9] [cork-lmro9] [encoding=cork]
-
- \definefontsynonym [cmti7] [cork-lmri7] [encoding=cork]
- \definefontsynonym [cmti8] [cork-lmri8] [encoding=cork]
- \definefontsynonym [cmti9] [cork-lmri9] [encoding=cork]
- \definefontsynonym [cmti10] [cork-lmri10] [encoding=cork]
- \definefontsynonym [cmti12] [cork-lmri12] [encoding=cork]
-
- \definefontsynonym [cmb10] [cork-lmb10] [encoding=cork]
- \definefontsynonym [cmbsl10] [cork-lmbo10] [encoding=cork]
- \definefontsynonym [cmbxsl10] [cork-lmbxo10] [encoding=cork]
- \definefontsynonym [cmbxti10] [cork-lmbxi10] [encoding=cork]
-
- \definefontsynonym [cmcsc10] [cork-lmcsc10] [encoding=cork]
- \definefontsynonym [cmcscsl10][cork-lmcsco10] [encoding=cork]
+ \definefontsynonym [cmr5] [cork-lmr5] [encoding=ec]
+ \definefontsynonym [cmr6] [cork-lmr6] [encoding=ec]
+ \definefontsynonym [cmr7] [cork-lmr7] [encoding=ec]
+ \definefontsynonym [cmr8] [cork-lmr8] [encoding=ec]
+ \definefontsynonym [cmr9] [cork-lmr9] [encoding=ec]
+ \definefontsynonym [cmr10] [cork-lmr10] [encoding=ec]
+ \definefontsynonym [cmr12] [cork-lmr12] [encoding=ec]
+ \definefontsynonym [cmr17] [cork-lmr17] [encoding=ec]
+
+ \definefontsynonym [cmbx5] [cork-lmbx5] [encoding=ec]
+ \definefontsynonym [cmbx6] [cork-lmbx6] [encoding=ec]
+ \definefontsynonym [cmbx7] [cork-lmbx7] [encoding=ec]
+ \definefontsynonym [cmbx8] [cork-lmbx8] [encoding=ec]
+ \definefontsynonym [cmbx9] [cork-lmbx9] [encoding=ec]
+ \definefontsynonym [cmbx10] [cork-lmbx10] [encoding=ec]
+ \definefontsynonym [cmbx12] [cork-lmbx12] [encoding=ec]
+
+ \definefontsynonym [cmsl10] [cork-lmro10] [encoding=ec]
+ \definefontsynonym [cmsl12] [cork-lmro12] [encoding=ec]
+ \definefontsynonym [cmsl8] [cork-lmro8] [encoding=ec]
+ \definefontsynonym [cmsl9] [cork-lmro9] [encoding=ec]
+
+ \definefontsynonym [cmti7] [cork-lmri7] [encoding=ec]
+ \definefontsynonym [cmti8] [cork-lmri8] [encoding=ec]
+ \definefontsynonym [cmti9] [cork-lmri9] [encoding=ec]
+ \definefontsynonym [cmti10] [cork-lmri10] [encoding=ec]
+ \definefontsynonym [cmti12] [cork-lmri12] [encoding=ec]
+
+ \definefontsynonym [cmb10] [cork-lmb10] [encoding=ec]
+ \definefontsynonym [cmbsl10] [cork-lmbo10] [encoding=ec]
+ \definefontsynonym [cmbxsl10] [cork-lmbxo10] [encoding=ec]
+ \definefontsynonym [cmbxti10] [cork-lmbxi10] [encoding=ec]
+
+ \definefontsynonym [cmcsc10] [cork-lmcsc10] [encoding=ec]
+ \definefontsynonym [cmcscsl10][cork-lmcsco10] [encoding=ec]
% Mono
- \definefontsynonym [cmtt8] [cork-lmtt8] [encoding=cork]
- \definefontsynonym [cmtt9] [cork-lmtt9] [encoding=cork]
- \definefontsynonym [cmtt10] [cork-lmtt10] [encoding=cork]
- \definefontsynonym [cmtt12] [cork-lmtt12] [encoding=cork]
+ \definefontsynonym [cmtt8] [cork-lmtt8] [encoding=ec]
+ \definefontsynonym [cmtt9] [cork-lmtt9] [encoding=ec]
+ \definefontsynonym [cmtt10] [cork-lmtt10] [encoding=ec]
+ \definefontsynonym [cmtt12] [cork-lmtt12] [encoding=ec]
- \definefontsynonym [cmitt10] [cork-lmtti10] [encoding=cork]
- \definefontsynonym [cmsltt10] [cork-lmtto10] [encoding=cork]
+ \definefontsynonym [cmitt10] [cork-lmtti10] [encoding=ec]
+ \definefontsynonym [cmsltt10] [cork-lmtto10] [encoding=ec]
- \definefontsynonym [cmvtt10] [cork-lmvtt10] [encoding=cork]
- \definefontsynonym [cmvtti10] [cork-lmvtto] [encoding=cork]
+ \definefontsynonym [cmvtt10] [cork-lmvtt10] [encoding=ec]
+ \definefontsynonym [cmvtti10] [cork-lmvtto] [encoding=ec]
- \definefontsynonym [cmcsc10] [cork-lmcsc10] [encoding=cork]
+ \definefontsynonym [cmcsc10] [cork-lmcsc10] [encoding=ec]
% Sans
- \definefontsynonym [cmss8] [cork-lmss8] [encoding=cork]
- \definefontsynonym [cmss9] [cork-lmss9] [encoding=cork]
- \definefontsynonym [cmss10] [cork-lmss10] [encoding=cork]
- \definefontsynonym [cmss12] [cork-lmss12] [encoding=cork]
- \definefontsynonym [cmss17] [cork-lmss17] [encoding=cork]
+ \definefontsynonym [cmss8] [cork-lmss8] [encoding=ec]
+ \definefontsynonym [cmss9] [cork-lmss9] [encoding=ec]
+ \definefontsynonym [cmss10] [cork-lmss10] [encoding=ec]
+ \definefontsynonym [cmss12] [cork-lmss12] [encoding=ec]
+ \definefontsynonym [cmss17] [cork-lmss17] [encoding=ec]
- \definefontsynonym [cmssi10] [cork-lmsso10] [encoding=cork]
- \definefontsynonym [cmssi12] [cork-lmsso12] [encoding=cork]
- \definefontsynonym [cmssi17] [cork-lmsso17] [encoding=cork]
- \definefontsynonym [cmssi8] [cork-lmsso8] [encoding=cork]
- \definefontsynonym [cmssi9] [cork-lmsso9] [encoding=cork]
+ \definefontsynonym [cmssi10] [cork-lmsso10] [encoding=ec]
+ \definefontsynonym [cmssi12] [cork-lmsso12] [encoding=ec]
+ \definefontsynonym [cmssi17] [cork-lmsso17] [encoding=ec]
+ \definefontsynonym [cmssi8] [cork-lmsso8] [encoding=ec]
+ \definefontsynonym [cmssi9] [cork-lmsso9] [encoding=ec]
- \definefontsynonym [cmssq8] [cork-lmssq8] [encoding=cork]
- \definefontsynonym [cmssqb8] [cork-lmssqbx8] [encoding=cork]
- \definefontsynonym [cmssqbi8] [cork-lmssqbo8] [encoding=cork]
- \definefontsynonym [cmssqi8] [cork-lmssqo8] [encoding=cork]
+ \definefontsynonym [cmssq8] [cork-lmssq8] [encoding=ec]
+ \definefontsynonym [cmssqb8] [cork-lmssqbx8] [encoding=ec]
+ \definefontsynonym [cmssqbi8] [cork-lmssqbo8] [encoding=ec]
+ \definefontsynonym [cmssqi8] [cork-lmssqo8] [encoding=ec]
- \definefontsynonym [cmssbx10] [cork-lmssbx10] [encoding=cork]
- \definefontsynonym [cmssdc10] [cork-lmssdc10] [encoding=cork]
- \definefontsynonym [cmssbi10] [cork-lmssbo10] [encoding=cork]
- \definefontsynonym [cmssdi10] [cork-lmssdo10] [encoding=cork]
+ \definefontsynonym [cmssbx10] [cork-lmssbx10] [encoding=ec]
+ \definefontsynonym [cmssdc10] [cork-lmssdc10] [encoding=ec]
+ \definefontsynonym [cmssbi10] [cork-lmssbo10] [encoding=ec]
+ \definefontsynonym [cmssdi10] [cork-lmssdo10] [encoding=ec]
\stoptypescript
@@ -756,64 +757,64 @@
\definefontsynonym [cmvtt10] [lhvtt10] [encoding=lcy]
\stoptypescript
-\starttypescript [all] [computer-modern] [ec]
- \definefontsynonym [cmb10] [ecrb1000] [encoding=ec]
- \definefontsynonym [cmbx10] [ecbx1000] [encoding=ec]
- \definefontsynonym [cmbx12] [ecbx1200] [encoding=ec]
- \definefontsynonym [cmbx5] [ecbx0500] [encoding=ec]
- \definefontsynonym [cmbx6] [ecbx0600] [encoding=ec]
- \definefontsynonym [cmbx7] [ecbx0700] [encoding=ec]
- \definefontsynonym [cmbx8] [ecbx0800] [encoding=ec]
- \definefontsynonym [cmbx9] [ecbx0900] [encoding=ec]
- \definefontsynonym [cmbxsl10] [ecbl1000] [encoding=ec]
- \definefontsynonym [cmbxti10] [ecbi1000] [encoding=ec]
- \definefontsynonym [cmcsc10] [eccc1000] [encoding=ec]
- \definefontsynonym [cmdunh10] [ecdh1000] [encoding=ec]
- \definefontsynonym [cmff10] [ecff1000] [encoding=ec]
- \definefontsynonym [cmfi10] [ecfi1000] [encoding=ec]
- \definefontsynonym [cmfib8] [ecfb0800] [encoding=ec]
- %\definefontsynonym [cminch] [ecinch00] [encoding=ec]
- \definefontsynonym [cmitt10] [ecit1000] [encoding=ec]
- \definefontsynonym [cmr10] [ecrm1000] [encoding=ec]
- \definefontsynonym [cmr12] [ecrm1200] [encoding=ec]
- \definefontsynonym [cmr17] [ecrm1700] [encoding=ec]
- \definefontsynonym [cmr5] [ecrm0500] [encoding=ec]
- \definefontsynonym [cmr6] [ecrm0600] [encoding=ec]
- \definefontsynonym [cmr7] [ecrm0700] [encoding=ec]
- \definefontsynonym [cmr8] [ecrm0800] [encoding=ec]
- \definefontsynonym [cmr9] [ecrm0900] [encoding=ec]
- \definefontsynonym [cmsl10] [ecsl1000] [encoding=ec]
- \definefontsynonym [cmsl12] [ecsl1200] [encoding=ec]
- \definefontsynonym [cmsl8] [ecsl0800] [encoding=ec]
- \definefontsynonym [cmsl9] [ecsl0900] [encoding=ec]
- \definefontsynonym [cmsltt10] [ecst1000] [encoding=ec]
- \definefontsynonym [cmss10] [ecss1000] [encoding=ec]
- \definefontsynonym [cmss12] [ecss1200] [encoding=ec]
- \definefontsynonym [cmss17] [ecss1700] [encoding=ec]
- \definefontsynonym [cmss8] [ecss0800] [encoding=ec]
- \definefontsynonym [cmss9] [ecss0900] [encoding=ec]
- \definefontsynonym [cmssbx10] [ecsx1000] [encoding=ec]
- %\definefontsynonym [cmssdc10] [ecssdc1000] [encoding=ec]
- \definefontsynonym [cmssi10] [ecsi1000] [encoding=ec]
- \definefontsynonym [cmssi12] [ecsi1200] [encoding=ec]
- \definefontsynonym [cmssi17] [ecsi1700] [encoding=ec]
- \definefontsynonym [cmssi8] [ecsi0800] [encoding=ec]
- \definefontsynonym [cmssi9] [ecsi0900] [encoding=ec]
- \definefontsynonym [cmssq8] [ecss0800] [encoding=ec] % ssq->ss
- \definefontsynonym [cmssqi8] [ecsi0800] [encoding=ec] % ssq->ss
- \definefontsynonym [cmtcsc10] [ectc1000] [encoding=ec]
- \definefontsynonym [cmti10] [ecti1000] [encoding=ec]
- \definefontsynonym [cmti12] [ecti1200] [encoding=ec]
- \definefontsynonym [cmti7] [ecti0700] [encoding=ec]
- \definefontsynonym [cmti8] [ecti0800] [encoding=ec]
- \definefontsynonym [cmti9] [ecti0900] [encoding=ec]
- \definefontsynonym [cmtt10] [ectt1000] [encoding=ec]
- \definefontsynonym [cmtt12] [ectt1200] [encoding=ec]
- \definefontsynonym [cmtt8] [ectt0800] [encoding=ec]
- \definefontsynonym [cmtt9] [ectt0900] [encoding=ec]
- \definefontsynonym [cmu10] [ecui1000] [encoding=ec]
- \definefontsynonym [cmvtt10] [ecvt1000] [encoding=ec]
-\stoptypescript
+% \starttypescript [all] [computer-modern] [ec]
+% \definefontsynonym [cmb10] [ecrb1000] [encoding=ec]
+% \definefontsynonym [cmbx10] [ecbx1000] [encoding=ec]
+% \definefontsynonym [cmbx12] [ecbx1200] [encoding=ec]
+% \definefontsynonym [cmbx5] [ecbx0500] [encoding=ec]
+% \definefontsynonym [cmbx6] [ecbx0600] [encoding=ec]
+% \definefontsynonym [cmbx7] [ecbx0700] [encoding=ec]
+% \definefontsynonym [cmbx8] [ecbx0800] [encoding=ec]
+% \definefontsynonym [cmbx9] [ecbx0900] [encoding=ec]
+% \definefontsynonym [cmbxsl10] [ecbl1000] [encoding=ec]
+% \definefontsynonym [cmbxti10] [ecbi1000] [encoding=ec]
+% \definefontsynonym [cmcsc10] [eccc1000] [encoding=ec]
+% \definefontsynonym [cmdunh10] [ecdh1000] [encoding=ec]
+% \definefontsynonym [cmff10] [ecff1000] [encoding=ec]
+% \definefontsynonym [cmfi10] [ecfi1000] [encoding=ec]
+% \definefontsynonym [cmfib8] [ecfb0800] [encoding=ec]
+% %\definefontsynonym [cminch] [ecinch00] [encoding=ec]
+% \definefontsynonym [cmitt10] [ecit1000] [encoding=ec]
+% \definefontsynonym [cmr10] [ecrm1000] [encoding=ec]
+% \definefontsynonym [cmr12] [ecrm1200] [encoding=ec]
+% \definefontsynonym [cmr17] [ecrm1700] [encoding=ec]
+% \definefontsynonym [cmr5] [ecrm0500] [encoding=ec]
+% \definefontsynonym [cmr6] [ecrm0600] [encoding=ec]
+% \definefontsynonym [cmr7] [ecrm0700] [encoding=ec]
+% \definefontsynonym [cmr8] [ecrm0800] [encoding=ec]
+% \definefontsynonym [cmr9] [ecrm0900] [encoding=ec]
+% \definefontsynonym [cmsl10] [ecsl1000] [encoding=ec]
+% \definefontsynonym [cmsl12] [ecsl1200] [encoding=ec]
+% \definefontsynonym [cmsl8] [ecsl0800] [encoding=ec]
+% \definefontsynonym [cmsl9] [ecsl0900] [encoding=ec]
+% \definefontsynonym [cmsltt10] [ecst1000] [encoding=ec]
+% \definefontsynonym [cmss10] [ecss1000] [encoding=ec]
+% \definefontsynonym [cmss12] [ecss1200] [encoding=ec]
+% \definefontsynonym [cmss17] [ecss1700] [encoding=ec]
+% \definefontsynonym [cmss8] [ecss0800] [encoding=ec]
+% \definefontsynonym [cmss9] [ecss0900] [encoding=ec]
+% \definefontsynonym [cmssbx10] [ecsx1000] [encoding=ec]
+% %\definefontsynonym [cmssdc10] [ecssdc1000] [encoding=ec]
+% \definefontsynonym [cmssi10] [ecsi1000] [encoding=ec]
+% \definefontsynonym [cmssi12] [ecsi1200] [encoding=ec]
+% \definefontsynonym [cmssi17] [ecsi1700] [encoding=ec]
+% \definefontsynonym [cmssi8] [ecsi0800] [encoding=ec]
+% \definefontsynonym [cmssi9] [ecsi0900] [encoding=ec]
+% \definefontsynonym [cmssq8] [ecss0800] [encoding=ec] % ssq->ss
+% \definefontsynonym [cmssqi8] [ecsi0800] [encoding=ec] % ssq->ss
+% \definefontsynonym [cmtcsc10] [ectc1000] [encoding=ec]
+% \definefontsynonym [cmti10] [ecti1000] [encoding=ec]
+% \definefontsynonym [cmti12] [ecti1200] [encoding=ec]
+% \definefontsynonym [cmti7] [ecti0700] [encoding=ec]
+% \definefontsynonym [cmti8] [ecti0800] [encoding=ec]
+% \definefontsynonym [cmti9] [ecti0900] [encoding=ec]
+% \definefontsynonym [cmtt10] [ectt1000] [encoding=ec]
+% \definefontsynonym [cmtt12] [ectt1200] [encoding=ec]
+% \definefontsynonym [cmtt8] [ectt0800] [encoding=ec]
+% \definefontsynonym [cmtt9] [ectt0900] [encoding=ec]
+% \definefontsynonym [cmu10] [ecui1000] [encoding=ec]
+% \definefontsynonym [cmvtt10] [ecvt1000] [encoding=ec]
+% \stoptypescript
\starttypescript [serif] [computer-modern] [default]
\definefontsynonym [ComputerModern] [cmr10]
@@ -886,8 +887,8 @@
% Fourier (Utopia)
\starttypescript [math] [fourier] [default,ec]
- % \definefontsynonym [Fourier-Math-Letters] [futr8t] [encoding=ec]
- \definefontsynonym [Fourier-Math-Letters] [futmi]
+ \definefontsynonym [Fourier-Math-Letters] [futr8t] [encoding=ec]
+ %\definefontsynonym [Fourier-Math-Letters] [futmi]
\definefontsynonym [Fourier-Math-Letters-Italic] [futmii]
\definefontsynonym [Fourier-Math-Symbols] [futsy]
\definefontsynonym [Fourier-Math-Extension] [fourier-mex]
@@ -1044,7 +1045,7 @@
\definefontsynonym [Bookman-LightSlanted] [\typefaceencoding-ubkl8a-slanted-167] [encoding=\typefaceencoding]
\definefontsynonym [Bookman-DemiBoldSlanted] [\typefaceencoding-ubkd8a-slanted-167] [encoding=\typefaceencoding]
- \definefontsynonym [Bookman-Light-Caps] [\typefaceencoding-ubkl8a-capitalized-800] [encoding=\typefaceencoding]
+ \definefontsynonym [Bookman-Light-Caps] [\typefaceencoding-ubkl8a-capitalized-800] [encoding=\typefaceencoding]
\stoptypescript
% Chancery (URW)
@@ -1053,6 +1054,18 @@
\definefontsynonym [Chancery] [\typefaceencoding-uzcmi8a] [encoding=\typefaceencoding]
\stoptypescript
+% New Century Schoolbook (URW)
+
+\starttypescript [serif] [schoolbook] [ec,texnansi,8r]
+ \definefontsynonym [Schoolbook-Roman] [\typefaceencoding-uncr8a] [encoding=\typefaceencoding]
+ \definefontsynonym [Schoolbook-Italic] [\typefaceencoding-uncri8a] [encoding=\typefaceencoding]
+ \definefontsynonym [Schoolbook-Bold] [\typefaceencoding-uncb8a] [encoding=\typefaceencoding]
+ \definefontsynonym [Schoolbook-BoldItalic] [\typefaceencoding-uncbi8a] [encoding=\typefaceencoding]
+ \definefontsynonym [Schoolbook-RomanSlanted] [\typefaceencoding-uncr8a-slanted-167] [encoding=\typefaceencoding]
+ \definefontsynonym [Schoolbook-BoldSlanted] [\typefaceencoding-uncb8a-slanted-167] [encoding=\typefaceencoding]
+ \definefontsynonym [Schoolbook-Roman-Caps] [\typefaceencoding-uncr8a-capitalized-800] [encoding=\typefaceencoding]
+\stoptypescript
+
% Utopia (Adobe)
\starttypescript [serif] [utopia] [ec,texnansi]
@@ -1150,7 +1163,7 @@
\definefontsynonym [LucidaNewMath-AltDemiItalic] [lbmdo]
\definefontsynonym [LucidaNewMath-Arrows-Demi] [lbmad]
\definefontsynonym [LucidaNewMath-Extension] [lbme]
- \definefontsynonym [LucidaNewMath-Demibold] [lbmd]
+ \definefontsynonym [LucidaNewMath-DemiBold] [lbmd]
\definefontsynonym [LucidaNewMath-DemiItalic] [lbmdi]
\definefontsynonym [LucidaNewMath-Symbol-Demi] [lbmsd]
\stoptypescript
diff --git a/tex/context/base/type-exa.tex b/tex/context/base/type-exa.tex
index 0e0455605..46d1811cc 100644
--- a/tex/context/base/type-exa.tex
+++ b/tex/context/base/type-exa.tex
@@ -13,126 +13,180 @@
%D A couple of goodies:
-\starttypescript [modern] [ec,il2,pl0,default]
+\starttypescript [modern] [texnansi,ec,il2,pl0,default]
-\definetypeface [modern] [rm] [serif] [computer-modern] [computer-modern] [encoding=\typescripttwo]
-\definetypeface [modern] [ss] [sans] [computer-modern] [computer-modern] [encoding=\typescripttwo]
-\definetypeface [modern] [tt] [mono] [computer-modern] [computer-modern] [encoding=\typescripttwo]
-\definetypeface [modern] [mm] [math] [computer-modern] [computer-modern] [encoding=\typescripttwo]
+ \definetypeface [modern] [rm] [serif] [latin-modern] [computer-modern] [encoding=\typescripttwo]
+ \definetypeface [modern] [ss] [sans] [latin-modern] [computer-modern] [encoding=\typescripttwo]
+ \definetypeface [modern] [tt] [mono] [latin-modern] [computer-modern] [encoding=\typescripttwo]
+ \definetypeface [modern] [mm] [math] [latin-modern] [computer-modern] [encoding=\typescripttwo]
+
+\stoptypescript
+
+\starttypescript [modern-base] [texnansi,ec,il2,pl0,default]
+
+ \definetypeface [modern] [rm] [serif] [computer-modern] [default] [encoding=\typescripttwo]
+ \definetypeface [modern] [ss] [sans] [computer-modern] [default] [encoding=\typescripttwo]
+ \definetypeface [modern] [tt] [mono] [computer-modern] [default] [encoding=\typescripttwo]
+ \definetypeface [modern] [mm] [math] [computer-modern] [default] [encoding=\typescripttwo]
\stoptypescript
\starttypescript [postscript] [texnansi,ec,8r]
-\definetypeface [postscript] [rm] [serif] [times] [default] [encoding=\typescripttwo]
-\definetypeface [postscript] [mm] [math] [times] [default]
-\definetypeface [postscript] [ss] [sans] [helvetica] [default] [rscale=.9,encoding=\typescripttwo]
-\definetypeface [postscript] [tt] [mono] [courier] [default] [rscale=1.1,encoding=\typescripttwo]
+ \definetypeface [postscript] [rm] [serif] [times] [default] [encoding=\typescripttwo]
+ \definetypeface [postscript] [mm] [math] [times] [default]
+ \definetypeface [postscript] [ss] [sans] [helvetica] [default] [rscale=.9,encoding=\typescripttwo]
+ \definetypeface [postscript] [tt] [mono] [courier] [default] [rscale=1.1,encoding=\typescripttwo]
\stoptypescript
\starttypescript [times] [texnansi,ec,8r]
-\definetypeface [times] [rm] [serif] [times] [default] [encoding=\typescripttwo]
-\definetypeface [times] [ss] [sans] [helvetica] [default] [rscale=.9,encoding=\typescripttwo]
-\definetypeface [times] [tt] [mono] [computer-modern] [default] [rscale=1.1]
-\definetypeface [times] [mm] [math] [times] [default] [encoding=\typescripttwo]
+ \definetypeface [times] [rm] [serif] [times] [default] [encoding=\typescripttwo]
+ \definetypeface [times] [ss] [sans] [helvetica] [default] [rscale=.9,encoding=\typescripttwo]
+ \definetypeface [times] [tt] [mono] [computer-modern] [default] [rscale=1.1]
+ \definetypeface [times] [mm] [math] [times] [default] [encoding=\typescripttwo]
+
+% \usemathcollection[default]
\stoptypescript
\starttypescript [palatino] [texnansi,ec,8r]
-\definetypeface [palatino] [rm] [serif] [palatino] [default] [encoding=\typescripttwo]
-\definetypeface [palatino] [mm] [math] [palatino] [default] [encoding=default]
-\definetypeface [palatino] [tt] [mono] [computer-modern] [default] [rscale=1.075,encoding=\typescripttwo]
+ \definetypeface [palatino] [rm] [serif] [palatino] [default] [encoding=\typescripttwo]
+ \definetypeface [palatino] [mm] [math] [palatino] [default] [encoding=default]
+ \definetypeface [palatino] [tt] [mono] [computer-modern] [default] [rscale=1.075,encoding=\typescripttwo]
+
+% \usemathcollection[default]
\stoptypescript
\starttypescript [fourier] [ec]
-\definetypeface [fourier] [rm] [serif] [fourier] [default] [encoding=ec]
-\definetypeface [fourier] [mm] [math] [fourier] [default] [encoding=default]
-\definetypeface [fourier] [tt] [mono] [latin-modern] [default] [rscale=1.070,encoding=ec]
+ \definetypeface [fourier] [rm] [serif] [fourier] [default] [encoding=ec]
+ \definetypeface [fourier] [mm] [math] [fourier] [default] [encoding=default]
+ \definetypeface [fourier] [tt] [mono] [latin-modern] [default] [rscale=1.070,encoding=ec]
-\usemathcollection[fou]
+ \usemathcollection[fou]
+
+\stoptypescript
+
+\starttypescript [lucida,lucidabfm] [texnansi,ec,8r]
+
+ \definetypeface [lucida] [rm] [serif] [lucida] [default] [encoding=\typescripttwo]
+ \definetypeface [lucida] [ss] [sans] [lucida] [default] [encoding=\typescripttwo]
+ \definetypeface [lucida] [tt] [mono] [lucida] [default] [encoding=\typescripttwo]
+ \definetypeface [lucida] [hw] [handwriting] [lucida] [default] [encoding=\typescripttwo]
\stoptypescript
\starttypescript [lucida] [texnansi,ec,8r]
-\definetypeface [lucida] [rm] [serif] [lucida] [default] [encoding=\typescripttwo]
-\definetypeface [lucida] [ss] [sans] [lucida] [default] [encoding=\typescripttwo]
-\definetypeface [lucida] [tt] [mono] [lucida] [default] [encoding=\typescripttwo]
-\definetypeface [lucida] [mm] [math] [lucida] [default] [encoding=\typescripttwo]
-\definetypeface [lucida] [hw] [handwriting] [lucida] [default] [encoding=\typescripttwo]
+ \definetypeface [lucida] [mm] [math] [lucida] [default] [encoding=\typescripttwo]
+
+\stoptypescript
-\usemathcollection[lbr]
+\starttypescript [lucidaboldmath] [texnansi,ec,8r]
+
+\definetypeface [lucidaboldmath] [rm] [serif] [lucida] [default] [encoding=\typescripttwo] % needed ?
+\definetypeface [lucidaboldmath] [ss] [sans] [lucida] [default] [encoding=\typescripttwo] % needed ?
+\definetypeface [lucidaboldmath] [tt] [mono] [lucida] [default] [encoding=\typescripttwo] % needed ?
+\definetypeface [lucidaboldmath] [mm] [boldmath] [lucida] [default] [encoding=\typescripttwo]
+
+\stoptypescript
+
+\starttypescript [lucidabfm,lucidaboldmath] [texnansi,ec,8r]
+
+ \definetypeface [lucida] [mm] [bfmath] [lucida] [default] [encoding=\typescripttwo]
+ \definetypeface [lucidaboldmath] [mm] [bfmath] [lucida] [default] [encoding=\typescripttwo]
+
+\stoptypescript
+
+\starttypescript [lucida,lucidabfm,lucidaboldmath] [texnansi,ec,8r]
+
+ \usemathcollection[lbr]
\stoptypescript
\starttypescript [serif] [hanging] [pure]
-\setupfontsynonym [Serif] [handling=pure]
-\setupfontsynonym [SerifBold] [handling=pure]
-\setupfontsynonym [SerifSlanted] [handling=pure]
-\setupfontsynonym [SerifItalic] [handling=pure]
-\setupfontsynonym [SerifBoldSlanted] [handling=pure]
-\setupfontsynonym [SerifBoldItalic] [handling=pure]
+ \setupfontsynonym [Serif] [handling=pure]
+ \setupfontsynonym [SerifBold] [handling=pure]
+ \setupfontsynonym [SerifSlanted] [handling=pure]
+ \setupfontsynonym [SerifItalic] [handling=pure]
+ \setupfontsynonym [SerifBoldSlanted] [handling=pure]
+ \setupfontsynonym [SerifBoldItalic] [handling=pure]
\stoptypescript
\starttypescript [sans] [hanging] [pure]
-\setupfontsynonym [Sans] [handling=pure]
-\setupfontsynonym [SansBold] [handling=pure]
-\setupfontsynonym [SansSlanted] [handling=pure]
-\setupfontsynonym [SansItalic] [handling=pure]
-\setupfontsynonym [SansBoldSlanted] [handling=pure]
-\setupfontsynonym [SansBoldItalic] [handling=pure]
+ \setupfontsynonym [Sans] [handling=pure]
+ \setupfontsynonym [SansBold] [handling=pure]
+ \setupfontsynonym [SansSlanted] [handling=pure]
+ \setupfontsynonym [SansItalic] [handling=pure]
+ \setupfontsynonym [SansBoldSlanted] [handling=pure]
+ \setupfontsynonym [SansBoldItalic] [handling=pure]
\stoptypescript
\starttypescript [mono] [hanging] [pure]
-\setupfontsynonym [Mono] [handling=pure]
-\setupfontsynonym [MonoBold] [handling=pure]
-\setupfontsynonym [MonoSlanted] [handling=pure]
-\setupfontsynonym [MonoItalic] [handling=pure]
-\setupfontsynonym [MonoBoldSlanted] [handling=pure]
-\setupfontsynonym [MonoBoldItalic] [handling=pure]
+ \setupfontsynonym [Mono] [handling=pure]
+ \setupfontsynonym [MonoBold] [handling=pure]
+ \setupfontsynonym [MonoSlanted] [handling=pure]
+ \setupfontsynonym [MonoItalic] [handling=pure]
+ \setupfontsynonym [MonoBoldSlanted] [handling=pure]
+ \setupfontsynonym [MonoBoldItalic] [handling=pure]
\stoptypescript
\starttypescript [serif] [hanging] [thanh]
-\setupfontsynonym [Serif] [handling=normal]
-\setupfontsynonym [SerifBold] [handling=bold]
-\setupfontsynonym [SerifSlanted] [handling=slanted]
-\setupfontsynonym [SerifItalic] [handling=italic]
-\setupfontsynonym [SerifBoldSlanted] [handling=boldslanted]
-\setupfontsynonym [SerifBoldItalic] [handling=bolditalic]
+ \setupfontsynonym [Serif] [handling=normal]
+ \setupfontsynonym [SerifBold] [handling=bold]
+ \setupfontsynonym [SerifSlanted] [handling=slanted]
+ \setupfontsynonym [SerifItalic] [handling=italic]
+ \setupfontsynonym [SerifBoldSlanted] [handling=boldslanted]
+ \setupfontsynonym [SerifBoldItalic] [handling=bolditalic]
\stoptypescript
\starttypescript [sans] [hanging] [thanh]
-\setupfontsynonym [Sans] [handling=normal]
-\setupfontsynonym [SansBold] [handling=bold]
-\setupfontsynonym [SansSlanted] [handling=slanted]
-\setupfontsynonym [SansItalic] [handling=italic]
-\setupfontsynonym [SansBoldSlanted] [handling=boldslanted]
-\setupfontsynonym [SansBoldItalic] [handling=bolditalic]
+ \setupfontsynonym [Sans] [handling=normal]
+ \setupfontsynonym [SansBold] [handling=bold]
+ \setupfontsynonym [SansSlanted] [handling=slanted]
+ \setupfontsynonym [SansItalic] [handling=italic]
+ \setupfontsynonym [SansBoldSlanted] [handling=boldslanted]
+ \setupfontsynonym [SansBoldItalic] [handling=bolditalic]
\stoptypescript
\starttypescript [mono] [hanging] [thanh]
-\setupfontsynonym [Mono] [handling=normal]
-\setupfontsynonym [MonoBold] [handling=bold]
-\setupfontsynonym [MonoSlanted] [handling=slanted]
-\setupfontsynonym [MonoItalic] [handling=italic]
-\setupfontsynonym [MonoBoldSlanted] [handling=boldslanted]
-\setupfontsynonym [MonoBoldItalic] [handling=bolditalic]
+ \setupfontsynonym [Mono] [handling=normal]
+ \setupfontsynonym [MonoBold] [handling=bold]
+ \setupfontsynonym [MonoSlanted] [handling=slanted]
+ \setupfontsynonym [MonoItalic] [handling=italic]
+ \setupfontsynonym [MonoBoldSlanted] [handling=boldslanted]
+ \setupfontsynonym [MonoBoldItalic] [handling=bolditalic]
+
+\stoptypescript
+
+\starttypescript [serif] [simple] [name]
+
+ \definefontsynonym [Simple] [cmvtt10]
+ \setupfontsynonym [Simple] [handling=pure]
+
+\stoptypescript
+
+\starttypescript [modernvariable] [texnansi,ec,8r]
+
+ \definetypeface [modernvariable] [rm] [serif] [simple] [default] [encoding=\typescripttwo]
+ \definetypeface [modernvariable] [ss] [sans] [modern] [default] [encoding=\typescripttwo]
+ \definetypeface [modernvariable] [tt] [mono] [modern] [default] [encoding=\typescripttwo]
+ \definetypeface [modernvariable] [mm] [math] [modern] [default]
\stoptypescript
diff --git a/tex/context/base/type-fsf.tex b/tex/context/base/type-fsf.tex
index f71fd77ad..4e5a1be9b 100644
--- a/tex/context/base/type-fsf.tex
+++ b/tex/context/base/type-fsf.tex
@@ -77,7 +77,7 @@
\starttypescript [serif] [garamond] [texnansi,ec,8r]
- \loadmapfile[\typefaceencoding-fontsite-opus.map]
+ \loadmapfile[\typefaceencoding-fontsite-garamond.map]
\definefontsynonym [FSGaramond] [\typefaceencoding-garamond] [encoding=\typefaceencoding]
\definefontsynonym [FSGaramondSmCaps] [\typefaceencoding-garasc] [encoding=\typefaceencoding]
@@ -91,4 +91,4 @@
\stoptypescript
-\endinput
+\endinput \ No newline at end of file
diff --git a/tex/context/base/type-ghz.tex b/tex/context/base/type-ghz.tex
new file mode 100644
index 000000000..56e39318e
--- /dev/null
+++ b/tex/context/base/type-ghz.tex
@@ -0,0 +1,103 @@
+% run texfont from currentpath with the fonts on subpath fontsite/500
+
+% texfont --en=texnansi --ve=linotype --co=optima type-ghz.dat
+% texfont --en=texnansi --ve=linotype --co=optima-nova type-ghz.dat
+% texfont --en=texnansi --ve=linotype --co=palatino type-ghz.dat
+
+% optima
+
+\starttypescript [sans] [optima] [name]
+
+ \definefontsynonym [Sans] [OptimaLT]
+ \definefontsynonym [SansItalic] [OptimaLT-Italic]
+ \definefontsynonym [SansBold] [OptimaLT-Bold]
+ \definefontsynonym [SansBoldItalic] [OptimaLT-BoldItalic]
+
+ \definefontsynonym [SansSlanted] [SansItalic]
+ \definefontsynonym [SansBoldSlanted] [SansBoldItalic]
+
+\stoptypescript
+
+\starttypescript [sans] [optima,optima-nova] [texnansi,ec,8r]
+
+ \loadmapfile[\typefaceencoding-linotype-optima.map]
+
+ \definefontsynonym [OptimaLT] [\typefaceencoding-lte50019] [encoding=\typefaceencoding]
+ \definefontsynonym [OptimaLT-Italic] [\typefaceencoding-lte52401] [encoding=\typefaceencoding]
+ \definefontsynonym [OptimaLT-Bold] [\typefaceencoding-lte50021] [encoding=\typefaceencoding]
+ \definefontsynonym [OptimaLT-BoldItalic] [\typefaceencoding-lte54379] [encoding=\typefaceencoding]
+
+ \definefontsynonym [OptimaLT-Medium] [\typefaceencoding-lte53505] [encoding=\typefaceencoding]
+ \definefontsynonym [OptimaLT-MediumItalic] [\typefaceencoding-lte53506] [encoding=\typefaceencoding]
+ \definefontsynonym [OptimaLT-DemiBold] [\typefaceencoding-lte53507] [encoding=\typefaceencoding]
+ \definefontsynonym [OptimaLT-DemiBoldItalic] [\typefaceencoding-lte53508] [encoding=\typefaceencoding]
+ \definefontsynonym [OptimaLT-Black] [\typefaceencoding-lte53509] [encoding=\typefaceencoding]
+ \definefontsynonym [OptimaLT-BlackItalic] [\typefaceencoding-lte53510] [encoding=\typefaceencoding]
+ \definefontsynonym [OptimaLT-ExtraBlack] [\typefaceencoding-lte53511] [encoding=\typefaceencoding]
+ \definefontsynonym [OptimaLT-ExtraBlackItalic] [\typefaceencoding-lte53512] [encoding=\typefaceencoding]
+
+\stoptypescript
+
+% optima nova
+
+\starttypescript [sans] [optima-nova] [name]
+
+ \definefontsynonym [Sans] [OptimaNovaLT-Regular]
+ \definefontsynonym [SansItalic] [OptimaNovaLT-Italic]
+ \definefontsynonym [SansBold] [OptimaLT-Bold]
+ \definefontsynonym [SansBoldItalic] [OptimaLT-BoldItalic]
+
+ \definefontsynonym [SansSlanted] [SansItalic]
+ \definefontsynonym [SansBoldSlanted] [SansBoldItalic]
+
+\stoptypescript
+
+\starttypescript [sans] [optima-nova] [texnansi,ec,8r]
+
+ \loadmapfile[\typefaceencoding-linotype-optima-nova.map]
+
+ \definefontsynonym [OptimaNovaLT-Regular] [\typefaceencoding-lt55483] [encoding=\typefaceencoding]
+ \definefontsynonym [OptimaNovaLT-Italic] [\typefaceencoding-lt55486] [encoding=\typefaceencoding]
+
+\stoptypescript
+
+% palatino
+
+\starttypescript [serif] [palatino] [name]
+
+ \definefontsynonym [Serif] [PalatinoLT-Roman]
+ \definefontsynonym [SerifItalic] [PalatinoLT-Italic]
+ \definefontsynonym [SerifBold] [PalatinoLT-Bold]
+ \definefontsynonym [SerifBoldItalic] [PalatinoLT-BoldItalic]
+
+ \definefontsynonym [SerifSlanted] [SerifItalic]
+ \definefontsynonym [SerifBoldSlanted] [SerifBoldItalic]
+
+ \definefontsynonym [SerifCaps] [Palatino-SC]
+
+\stoptypescript
+
+\starttypescript [serif] [palatino] [texnansi,ec,8r]
+
+ \loadmapfile[\typefaceencoding-linotype-palatino.map]
+
+ \definefontsynonym[PalatinoLT-Roman] [\typefaceencoding-lte50001] [encoding=\typefaceencoding]
+ \definefontsynonym[PalatinoLT-Italic] [\typefaceencoding-lte50002] [encoding=\typefaceencoding]
+ \definefontsynonym[PalatinoLT-Bold] [\typefaceencoding-lte50003] [encoding=\typefaceencoding]
+ \definefontsynonym[PalatinoLT-BoldItalic] [\typefaceencoding-lte50004] [encoding=\typefaceencoding]
+
+ \definefontsynonym[PalatinoLT-Light] [\typefaceencoding-lte52168] [encoding=\typefaceencoding]
+ \definefontsynonym[PalatinoLT-LightItalic] [\typefaceencoding-lte52169] [encoding=\typefaceencoding]
+ \definefontsynonym[PalatinoLT-Medium] [\typefaceencoding-lte52170] [encoding=\typefaceencoding]
+ \definefontsynonym[PalatinoLT-MediumItalic] [\typefaceencoding-lte52171] [encoding=\typefaceencoding]
+ \definefontsynonym[PalatinoLT-Black] [\typefaceencoding-lte52172] [encoding=\typefaceencoding]
+ \definefontsynonym[PalatinoLT-BlackItalic] [\typefaceencoding-lte52173] [encoding=\typefaceencoding]
+ \definefontsynonym[Palatino-BoldItalicOsF] [\typefaceencoding-pobio] [encoding=\typefaceencoding]
+ \definefontsynonym[Palatino-BoldOsF] [\typefaceencoding-pobos] [encoding=\typefaceencoding]
+ \definefontsynonym[Palatino-ItalicOsF] [\typefaceencoding-poios] [encoding=\typefaceencoding]
+
+ \definefontsynonym[Palatino-SC] [\typefaceencoding-posc] [encoding=\typefaceencoding]
+
+\stoptypescript
+
+\endinput \ No newline at end of file
diff --git a/tex/context/base/type-ini.tex b/tex/context/base/type-ini.tex
index effbf2f53..d2ef37410 100644
--- a/tex/context/base/type-ini.tex
+++ b/tex/context/base/type-ini.tex
@@ -43,7 +43,7 @@
\let\@@typescripttwo \empty \let\typescripttwo \empty
\let\@@typescriptthree\empty \let\typescriptthree\empty
-\unexpanded\def\usetypescript%
+\unexpanded\def\usetypescript
{\dotripleempty\dousetypescript}
\def\dousetypescript[#1][#2][#3]%
@@ -53,12 +53,12 @@
{\pushmacro\@@typescriptone \edef\@@typescriptone {\truetypescript{#1}}%
\pushmacro\@@typescripttwo \edef\@@typescripttwo {\truetypescript{#2}}%
\pushmacro\@@typescriptthree\edef\@@typescriptthree{\truetypescript{#3}}%
- \pushmacro\typescriptone
- \pushmacro\typescripttwo
+ \pushmacro\typescriptone
+ \pushmacro\typescripttwo
\pushmacro\typescriptthree
\pushmacro\stoptypescript
\typescriptfoundfalse
- \writestatus\m!fonts
+ \writestatus\m!fonts
{[\@@typescriptone] [\@@typescripttwo] [\@@typescriptthree]}%
\processcommacommand[\typescriptfiles]\dododousetypescript
\firsttypescriptpassfalse % testen
@@ -84,12 +84,12 @@
\def\dousetypescriptonce[#1][#2][#3]%
{\doifelseflagged{ts:#1:#2:#3}%
{\writestatus\m!fonts{once (#1) (#2) (#3)}}
- {\setflag{ts:#1:#2:#3}%
- \expanded{\dodousetypescript[#1][#2][#3]}}}
+ {\setflag{ts:#1:#2:#3}%
+ \expanded{\dodousetypescript[#1][#2][#3]}}}
% \definetypescriptsynonym[lbr][cmr]
-\def\definetypescriptsynonym%
+\def\definetypescriptsynonym
{\dodoubleempty\dodefinetypescriptsynonym}
\def\dodefinetypescriptsynonym[#1][#2]%
@@ -127,22 +127,22 @@
\prependtoks\firsttypescriptpasstrue\to\everyjob
-% \def\dochecktypescript#1#2#3% script use value
+% \def\dochecktypescript#1#2#3% script use value
% {\donefalse
% \doifelsenothing{#1}\donetrue
% {\doifelse{#2}{all}\donetrue
% {\doifelse{#1}{all}\donetrue
% {\fullexpandtwoargsafter\doifcommonelse{#1}{#2}\donetrue\donefalse
% \ifdone\let#3\commalistelement\fi}}}}
-%
+%
% \def\starttypescript%
% {\dotripleempty\dostarttypescript}
%
% \long\def\dostarttypescript[#1][#2][#3]#4\stoptypescript
% {\iffirstargument
-% \let\typescriptone \@@typescriptone
-% \let\typescripttwo \@@typescripttwo
-% \let\typescriptthree\@@typescriptthree
+% \let\typescriptone \@@typescriptone
+% \let\typescripttwo \@@typescripttwo
+% \let\typescriptthree\@@typescriptthree
% \dochecktypescript{#1}\@@typescriptone \typescriptone \ifdone
% \dochecktypescript{#2}\@@typescripttwo \typescripttwo \ifdone
% \dochecktypescript{#3}\@@typescriptthree\typescriptthree \ifdone
@@ -154,7 +154,7 @@
% [\@@typescripttwo =#2 (\typescripttwo)]
% [\@@typescriptthree=#3 (\typescriptthree)]}%
% #4\typescriptfoundtrue
-% \fi\fi\fi
+% \fi\fi\fi
% \else\iffirsttypescriptpass
% \pushmacro\fontclass
% #4%
@@ -247,7 +247,7 @@
\else
\let\next\dostarttypescriptC
\fi
- \iftracetypescripts
+ \iftracetypescripts
\writestatus\m!fonts{\ifdone match\else pass\fi ed}%
\fi
\else\iffirsttypescriptpass
@@ -280,7 +280,7 @@
% 2 reported
% 3 preloaded
-% flags ipv \c!status, more flag values
+% flags ipv \c!status, more flag values
% \def\preloadmapfile[#1]%
% {\def\docommando##1%
@@ -290,7 +290,7 @@
% \doglobal\removefromcommalist{##1}\allfontmapsfiles}
% {\expanded{\docommando{##1.\f!fontmapextension}}}}%
% \expanded{\processcommalist[#1]}\docommando}
-%
+%
% \def\loadmapfile[#1]% last add first
% {\def\docommando##1%
% {\doifinstringelse{.}{##1}
@@ -336,11 +336,11 @@
\def\loadallfontmapfiles
{%\message{[\allfontmapsfiles]}%
\ifx\allfontmapsfiles\empty \else
- \ifautoloadmapfiles
+ \ifautoloadmapfiles
\ifcase\pdfoutput \else \ifx\pdfmapfile\undefined \else
\processcommacommand[\allfontmapsfiles]\doloadfontmapfile
\forgetmapfiles
- \fi \fi
+ \fi \fi
\else
\processcommacommand[\allfontmapsfiles]\doreportfontmapfile
\forgetmapfiles
@@ -358,6 +358,11 @@
\forgetmapfiles
+\def\disablemapfiles
+ {\ifcase\pdfoutput \else \ifx\pdfmapfile\undefined \else
+ \pdfmapfile{}% this will (kind of reset) the map file loading
+ \fi \fi}
+
% \definetypeface [#1:joke] [#2:rm]
% \definetypeface [#1:joke] [#2:rm] [#3:...]
% \definetypeface [#1:joke] [#2:rm] [#3:serif] [#4:lucida] [#5:size] [#6:...]
@@ -380,7 +385,7 @@
{\dododefinetypeface[#1][#2]
\iffifthargument % sixth is optional
% \getparameters[\??ts][rscale=1,\s!encoding=\defaultencoding,#6]
- % we need to expand since in #6 there can be a \typescripttwo
+ % we need to expand since in #6 there can be a \typescripttwo
\expanded{\getparameters[\??ts][\s!rscale=1,\s!encoding=\defaultencoding,#6]}%
% toch niet \expanded{\getparameters[\??ts][\s!rscale=1,\s!encoding=\s!default,#6]}%
\pushmacro\relativefontsize
@@ -389,7 +394,7 @@
\let\relativefontsize\@@tsrscale
\let\typefaceencoding\@@tsencoding
\setcurrentfontclass{#1}
- \saverelativefontsize{#2}{\relativefontsize}% fall back
+ \saverelativefontsize{#2}{\relativefontsize}% fall back
%\writestatus{typeface}{[#1] [#2] [#3] [#4]}
\writestatus\m!fonts{[#1] [#2] [#3] [#4]}
\usetypescript[map][\typefaceencoding]
@@ -429,9 +434,9 @@
{#1[\getvalue{\??tf\fontclass\s!default}]}
{#1[\c!rm]}%
\fi \fi
- \ifmmode\mr\else\tf\fi} % needed ?
+ \ifmmode\mr\else\tf\fi} % needed ?
-\def\usetypefile[#1]% recurses on path !
+\def\usetypefile[#1]% recurses on path !
{\readfile{\f!typeprefix#1}{}{}}% \relax\relax}
%D For backward compatibility we reimplement the font file
@@ -468,4 +473,4 @@
% \usetypescript [berry] [ec]
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/type-map.tex b/tex/context/base/type-map.tex
index e6c3320f5..ca23fc788 100644
--- a/tex/context/base/type-map.tex
+++ b/tex/context/base/type-map.tex
@@ -53,6 +53,7 @@
\loadmapfile[8r-urw-palatino.map]
\loadmapfile[8r-urw-times.map]
\loadmapfile[8r-urw-zapfchan.map]
+ \loadmapfile[8r-urw-ncntrsbk.map]
\stoptypescript
\starttypescript [map] [ec]
@@ -66,6 +67,7 @@
\loadmapfile[ec-urw-palatino.map]
\loadmapfile[ec-urw-times.map]
\loadmapfile[ec-urw-zapfchan.map]
+ \loadmapfile[ec-urw-ncntrsbk.map]
\stoptypescript
\starttypescript [map] [texnansi]
@@ -79,6 +81,7 @@
\loadmapfile[texnansi-urw-palatino.map]
\loadmapfile[texnansi-urw-times.map]
\loadmapfile[texnansi-urw-zapfchan.map]
+ \loadmapfile[texnansi-urw-ncntrsbk.map]
\stoptypescript
\starttypescript [map] [ec,texnansi,8r]
diff --git a/tex/context/base/type-pre.tex b/tex/context/base/type-pre.tex
index 3a4ad7af4..7f903f972 100644
--- a/tex/context/base/type-pre.tex
+++ b/tex/context/base/type-pre.tex
@@ -84,6 +84,8 @@
\usemathcollection[default]
+\stoptypescript
+
\starttypescript [lh-t2b]
\usetypescript [serif,sans,mono,math] [computer-modern] [default,name,size,t2b]
diff --git a/tex/context/base/type-siz.tex b/tex/context/base/type-siz.tex
index 4a69acc2a..9dff7caba 100644
--- a/tex/context/base/type-siz.tex
+++ b/tex/context/base/type-siz.tex
@@ -668,4 +668,4 @@
\stoptypescript
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/type-spe.tex b/tex/context/base/type-spe.tex
index df663d8ae..51fc51b4a 100644
--- a/tex/context/base/type-spe.tex
+++ b/tex/context/base/type-spe.tex
@@ -24,15 +24,15 @@
\stoptypescript
\starttypescript [math] [ams] [special]
- \usemathcollection[ams]
+ \usemathcollection[default]
\stoptypescript
\starttypescript [math] [times] [special]
- \usemathcollection[ams]
+ \usemathcollection[default]
\stoptypescript
\starttypescript [math] [palatino] [special]
- \usemathcollection[ams]
+ \usemathcollection[default]
\stoptypescript
\starttypescript [math] [fourier] [special]
diff --git a/tex/context/base/type-syn.tex b/tex/context/base/type-syn.tex
index dcbf912d0..ca05e6827 100644
--- a/tex/context/base/type-syn.tex
+++ b/tex/context/base/type-syn.tex
@@ -25,7 +25,7 @@
% Computer Modern Roman : Donald Knuth
-\starttypescript [serif] [computer-modern] [name]
+\starttypescript [serif] [computer-modern,latin-modern] [name]
\definefontsynonym [Serif] [ComputerModern]
\definefontsynonym [SerifBold] [ComputerModern-Bold]
\definefontsynonym [SerifItalic] [ComputerModern-Italic]
@@ -35,7 +35,7 @@
\definefontsynonym [SerifCaps] [ComputerModern-Caps]
\stoptypescript
-\starttypescript [sans] [computer-modern] [name]
+\starttypescript [sans] [computer-modern,latin-modern] [name]
\definefontsynonym [Sans] [ComputerModernSans]
\definefontsynonym [SansBold] [ComputerModernSans-Bold]
\definefontsynonym [SansItalic] [ComputerModernSans-Italic]
@@ -45,7 +45,7 @@
\definefontsynonym [SansCaps] [ComputerModernSans-Caps]
\stoptypescript
-\starttypescript [mono] [computer-modern] [name]
+\starttypescript [mono] [computer-modern,latin-modern] [name]
\definefontsynonym [Mono] [ComputerModernMono]
\definefontsynonym [MonoBold] [ComputerModernMono-Bold]
\definefontsynonym [MonoItalic] [ComputerModernMono-Italic]
@@ -55,14 +55,14 @@
\definefontsynonym [MonoCaps] [ComputerModernMono-Caps]
\stoptypescript
-\starttypescript [math] [computer-modern] [name]
+\starttypescript [math] [computer-modern,latin-modern] [name]
\definefontsynonym [MathRoman] [ComputerModernMath-Roman]
\definefontsynonym [MathExtension] [ComputerModernMath-Extension]
\definefontsynonym [MathItalic] [ComputerModernMath-Italic]
\definefontsynonym [MathSymbol] [ComputerModernMath-Symbol]
\stoptypescript
-\starttypescript [serif] [computer-modern-vari] [name]
+\starttypescript [serif] [computer-modern-vari,latin-modern-vari] [name]
\definefontsynonym [Serif] [ComputerModernMono-Variable]
\definefontsynonym [SerifBold] [Serif]
\definefontsynonym [SerifItalic] [Serif]
@@ -74,7 +74,7 @@
% This will change some day.
-\starttypescript [math] [computer-modern] [name]
+\starttypescript [math] [computer-modern,latin-modern] [name]
\definefontsynonym [OldStyle] [MathItalic]
\definefontsynonym [Fraktur] [eufm10]
\definefontsynonym [Blackboard] [msbm10]
@@ -153,12 +153,20 @@
\definefontsynonym [MathBeta] [LucidaNewMath-Roman]
\stoptypescript
+ \definefontsynonym [LucidaNewMath-AltDemiItalic] [lbmdo]
+ \definefontsynonym [LucidaNewMath-Arrows-Demi] [lbmad]
+ \definefontsynonym [LucidaNewMath-Extension] [lbme]
+ \definefontsynonym [LucidaNewMath-Demibold] [lbmd]
+ \definefontsynonym [LucidaNewMath-DemiItalic] [lbmdi]
+ \definefontsynonym [LucidaNewMath-Symbol-Demi] [lbmsd]
+
\starttypescript [boldmath] [lucida] [name]
- \definefontsynonym [MathRoman] [LucidaNewMath-Demibold]
+ \definefontsynonym [MathRoman] [LucidaBright-Demi]
\definefontsynonym [MathExtension] [LucidaNewMath-Extension]
\definefontsynonym [MathItalic] [LucidaNewMath-AltDemiItalic]
\definefontsynonym [MathSymbol] [LucidaNewMath-Symbol-Demi]
\definefontsynonym [MathAlpha] [LucidaNewMath-Arrows-Demi]
+ \definefontsynonym [MathBeta] [LucidaNewMath-DemiBold]
\stoptypescript
\starttypescript [bfmath] [lucida] [name]
@@ -167,6 +175,7 @@
\definefontsynonym [MathItalicBold] [LucidaNewMath-AltDemiItalic]
\definefontsynonym [MathSymbolBold] [LucidaNewMath-Symbol-Demi]
\definefontsynonym [MathAlphaBold] [LucidaNewMath-Arrows-Demi]
+ \definefontsynonym [MathBetaBold] [LucidaNewMath-DemiBold] % ??
\stoptypescript
\starttypescript [handwriting] [lucida] [name]
@@ -260,6 +269,18 @@
\definefontsynonym [Calligraphy] [Chancery]
\stoptypescript
+% schoolbook :
+
+\starttypescript [serif] [schoolbook] [name]
+ \definefontsynonym [Serif] [Schoolbook-Roman]
+ \definefontsynonym [SerifItalic] [Schoolbook-Italic]
+ \definefontsynonym [SerifBold] [Schoolbook-Bold]
+ \definefontsynonym [SerifBoldItalic] [Schoolbook-BoldItalic]
+ \definefontsynonym [SerifSlanted] [Schoolbook-RomanSlanted]
+ \definefontsynonym [SerifBoldSlanted] [Schoolbook-BoldSlanted]
+ \definefontsynonym [SerifCaps] [Schoolbook-Roman-Caps]
+\stoptypescript
+
% Utopia : Adobe
\starttypescript [serif] [utopia] [name]
diff --git a/tex/context/base/unic-000.tex b/tex/context/base/unic-000.tex
index eba4a33c1..329dc4e6c 100644
--- a/tex/context/base/unic-000.tex
+++ b/tex/context/base/unic-000.tex
@@ -8,47 +8,47 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
-\unprotect
+\unprotect
-\startunicodevector 0
+\startunicodevector 0
\ifcase\numexpr(#1-159)
- \@@unknownchar\or
+ \@@unknownchar\or
\@@unknownchar\or % NO-BREAK SPACE
- exclamdown\or
- textcent\or
- textsterling\or
- textcurrency\or
- textyen\or
- textbrokenbar\or
- sectionmark\or
- textdiaeresis\or
- copyright\or
- \@@unknownchar\or % FEMININE ORDINAL INDICATOR
+ exclamdown\or
+ textcent\or
+ textsterling\or
+ textcurrency\or
+ textyen\or
+ textbrokenbar\or
+ sectionmark\or
+ textdiaeresis\or
+ copyright\or
+ ordfeminine\or % FEMININE ORDINAL INDICATOR
\@@unknownchar\or % LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
- textlognot\or
- softhyphen\or
- registered\or
- textmacron\or
+ textlognot\or
+ softhyphen\or
+ registered\or
+ textmacron\or
textdegree\or
- textpm\or
+ textpm\or
\@@unknownchar\or % SUPERSCRIPT TWO
\@@unknownchar\or % SUPERSCRIPT THREE
- textacute\or
+ textacute\or
\@@unknownchar\or % MICRO SIGN
\@@unknownchar\or % PILCROW SIGN
\@@unknownchar\or % MIDDLE DOT
- textcedilla\or
+ textcedilla\or
\@@unknownchar\or % SUPERSCRIPT ONE
- \@@unknownchar\or % MASCULINE ORDINAL INDICATOR
+ ordmasculine\or % MASCULINE ORDINAL INDICATOR
\@@unknownchar\or % RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
\@@unknownchar\or % VULGAR FRACTION ONE QUARTER
\@@unknownchar\or % VULGAR FRACTION ONE HALF
\@@unknownchar\or % VULGAR FRACTION THREE QUARTERS
questiondown\or
- Agrave\or
+ Agrave\or
Aacute\or
Acircumflex\or
Atilde\or
@@ -64,7 +64,7 @@
Iacute\or
Icircumflex\or
Idiaeresis\or
- \@@unknownchar\or % Eth\or
+ \@@unknownchar\or % Eth\or
Ntilde\or
Ograve\or
Oacute\or
@@ -96,7 +96,7 @@
iacute\or
icircumflex\or
idiaeresis\or
- \@@unknownchar\or % eth\or
+ \@@unknownchar\or % eth\or
ntilde\or
ograve\or
oacute\or
@@ -112,48 +112,48 @@
yacute\or
thorn\or
ydiaeresis\else
- \@@unknownchar
+ \@@unknownchar
\fi
\stopunicodevector
-% 20\% faster:
+% 20\% faster:
-\startunicodevector 0
+\startunicodevector 0
\expandafter\strippedcsname
- \ifcase\numexpr(#1-159)!\@@unknownchar\or
+ \ifcase\numexpr(#1-159)!\@@unknownchar\or
\unknownchar \or % NO-BREAK SPACE
- \exclamdown \or
- \textcent \or
- \textsterling \or
- \textcurrency \or
- \textyen \or
- \textbrokenbar \or
- \sectionmark \or
- \textdiaeresis \or
- \copyright \or
- \unknownchar \or % FEMININE ORDINAL INDICATOR
+ \exclamdown \or
+ \textcent \or
+ \textsterling \or
+ \textcurrency \or
+ \textyen \or
+ \textbrokenbar \or
+ \sectionmark \or
+ \textdiaeresis \or
+ \copyright \or
+ \ordfeminine \or % FEMININE ORDINAL INDICATOR
\unknownchar \or % LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
- \textlognot \or
- \softhyphen \or
- \registered \or
- \textmacron \or
+ \textlognot \or
+ \softhyphen \or
+ \registered \or
+ \textmacron \or
\textdegree \or
- \textpm \or
+ \textpm \or
\unknownchar \or % SUPERSCRIPT TWO
\unknownchar \or % SUPERSCRIPT THREE
- \textacute \or
+ \textacute \or
\unknownchar \or % MICRO SIGN
\unknownchar \or % PILCROW SIGN
\unknownchar \or % MIDDLE DOT
- \textcedilla \or
+ \textcedilla \or
\unknownchar \or % SUPERSCRIPT ONE
- \unknownchar \or % MASCULINE ORDINAL INDICATOR
+ \ordmasculine \or % MASCULINE ORDINAL INDICATOR
\unknownchar \or % RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
\unknownchar \or % VULGAR FRACTION ONE QUARTER
\unknownchar \or % VULGAR FRACTION ONE HALF
\unknownchar \or % VULGAR FRACTION THREE QUARTERS
\questiondown \or
- \Agrave \or
+ \Agrave \or
\Aacute \or
\Acircumflex \or
\Atilde \or
@@ -169,7 +169,7 @@
\Iacute \or
\Icircumflex \or
\Idiaeresis \or
- \unknownchar \or % \Eth \or
+ \unknownchar \or % \Eth \or
\Ntilde \or
\Ograve \or
\Oacute \or
@@ -201,7 +201,7 @@
\iacute \or
\icircumflex \or
\idiaeresis \or
- \unknownchar \or % \eth \or
+ \unknownchar \or % \eth \or
\ntilde \or
\ograve \or
\oacute \or
@@ -217,8 +217,8 @@
\yacute \or
\thorn \or
\ydiaeresis \else
- \unknownchar
+ \unknownchar
\fi
\stopunicodevector
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/unic-001.tex b/tex/context/base/unic-001.tex
index 189e57f21..d91dfe673 100644
--- a/tex/context/base/unic-001.tex
+++ b/tex/context/base/unic-001.tex
@@ -146,8 +146,8 @@
\fi
\stopunicodevector
-%D Faster, watch how we avoid zero and \TEX's
-%D automatically added \type {\relax}.
+%D Faster, watch how we avoid zero and \TEX's
+%D automatically added \type {\relax}.
\startunicodevector 1
\expandafter\strippedcsname
@@ -284,4 +284,4 @@
\fi
\stopunicodevector
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/unic-002.tex b/tex/context/base/unic-002.tex
index 1f9065ec6..5790fa76a 100644
--- a/tex/context/base/unic-002.tex
+++ b/tex/context/base/unic-002.tex
@@ -8,10 +8,10 @@
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
-\unprotect
+\unprotect
\startunicodevector 2
\ifcase\numexpr(#1-198)
@@ -28,7 +28,7 @@
\fi\fi
\stopunicodevector
-% ugly but faster
+% ugly but faster
\startunicodevector 2
\ifcase\numexpr(#1-198)
@@ -45,4 +45,4 @@
\fi\fi
\stopunicodevector
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/unic-exp.tex b/tex/context/base/unic-exp.tex
index 0c5451ca1..1f60cb99c 100644
--- a/tex/context/base/unic-exp.tex
+++ b/tex/context/base/unic-exp.tex
@@ -13,14 +13,14 @@
\writestatus{loading}{Context UNICODE Macros (expansion)}
-%D \macros
+%D \macros
%D {expandunivector}
-%D
-%D The \type {\expandunivector} macro can be used to expand
-%D vectors, which leads to a faster run in case of documents
-%D with lots of \UTF-8 code.
+%D
+%D The \type {\expandunivector} macro can be used to expand
+%D vectors, which leads to a faster run in case of documents
+%D with lots of \UTF-8 code.
-\unprotect
+\unprotect
\def\expandunivector[#1]%
{\processcommalist[#1]\doexpandunivector}
@@ -33,9 +33,11 @@
\dorecurse{255}
{\@EA\ifx\csname\csname\@@univector#1\endcsname\recurselevel\endcsname
\unknownchar
- % skip
+ % skip
\else
- \@EAEAEA\let\@EA\@EA\csname\@@univector\@@univector#1:\recurselevel\endcsname
+ % \@EAEAEA\let\@EA\@EA\csname\@@univector\@@univector#1:\recurselevel\endcsname
+ % \csname\csname\@@univector#1\endcsname\recurselevel\endcsname
+ \@EA\let\csname\@@univector\@@univector#1:\recurselevel\@EA\endcsname
\csname\csname\@@univector#1\endcsname\recurselevel\endcsname
\fi}%
\letbeundefined{\@@univector#1}%
@@ -49,7 +51,7 @@
\@@unknownchar
\fi}
-%D For this purpose, we need to redefine the resolver.
+%D For this purpose, we need to redefine the resolver.
\def\doutfunihash#1#2%
{\ifcsname\@@univector\@@univector\number#1\endcsname
@@ -57,7 +59,7 @@
\else\ifcsname\@@univector\number#1\endcsname
\csname\@@univector#1\endcsname{\utfmod{#2}}%
\else
- \@@unknownchar
+ \@@unknownchar
\fi\fi}
\let\utfunihash\utfunihashglyph
@@ -66,4 +68,4 @@
\expandunivector[0,1,2,32,33]
-\protect \endinput
+\protect \endinput
diff --git a/tex/context/base/unic-ini.tex b/tex/context/base/unic-ini.tex
index 77e8fb5c1..a12ab1590 100644
--- a/tex/context/base/unic-ini.tex
+++ b/tex/context/base/unic-ini.tex
@@ -50,9 +50,9 @@
%D \NC262144(b_1-240)\NC+\NC4096(b_2-128)\NC+\NC64(b_3-128)\NC+\NC(b_4-128)\NC if 240<=b1<=247\NC \NR
%D \stoptabulatie
%D
-%D A lot of information abou tunicode can be found on the
-%D web (search for Markus Kuhn and unicode and you'll
-%D probably end up at the right place).
+%D A lot of information abou tunicode can be found on the
+%D web (search for Markus Kuhn and unicode and you'll
+%D probably end up at the right place).
%D In \ETEX\ vocabulary such a conversion looks as follows.
%D We need the \type {`} in order to turn a character into a
@@ -222,50 +222,50 @@
%D {utfunicodetracer}
%D
%D By default, the converter produces a character representation,
-%D but for tracing purposes, you can set a trace option.
+%D but for tracing purposes, you can set a trace option.
\chardef\utfunicodetracer=0
%D \def\TraceUnic#1%
-%D {\chardef\utfunicodetracer#1\relax\enableregime[utf]Å°}
-%D
+%D {\chardef\utfunicodetracer#1\relax\enableregime[utf]Å°}
+%D
%D \starttabulatie[|c|c|c|c|c|c|]
%D \NC option \NC number\NC mapping\NC glyph\NC string\NC example \NC \NR
%D \NC 0 \NC \NC \NC \star\NC \NC \TraceUnic0\NC \NR
-%D \NC 1 \NC \star \NC \NC \NC \NC \TraceUnic1\NC \NR
-%D \NC 2 \NC \NC \star \NC \NC \NC \TraceUnic2\NC \NR
-%D \NC 3 \NC \star \NC \star \NC \NC \NC \TraceUnic3\NC \NR
-%D \NC 4 \NC \star \NC \NC \star\NC \NC \TraceUnic4\NC \NR
+%D \NC 1 \NC \star \NC \NC \NC \NC \TraceUnic1\NC \NR
+%D \NC 2 \NC \NC \star \NC \NC \NC \TraceUnic2\NC \NR
+%D \NC 3 \NC \star \NC \star \NC \NC \NC \TraceUnic3\NC \NR
+%D \NC 4 \NC \star \NC \NC \star\NC \NC \TraceUnic4\NC \NR
%D \NC 5 \NC \NC \star \NC \star\NC \NC \TraceUnic5\NC \NR
-%D \NC 6 \NC \star \NC \star \NC \star\NC \NC \TraceUnic6\NC \NR
-%D \NC 7 \NC \NC \NC \NC \star \NC \TraceUnic7\NC \NR
-%D \NC 8 \NC \star \NC \NC \NC \NC \TraceUnic8\NC \NR
+%D \NC 6 \NC \star \NC \star \NC \star\NC \NC \TraceUnic6\NC \NR
+%D \NC 7 \NC \NC \NC \NC \star \NC \TraceUnic7\NC \NR
+%D \NC 8 \NC \star \NC \NC \NC \NC \TraceUnic8\NC \NR
%D \NC otherwise\NC \NC \NC \star\NC \NC \TraceUnic9\NC \NR
%D \stoptabulatie
%D \macros
%D {unicodechar}
%D
-%D Next we implement the character handler:
+%D Next we implement the character handler:
\def\unicodechar
- {\ifcase\utfunicodetracer
- \expandafter\utfunihash \or
- \expandafter\utfunichar \or
- \expandafter\utfunisplit \or
- \expandafter\utfuniboth \or
- \expandafter\utfunihashchar \or
- \expandafter\utfunihashsplit \or
- \expandafter\utfunihashboth \or
+ {\ifcase\utfunicodetracer
+ \expandafter\utfunihash \or
+ \expandafter\utfunichar \or
+ \expandafter\utfunisplit \or
+ \expandafter\utfuniboth \or
+ \expandafter\utfunihashchar \or
+ \expandafter\utfunihashsplit \or
+ \expandafter\utfunihashboth \or
\@EA\string\@EA\unicodechar \or
\expandafter\utfunientity \else
- \expandafter\utfunihash
+ \expandafter\utfunihash
\fi}
%D \macros
%D {unicodehexnumber}
%D
-%D A few auxiliary macros, producing the range||char pair:
+%D A few auxiliary macros, producing the range||char pair:
\def\unicodepair#1%
{\utfdiv{#1}:\utfmod{#1}}
@@ -277,7 +277,7 @@
% \expanded{\uchexnumbers{\utfmod{#1}}}}
\def\unicodehexnumber#1%
- {\ifnum#1>\maxcard
+ {\ifnum#1>\maxcard
\expanded{\uchexnumbers{\utfvid{#1}}}%
\expanded{\uchexnumbers{\utfdiv{\utfdiv{#1}}}}%
\else
@@ -289,7 +289,7 @@
%D The following macros visualize the unicode character. The
%D \type {\relax} in front of the \type {-} prevents lookahead
%D problems; somehow \type {\numexpr} cannot look beyond this
-%D sign, and expects a number.
+%D sign, and expects a number.
\def\utfunichar #1%
{{\tttf U\low{\unicodenumber{#1}}}}
@@ -303,62 +303,62 @@
\def\utfunientity #1%
{{\tttf\&\#\unicodehexnumber{#1};}}
-%D The character itself is accessed and typeset by:
+%D The character itself is accessed and typeset by:
%D
-%D \starttypen
+%D \starttypen
%D \def\utfunihash#1%
%D {\executeifdefined{\@@univector\utfdiv{#1}}%
%D \gobbleoneargument{\utfmod{#1}}}
-%D \stoptypen
-%D
+%D \stoptypen
+%D
%D Again, we can provide a faster alternative, because inside
%D the conditional executer, the argument is expanded twice,
-%D and therefore the calculation done once more than needed.
-%D So, we make sure that the argument is expansion on
-%D forehand. Just to remind you: \type {#1} is the \UNICODE\
-%D number.
-%D
-%D \starttypen
+%D and therefore the calculation done once more than needed.
+%D So, we make sure that the argument is expansion on
+%D forehand. Just to remind you: \type {#1} is the \UNICODE\
+%D number.
+%D
+%D \starttypen
%D \def\utfunihash#1%
%D {\@EA\executeifdefined\@EA{\@EA\@@univector\number\utfdiv{#1}}%
%D {\unknownchar\gobbleoneargument}{\utfmod{#1}}}
-%D \stoptypen
-%D
-%D In order to save calculation time, I decided to change
-%D this definition into:
+%D \stoptypen
+%D
+%D In order to save calculation time, I decided to change
+%D this definition into:
-%D \starttypen
+%D \starttypen
%D \def\utfunihash#1%
%D {\@EA\doutfunihash\@EA{\number\utfdiv{#1}}{#1}}
-%D
+%D
%D \def\doutfunihash#1#2%
%D {\ifcsname\@@univector\number#1\endcsname
%D \csname\csname\@@univector#1\endcsname{\utfmod{#2}}\endcsname
%D \else
-%D \unknownchar
+%D \unknownchar
%D \fi}
-%D \stoptypen
+%D \stoptypen
%D
-%D Or leaner and meaner:
-%D
-%D \starttypen
+%D Or leaner and meaner:
+%D
+%D \starttypen
%D \def\doutfunihash#1#2%
%D {\csname
%D \ifcsname\@@univector\number#1\endcsname
%D \csname\@@univector#1\endcsname{\utfmod{#2}}%
%D \else
-%D \@@unknownchar
+%D \@@unknownchar
%D \fi
%D \endcsname}
-%D \stoptypen
-%D
+%D \stoptypen
+%D
%D And finaly it became:
\def\doutfunihash#1#2%
{\ifcsname\@@univector\number#1\endcsname
\csname\@@univector#1\endcsname{\utfmod{#2}}%
\else
- \@@unknownchar
+ \@@unknownchar
\fi}
\def\utfunihashglyph#1%
@@ -367,7 +367,7 @@
\def\utfunihashcommand
{\@EAEAEA\string\utfunihashglyph}
-%D For practical purposes, we handle the normal \ASCII\
+%D For practical purposes, we handle the normal \ASCII\
%D characters here:
\def\utfunihashglyph#1%
@@ -382,7 +382,7 @@
\let\unicodeasciicharacter\rawcharacter
-%D Now we can say:
+%D Now we can say:
\let\utfunihash\utfunihashglyph
@@ -397,17 +397,17 @@
\def\utfunihashboth #1%
{\utfunihash{#1}\low{\infofont\unicodenumber{#1\relax}->\unicodepair{#1}}}
-%D Unknown characters get a placeholder.
+%D Unknown characters get a placeholder.
-\unexpanded\def\unknownchar % {} prevents problems with arguments
+\unexpanded\def\unknownchar % {} prevents problems with arguments
{{\hbox{\vrule\!!width.5em\!!height1ex\!!depth\zeropoint}}}
-%D So far for the conversion macros. The optimizations we
-%D did, brought down the runtime some 50\%, which, given that
-%D the majority of characters will be normal \ASCII\
-%D characters, the penalty of conversion is not that large.
+%D So far for the conversion macros. The optimizations we
+%D did, brought down the runtime some 50\%, which, given that
+%D the majority of characters will be normal \ASCII\
+%D characters, the penalty of conversion is not that large.
-%D \macros
+%D \macros
%D {useunicodevector}
%D
%D Since we end up with many encodings, it starts making
@@ -426,33 +426,43 @@
%D \macros
%D {startunicodevector}
-%D
+%D
%D A vector roughly looks as follows. By putting the text
%D inside the name constructor, we prevent problems with
-%D partial expansion in macros and special cases.
-%D
-%D \starttypen
+%D partial expansion in macros and special cases.
+%D
+%D \starttypen
%D \startunicodevector 0
-%D \ifcase\numexpr(#1-159)\or
+%D \ifcase\numexpr(#1-159)\or
%D \@@unknownchar\or % NO-BREAK SPACE
-%D exclamdown\or
-%D textcent\or
+%D exclamdown\or
+%D textcent\or
%D ....\else
%D \@@unknowncharacter
%D \fi
%D \stopunicodevector
-%D \stoptypen
-%D
+%D \stoptypen
+%D
%D In vector \type {unix-000} you will find another
%D optimizations. By using as less tokens as possible, we limit
%D the time skipping branches in the test, and save upto 20\%
-%D runtime.
+%D runtime.
\def\startunicodevector #1 #2\stopunicodevector
{\setgvalue{\@@univector#1}##1{#2}}
-%D Here we provide another auxiliary macro:
-%D
+%D We define (as a practical example) the utf signal FEFF:
+
+\ifx\zwnbsp\undefined
+ \let\zwnbsp\relax % zerowidthnonbreakablespace
+\fi
+
+\startunicodevector 254
+ \expandafter\strippedcsname\ifnum#1<255\unknownchar\else\zwnbsp\fi
+\stopunicodevector
+
+%D Here we provide another auxiliary macro:
+%D
%D \startbuffer
%D \unicodeinfoline{196}{Ä}{LATIN CAPITAL LETTER A WITH DIAERESIS}
%D \unicodeinfoline{197}{Ã…}{LATIN CAPITAL LETTER A WITH RING ABOVE}
@@ -461,9 +471,9 @@
%D \unicodeinfoline{200}{È}{LATIN CAPITAL LETTER E WITH GRAVE}
%D \unicodeinfoline{201}{É}{LATIN CAPITAL LETTER E WITH ACUTE}
%D \stopbuffer
-%D
+%D
%D \typebuffer
-%D
+%D
%D \start \enableregime[utf]\getbuffer \stop
\def\unicodeinfoline#1#2#3%
@@ -472,19 +482,19 @@
{\hbox to 4em{\tttf\unicodehexnumber{#1}\hss}\quad
\hbox to 1em{#2\hss}\quad
\hbox to 9em{\tttf\unicodenumber{#1\relax}->\unicodepair{#1}\hss}\quad
- \hbox to 9em{\tttf\let\utfunihash\utfunihashcommand#2\hss}\quad % tricky
+ \hbox to 9em{\tttf\let\utfunihash\utfunihashcommand#2\hss}\quad % tricky
\lowercase {\tttf#3}}\par
\fi}
-%D The next code permits utf code in hyperlinks:
+%D The next code permits utf code in hyperlinks:
\def\cleanunicodechar#1{.#1.}
\appendtoks \let\unicodechar\cleanunicodechar \to \everycleanupfeatures
-%D We will now hook this mechanism in the existing font
-%D handler. More documentation will follow. Probably, some
-%D features in \type {font-uni.tex} will be generalized
+%D We will now hook this mechanism in the existing font
+%D handler. More documentation will follow. Probably, some
+%D features in \type {font-uni.tex} will be generalized
%D and moved here.
\def\unidiv{0} \def\unimod{0}
@@ -498,11 +508,11 @@
\char\unimod % \unicodeascii\unimod
\else\ifcsname\@@univector\unidiv\endcsname
\csname\doutfunihash{\unidiv}{#1}\endcsname
- \else % so, these can be different fonts !
- \unicodeglyph\unidiv\unimod % no \uchar (yet)
+ \else % so, these can be different fonts !
+ \unicodeglyph\unidiv\unimod % no \uchar (yet)
\fi\fi}
-\chardef\utfunicommandmode=0 % 1 = hex
+\chardef\utfunicommandmode=0 % 1 = hex
\def\unicodecommandchar#1#2%
{\string\char
@@ -517,14 +527,14 @@
\unicodecommandchar\unidiv\unimod
\else\ifcsname\@@univector\unidiv\endcsname
\@EA\string\csname\doutfunihash{\unidiv}{#1}\endcsname
- \else
+ \else
\unicodecommandchar\unidiv\unimod
\fi\fi}
\def\utfunihash
{\ifcase\utfunihashmode
- \@EA\utfunihashglyph
- \else
+ \@EA\utfunihashglyph
+ \else
\@EA\utfunifontglyph
\fi}
@@ -535,7 +545,7 @@
{\ifcase\utfunihashmode
% \@EA\@EAEAEA\@EA\string\@EA\utfunihashglyph
\@EA\utfunihushcommand
- \else
+ \else
\@EA\utfunifontcommand
\fi}
diff --git a/tex/context/base/x-contml.tex b/tex/context/base/x-contml.tex
index a9adae2bd..328e1a4f0 100644
--- a/tex/context/base/x-contml.tex
+++ b/tex/context/base/x-contml.tex
@@ -1,29 +1,29 @@
-% interface=en
+% interface=en
%M \usemodule [contml] \autoXMLnamespace [context]
%M \definefilesynonym [context] [x-contml.xsd]
%D \module
%D [ file=x-contml,
-%D version=mid 2001,
+%D version=mid 2001,
%D title=\CONTEXT\ XML Support,
-%D subtitle=Basic \CONTEXT\ commands,
+%D subtitle=Basic \CONTEXT\ commands,
%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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
-% This module provides some basic \XML\ elements. These definitions
-% are highly experimental and serve as a playground for interface
+% This module provides some basic \XML\ elements. These definitions
+% are highly experimental and serve as a playground for interface
% development.
\unprotect
%D \elements {include}
-%D
+%D
%D \startbuffer
%D You can include another file in the current document with the
%D <element>include</element> element. When including the file, &context;
@@ -56,7 +56,7 @@
%D
%D \showelements [context] [compound]
-\let\normalcompound=|
+\ifx\normalcompound\undefined \let\normalcompound=| \fi
% \defineXMLsingular [context:compound] [token=]
% {\expanded{\normalcompound\XMLop{token}}|}
@@ -89,10 +89,10 @@
%D \elements {pageref,textref,lineref}
%D
%D \startbuffer
-%D You can ask for a page (<pageref label="lastpage">the last pagenumber
+%D You can ask for a page (<pageref label="lastpage">the last pagenumber
%D is</pageref> aka page <pageref label="lastpage"/>), text or line reference
-%D with the following three elements. The label may be any valid &context;
-%D reference label.
+%D with the following three elements. The label may be any valid &context;
+%D reference label.
%D \stopbuffer
%D
%D \showelements [context] [references]
@@ -145,9 +145,9 @@
%D \elements {verbatim,typing,line,verb,type}
%D
%D \startbuffer
-%D Although the following method can be used to typeset a piece of code
+%D Although the following method can be used to typeset a piece of code
%D verbatim
-%D
+%D
%D <![CDATA[
%D Dit \is nogal verbatim !
%D Dit is {nogal} verbatim !
@@ -164,7 +164,7 @@
%D \stopbuffer
%D
%D The element to tag in<compound/>line verbatim is <type><verb></type>.
-%D
+%D
%D \showelements [context] [verbatim]
\defineXMLenvironment [context:verbatim]
@@ -182,10 +182,10 @@
%D \elements {itemize,item}
%D
%D \startbuffer
-%D Itemized lists are quite common in documents, al least in the ones that
-%D we produce. For the moment we only provide a few options, later we will
-%D hook it into the &context; attribute handler.
-%D
+%D Itemized lists are quite common in documents, al least in the ones that
+%D we produce. For the moment we only provide a few options, later we will
+%D hook it into the &context; attribute handler.
+%D
%D <itemize type="a">
%D <item label="bla"> test </item>
%D <item> test </item>
@@ -196,7 +196,7 @@
%D <item> test <em>what?</em></item>
%D </itemize>
%D \stopbuffer
-%D
+%D
%D \showelements [context] [itemize]
\defineXMLenvironment [context:itemize] [type=,packed=]
@@ -215,21 +215,21 @@
%D \elements {fixed}
%D
%D \startbuffer
-%D Something fixed will end up at the place where it defined in the input
-%D stream. The main idea behind this element is that it gives you control
-%D over the placement.
-%D
+%D Something fixed will end up at the place where it defined in the input
+%D stream. The main idea behind this element is that it gives you control
+%D over the placement.
+%D
%D <itemize>
-%D <item>
+%D <item>
%D <fixed align="high">
%D <content>
%D <externalfigure file="koe" frame="on" height="1cm" />
%D </content>
%D </fixed>
-%D </item>
+%D </item>
%D </itemize>
%D \stopbuffer
-%D
+%D
%D \showelements [context] [fixed]
\defineXMLenvironment [context:fixed] [type=figure,location=,label=]
@@ -248,10 +248,10 @@
%D \elements {float}
%D
%D \startbuffer
-%D A floating body will be placed at the first location available, unless
-%D a location is specified. As with the <element>fixed</element> element,
+%D A floating body will be placed at the first location available, unless
+%D a location is specified. As with the <element>fixed</element> element,
%D you can prvide a caption.
-%D
+%D
%D <float type="figure">
%D <content>
%D <externalfigure file="koe" frame="on" height="3cm" />
@@ -259,7 +259,7 @@
%D <caption>This is a cow!</caption>
%D </float>
%D \stopbuffer
-%D
+%D
%D \showelements [context] [float]
\defineXMLenvironment [context:float] [type=figure,location=here,label=]
@@ -276,17 +276,17 @@
%D
%D \startbuffer
%D The previous examples already demonstrated how we can include a graphic:
-%D
+%D
%D <verbatim>
%D <line><externalfigure file="koe" width="5cm" /></line>
%D </verbatim>
%D \stopbuffer
-%D
+%D
%D \showelements [context] [externalfigure]
\defineXMLsingular [context:externalfigure] [\??ef] [base=,label=,file=]
{\bgroup % \getXMLta \expandXMLta \expandXMLtp{file}%
- \expandXMLta \getXMLta % expand entities first
+ \expandXMLta \getXMLta % expand entities first
\doifelsenothing{\XMLtp{label}}
{\expanded{\externalfigure[\XMLtp{file}][\XMLta]}}
{\doifsomething{\XMLtp{base}}{\usefigurebase[\XMLtp{base}]}%
@@ -296,11 +296,11 @@
%D \elements {quotation,quote}
%D
%D \startbuffer
-%D There is a (not so) subtle difference between a display
+%D There is a (not so) subtle difference between a display
%D <quotation>quotation</quotation> and an <quote>in<compound/>line</quote>
-%D one.
+%D one.
%D \stopbuffer
-%D
+%D
%D \showelements [context] [table]
\defineXMLgrouped [context:quote] \quote
@@ -402,10 +402,10 @@
%D \elements {hide}
%D
-%D \startbuffer
-%D This is the way to [<hide>this is gone</hide>] something for the
-%D typesetting engine. Normally this element is only used for testing
-%D purposes.
+%D \startbuffer
+%D This is the way to [<hide>this is gone</hide>] something for the
+%D typesetting engine. Normally this element is only used for testing
+%D purposes.
%D \stopbuffer
%D
%D \showelements [context] [tabulate]
@@ -415,22 +415,22 @@
%D \elements {unknown}
%D
%D \startbuffer
-%D We can go on and on and <unknown/> with defining elements that map onto
+%D We can go on and on and <unknown/> with defining elements that map onto
%D &context; commands, but why not just use &tex; input syntax then?
%D \stopbuffer
-%D
+%D
%D \showelements [context] [unknown]
\defineXMLsingular [context:unknown] \unknown
-%D A (for the moment) private one.
+%D A (for the moment) private one.
\defineXMLargument [context:element] \type
-%D The following common schema definitions apply:
+%D The following common schema definitions apply:
%D
%D {\setupcolors[state=stop]\showXSDcomponent[context][definitions]}
-
+
\defineXMLargument [context:chapter] [label=] {\chapter[\XMLop{label}]}
\defineXMLargument [context:section] [label=] {\section[\XMLop{label}]}
\defineXMLargument [context:subsection] [label=] {\subsection[\XMLop{label}]}
@@ -448,19 +448,19 @@
\defineXMLenvironment [context:backmatter] \startbackmatter \stopbackmatter
\defineXMLenvironment [context:appendices] \startappendices \stopappendices
-\defineXMLargument [context:index] [key=]
+\defineXMLargument [context:index] [key=]
{\doifelsenothingXMLop{key}{\index}{\expanded{\index[\XMLop{key}]}}}
% \enableXMLfiledata
-% Needed for example (stickers and so):
+% Needed for example (stickers and so):
-\defineXMLenvironment [context:makeup]
+\defineXMLenvironment [context:makeup]
\startstandardmakeup \stopstandardmakeup
\protect \endinput
-% TO DO
+% TO DO
\defineXMLenvironment [combination] [columns=2,rows=1]
{\scratchtoks\emptytoks
diff --git a/tex/context/base/x-corres.tex b/tex/context/base/x-corres.tex
index ba39dd157..259c07e95 100644
--- a/tex/context/base/x-corres.tex
+++ b/tex/context/base/x-corres.tex
@@ -1,50 +1,50 @@
%D \module
%D [ file=x-corres,
-%D version=2003.12.15, % replaces keep-02a cum suis
+%D version=2003.12.15, % replaces keep-02a cum suis
%D title=\CONTEXT\ XML Modules,
-%D subtitle=Handling Correspondence Base,
+%D subtitle=Handling Correspondence Base,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA ADE / 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.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
-%D The selection spec:
+%D The selection spec:
\setvariables
[contacts]
[selection=,
- file=]
+ file=x-corres.xml] % fall back
-%D First we define the group expansion pass:
+%D First we define the group expansion pass:
\startsetups[contacts:collect]
\defineXMLprocess [contacts]
- \defineXMLignore [contact]
+ \defineXMLignore [contact]
- \defineXMLargument [contactfile]
+ \defineXMLargument [contactfile]
\processfile
- \defineXMLenvironmentsave [contactgroup] [label=]
+ \defineXMLenvironmentsave [contactgroup] [label=]
{\startXMLmappinggroup[contacts]}
{\XMLaddcontactgrouptoselection
\stopXMLmappinggroup}
\stopsetups
-%D Next we define the main processing pass:
+%D Next we define the main processing pass:
\startsetups[contacts:process]
\defineXMLprocess[contacts]
- \defineXMLignore [contactgroup]
+ \defineXMLignore [contactgroup]
- \defineXMLargument [contactfile]
+ \defineXMLargument [contactfile]
\processfile
\defineXMLenvironmentsave[contact] [label=]
@@ -58,7 +58,7 @@
\defineXMLsave [initials]
\defineXMLsave [formalname]
- \defineXMLsave [informalname]
+ \defineXMLsave [informalname]
\defineXMLsave [title]
\defineXMLsave [prefix]
\defineXMLsave [suffix]
@@ -66,7 +66,7 @@
\defineXMLsave [mobiletelephone]
\defineXMLsave [telefax]
\defineXMLsave [email]
- \defineXMLsave [address]
+ \defineXMLsave [address]
\defineXMLsave [information]
\defineXMLenvironment [p] \endgraf \endgraf
@@ -75,8 +75,8 @@
\stopXMLmapping
-%D The selection macros: we expand groups and replace them
-%D by contact labels in the selection spec.
+%D The selection macros: we expand groups and replace them
+%D by contact labels in the selection spec.
\def\XMLaddcontactgrouptoselection
{\edef\XMLcontactlist{\getvariable{contacts}{selection}}%
@@ -93,7 +93,7 @@
\def\XMLaddcontacttoselection#1%
{\addtocommalist{#1}\XMLgrouplist}
-%D The main selector:
+%D The main selector:
\def\XMLselectcontact
{\edef\XMLcontactlist {\getvariable{contacts}{selection}}%
@@ -103,10 +103,10 @@
{\expanded{\doifinsetelse{\XMLcontactlabel}{\XMLcontactlist}}
{\donetrue}
{\donefalse}}%
- \ifdone
- \XMLflush{contact}%
- \setups[contact:handle]%
- \fi}
+ \ifdone
+ \XMLflush{contact}%
+ \setups[contact:handle]%
+ \fi}
%D The default:
@@ -126,11 +126,11 @@
\def\XMLprocesscontacts[#1]%
{\bgroup
\doifelsenothing{#1}
- {\XMLprocesscontacts[\getvariable{contacts}{file}]}
+ {\XMLprocesscontacts[\getvariable{contacts}{file}]}
{\setups[contacts:collect]%
\processcommacommand[#1]\processXMLfile
\setups[contacts:process]%
\processcommacommand[#1]\processXMLfile}%
\egroup}
-\endinput
+\endinput \ No newline at end of file
diff --git a/tex/context/base/x-dir-01.tex b/tex/context/base/x-dir-01.tex
new file mode 100644
index 000000000..7fc3f7983
--- /dev/null
+++ b/tex/context/base/x-dir-01.tex
@@ -0,0 +1,134 @@
+% interface=en
+
+\setuppapersize
+ [S6][S6]
+
+\setuplayout
+ [width=middle,
+ height=middle,
+ backspace=12pt,
+ topspace=12pt,
+ bottomspace=32pt,
+ header=0pt,
+ footer=0pt,
+ bottomdistance=9pt,
+ bottom=18pt]
+
+\setupinteractionmenu
+ [bottom]
+ [state=start,
+ frame=off,
+ rightoffset=-3pt,
+ background=color,
+ backgroundcolor=TextColor,
+ middle=\hskip4pt,
+ left=\hfill]
+
+\startinteractionmenu[bottom]
+ \but [PreviousJump] Previous Jump \\
+ \but [previouspage] Previous Page \\
+ \but [nextpage] Next Page \\
+\stopinteractionmenu
+
+\setupbackgrounds
+ [page]
+ [backgroundoffset=3pt,
+ background=color,
+ backgroundcolor=PageColor]
+
+\setupbackgrounds
+ [text]
+ [background=color,
+ backgroundcolor=TextColor]
+
+\definecolor [PageColor] [r=.6,g=.7,b=.8]
+\definecolor [TextColor] [r=.7,g=.8,b=.9]
+\definecolor [DoneColor] [s=.5]
+
+\startmode[colorscheme-red]
+
+ \definecolor [PageColor] [r=.9,g=.7,b=.6]
+ \definecolor [TextColor] [r=.9,g=.8,b=.7]
+
+\stopmode
+
+\startmode[colorscheme-green]
+
+ \definecolor [PageColor] [r=.6,g=.8,b=.7]
+ \definecolor [TextColor] [r=.7,g=.9,b=.8]
+
+\stopmode
+
+\setupcolors
+ [state=start]
+
+\setupinteraction
+ [state=start,
+ menu=on,
+ color=,
+ display=new,
+ contrastcolor=DoneColor,
+ style=]
+
+\definehead
+ [directory]
+ [subject]
+
+\setuphead
+ [directory]
+ [style=\tfc]
+
+\setupbodyfont
+ [tt]
+
+\defineXMLenvironment [files] [url=]
+ {\doifelsenothing{\XMLop{url}}
+ {\xdef\XMLDIRurl{}}
+ {\xdef\XMLDIRurl{\XMLop{url}/}}
+ \startXMLignore}
+ {\stopXMLignore}
+
+\newcounter\NOfEntries
+
+\startsetups[xmldir:file]
+
+ \doglobal\increment\NOfEntries
+
+ \goto {\hbox to \hsize \bgroup
+
+ \XMLflush{base}
+ \hss
+ \hbox to 2em{\XMLflush{type}\hss}
+ \quad
+ \quad
+ \hbox to 5em{\hss\XMLflush{size}}
+ \quad
+ \quad
+ \XMLflush{date}
+
+ \egroup} [url(\XMLDIRurl\XMLop{name})]% [program(\XMLDIRurl\XMLop{name})]
+
+\stopsetups
+
+\defineXMLenvironment [directory] [name=]
+ {\directory{Path \XMLop{name}}}
+ {}
+
+\defineXMLenvironment [file] [name=]
+ {\bgroup}
+ {\setups[xmldir:file]
+ \endgraf
+ \egroup}
+
+\defineXMLsave[base]
+\defineXMLsave[type]
+\defineXMLsave[size]
+\defineXMLsave[date]
+
+\starttext
+
+ \processXMLfilegrouped{\inputfilename}
+
+ \ifnum\NOfEntries=0 There are no files found that match the pattern. \fi
+
+\stoptext \ No newline at end of file
diff --git a/tex/context/base/xtag-ent.tex b/tex/context/base/xtag-ent.tex
index 1d9706b80..ef98e7eb1 100644
--- a/tex/context/base/xtag-ent.tex
+++ b/tex/context/base/xtag-ent.tex
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-% Here we also define fallbacks
+% Here we also define fallbacks
\defineXMLentities [tex] {tex} {\TeX}
\defineXMLentities [latex] {latex} {\LaTeX}
@@ -20,19 +20,19 @@
\defineXMLentities [Omega] {Omega} {\Omega}
-% We need this for French and Hungarian.
+% We need this for French and Hungarian.
\defineXMLentity [colon] {\directdiscretionary{:}}
\defineXMLentity [semicolon] {\directdiscretionary{;}}
\defineXMLentity [questionmark] {\directdiscretionary{?}}
\defineXMLentity [exclamationmark] {\directdiscretionary{!}}
-% These will fall back to the raw encoding vector
+% These will fall back to the raw encoding vector
\defineXMLentity [Aacute] {\Aacute}
\defineXMLentity [aacute] {\aacute}
-\defineXMLentity [Cacute] {\Cacute} % unofficial
-\defineXMLentity [cacute] {\cacute} % unofficial
+\defineXMLentity [Cacute] {\Cacute} % unofficial
+\defineXMLentity [cacute] {\cacute} % unofficial
\defineXMLentity [Eacute] {\Eacute}
\defineXMLentity [eacute] {\eacute}
\defineXMLentity [Iacute] {\Iacute}
@@ -69,13 +69,13 @@
\defineXMLentity [Aring] {\Aring}
\defineXMLentity [aring] {\aring}
-\defineXMLentity [Oslash] {\Oslash} % stroke
+\defineXMLentity [Oslash] {\Oslash} % stroke
\defineXMLentity [oslash] {\oslash}
-\defineXMLentity [Lslash] {\Lslash} % unofficial
-\defineXMLentity [lslash] {\lslash} % unofficial
+\defineXMLentity [Lslash] {\Lslash} % unofficial
+\defineXMLentity [lslash] {\lslash} % unofficial
-\defineXMLentity [eth] {\eth} % ?
-\defineXMLentity [ETH] {\Eth} % ?
+\defineXMLentity [eth] {\eth} % ?
+\defineXMLentity [ETH] {\Eth} % ?
\defineXMLentity [Atilde] {\Atilde}
\defineXMLentity [atilde] {\atilde}
@@ -116,10 +116,10 @@
\defineXMLentity [Ucirc] {\Ucircumflex}
\defineXMLentity [ucirc] {\ucircumflex}
-\defineXMLentity [ccaron] {\ccaron} % unofficial
-\defineXMLentity [rcaron] {\rcaron} % unofficial
-\defineXMLentity [scaron] {\scaron} % unofficial
-\defineXMLentity [zcaron] {\zcaron} % unofficial
+\defineXMLentity [ccaron] {\ccaron} % unofficial
+\defineXMLentity [rcaron] {\rcaron} % unofficial
+\defineXMLentity [scaron] {\scaron} % unofficial
+\defineXMLentity [zcaron] {\zcaron} % unofficial
\defineXMLentity [dots] {\unknown}
-\defineXMLentity [amp] {\&}
+\defineXMLentity [amp] {\&} \ No newline at end of file
diff --git a/tex/context/base/xtag-hyp.tex b/tex/context/base/xtag-hyp.tex
new file mode 100644
index 000000000..5328899c5
--- /dev/null
+++ b/tex/context/base/xtag-hyp.tex
@@ -0,0 +1,49 @@
+%D \module
+%D [ file=xtag-hyp,
+%D version=2003.11.24,
+%D title=\CONTEXT\ XML Support,
+%D subtitle=hyphenation support,
+%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 XML Macros (hyphenation)}
+
+%D This filter is kind of obsolete, since \UTF\ is not
+%D limited to \XML. So, here we only enable \UTF\ support.
+
+\defineXMLenvironment [hyphenations] [language=\currentlanguage,regime=utf,encoding=\defaultencoding]
+ {\startnointerference
+ \defineXMLargument [hyphenation] \hyphenation
+ \language[\XMLop{language}]%
+ \enableregime[\XMLop{regime}]%
+ \enableencoding[\XMLop{encoding}]}
+ {\stopnointerference}
+
+\endinput
+
+% \mainlanguage[nl] \setupbodyfont[pos] \useXMLfilter[utf,hyp]
+%
+% \starttext
+%
+% \hyphenatedword{pati\ediaeresis nten}
+% \hyphenatedword{pati\ediaeresis ntenorganisatie}
+% \hyphenatedword{pati\ediaeresis ntenplatform}
+%
+% \startXMLdata
+% <hyphenations language='nl' regime='utf'>
+% <hyphenation>pa-tiën-ten</hyphenation>
+% <hyphenation>pa-tiën-ten-or-ga-ni-sa-tie</hyphenation>
+% <hyphenation>pa-tiën-ten-plat-form</hyphenation>
+% </hyphenations>
+% \stopXMLdata
+%
+% \hyphenatedword{pati\ediaeresis nten}
+% \hyphenatedword{pati\ediaeresis ntenorganisatie}
+% \hyphenatedword{pati\ediaeresis ntenplatform}
+%
+% \stoptext \ No newline at end of file
diff --git a/tex/context/base/xtag-ini.tex b/tex/context/base/xtag-ini.tex
index 282aea035..9ea384ad7 100644
--- a/tex/context/base/xtag-ini.tex
+++ b/tex/context/base/xtag-ini.tex
@@ -155,23 +155,45 @@
\unprotect
-\def\@@XML {XML:}
-\def\@@XMLentity {\@@XML ent} % &crap;
-\def\@@XMLelement {\@@XML ele} % <this> </this> <that/>
-\def\@@XMLvariable {\@@XML var} % key="val"
-\def\@@XMLvalue {\@@XML val} % key="val"
-\def\@@XMLpars {\@@XML par} %
-\def\@@XMLdata {\@@XML dat} % mem buffer
-\def\@@XMLcode {\@@XML cod} % named mem buffers
-\def\@@XMLinstruction {\@@XML ins} % <?
-\def\@@XMLmap {\@@XML map} % mapping on context attr
-\def\@@XMLlist {\@@XML lst} %
-\def\@@XMLnamespace {\@@XML nam} % namespace:element
-\def\@@XMLurlspace {\@@XML url} %
-\def\@@XMLescape {\@@XML esc} % <!
-\def\@@XMLdepth {\@@XML dep} % used to track nesting
-\def\@@XMLdopth {\@@XML dop} % used to track nesting
-\def\@@XMLsave {\@@XML sav} % namespace for saved elements
+\def \@@XML {XML:}
+\edef\@@XMLentity {\@@XML ent} % &crap;
+\edef\@@XMLelement {\@@XML ele} % <this> </this> <that/>
+\edef\@@XMLvariable {\@@XML var} % key="val"
+\edef\@@XMLvalue {\@@XML val} % key="val"
+\edef\@@XMLpars {\@@XML par} %
+\edef\@@XMLdata {\@@XML dat} % mem buffer
+\edef\@@XMLcode {\@@XML cod} % named mem buffers
+\edef\@@XMLinstruction {\@@XML ins} % <?
+\edef\@@XMLmap {\@@XML map} % mapping on context attr
+\edef\@@XMLlist {\@@XML lst} %
+\edef\@@XMLnamespace {\@@XML nam} % namespace:element
+\edef\@@XMLurlspace {\@@XML url} %
+\edef\@@XMLescape {\@@XML esc} % <!
+\edef\@@XMLdepth {\@@XML dep} % used to track nesting
+\edef\@@XMLdopth {\@@XML dop} % used to track nesting
+\edef\@@XMLsave {\@@XML sav} % namespace for saved elements
+
+\iffalse % slightly faster
+
+\edef\@@XML {*}
+\edef\@@XMLentity {\@@XML a} % &crap;
+\edef\@@XMLelement {\@@XML b} % <this> </this> <that/>
+\edef\@@XMLvariable {\@@XML c} % key="val"
+\edef\@@XMLvalue {\@@XML d} % key="val"
+\edef\@@XMLpars {\@@XML e} %
+\edef\@@XMLdata {\@@XML f} % mem buffer
+\edef\@@XMLcode {\@@XML g} % named mem buffers
+\edef\@@XMLinstruction {\@@XML h} % <?
+\edef\@@XMLmap {\@@XML i} % mapping on context attr
+\edef\@@XMLlist {\@@XML j} %
+\edef\@@XMLnamespace {\@@XML k} % namespace:element
+\edef\@@XMLurlspace {\@@XML l} %
+\edef\@@XMLescape {\@@XML m} % <!
+\edef\@@XMLdepth {\@@XML n} % used to track nesting
+\edef\@@XMLdopth {\@@XML o} % used to track nesting
+\edef\@@XMLsave {\@@XML p} % namespace for saved elements
+
+\fi
\newtoks\XMLtoks
\newtoks\XMLresetlist
@@ -1243,7 +1265,7 @@
% \@EA\def\csname\@@XMLvariable:\@@XMLclass:\@@XMLspac:\@@XMLname\endcsname{#1}%
% \fi}
-\def\dosetXMLattributeC%
+\def\dosetXMLattributeC
{\@EA\def\csname\@@XMLvariable:\@@XMLclass\ifx\@@XMLspac
\originalXMLnamespace\else:\@@XMLspac\fi:\@@XMLname\endcsname}
@@ -1360,21 +1382,25 @@
\def\dodoparseXMLargumentsD#1"{\dosetXMLargument{#1}}
\def\dodoparseXMLargumentsS#1'{\dosetXMLargument{#1}}
-\def\dosetXMLargument#1%
- {\ifXMLnamespace
- \ifx\@@XMLspac\@@XMLns
- \checkXMLnamespaceattr{#1}% xmlns:\@@XMLname="#1"
- \else
- \dosetXMLattribute{#1}% some:\@@XMLname="#1"
- \fi
- \XMLnamespacefalse
- \else\ifx\@@XMLname\@@XMLns
- \checkXMLnamespaceattr{#1}% xmlns="#1"
- \else
- \dodosetXMLargument{#1}%
- \fi\fi
- \let\dodoparseXMLarguments\doparseXMLarguments
- \dodoparseXMLarguments}
+% the readable version
+%
+% \def\dosetXMLargument#1%
+% {\ifXMLnamespace
+% \ifx\@@XMLspac\@@XMLns
+% \checkXMLnamespaceattr{#1}% xmlns:\@@XMLname="#1"
+% \else
+% \dosetXMLattribute{#1}% some:\@@XMLname="#1"
+% \fi
+% \XMLnamespacefalse
+% \else\ifx\@@XMLname\@@XMLns
+% \checkXMLnamespaceattr{#1}% xmlns="#1"
+% \else
+% \dodosetXMLargument{#1}%
+% \fi\fi
+% \let\dodoparseXMLarguments\doparseXMLarguments
+% \dodoparseXMLarguments}
+%
+% the ugly alternative
\def\dosetXMLargument#1% ugly alternative
{\ifXMLnamespace
@@ -1491,112 +1517,171 @@
\bgroup \catcode`<=\@@active
+% \long\gdef\dododefineXMLsingular#1#2%
+% {\long\setvalue{\@@XMLelement:#1/}{#2}}
+
\long\gdef\dododefineXMLsingular#1#2%
- {\long\setvalue{\@@XMLelement:#1/}{#2}}
+ {\long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2}}
+
+% \long\gdef\dododefineXMLcommand#1#2%
+% {\long\setvalue{\@@XMLelement:#1/}{#2}%
+% \long\setvalue{\@@XMLelement:#1}{#2}}
\long\gdef\dododefineXMLcommand#1#2%
- {\long\setvalue{\@@XMLelement:#1/}{#2}%
- \long\setvalue{\@@XMLelement:#1}{#2}}
+ {\long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2}%
+ \long\@EA\def\csname\@@XMLelement:#1\endcsname{#2}}
+
+% \long\gdef\dododefineXMLgrouped#1#2%
+% {\long\setvalue{\@@XMLelement:#1}{\groupedcommand{#2}{}\bgroup}%
+% \long\setvalue{\@@XMLelement:/#1}{\egroup}}
\long\gdef\dododefineXMLgrouped#1#2%
- {\long\setvalue{\@@XMLelement:#1}{\groupedcommand{#2}{}\bgroup}%
- \long\setvalue{\@@XMLelement:/#1}{\egroup}}
+ {\long\@EA\def\csname\@@XMLelement:#1\endcsname{\groupedcommand{#2}\donothing\bgroup}%
+ \@EA\let\csname\@@XMLelement:/#1\endcsname\egroup}
+
+% \long\gdef\dododefineXMLargument#1#2% watch the {} around ##1
+% {\long\setvalue{\@@XMLelement:#1/}{#2{}}%
+% \long\setvalue{\@@XMLelement:#1}##1</#1>{#2{##1}}}
-%\long\gdef\dododefineXMLargument#1#2% watch the {} around ##1
-% {\long\setvalue{\@@XMLelement:#1/}{#2{}}%
-% \long\setvalue{\@@XMLelement:#1}##1</#1>{#2{##1}}}
+% \long\gdef\dododefineXMLargument#1#2% watch the {} around ##1
+% {\long\setvalue{\@@XMLelement:#1/}{#2{}}%
+% \long\setvalue{\@@XMLelement:#1}{\redoXMLargument{#1}{#2}}}
\long\gdef\dododefineXMLargument#1#2% watch the {} around ##1
- {\long\setvalue{\@@XMLelement:#1/}{#2{}}%
- \long\setvalue{\@@XMLelement:#1}{\redoXMLargument{#1}{#2}}}
+ {\long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2{}}%
+ \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLargument{#1}{#2}}}
-\long\gdef\redoXMLargument#1#2%
- {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>{#2{##1}}%
+\long\gdef\redoXMLargument#1#2% potential optimization: globalnext
+ {\long\@EA\gdef\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>{#2{##1}}%
\next}
%\long\gdef\dododefineXMLignore#1%
% {\long\setvalue{\@@XMLelement:#1/}{}%
% \long\setvalue{\@@XMLelement:#1}##1</#1>{}}
+% \long\gdef\dododefineXMLignore#1%
+% {\long\setvalue{\@@XMLelement:#1/}{}%
+% \long\setvalue{\@@XMLelement:#1}{\redoXMLignore{#1}}}
+
\long\gdef\dododefineXMLignore#1%
- {\long\setvalue{\@@XMLelement:#1/}{}%
- \long\setvalue{\@@XMLelement:#1}{\redoXMLignore{#1}}}
+ {\@EA\let\csname\@@XMLelement:#1/\endcsname\donothing
+ \@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLignore{#1}}}
\long\gdef\redoXMLignore#1%
{\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>{}%
\next}
-%\long\gdef\dododefineXMLpickup#1#2#3%
-% {\long\setvalue{\@@XMLelement:#1/}{#2#3}%
-% \long\setvalue{\@@XMLelement:#1}##1</#1>{#2##1#3}}
+% \long\gdef\dododefineXMLpickup#1#2#3%
+% {\long\setvalue{\@@XMLelement:#1/}{#2#3}%
+% \long\setvalue{\@@XMLelement:#1}##1</#1>{#2##1#3}}
+
+% \long\gdef\dododefineXMLpickup#1#2#3%
+% {\long\setvalue{\@@XMLelement:#1/}{#2#3}%
+% \long\setvalue{\@@XMLelement:#1}{\redoXMLpickup{#1}{#2}{#3}}}
\long\gdef\dododefineXMLpickup#1#2#3%
- {\long\setvalue{\@@XMLelement:#1/}{#2#3}%
- \long\setvalue{\@@XMLelement:#1}{\redoXMLpickup{#1}{#2}{#3}}}
+ {\long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2#3}%
+ \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLpickup{#1}{#2}{#3}}}
\long\gdef\redoXMLpickup#1#2#3%
{\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>{#2##1#3}%
\next}
+% \long\gdef\dododefineXMLenvironment#1#2#3%
+% {\long\setvalue{\@@XMLelement:#1/}{#2#3}%
+% \long\setvalue{\@@XMLelement:#1}{#2}%
+% \long\setvalue{\@@XMLelement:/#1}{#3}}
+
\long\gdef\dododefineXMLenvironment#1#2#3%
- {\long\setvalue{\@@XMLelement:#1/}{#2#3}%
- \long\setvalue{\@@XMLelement:#1}{#2}%
- \long\setvalue{\@@XMLelement:/#1}{#3}}
+ {\long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2#3}%
+ \long\@EA\def\csname\@@XMLelement:#1\endcsname{#2}%
+ \long\@EA\def\csname\@@XMLelement:/#1\endcsname{#3}}
-%\long\gdef\dododefineXMLsave#1%
-% {\letvalue{\@@XMLdata:#1}\longempty
-% \long\setvalue{\@@XMLelement:#1/}{\long\setvalue{\@@XMLdata:#1}{}}%
-% \long\setvalue{\@@XMLelement:#1}##1</#1>{\long\setvalue{\@@XMLdata:#1}{##1}}}
+% \long\gdef\dododefineXMLsave#1%
+% {\letvalue{\@@XMLdata:#1}\longempty
+% \long\setvalue{\@@XMLelement:#1/}{\long\setvalue{\@@XMLdata:#1}{}}%
+% \long\setvalue{\@@XMLelement:#1}##1</#1>{\long\setvalue{\@@XMLdata:#1}{##1}}}
+
+% \long\gdef\dododefineXMLsave#1%
+% {\letvalue{\@@XMLdata:#1}\longempty
+% \long\setvalue{\@@XMLelement:#1/}{\long\setvalue{\@@XMLdata:#1}{}}%
+% \long\setvalue{\@@XMLelement:#1}{\redoXMLsave{#1}}}
\long\gdef\dododefineXMLsave#1%
- {\letvalue{\@@XMLdata:#1}\longempty
- \long\setvalue{\@@XMLelement:#1/}{\long\setvalue{\@@XMLdata:#1}{}}%
- \long\setvalue{\@@XMLelement:#1}{\redoXMLsave{#1}}}
+ {\@EA\let\csname\@@XMLdata:#1\endcsname\longempty
+ \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}%
+ \long\@EA\def\csname\@@XMLelement:#1\endcsname {\redoXMLsave{#1}}}
+
+% \long\gdef\dododefineXMLsavecontent#1#2%
+% {\long\setvalue{\@@XMLdata:#1}{#2}%
+% \long\setvalue{\@@XMLelement:#1/}{}%
+% \long\setvalue{\@@XMLelement:#1}{\redoXMLsave{#1}}}
\long\gdef\dododefineXMLsavecontent#1#2%
- {\long\setvalue{\@@XMLdata:#1}{#2}%
- \long\setvalue{\@@XMLelement:#1/}{}%
- \long\setvalue{\@@XMLelement:#1}{\redoXMLsave{#1}}}
+ {\long\@EA\def\csname\@@XMLdata:#1\endcsname{#2}%
+ \@EA\let\csname\@@XMLelement:#1/\endcsname\donothing
+ \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLsave{#1}}}
\gdef\redoXMLsave#1%
{\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>%
{\long\@EA\def\csname\@@XMLdata:#1\endcsname{##1}}%
\next}
+% \long\gdef\dododefineXMLgsave#1%
+% {\letgvalue{\@@XMLdata:#1}\longempty
+% \long\setvalue{\@@XMLelement:#1/}{\long\setgvalue{\@@XMLdata:#1}{}}%
+% \long\setvalue{\@@XMLelement:#1}{\redoXMLgsave{#1}}}
+
\long\gdef\dododefineXMLgsave#1%
- {\letgvalue{\@@XMLdata:#1}\longempty
- \long\setvalue{\@@XMLelement:#1/}{\long\setgvalue{\@@XMLdata:#1}{}}%
- \long\setvalue{\@@XMLelement:#1}{\redoXMLgsave{#1}}}
+ {\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty
+ \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}%
+ \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLgsave{#1}}}
+
+% \long\gdef\dododefineXMLgsavecontent#1#2%
+% {\long\setvalue{\@@XMLdata:#1}{#2}%
+% %\long\setvalue{\@@XMLelement:#1/}{}%
+% \long\setvalue{\@@XMLelement:#1/}{\long\setgvalue{\@@XMLdata:#1}{}}%
+% \long\setvalue{\@@XMLelement:#1}{\redoXMLgsave{#1}}}
\long\gdef\dododefineXMLgsavecontent#1#2%
- {\long\setvalue{\@@XMLdata:#1}{#2}%
- \long\setvalue{\@@XMLelement:#1/}{}%
- \long\setvalue{\@@XMLelement:#1}{\redoXMLgsave{#1}}}
+ {\long\@EA\gdef\csname\@@XMLdata:#1\endcsname{#2}%
+ \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}%
+ \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLgsave{#1}}}
\gdef\redoXMLgsave#1%
{\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>%
{\long\@EA\gdef\csname\@@XMLdata:#1\endcsname{##1}}%
\next}
-%\long\gdef\dododefineXMLenvironmentsave#1#2#3%
-% {\letvalue{\@@XMLdata:#1}\longempty
-% \long\setvalue{\@@XMLelement:#1/}{#2\long\setvalue{\@@XMLdata:#1}{}#3}%
-% \long\setvalue{\@@XMLelement:#1}##1</#1>{#2\long\setvalue{\@@XMLdata:#1}{##1}#3}}
+% \long\gdef\dododefineXMLenvironmentsave#1#2#3%
+% {\letvalue{\@@XMLdata:#1}\longempty
+% \long\setvalue{\@@XMLelement:#1/}{#2\long\setvalue{\@@XMLdata:#1}{}#3}%
+% \long\setvalue{\@@XMLelement:#1}##1</#1>{#2\long\setvalue{\@@XMLdata:#1}{##1}#3}}
+
+% \long\gdef\dododefineXMLenvironmentsave#1#2#3%
+% {\letvalue{\@@XMLdata:#1}\longempty
+% \long\setvalue{\@@XMLelement:#1/}{#2\long\setvalue{\@@XMLdata:#1}{}#3}%
+% \long\setvalue{\@@XMLelement:#1}{\redoXMLenvironmentsave{#1}{#2}{#3}}}
\long\gdef\dododefineXMLenvironmentsave#1#2#3%
- {\letvalue{\@@XMLdata:#1}\longempty
- \long\setvalue{\@@XMLelement:#1/}{#2\long\setvalue{\@@XMLdata:#1}{}#3}%
- \long\setvalue{\@@XMLelement:#1}{\redoXMLenvironmentsave{#1}{#2}{#3}}}
+ {\@EA\let\csname\@@XMLdata:#1\endcsname\longempty
+ \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2\@EA\let\csname\@@XMLdata:#1\endcsname\longempty#3}%
+ \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLenvironmentsave{#1}{#2}{#3}}}
\gdef\redoXMLenvironmentsave#1#2#3%
{\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>%
{#2\long\@EA\def\csname\@@XMLdata:#1\endcsname{##1}#3}%
\next}
+% \long\gdef\dododefineXMLenvironmentgsave#1#2#3%
+% {\letgvalue{\@@XMLdata:#1}\longempty
+% \long\setvalue{\@@XMLelement:#1/}{#2\long\setgvalue{\@@XMLdata:#1}{}#3}%
+% \long\setvalue{\@@XMLelement:#1}{\redoXMLenvironmentgsave{#1}{#2}{#3}}}
+
\long\gdef\dododefineXMLenvironmentgsave#1#2#3%
- {\letgvalue{\@@XMLdata:#1}\longempty
- \long\setvalue{\@@XMLelement:#1/}{#2\long\setgvalue{\@@XMLdata:#1}{}#3}%
- \long\setvalue{\@@XMLelement:#1}{\redoXMLenvironmentgsave{#1}{#2}{#3}}}
+ {\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty
+ \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty#3}%
+ \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLenvironmentgsave{#1}{#2}{#3}}}
\gdef\redoXMLenvironmentgsave#1#2#3%
{\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>%
@@ -1608,16 +1693,27 @@
% \long\setvalue{\@@XMLelement:#1}{}%
% \long\setvalue{\@@XMLelement:/#1}{}}
+% \long\gdef\dododefineXMLprocess#1%
+% {\letvalue{\@@XMLelement:#1/}\donothing
+% \letvalue{\@@XMLelement:#1}\donothing
+% \letvalue{\@@XMLelement:/#1}\donothing}
+
\long\gdef\dododefineXMLprocess#1%
- {\letvalue{\@@XMLelement:#1/}\donothing
- \letvalue{\@@XMLelement:#1}\donothing
- \letvalue{\@@XMLelement:/#1}\donothing}
+ {\@EA\let\csname\@@XMLelement:#1/\endcsname\donothing
+ \@EA\let\csname\@@XMLelement:#1\endcsname\donothing
+ \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing}
+
+% \long\gdef\dododefineXMLnestedenvironment#1#2#3%
+% {\long\setvalue{\@@XMLelement:#1}{\getXMLgroupedenvironment{#1}{#2}{#3}}}
\long\gdef\dododefineXMLnestedenvironment#1#2#3%
- {\long\setvalue{\@@XMLelement:#1}{\getXMLgroupedenvironment{#1}{#2}{#3}}}
+ {\long\@EA\def\csname\@@XMLelement:#1\endcsname{\getXMLgroupedenvironment{#1}{#2}{#3}}}
+
+% \long\gdef\dododefineXMLnestedargument#1#2%
+% {\long\setvalue{\@@XMLelement:#1}{\getXMLgroupedargument{#1}{#2}}}
\long\gdef\dododefineXMLnestedargument#1#2%
- {\long\setvalue{\@@XMLelement:#1}{\getXMLgroupedargument{#1}{#2}}}
+ {\long\@EA\def\csname\@@XMLelement:#1\endcsname{\getXMLgroupedargument{#1}{#2}}}
\egroup
@@ -1818,12 +1914,10 @@
\let\XMLpopdata\XMLflushdata
\def\XMLappend#1#2% let to empty expands to nothing -)
- {\long\@EA\edef\csname\@@XMLdata:#1\endcsname
- {\csname\@@XMLdata:#1\endcsname#2}}
+ {\long\@EA\edef\csname\@@XMLdata:#1\endcsname{\csname\@@XMLdata:#1\endcsname#2}}
\def\XMLprepend#1#2% let to empty expands to nothing -)
- {\long\@EA\edef\csname\@@XMLdata:#1\endcsname
- {#2\csname\@@XMLdata:#1\endcsname}}
+ {\long\@EA\edef\csname\@@XMLdata:#1\endcsname{#2\csname\@@XMLdata:#1\endcsname}}
\def\XMLerase#1%
{\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}
@@ -2266,7 +2360,8 @@
\def\XMLifequalelse#1#2%
{\ifcsname\@@XMLvariable:#1:#2\endcsname
- \@EAEAEA\doXMLifequalelse\@EA\@EA\csname\@@XMLvariable:#1:#2\endcsname
+ % \@EAEAEA\doXMLifequalelse\@EA\@EA\csname\@@XMLvariable:#1:#2\endcsname
+ \@EA\doXMLifequalelse\csname\@@XMLvariable:#1:#2\@EA\endcsname
\else
\@EA\secondoftwoarguments
\fi}
@@ -2290,4 +2385,4 @@
\def\XMLyes#1{\XMLownifequalelse{#1}{yes}{#1}{}}
-\protect \endinput
+\protect \endinput \ No newline at end of file
diff --git a/tex/context/base/xtag-mmc.tex b/tex/context/base/xtag-mmc.tex
index 5dcba788f..9da718b27 100644
--- a/tex/context/base/xtag-mmc.tex
+++ b/tex/context/base/xtag-mmc.tex
@@ -14,11 +14,11 @@
\writestatus{loading}{Context XML Macros (content math ml)}
% this is the first, experimental, shabby implementation, as
-% always, the third will do -)
+% always, the third will do -)
% okay, now this is the second one, with a more kid based
-% approach, which we needed for proper nesting, but the
-% code is still too ugly
+% approach, which we needed for proper nesting, but the
+% code is still too ugly
\startXMLmapping[mml]
@@ -70,8 +70,8 @@
\def\MMLcfloat#1%
{\doifelse\@@MMLfloatsymbool\v!nee
- {{\rm#1}} % make sure that e shows up ok
- {% we should ignore \entities !
+ {{\rm#1}} % make sure that e shows up ok
+ {% we should ignore \entities !
\beforesplitstring#1\at e\to\first
\aftersplitstring #1\at e\to\last
\ifx\first\empty #1\else
@@ -81,19 +81,19 @@
10^{\last}%
\fi\fi}}
-% we now have:
+% we now have:
\setupMMLappearance[enotation][\c!symbool=\v!nee] % \v!ja|dot
\def\MMLcenotation#1%
{\doifelse\@@MMLenotationsymbool\v!nee
- {\def\MMLcsep%
+ {\def\MMLcsep%
{\unskip{\rm e}\ignorespaces}}
{\def\MMLcsep##1\empty
{\doifelse\@@MMLenotationsymbool{dot}\cdot\times10^{##1}}}%
#1\empty}
-\def\MMLcCI#1% #2% can be sped up with \doifundefined ...
+\def\MMLcCI#1% #2% can be sped up with \doifundefined ...
{\getXMLarguments{ci}{type="" #1}%
\doifXMLparelse{ci}{type}
{\processaction
@@ -107,8 +107,8 @@ complex-cartesian=>\let\next\MMLccartesian,
complex-polar=>\let\next\MMLcpolar,
polar=>\let\next\MMLcpolar,
fn=>\let\next\MMLcCIfunction,
- unknown=>\let\next\firstofoneargument]} % integer constant real float
- {\let\next\firstofoneargument}%
+ unknown=>\let\next\firstofoneargument]} % integer constant real float
+ {\let\next\firstofoneargument}%
\next}
\def\MMLcCIset#1%
@@ -126,18 +126,18 @@ complex-cartesian=>\let\next\MMLccartesian,
{{\bi#1}}
\def\MMLcCIfunction#1%
- {\doifMMLoperatorelse{#1}
+ {\doifMMLoperatorelse{#1}
{\let\next\MMLcCIdefault}
{\let\next\MMLcFNdefault}%
\next{}{#1}}
-\def\MMLcCIdefault#1#2% #1=dummy
- {#2%\!% \getXMLentity{NegThinSpace}% looks bad in A(x)
+\def\MMLcCIdefault#1#2% #1=dummy
+ {#2%\!% \getXMLentity{NegThinSpace}% looks bad in A(x)
\doifnextcharelse\xmlr
{\encapsulatenextXMLRelements{\left(}{\MMLccomma}{\right)}}
{}}
-\def\MMLcCN#1% #2% can be sped up with \doifundefined ...
+\def\MMLcCN#1% #2% can be sped up with \doifundefined ...
{\getXMLarguments{cn}{type="" #1}%
\doifXMLparelse{cn}{type}
{\processaction
@@ -149,9 +149,9 @@ complex-cartesian=>\let\next\MMLccartesian,
complex=>\let\next\MMLccartesian,
complex-polar=>\let\next\MMLcpolar,
polar=>\let\next\MMLcpolar,
- e-notation=>\let\next\MMLcenotation, % new
- float=>\let\next\MMLcfloat, % obsolete
- real=>\let\next\MMLcfloat, % ?
+ e-notation=>\let\next\MMLcenotation, % new
+ float=>\let\next\MMLcfloat, % obsolete
+ real=>\let\next\MMLcfloat, % ?
unknown=>\let\next\firstofoneargument]}
{\let\next\firstofoneargument}
\next}
@@ -160,7 +160,7 @@ complex-cartesian=>\let\next\MMLccartesian,
\def\MMLcCNinteger#1%
{\doifXMLparelse{cn}{base}
- {\def\MMLcCNbase{\XMLpar{cn}{base}{}}%
+ {\def\MMLcCNbase{\XMLpar{cn}{base}{}}%
\doifelse\@@MMLbasesymbool\v!nee
{\MMLcCNbasedata{#1}}
{\MMLcCNbasedata{#1}_{\hbox{$\rm\scriptscriptstyle
@@ -206,7 +206,7 @@ complex-cartesian=>\let\next\MMLccartesian,
\let\MMLctempresetlist\empty \def\setMMLcreset{\edef\MMLctempresetlist}
\def\MMLcmainresetlist%
- {times/,divide/,power/,%
+ {times/,divide/,power/,%
lt/,gt/,eq/,leq/,geq/,%
in/,inverse/,%
fn,%
@@ -225,10 +225,10 @@ complex-cartesian=>\let\next\MMLccartesian,
sec/,arcsec/,sech/,arcsech/,%
ln/,exp/,log/,%
abs/,int/,limit/,sum/,product/,%
- fn} % ?
+ fn} % ?
\def\MMLcconstructlist
- {diff/,partialdiff/,root/} % apply goes wrong on 1/2 * (a_2 + b_3)
+ {diff/,partialdiff/,root/} % apply goes wrong on 1/2 * (a_2 + b_3)
% better: no () here but explicitly when needed, which is in
% less cases
@@ -253,7 +253,7 @@ complex-cartesian=>\let\next\MMLccartesian,
\advance\@MMLlevel-1
\doifXMLparelse{apply}{close}{\right\XMLpar{apply}{close}{}}{}%
\popmacro\xmlr
- \endgroup}}
+ \endgroup}}
\remapXMLsequence [reln] [CPA] \MMLcRELN
@@ -262,37 +262,37 @@ complex-cartesian=>\let\next\MMLccartesian,
\remapXMLsequence [fn] [CPA] \MMLcFN
-\def\MMLcFN#1#2% neg space needed because of \left
+\def\MMLcFN#1#2% neg space needed because of \left
{\doifXMLRchildelse{ci}{#2}
{\collectXMLRchild{ci}{#2}%
- \@EA\doifMMLoperatorelse\@EA{\the\XMLRtoks}
+ \@EA\doifMMLoperatorelse\@EA{\the\XMLRtoks}
{\let\next\MMLcFNoperator}
{\let\next\MMLcFNdefault}}
{\let\next\MMLcFNdefault}%
- \next{#1}{#2}}
+ \next{#1}{#2}}
-\def\MMLcFNdefault#1#2% neg space needed because of \left
+\def\MMLcFNdefault#1#2% neg space needed because of \left
{#2\!% \getXMLentity{NegThinSpace}%
\MMLcreset\encapsulatenextXMLRelements{\left(}{\MMLccomma}{\right)}}
-% special function handlers
+% special function handlers
\def\MMLcFNoperator
{\getvalue{doMMLcFN\mmloperator}}
% \def\doMMLcFNplusminus#1#2#3\empty
-% {\countXMLRchildren{#3}%
+% {\countXMLRchildren{#3}%
% \ifcase\nofXMLRchildren\or
% #2#3%
-% \else % suboptimal for instance under root
+% \else % suboptimal for instance under root
% \encapsulateXMLR{\left(}{#2}{\right)}{\MMLcreset#3}%
% \fi}
\def\doMMLcFNplusminus#1#2#3\empty
- {\countXMLRchildren{#3}%
+ {\countXMLRchildren{#3}%
\ifcase\nofXMLRchildren\or
\def\next{#2#3}%
- \else
+ \else
\def\next
{\doifnextcharelse\xmlr
{\encapsulateXMLR{\left(}{#2}{\right)}{\MMLcreset#3}}%
@@ -305,7 +305,7 @@ complex-cartesian=>\let\next\MMLccartesian,
\def\doMMLcFNcontinued#1#2#3\empty
{#3\getXMLentity{continued}}
-% so far for the special handlers
+% so far for the special handlers
\remapXMLsequence [interval] [CPA] \MMLcINTERVAL
@@ -353,7 +353,7 @@ complex-cartesian=>\let\next\MMLccartesian,
{\withnextXMLRelement
{\getXMLentity{declare}\nextXMLRelement
\countXMLRchildren{#2}%
- \ifnum\nofXMLRchildren>1
+ \ifnum\nofXMLRchildren>1
\;% \getXMLentity{ThickSpace}%
\getXMLentity{as}%
\;% \getXMLentity{ThickSpace}%
@@ -410,7 +410,7 @@ complex-cartesian=>\let\next\MMLccartesian,
\remapXMLsequence [piece] [CPA] \MMLcPIECE
\remapXMLsequence [otherwise] [CPA] \MMLcOTHERWISE
-\setupMMLappearance[piece][\c!scheider=]
+\setupMMLappearance[piece][\c!scheider=]
\def\MMLcPIECEWISE#1#2%
{\cases{#2}}
@@ -427,7 +427,7 @@ complex-cartesian=>\let\next\MMLccartesian,
\def\MMLcPIECEseparator{\doif\@@MMLpiecescheider\v!ja,}
-\def\MMLcPIECE#1#2%
+\def\MMLcPIECE#1#2%
{\withnexttwoXMLRelements
{\@EA\XMLRtoks\@EA{\firstXMLRelement\MMLcPIECEseparator\@col@amp@}%
\@EA\appendtoks\@EA\mathematics\@EA{\secondXMLRelement}\to\XMLRtoks
@@ -481,11 +481,11 @@ complex-cartesian=>\let\next\MMLccartesian,
\setupMMLappearance[sign][\c!reductie=\v!ja]
-\def\MMLcMINUS % expandafter needed ?
+\def\MMLcMINUS % expandafter needed ?
{\doifelse\@@MMLsignreductie\v!ja
{\expandafter\MMLcMINUSyes}{\expandafter\MMLcMINUSno}}
-\def\MMLcPLUS % expandafter needed ?
+\def\MMLcPLUS % expandafter needed ?
{\doifelse\@@MMLsignreductie\v!ja
{\expandafter\MMLcPLUSyes}{\expandafter\MMLcPLUSno}}
@@ -497,7 +497,7 @@ complex-cartesian=>\let\next\MMLccartesian,
{\countXMLRchildren{#3}%
\encapsulateXMLR{\ifcase\nofXMLRchildren\or+\fi}{+}{}{#3}}
-\def\MMLcMINUSyes#1#2#3\empty
+\def\MMLcMINUSyes#1#2#3\empty
{\setMMLcreset{\MMLcfunctionlist}%
\countXMLRchildren{#3}%
\encapsulateXMLR{\ifcase\nofXMLRchildren\or-\fi}{-}{}{#3}}
@@ -565,7 +565,7 @@ complex-cartesian=>\let\next\MMLccartesian,
\def\MMLcROOT#1#2#3\empty
{\doifXMLRchildelse{degree}{#3}\donetrue\donefalse
\doif\@@MMLrootsymbool\v!nee\donefalse
- \ifdone
+ \ifdone
\root\processXMLRchild{degree}{#3}\of
{\let\MMLcDEGREE\ignoreXMLRelement
\MMLcreset\processXMLRchildren{#3}}%
@@ -614,7 +614,7 @@ complex-cartesian=>\let\next\MMLccartesian,
{\countXMLRchild{apply,reln,ci,cn}{#3}%
\ifcase\nofXMLRchildren\or % == snelle volgende
\encapsulateXMLRchildren{apply,reln,ci,cn}
- {\left\vert}%
+ {\left\vert}%
{}
{\right.}
{#3\empty}%
@@ -686,8 +686,8 @@ complex-cartesian=>\let\next\MMLccartesian,
\def\lastMMLcrelation#1#2%
{\countXMLRchildren{#2}%
\rawcollectbetweenXMLR
- {\advance\nofXMLRchildren -1
- \ifnum\nofXMLRchildren>1
+ {\advance\nofXMLRchildren -1
+ \ifnum\nofXMLRchildren>1
\appendtoks\@col@amp@#1\crcr\to\XMLRtoks
\else
\appendtoks\@col@amp@#1\to\XMLRtoks
@@ -698,8 +698,8 @@ complex-cartesian=>\let\next\MMLccartesian,
\def\firstMMLcrelation#1#2%
{\nofXMLRchildren=0
\rawcollectbetweenXMLR
- {\advance\nofXMLRchildren 1
- \ifnum\nofXMLRchildren=1
+ {\advance\nofXMLRchildren 1
+ \ifnum\nofXMLRchildren=1
\appendtoks\@col@amp@#1\to\XMLRtoks
\else
\appendtoks\crcr\@col@amp@#1\to\XMLRtoks
@@ -724,7 +724,7 @@ complex-cartesian=>\let\next\MMLccartesian,
\v!eerste=>\let\next\firstMMLcrelation,
\v!ja=>\let\next\leftMMLcrelation ,
\v!links=>\let\next\leftMMLcrelation ,
- \v!rechts=>\let\next\rightMMLcrelation,
+ \v!rechts=>\let\next\rightMMLcrelation,
\s!default=>\let\next\noMMLcrelation ,
\s!unknown=>\let\next\noMMLcrelation ]
\next{#1}{#2}}
@@ -745,7 +745,7 @@ complex-cartesian=>\let\next\MMLccartesian,
\def\MMLcBECOMES#1#2{\MMLcrelation{:=}}
-\addtocommalist{becomes/}\MMLcmainresetlist
+\addtocommalist{becomes/}\MMLcmainresetlist
%%% calculus and vector calculus
@@ -770,11 +770,11 @@ complex-cartesian=>\let\next\MMLccartesian,
{\int}}}%
\doifXMLRchildelse{apply}{#3}
{\doifMMLfunctionelse{#3}%
- {\MMLcreset % TEST
+ {\MMLcreset % TEST
\processXMLRchild{apply}{#3}}
- {\left(\MMLcreset % TEST
+ {\left(\MMLcreset % TEST
\processXMLRchild{apply}{#3}\right)}}
- {\MMLcreset % TEST
+ {\MMLcreset % TEST
\processXMLRchild{ci}{#3}}%
\doifXMLRchild{bvar}{#3}
{\,% \getXMLentity{ThinSpace}%
@@ -843,13 +843,13 @@ complex-cartesian=>\let\next\MMLccartesian,
\def\doifMMLfunctionelse#1#2#3%
{\collectXMLRchild{apply}{#1}%
- \doifXMLRchildelse{fn}{\the\XMLRtoks#1}
+ \doifXMLRchildelse{fn}{\the\XMLRtoks#1}
{#2}
- {\doifXMLRchildelse{ci}{\the\XMLRtoks#1}
+ {\doifXMLRchildelse{ci}{\the\XMLRtoks#1}
{\pushmacro\xmlr
\getXMLarguments{dummy}{type=""}%
\def\xmlr{\getmmlarguments{dummy}{}}%
- \the\XMLRtoks % what if more than one ?
+ \the\XMLRtoks % what if more than one ?
\popmacro\xmlr
\doif{\XMLpar{dummy}{type}{}}{fn}{#2}{#3}}
{#2}}}
@@ -933,13 +933,13 @@ complex-cartesian=>\let\next\MMLccartesian,
\def\stackMMLsubscripts#1%
{\vbox
- {\baselineskip\!!zeropoint % hack, taco vragen
+ {\baselineskip\zeropoint % hack, taco vragen
\halign{$\scriptstyle\hss##\hss$\cr#1\crcr}}}
\def\MMLcSUMandPRODUCT#1#2#3#4\empty
{\pushmacro\xmlr
\doifXMLRchildelse{condition,bvar,lowlimit}{#4}
- {\def\MMLcSUMlow
+ {\def\MMLcSUMlow
{_{\doifXMLRchildelse{condition}{#4}
{\collectXMLRchild{condition}{#4}%
\expanded{\collectbetweenXMLR{\crcr}{\the\XMLRtoks}}%
@@ -1015,7 +1015,7 @@ complex-cartesian=>\let\next\MMLccartesian,
{\getXMLentity{log}_{\processXMLRchild{logbase}{#3}}}}
{\getXMLentity{log}}%
\let\MMLcLOGBASE\ignoreXMLRelement
- \nodoMMLcfunction#3\empty
+ \nodoMMLcfunction#3\empty
\popmacro\MMLcLOGBASE}
\remapXMLsequence [logbase] [CPA] \MMLcLOGBASE
@@ -1124,7 +1124,7 @@ complex-cartesian=>\let\next\MMLccartesian,
\setupMMLappearance[vector][\c!richting=\v!horizontaal] % \v!vertikaal
\def\MMLcVECTOR#1#2%
- {\countXMLRchildren{#2}%
+ {\countXMLRchildren{#2}%
\ifnum\nofXMLRchildren>1
\doifelse\@@MMLvectorrichting\v!horizontaal
{\encapsulateXMLR{\left(}{\MMLccomma}{\right)}{#2}}
@@ -1177,7 +1177,7 @@ complex-cartesian=>\let\next\MMLccartesian,
\def\MMLcSELECTOR#1#2#3\empty
{\pushmacro\xmlr
\withnextXMLRelement
- {\mathinner{\nextXMLRelement}% hm, assumes a matrix or so
+ {\mathinner{\nextXMLRelement}% hm, assumes a matrix or so
\doMMLcSELECTOR}%
#3\empty
\popmacro\xmlr}
@@ -1207,13 +1207,13 @@ complex-cartesian=>\let\next\MMLccartesian,
\remapXMLsequence [annotation] [CPA] \MMLcANNOTATION
-\def\MMLcANNOTATION#1#2% we need a better unmapper
+\def\MMLcANNOTATION#1#2% we need a better unmapper
{\getXMLarguments{annotation}{encoding="" #1}%
\doif{\XMLpar{annotation}{encoding}{}}{TeX}%
{\begingroup
- \setnormalXMLentities % better: \simplifyXMLentities ; test first
- \let\xmlrent\expandedXMLentity
- \edef\mmlascii{#2}%
+ \setnormalXMLentities % better: \simplifyXMLentities ; test first
+ \let\xmlrent\expandedXMLentity
+ \edef\mmlascii{#2}%
\setnormalcatcodes
\ifx\mmlascii\empty
\donefalse
diff --git a/tex/context/base/xtag-mml.tex b/tex/context/base/xtag-mml.tex
index cf3479073..cacdaf4e3 100644
--- a/tex/context/base/xtag-mml.tex
+++ b/tex/context/base/xtag-mml.tex
@@ -15,13 +15,13 @@
%\enablemathpunctuation
-% First some general formula element definitions.
+% First some general formula element definitions.
-\defineXMLenvironment [formula] [label=,sublabel=]
+\defineXMLenvironment [formula] [label=,sublabel=]
{\dostartXMLformula\placeformula}
{\dostopXMLformula}
-\defineXMLenvironment [subformula] [label=,sublabel=]
+\defineXMLenvironment [subformula] [label=,sublabel=]
{\dostartXMLformula\placesubformula}
{\dostopXMLformula}
@@ -55,7 +55,7 @@
\def\setupMMLappearance[#1]{\dodoubleargument\getparameters[@@MML#1]}
-\defineXMLdirective [mathml] \setupMMLappearance
+\defineXMLdirective [mathml] \setupMMLappearance
\defineXMLargument [math] \doXMLmath
\defineXMLargument [imath] \doXMLimath
@@ -92,7 +92,7 @@
\def\mathopnolimits#1{\mathop{\rm#1}\nolimits}
-% Auxiliary macros
+% Auxiliary macros
\bgroup \obeylines
@@ -100,21 +100,21 @@
{\bgroup\obeylines\xdefineMMLentity}
\gdef\xdefineMMLentity #1 #2 #3 #4
- {\egroup\dodefineMMLentity{#1}{#2}{#3}{#4}}
+ {\egroup\dodefineMMLentity{#1}{#2}{#3}{#4}}
\global\let\dodefineMMLentity\gobblefourarguments
\gdef\defineMMLsynonym
{\bgroup\obeylines\xdefineMMLsynonym}
-\gdef\xdefineMMLsynonym #1 #2
- {\egroup\dodefineMMLsynonym{#1}{#2}}
+\gdef\xdefineMMLsynonym #1 #2
+ {\egroup\dodefineMMLsynonym{#1}{#2}}
\global\let\dodefineMMLsynonym\gobbletwoarguments
-\egroup
+\egroup
-% some more
+% some more
\def\showMMLentity#1%
{\bgroup
@@ -134,7 +134,7 @@
\def\blackboard{\ifx\Bbb\undefined\else\expandafter\Bbb\fi}
\fi
-% basic entities, greek
+% basic entities, greek
\defineXMLentity [alpha] {\mathematics \alpha}
\defineXMLentity [beta] {\mathematics \beta}
@@ -309,9 +309,9 @@
\defineXMLentity [product] {\prod}
\defineXMLentity [lim] {\lim}
-\defineXMLentity [exp] {\exp}
-\defineXMLentity [ln] {\ln}
-\defineXMLentity [log] {\log}
+\defineXMLentity [exp] {\mathopnolimits{exp}} % {\exp}
+\defineXMLentity [ln] {\mathopnolimits{ln}} % {\ln}
+\defineXMLentity [log] {\mathopnolimits{log}} % {\log}
\defineXMLentity [sin] {\mathopnolimits{sin}}
\defineXMLentity [arcsin] {\mathopnolimits{arcsin}}
@@ -399,7 +399,7 @@
\def\somespaceentity#1#2%
{\mathortext
{\mskip#1mu}
- {\unskip\hskip#2em\strut\hskip\!!zeropoint\ignorespaces}\relax}
+ {\unskip\hskip#2em\strut\hskip\zeropoint\ignorespaces}\relax}
\defineXMLentity [VeryThinSpace] {\somespaceentity {2}{.125}}
\defineXMLentity [ThinSpace] {\somespaceentity {3}{.25}}
@@ -420,8 +420,8 @@
\defineXMLentity [medsp] {\getXMLentity{MediumSpace}}
\defineXMLentity [thicksp] {\getXMLentity{ThickSpace}}
-\defineXMLentity [larr] {\getXMLentity{LeftArrow}}
-\defineXMLentity [rarr] {\getXMLentity{RightArrow}}
+\defineXMLentity [larr] {\getXMLentity{LeftArrow}}
+\defineXMLentity [rarr] {\getXMLentity{RightArrow}}
\defineXMLentity [lbrace] {\normalordelimiter{\{}{\left \{}}
\defineXMLentity [rbrace] {\normalordelimiter{\}}{\right\}}}
@@ -439,7 +439,7 @@
\defineXMLentity [lparent] {\getXMLentity{lparenthesis}}
\defineXMLentity [rparent] {\getXMLentity{rparenthesis}}
-\bgroup
+\bgroup
\catcode`\{=12 \doglobal\convertargument{\to\mmllbrace
\catcode`\}=12 \doglobal\convertargument}\to\mmlrbrace
\egroup
diff --git a/tex/context/base/xtag-mmp.tex b/tex/context/base/xtag-mmp.tex
index 8a9380f96..13d488e5e 100644
--- a/tex/context/base/xtag-mmp.tex
+++ b/tex/context/base/xtag-mmp.tex
@@ -21,7 +21,7 @@
{\convertargument#2\to\asciiafter
\@EA#1\@EA{\asciiafter}}
-%
+%
\def\checkMMLoperator#1#2% temp hack
{\unspaceargument#1\to\ascii
@@ -34,7 +34,7 @@
\def\MMLpmath#1#2%
{\begingroup
\getXMLarguments{mstyle}{#1}\setMMLpmathstyle{mstyle}#2%
- \endgroup}
+ \endgroup}
\def\MMLpMI#1#2%
{\MMLpmath{#1}{\checkMMLoperator{#2}{#2}}}
@@ -42,11 +42,11 @@
\def\MMLpMN#1#2%
{\begingroup\rm\MMLpmath{#1}{#2}\endgroup}
-\def\MMLpMO#1#2% yes or no
+\def\MMLpMO#1#2% yes or no
{\checkMMLoperator
{#2}
{\ConvertConstantAfter\doifinstringelse{\xmlrent}{#2}
- {#2}{\hbox{\MMLpmath{#1}{\ignorespaces#2\unskip}}}}} % \hbox ?
+ {#2}{\hbox{\MMLpmath{#1}{\ignorespaces#2\unskip}}}}} % \hbox ?
\remapXMLsequence [mfenced] [CPA] \MMLpFENCED
@@ -64,13 +64,13 @@
\edef\MMLpopen {\XMLpar{mfenced}{open}{}}%
\edef\MMLpclose{\XMLpar{mfenced}{close}{}}%
\ifx\MMLpopen\empty\else\doMMLleft\MMLpopen\fi
- \pushmacro\MMLpopen
+ \pushmacro\MMLpopen
\pushmacro\MMLpclose
\doifXMLparelse{mfenced}{separators}
{\resetMMLseparator
\encapsulateXMLR
{}%
- {\pushmacro\myspecialvert % hack
+ {\pushmacro\myspecialvert % hack
\def\myspecialvert{\;\vrule\;}%
\grabMMLseparator{\XMLpar{mfenced}{separators}{}}%
\popmacro\myspecialvert}
@@ -89,7 +89,7 @@
\def\grabMMLseparator#1%
{\increment\MMLxxcounter
- \newcounter\MMLyycounter
+ \newcounter\MMLyycounter
\expanded{\dograbMMLseparator#1\noexpand\relax}}
\def\dograbMMLseparator%
@@ -116,7 +116,7 @@
\def\MMLpENCLOSE#1#2%
{\getXMLarguments{menclose}{notation="" #1}%
- \doifelse{\XMLpar{menclose}{notation}{}}{longdiv}
+ \doifelse{\XMLpar{menclose}{notation}{}}{longdiv}
{\overline{)#2}}
{#2}}
@@ -129,8 +129,8 @@
{\edef\theXMLpar{\XMLpar{mfrac}{linethickness}{1}}%
\processaction
[\theXMLpar]
- [ thin=>\scratchdimen=.2pt,
- medium=>\scratchdimen=.4pt,
+ [ thin=>\scratchdimen=.2pt,
+ medium=>\scratchdimen=.4pt,
thick=>\scratchdimen=.8pt,
unknown=>\setdimensionwithunit\scratchdimen{\theXMLpar}{}]%
{{\firstXMLRelement}\above\scratchdimen{\secondXMLRelement}}}
@@ -167,7 +167,7 @@
{\setMMLptextstyle{mstyle}%
\ignorespaces#2\unskip\unskip}}}}
-\def\setMMLpstyle#1%
+\def\setMMLpstyle#1%
{\doifdefined{MMLpstyle:#1}{\getvalue{MMLpstyle:#1}}}
\def\defineMMLstyle[#1]#2%
@@ -175,19 +175,19 @@
\defineMMLstyle[normal] {\tf} \defineMMLstyle[double-stuck] {\bf}
\defineMMLstyle[bolditalic] {\bi} \defineMMLstyle[bold-italic] {\bi}
-\defineMMLstyle[boldslanted]{\bs} \defineMMLstyle[bold-slanted] {\bs}
+\defineMMLstyle[boldslanted]{\bs} \defineMMLstyle[bold-slanted] {\bs}
\defineMMLstyle[boldnormal] {\bf} \defineMMLstyle[bold] {\bf}
\defineMMLstyle[slanted] {\sl} \defineMMLstyle[normalslanted]{\sl}
\defineMMLstyle[italic] {\it} \defineMMLstyle[normalitalic] {\it}
\defineMMLstyle[fraktur] {\bf} \defineMMLstyle[bold-fraktur] {\bf}
\defineMMLstyle[script] {\tf} \defineMMLstyle[bold-script] {\bf}
-% and all kind of other crappy names
+% and all kind of other crappy names
-\def\setMMLptextstyle#1%
+\def\setMMLptextstyle#1%
{\setMMLpstyle{\XMLpar{#1}{fontweight}{}\XMLpar{#1}{fontstyle}{}}}
-\def\setMMLpmathstyle#1%
+\def\setMMLpmathstyle#1%
{\setMMLpstyle{\XMLpar{#1}{mathvariant}{}}}
\def\doMMPpcolor#1#2%
@@ -203,7 +203,7 @@
{#2}}
\def\MMLpERROR #1#2{\hbox{$\displaystyle#2$}}
-\def\MMLpPHANTOM#1#2{\phantom{\ignorespaces{}#2\unskip}} % watch spacing {} hack
+\def\MMLpPHANTOM#1#2{\phantom{\ignorespaces{}#2\unskip}} % watch spacing {} hack
\def\MMLpPADDED #1#2{#2}
\remapXMLsequence [mrow] [CPA] \MMLpROW
@@ -227,7 +227,7 @@
\def\MMLpSUBP#1#2%
{\withnexttwoXMLRelements
{\doifelse\@@MMLscriptsvariant\v!a
- {{\firstXMLRelement}#1{\secondXMLRelement}} % both {} essential
+ {{\firstXMLRelement}#1{\secondXMLRelement}} % both {} essential
{\firstXMLRelement#1{\secondXMLRelement}}}%
#2}
@@ -254,7 +254,7 @@
{\pushmacro\doMMLfiller
\let\doMMLfiller\gobbleoneargument
\gdef\dodoMMLfiller{\disablefiller\mathematics{#1}}%
- \setbox\scratchbox=\hbox
+ \setbox\scratchbox=\hbox
{\def\normalorfiller##1##2%
{\gdef\dodoMMLfiller{\enablefiller#1}%
\let\normalorfiller\gobbletwoarguments}%
@@ -310,7 +310,7 @@
{\edef\MMLsetting{\XMLpar{mtbl}{#1}{}}#3% remap list
\edef\theMMLpTABLEmap{#2=\MMLsetting,\theMMLpTABLEmap}}
{}}
-
+
\def\doMMLpREMAP#1#2%
{\doif{\MMLsetting}{#1}
{\def\MMLsetting{#2}%
@@ -321,7 +321,7 @@
\def\doMMLpTABLE#1#2%
{\begingroup
\getXMLarguments{mtable}
- {columnalign="" columnspacing=".25ex" rowspacing=".25ex"
+ {columnalign="" columnspacing=".25ex" rowspacing=".25ex"
frame="" color="" background="" #1}%
\setupTABLE[\c!kader=\v!uit]%
\MMLpTABLEmapper{background}{\c!achtergrondkleur}{}%
@@ -343,10 +343,10 @@
{\doifXMLRchildelse{mtd}{#2}
{\bTR\ignorespaces#2\unskip\eTR}
{\bTR\doMMLpTD{#1}{#2}\eTR}}
-
+
\def\doMMLpTD#1#2%
{\getXMLarguments{mtbl}
- {columnalign="" columnspacing="" rowspacing=""
+ {columnalign="" columnspacing="" rowspacing=""
frame="" color="" background="" #1}%
\let\theMMLpTABLEmap\empty
\MMLpTABLEmap{background}{\c!achtergrondkleur}{}%
@@ -364,7 +364,7 @@
{\expandafter\MMLpTABLEa}
{\expandafter\MMLpTABLEb}}
-\def\MMLpTABLEa#1#2%
+\def\MMLpTABLEa#1#2%
{\begingroup
\doifelsenothing{#1}
{\global\setfalse\mmlTABLEargs}
@@ -376,10 +376,10 @@
{\ifconditional\mmlTABLEargs \else
\doifelsenothing{##1}{##2}{\global\settrue\mmlTABLEargs}%
\fi}%
- \let\MMLpTR\MMLpTABLE
- \let\MMLpTD\MMLpTABLE
+ \let\MMLpTR\MMLpTABLE
+ \let\MMLpTD\MMLpTABLE
#2$}%
- \fi
+ \fi
\ifconditional\mmlTABLEargs
\let\MMLpTABLE\doMMLpTABLE
\def\next{\MMLpTABLE{#1}}%
@@ -399,7 +399,7 @@
\@EA\aftersplitstring\ascii\at.\to\ascii
\scratchcounter=\ifx\ascii\empty#1\else\ascii\fi
\unskip\unskip}%
- \ifdim\wd\scratchbox=\!!zeropoint
+ \ifdim\wd\scratchbox=\zeropoint
\edef\MMLpunit{#1em}%
\else
\edef\ascii{#1}\convertcommand\ascii\to\ascii
@@ -417,7 +417,7 @@
\remapXMLsingular [mglyph] [CPA] \MMLpGLYPH
-\def\MMLpGLYPH#1#2% we assume \definefont usage
+\def\MMLpGLYPH#1#2% we assume \definefont usage
{\getXMLarguments{mglyph}{fontfamily="" index="1" alt="" #1}%
\def\MMLpglyph{\XMLpar{mglyph}{fontfamily}{}}%
\doifelsenothing{\MMLpglyph}
@@ -443,7 +443,7 @@
\def\MMLpMULTISCRIPTS#1#2%
{\pushmacro\xmlr
\let\xmlr\pMULTISCRIPTmmlPRE
- \donefalse \scratchcounter=0 #2\empty
+ \donefalse \scratchcounter=0 #2\empty
\let\xmlr\pMULTISCRIPTmmlPOST
\donetrue \scratchcounter=0 #2\empty
\popmacro\xmlr}
diff --git a/tex/context/base/xtag-utf.tex b/tex/context/base/xtag-utf.tex
index 172f7b303..e1faa04d2 100644
--- a/tex/context/base/xtag-utf.tex
+++ b/tex/context/base/xtag-utf.tex
@@ -13,9 +13,9 @@
\writestatus{loading}{Context XML Macros (UTF-8)}
-%D This filter is kind of obsolete, since \UTF\ is not
-%D limited to \XML. So, here we only enable \UTF\ support.
+%D This filter is kind of obsolete, since \UTF\ is not
+%D limited to \XML. So, here we only enable \UTF\ support.
\enableregime[utf]
-\endinput
+\endinput \ No newline at end of file
diff --git a/tex/context/config/cont-usr.tex b/tex/context/config/cont-usr.tex
index eaab96693..22b8a63f5 100644
--- a/tex/context/config/cont-usr.tex
+++ b/tex/context/config/cont-usr.tex
@@ -8,25 +8,26 @@
%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.
-
-%D In this file users can specify what hyphenation patterns
-%D they want to load into the format file. Normally, when
-%D using the \type {cont-..} files, this file can best be
-%D left unchanged. The default language and font settings
-%D done in the \type {cont-.} files take precedence! This file
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D In this file users can specify what hyphenation patterns
+%D they want to load into the format file. Normally, when
+%D using the \type {cont-..} files, this file can best be
+%D left unchanged. The default language and font settings
+%D done in the \type {cont-.} files take precedence! This file
%D is subject to changes.
\unprotect
%D Hyphenation patterns are normally sought in filed named
-%D \type {lang-xx.pat}. When present on the system, those
-%D patterns take precedence. (The next list is inspired on
-%D Thomas Esser's \TETEX\ distribution.) This list will be
+%D \type {lang-xx.pat}. When present on the system, those
+%D patterns take precedence. (The next list is inspired on
+%D Thomas Esser's \TETEX\ distribution.) This list will be
%D adapted to the actual situation.
-\definefilesynonym [lang-cz.pat] [czhyph.tex]
+%definefilesynonym [lang-cz.pat] [czhyph.tex] % is bound to latex (tl 8+)
+\definefilesynonym [lang-cz.pat] [czhyphen.tex]
\definefilesynonym [lang-da.pat] [dkhyph.tex]
\definefilesynonym [lang-de.pat] [dehyphn.tex]
\definefilesynonym [lang-en.pat] [ushyph1.tex]
@@ -43,7 +44,8 @@
\definefilesynonym [lang-pt.pat] [pthyph.tex]
\definefilesynonym [lang-ro.pat] [rohyph.tex]
\definefilesynonym [lang-ru.pat] [ruenhyph.tex]
-\definefilesynonym [lang-sk.pat] [skhyph.tex]
+%definefilesynonym [lang-sk.pat] [skhyph.tex] % is bound to latex (tl 8+)
+\definefilesynonym [lang-sk.pat] [skhyphen.tex]
\definefilesynonym [lang-sv.pat] [sehyph.tex]
\definefilesynonym [lang-tr.pat] [trhyph.tex]
\definefilesynonym [lang-ua.pat] [ukrenhyp.tex]
@@ -56,7 +58,7 @@
%D replaced by \type {nehyph96.tex}. Typical something that
%D you have to find out by accident. The names of hyphenation
%D files as well as their coding is one of the dark areas of
-%D \TEX\ distributions.
+%D \TEX\ distributions.
\doiffileelse{nehyph96.tex}
{\definefilesynonym[lang-nl.pat][nehyph96.tex]}
@@ -65,54 +67,54 @@
{\definefilesynonym[lang-nl.pat][nehyph.tex]}}
%D Pattern files are (can be) encoded! And, alas, not all
-%D pattern files are self contained, which is why (for the
-%D moment) we specify encodings here.
+%D pattern files are self contained, which is why (for the
+%D moment) we specify encodings here.
-\installlanguage [\s!cz] [\s!mapping={il2,ec},\s!encoding={il2,ec}]
-\installlanguage [\s!hr] [\s!mapping={il2,ec},\s!encoding={il2,ec}]
-%installlanguage [\s!pl] [\s!mapping=pl0,\s!encoding=pl0]
-\installlanguage [\s!pl] [\s!mapping={pl0,ec},\s!encoding={pl0,ec}]
-\installlanguage [\s!sk] [\s!mapping={il2,ec},\s!encoding={il2,ec}]
+\installlanguage [\s!cz] [\s!mapping={il2,ec},\s!encoding={il2,ec}]
+\installlanguage [\s!hr] [\s!mapping={il2,ec},\s!encoding={il2,ec}]
+%installlanguage [\s!pl] [\s!mapping=pl0,\s!encoding=pl0]
+\installlanguage [\s!pl] [\s!mapping={pl0,ec},\s!encoding={pl0,ec}]
+\installlanguage [\s!sk] [\s!mapping={il2,ec},\s!encoding={il2,ec}]
-%D Sometimes these are not wanted:
+%D Sometimes these are not wanted:
%\definefilesynonym [lang-deo.pat] [dehypht.tex] % old patterns
-%\definefilesynonym [lang-nlx.pat] [dutch96.pat] % new patterns
+%\definefilesynonym [lang-nlx.pat] [dutch96.pat] % new patterns
-%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.
+%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.
-% \installlanguage [\s!af] [\c!status=\v!start] % afrikaans
+% \installlanguage [\s!af] [\c!status=\v!start] % afrikaans
% \installlanguage [\s!cz] [\c!status=\v!start] % czech
-% \installlanguage [\s!da] [\c!status=\v!start] % danish
-% \installlanguage [\s!de] [\c!status=\v!start] % german
-% \installlanguage [\s!en] [\c!status=\v!start] % english us
-% \installlanguage [\s!es] [\c!status=\v!start] % spanish
+% \installlanguage [\s!da] [\c!status=\v!start] % danish
+% \installlanguage [\s!de] [\c!status=\v!start] % german
+% \installlanguage [\s!en] [\c!status=\v!start] % english us
+% \installlanguage [\s!es] [\c!status=\v!start] % spanish
% \installlanguage [\s!fi] [\c!status=\v!start] % finnish
-% \installlanguage [\s!fr] [\c!status=\v!start] % french
+% \installlanguage [\s!fr] [\c!status=\v!start] % french
% \installlanguage [\s!hr] [\c!status=\v!start] % croatian
-% \installlanguage [\s!hu] [\c!status=\v!start] % hungarian
-% \installlanguage [\s!it] [\c!status=\v!start] % italian
-% \installlanguage [\s!la] [\c!status=\v!start] % latin
-% \installlanguage [\s!nl] [\c!status=\v!start] % dutch
-% \installlanguage [\s!no] [\c!status=\v!start] % norwegian
+% \installlanguage [\s!hu] [\c!status=\v!start] % hungarian
+% \installlanguage [\s!it] [\c!status=\v!start] % italian
+% \installlanguage [\s!la] [\c!status=\v!start] % latin
+% \installlanguage [\s!nl] [\c!status=\v!start] % dutch
+% \installlanguage [\s!no] [\c!status=\v!start] % norwegian
% \installlanguage [\s!pl] [\c!status=\v!start] % polish
-% \installlanguage [\s!pt] [\c!status=\v!start] % portuguese
-% \installlanguage [\s!ro] [\c!status=\v!start] % romanian
-% \installlanguage [\s!ru] [\c!status=\v!start] % russian
+% \installlanguage [\s!pt] [\c!status=\v!start] % portuguese
+% \installlanguage [\s!ro] [\c!status=\v!start] % romanian
+% \installlanguage [\s!ru] [\c!status=\v!start] % russian
% \installlanguage [\s!sk] [\c!status=\v!start] % slovak
-% \installlanguage [\s!sv] [\c!status=\v!start] % swedish
-% \installlanguage [\s!tr] [\c!status=\v!start] % turkish
+% \installlanguage [\s!sv] [\c!status=\v!start] % swedish
+% \installlanguage [\s!tr] [\c!status=\v!start] % turkish
% \installlanguage [\s!ua] [\c!status=\v!start] % ukrainian
-% \installlanguage [\s!uk] [\c!status=\v!start] % english uk
+% \installlanguage [\s!uk] [\c!status=\v!start] % english uk
% \installlanguage [deo] [\c!status=\v!start] % old german
-% \installlanguage [nlx] [\c!status=\v!start] % dutch 8 bit
+% \installlanguage [nlx] [\c!status=\v!start] % dutch 8 bit
-%D The next lines can be used for setting the language to be
-%D used at startup time.
+%D The next lines can be used for setting the language to be
+%D used at startup time.
% \setupcurrentlanguage[\s!af]
% \setupcurrentlanguage[\s!cz]
@@ -137,23 +139,23 @@
% \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.
+%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.
-% \definefilesynonym [font-cmr] [font-csr] % czech & slovak
-% \definefilesynonym [font-cmr] [font-plr] % polish
+% \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.
+%D In some languages, compound characters, like \type {"e}
+%D are used to get accented and non latin characters.
- \useencoding[fde] % german
-% \useencoding[ffr] % french
+ \useencoding[fde] % german
+% \useencoding[ffr] % french
% \useencoding[fro] % romanian
-% \useencoding[fpl] % polish
+% \useencoding[fpl] % polish
-%D Don't remove the next few lines.
+%D Don't remove the next few lines.
-\protect \endinput
+\protect \endinput
diff --git a/tex/context/sample/bryson.tex b/tex/context/sample/bryson.tex
new file mode 100644
index 000000000..ecda71c58
--- /dev/null
+++ b/tex/context/sample/bryson.tex
@@ -0,0 +1,9 @@
+Imagine trying to live in a world dominated by dihydrogen oxide, a
+compound that has no taste or smell and is so viable in its properties
+that it is generally benign but at other times swiftly lethal.
+Depending on its state, it can scald you or freeze you. In the
+presence of certain organic molecules it can form carbonic acids so
+nasty that they can strip the leaves from trees and eat the faces off
+statuary. In bulk, when agitated, it can strike with a fury that no
+human edifice could withstand. Even for those who have learned to live
+with it, it is often murderous substance. We call it water. \ No newline at end of file
diff --git a/tex/context/sample/davis.tex b/tex/context/sample/davis.tex
new file mode 100644
index 000000000..8d45c9849
--- /dev/null
+++ b/tex/context/sample/davis.tex
@@ -0,0 +1,13 @@
+This nation, turning 100 years old, had no {\em Odyssey}, no
+St.~George slaying the dragon, no Prometheus. The emerging American
+genius for making a lot of money was a poor substitute for King
+Arthur and his knights (although the Horatio Alger myth of rags to
+riches was good for a lot of mileage). Without a mythology and set
+of ancient heroes to call its own, America had to manufacture its
+heroes. So the mythmaking machinery of nineteenth|-|century American
+media created a suitable heroic archetype in the cowboys of the Wild
+West. The image was of the undaunted cattle drivers living a life of
+reckless individualism, braving the elements, staving off brutal
+Indian attacks. Or of heroic lawmen dueling with six|-|guns in the
+streets at high noon. This artificial Wild West became America's
+Iliad. \ No newline at end of file
diff --git a/tex/context/sample/dawkins.tex b/tex/context/sample/dawkins.tex
index acb47b967..3490b79b0 100644
--- a/tex/context/sample/dawkins.tex
+++ b/tex/context/sample/dawkins.tex
@@ -13,8 +13,8 @@ tails. Obviously one side had to lose, and they were asked
to sit down. Then those who remained were divided into two,
with half \quote {willing} heads and the other half tails.
Again the losers sat down. And so on by successive halvings
-until, inevitably. after seven or eight tosses, one
+until, inevitably, after seven or eight tosses, one
individual was left standing. \quotation {A big round of
applause for our psychic.} He must be psychic, mustn't he,
because he successfully influenced the coin eight times in
-a row?
+a row? \ No newline at end of file
diff --git a/tex/context/sample/sample.tex b/tex/context/sample/sample.tex
new file mode 100644
index 000000000..6e18f08d5
--- /dev/null
+++ b/tex/context/sample/sample.tex
@@ -0,0 +1,29 @@
+\starttext
+
+The sample directory contains a few files with quotes that can be used
+while testing styles. I'll complete this file when I've reorganized my
+books and audio cd's.
+
+\starttabulate[|l|l|p|]
+\NC \bf file \NC \bf author \NC \bf source \NC \NR
+\HL
+%NC stork.tex \NC David F. Stork \NC \NC \NR
+\NC knuth.tex \NC Donald E. Knuth \NC \NC \NR
+\NC tufte.tex \NC Edward R. Tufte \NC \NC \NR
+\NC reich.tex \NC Steve Reich \NC \NC \NR
+\NC materie.tex \NC Louis Andriessen \NC De Materie \NC \NR
+\NC douglas.tex \NC Douglas R. Hofstadter \NC \NC \NR
+\NC dawkins.tex \NC Dawkins \NC \NC \NR
+\NC ward.tex \NC Peter D. Ward \NC The Life and Death of Planet Earth \NC \NR
+\NC zapf.tex \NC Hermann Zapf \NC About micro-typography and the hz-program, \endgraf
+ Electronic Publishing, vol. 6(3), \endgraf
+ 283-–288 (September 1993) \NC \NR
+\NC bryson.tex \NC Bill Bryson \NC A Short History of Nearly Everything, \endgraf
+ Random House, 2003 \NC \NR
+\NC davis.tex \NC Kenneth C. Davis \NC Don't Know Much About History, \endgraf
+ Everything You Need to Know About American
+ History but Never Learned, \endgraf
+ HarperCollins, 2003 \NC \NR
+\stoptabulate
+
+\stoptext \ No newline at end of file
diff --git a/tex/context/sample/ward.tex b/tex/context/sample/ward.tex
index 7d5c0196b..9922beb6e 100644
--- a/tex/context/sample/ward.tex
+++ b/tex/context/sample/ward.tex
@@ -1,5 +1,5 @@
-The Earth, as a habitat for animal life, is in old age and
+The Earth, as a habitat for animal life, is in old age and
has a fatal illness. Several, in fact. It would be happening
-whether humans has ever evolved or not. But our presence is
+whether humans has ever evolved or not. But our presence is
like the effect of an old|-|age patient who smokes many packs
-of cigarettes per day |.| and we humans are the cigarettes.
+of cigarettes per day |.| and we humans are the cigarettes. \ No newline at end of file