summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2003-04-22 00:00:00 +0200
committerHans Hagen <pragma@wxs.nl>2003-04-22 00:00:00 +0200
commit30ab0025913bb6e39e7cfd2c37b402083b1f7337 (patch)
treecb73415b1f5e397d6c2d81300d962405b5b27639 /tex
parent44a457e94e531de21ed9138035570e6fc23d9019 (diff)
downloadcontext-30ab0025913bb6e39e7cfd2c37b402083b1f7337.tar.gz
stable 2003.04.22
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/colo-ema.tex590
-rw-r--r--tex/context/base/colo-ini.tex8
-rw-r--r--tex/context/base/colo-run.tex11
-rw-r--r--tex/context/base/colo-xwi.tex142
-rw-r--r--tex/context/base/cont-new.tex254
-rw-r--r--tex/context/base/context.tex2
-rw-r--r--tex/context/base/core-box.tex5
-rw-r--r--tex/context/base/core-buf.tex4
-rw-r--r--tex/context/base/core-con.tex6
-rw-r--r--tex/context/base/core-fig.tex29
-rw-r--r--tex/context/base/core-grd.tex84
-rw-r--r--tex/context/base/core-int.tex36
-rw-r--r--tex/context/base/core-lst.tex6
-rw-r--r--tex/context/base/core-mak.tex3
-rw-r--r--tex/context/base/core-mat.tex384
-rw-r--r--tex/context/base/core-mis.tex2
-rw-r--r--tex/context/base/core-obj.tex85
-rw-r--r--tex/context/base/core-pos.tex127
-rw-r--r--tex/context/base/core-ref.tex89
-rw-r--r--tex/context/base/core-rul.tex6
-rw-r--r--tex/context/base/core-sec.tex61
-rw-r--r--tex/context/base/core-spa.tex375
-rw-r--r--tex/context/base/core-tab.tex4
-rw-r--r--tex/context/base/core-tbl.tex4
-rw-r--r--tex/context/base/core-ver.tex40
-rw-r--r--tex/context/base/enco-ini.tex85
-rw-r--r--tex/context/base/lang-grk.tex85
-rw-r--r--tex/context/base/m-plus.tex2
-rw-r--r--tex/context/base/math-eul.tex184
-rw-r--r--tex/context/base/math-lbr.tex2
-rw-r--r--tex/context/base/meta-dum.tex113
-rw-r--r--tex/context/base/meta-ini.tex38
-rw-r--r--tex/context/base/meta-nav.tex65
-rw-r--r--tex/context/base/meta-pag.tex13
-rw-r--r--tex/context/base/mult-com.tex26
-rw-r--r--tex/context/base/mult-con.tex18
-rw-r--r--tex/context/base/mult-sys.tex2
-rw-r--r--tex/context/base/page-flt.tex291
-rw-r--r--tex/context/base/page-ini.tex2
-rw-r--r--tex/context/base/page-lay.tex5
-rw-r--r--tex/context/base/page-mar.tex49
-rw-r--r--tex/context/base/page-mul.tex19
-rw-r--r--tex/context/base/page-new.tex2
-rw-r--r--tex/context/base/page-one.tex77
-rw-r--r--tex/context/base/page-set.tex801
-rw-r--r--tex/context/base/page-sid.tex581
-rw-r--r--tex/context/base/s-mag-01.tex2
-rw-r--r--tex/context/base/s-map-01.tex4
-rw-r--r--tex/context/base/setupb.tex14
-rw-r--r--tex/context/base/setupe.tex11
-rw-r--r--tex/context/base/spec-def.tex11
-rw-r--r--tex/context/base/spec-fdf.tex227
-rw-r--r--tex/context/base/spec-tpd.tex94
-rw-r--r--tex/context/base/supp-box.tex20
-rw-r--r--tex/context/base/supp-emp.tex28
-rw-r--r--tex/context/base/supp-fun.tex35
-rw-r--r--tex/context/base/supp-mps.tex8
-rw-r--r--tex/context/base/supp-num.tex2
-rw-r--r--tex/context/base/supp-pdf.tex6
-rw-r--r--tex/context/base/syst-gen.tex21
-rw-r--r--tex/context/base/type-buy.tex44
-rw-r--r--tex/context/base/type-enc.tex148
-rw-r--r--tex/context/base/unic-ini.tex15
-rw-r--r--tex/context/base/x-res-04.tex9
-rw-r--r--tex/context/base/x-res-09.tex5
-rw-r--r--tex/context/base/x-sch-01.tex2
-rw-r--r--tex/context/base/x-xml-01.tex12
-rw-r--r--tex/context/base/xtag-pre.tex2
-rw-r--r--tex/context/base/xtag-run.tex20
-rw-r--r--tex/latex/context/m-ch-de.sty2
-rw-r--r--tex/latex/context/m-ch-en.sty2
-rw-r--r--tex/latex/context/m-ch-nl.sty2
-rw-r--r--tex/latex/context/m-metapo.sty2
-rw-r--r--tex/latex/context/m-pictex.sty2
74 files changed, 3638 insertions, 1929 deletions
diff --git a/tex/context/base/colo-ema.tex b/tex/context/base/colo-ema.tex
new file mode 100644
index 000000000..e5e90b235
--- /dev/null
+++ b/tex/context/base/colo-ema.tex
@@ -0,0 +1,590 @@
+%D \module
+%D [ file=colo-ema,
+%D version=2003.03.20,
+%D title=\CONTEXT\ Color Macros,
+%D subtitle=Emacs Colors,
+%D author=Peter Rolf,
+%D date=\currentdate,
+%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.
+
+% author : Peter Rolf <peter.rolf@arcor.de>
+% last change : 17 march 2003
+% origin : /emacs/etc/rgb.txt
+%
+% USAGE:
+%
+% - select emacs menu: Edit -> Text Properties -> Display
+% Colors, if you don't know what I'm talking about
+% - copy this file to your /texmf/tex/context/user directory
+% and add "\input colo-emacs" to your tex-file
+%
+% IMPORTANT NOTES:
+%
+% - all color names are written as ONE word in lowercase
+% letters (no redundancy as in rgb.txt) so if you want to
+% use the color "Light Sky Blue"/"light sky blue" it's new
+% name is lightskyblue
+% - the grayX values [X=0..100] can only be used with \color
+% [grayX]
+% - use it at your own risk :)
+%
+% HINT:
+%
+% I only include this file (\showcolor [ema]) until I've
+% found the colors I want. Copy and paste the color
+% definitions to a seperate file, to decrease compilation
+% time (540 color definitions).
+
+\definecolor [snow] [r=1,g=.980392,b=.980392]
+\definecolor [ghostwhite] [r=.972549,g=.972549,b=1]
+\definecolor [whitesmoke] [s=.960784]
+\definecolor [gainsboro] [s=.862745]
+\definecolor [floralwhite] [r=1,g=.980392,b=.941176]
+\definecolor [oldlace] [r=.992157,g=.960784,b=.901961]
+\definecolor [linen] [r=.980392,g=.941176,b=.901961]
+\definecolor [antiquewhite] [r=.980392,g=.921569,b=.843137]
+\definecolor [papayawhip] [r=1,g=.937255,b=.835294]
+\definecolor [blanchedalmond] [r=1,g=.921569,b=.803922]
+\definecolor [bisque] [r=1,g=.894118,b=.768627]
+\definecolor [peachpuff] [r=1,g=.854902,b=.72549]
+\definecolor [navajowhite] [r=1,g=.870588,b=.678431]
+\definecolor [moccasin] [r=1,g=.894118,b=.709804]
+\definecolor [cornsilk] [r=1,g=.972549,b=.862745]
+\definecolor [ivory] [r=1,g=1,b=.941176]
+\definecolor [lemonchiffon] [r=1,g=.980392,b=.803922]
+\definecolor [seashell] [r=1,g=.960784,b=.933333]
+\definecolor [honeydew] [r=.941176,g=1,b=.941176]
+\definecolor [mintcream] [r=.960784,g=1,b=.980392]
+\definecolor [azure] [r=.941176,g=1,b=1]
+\definecolor [aliceblue] [r=.941176,g=.972549,b=1]
+\definecolor [lavender] [r=.901961,g=.901961,b=.980392]
+\definecolor [lavenderblush] [r=1,g=.941176,b=.960784]
+\definecolor [mistyrose] [r=1,g=.894118,b=.882353]
+%definecolor[white] [s=1]
+%definecolor[black] [s=0]
+\definecolor [darkslategray] [r=.184314,g=.309804,b=.309804]
+\definecolor [dimgray] [s=.411765]
+\definecolor [slategray] [r=.439216,g=.501961,b=.564706]
+\definecolor [lightslategray] [r=.466667,g=.533333,b=.6]
+\definecolor [gray] [s=.745098]
+\definecolor [lightgray] [s=.827451]
+\definecolor [midnightblue] [r=.098039,g=.098039,b=.439216]
+\definecolor [navy] [b=.501961]
+\definecolor [navyblue] [navy]
+\definecolor [cornflowerblue] [r=.392157,g=.584314,b=.929412]
+\definecolor [darkslateblue] [r=.282353,g=.239216,b=.545098]
+\definecolor [slateblue] [r=.415686,g=.352941,b=.803922]
+\definecolor [mediumslateblue] [r=.482353,g=.407843,b=.933333]
+\definecolor [lightslateblue] [r=.517647,g=.439216,b=1]
+\definecolor [mediumblue] [b=.803922]
+\definecolor [royalblue] [r=.254902,g=.411765,b=.882353]
+%definecolor[blue] [b=1]
+\definecolor [dodgerblue] [r=.117647,g=.564706,b=1]
+\definecolor [deepskyblue] [g=.74902,b=1]
+\definecolor [skyblue] [r=.529412,g=.807843,b=.921569]
+\definecolor [lightskyblue] [r=.529412,g=.807843,b=.980392]
+\definecolor [steelblue] [r=.27451,g=.509804,b=.705882]
+\definecolor [lightsteelblue] [r=.690196,g=.768627,b=.870588]
+\definecolor [lightblue] [r=.678431,g=.847059,b=.901961]
+\definecolor [powderblue] [r=.690196,g=.878431,b=.901961]
+\definecolor [paleturquoise] [r=.686275,g=.933333,b=.933333]
+\definecolor [darkturquoise] [g=.807843,b=.819608]
+\definecolor [mediumturquoise] [r=.282353,g=.819608,b=.8]
+\definecolor [turquoise] [r=.25098,g=.878431,b=.815686]
+%definecolor[cyan] [g=1,b=1]
+\definecolor [lightcyan] [r=.878431,g=1,b=1]
+\definecolor [cadetblue] [r=.372549,g=.619608,b=.627451]
+\definecolor [mediumaquamarine] [r=.4,g=.803922,b=.666667]
+\definecolor [aquamarine] [r=.498039,g=1,b=.831373]
+\definecolor [darkgreen] [g=.392157]
+\definecolor [darkolivegreen] [r=.333333,g=.419608,b=.184314]
+\definecolor [darkseagreen] [r=.560784,g=.737255,b=.560784]
+\definecolor [seagreen] [r=.180392,g=.545098,b=.341176]
+\definecolor [mediumseagreen] [r=.235294,g=.701961,b=.443137]
+\definecolor [lightseagreen] [r=.12549,g=.698039,b=.666667]
+\definecolor [palegreen] [r=.596078,g=.984314,b=.596078]
+\definecolor [springgreen] [g=1,b=.498039]
+\definecolor [lawngreen] [r=.486275,g=.988235]
+%definecolor[green] [g=1]
+\definecolor [chartreuse] [r=.498039,g=1]
+\definecolor [mediumspringgreen] [g=.980392,b=.603922]
+\definecolor [greenyellow] [r=.678431,g=1,b=.184314]
+\definecolor [limegreen] [r=.196078,g=.803922,b=.196078]
+\definecolor [yellowgreen] [r=.603922,g=.803922,b=.196078]
+\definecolor [forestgreen] [r=.133333,g=.545098,b=.133333]
+\definecolor [olivedrab] [r=.419608,g=.556863,b=.137255]
+\definecolor [darkkhaki] [r=.741176,g=.717647,b=.419608]
+\definecolor [khaki] [r=.941176,g=.901961,b=.54902]
+\definecolor [palegoldenrod] [r=.933333,g=.909804,b=.666667]
+\definecolor [lightgoldenrodyellow] [r=.980392,g=.980392,b=.823529]
+\definecolor [lightyellow] [r=1,g=1,b=.878431]
+%definecolor[yellow] [r=1,g=1]
+\definecolor [gold] [r=1,g=.843137]
+\definecolor [lightgoldenrod] [r=.933333,g=.866667,b=.509804]
+\definecolor [goldenrod] [r=.854902,g=.647059,b=.12549]
+\definecolor [darkgoldenrod] [r=.721569,g=.52549,b=.043137]
+\definecolor [rosybrown] [r=.737255,g=.560784,b=.560784]
+\definecolor [indianred] [r=.803922,g=.360784,b=.360784]
+\definecolor [saddlebrown] [r=.545098,g=.270588,b=.07451]
+\definecolor [sienna] [r=.627451,g=.321569,b=.176471]
+\definecolor [peru] [r=.803922,g=.521569,b=.247059]
+\definecolor [burlywood] [r=.870588,g=.721569,b=.529412]
+\definecolor [beige] [r=.960784,g=.960784,b=.862745]
+\definecolor [wheat] [r=.960784,g=.870588,b=.701961]
+\definecolor [sandybrown] [r=.956863,g=.643137,b=.376471]
+\definecolor [tan] [r=.823529,g=.705882,b=.54902]
+\definecolor [chocolate] [r=.823529,g=.411765,b=.117647]
+\definecolor [firebrick] [r=.698039,g=.133333,b=.133333]
+\definecolor [brown] [r=.647059,g=.164706,b=.164706]
+\definecolor [darksalmon] [r=.913725,g=.588235,b=.478431]
+\definecolor [salmon] [r=.980392,g=.501961,b=.447059]
+\definecolor [lightsalmon] [r=1,g=.627451,b=.478431]
+\definecolor [orange] [r=1,g=.647059]
+\definecolor [darkorange] [r=1,g=.54902]
+\definecolor [coral] [r=1,g=.498039,b=.313725]
+\definecolor [lightcoral] [r=.941176,g=.501961,b=.501961]
+\definecolor [tomato] [r=1,g=.388235,b=.278431]
+\definecolor [orangered] [r=1,g=.270588]
+%definecolor[red] [r=1]
+\definecolor [hotpink] [r=1,g=.411765,b=.705882]
+\definecolor [deeppink] [r=1,g=.078431,b=.576471]
+\definecolor [pink] [r=1,g=.752941,b=.796078]
+\definecolor [lightpink] [r=1,g=.713725,b=.756863]
+\definecolor [palevioletred] [r=.858824,g=.439216,b=.576471]
+\definecolor [maroon] [r=.690196,g=.188235,b=.376471]
+\definecolor [mediumvioletred] [r=.780392,g=.082353,b=.521569]
+\definecolor [violetred] [r=.815686,g=.12549,b=.564706]
+%definecolor[magenta] [r=1,b=1]
+\definecolor [violet] [r=.933333,g=.509804,b=.933333]
+\definecolor [plum] [r=.866667,g=.627451,b=.866667]
+\definecolor [orchid] [r=.854902,g=.439216,b=.839216]
+\definecolor [mediumorchid] [r=.729412,g=.333333,b=.827451]
+\definecolor [darkorchid] [r=.6,g=.196078,b=.8]
+\definecolor [darkviolet] [r=.580392,b=.827451]
+\definecolor [blueviolet] [r=.541176,g=.168627,b=.886275]
+\definecolor [purple] [r=.627451,g=.12549,b=.941176]
+\definecolor [mediumpurple] [r=.576471,g=.439216,b=.858824]
+\definecolor [thistle] [r=.847059,g=.74902,b=.847059]
+\definecolor [snow1] [r=1,g=.980392,b=.980392]
+\definecolor [snow2] [r=.933333,g=.913725,b=.913725]
+\definecolor [snow3] [r=.803922,g=.788235,b=.788235]
+\definecolor [snow4] [r=.545098,g=.537255,b=.537255]
+\definecolor [seashell1] [r=1,g=.960784,b=.933333]
+\definecolor [seashell2] [r=.933333,g=.898039,b=.870588]
+\definecolor [seashell3] [r=.803922,g=.772549,b=.74902]
+\definecolor [seashell4] [r=.545098,g=.52549,b=.509804]
+\definecolor [antiquewhite1] [r=1,g=.937255,b=.858824]
+\definecolor [antiquewhite2] [r=.933333,g=.87451,b=.8]
+\definecolor [antiquewhite3] [r=.803922,g=.752941,b=.690196]
+\definecolor [antiquewhite4] [r=.545098,g=.513725,b=.470588]
+\definecolor [bisque1] [r=1,g=.894118,b=.768627]
+\definecolor [bisque2] [r=.933333,g=.835294,b=.717647]
+\definecolor [bisque3] [r=.803922,g=.717647,b=.619608]
+\definecolor [bisque4] [r=.545098,g=.490196,b=.419608]
+\definecolor [peachpuff1] [r=1,g=.854902,b=.72549]
+\definecolor [peachpuff2] [r=.933333,g=.796078,b=.678431]
+\definecolor [peachpuff3] [r=.803922,g=.686275,b=.584314]
+\definecolor [peachpuff4] [r=.545098,g=.466667,b=.396078]
+\definecolor [navajowhite1] [r=1,g=.870588,b=.678431]
+\definecolor [navajowhite2] [r=.933333,g=.811765,b=.631373]
+\definecolor [navajowhite3] [r=.803922,g=.701961,b=.545098]
+\definecolor [navajowhite4] [r=.545098,g=.47451,b=.368627]
+\definecolor [lemonchiffon1] [r=1,g=.980392,b=.803922]
+\definecolor [lemonchiffon2] [r=.933333,g=.913725,b=.74902]
+\definecolor [lemonchiffon3] [r=.803922,g=.788235,b=.647059]
+\definecolor [lemonchiffon4] [r=.545098,g=.537255,b=.439216]
+\definecolor [cornsilk1] [r=1,g=.972549,b=.862745]
+\definecolor [cornsilk2] [r=.933333,g=.909804,b=.803922]
+\definecolor [cornsilk3] [r=.803922,g=.784314,b=.694118]
+\definecolor [cornsilk4] [r=.545098,g=.533333,b=.470588]
+\definecolor [ivory1] [r=1,g=1,b=.941176]
+\definecolor [ivory2] [r=.933333,g=.933333,b=.878431]
+\definecolor [ivory3] [r=.803922,g=.803922,b=.756863]
+\definecolor [ivory4] [r=.545098,g=.545098,b=.513725]
+\definecolor [honeydew1] [r=.941176,g=1,b=.941176]
+\definecolor [honeydew2] [r=.878431,g=.933333,b=.878431]
+\definecolor [honeydew3] [r=.756863,g=.803922,b=.756863]
+\definecolor [honeydew4] [r=.513725,g=.545098,b=.513725]
+\definecolor [lavenderblush1] [r=1,g=.941176,b=.960784]
+\definecolor [lavenderblush2] [r=.933333,g=.878431,b=.898039]
+\definecolor [lavenderblush3] [r=.803922,g=.756863,b=.772549]
+\definecolor [lavenderblush4] [r=.545098,g=.513725,b=.52549]
+\definecolor [mistyrose1] [r=1,g=.894118,b=.882353]
+\definecolor [mistyrose2] [r=.933333,g=.835294,b=.823529]
+\definecolor [mistyrose3] [r=.803922,g=.717647,b=.709804]
+\definecolor [mistyrose4] [r=.545098,g=.490196,b=.482353]
+\definecolor [azure1] [r=.941176,g=1,b=1]
+\definecolor [azure2] [r=.878431,g=.933333,b=.933333]
+\definecolor [azure3] [r=.756863,g=.803922,b=.803922]
+\definecolor [azure4] [r=.513725,g=.545098,b=.545098]
+\definecolor [slateblue1] [r=.513725,g=.435294,b=1]
+\definecolor [slateblue2] [r=.478431,g=.403922,b=.933333]
+\definecolor [slateblue3] [r=.411765,g=.34902,b=.803922]
+\definecolor [slateblue4] [r=.278431,g=.235294,b=.545098]
+\definecolor [royalblue1] [r=.282353,g=.462745,b=1]
+\definecolor [royalblue2] [r=.262745,g=.431373,b=.933333]
+\definecolor [royalblue3] [r=.227451,g=.372549,b=.803922]
+\definecolor [royalblue4] [r=.152941,g=.25098,b=.545098]
+\definecolor [blue1] [blue]
+\definecolor [blue2] [b=.933333]
+\definecolor [blue3] [b=.803922]
+\definecolor [blue4] [b=.545098]
+\definecolor [dodgerblue1] [r=.117647,g=.564706,b=1]
+\definecolor [dodgerblue2] [r=.109804,g=.52549,b=.933333]
+\definecolor [dodgerblue3] [r=.094118,g=.454902,b=.803922]
+\definecolor [dodgerblue4] [r=.062745,g=.305882,b=.545098]
+\definecolor [steelblue1] [r=.388235,g=.721569,b=1]
+\definecolor [steelblue2] [r=.360784,g=.67451,b=.933333]
+\definecolor [steelblue3] [r=.309804,g=.580392,b=.803922]
+\definecolor [steelblue4] [r=.211765,g=.392157,b=.545098]
+\definecolor [deepskyblue1] [g=.74902,b=1]
+\definecolor [deepskyblue2] [g=.698039,b=.933333]
+\definecolor [deepskyblue3] [g=.603922,b=.803922]
+\definecolor [deepskyblue4] [g=.407843,b=.545098]
+\definecolor [skyblue1] [r=.529412,g=.807843,b=1]
+\definecolor [skyblue2] [r=.494118,g=.752941,b=.933333]
+\definecolor [skyblue3] [r=.423529,g=.65098,b=.803922]
+\definecolor [skyblue4] [r=.290196,g=.439216,b=.545098]
+\definecolor [lightskyblue1] [r=.690196,g=.886275,b=1]
+\definecolor [lightskyblue2] [r=.643137,g=.827451,b=.933333]
+\definecolor [lightskyblue3] [r=.552941,g=.713725,b=.803922]
+\definecolor [lightskyblue4] [r=.376471,g=.482353,b=.545098]
+\definecolor [slategray1] [r=.776471,g=.886275,b=1]
+\definecolor [slategray2] [r=.72549,g=.827451,b=.933333]
+\definecolor [slategray3] [r=.623529,g=.713725,b=.803922]
+\definecolor [slategray4] [r=.423529,g=.482353,b=.545098]
+\definecolor [lightsteelblue1] [r=.792157,g=.882353,b=1]
+\definecolor [lightsteelblue2] [r=.737255,g=.823529,b=.933333]
+\definecolor [lightsteelblue3] [r=.635294,g=.709804,b=.803922]
+\definecolor [lightsteelblue4] [r=.431373,g=.482353,b=.545098]
+\definecolor [lightblue1] [r=.74902,g=.937255,b=1]
+\definecolor [lightblue2] [r=.698039,g=.87451,b=.933333]
+\definecolor [lightblue3] [r=.603922,g=.752941,b=.803922]
+\definecolor [lightblue4] [r=.407843,g=.513725,b=.545098]
+\definecolor [lightcyan1] [r=.878431,g=1,b=1]
+\definecolor [lightcyan2] [r=.819608,g=.933333,b=.933333]
+\definecolor [lightcyan3] [r=.705882,g=.803922,b=.803922]
+\definecolor [lightcyan4] [r=.478431,g=.545098,b=.545098]
+\definecolor [paleturquoise1] [r=.733333,g=1,b=1]
+\definecolor [paleturquoise2] [r=.682353,g=.933333,b=.933333]
+\definecolor [paleturquoise3] [r=.588235,g=.803922,b=.803922]
+\definecolor [paleturquoise4] [r=.4,g=.545098,b=.545098]
+\definecolor [cadetblue1] [r=.596078,g=.960784,b=1]
+\definecolor [cadetblue2] [r=.556863,g=.898039,b=.933333]
+\definecolor [cadetblue3] [r=.478431,g=.772549,b=.803922]
+\definecolor [cadetblue4] [r=.32549,g=.52549,b=.545098]
+\definecolor [turquoise1] [g=.960784,b=1]
+\definecolor [turquoise2] [g=.898039,b=.933333]
+\definecolor [turquoise3] [g=.772549,b=.803922]
+\definecolor [turquoise4] [g=.52549,b=.545098]
+\definecolor [cyan1] [cyan]
+\definecolor [cyan2] [g=.933333,b=.933333]
+\definecolor [cyan3] [g=.803922,b=.803922]
+\definecolor [cyan4] [g=.545098,b=.545098]
+\definecolor [darkslategray1] [r=.592157,g=1,b=1]
+\definecolor [darkslategray2] [r=.552941,g=.933333,b=.933333]
+\definecolor [darkslategray3] [r=.47451,g=.803922,b=.803922]
+\definecolor [darkslategray4] [r=.321569,g=.545098,b=.545098]
+\definecolor [aquamarine1] [r=.498039,g=1,b=.831373]
+\definecolor [aquamarine2] [r=.462745,g=.933333,b=.776471]
+\definecolor [aquamarine3] [r=.4,g=.803922,b=.666667]
+\definecolor [aquamarine4] [r=.270588,g=.545098,b=.454902]
+\definecolor [darkseagreen1] [r=.756863,g=1,b=.756863]
+\definecolor [darkseagreen2] [r=.705882,g=.933333,b=.705882]
+\definecolor [darkseagreen3] [r=.607843,g=.803922,b=.607843]
+\definecolor [darkseagreen4] [r=.411765,g=.545098,b=.411765]
+\definecolor [seagreen1] [r=.329412,g=1,b=.623529]
+\definecolor [seagreen2] [r=.305882,g=.933333,b=.580392]
+\definecolor [seagreen3] [r=.262745,g=.803922,b=.501961]
+\definecolor [seagreen4] [r=.180392,g=.545098,b=.341176]
+\definecolor [palegreen1] [r=.603922,g=1,b=.603922]
+\definecolor [palegreen2] [r=.564706,g=.933333,b=.564706]
+\definecolor [palegreen3] [r=.486275,g=.803922,b=.486275]
+\definecolor [palegreen4] [r=.329412,g=.545098,b=.329412]
+\definecolor [springgreen1] [g=1,b=.498039]
+\definecolor [springgreen2] [g=.933333,b=.462745]
+\definecolor [springgreen3] [g=.803922,b=.4]
+\definecolor [springgreen4] [g=.545098,b=.270588]
+\definecolor [green1] [green]
+\definecolor [green2] [g=.933333]
+\definecolor [green3] [g=.803922]
+\definecolor [green4] [g=.545098]
+\definecolor [chartreuse1] [r=.498039,g=1]
+\definecolor [chartreuse2] [r=.462745,g=.933333]
+\definecolor [chartreuse3] [r=.4,g=.803922]
+\definecolor [chartreuse4] [r=.270588,g=.545098]
+\definecolor [olivedrab1] [r=.752941,g=1,b=.243137]
+\definecolor [olivedrab2] [r=.701961,g=.933333,b=.227451]
+\definecolor [olivedrab3] [r=.603922,g=.803922,b=.196078]
+\definecolor [olivedrab4] [r=.411765,g=.545098,b=.133333]
+\definecolor [darkolivegreen1] [r=.792157,g=1,b=.439216]
+\definecolor [darkolivegreen2] [r=.737255,g=.933333,b=.407843]
+\definecolor [darkolivegreen3] [r=.635294,g=.803922,b=.352941]
+\definecolor [darkolivegreen4] [r=.431373,g=.545098,b=.239216]
+\definecolor [khaki1] [r=1,g=.964706,b=.560784]
+\definecolor [khaki2] [r=.933333,g=.901961,b=.521569]
+\definecolor [khaki3] [r=.803922,g=.776471,b=.45098]
+\definecolor [khaki4] [r=.545098,g=.52549,b=.305882]
+\definecolor [lightgoldenrod1] [r=1,g=.92549,b=.545098]
+\definecolor [lightgoldenrod2] [r=.933333,g=.862745,b=.509804]
+\definecolor [lightgoldenrod3] [r=.803922,g=.745098,b=.439216]
+\definecolor [lightgoldenrod4] [r=.545098,g=.505882,b=.298039]
+\definecolor [lightyellow1] [r=1,g=1,b=.878431]
+\definecolor [lightyellow2] [r=.933333,g=.933333,b=.819608]
+\definecolor [lightyellow3] [r=.803922,g=.803922,b=.705882]
+\definecolor [lightyellow4] [r=.545098,g=.545098,b=.478431]
+\definecolor [yellow1] [yellow]
+\definecolor [yellow2] [r=.933333,g=.933333]
+\definecolor [yellow3] [r=.803922,g=.803922]
+\definecolor [yellow4] [r=.545098,g=.545098]
+\definecolor [gold1] [r=1,g=.843137]
+\definecolor [gold2] [r=.933333,g=.788235]
+\definecolor [gold3] [r=.803922,g=.678431]
+\definecolor [gold4] [r=.545098,g=.458824]
+\definecolor [goldenrod1] [r=1,g=.756863,b=.145098]
+\definecolor [goldenrod2] [r=.933333,g=.705882,b=.133333]
+\definecolor [goldenrod3] [r=.803922,g=.607843,b=.113725]
+\definecolor [goldenrod4] [r=.545098,g=.411765,b=.078431]
+\definecolor [darkgoldenrod1] [r=1,g=.72549,b=.058824]
+\definecolor [darkgoldenrod2] [r=.933333,g=.678431,b=.054902]
+\definecolor [darkgoldenrod3] [r=.803922,g=.584314,b=.047059]
+\definecolor [darkgoldenrod4] [r=.545098,g=.396078,b=.031373]
+\definecolor [rosybrown1] [r=1,g=.756863,b=.756863]
+\definecolor [rosybrown2] [r=.933333,g=.705882,b=.705882]
+\definecolor [rosybrown3] [r=.803922,g=.607843,b=.607843]
+\definecolor [rosybrown4] [r=.545098,g=.411765,b=.411765]
+\definecolor [indianred1] [r=1,g=.415686,b=.415686]
+\definecolor [indianred2] [r=.933333,g=.388235,b=.388235]
+\definecolor [indianred3] [r=.803922,g=.333333,b=.333333]
+\definecolor [indianred4] [r=.545098,g=.227451,b=.227451]
+\definecolor [sienna1] [r=1,g=.509804,b=.278431]
+\definecolor [sienna2] [r=.933333,g=.47451,b=.258824]
+\definecolor [sienna3] [r=.803922,g=.407843,b=.223529]
+\definecolor [sienna4] [r=.545098,g=.278431,b=.14902]
+\definecolor [burlywood1] [r=1,g=.827451,b=.607843]
+\definecolor [burlywood2] [r=.933333,g=.772549,b=.568627]
+\definecolor [burlywood3] [r=.803922,g=.666667,b=.490196]
+\definecolor [burlywood4] [r=.545098,g=.45098,b=.333333]
+\definecolor [wheat1] [r=1,g=.905882,b=.729412]
+\definecolor [wheat2] [r=.933333,g=.847059,b=.682353]
+\definecolor [wheat3] [r=.803922,g=.729412,b=.588235]
+\definecolor [wheat4] [r=.545098,g=.494118,b=.4]
+\definecolor [tan1] [r=1,g=.647059,b=.309804]
+\definecolor [tan2] [r=.933333,g=.603922,b=.286275]
+\definecolor [tan3] [r=.803922,g=.521569,b=.247059]
+\definecolor [tan4] [r=.545098,g=.352941,b=.168627]
+\definecolor [chocolate1] [r=1,g=.498039,b=.141176]
+\definecolor [chocolate2] [r=.933333,g=.462745,b=.129412]
+\definecolor [chocolate3] [r=.803922,g=.4,b=.113725]
+\definecolor [chocolate4] [r=.545098,g=.270588,b=.07451]
+\definecolor [firebrick1] [r=1,g=.188235,b=.188235]
+\definecolor [firebrick2] [r=.933333,g=.172549,b=.172549]
+\definecolor [firebrick3] [r=.803922,g=.14902,b=.14902]
+\definecolor [firebrick4] [r=.545098,g=.101961,b=.101961]
+\definecolor [brown1] [r=1,g=.25098,b=.25098]
+\definecolor [brown2] [r=.933333,g=.231373,b=.231373]
+\definecolor [brown3] [r=.803922,g=.2,b=.2]
+\definecolor [brown4] [r=.545098,g=.137255,b=.137255]
+\definecolor [salmon1] [r=1,g=.54902,b=.411765]
+\definecolor [salmon2] [r=.933333,g=.509804,b=.384314]
+\definecolor [salmon3] [r=.803922,g=.439216,b=.329412]
+\definecolor [salmon4] [r=.545098,g=.298039,b=.223529]
+\definecolor [lightsalmon1] [r=1,g=.627451,b=.478431]
+\definecolor [lightsalmon2] [r=.933333,g=.584314,b=.447059]
+\definecolor [lightsalmon3] [r=.803922,g=.505882,b=.384314]
+\definecolor [lightsalmon4] [r=.545098,g=.341176,b=.258824]
+\definecolor [orange1] [r=1,g=.647059]
+\definecolor [orange2] [r=.933333,g=.603922]
+\definecolor [orange3] [r=.803922,g=.521569]
+\definecolor [orange4] [r=.545098,g=.352941]
+\definecolor [darkorange1] [r=1,g=.498039]
+\definecolor [darkorange2] [r=.933333,g=.462745]
+\definecolor [darkorange3] [r=.803922,g=.4]
+\definecolor [darkorange4] [r=.545098,g=.270588]
+\definecolor [coral1] [r=1,g=.447059,b=.337255]
+\definecolor [coral2] [r=.933333,g=.415686,b=.313725]
+\definecolor [coral3] [r=.803922,g=.356863,b=.270588]
+\definecolor [coral4] [r=.545098,g=.243137,b=.184314]
+\definecolor [tomato1] [r=1,g=.388235,b=.278431]
+\definecolor [tomato2] [r=.933333,g=.360784,b=.258824]
+\definecolor [tomato3] [r=.803922,g=.309804,b=.223529]
+\definecolor [tomato4] [r=.545098,g=.211765,b=.14902]
+\definecolor [orangered1] [r=1,g=.270588]
+\definecolor [orangered2] [r=.933333,g=.25098]
+\definecolor [orangered3] [r=.803922,g=.215686]
+\definecolor [orangered4] [r=.545098,g=.145098]
+\definecolor [red1] [red]
+\definecolor [red2] [r=.933333]
+\definecolor [red3] [r=.803922]
+\definecolor [red4] [r=.545098]
+\definecolor [deeppink1] [r=1,g=.078431,b=.576471]
+\definecolor [deeppink2] [r=.933333,g=.070588,b=.537255]
+\definecolor [deeppink3] [r=.803922,g=.062745,b=.462745]
+\definecolor [deeppink4] [r=.545098,g=.039216,b=.313725]
+\definecolor [hotpink1] [r=1,g=.431373,b=.705882]
+\definecolor [hotpink2] [r=.933333,g=.415686,b=.654902]
+\definecolor [hotpink3] [r=.803922,g=.376471,b=.564706]
+\definecolor [hotpink4] [r=.545098,g=.227451,b=.384314]
+\definecolor [pink1] [r=1,g=.709804,b=.772549]
+\definecolor [pink2] [r=.933333,g=.662745,b=.721569]
+\definecolor [pink3] [r=.803922,g=.568627,b=.619608]
+\definecolor [pink4] [r=.545098,g=.388235,b=.423529]
+\definecolor [lightpink1] [r=1,g=.682353,b=.72549]
+\definecolor [lightpink2] [r=.933333,g=.635294,b=.678431]
+\definecolor [lightpink3] [r=.803922,g=.54902,b=.584314]
+\definecolor [lightpink4] [r=.545098,g=.372549,b=.396078]
+\definecolor [palevioletred1] [r=1,g=.509804,b=.670588]
+\definecolor [palevioletred2] [r=.933333,g=.47451,b=.623529]
+\definecolor [palevioletred3] [r=.803922,g=.407843,b=.537255]
+\definecolor [palevioletred4] [r=.545098,g=.278431,b=.364706]
+\definecolor [maroon1] [r=1,g=.203922,b=.701961]
+\definecolor [maroon2] [r=.933333,g=.188235,b=.654902]
+\definecolor [maroon3] [r=.803922,g=.160784,b=.564706]
+\definecolor [maroon4] [r=.545098,g=.109804,b=.384314]
+\definecolor [violetred1] [r=1,g=.243137,b=.588235]
+\definecolor [violetred2] [r=.933333,g=.227451,b=.54902]
+\definecolor [violetred3] [r=.803922,g=.196078,b=.470588]
+\definecolor [violetred4] [r=.545098,g=.133333,b=.321569]
+\definecolor [magenta1] [magenta]
+\definecolor [magenta2] [r=.933333,b=.933333]
+\definecolor [magenta3] [r=.803922,b=.803922]
+\definecolor [magenta4] [r=.545098,b=.545098]
+\definecolor [orchid1] [r=1,g=.513725,b=.980392]
+\definecolor [orchid2] [r=.933333,g=.478431,b=.913725]
+\definecolor [orchid3] [r=.803922,g=.411765,b=.788235]
+\definecolor [orchid4] [r=.545098,g=.278431,b=.537255]
+\definecolor [plum1] [r=1,g=.733333,b=1]
+\definecolor [plum2] [r=.933333,g=.682353,b=.933333]
+\definecolor [plum3] [r=.803922,g=.588235,b=.803922]
+\definecolor [plum4] [r=.545098,g=.4,b=.545098]
+\definecolor [mediumorchid1] [r=.878431,g=.4,b=1]
+\definecolor [mediumorchid2] [r=.819608,g=.372549,b=.933333]
+\definecolor [mediumorchid3] [r=.705882,g=.321569,b=.803922]
+\definecolor [mediumorchid4] [r=.478431,g=.215686,b=.545098]
+\definecolor [darkorchid1] [r=.74902,g=.243137,b=1]
+\definecolor [darkorchid2] [r=.698039,g=.227451,b=.933333]
+\definecolor [darkorchid3] [r=.603922,g=.196078,b=.803922]
+\definecolor [darkorchid4] [r=.407843,g=.133333,b=.545098]
+\definecolor [purple1] [r=.607843,g=.188235,b=1]
+\definecolor [purple2] [r=.568627,g=.172549,b=.933333]
+\definecolor [purple3] [r=.490196,g=.14902,b=.803922]
+\definecolor [purple4] [r=.333333,g=.101961,b=.545098]
+\definecolor [mediumpurple1] [r=.670588,g=.509804,b=1]
+\definecolor [mediumpurple2] [r=.623529,g=.47451,b=.933333]
+\definecolor [mediumpurple3] [r=.537255,g=.407843,b=.803922]
+\definecolor [mediumpurple4] [r=.364706,g=.278431,b=.545098]
+\definecolor [thistle1] [r=1,g=.882353,b=1]
+\definecolor [thistle2] [r=.933333,g=.823529,b=.933333]
+\definecolor [thistle3] [r=.803922,g=.709804,b=.803922]
+\definecolor [thistle4] [r=.545098,g=.482353,b=.545098]
+\definecolor [gray0] [black]
+\definecolor [gray1] [s=.01]
+\definecolor [gray2] [s=.02]
+\definecolor [gray3] [s=.03]
+\definecolor [gray4] [s=.04]
+\definecolor [gray5] [s=.05]
+\definecolor [gray6] [s=.06]
+\definecolor [gray7] [s=.07]
+\definecolor [gray8] [s=.08]
+\definecolor [gray9] [s=.09]
+\definecolor [gray10] [s=.1]
+\definecolor [gray11] [s=.11]
+\definecolor [gray12] [s=.12]
+\definecolor [gray13] [s=.13]
+\definecolor [gray14] [s=.14]
+\definecolor [gray15] [s=.15]
+\definecolor [gray16] [s=.16]
+\definecolor [gray17] [s=.17]
+\definecolor [gray18] [s=.18]
+\definecolor [gray19] [s=.19]
+\definecolor [gray20] [s=.2]
+\definecolor [gray21] [s=.21]
+\definecolor [gray22] [s=.22]
+\definecolor [gray23] [s=.23]
+\definecolor [gray24] [s=.24]
+\definecolor [gray25] [s=.25]
+\definecolor [gray26] [s=.26]
+\definecolor [gray27] [s=.27]
+\definecolor [gray28] [s=.28]
+\definecolor [gray29] [s=.29]
+\definecolor [gray30] [s=.3]
+\definecolor [gray31] [s=.31]
+\definecolor [gray32] [s=.32]
+\definecolor [gray33] [s=.33]
+\definecolor [gray34] [s=.34]
+\definecolor [gray35] [s=.35]
+\definecolor [gray36] [s=.36]
+\definecolor [gray37] [s=.37]
+\definecolor [gray38] [s=.38]
+\definecolor [gray39] [s=.39]
+\definecolor [gray40] [s=.4]
+\definecolor [gray41] [s=.41]
+\definecolor [gray42] [s=.42]
+\definecolor [gray43] [s=.43]
+\definecolor [gray44] [s=.44]
+\definecolor [gray45] [s=.45]
+\definecolor [gray46] [s=.46]
+\definecolor [gray47] [s=.47]
+\definecolor [gray48] [s=.48]
+\definecolor [gray49] [s=.49]
+\definecolor [gray50] [s=.5]
+\definecolor [gray51] [s=.51]
+\definecolor [gray52] [s=.52]
+\definecolor [gray53] [s=.53]
+\definecolor [gray54] [s=.54]
+\definecolor [gray55] [s=.55]
+\definecolor [gray56] [s=.56]
+\definecolor [gray57] [s=.57]
+\definecolor [gray58] [s=.58]
+\definecolor [gray59] [s=.59]
+\definecolor [gray60] [s=.6]
+\definecolor [gray61] [s=.61]
+\definecolor [gray62] [s=.62]
+\definecolor [gray63] [s=.63]
+\definecolor [gray64] [s=.64]
+\definecolor [gray65] [s=.65]
+\definecolor [gray66] [s=.66]
+\definecolor [gray67] [s=.67]
+\definecolor [gray68] [s=.68]
+\definecolor [gray69] [s=.69]
+\definecolor [gray70] [s=.7]
+\definecolor [gray71] [s=.71]
+\definecolor [gray72] [s=.72]
+\definecolor [gray73] [s=.73]
+\definecolor [gray74] [s=.74]
+\definecolor [gray75] [s=.75]
+\definecolor [gray76] [s=.76]
+\definecolor [gray77] [s=.77]
+\definecolor [gray78] [s=.78]
+\definecolor [gray79] [s=.79]
+\definecolor [gray80] [s=.8]
+\definecolor [gray81] [s=.81]
+\definecolor [gray82] [s=.82]
+\definecolor [gray83] [s=.83]
+\definecolor [gray84] [s=.84]
+\definecolor [gray85] [s=.85]
+\definecolor [gray86] [s=.86]
+\definecolor [gray87] [s=.87]
+\definecolor [gray88] [s=.88]
+\definecolor [gray89] [s=.89]
+\definecolor [gray90] [s=.9]
+\definecolor [gray91] [s=.91]
+\definecolor [gray92] [s=.92]
+\definecolor [gray93] [s=.93]
+\definecolor [gray94] [s=.94]
+\definecolor [gray95] [s=.95]
+\definecolor [gray96] [s=.96]
+\definecolor [gray97] [s=.97]
+\definecolor [gray98] [s=.98]
+\definecolor [gray99] [s=.99]
+\definecolor [gray100] [white]
+\definecolor [darkgray] [s=.662745]
+\definecolor [darkblue] [b=.545098]
+\definecolor [darkcyan] [g=.545098,b=.545098]
+\definecolor [darkmagenta] [r=.545098,b=.545098]
+\definecolor [darkred] [r=.545098]
+\definecolor [lightgreen] [r=.564706,g=.933333,b=.564706]
diff --git a/tex/context/base/colo-ini.tex b/tex/context/base/colo-ini.tex
index 9722c5e2d..790caac58 100644
--- a/tex/context/base/colo-ini.tex
+++ b/tex/context/base/colo-ini.tex
@@ -456,6 +456,8 @@
{\showmessage\m!colors4\colorstyle}
{\showmessage\m!colors5\colorstyle}}
+\let\usecolors\setupcolor
+
%D When typesetting for paper, we prefer using the \kap{CMYK}
%D color space, but for on||screen viewing we prefer \kap{RGB}
%D (the previous implementation supported only this scheme).
@@ -1958,6 +1960,12 @@
{\doifdefined{\??pa#2}
{\expanded{\dodefinepalet[#1][\getvalue{\??pa\??pa#2}]}}}}
+\let\paletsize\!!zerocount
+
+\def\getpaletsize[#1]%
+ {\getcommacommandsize[\getvalue{\??pa\??pa#1}]%
+ \edef\paletsize{\number\commalistsize}}
+
%D \macros
%D {setuppalet}
%D
diff --git a/tex/context/base/colo-run.tex b/tex/context/base/colo-run.tex
index 2b222328f..8c5e89a83 100644
--- a/tex/context/base/colo-run.tex
+++ b/tex/context/base/colo-run.tex
@@ -122,9 +122,16 @@
\doshowgroup1\doshowgroup2\doshowgroup3\doshowgroup4%
\doshowgroup5\doshowgroup6\doshowgroup7\doshowgroup8}}}
-\gdef\showcolor[#1]%
+\gdef\showcolor
+ {\dosingleempty\doshowcolor}
+
+\gdef\doshowcolor[#1]%
{\bgroup
- \setupcolor[#1]
+ \iffirstargument
+ \let\colorlist\empty
+ \let\colorstyle\empty
+ \setupcolor[#1]%
+ \fi
\stelwitruimtein[\v!geen]
\def\rule
{\vrule\!!width4em\!!height\strutht\!!depth\strutdp}
diff --git a/tex/context/base/colo-xwi.tex b/tex/context/base/colo-xwi.tex
new file mode 100644
index 000000000..863165230
--- /dev/null
+++ b/tex/context/base/colo-xwi.tex
@@ -0,0 +1,142 @@
+%D \module
+%D [ file=colo-xwi,
+%D version=1995.1.1,
+%D title=\CONTEXT\ Color Macros,
+%D subtitle=X Windows,
+%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.
+
+%D I've forgotten where I got these definitions from, but maybe
+%D they can be of use.
+
+\definecolor [aliceblue] [r=0.94,g=0.97,b=1.00]
+\definecolor [antiquewhite] [r=0.98,g=0.92,b=0.84]
+\definecolor [aquamarine] [r=0.50,g=1.00,b=0.83]
+\definecolor [azure] [r=0.94,g=1.00,b=1.00]
+\definecolor [beige] [r=0.96,g=0.96,b=0.86]
+\definecolor [bisque] [r=1.00,g=0.89,b=0.77]
+\definecolor [black] [s=0] % [r=0.00,g=0.00,b=0.00]
+\definecolor [blanchedalmond] [r=1.00,g=0.92,b=0.80]
+\definecolor [blue] [r=0.00,g=0.00,b=1.00]
+\definecolor [blueviolet] [r=0.54,g=0.17,b=0.89]
+\definecolor [brown] [r=0.65,g=0.16,b=0.16]
+\definecolor [burlywood] [r=0.87,g=0.72,b=0.53]
+\definecolor [cadetblue] [r=0.37,g=0.62,b=0.63]
+\definecolor [chartreuse] [r=0.50,g=1.00,b=0.00]
+\definecolor [chocolate] [r=0.82,g=0.41,b=0.12]
+\definecolor [coral] [r=1.00,g=0.50,b=0.31]
+\definecolor [cornflowerblue] [r=0.39,g=0.58,b=0.93]
+\definecolor [cornsilk] [r=1.00,g=0.97,b=0.86]
+\definecolor [cyan] [r=0.00,g=1.00,b=1.00]
+\definecolor [darkgoldenrod] [r=0.72,g=0.53,b=0.04]
+\definecolor [darkgreen] [r=0.00,g=0.39,b=0.00]
+\definecolor [darkkhaki] [r=0.74,g=0.72,b=0.42]
+\definecolor [darkolivegreen] [r=0.33,g=0.42,b=0.18]
+\definecolor [darkorange] [r=1.00,g=0.55,b=0.00]
+\definecolor [darkorchid] [r=0.60,g=0.20,b=0.80]
+\definecolor [darksalmon] [r=0.91,g=0.59,b=0.48]
+\definecolor [darkseagreen] [r=0.56,g=0.74,b=0.56]
+\definecolor [darkslateblue] [r=0.28,g=0.24,b=0.55]
+\definecolor [darkturquoise] [r=0.00,g=0.81,b=0.82]
+\definecolor [darkviolet] [r=0.58,g=0.00,b=0.83]
+\definecolor [deeppink] [r=1.00,g=0.08,b=0.58]
+\definecolor [deepskyblue] [r=0.00,g=0.75,b=1.00]
+\definecolor [dodgerblue] [r=0.12,g=0.56,b=1.00]
+\definecolor [firebrick] [r=0.70,g=0.13,b=0.13]
+\definecolor [floralwhite] [r=1.00,g=0.98,b=0.94]
+\definecolor [forestgreen] [r=0.13,g=0.55,b=0.13]
+\definecolor [gainsboro] [r=0.86,g=0.86,b=0.86]
+\definecolor [ghostwhite] [r=0.97,g=0.97,b=1.00]
+\definecolor [gold] [r=1.00,g=0.84,b=0.00]
+\definecolor [goldenrod] [r=0.85,g=0.65,b=0.13]
+\definecolor [green] [r=0.00,g=1.00,b=0.00]
+\definecolor [greenyellow] [r=0.68,g=1.00,b=0.18]
+\definecolor [honeydew] [r=0.94,g=1.00,b=0.94]
+\definecolor [hotpink] [r=1.00,g=0.41,b=0.71]
+\definecolor [indianred] [r=0.80,g=0.36,b=0.36]
+\definecolor [ivory] [r=1.00,g=1.00,b=0.94]
+\definecolor [khaki] [r=0.94,g=0.90,b=0.55]
+\definecolor [lavender] [r=0.90,g=0.90,b=0.98]
+\definecolor [lavenderblush] [r=1.00,g=0.94,b=0.96]
+\definecolor [lawngreen] [r=0.49,g=0.99,b=0.00]
+\definecolor [lemonchiffon] [r=1.00,g=0.98,b=0.80]
+\definecolor [lightblue] [r=0.68,g=0.85,b=0.90]
+\definecolor [lightcoral] [r=0.94,g=0.50,b=0.50]
+\definecolor [lightcyan] [r=0.88,g=1.00,b=1.00]
+\definecolor [lightgoldenrod] [r=0.93,g=0.87,b=0.51]
+\definecolor [lightgoldenrodyellow] [r=0.98,g=0.98,b=0.82]
+\definecolor [lightpink] [r=1.00,g=0.71,b=0.76]
+\definecolor [lightsalmon] [r=1.00,g=0.63,b=0.48]
+\definecolor [lightseagreen] [r=0.13,g=0.70,b=0.67]
+\definecolor [lightskyblue] [r=0.53,g=0.81,b=0.98]
+\definecolor [lightslateblue] [r=0.52,g=0.44,b=1.00]
+\definecolor [lightsteelblue] [r=0.69,g=0.77,b=0.87]
+\definecolor [lightyellow] [r=1.00,g=1.00,b=0.88]
+\definecolor [limegreen] [r=0.20,g=0.80,b=0.20]
+\definecolor [linen] [r=0.98,g=0.94,b=0.90]
+\definecolor [magenta] [r=1.00,g=0.00,b=1.00]
+\definecolor [maroon] [r=0.69,g=0.19,b=0.38]
+\definecolor [mediumaquamarine] [r=0.40,g=0.80,b=0.67]
+\definecolor [mediumblue] [r=0.00,g=0.00,b=0.80]
+\definecolor [mediumorchid] [r=0.73,g=0.33,b=0.83]
+\definecolor [mediumpurple] [r=0.58,g=0.44,b=0.86]
+\definecolor [mediumseagreen] [r=0.24,g=0.70,b=0.44]
+\definecolor [mediumslateblue] [r=0.48,g=0.41,b=0.93]
+\definecolor [mediumspringgreen] [r=0.00,g=0.98,b=0.60]
+\definecolor [mediumturquoise] [r=0.28,g=0.82,b=0.80]
+\definecolor [mediumvioletred] [r=0.78,g=0.08,b=0.52]
+\definecolor [midnightblue] [r=0.10,g=0.10,b=0.44]
+\definecolor [mintcream] [r=0.96,g=1.00,b=0.98]
+\definecolor [mistyrose] [r=1.00,g=0.89,b=0.88]
+\definecolor [moccasin] [r=1.00,g=0.89,b=0.71]
+\definecolor [navajowhite] [r=1.00,g=0.87,b=0.68]
+\definecolor [navy] [r=0.00,g=0.00,b=0.50]
+\definecolor [navyblue] [r=0.00,g=0.00,b=0.50]
+\definecolor [oldlace] [r=0.99,g=0.96,b=0.90]
+\definecolor [olivedrab] [r=0.42,g=0.56,b=0.14]
+\definecolor [orange] [r=1.00,g=0.65,b=0.00]
+\definecolor [orangered] [r=1.00,g=0.27,b=0.00]
+\definecolor [orchid] [r=0.85,g=0.44,b=0.84]
+\definecolor [palegoldenrod] [r=0.93,g=0.91,b=0.67]
+\definecolor [palegreen] [r=0.60,g=0.98,b=0.60]
+\definecolor [paleturquoise] [r=0.69,g=0.93,b=0.93]
+\definecolor [palevioletred] [r=0.86,g=0.44,b=0.58]
+\definecolor [papayawhip] [r=1.00,g=0.94,b=0.84]
+\definecolor [peachpuff] [r=1.00,g=0.85,b=0.73]
+\definecolor [peru] [r=0.80,g=0.52,b=0.25]
+\definecolor [pink] [r=1.00,g=0.75,b=0.80]
+\definecolor [plum] [r=0.87,g=0.63,b=0.87]
+\definecolor [powderblue] [r=0.69,g=0.88,b=0.90]
+\definecolor [purple] [r=0.63,g=0.13,b=0.94]
+\definecolor [red ] [r=1.00,g=0.00,b=0.00]
+\definecolor [rosybrown] [r=0.74,g=0.56,b=0.56]
+\definecolor [royalblue] [r=0.25,g=0.41,b=0.88]
+\definecolor [saddlebrown] [r=0.55,g=0.27,b=0.07]
+\definecolor [salmon] [r=0.98,g=0.50,b=0.45]
+\definecolor [sandybrown] [r=0.96,g=0.64,b=0.38]
+\definecolor [seagreen] [r=0.18,g=0.55,b=0.34]
+\definecolor [seashell] [r=1.00,g=0.96,b=0.93]
+\definecolor [sienna] [r=0.63,g=0.32,b=0.18]
+\definecolor [skyblue] [r=0.53,g=0.81,b=0.92]
+\definecolor [slateblue] [r=0.42,g=0.35,b=0.80]
+\definecolor [snow] [r=1.00,g=0.98,b=0.98]
+\definecolor [springgreen] [r=0.00,g=1.00,b=0.50]
+\definecolor [steelblue] [r=0.27,g=0.51,b=0.71]
+\definecolor [tan ] [r=0.82,g=0.71,b=0.55]
+\definecolor [thistle] [r=0.85,g=0.75,b=0.85]
+\definecolor [tomato] [r=1.00,g=0.39,b=0.28]
+\definecolor [turquoise] [r=0.25,g=0.88,b=0.82]
+\definecolor [violet] [r=0.93,g=0.51,b=0.93]
+\definecolor [violetred] [r=0.82,g=0.13,b=0.56]
+\definecolor [wheat] [r=0.96,g=0.87,b=0.70]
+\definecolor [white] [r=1.00,g=1.00,b=1.00]
+\definecolor [whitesmoke] [s=0.96] % [r=0.96,g=0.96,b=0.96]
+\definecolor [yellow] [r=1.00,g=1.00,b=0.00]
+\definecolor [yellowgreen] [r=0.60,g=0.80,b=0.20]
+
+\endinput
diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex
index 5438259b6..627a4f6d3 100644
--- a/tex/context/base/cont-new.tex
+++ b/tex/context/base/cont-new.tex
@@ -17,10 +17,218 @@
\unprotect
-% startplaats
+%%%%%%%% todo: \chardef\snapstruts=1 => d=l-h
\writestatus{\m!systems}{beware: some patches loaded from cont-new.tex!}
+\appendtoks\optimizeverbatimfalse\to\everytabulate
+
+\def\centertogrid % meant for special situations
+ {\ifgridsnapping
+ \dowithnextboxcontent
+ {\ignorespaces}
+ {\bgroup
+ \par
+ \scratchdimen\nextboxht
+ \advance\scratchdimen \nextboxdp
+ \getnoflines\scratchdimen
+ \setbox\nextbox\vbox to \noflines\lineheight
+ {\forgetall
+ \vss
+ \topbaselinecorrection
+ \copy\nextbox
+ \botbaselinecorrection
+ \vss}%
+ \setbox\nextbox\hbox{\lower\strutdp\flushnextbox}%
+ \noindent\snaptogrid\vbox{\flushnextbox}%
+ \egroup}
+ \vbox % was \hbox
+ \fi}
+
+% \strut Bruggetje
+% \startlinecorrection
+% \startcombination
+% {\framed{test}} {} {\framed{test}} {}
+% \stopcombination
+% \stoplinecorrection
+% \strut Bruggetje
+% \startlinecorrection
+% \startcombination[2*2]
+% {\framed{test}} {} {\framed{test}} {}
+% {\framed{test}} {} {\framed{test}} {}
+% \stopcombination
+% \stoplinecorrection
+% \strut Bruggetje
+% \startlinecorrection[blank]
+% \startcombination
+% {\framed{test}} {} {\framed{test}} {}
+% \stopcombination
+% \stoplinecorrection
+% \strut Bruggetje
+% \startlinecorrection[blank]
+% \startcombination[2*2]
+% {\framed{test}} {} {\framed{test}} {}
+% {\framed{test}} {} {\framed{test}} {}
+% \stopcombination
+% \stoplinecorrection
+% \strut Bruggetje
+% \startlinecorrection
+% \startcombination
+% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {}
+% \stopcombination
+% \stoplinecorrection
+% \strut Bruggetje
+% \startlinecorrection
+% \startcombination[2*2]
+% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {}
+% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {}
+% \stopcombination
+% \stoplinecorrection
+% \strut Bruggetje
+% \startlinecorrection[blank]
+% \startcombination
+% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {}
+% \stopcombination
+% \stoplinecorrection
+% \strut Bruggetje
+% \startlinecorrection[blank]
+% \startcombination[2*2]
+% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {}
+% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {}
+% \stopcombination
+% \stoplinecorrection
+
+% needed for extreme
+
+\definesystemvariable{ie}
+
+% \def\definetest[#1]#2%
+% {\long\setvalue{\??ie#1}{#2}}
+
+\def\definetest
+ {\dodoubleempty\dodefinetest}
+
+\def\dodefinetest[#1][#2]#3%
+ {\setgvalue{\??ie#1}{#3}%
+ \ifsecondargument
+ \processaction
+ [#2]
+ [% first test true, rest depends
+ \v!volgende=>\setgvalue{\??ie#1}{\setgvalue{\??ie#1}{#3}\firstoftwoarguments},
+ % rest true if first true
+ % \v!eerste=>\setgvalue{\??ie#1}{#3{\letgvalue{\??ie#1}%
+ % \firstoftwoarguments\firstoftwoarguments}%
+ % \secondoftwoarguments},
+ % always true
+ \v!ja=>\letgvalue{\??ie#1}\firstoftwoarguments,
+ % always false
+ \v!nee=>\letgvalue{\??ie#1}\secondoftwoarguments]%
+ \fi}
+
+\def\doperformtest#1%
+ {\executeifdefined{\??ie#1}\secondoftwoarguments}
+
+\def\definecolumnsethsize#1#2#3#4% will be improved/speed up
+ {\bgroup
+ \def\OTRSETidentifier{#1}%
+ \ifcase\columnsetlevel\relax
+ \mofcolumns\plusone
+ \OTRSETinitializecolumns
+ \OTRSETassignwidths
+ \OTRSETsethsize
+ \fi
+ \!!counta#2\!!countb#3\docalculatecolumnsetspan
+ \expandafter\egroup\expandafter\edef\expandafter
+ #4\expandafter{\the\!!widtha}}
+
+% so far
+
+\def\setstrut
+ {\strutdimen\normallineheight
+ \strutdimen\strutheightfactor\strutdimen
+ \strutdimen\spacingfactor\strutdimen
+ \edef\strutheight{\the\strutdimen}%
+ \strutdimen\normallineheight
+ \ifgridsnapping
+ \advance\strutdimen-\strutheight
+ \else
+ \strutdimen\strutdepthfactor\strutdimen
+ \strutdimen\spacingfactor\strutdimen
+ \fi
+ \edef\strutdepth{\the\strutdimen}%
+ \dosetstrut}
+
+% \setupinteraction[state=start]
+%
+% \useattachment[whatever][test.tex]
+%
+% % \setupattachments[\c!symbool={symbol-normal,symbol-down}]
+%
+% \starttext \attachment[whatever] \stoptext
+
+\definesystemvariable{at}
+
+\def\useattachment
+ {\dotripleempty\douseattachment}
+
+\def\douseattachment[#1][#2][#3]%
+ {\setgvalue{\??at :#1}{#2}%
+ \setgvalue{\??at::#1}{#3}%
+ \doifvaluenothing{\??at :#1}{\setxvalue{\??at :#1}{#1}}%
+ \doifvaluenothing{\??at::#1}{\setxvalue{\??at::#1}{\getvalue{\??at:#1}}}}
+
+\def\attachment[#1]%
+ {\ifundefined{\??at:#1}\else \iflocation
+ \doif\@@atstatus\v!start
+ {\doiffileelse{\getvalue{\??at:#1}}%
+ {\doPDFattachfile
+ {\getvalue{\??at::#1}}%
+ {1em}{1ex}\@@atkleur\@@atsymbool
+ {\getvalue{\??at:#1}}}%
+ {}}%
+ \fi \fi}
+
+\def\setupattachments
+ {\dodoubleempty\getparameters[\??at]}
+
+\setupattachments
+ [\c!status=\v!start,
+ \c!kleur=\@@iakleur,
+ \c!symbool=]
+
+% 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
@@ -33,41 +241,6 @@
% \tabulatetailcontent
% \removefunnytabulateline}
-\newsignal\strutsignal \setfalse\sigstruts
-
-\def\begstrut
- {\relax\ifcase\strutht\else
- \ifconditional\sigstruts
- \noindent\hbox{\strut}%
- \normalpenalty\@M % \!!tenthousand
- \normalhskip-\strutsignal
- \normalhskip\strutsignal
- \else
- \strut
- \normalpenalty\@M % \!!tenthousand
- \normalhskip\zeropoint
- \fi
- \ignorespaces
- \fi}
-
-\def\endstrut
- {\relax\ifhmode\ifcase\strutht\else
- \ifconditional\sigstruts
- \ifdim\lastskip=\strutsignal
- \unskip\unskip\unpenalty\setbox\scratchbox\lastbox
- \else
- \normalpenalty\@M % \!!tenthousand
- \normalhskip\zeropoint
- \strut
- \fi
- \else
- \removeunwantedspaces
- \normalpenalty\@M % \!!tenthousand
- \normalhskip\zeropoint
- \strut
- \fi
- \fi\fi}
-
\def\showexternalfigured
{\bgroup
\immediate\openout\scratchwrite=mpfigs.mp
@@ -129,7 +302,7 @@
\advance\scratchdimen-\strutdepth
\getnoflines\scratchdimen
\struttedbox{\flushnextbox}%
- \dorecurse\noflines{\vbox{\hsize\zeropoint\strut}}%
+ \dorecurse\noflines\verticalstrut
\else
\flushnextbox
\fi}%
@@ -397,7 +570,7 @@
%
%\defineclassfontsynonym [KopFont] [officina] [SerifBold]
-\def\startkolomopmaak % don't change
+\def\startcolumnmakeup % don't change
{\bgroup
\getrawnoflines\teksthoogte % teksthoogte kan topskip hebben, dus raw
\scratchdimen\noflines\lineheight
@@ -407,12 +580,13 @@
\ifcase\showgridstate\vbox\else\ruledvbox\fi to \scratchdimen\bgroup
\forgetall} % ! don't change
-\def\stopkolomopmaak
+\def\stopcolumnmakeup
{\egroup
\dp\scratchbox\zeropoint
\wd\scratchbox\tekstbreedte
\box\scratchbox
- \egroup}
+ \egroup
+ \synchronizehsize}
% todo : hoe komt box er uit
diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex
index 49973594c..a168370ae 100644
--- a/tex/context/base/context.tex
+++ b/tex/context/base/context.tex
@@ -15,7 +15,7 @@
\catcode`\{=1 \catcode`\}=2
-\def\contextversion{2003.3.17}
+\def\contextversion{2003.4.22}
%D Welcome to the main module. When this module is ran through
%D \type{initex} or \type{tex -i} or \type{whatevertex} using
diff --git a/tex/context/base/core-box.tex b/tex/context/base/core-box.tex
index 47374e0fe..8d9f04f7e 100644
--- a/tex/context/base/core-box.tex
+++ b/tex/context/base/core-box.tex
@@ -580,6 +580,7 @@
% \definelayerpreset [righttop] [corner={right,top},location={left,bottom}]
% \definelayerpreset [leftbottom] [corner={left,bottom},location={right,top}]
% \definelayerpreset [rightbottom] [corner={right,bottom},location={left,top}]
+% \definelayerpreset [middle] [corner=middle,location=middle]
%
% \setlayer[pagefigures][preset=lefttop]
% \setlayer[pagefigures][preset=righttop]
@@ -605,6 +606,10 @@
[\v!rechts\v!onder]
[\c!hoek={\v!rechts,\v!onder},%
\c!plaats={\v!links,\v!boven}]
+
+\definelayerpreset
+ [\v!midden]
+ [\c!hoek=\v!midden,\c!plaats=\v!midden]
\def\alignedbox
{\dodoubleempty\doalignedbox[]}
diff --git a/tex/context/base/core-buf.tex b/tex/context/base/core-buf.tex
index 96578ee45..a37249198 100644
--- a/tex/context/base/core-buf.tex
+++ b/tex/context/base/core-buf.tex
@@ -789,7 +789,7 @@
\def\next
{\def\dobeforeblock####1####2%
{\begingroup
- \globaldefs=-1\relax}%
+ \globaldefs\minusone}%
\def\doafterblock####1####2%
{\endgroup}%
\copyblock{#1}{#3#4}}}%
@@ -860,7 +860,7 @@
{\bgroup\obeylines\dotripleempty\dohandhaafblok[##1][#2]}}%
\processcommalist[#1]\docommando}
-\def\handhaafblokken%
+\def\handhaafblokken
{\dodoubleempty\dohandhaafblokken}
\newconditional\processblockstatus
diff --git a/tex/context/base/core-con.tex b/tex/context/base/core-con.tex
index f3cfa36bc..b11800f4a 100644
--- a/tex/context/base/core-con.tex
+++ b/tex/context/base/core-con.tex
@@ -619,8 +619,10 @@
\def\calculatecurrenttime
% {\DoDiv\time by60to\scratchcounter\edef\currenthour {\the\scratchcounter}%
% \DoMod\time by60to\scratchcounter\edef\currentminute{\the\scratchcounter}}
- {\dosetdivision\time{60}\scratchcounter\edef\currenthour {\the\scratchcounter}%
- \dosetmodulo \time{60}\scratchcounter\edef\currentminute{\the\scratchcounter}}
+ {\dosetdivision\time{60}\scratchcounter
+ \edef\currenthour {\ifnum\scratchcounter<10 0\fi \the\scratchcounter}%
+ \dosetmodulo \time{60}\scratchcounter
+ \edef\currentminute{\ifnum\scratchcounter<10 0\fi \the\scratchcounter}}
\appendtoks \calculatecurrenttime \to \everyjob
diff --git a/tex/context/base/core-fig.tex b/tex/context/base/core-fig.tex
index 2a98f6814..4f873fabf 100644
--- a/tex/context/base/core-fig.tex
+++ b/tex/context/base/core-fig.tex
@@ -869,8 +869,11 @@
\let\@@efextension #1%
\let\@@efobject \v!nee
\let\@@efpreset \v!nee
- \ifx\@@efbreedte\empty\def\@@efbreedte{4cm}\fi
- \ifx\@@efhoogte \empty\def\@@efhoogte {3cm}\fi}
+ \ifx\@@efbreedte\empty
+ \def\@@efbreedte{8\lineheight}% 4cm
+ \ifx\@@efhoogte\empty
+ \def\@@efhoogte{6\lineheight}% 3cm
+ \fi}
\def\presetfiguremov{\presetundefinedfigure\c!mov}
\def\presetfigureavi{\presetundefinedfigure\c!avi}
@@ -929,7 +932,8 @@
\getparameters
[\??ep]
[\c!e=\s!unknown,
- \c!w=15\korpsgrootte,\c!h=10\korpsgrootte,
+ %\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
@@ -976,9 +980,9 @@
\let\@@efextension\c!tmp
\fi
\let\@@eftype\c!tex}%
- %\@EA\doifnumberelse\@EA{\@@efextension} % new, test first
- %{\def\@@eftype{\c!mps}}
- %{%
+ \@EA\doifnumberelse\@EA{\@@efextension} % new, test first
+ {\def\@@eftype{\c!mps}}
+ {%
\processaction
[\@@efextension]
[ \c!tex=>\let\@@eftype\c!tex,
@@ -987,7 +991,7 @@
\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,
@@ -1336,10 +1340,10 @@
%\c!kader=\ifincolor\v!uit\else\v!aan\fi]
%\c!kader=\ifincolor\@@efkader\else\v!aan\fi]}%
\c!kader=\@@efkader]}%
- {\ttx \nohyphens
- name: \expanded{\verbatimstring{#1}}\\%
- file: \expanded{\verbatimstring{#2}}\\%
- state: \expanded{\verbatimstring{#3}}}}
+ {\tt\tfxx \nohyphens
+ name: \expanded{\verbatimstring{#1}}\\%
+ file: \expanded{\verbatimstring{#2}}\\%
+ state: \expanded{\verbatimstring{#3}}}}
\newtoks\externalfigureresets
\newtoks\externalfigurepostprocessors
@@ -1511,7 +1515,8 @@
\def\doexternalfigure[#1][#2][#3]%
{\bgroup
\doifelsenothing{#1}
- {\framed[\c!breedte=4cm,\c!hoogte=3cm]{external\\figure}}
+ %{\framed[\c!breedte=4cm,\c!hoogte=3cm]{external\\figure}}
+ {\framed[\c!breedte=8\lineheight,\c!hoogte=6\lineheight]{external\\figure}}
{\doifundefinedelse{\??ef\??ef#1}
{\useexternalfigure[\s!dummy][#1][#2][#3]%
\getexternalfigure{\s!dummy}[#3]}
diff --git a/tex/context/base/core-grd.tex b/tex/context/base/core-grd.tex
index 5d3644bdd..08c4ebb92 100644
--- a/tex/context/base/core-grd.tex
+++ b/tex/context/base/core-grd.tex
@@ -297,31 +297,14 @@
\expandafter\dodosnaptogrid
\fi}
-% \def\forcedpresnapcorrection
-% {\ifforcepresnap
-% % we don't want top of page space when 'top' option
-% %\vbox{\strut}\nobreak\vskip-\openlineheight
-% \vbox{\strut}\vskip-\openlineheight
-% \fi}
-%
-%\def\forcedpresnapcorrection
-% {\ifforcepresnap
-% \ifvmode \else \par \fi
-% \ifdim\prevdepth<\zeropoint \else
-% \vskip-\prevdepth
-% \vskip\strutdepth
-% \prevdepth\strutdepth
-% \fi
-% \fi}
-
\def\forcedpresnapcorrection % test this on 'details'
{\ifforcepresnap
\ifvmode \else \par \fi % new
% we don't want top of page space when 'top' option
- %\vbox{\strut}\nobreak\vskip-\openlineheight
- %\vbox{\strut}\vskip-\openlineheight
+ %\verticalstrut\nobreak\vskip-\struttotal
+ %\verticalstrut\vskip-\struttotal
% nobreak really needed
- \allowbreak\vbox{\strut}\nobreak\vskip-\openlineheight
+ \allowbreak\verticalstrut\nobreak\vskip-\struttotal
%\ifdim\pagetotal>\topskip \else
% eigenlijk signal
%\writestatus{grid}{removing dummy at top of page}%
@@ -403,7 +386,7 @@
% \getrawnoflines\scratchdimen
% \advance\scratchdimen-\noflines\lineheight
% \vskip\scratchdimen % disappears at top of page
-% \dorecurse\noflines{\vbox{\strut}\nobreak}%
+% \dorecurse\noflines{\verticalstrut\nobreak}%
% \else \ifdim\scratchdimen=\zeropoint
% % nothing to skip
% \else % disappears at top of page
@@ -604,7 +587,7 @@
\getrawnoflines\scratchdimen
\advance\scratchdimen-\noflines\lineheight
\vskip\scratchdimen % disappears at top of page
- \dorecurse\noflines{\vbox{\strut}\nobreak}%
+ \dorecurse\noflines{\verticalstrut\nobreak}%
\else \ifdim\scratchdimen=\zeropoint
% nothing to skip
\else % disappears at top of page
@@ -767,32 +750,30 @@
\hbox
\fi}
-% The old one (to be kept):
-%
-% \def\centertogrid
-% {\ifgridsnapping
-% \dowithnextbox
-% {\bgroup
-% \par
-% \scratchdimen\nextboxht
-% \advance\scratchdimen \nextboxdp
-% \getnoflines\scratchdimen
-% \setbox\nextbox\vbox to \noflines\lineheight
-% {\forgetall
-% \vskip\zeropoint \!!plus \nextboxht
-% \copy\nextbox
-% \kern.5\strutdp % VOORLOPIGE WAARDE
-% \vskip\zeropoint \!!plus \nextboxdp}
-% \noindent\snaptogrid\vbox{\flushnextbox}%
-% \egroup}
-% \hbox
-% \fi}
-%
-% The new implementation, using one of the placement
-% options, will be configurable some day ...
+\def\centertogrid % meant for special situations
+ {\ifgridsnapping
+ \dowithnextboxcontent
+ {\ignorespaces}
+ {\bgroup
+ \par
+ \scratchdimen\nextboxht
+ \advance\scratchdimen \nextboxdp
+ \getnoflines\scratchdimen
+ \setbox\nextbox\vbox to \noflines\lineheight
+ {\forgetall
+ \vskip\zeropoint \!!plus \nextboxht
+ \copy\nextbox
+ \kern.5\strutdp % VOORLOPIGE WAARDE
+ \vskip\zeropoint \!!plus \nextboxdp}%
+ \noindent\snaptogrid\vbox{\flushnextbox}%
+ \egroup}
+ \vbox % was \hbox
+ \fi}
-\def\centertogrid % usage: see ie pascal / stepcharts
- {\snaptogrid[\v!midden,.5\strutdp]\vbox}
+% The next implementation is sub-optimal
+%
+% \def\centertogrid % usage: see ie pascal / stepcharts
+% {\snaptogrid[\v!midden,.5\strutdp]\vbox}
\ifx\startbaselinecorrection\undefined \wait \fi % change order
@@ -949,8 +930,9 @@
% \bgroup
% \endgraf
% \forgetall
-% \vbox{\strut}
-% \kern-2\lineheight
+% \verticalstrut
+% \kern-\struttotal
+% \kern-\lineheight
% \nobreak
% \vskip\lineheight
% \egroup
@@ -970,8 +952,8 @@
\def\dosyncfuzzyvskip
{\ifvmode\ifdim\lastskip<\lineheight\ifdim\lastskip>\zeropoint
- \bgroup
- \endgraf\forgetall\vbox{\strut}\nobreak\vskip\lineheight
+ \bgroup % - added 28/2/2003: check this, there was no -
+ \endgraf\forgetall\verticalstrut\nobreak\vskip-\struttotal
\egroup
\fi\fi\fi}
diff --git a/tex/context/base/core-int.tex b/tex/context/base/core-int.tex
index 5020c5add..14ffe5b98 100644
--- a/tex/context/base/core-int.tex
+++ b/tex/context/base/core-int.tex
@@ -167,9 +167,9 @@
\else
\edef\nextlink {0\getvalue{\s!link:#1:l}}%
\fi
- \edef\writelink%
- {\writeutilitycommand%
- {\twopassentry%
+ \edef\writelink
+ {\writeutilitycommand
+ {\twopassentry
{\s!link:#1}%
{\numberoflinks}%
{\noexpand\realfolio}}}%
@@ -225,13 +225,13 @@
\edef\prevlink {0##4}%
\edef\currentlink{0##5}}%
\expanded{\next[\getvalue{\s!link:#1:}]}%
- \edef\nextlink%
+ \edef\nextlink
{0\iftwopassdatafound\twopassdata\else\lastlink\fi}%
\setxvalue{\s!link:#1:}%
{\firstlink:\lastlink:\noflinks:\currentlink:\nextlink}%
- \edef\writelink%
- {\writeutilitycommand%
- {\twopassentry%
+ \edef\writelink
+ {\writeutilitycommand
+ {\twopassentry
{\s!link:#1}%
{\numberoflinks}%
{\noexpand\realfolio}}}%
@@ -2112,15 +2112,22 @@
\newbox\commentbox
\def\doflushcommentanchors
- {\inmarge{\hbox{\raise\strutht\box\commentbox}}}
+ {\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\flushcommentanchors % in everypar so indirect
{\ifvoid\commentbox\else \doflushcommentanchors \fi}
-\def\stelcommentaarin
+\def\setupcomment
{\dodoubleargument\getparameters[\??cc]}
-\setvalue{\e!start\v!commentaar}% the dummy triple gobbles trailing spaces
+\setvalue{\e!start\v!comment}% the dummy triple gobbles trailing spaces
{\dotripleempty\dostartcommentaar}
\def\commentaar
@@ -2130,9 +2137,9 @@
{\!!widtha\@@ccbreedte
\!!heighta\@@cchoogte
\doifelse\@@ccoptie\v!max
- {\def\@@ccopen{1}}{\def\@@ccopen{0}}%
+ {\let\@@ccopen \!!plusone}{\let\@@ccopen \!!zerocount}%
\doifelse\@@ccoptie\v!buffer
- {\def\@@cccollect{1}}{\def\@@cccollect{0}}%
+ {\let\@@cccollect\!!plusone}{\let\@@cccollect\!!zerocount}%
\doinsertcomment
\@@cctitel\!!widtha\!!heighta
\@@cckleur\@@ccopen\@@ccsymbool
@@ -2157,7 +2164,7 @@
\egroup}}%
{\long\def\docommando##1%
{\egroup}}%
- \grabuntil{\e!stop\v!commentaar}\docommando}
+ \grabuntil{\e!stop\v!comment}\docommando}
\def\docommentaar[#1][#2]#3%
{\doif\@@ccstatus\v!start
@@ -2434,7 +2441,7 @@
\stelpaginaovergangenin
[\v!reset]
-\stelcommentaarin
+\setupcomment
[\c!status=\v!start,
\c!marge=2.5em,
\c!afstand=1em,
@@ -2444,6 +2451,7 @@
\c!titel=,
\c!spatie=\v!nee,
\c!symbool=\v!normaal,
+ \c!plaats=\v!inmarge,
\c!optie=]
\stelversiesin % beware, @ is made active here,
diff --git a/tex/context/base/core-lst.tex b/tex/context/base/core-lst.tex
index 7f67930a1..2725d58e5 100644
--- a/tex/context/base/core-lst.tex
+++ b/tex/context/base/core-lst.tex
@@ -1021,19 +1021,19 @@
\c!voor=\blanko,\c!na=\pagina,
\c!letter=\v!kleinnormaal,\c!kleur=]
-\def\resetremaininglistlength%
+\def\resetremaininglistlength
{\dodoubleempty\doresetremaininglistlength}
\def\doresetremaininglistlength[#1][#2]%
{\bepaallijstkenmerken[#1][#2]% \determinelistcharacteristics[#1][#2]%
\xdef\listlengthcounter{\number\utilitylistlength}}
-\def\showremaininglistlength%
+\def\showremaininglistlength
{\bgroup
\ifnum\listlengthcounter>\plusone
\scratchdimen\pagetotal
\setbox\scratchbox\vbox
- {\@@llvoor\par\hbox{\strut}\par\hbox{\strut}\par\@@llna}
+ {\@@llvoor\par\horizontalstrut\par\horizontalstrut\par\@@llna}%
\advance\scratchdimen \ht\scratchbox
\advance\scratchdimen \dp\scratchbox
\ifdim\scratchdimen>\pagegoal
diff --git a/tex/context/base/core-mak.tex b/tex/context/base/core-mak.tex
index d258ad9ec..040cce8c7 100644
--- a/tex/context/base/core-mak.tex
+++ b/tex/context/base/core-mak.tex
@@ -16,6 +16,7 @@
\unprotect
% \definieerplaats[naam][instellingen]
+% \stelplaatsin[naam][instellingen]
% \plaats<naam>[[instellingen]]
%
% - still undocumented and also not in setupb yet
@@ -32,7 +33,7 @@
\c!grid=\v!midden,
%\c!voor=,
%\c!na=,
- #2]%
+ #2]%
\setvalue{\e!plaats#1}{\doplacement[\??pl#1]}}
\def\defineplacement
diff --git a/tex/context/base/core-mat.tex b/tex/context/base/core-mat.tex
index b70fc9a3d..5ecf38206 100644
--- a/tex/context/base/core-mat.tex
+++ b/tex/context/base/core-mat.tex
@@ -314,10 +314,18 @@
\informulatrue
%\forgetall % otherwise backgrounds fail
\ifdim\lastskip<\!!zeropoint\else
- \par\ifvmode\ifdim\parskip>\zeropoint\relax\vskip-\parskip\fi\fi
+ \par
+ \ifvmode \ifdim\parskip>\zeropoint\relax
+ \vskip-\parskip
+ \fi \fi
\fi
\beforedisplayspace
- \par\ifvmode\vbox{\strut}\vskip-2\baselineskip\fi
+ \par
+ \ifvmode
+ \verticalstrut
+ \vskip-\struttotal
+ \vskip-\baselineskip
+ \fi
\fi
$$\setdisplaydimensions
\setpredisplaysize\lastlinewidth
@@ -449,54 +457,27 @@
{\setfalse\incrementformulanumber
\dodoubleempty\doplaatsformule}
-% \def\doplaatsformule[#1][#2]% #2 = dummy, gobbles spaces
-% {\def\redoplaatsformule
-% {\bgroup\def\dostartformula####1{\relax}%
-% \ifx\next\bgroup
-% \@EA\moreplaatsformule % [ref]{}
-% \else\if\next\relax % a \cs
-% \egroup \@EA\@EA\@EA\dodoplaatsformule % [ref]\start
-% \else
-% \egroup \@EA\@EA\@EA\dispplaatsformule % [ref]$$
-% \fi\fi
-% [#1]{}}%
-% \futurelet\next\redoplaatsformule}
-%
-% \long\def\moreplaatsformule[#1]#2#3#4% #2 dummy #4 gobbles spaces
-% {\def\redoplaatsformule%
-% {\if\next\relax % a \cs
-% \egroup \expandafter\dodoplaatsformule % [ref]{}\start
-% \else
-% \egroup \expandafter\dispplaatsformule % [ref]{}$$
-% \fi
-% [#1]{#3}}%
-% \futurelet\next\redoplaatsformule#4}
-
\def\doplaatsformule[#1][#2]% #2 = dummy, gobbles spaces
{\def\redoplaatsformule
{\bgroup\def\dostartformula####1{\relax}%
\ifx\next\bgroup
\@EA\moreplaatsformule % [ref]{}
\else
- \convertcommand\next\to\ascii
- \getfirstcharacter\ascii
- \ifx\firstcharacter\letterbackslash % a \cs
- \egroup \@EAEAEA\dodoplaatsformule % [ref]\start
- \else
- \egroup \@EAEAEA\dispplaatsformule % [ref]$$
- \fi
- \fi
- [#1]{}}%
+ \expandafter\convertargument\e!start\to\asciiA
+ \expandafter\convertargument\next \to\asciiB
+ \ExpandBothAfter\doifincsnameelse\asciiA\asciiB
+ {\egroup \@EA\dodoplaatsformule}% [ref]\start
+ {\egroup \@EA\dispplaatsformule}% [ref]$$
+ \fi[#1]{}}%
\futurelet\next\redoplaatsformule}
\long\def\moreplaatsformule[#1]#2#3#4% #2 dummy #4 gobbles spaces
{\def\redoplaatsformule
- {\convertcommand\next\to\ascii \getfirstcharacter\ascii
- \ifx\firstcharacter\letterbackslash % a \cs
- \egroup \expandafter\dodoplaatsformule % [ref]{}\start
- \else
- \egroup \expandafter\dispplaatsformule % [ref]{}$$
- \fi
+ {\expandafter\convertargument\e!start\to\asciiA
+ \expandafter\convertargument\next \to\asciiB
+ \ExpandBothAfter\doifincsnameelse\asciiA\asciiB
+ {\egroup \dodoplaatsformule}% [ref]\start
+ {\egroup \dispplaatsformule}% [ref]$$
[#1]{#3}}%
\futurelet\next\redoplaatsformule#4}
@@ -561,7 +542,7 @@
{\getvalue{\e!stop \??fm\getvalue{\??fm\currentformula\c!uitlijnen}}}
\def\mathinnerstrut
- {\doifvalue{\??fm\currentformula\c!strut}{\v!ja}{\strut}}
+ {\doifvalue{\??fm\currentformula\c!strut}\v!ja\strut}
\long\def\defineinnermathhandler#1#2#3%
{\setvalue{\e!start\??fm#1}{#2}%
@@ -964,6 +945,25 @@
\def\snappedinlineformula
{\dosingleempty\dosnappedinlineformula}
+%D \starttabulatie[|Tl|l|]
+%D \NC - \NC half lines \NC \NR
+%D \NC + \NC full lines \NC \NR
+%D \NC = \NC force \NC \NR
+%D \NC < \NC force, minus pre \NC \NR
+%D \NC > \NC force, minus post \NC \NR
+%D \stoptabulatie
+
+\newif\if!!donee
+\newif\if!!donef
+
+\def\inlinemathmargin{1pt}
+
+\settrue\autocrazymathsnapping
+
+% FROM NOW ON, CHANGES AS OPTIONS
+
+% TODO: SKYLINE (PREV LINE POS SCAN)
+
\def\dosnappedinlineformula[#1]#2%
{\ifvmode\dontleavehmode\fi % tricky
\strut % prevents funny space at line break
@@ -982,31 +982,66 @@
\else
\donefalse
\fi
+ \!!doneafalse % forced or not auto
+ \!!donebfalse % too heigh
+ \!!donecfalse % too low
+ \!!donedfalse % less before
+ \!!doneefalse % less after
\ifdone
\setbox\nextbox\hbox{$#2$}%
- \ifdim\nextboxht>\strutheight\relax
- \donetrue
- \else\ifdim\nextboxdp>\strutdepth\relax
+ \iftracegridsnapping
+ \setbox\nextbox\ruledhbox
+ {\incolortrue\localcolortrue
+ \backgroundline[gray]{\showstruts\strut\flushnextbox}}%
+ \fi
+ \def\docommando##1%
+ {\doif{##1}-{\settrue \halfcrazymathlines}%
+ \doif{##1}+{\setfalse\halfcrazymathlines}%
+ \doif{##1}={\!!doneatrue}%
+ \doif{##1}<{\!!donedtrue}%
+ \doif{##1}>{\!!doneetrue}}%
+ \processcommalist[#1]\docommando
+\if!!doneb
+ \if!!donec \else
+ \setfalse\halfcrazymathlines
+ \fi
+\else
+ \if!!donec
+ \setfalse\halfcrazymathlines
+ \fi
+\fi
+ \donefalse
+ \if!!donea
\donetrue
- \else
+\scratchdimen \nextboxht
+\advance\scratchdimen .5\lineheight
+\nextboxht\scratchdimen
+\scratchdimen \nextboxdp
+\advance\scratchdimen .5\lineheight
+\nextboxdp\scratchdimen
+ \else\ifdim\nextboxht>\strutht
+ \donetrue
+ \else\ifdim\nextboxdp>\strutdp
+ \donetrue
+ \fi\fi\fi
+ \ifconditional\autocrazymathsnapping \else \if!!donea \else
+ % don't compensate, just snap to strut
\donefalse
- \fi\fi
+ % signal for next else, snap line to strut
+ \!!doneatrue
+ \fi \fi
\fi
\ifdone
- \ifdim\nextboxht<\lineheight\relax
- \ifdim\nextboxdp<\strutheight\relax
- \donetrue
- \else
- \donefalse
- \fi
- \else
- \donefalse
- \fi
+ % analyze height
+ \scratchdimen\inlinemathmargin
+ \advance\scratchdimen \strutht
+ \ifdim\nextboxht<\scratchdimen \else \!!donebtrue \fi
+ % analyze depth
+ \scratchdimen\inlinemathmargin
+ \advance\scratchdimen \strutdp
+ \ifdim\nextboxdp<\scratchdimen \else \!!donectrue \fi
+ % analyzed or forced
\ifdone
- \flushcrazymathbox
- \else
- \doif{#1}-{\settrue \halfcrazymathlines}%
- \doif{#1}+{\setfalse\halfcrazymathlines}%
\global\advance\crazymathhack\plusone
\donefalse
\ifnum\MPp\crazymathtag=\lastcrazymathpage\relax
@@ -1024,67 +1059,61 @@
\xdef\lastcrazymathpage{\MPp\crazymathtag}%
\xdef\lastcrazymathline{\MPy\crazymathtag}%
\fi
- \getrawnoflines\nextboxht
- \scratchcounter\noflines
- \advance\noflines-\lastcrazymathprelines\relax
- \ifnum\noflines>\zerocount
- \xdef\lastcrazymathprelines{\the\scratchcounter}%
- \scratchdimen\noflines\lineheight
- \ifconditional\halfcrazymathlines
- \advance\scratchdimen-.5\lineheight
- \fi
- \advance\scratchdimen-\strutdepth
- \setbox\scratchbox\null
- \wd\scratchbox2\bodyfontsize
- \ht\scratchbox\scratchdimen
- \dp\scratchbox\strutdepth
- % % correct for fuzzy top of page situations
- % \scratchdimen\lastcrazymathprelines\lineheight
- % \advance\scratchdimen\MPy\crazymathtag
- % \advance\scratchdimen\lineheight
- % \advance\scratchdimen\topskip
- % \advance\scratchdimen-\strutheight
- % \dimen0=\MPy\crazytexttag
- % \advance\dimen0 \MPh\crazytexttag
- % \advance\scratchdimen-\dimen0\relax
- % % do we need correction at all
- % \ifdim\scratchdimen>\strutdepth\relax
- % \donefalse
- % \else\ifdim\scratchdimen<\zeropoint
- % \donefalse
- % \else
- % \donetrue
- % \fi\fi
- % % analysis done
- % \donefalse
- % \ifdone
- % \edef\crazymathcorrection{\the\scratchdimen}%
- % \advance\scratchdimen-\dp\scratchbox
- % \dp\scratchbox-\scratchdimen
- % \else
- % \let\crazymathcorrection\zeropoint
- % \fi
- \normalvadjust pre
- {%\allowbreak % sometimes breaks spacing
- \forgetall
- \crazymathindent
- \iftracegridsnapping\ruledhbox\fi{\box\scratchbox}%
- \endgraf
- \nobreak}%
- \else\ifnum\scratchcounter>\zerocount
- \normalvadjust pre
- {\nobreak}%
- \fi\fi
- \getrawnoflines\nextboxdp
- \scratchcounter\noflines
- \advance\noflines-\lastcrazymathpostlines\relax
- \ifnum\noflines>\zerocount
- \donetrue
- \else\ifnum\lastcrazymathpostlines=\zerocount
- \donetrue
+ \if!!doneb
+ % \getrawnoflines\nextboxht
+ \scratchdimen\nextboxht
+ \advance\scratchdimen-\strutht
+ \getnoflines\scratchdimen
+ \if!!doned \advance\noflines\minusone \fi
+ \scratchcounter\noflines
+ \advance\noflines-\lastcrazymathprelines\relax
+ \ifnum\noflines>\zerocount
+ \xdef\lastcrazymathprelines{\the\scratchcounter}%
+ \scratchdimen\noflines\lineheight
+ \ifconditional\halfcrazymathlines
+ \advance\scratchdimen-.5\lineheight
+ \fi
+ \advance\scratchdimen-\strutdepth
+ \setbox\scratchbox\null
+ \wd\scratchbox2\bodyfontsize
+ \ht\scratchbox\scratchdimen
+ \dp\scratchbox\strutdepth
+ %%% top correction code (see below)
+ \normalvadjust pre
+ {%\allowbreak % sometimes breaks spacing
+ \forgetall
+ \crazymathindent
+ \iftracegridsnapping
+ \setbox\scratchbox\hbox
+ {\incolortrue\localcolortrue\green
+ \ruledhbox{\box\scratchbox}}%
+ \fi
+ \box\scratchbox
+ \endgraf
+ \nobreak}%
+ \else\ifnum\scratchcounter>\zerocount
+ \normalvadjust pre
+ {\nobreak}%
+ \fi\fi
+ \fi
+ \if!!donec
+ % \getrawnoflines\nextboxdp
+ \scratchdimen\nextboxdp
+ \advance\scratchdimen-\strutdp
+ \getnoflines\scratchdimen
+ \if!!donee \advance\noflines\minusone \fi
+ \scratchcounter\noflines
+ \advance\noflines-\lastcrazymathpostlines\relax
+ \ifnum\noflines>\zerocount
+ \donetrue
+ \else\ifnum\lastcrazymathpostlines=\zerocount
+ \donetrue
+ \else
+ \donefalse
+ \fi\fi
\else
\donefalse
- \fi\fi
+ \fi
\ifdone
\xdef\lastcrazymathpostlines{\the\scratchcounter}%
\ifnum\lastcrazymathpostlines=\zerocount
@@ -1092,44 +1121,98 @@
\fi
\hbox{\setposition\crazymathtag\flushcrazymathbox}%
\scratchdimen\noflines\lineheight
+ \advance\scratchdimen-\lineheight
+ \advance\scratchdimen+\strutheight
+\ifdim\scratchdimen>\zeropoint \else
+ \scratchdimen=\strutheight % todo : test for half lines
+\fi
\ifconditional\halfcrazymathlines
\advance\scratchdimen-.5\lineheight
\fi
- \advance\scratchdimen+\strutheight
\setbox\scratchbox\null
- \wd\scratchbox\bodyfontsize
+ \wd\scratchbox2\bodyfontsize
\ht\scratchbox\scratchdimen
\dp\scratchbox\strutdepth
\normalvadjust
{\forgetall
\crazymathindent
- \iftracegridsnapping\ruledhbox\fi{\box\scratchbox}%
+ \iftracegridsnapping
+ \setbox\scratchbox\hbox
+ {\incolortrue\localcolortrue\blue
+ \ruledhbox{\box\scratchbox}}%
+ \fi
+ \box\scratchbox
\endgraf
- \allowbreak}% else we stick below the text bottom
+ % precaution: else we stick below the text bottom
+ \ifconditional\halfcrazymathlines
+ \allowbreak
+ \else
+ \vskip-\lineheight
+ \vskip \lineheight
+ \fi}%
\else
\hbox{\setposition\crazymathtag\flushcrazymathbox}%
\fi
+ \else
+ \flushcrazymathbox
\fi
+ \else\if!!donea
+ \flushcrazymathbox
\else
\mathematics{#2}%
- \fi
+ \fi\fi
\endgroup}
+
+%%% top correction code
+%%%
+%%% correct for fuzzy top of page situations
+%
+% \scratchdimen\lastcrazymathprelines\lineheight
+% \advance\scratchdimen\MPy\crazymathtag
+% \advance\scratchdimen\lineheight
+% \advance\scratchdimen\topskip
+% \advance\scratchdimen-\strutheight
+% \dimen0=\MPy\crazytexttag
+% \advance\dimen0 \MPh\crazytexttag
+% \advance\scratchdimen-\dimen0\relax
+% % do we need correction at all
+% \ifdim\scratchdimen>\strutdepth\relax
+% \donefalse
+% \else\ifdim\scratchdimen<\zeropoint
+% \donefalse
+% \else
+% \donetrue
+% \fi\fi
+% % analysis done
+% \donefalse
+% \ifdone
+% \edef\crazymathcorrection{\the\scratchdimen}%
+% \advance\scratchdimen-\dp\scratchbox
+% \dp\scratchbox-\scratchdimen
+% \else
+% \let\crazymathcorrection\zeropoint
+% \fi
+%
+%%%
+%%% keep the previous code
+%%%
+
\let\tform\mathematics
\let\gform\snappedinlineformula
% test set:
%
% \startbuffer
-% Crazy math \sform {1+x} or \sform {\dorecurse {100} {1+} 1 =
-% 101} and even gore crazy \sform {2^{2^2}_{1_1}}
-% again\dorecurse {20} { and again} \sform {\sqrt {\frac
+% Crazy math \gform {1+x} or \gform {\dorecurse {100} {1+} 1 =
+% 101} and even gore crazy \gform {2^{2^2}_{1_1}}
+% again\dorecurse {20} { and again} \gform {\sqrt {\frac
% {x^{5^5}} {\frac {1} {2}}}} even gore\dorecurse {50} { and
-% gore} \iform {\dorecurse {12} {\sform {\sqrt {\frac
-% {x^{5^5}} {3}}}+\sform {\sqrt {\frac {x^{5^5}} {\frac {1}
-% {2}}}}+}x=10}\dorecurse{20} { super crazy math}: \iform
-% {\dorecurse {30} {\sform {\sqrt {\frac {x^{5^5}} {3}}}+
-% \sform {\sqrt {\frac {x^{5^5}} {\frac {1} {2}}}}+ }x = 10},
+% gore} \tform {\dorecurse {12} {\gform {\sqrt {\frac
+% {x^{5^5}} {3}}}+\gform {\sqrt {\frac {x^{5^5}} {\frac {1}
+% {2}}}}+}x=10}\dorecurse{20} { super crazy math}: \tform
+% {\dorecurse {30} {\gform {\sqrt {\frac {x^{5^5}} {3}}}+
+% \gform {\sqrt {\frac {x^{5^5}} {\frac {1} {2}}}}+ }x = 10},
% and we're\dorecurse {20} { done}!
% \stopbuffer
%
@@ -1144,6 +1227,45 @@
% \setuplayout[grid=yes,lines=18]\getbuffer \page
% \setuplayout[grid=yes,lines=19]\getbuffer \page
% \stoptext
+%
+% test
+%
+% \startregels
+% \gform[<]{35 \cdot p^{\frac{3}{4}} = 70}
+% \gform{12{,}4 \cdot d^3 = 200}
+% \gform{a \cdot x^b}.
+% \gform{12x^6 \cdot \negative 3x^4}
+% \gform{\frac{12x^6}{\negative 3x^4}}
+% \gform{(4x^2)^3}
+% \gform{4x \sqrt{x} \cdot 3x^2}
+% \gform{\frac{2x^4}{4x \sqrt{x}}}
+% \gform{y = a \cdot x^b}.
+% \gform{y_1 = \frac{15x^2}{x}}
+% \gform{y_2 = x \cdot \sqrt{x}}
+% \gform{y_3 = \frac{6x^3}{x^2}}
+% \gform[<]{y_4 = \left(2x^2\right)^{\frac{1}{2}}}
+% \gform{y_1 = \frac{4x^5}{x^2}}
+% \gform{y_2 = 4 \cdot \sqrt{x}}
+% \gform{y_3 = 4x^3}
+% \gform{y_4 = \frac{100x}{\sqrt{x}}}
+% \gform[<]{y_5 = 4 \cdot x^{\frac{1}{2}}}
+% \gform{y_6 = \frac{1}{2} x \cdot 4x^2}
+% \gform{y_7 = 2 \cdot x^3}
+% \gform{y_8 = 100 \cdot x^{\frac{1}{2}}}
+% \gform{4x^8 \cdot 8x^3}
+% \gform{\frac{4x^8}{8x^3}}
+% \gform{\left(\negative3x^4\right)^3}
+% \gform{x^3 \sqrt{x} \cdot 3x^2}
+% \gform{\frac{6x^3}{x^2 \sqrt{x}}}
+% \gform{\frac{6}{2x^4}}
+% \gform{\frac{1}{3x^6}}
+% \gform{\frac{12x^8}{4x^{10}}}
+% \gform{\frac{4}{\sqrt{x}}}
+% \gform{\frac{1}{2x \sqrt{x}}}
+% \gform{\frac{2{,}25}{p} = 0{,}35}
+% \gform{4{,}50 + \frac{300}{k} = 4{,}70}
+% \gform{\frac{1200}{k+12} - 42 = 6}
+% \stopregels
%D \macro
%D {restoremathstyle}
diff --git a/tex/context/base/core-mis.tex b/tex/context/base/core-mis.tex
index 3478d2004..85270dec0 100644
--- a/tex/context/base/core-mis.tex
+++ b/tex/context/base/core-mis.tex
@@ -1776,7 +1776,7 @@
\def\definecombination
{\dodoubleempty\dodefinecombination}
-\def\definecombination[#1][#2]%
+\def\dodefinecombination[#1][#2]%
{\copyparameters
[\??co#1][\??co]
[\c!breedte,\c!hoogte,\c!afstand,\c!plaats,%
diff --git a/tex/context/base/core-obj.tex b/tex/context/base/core-obj.tex
index 33473b4c7..247a5f5b6 100644
--- a/tex/context/base/core-obj.tex
+++ b/tex/context/base/core-obj.tex
@@ -117,30 +117,52 @@
\inobjecttrue
\dowithnextbox{\dododosetobject{#1}{#2}{#3}\egroup}}
+% \def\dododosetobject#1#2#3%
+% {\blabelgroup
+% \dontshowcomposition % rather fuzzy in \setxvalue ... \hbox
+% \@EA\xdef\csname\r!object#2::#3\endcsname
+% {\noexpand\dohandleobject{#2}{#3}%
+% {\ifhbox\nextbox\hbox\else\vbox\fi}%
+% %{\the\nextboxwd}{\the\nextboxht}{\the\nextboxdp}}%
+% {\number\nextboxwd}{\number\nextboxht}{\number\nextboxdp}}%
+% \expanded % freeze the dimensions since \dostartobject may use \nextbox
+% {\dostartobject
+% {#2}{#3}{\the\nextboxwd}{\the\nextboxht}{\the\nextboxdp}}%
+% \ifcase#1\relax\else \ifdim\objectoffset>\zeropoint
+% \scratchdimen\objectoffset
+% \edef\width {\the\nextboxwd}%
+% \edef\height{\the\nextboxht}%
+% \edef\depth {\the\nextboxdp}%
+% \setbox\nextbox\vbox spread 2\scratchdimen
+% {\forgetall
+% \vss\hbox spread 2\scratchdimen{\hss\flushnextbox\hss}\vss}%
+% \setbox\nextbox\hbox
+% {\hskip-\scratchdimen\lower\scratchdimen\flushnextbox}%
+% \nextboxwd\width
+% \nextboxht\height
+% \nextboxdp\depth
+% \fi \fi
+% \flushnextbox
+% \dostopobject
+% \elabelgroup}
+
\def\dododosetobject#1#2#3%
{\blabelgroup
\dontshowcomposition % rather fuzzy in \setxvalue ... \hbox
+ \scratchdimen\objectoffset
\@EA\xdef\csname\r!object#2::#3\endcsname
{\noexpand\dohandleobject{#2}{#3}%
{\ifhbox\nextbox\hbox\else\vbox\fi}%
%{\the\nextboxwd}{\the\nextboxht}{\the\nextboxdp}}%
- {\number\nextboxwd}{\number\nextboxht}{\number\nextboxdp}}%
+ {\number\nextboxwd}{\number\nextboxht}{\number\nextboxdp}%
+ {\number\scratchdimen}}%
\expanded % freeze the dimensions since \dostartobject may use \nextbox
{\dostartobject
{#2}{#3}{\the\nextboxwd}{\the\nextboxht}{\the\nextboxdp}}%
\ifcase#1\relax\else \ifdim\objectoffset>\zeropoint
- \scratchdimen\objectoffset
- \edef\width {\the\nextboxwd}%
- \edef\height{\the\nextboxht}%
- \edef\depth {\the\nextboxdp}%
\setbox\nextbox\vbox spread 2\scratchdimen
- {\forgetall
+ {\forgetall \offinterlineskip
\vss\hbox spread 2\scratchdimen{\hss\flushnextbox\hss}\vss}%
- \setbox\nextbox\hbox
- {\hskip-\scratchdimen\lower\scratchdimen\flushnextbox}%
- \nextboxwd\width
- \nextboxht\height
- \nextboxdp\depth
\fi \fi
\flushnextbox
\dostopobject
@@ -151,7 +173,27 @@
\let\dohandleobject\dogetobject
\csname\r!object#1::#2\endcsname}
-\def\dogetobject#1#2#3#4#5#6%
+% \def\dogetobject#1#2#3#4#5#6%
+% {\initializepaper
+% \forgetall
+% \dontshowcomposition
+% \setbox\scratchbox\vbox
+% {\doinsertobject{#1}{#2}}%
+% \setbox\scratchbox#3%
+% {\vbox to #5\s!sp
+% {\ifdim\ht\scratchbox>#5\s!sp
+% % or \ifdim\wd\scratchbox>#4\s!sp
+% \vss\hbox to #4\s!sp{\hss\box\scratchbox\hss}\vss
+% \else
+% \vss\box\scratchbox
+% \fi}}%
+% \wd\scratchbox#4\s!sp
+% \ht\scratchbox#5\s!sp
+% \dp\scratchbox#6\s!sp
+% \box\scratchbox
+% \elabelgroup}
+
+\def\dogetobject#1#2#3#4#5#6#7%
{\initializepaper
\forgetall
\dontshowcomposition
@@ -165,6 +207,9 @@
\else
\vss\box\scratchbox
\fi}}%
+ \scratchdimen#7\s!sp
+ \setbox\nextbox\hbox
+ {\hskip-\scratchdimen\lower\scratchdimen\flushnextbox}%
\wd\scratchbox#4\s!sp
\ht\scratchbox#5\s!sp
\dp\scratchbox#6\s!sp
@@ -180,10 +225,16 @@
%D The results are reported in \type {\objectwidth}, \type
%D {\objectheight} and \type {\objectdepth}.
-\def\dogetobjectdimensions#1#2#3#4#5#6%
+% \def\dogetobjectdimensions#1#2#3#4#5#6%
+% {\def\objectwidth {#4\s!sp}%
+% \def\objectheight{#5\s!sp}%
+% \def\objectdepth {#6\s!sp}}
+
+\def\dogetobjectdimensions#1#2#3#4#5#6#7%
{\def\objectwidth {#4\s!sp}%
\def\objectheight{#5\s!sp}%
- \def\objectdepth {#6\s!sp}}
+ \def\objectdepth {#6\s!sp}%
+ \def\objectmargin{#7\s!sp}}
\def\getobjectdimensions#1#2%
{\let\dohandleobject\dogetobjectdimensions
@@ -243,6 +294,12 @@
\setxvalue{\r!driver#1::#2}{#3}%
\elabelgroup}
+\def\dosetdriverreference
+ {\driverreferenced\dosetobjectreference}
+
+\def\driverreferenced
+ {\global\objectreferencingfalse}
+
\def\defaultobjectreference#1#2{0}
\def\dogetobjectreference#1#2#3%
diff --git a/tex/context/base/core-pos.tex b/tex/context/base/core-pos.tex
index d44af3480..dec86b331 100644
--- a/tex/context/base/core-pos.tex
+++ b/tex/context/base/core-pos.tex
@@ -480,6 +480,7 @@
\initializenextposition
\def\currentposition{#1}%
\dosetposition\currentposition
+ \traceposstring\llap\green{\currentposition>}%
\dopositionaction\currentposition
\fi}
@@ -690,20 +691,20 @@
\def\epos#1{\removelastspace\hpos{e:#1}{\strut}}
\def\fpos#1%
- {\setpositionplus{b:#1}\parposcounter\hbox{\strut}%
+ {\setpositionplus{b:#1}\parposcounter\horizontalstrut
\ignorespaces}
\def\tpos#1%
{\removelastspace
- \setpositionplus{e:#1}\parposcounter\hbox{\strut}}
+ \setpositionplus{e:#1}\parposcounter\horizontalstrut}
\def\ffpos#1%
- {\setpositionplus{b:#1}\parposcounter\hbox{\strut}\wpos{#1}%
+ {\setpositionplus{b:#1}\parposcounter\horizontalstrut\wpos{#1}%
\ignorespaces}
\def\ttpos#1%
{\removelastspace
- \setpositionplus{e:#1}\parposcounter\hbox{\strut}}
+ \setpositionplus{e:#1}\parposcounter\horizontalstrut}
\def\wpos#1%
{\dontleavehmode\vadjust % may disappear if buried
@@ -817,31 +818,73 @@
%D {action when not overlapping}
%D \stoptypen
-\def\doifoverlappingelse#1#2#3#4%
- {\ifnum\MPp{#1}=\MPp{#2}\relax
- \bgroup
- \donefalse
+% \def\doifoverlappingelse#1#2#3#4%
+% {\relax\ifnum\MPp{#1}=\MPp{#2}\relax
+% \bgroup
+% \donefalse
+% \def\check##1##2%
+% {\ifdone\else
+% \ifdim\dimen1##1<\dimen0 \else \ifdim\dimen1##1>\dimen2 \else
+% \ifdim\dimen1##2<\dimen4 \else \ifdim\dimen1##2>\dimen6 \else
+% \donetrue
+% \fi\fi
+% \fi\fi
+% \fi}%
+% \dimen 0=\MPx{#1}%
+% \dimen 2=\MPx{#1}\advance\dimen 2 \MPw{#1}%
+% \dimen 4=\MPy{#1}\advance\dimen 4 -\MPd{#1}%
+% \dimen 6=\MPy{#1}\advance\dimen 6 \MPh{#1}%
+% \dimen10=\MPx{#2}%
+% \dimen12=\MPx{#2}\advance\dimen12 \MPw{#2}%
+% \dimen14=\MPy{#2}\advance\dimen14 -\MPd{#2}%
+% \dimen16=\MPy{#2}\advance\dimen16 \MPh{#2}%
+% %\message{\the\dimen 0-\the\dimen 2,\the\dimen 4-\the\dimen 6}\wait
+% %\message{\the\dimen10-\the\dimen12,\the\dimen14-\the\dimen16}\wait
+% \check04\check24\check26\check06\ifdone\egroup#3\else\egroup#4\fi
+% \else
+% #4%
+% \fi}
+
+\newdimen\overlappingmargin \overlappingmargin\zeropoint
+
+\def\doifoverlappingelse#1#2%
+ {\begingroup
+ \donefalse
+ \edef\!!stringa{#1}\edef\!!stringb{#2}%
+ \ifnum\MPp\!!stringa=\MPp\!!stringb\relax
\def\check##1##2%
- {\ifdone\else
- \ifdim\dimen1##1<\dimen0 \else \ifdim\dimen1##1>\dimen2 \else
- \ifdim\dimen1##2<\dimen4 \else \ifdim\dimen1##2>\dimen6 \else
- \donetrue
- \fi\fi
+ {\ifdim##1<\!!dimena \else \ifdim##1>\!!dimenb \else
+ \ifdim##2<\!!dimenc \else \ifdim##2>\!!dimend \else
+ \donetrue
\fi\fi
- \fi}%
- \dimen 0=\MPx{#1}%
- \dimen 2=\MPx{#1}\advance\dimen 2 \MPw{#1}%
- \dimen 4=\MPy{#1}\advance\dimen 4 -\MPd{#1}%
- \dimen 6=\MPy{#1}\advance\dimen 6 \MPh{#1}%
- \dimen10=\MPx{#2}%
- \dimen12=\MPx{#2}\advance\dimen12 \MPw{#2}%
- \dimen14=\MPy{#2}\advance\dimen14 -\MPd{#2}%
- \dimen16=\MPy{#2}\advance\dimen16 \MPh{#2}%
- %\message{\the\dimen 0-\the\dimen 2,\the\dimen 4-\the\dimen 6}\wait
- %\message{\the\dimen10-\the\dimen12,\the\dimen14-\the\dimen16}\wait
- \check04\check24\check26\check06\ifdone\egroup#3\else\egroup#4\fi
+ \fi\fi}%
+ \!!dimena\MPx\!!stringa
+ \!!dimenb\MPx\!!stringa\advance\!!dimenb \MPw\!!stringa
+ \!!dimenc\MPy\!!stringa\advance\!!dimenc-\MPd\!!stringa
+ \!!dimend\MPy\!!stringa\advance\!!dimend \MPh\!!stringa
+ \!!dimene\MPx\!!stringb
+ \!!dimenf\MPx\!!stringb\advance\!!dimenf \MPw\!!stringb
+ \!!dimeng\MPy\!!stringb\advance\!!dimeng-\MPd\!!stringb
+ \!!dimenh\MPy\!!stringb\advance\!!dimenh \MPh\!!stringb
+ \ifdim\overlappingmargin=\zeropoint\else
+ \advance\!!dimena-\overlappingmargin
+ \advance\!!dimenb+\overlappingmargin
+ \advance\!!dimenc-\overlappingmargin
+ \advance\!!dimend+\overlappingmargin
+ \advance\!!dimene-\overlappingmargin
+ \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
+ \ifdone
+ \endgroup\expandafter\firstoftwoarguments
\else
- #4%
+ \endgroup\expandafter\secondoftwoarguments
\fi}
%D \macros
@@ -2085,6 +2128,38 @@
\def\stackposleft {\dostackposbox{\copy\nextbox\hskip\nextboxwd\hskip\stackposdistance}}
\def\stackposright{\dostackposbox{\hskip\stackposdistance\hskip\nextboxwd\flushnextbox}}
+%D \macros
+%D {stackeddown}
+%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.
+
+\def\stackeddown
+ {\dowithnextbox
+ {\doglobal\increment\currentautopos
+ \hpos{\POSstackprefix\currentautopos}
+ {\edef\next
+ {\nextboxht\the\nextboxht
+ \nextboxdp\the\nextboxdp
+ \nextboxwd\the\nextboxwd}%
+ \let\previousautopos\currentautopos
+ \scratchdimen\zeropoint
+ \doloop
+ {\decrement\previousautopos
+ \doifoverlappingelse{\POSstackprefix\currentautopos}{\POSstackprefix\previousautopos}
+ {\advance\scratchdimen\MPh{\POSstackprefix\previousautopos}%
+ \advance\scratchdimen\MPd{\POSstackprefix\previousautopos}}%
+ \exitloop
+ \ifnum\previousautopos<\zerocount\exitloop\fi}%
+ \ifdim\scratchdimen>\zeropoint
+ \setbox\nextbox \hbox % \iftracepositons\ruledhbox\else\hbox\fi
+ {\lower\scratchdimen\flushnextbox}%
+ \next
+ \fi
+ \flushnextbox}}}
+
%D The next hack make sure that margin texts near faulty
%D strutted lines are handled ok.
diff --git a/tex/context/base/core-ref.tex b/tex/context/base/core-ref.tex
index 659aba09e..9d263c9dd 100644
--- a/tex/context/base/core-ref.tex
+++ b/tex/context/base/core-ref.tex
@@ -639,7 +639,7 @@
\let\currentsubtextreference\empty
\let\currentsubsubtextreference\empty}
-\def\dodosettextreferences#1#2#3#4\end%
+\def\dodosettextreferences#1#2#3#4\end
{\def\currenttextreference{#1}%
\def\currentsubtextreference{#2}%
\def\currentsubsubtextreference{#3}}
@@ -968,7 +968,7 @@
% \fi
% \fi
% \ifreferencefound \else
-% \let\referenceprefix=\empty
+% \let\referenceprefix\empty
% \@EA\ifx\csname\specialREFidentifier#1\endcsname\relax\else
% \@EA\@EA\@EA\splitofffullreference\@EA\@EA\@EA % 1 level
% {\csname\specialREFidentifier#1\endcsname}%
@@ -1007,7 +1007,7 @@
\def\dodoexpandreferences#1REF(#2#3)#4\relax
{\ifx#2\relax
\@EA\ifx\csname\specialREFidentifier#1\endcsname\relax
- \global\advance\nofexpandedreferences 1
+ \global\advance\nofexpandedreferences \plusone
\@EA\xdef\csname REF::\number\nofexpandedreferences\endcsname{#1}%
\else
\edef\expandedreference{\csname\specialREFidentifier#1\endcsname,}%
@@ -1104,7 +1104,7 @@
\ifcsname\specialREFidentifier#1\endcsname
\edef\expandedreference{\csname\specialREFidentifier#1\endcsname,}%
\else
- \global\advance\nofexpandedreferences 1
+ \global\advance\nofexpandedreferences \plusone
\@EA\xdef\csname REF::\number\nofexpandedreferences\endcsname{#1}%
\fi
\else
@@ -1125,7 +1125,7 @@
\fi}
\def\expandreferences#1%
- {\global\nofexpandedreferences0
+ {\global\nofexpandedreferences\zerocount
\doexpandreferences#1,],}
\def\dodoifreferencefoundelse#1%
@@ -1313,7 +1313,7 @@
\expandreferences{#1}%
\egroup
\doresetgotowhereever
- \global\nofsecondaryreferences 0
+ \global\nofsecondaryreferences \zerocount
\ifcase\nofexpandedreferences\relax % #1 can be number -)
% no ref
\or
@@ -1328,7 +1328,7 @@
\let\unharmedreferenceprefix\referenceprefix
\dodoifreferencefoundelse\secondaryreference
\ifreferencefound
- \global\nofsecondaryreferences 1
+ \global\nofsecondaryreferences \plusone
#2%
\else
\dostartnoto#3\dostopnoto
@@ -1339,7 +1339,7 @@
% more than two refs
\ifenablereferencechains \iflocation
\global\secondaryreferencetrue
- \scratchcounter2
+ \scratchcounter\plustwo
\loop
\xdef\secondaryreference{\csname REF::\number\scratchcounter\endcsname}%
\bgroup
@@ -1347,14 +1347,14 @@
\let\unharmedreferenceprefix\referenceprefix
\dodoifreferencefoundelse\secondaryreference
\ifreferencefound
- \global\advance\nofsecondaryreferences 1
+ \global\advance\nofsecondaryreferences \plusone
#2%
\else
\dostartnoto#3\dostopnoto
\fi
\egroup
\ifnum\scratchcounter<\nofexpandedreferences\relax
- \advance\scratchcounter 1
+ \advance\scratchcounter \plusone
\repeat
\fi \fi
\fi
@@ -1442,8 +1442,8 @@
\beginETEX
-\def\docheckinnerreference%
- {\global\let\predefinedreference=\currentinnerreference
+\def\docheckinnerreference
+ {\global\let\predefinedreference\currentinnerreference
\ifx\currentreferencearguments\empty
\ifcsname\r!cross\referenceprefix\currentfullreference\endcsname
\global\referencefoundtrue
@@ -1469,8 +1469,8 @@
\beginTEX
-\def\docheckinnerreference%
- {\global\let\predefinedreference=\currentinnerreference
+\def\docheckinnerreference
+ {\global\let\predefinedreference\currentinnerreference
\ifx\currentreferencearguments\empty
\@EA\ifx\csname\r!cross\referenceprefix\currentfullreference\endcsname\relax
\let\referenceprefix\empty
@@ -1529,7 +1529,7 @@
\beginTEX
-\def\dodocheckouterreference%
+\def\dodocheckouterreference
{\@EA\ifx\csname\specialREFidentifier\currentfullreference\endcsname\relax
\ifstrictouterreferences
\global\referencefoundfalse
@@ -1630,14 +1630,14 @@
\doifsomething{#2}
{\inlinker
{\infofont
- \dimen0=\linkermargebreedte
- \advance\dimen0 by -2em
- \doboundtext{#2}{\dimen0}{..}->}}%
+ \scratchdimen\linkermargebreedte
+ \advance\scratchdimen -2em
+ \doboundtext{#2}\scratchdimen{..}->}}%
\fi\fi
\doifpredefinedreferenceelse
{}
{\predefinereference
- \showmessage{\m!references}{#1}{[\unharmedreferenceprefix][#2]}}%
+ \showmessage\m!references{#1}{[\unharmedreferenceprefix][#2]}}%
\egroup}
\def\unknownreference{\reportreferenceerror1}
@@ -1646,15 +1646,13 @@
%D Although not actually needed, we default the unharmed
%D reference prefix to the normal one.
-\def\unharmedreferenceprefix%
- {\referenceprefix}
+\def\unharmedreferenceprefix{\referenceprefix}
%D When a reference is not found, we typeset a placeholder
%D (two glyphs are often enough to represent the reference
%D text).
-\def\dummyreference%
- {{\tttf ??}}
+\def\dummyreference{{\tttf ??}}
%D To prevent repetitive messages concerning a reference
%D being defined, we set such an unknown reference to an empty
@@ -1662,13 +1660,13 @@
\let\predefinedreference\s!unknown
-% \def\predefinereference%
+% \def\predefinereference
% {\setgvalue{\r!cross\predefinedreference}{\rt!cross{}{}{}{}}%
% \setgvalue{\r!cross\unharmedreferenceprefix\predefinedreference}{\rt!cross{}{}{}{}}}
\def\dummypredefinedreference{\r!cross{}{}{}{}}
-\def\predefinereference%
+\def\predefinereference
{\global\@EA\let\csname\r!cross\predefinedreference \endcsname\dummypredefinedreference
\global\@EA\let\csname\r!cross\unharmedreferenceprefix\endcsname\dummypredefinedreference}
@@ -1683,7 +1681,7 @@
% \doifelse{\getvalue{\r!cross\referenceprefix\predefinedreference}}{{}{}{}}
% {\egroup#1}{\egroup#2}}
-\def\doifpredefinedreferenceelse% \referenceprefix added
+\def\doifpredefinedreferenceelse % \referenceprefix added
{\@EA\ifx\csname\r!cross\referenceprefix\predefinedreference\endcsname\dummypredefinedreference
\expandafter\firstoftwoarguments
\else
@@ -1914,7 +1912,7 @@
% {\gotodestination{}{}{\s!aut\iftraceinternalreferences:#1\fi:#2}}
\def\thisisnextinternal#1%
- {\global\advance\locationcount 1
+ {\global\advance\locationcount \plusone
\ifinternalnamedreferences
\thisisdestination{\s!aut\iftraceinternalreferences:#1\fi:\nextinternalreference}%
\fi}
@@ -2174,7 +2172,7 @@
% \newif\ifreferencestrut % some day an option
-\def\setupreferencing%
+\def\setupreferencing
{\dosingleargument\dosetupreferencing}
\def\dosetupreferencing[#1]%
@@ -2191,20 +2189,20 @@
\v!label=>\let\dowantedreference\dolabelonlyreference,
\v!tekst=>\let\dowantedreference\dotextonlyreference,
\v!symbool=>\let\dowantedreference\dosymbolreference]%
- \chardef\autocrossfilereferences=0
+ \chardef\autocrossfilereferences\zerocount
\processaction
[\@@rfautofile]
- [ \v!ja=>\chardef\autocrossfilereferences=1,
- \v!pagina=>\chardef\autocrossfilereferences=2]%
- \chardef\referencefilecase=0
+ [ \v!ja=>\chardef\autocrossfilereferences\plusone,
+ \v!pagina=>\chardef\autocrossfilereferences\plustwo]%
+ \chardef\referencefilecase\zerocount
\processaction[\@@rfconverteerfile]
- [ \v!ja=>\chardef\referencefilecase=1,
- \v!groot=>\chardef\referencefilecase=1,
- \v!klein=>\chardef\referencefilecase=2]%
- %\doifelse{\@@rfstrut}{\v!ja} % some day an option
- % {\referencetruttrue}{\referencestrutfalse}%
+ [ \v!ja=>\chardef\referencefilecase\plusone,
+ \v!groot=>\chardef\referencefilecase\plusone,
+ \v!klein=>\chardef\referencefilecase\plustwo]%
+ %\doifelse\@@rfstrut\v!ja % some day an option
+ % \referencetruttrue\referencestrutfalse
\setupreferenceprefix[\@@rfprefix]%
- \doifelse{\@@rfglobaal}{\v!ja}
+ \doifelse\@@rfglobaal\v!ja
{\settrue \autoglobalfilereferences}
{\setfalse\autoglobalfilereferences}}
@@ -2286,8 +2284,7 @@
%D \haalbuffer
%D \stopregels
-\def\ref%
- {\dodoubleargument\doref}
+\def\ref{\dodoubleargument\doref}
\def\reftypep{\currentpagereference}
\def\reftypet{\currenttextreference}
@@ -2645,12 +2642,12 @@
\def\donaarspace#1[#2]%
{\iflocationsplit
- \ifsecondaryreference\setbox0=\hbox\fi % due to space insertion
- {\let\donaarspace=\donaarfixed
+ \ifsecondaryreference\setbox0\hbox\fi % due to space insertion
+ {\let\donaarspace\donaarfixed
\iflocation
\def\processisolatedword##1%
{\ifisolatedwords\ifsharesimilarreferences
- \global\advance\similarreference 1
+ \global\advance\similarreference \plusone
\fi\fi
\hbox{\gotolocation{#2}{##1\presetgoto}}}%
\doattributes\??ia\c!letter\c!kleur
@@ -2975,7 +2972,7 @@
\definespeciallocation\v!URL {\settrue \forceURLlocation\handlespecialallocationFILEandURL}
\definespeciallocation\v!url {\settrue \forceURLlocation\handlespecialallocationFILEandURL}
-\def\handlespecialFILEandURL%
+\def\handlespecialFILEandURL
{\localdoifreferencefoundelse
{\currentreferenceoperation::\currentreferencearguments}}
@@ -3027,13 +3024,13 @@
%D The latter gives access to the description of the program,
%D being the last argument to the definition command.
-\def\stelprogrammasin%
+\def\stelprogrammasin
{\dodoubleargument\getparameters[\??pr]}
\def\dodefinieerprogramma[#1][#2][#3]%
{\setgvalue{\v!programma:::#1}{\doprogramma{#2}{#3}}}
-\def\definieerprogramma%
+\def\definieerprogramma
{\dotripleargument\dodefinieerprogramma}
\def\programma#1[#2]%
diff --git a/tex/context/base/core-rul.tex b/tex/context/base/core-rul.tex
index a248a99a2..713fe52ae 100644
--- a/tex/context/base/core-rul.tex
+++ b/tex/context/base/core-rul.tex
@@ -2396,7 +2396,7 @@
\doifvalue{\??kd#1\c!dieptecorrectie}\v!aan % new, inside box
{\bgroup
\verticalstrut
- \vskip-\lineheight}%
+ \vskip-\struttotal}%
\blanko[\v!blokkeer]% plaatst signal
\doconvertfont{\getvalue{\??kd#1\c!letter}}\empty
\def\dostopframedtext{\dodostopframedtext{#1}{#2}}}
@@ -2410,7 +2410,7 @@
\removelastskip
\doifvalue{\??kd#1\c!dieptecorrectie}\v!aan % local and global
{\forgetall
- \vskip-\lineheight
+ \vskip-\struttotal
\verticalstrut
\egroup
\forgetall
@@ -2561,7 +2561,7 @@
\ht\scratchbox\strutht
\dp\scratchbox\strutdp
\noindent\box\scratchbox
-%\nobreak\verticalstrut\kern-\lineheight
+%\nobreak\verticalstrut\kern-\struttotal
% evt \witruimte
\egroup}
diff --git a/tex/context/base/core-sec.tex b/tex/context/base/core-sec.tex
index 6ee585198..8c479714e 100644
--- a/tex/context/base/core-sec.tex
+++ b/tex/context/base/core-sec.tex
@@ -11,6 +11,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+% nummeren per sectieblok implementeren
+
% this module needs a clean up, currently some manipulations
% take place multiple times
@@ -127,7 +129,7 @@
{\bgroup
\doifinstringelse{.0}{.#2}
{\doifnot{#3}\v!per
- {%\debuggerinfo{\m!systems}{number #1 #3 becomes \getnumbervariable{#1\c!wijze}}%
+ {%\debuggerinfo\m!systems{number #1 #3 becomes \getnumbervariable{#1\c!wijze}}%
\setevalue{\@@thenumber{#1}\c!wijze}{#3}% geen \xdef, gaat mis met \subpage
\dochecknummer{#1}}} % tricky and ugly
{\doifnotvalue{\@@thenumber{#1}\s!check}{#2}
@@ -746,7 +748,8 @@
\@@shortsectionnumber{#1}%
\fi}
-
+% suited for chinese too:
+%
% \def\@@shortsectionnumber#1%
% {\@EA\ifx\csname\??se#1\@@sectieblok\c!conversie\endcsname\relax
% \@@sectionvalue{#1}%
@@ -755,6 +758,21 @@
% \fi}
%
% obey eigennummer
+%
+% \def\@@shortsectionnumber#1%
+% {\@EA\ifx\csname\??se#1\c!eigennummer\endcsname\relax
+% \@EA\ifx\csname\??se#1\@@sectieblok\c!conversie\endcsname\relax
+% \@EA\ifx\csname\??se#1\c!conversie\endcsname\relax
+% \@@sectionvalue{#1}%
+% \else
+% \@@sectionconversion{#1}{\@@sectionvalue{#1}}%
+% \fi
+% \else
+% \@@sectionconversion{#1}{\@@sectionvalue{#1}}%
+% \fi
+% \else
+% \csname\??se#1\c!eigennummer\endcsname
+% \fi}
\def\@@shortsectionnumber#1%
{\@EA\ifx\csname\??se#1\c!eigennummer\endcsname\relax
@@ -771,19 +789,6 @@
\csname\??se#1\c!eigennummer\endcsname
\fi}
-% suited for chinese too:
-
-\def\@@shortsectionnumber#1%
- {\@EA\ifx\csname\??se#1\@@sectieblok\c!conversie\endcsname\relax
- \@EA\ifx\csname\??se#1\c!conversie\endcsname\relax
- \@@sectionvalue{#1}%
- \else
- \@@sectionconversion{#1}{\@@sectionvalue{#1}}%
- \fi
- \else
- \@@sectionconversion{#1}{\@@sectionvalue{#1}}%
- \fi}
-
\def\dosetlocalsectieblok#1#2#3% new \edef's
{\edef\@@sectiontype {#1}%
\edef\@@sectieblok {#2}%
@@ -1014,6 +1019,8 @@
% \hoofdstuk tekst
% \hoofdstuk <niets>
+\let\finalsectionnumber\empty
+
\def\dofinalsectionnumber
{\ifundefined{\@@sectie\c!nummer}\else
\ifsomeheadconversion
@@ -1521,13 +1528,13 @@
\def\doplaatskoptekst#1#2#3#4%
{\beginheadplacement{#1}%
- \iflegekop
- \setbox0\ifvertical\vbox\else\hbox\fi to \zeropoint
+ \iflegekop % = needed
+ \setbox0=\ifvertical\vbox\else\hbox\fi to \zeropoint
{\headnumbercontentfalse
\resetsystemmode\v!sectienummer
#2}%
\makestrutofbox0
- \else
+ \else % = needed
\setbox0=\ifvertical\vbox\else\hbox\fi % \vhbox
{\headnumbercontentfalse
\resetsystemmode\v!sectienummer
@@ -1536,6 +1543,7 @@
% outerside font determines distance
\dosetfontattribute{\??ko#1}\c!letter
% but we don't want color to influence user commands
+% todo: get the if-else out of it
\getvalue{\??ko#1\c!commando}
{} % no number
{\dostartattributes{\??ko#1}\c!letter\c!kleur\empty
@@ -1566,14 +1574,14 @@
\def\doplaatskopnummertekst#1#2#3#4#5% maybe move modes outside box
{\beginheadplacement{#1}%
- \iflegekop
- \setbox0\ifvertical\vbox\else\hbox\fi to \zeropoint
+ \iflegekop % = needed
+ \setbox0=\ifvertical\vbox\else\hbox\fi to \zeropoint
{\doiftextelse{#3}
{\setsystemmode \v!sectienummer\headnumbercontenttrue }
{\resetsystemmode\v!sectienummer\headnumbercontentfalse}%
#2}%
\makestrutofbox0
- \else
+ \else % = needed
\setbox0=\ifvertical\vbox\else\hbox\fi % \vhbox
{\doiftextelse{#3}
{\setsystemmode \v!sectienummer\headnumbercontenttrue }
@@ -1873,7 +1881,6 @@
\c!tekstletter=\getvalue{\??ko#1\c!letter},
\c!nummerkleur=\getvalue{\??ko#1\c!kleur},
\c!tekstkleur=\getvalue{\??ko#1\c!kleur}]%
-% \ConvertToConstant\doifinstringelse{=}{#2}
\doifassignmentelse{#2}
{\getparameters
[\??ko#1]
@@ -1917,8 +1924,9 @@
\c!hoofd,\c!tekst,\c!voet,\c!scheider,
\c!nummer,\c!eigennummer,\c!plaatskop,\c!verhoognummer,
\c!letter,\c!kleur,\c!afstand,\c!variant,\c!springvolgendein,
- %\c!nummerletter,\c!tekstletter,
- %\c!expansie, % why njet ?
+ % new per 20/03/3002 (o-pbu-l) / was too confusing
+ \c!nummerletter,\c!tekstletter,\c!expansie,
+ %
\c!uitlijnen,\c!titeluitlijnen,\c!tolerantie,\c!grid,
\c!nummercommando,\c!tekstcommando,\c!margetekst]}}%
\getparameters[\??ko#1][#2]%
@@ -1942,8 +1950,9 @@
\c!hoofd,\c!tekst,\c!voet,
\c!nummer,\c!eigennummer,\c!plaatskop,\c!verhoognummer,
\c!letter,\c!kleur,\c!afstand,\c!variant,\c!springvolgendein,
- %\c!nummerletter,\c!tekstletter,
- %\c!expansie, % why njet ?
+ % new per 20/03/3002 (o-pbu-l) / was too confusing
+ \c!nummerletter,\c!tekstletter,\c!expansie,
+ %
\c!uitlijnen,\c!titeluitlijnen,\c!tolerantie,\c!grid,
\c!nummercommando,\c!tekstcommando,\c!margetekst]%
\getparameters[\??ko#1][\c!expansie=]% iig een value, rather fuzzy
diff --git a/tex/context/base/core-spa.tex b/tex/context/base/core-spa.tex
index f5a6b7730..7a0872e84 100644
--- a/tex/context/base/core-spa.tex
+++ b/tex/context/base/core-spa.tex
@@ -116,7 +116,7 @@
\fi
-\def\presetnormallineheight%
+\def\presetnormallineheight
{\edef\normallineheight{\@@itregel}%
\iflocalinterlinespace \else
\doifdefined\bodyfontinterlinespecs
@@ -282,7 +282,7 @@
% \ifvmode %in pos fonts gaat dit mis
% \ifblankoforceer%\ifdim\prevdepth>\zeropoint\else
% % -1000pt signals top of page or column (\ejectcolumn)
-% \vbox{\strut}\kern-\lineheight
+% \verticalstrut\kern-\struttotal
% \fi
% \ifblankoblokkeer
% \global\doeblankofalse
@@ -536,262 +536,8 @@
% Overloaded in cont-new!
-% \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
-% \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 %in pos fonts gaat dit mis
-% \ifblankoforceer%\ifdim\prevdepth>\zeropoint\else
-% % -1000pt signals top of page or column (\ejectcolumn)
-% \verticalstrut
-% \kern-\lineheight
-% \fi
-% \ifblankoblokkeer
-% \global\doeblankofalse
-% \edef\oldprevdepth{\the\prevdepth}%
-% \prevdepth\newprevdepth
-% \else
-% \global\doeblankotrue
-% \fi
-% \ifblankoreset
-% \global\doeblankotrue
-% \ifdim\prevdepth=\newprevdepth
-% \prevdepth\oldprevdepth
-% \fi
-% \fi
-% \ifdoeblanko
-% \ifdim\lastskip<\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\prevdepth=\newprevdepth
-% % blokkeer
-% \else
-% \iffuzzyvskip
-% \removelastfuzzyvskip
-% \fuzzyvskip\blankoskip\relax
-% \else
-% \removelastskip
-% \vskip\blankoskip\relax
-% \fi
-% \fi
-% \else
-% \iffuzzyvskip
-% \removelastfuzzyvskip
-% \fuzzyvskip\blankoskip\relax
-% \fi
-% \fi
-% \fi
-% \fi
-% \fi
-% \global\fuzzyvskipfalse
-% \presetindentation}
-
\newsignal\noblanksignal
-% \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
-% \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 %in pos fonts gaat dit mis
-% \ifblankoforceer%\ifdim\prevdepth>\zeropoint\else
-% % -1000pt signals top of page or column (\ejectcolumn)
-% \vbox{\strut}\kern-\lineheight
-% \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
-% \ifgridsnapping
-% \ifdim\lastkern=\noblanksignal
-% \global\doeblankofalse
-% \fi
-% \else
-% \ifdim\prevdepth=\newprevdepth
-% \global\doeblankofalse
-% \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}
-
\def\docomplexdoblanko[#1]% pas op \relax's zijn nodig ivm volgende \if
{\global\blankoresetfalse
\global\blankoblokkeerfalse
@@ -815,7 +561,7 @@
\ifvmode %in pos fonts gaat dit mis
\ifblankoforceer%\ifdim\prevdepth>\zeropoint\else
% -1000pt signals top of page or column (\ejectcolumn)
- \vbox{\strut}\kern-\lineheight
+ \bgroup\forgeteverypar\verticalstrut\egroup\kern-\struttotal
\fi
\ifblankoblokkeer
\global\doeblankofalse
@@ -1570,13 +1316,15 @@
\def\toonregelcorrectie {\showbaselinecorrection}
\def\regelcorrectie {\baselinecorrection}
-\definecomplexorsimpleempty\startregelcorrectie
% \prevdepth crosses pageboundaries!
\let\dorondomregelcorrectie=\relax
-\def\complexstartregelcorrectie[#1]%
+\def\startregelcorrectie
+ {\dodoubleempty\dostartregelcorrectie}
+
+\def\dostartregelcorrectie[#1][#2]% #2 gobbles spaces
{\bgroup
\processaction
[#1]
@@ -1585,7 +1333,8 @@
\s!unknown=>{\def\dorondomregelcorrectie{\blanko[#1]}}]%
\dorondomregelcorrectie
\startbaselinecorrection
- \offbaselinecorrection}
+ \offbaselinecorrection
+ \ignorespaces}
\def\stopregelcorrectie
{\stopbaselinecorrection
@@ -1599,9 +1348,10 @@
\stopbaselinecorrection}%
\vbox}
-\def\verticalstrut{\vbox{\hsize\zeropoint\strut}}
+\def\verticalstrut {\normalvbox{\hsize\zeropoint\strut}}
+\def\horizontalstrut{\normalhbox {\strut}}
-\def\showstruts%
+\def\showstruts
{\setteststrut}
% Hieronder volgen enkele instellingen en macro's ten behoeve
@@ -1648,6 +1398,7 @@
\newdimen\openstrutheight
\newdimen\openstrutdepth
\newdimen\topskipgap
+\newdimen\struttotal
\def\strutheightfactor {.72}
\def\strutdepthfactor {.28}
@@ -1692,7 +1443,7 @@
\vskip-\openstrutheight
\fi
\verticalstrut
- \vskip-\openlineheight}
+ \vskip-\struttotal}
\def\settopskip % the extra test is needed for the lbr family
{\topskip\systemtopskipfactor\globalbodyfontsize
@@ -1729,7 +1480,7 @@
\normalbaselines}
\def\setspacingfactor#1\to#2\by#3\\%
- {\strutdimen#2pt\relax
+ {\strutdimen#2\s!pt
\strutdimen#3\strutdimen
\edef#1{\withoutpt{\the\strutdimen}}}
@@ -1776,7 +1527,7 @@
% The double \hbox construction enables us to \backtrack
% boxes.
-% \def\setstrut%
+% \def\setstrut
% {\setstrutdimen\strutheight\strutheightfactor\spacingfactor
% \setstrutdimen\strutdepth \strutdepthfactor \spacingfactor
% \let\strut=\normalstrut
@@ -1816,7 +1567,13 @@
\!!width \strutwidth
\!!height\strutheight
\!!depth \strutdepth
- \hss}}}
+ \hss}}%
+ \struttotal\strutht
+ \advance\struttotal\strutdp}
+
+%D The dimen \type {\struttotal} holds the exact size of the
+%D strut; occasionally a one scaled point difference can show
+%D up with the lineheight.
%D Sometimes a capstrut comes in handy
%D
@@ -1846,20 +1603,60 @@
{\def\strutwidth{.8pt}%
\setstrut}
+% simple version
+%
+% \def\begstrut
+% {\relax\ifcase\strutht\else
+% \strut
+% \normalpenalty\@M % \!!tenthousand
+% \normalhskip\zeropoint
+% \ignorespaces
+% \fi}
+%
+% \def\endstrut
+% {\relax\ifhmode\ifcase\strutht\else
+% \removeunwantedspaces
+% \normalpenalty\@M % \!!tenthousand
+% \normalhskip\zeropoint
+% \strut
+% \fi\fi}
+
+% when enabled, sigstruts will remove themselves if nothing
+% goes inbetween
+
+\newsignal\strutsignal \setfalse\sigstruts
+
\def\begstrut
{\relax\ifcase\strutht\else
- \strut
- \normalpenalty\@M % \!!tenthousand
- \normalhskip\zeropoint
+ \ifconditional\sigstruts
+ \noindent\horizontalstrut
+ \normalpenalty\@M % \!!tenthousand
+ \normalhskip-\strutsignal
+ \normalhskip\strutsignal
+ \else
+ \strut
+ \normalpenalty\@M % \!!tenthousand
+ \normalhskip\zeropoint
+ \fi
\ignorespaces
\fi}
\def\endstrut
{\relax\ifhmode\ifcase\strutht\else
- \removeunwantedspaces
- \normalpenalty\@M % \!!tenthousand
- \normalhskip\zeropoint
- \strut
+ \ifconditional\sigstruts
+ \ifdim\lastskip=\strutsignal
+ \unskip\unskip\unpenalty\setbox\scratchbox\lastbox
+ \else
+ \normalpenalty\@M % \!!tenthousand
+ \normalhskip\zeropoint
+ \strut
+ \fi
+ \else
+ \removeunwantedspaces
+ \normalpenalty\@M % \!!tenthousand
+ \normalhskip\zeropoint
+ \strut
+ \fi
\fi\fi}
\newbox\nostrutbox \setbox\nostrutbox\normalhbox{\normalhbox{}}
@@ -1872,7 +1669,7 @@
% unsave:
%
-% \def\pseudostrut%
+% \def\pseudostrut
% {\bgroup
% \setnostrut
% \normalstrut
@@ -1886,7 +1683,7 @@
%
% so:
-\def\pseudostrut%
+\def\pseudostrut
{\noindent} % better: \dontleavehmode
\let\pseudobegstrut\pseudostrut
@@ -2808,13 +2605,13 @@
\updateraggedskips}
\def\dosetraggedskips#1#2#3#4#5#6#7%
- {\chardef\raggedstatus#1\relax
- \leftskip1\leftskip\!!plus#2\relax % zie: Tex By Topic 8.1.3
- \rightskip1\rightskip\!!plus#3\relax % zie: Tex By Topic 8.1.3
- \spaceskip#4\relax
- \xspaceskip#5\relax
+ {\chardef \raggedstatus#1\relax
+ \leftskip 1\leftskip\!!plus#2\relax % zie: Tex By Topic 8.1.3
+ \rightskip 1\rightskip\!!plus#3\relax % zie: Tex By Topic 8.1.3
+ \spaceskip #4\relax
+ \xspaceskip #5\relax
\parfillskip\zeropoint\!!plus#6\relax
- \parindent#7\relax}
+ \parindent #7\relax}
% \def\notragged%
% {\setraggedskips{0}{0em}{0em}{0em}{0em}{1fil}{\parindent}}
@@ -2940,12 +2737,17 @@
{\par
\egroup}
+\chardef\alignstrutmode=1
+
\def\doalignline#1#2% \\ == newline
{\bgroup
\setlocalhsize % new
\def\\{\egroup\par\doalignline{#1}{#2}\bgroup}%
\dowithnextbox
- {\noindent\hbox to \localhsize{\strut#1\unhbox\nextbox#2}\egroup}
+ {\noindent
+ \hbox to \localhsize
+ {\ifcase\alignstrutmode\or\strut\fi
+ #1\unhbox\nextbox#2}\egroup}
\hbox}
% directe commando's
@@ -2962,8 +2764,7 @@
\setvalue{\s!do\v!regel\v!rechts}{\doalignline \hss \relax}
\setvalue{\s!do\v!regel\v!midden}{\doalignline \hss \hss }
-\def\doregelplaats#1%
- {\getvalue{\s!do\v!regel#1}}
+\def\doregelplaats#1{\csname\s!do\v!regel#1\endcsname}
%D Experimental:
@@ -2973,7 +2774,8 @@
\def\\{\egroup\par\doxalignline{#1}{#2}\bgroup}% inefficient
\dowithnextbox
{\noindent\hbox to \localhsize
- {\strut\signalrightpage
+ {\ifcase\alignstrutmode\or\strut\fi
+ \signalrightpage
\doifrightpageelse{#1\unhbox\nextbox#2}{#2\unhbox\nextbox#1}}%
\egroup}
\hbox}
@@ -2983,8 +2785,7 @@
%D Better:
-\def\doregelplaats#1%
- {\getvalue{\s!do\v!regel#1}}
+\def\doregelplaats#1{\csname\s!do\v!regel#1\endcsname}
\def\alignedline#1#2% setting default
{\csname
diff --git a/tex/context/base/core-tab.tex b/tex/context/base/core-tab.tex
index 320ee324e..7a1a00671 100644
--- a/tex/context/base/core-tab.tex
+++ b/tex/context/base/core-tab.tex
@@ -476,7 +476,7 @@
{\removelastskip % itemize or so
\par
\ifnum\prevgraf>\zerocount % we want at least
- \strut \geenwitruimte \vskip-\lineheight % one line of text
+ \verticalstrut \geenwitruimte \vskip-\struttotal% one line of text
\egroup
\ifdim\dp\scratchbox>\lineheight % see (*) for an
\getnoflines{\dp\scratchbox}% % example of where
@@ -1265,7 +1265,7 @@
\def\removeTABLEtopskip
{\ifinsidefloat
- \hbox{\strut}\kern-\lineheight
+ \verticalstrut\kern-\struttotal
\else
\hbox{}\kern-\topskip
\fi}
diff --git a/tex/context/base/core-tbl.tex b/tex/context/base/core-tbl.tex
index ff8aa2f9b..cd49e2fc1 100644
--- a/tex/context/base/core-tbl.tex
+++ b/tex/context/base/core-tbl.tex
@@ -1118,8 +1118,8 @@
\ifinsidefloat\else
\doifemptyvalue{\??tt\currenttabulate\c!na} % no expansion
{\vskip\strutdp
- \vbox{\strut}%
- \vskip-\lineheight}%
+ \verticalstrut
+ \vskip-\struttotal}%
\fi}}%
\startframedcontent[\getvalue{\??tt\currenttabulate\c!kader}]%
%
diff --git a/tex/context/base/core-ver.tex b/tex/context/base/core-ver.tex
index 4b302422a..f7327cf59 100644
--- a/tex/context/base/core-ver.tex
+++ b/tex/context/base/core-ver.tex
@@ -128,7 +128,7 @@
\installnewpretty I {\setupprettiesintype{EIF}\setupprettytype} % E taken
\installnewpretty X {\setupprettiesintype{XML}\setupprettytype}
- \def\setupcommonverbatim#1%
+\def\setupcommonverbatim#1%
{\eightbitcharactersfalse % obey regime / encoding
%
\def\prettyidentifier{TEX}%
@@ -146,6 +146,7 @@
\doifvalue{#1\c!tab} \s!ascii{\chardef\tabskipmode2}% quit on >127
\doifvalue{#1\c!pagina}\v!nee{\def\obeypages {\ignorepages}}%
%
+ \ignorehyphens % default
\ExpandFirstAfter\processaction
[\getvalue{#1\c!regels}]
[ \v!ja=>\obeybreakpoints,
@@ -565,27 +566,46 @@
%D works all right, but a decent hyphenation support of
%D \type{\tt} text will be implemented soon.
+% \def\obeyhyphens
+% {\def\obeyedspace{\hskip\spaceskip}%
+% \edef\savedfont{\the\font}%
+% \ttsl\hyphenchar\font45
+% \tttf\hyphenchar\font45
+% \savedfont
+% \spaceskip.5em\!!plus.25em\!!minus.25em\relax}
+%
+% \def\obeybreakpoints
+% {\def\obeyedspace{\hskip\spaceskip}%
+% \spaceskip.5em
+% \veryraggedright}
+
\def\obeyhyphens
- {\def\obeyedspace{\hskip\spaceskip}%
- \edef\savedfont{\the\font}%
- \ttsl\hyphenchar\font=45
- \tttf\hyphenchar\font=45
- \savedfont
- \spaceskip.5em\!!plus.25em\!!minus.25em\relax}
+ {\def\obeyedspace {\hskip\spaceskip}%
+ \def\controlspace{\hskip\zeropoint\hbox{\char32}\hskip\zeropoint}%
+ \spaceskip.25em\!!plus.5em\!!minus.25em\relax}
\def\obeybreakpoints
- {\def\obeyedspace{\hskip\spaceskip}%
- \spaceskip.5em
+ {\ignorehyphens
\veryraggedright}
+\def\ignorehyphens
+ {\def\obeyedspace {\null\hskip\spaceskip\null}%
+ \def\controlspace{\null\hskip\zeropoint\hbox{\char32}\hskip\zeropoint\null}%
+ \spaceskip.5em\relax}
+
%\unexpanded\def\typ
% {\bgroup
% \obeyhyphens
% \futurelet\next\dotype}
+%\unexpanded\def\typ
+% {\bgroup
+% \obeyhyphens
+% \futurelet\next\dodotype}
+
\unexpanded\def\typ
{\bgroup
- \obeyhyphens
+ \let\@@tyregels\v!afgebroken
\futurelet\next\dodotype}
%D \macros
diff --git a/tex/context/base/enco-ini.tex b/tex/context/base/enco-ini.tex
index e7a8cc80a..93fba6933 100644
--- a/tex/context/base/enco-ini.tex
+++ b/tex/context/base/enco-ini.tex
@@ -551,6 +551,12 @@
\edef\charactermapping {@\s!default @}
\edef\characterregime {@\s!default @}
+% todo, else \d j == \dj, print file and check
+
+\def\accentprefix {}%{*}
+\def\commandprefix {}%{=}
+\def\characterprefix{}%{-}
+
%D \macros
%D {startcoding, reducetocoding}
%D
@@ -565,17 +571,17 @@
% etex : \ifcsname
\def\donthandleaccent#1#2% \empty makes #2={} save % no \unexpanded
- {\ifundefined{\characterencoding#1\string#2\empty}%
+ {\ifundefined{\accentprefix\characterencoding#1\string#2\empty}%
#2%
\else
- \csname\characterencoding#1\string#2\empty\endcsname
+ \csname\accentprefix\characterencoding#1\string#2\empty\endcsname
\fi}
\def\donthandlecommand#1% % no \unexpanded, otherwise pdfdoc will fail
- {\ifundefined{\characterencoding#1}% as well as hyph patterns
+ {\ifundefined{\commandprefix\characterencoding#1}% as well as hyph patterns
#1%
\else
- \csname\characterencoding#1\endcsname
+ \csname\commandprefix\characterencoding#1\endcsname
\fi}
\def\enableencoding
@@ -705,28 +711,28 @@
\def\dododefineaccent#1 #2 #3 %
{\setvalue{#1}{\dohandleaccent{#1}}%
\doifnumberelse{\string#3}
- {\setvalue{\characterencoding#1\string#2}{\char#3 }} % space added
- {\setvalue{\characterencoding#1\string#2}{#3}}}
+ {\setvalue{\accentprefix\characterencoding#1\string#2}{\char#3 }} % space added
+ {\setvalue{\accentprefix\characterencoding#1\string#2}{#3}}}
\beginTEX
\def\dohandleaccent#1#2%
- {\@EA\ifx\csname\characterencoding#1\string#2\empty\endcsname\relax
- \@EA\ifx\csname\nocharacterencoding#1\string#2\empty\endcsname\relax
- \@EA\ifx\csname\characterencoding#1\endcsname\relax
-% \@EA\ifx\csname\nocharacterencoding#1\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
% \donormaltextaccent{#1}{#2}%
% \else
- \csname\nocharacterencoding#1\endcsname{#2}%
+ \csname\accentprefix\nocharacterencoding#1\endcsname{#2}%
% \fi
\else
- \csname\characterencoding#1\endcsname{#2}%
+ \csname\accentprefix\characterencoding#1\endcsname{#2}%
\fi
\else
- \csname\nocharacterencoding#1\string#2\empty\endcsname
+ \csname\accentprefix\nocharacterencoding#1\string#2\empty\endcsname
\fi
\else
- \csname\characterencoding#1\string#2\empty\endcsname
+ \csname\accentprefix\characterencoding#1\string#2\empty\endcsname
\fi}
\endTEX
@@ -734,14 +740,14 @@
\beginETEX \ifcsname
\def\dohandleaccent#1#2%
- {\ifcsname\characterencoding#1\string#2\empty\endcsname
- \csname\characterencoding#1\string#2\empty\endcsname
- \else\ifcsname\nocharacterencoding#1\string#2\empty\endcsname
- \csname\nocharacterencoding#1\string#2\empty\endcsname
- \else\ifcsname\characterencoding#1\endcsname
- \csname\characterencoding#1\endcsname{#2}%
- \else%\ifcsname\nocharacterencoding#1\endcsname
- \csname\nocharacterencoding#1\endcsname{#2}%
+ {\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
+ \else\ifcsname\accentprefix\characterencoding#1\endcsname
+ \csname\accentprefix\characterencoding#1\endcsname{#2}%
+ \else%\ifcsname\accentprefix\nocharacterencoding#1\endcsname
+ \csname\accentprefix\nocharacterencoding#1\endcsname{#2}%
% \else
% \donormaltextaccent{#1}{#2}%
\fi\fi\fi}%\fi}
@@ -766,18 +772,18 @@
\def\definecharacter#1 #2 %
{\ifundefined{#1}\setvalue{#1}{\dohandlecharacter{#1}}\fi
\doifnumberelse{\string#2}
- {\setvalue{\characterencoding\string#1}{\char#2 }% watch the space
+ {\setvalue{\characterprefix\characterencoding\string#1}{\char#2 }% watch the space
\doautosetregime{#1}{#2}}
- {\setvalue{\characterencoding\string#1}{#2}}}
+ {\setvalue{\characterprefix\characterencoding\string#1}{#2}}}
% better
%
% \def\definecharacter#1 #2 %
% {\ifundefined{#1}\setvalue{#1}{\dohandlecharacter{#1}}\fi
% \doifnumberelse{\string#2}
-% {\setevalue{\characterencoding\string#1}{\noexpand\charofnum{\number#2}}% watch the space
+% {\setevalue{\characterprefix\characterencoding\string#1}{\noexpand\charofnum{\number#2}}% watch the space
% \doautosetregime{#1}{#2}}
-% {\setvalue{\characterencoding\string#1}{#2}}}
+% {\setvalue{\characterprefix\characterencoding\string#1}{#2}}}
%
% \def\charofnum#1{\char#1 }
% \def\byteofnum#1{\rawcharacter{#1}}
@@ -785,7 +791,7 @@
\beginTEX
\def\dohandlecharacter#1%
- {\csname\expandafter\ifx\csname\characterencoding#1\endcsname\relax
+ {\csname\characterprefix\expandafter\ifx\csname\characterprefix\characterencoding#1\endcsname\relax
\nocharacterencoding\else\characterencoding\fi#1\endcsname}
\endTEX
@@ -793,20 +799,20 @@
\beginETEX \ifcsname
\def\dohandlecharacter#1%
- {\csname\ifcsname\characterencoding#1\endcsname
+ {\csname\characterprefix\ifcsname\characterprefix\characterencoding#1\endcsname
\characterencoding\else\nocharacterencoding\fi#1\endcsname}
\endETEX
\def\defaultcharacter#1%
- {\csname\nocharacterencoding\strippedcsname#1\endcsname}
+ {\csname\characterprefix\nocharacterencoding\strippedcsname#1\endcsname}
%D Instead of numbers, a command may be entered.
\def\definecommand#1 #2 %
{\setvalue{\string#1}{\dohandlecommand{#1}}%
%\redefinecommand #1 % just to be sure
- \setvalue{\characterencoding\string#1}{#2}}
+ \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
@@ -884,8 +890,8 @@
\def\dodefineaccentcommand#1 #2 % \string toegevoegd
{\doifnumberelse{\string#2}
- {\setvalue{\characterencoding\string#1}##1{{\accent#2 ##1}}}
- {\setvalue{\characterencoding\string#1}##1{{#2##1}}}%
+ {\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.
@@ -974,17 +980,11 @@
{% no \unexpanded, else pdfdoc fails
\setvalue{\string#1}{\dohandlecommand{#1}}}%
-% \unexpanded\def\dohandlecommand#1%
-% {\doifdefinedelse{\characterencoding#1}
-% {\def\next{\getvalue{\characterencoding#1}}}
-% {\def\next{\getvalue{\nocharacterencoding#1}}}%
-% \next}
-
\beginETEX \ifcsname
\def\dohandlecommand#1%
- {\csname
- \ifcsname\characterencoding#1\endcsname
+ {\csname\commandprefix
+ \ifcsname\commandprefix\characterencoding#1\endcsname
\characterencoding
\else
\nocharacterencoding
@@ -996,8 +996,8 @@
\beginTEX
\def\dohandlecommand#1%
- {\csname
- \expandafter\ifx\csname\characterencoding#1\endcsname\relax
+ {\csname\commandprefix
+ \expandafter\ifx\csname\commandprefix\characterencoding#1\endcsname\relax
\nocharacterencoding
\else
\characterencoding
@@ -1331,6 +1331,7 @@
\definecommand ` {\buildtextaccent\textgrave}
\definecommand ' {\buildtextaccent\textacute}
+\definecommand r {\buildtextaccent\textring}
\definecommand v {\buildtextaccent\textcaron}
\definecommand u {\buildtextaccent\textbreve}
\definecommand = {\buildtextaccent\textmacron}
diff --git a/tex/context/base/lang-grk.tex b/tex/context/base/lang-grk.tex
index 4cda4f3c1..0b000e8a1 100644
--- a/tex/context/base/lang-grk.tex
+++ b/tex/context/base/lang-grk.tex
@@ -1,9 +1,9 @@
%D \module
%D [ file=lang-grk,
-%D version=1997.09.03,
+%D version=2003.04.01,
%D title=\CONTEXT\ Language Macros,
-%D subtitle=Greek Languages,
-%D author=Hans Hagen / Tobias Burnus,
+%D subtitle=Uralic Languages,
+%D author=Apostolos Syropoulos
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
@@ -11,18 +11,79 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\writestatus{loading}{Greek Languages}
-%D The framework of this module is set up by Hans Hagen while
-%D many of the first translations were done by Tobias. Later
-%D on, corrections were made by users. If you have suggestions,
-%D or feel that your name missing here, don't hesitate to send
-%D us an email.
+\writestatus{loading}{Greek Language}
-% Modern Greek
+%D The framework of this module is set up by Hans Hagen while
+%D all the translations have been done by Apostolos Syropoulos
\unprotect
-\protect
+\installlanguage
+ [\s!gr]
+ [\c!spatiering=\v!opelkaar,
+ \c!leftsentence=---,
+ \c!rightsentence=---,
+ \c!leftsubsentence=---,
+ \c!rightsubsentence=---,
+ \c!leftquote=\Greekleftquot,
+ \c!rightquote=\Greekrightquot,
+ \c!leftquotation=\Greekleftquot,
+ \c!rightquotation=\Greekrightquot,
+ \c!datum={\v!dag\ \v!maand\ \v!jaar},
+ \c!status=\v!stop]
+
+\installlanguage [greek] [\s!gr]
+
+\setupheadtext [\s!fi] [\v!inhoud=\GreekPi\Greekepsilon\Greekrho\Greekiota\Greekepsilon\Greekchi\Greekomicrontonos\Greekmu\Greekepsilon\Greeknu\Greekalpha]
+\setupheadtext [\s!fi] [\v!tabellen=\GreekPi\Greekiotatonos\Greeknu\Greekalpha\Greekkappa\Greekepsilon\Greekfinalsigma]
+\setupheadtext [\s!fi] [\v!figuren=\GreekSigma\Greekchi\Greeketatonos\Greekmu\Greekalpha\Greektau\Greekalpha]
+\setupheadtext [\s!fi] [\v!grafieken=\GreekGamma\Greekrho\Greekalpha\Greekphi\Greekiota\Greekkappa\Greekalphatonos]
+\setupheadtext [\s!fi] [\v!intermezzos=\GreekPi\Greekalpha\Greekupsilontonos\Greeksigma\Greekepsilon\Greekiota\Greekfinalsigma]
+\setupheadtext [\s!fi] [\v!index=\GreekEpsilon\Greekupsilon\Greekrho\Greekepsilon\Greektau\Greeketatonos\Greekrho\Greekiota\Greekomicron]
+\setupheadtext [\s!fi] [\v!afkortingen=\GreekSigma\Greekupsilon\Greeknu\Greektau\Greekomicron\Greekmu\Greekomicron\Greekgamma\Greekrho\Greekalpha\Greekphi\Greekiotatonos\Greekepsilon\Greekfinalsigma]
+\setupheadtext [\s!fi] [\v!logos=\GreekLamda\Greekomicron\Greekgamma\Greekomicrontonos\Greektau\Greekupsilon\Greekpi\Greekalpha]
+\setupheadtext [\s!fi] [\v!eenheden=\GreekMu\Greekomicron\Greeknu\Greekalphatonos\Greekdelta\Greekepsilon\Greekfinalsigma]
+
+
+\setuplabeltext [\s!fi] [\v!tabel=\GreekPi\Greekiotatonos\Greeknu\Greekalpha\Greekkappa\Greekalpha\Greekfinalsigma]
+\setuplabeltext [\s!fi] [\v!figuur=\GreekSigma\Greekchi\Greeketatonos\Greekmu\Greekalpha]
+\setuplabeltext [\s!fi] [\v!intermezzo=\GreekPi\Greekalpha\Greekupsilontonos\Greeksigma\Greeketa]
+\setuplabeltext [\s!fi] [\v!grafiek=\GreekGamma\Greekrho\Greekalpha\Greekphi\Greekiota\Greekkappa\Greekomicrontonos]
+\setuplabeltext [\s!fi] [\v!hoofdstuk=\GreekKappa\Greekepsilon\Greekphi\Greekalphatonos\Greeklamda\Greekalpha\Greekiota\Greekomicron]
+\setuplabeltext [\s!fi] [\v!paragraaf=\GreekEpsilon\Greeknu\Greekomicrontonos\Greektau\Greeketa\Greektau\Greekalpha]
+\setuplabeltext [\s!fi] [\v!sub\v!paragraaf=\GreekUpsilon\Greekpi\Greekomicrontonos\Greekepsilon\Greeknu\Greekomicrontonos\Greektau\Greeketa\Greektau\Greekalpha]
+\setuplabeltext [\s!fi] [\v!sub\v!sub\v!paragraaf=]
+\setuplabeltext [\s!fi] [\v!sub\v!sub\v!sub\v!paragraaf=]
+\setuplabeltext [\s!fi] [\v!bijlage=\GreekPi\Greekalpha\Greekrho\Greekalphatonos\Greekrho\Greektau\Greeketa\Greekmu\Greekalpha]
+\setuplabeltext [\s!fi] [\v!deel=\GreekMu\Greekepsilontonos\Greekrho\Greekomicron\Greekfinalsigma]
+\setuplabeltext [\s!fi] [\v!regel=\GreekGamma\Greekrho\Greekalpha\Greekmu\Greekmu\Greeketatonos]
+\setuplabeltext [\s!fi] [\v!regels=\GreekGamma\Greekrho\Greekalpha\Greekmu\Greekmu\Greekepsilontonos\Greekfinalsigma]
+
+\setuplabeltext [\s!fi] [\v!january=\GreekIota\Greekalpha\Greeknu\Greekomicron\Greekupsilon\Greekalphatonos\Greekrho\Greekiota\Greekomicron\Greekfinalsigma]
+\setuplabeltext [\s!fi] [\v!february=\GreekPhi\Greekepsilon\Greekbeta\Greekrho\Greekomicron\Greekupsilon\Greekalphatonos\Greekrho\Greekiota\Greekomicron\Greekfinalsigma]
+\setuplabeltext [\s!fi] [\v!march=\GreekMu\Greekalphatonos\Greekrho\Greektau\Greekiota\Greekomicron\Greekfinalsigma]
+\setuplabeltext [\s!fi] [\v!april=\GreekAlpha\Greekpi\Greekrho\Greekiotatonos\Greeklamda\Greekiota\Greekomicron\Greekfinalsigma]
+\setuplabeltext [\s!fi] [\v!may=\GreekMu\Greekalphatonos\Greekiota\Greekomicron\Greekfinalsigma]
+\setuplabeltext [\s!fi] [\v!june=\GreekIota\Greekomicron\Greekupsilontonos\Greeknu\Greekiota\Greekomicron\Greekfinalsigma]
+\setuplabeltext [\s!fi] [\v!july=\GreekIota\Greekomicron\Greekupsilontonos\Greeklamda\Greekiota\Greekomicron\Greekfinalsigma]
+\setuplabeltext [\s!fi] [\v!august=\GreekAlpha\Greekupsilontonos\Greekgamma\Greekomicron\Greekupsilon\Greeksigma\Greektau\Greekomicron\Greekfinalsigma]
+\setuplabeltext [\s!fi] [\v!september=\GreekSigma\Greekepsilon\Greekpi\Greektau\Greekepsilontonos\Greekmu\Greekbeta\Greekrho\Greekiota\Greekomicron\Greekfinalsigma]
+\setuplabeltext [\s!fi] [\v!october=\GreekOmicron\Greekkappa\Greektau\Greekomegatonos\Greekbeta\Greekrho\Greekiota\Greekomicron\Greekfinalsigma]
+\setuplabeltext [\s!fi] [\v!november=\GreekNu\Greekomicron\Greekepsilontonos\Greekmu\Greekbeta\Greekrho\Greekiota\Greekomicron\Greekfinalsigma]
+\setuplabeltext [\s!fi] [\v!december=\GreekDelta\Greekepsilon\Greekkappa\Greekepsilontonos\Greekmu\Greekbeta\Greekrho\Greekiota\Greekomicron\Greekfinalsigma]
+
+
+\setuplabeltext [\s!fi] [\v!sunday=\GreekKappa\Greekupsilon\Greekrho\Greekiota\Greekalpha\Greekkappa\Greeketatonos]
+\setuplabeltext [\s!fi] [\v!monday=\GreekDelta\Greekepsilon\Greekupsilon\Greektau\Greekepsilontonos\Greekrho\Greekalpha]
+\setuplabeltext [\s!fi] [\v!tuesday=\GreekTau\Greekrho\Greekiotatonos\Greektau\Greeketa]
+\setuplabeltext [\s!fi] [\v!wednesday=\GreekTau\Greekepsilon\Greektau\Greekalphatonos\Greekrho\Greektau\Greeketa]
+\setuplabeltext [\s!fi] [\v!thursday=\GreekPi\Greekepsilontonos\Greekmu\Greekpi\Greektau\Greeketa]
+\setuplabeltext [\s!fi] [\v!friday=\GreekPi\Greekalpha\Greekrho\Greekalpha\Greeksigma\Greekkappa\Greekepsilon\Greekupsilon\Greeketatonos]
+\setuplabeltext [\s!fi] [\v!saturday=\GreekSigma\Greekalphatonos\Greekbeta\Greekbeta\Greekalpha\Greektau\Greekomicron]
+
+%D \ShowAllLanguageValues [\s!gr] [\GreekEpsilon\Greeklamda\Greeklamda\Greeketa\Greeknu\Greekiota\Greekkappa\Greekalphatonos]
+
+\protect
-\endinput
+\endinput
diff --git a/tex/context/base/m-plus.tex b/tex/context/base/m-plus.tex
index cd3a72757..93e2521cb 100644
--- a/tex/context/base/m-plus.tex
+++ b/tex/context/base/m-plus.tex
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D Somewhere in 2001 i started collecting new functionality
+%D Somewhere in 2001 I started collecting new functionality
%D in a module \type {m-yesno}. As the name suggests, I was
%D not entirely sure if this functionality belonged in the
%D kernel. When (again) on the \CONTEXT\ list a request for
diff --git a/tex/context/base/math-eul.tex b/tex/context/base/math-eul.tex
index 0ec35fe16..75dec7156 100644
--- a/tex/context/base/math-eul.tex
+++ b/tex/context/base/math-eul.tex
@@ -1,127 +1,103 @@
%D \module
%D [ file=math-eul,
-%D version=2001.04.12,
+%D version=2003.02.03,
%D title=\CONTEXT\ Math Macros,
-%D subtitle=Euler Specials,
-%D author={Hans Hagen \& Taco Hoekwater},
+%D subtitle=Virtual Euler Specials,
+%D author={Hans Hagen \& Taco Hoekwater \& Adam Lindsay},
%D date=\currentdate,
%D copyright=\PRAGMA]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\unprotect
-
-\startmathcollection[eul]
-
-\definemathcharacter [0] [alpha] [mi] [30]
-\definemathcharacter [1] [alpha] [mi] [31]
-\definemathcharacter [2] [alpha] [mi] [32]
-\definemathcharacter [3] [alpha] [mi] [33]
-\definemathcharacter [4] [alpha] [mi] [34]
-\definemathcharacter [5] [alpha] [mi] [35]
-\definemathcharacter [6] [alpha] [mi] [36]
-\definemathcharacter [7] [alpha] [mi] [37]
-\definemathcharacter [8] [alpha] [mi] [38]
-\definemathcharacter [9] [alpha] [mi] [39]
-
+%C details. Further modified by Adam Lindsay.
+
+\unprotect
+
+%D We follow the following mappings from type-eul:
+%D mr [MathRoman] [Euler-Roman] [zeurm10]
+%D mi [MathItalic] [Euler-Italic] [zeurm10]
+%D ex [MathExtension] [Euler-Extension] [zeuex10]
+%D sy [MathSymbol] [Euler-Symbol] [zeusm10]
+%D mb [MathBeta] [Charter-Roman] [bchr8r]
+%D mc [MathGamma] [Euler-Fraktur] [eufm10]
+%D
+%D The inclusion of Bitstream Charter was originally for the text accents.
+%D Obviously, it's not a proper ``MathBeta'' font.
+
+
+%D The varrho and varsigma characters don't exist in eulervm,
+%D so we point at the normal types.
+\startmathcollection [eul]
+\definemathsymbol [varrho] [nothing] [vargreek] ["1A]
+\definemathsymbol [varsigma] [nothing] [vargreek] ["1B]
\stopmathcollection
-\startmathcollection[eul]
-
-\definemathsymbol [intop] [op] [ma] ["52]
-\definemathsymbol [ointop] [op] [ma] ["48]
-\definemathsymbol [coprod] [op] [ma] ["60]
-\definemathsymbol [prod] [op] [ma] ["51]
-\definemathsymbol [sum] [op] [ma] ["50]
-\definemathsymbol [braceld] [nothing] [ma] ["7A]
-\definemathsymbol [bracerd] [nothing] [ma] ["7B]
-\definemathsymbol [bracelu] [nothing] [ma] ["7C]
-\definemathsymbol [braceru] [nothing] [ma] ["7D]
-\definemathsymbol [infty] [ord] [ma] ["31]
-\definemathsymbol [nearrow] [rel] [ma] ["25]
-\definemathsymbol [searrow] [rel] [ma] ["26]
-\definemathsymbol [nwarrow] [rel] [ma] ["2D]
-\definemathsymbol [swarrow] [rel] [ma] ["2E]
-\definemathsymbol [Leftrightarrow] [rel] [ma] ["2C]
-\definemathsymbol [Leftarrow] [rel] [ma] ["28]
-\definemathsymbol [Rightarrow] [rel] [ma] ["29]
-\definemathsymbol [leftrightarrow] [rel] [ma] ["24]
-\definemathsymbol [leftarrow] [rel] [ma] ["20]
-\definemathsymbol [gets] [rel] [ma] ["20] % leftarrow
-\definemathsymbol [rightarrow] [rel] [ma] ["21]
-\definemathsymbol [to] [rel] [ma] ["21] % rightarrow
-\definemathsymbol [uparrow] [rel] [ma] ["22] [ex] ["78]
-\definemathsymbol [downarrow] [rel] [ma] ["23] [ex] ["79]
-\definemathsymbol [updownarrow] [rel] [ma] ["6C] [ex] ["3F]
-\definemathsymbol [Uparrow] [rel] [ma] ["2A] [ex] ["7E]
-\definemathsymbol [Downarrow] [rel] [ma] ["2B] [ex] ["7F]
-\definemathsymbol [Updownarrow] [rel] [ma] ["6D] [ex] ["77]
-
-\definemathsymbol [leftharpoonup] [rel] [ma] ["18]
-\definemathsymbol [leftharpoondown] [rel] [ma] ["19]
-\definemathsymbol [rightharpoonup] [rel] [ma] ["1A]
-\definemathsymbol [rightharpoondown] [rel] [ma] ["1B]
-
+\startmathcollection [eul]
+\definemathcharacter [!] [close] [mc] ["21]
+\definemathcharacter [(] [open] [mc] ["28]
+\definemathcharacter [)] [close] [mc] ["29]
+\definemathcharacter [+] [bin] [mc] ["2B]
+\definemathcharacter [:] [rel] [sy] ["BA]
+\definemathcharacter [;] [punct] [sy] ["BB]
+\definemathcharacter [=] [rel] [mi] ["82]
+\definemathcharacter [?] [close] [sy] ["BF]
+\definemathcharacter [91] [open] [sy] ["DB] % [
+\definemathcharacter [93] [close] [sy] ["DD] % ]
\stopmathcollection
-\startmathcollection[eul]
-
-\definemathcharacter [+] [bin] [mc] ["2B]
-\definemathcharacter [-] [bin] [mc] ["2D]
-\definemathcharacter [!] [ord] [mc] ["21]
-\definemathcharacter [(] [open] [mc] ["28]
-\definemathcharacter [)] [close] [mc] ["29]
-\definemathcharacter [91] [open] [mc] ["5B]
-\definemathcharacter [93] [close] [mc] ["5D]
-\definemathcharacter [=] [rel] [mc] ["3D]
-
-\definemathcharacter [(] [nothing] [mc] ["28] [ex] ["00]
-\definemathcharacter [)] [nothing] [mc] ["29] [ex] ["01]
-\definemathcharacter [91] [nothing] [mc] ["5B] [ex] ["02]
-\definemathcharacter [93] [nothing] [mc] ["5D] [ex] ["03]
-
+\startmathcollection [eul]
+\definemathcharacter [(] [nothing] [sy] ["A8] [ex] ["00]
+\definemathcharacter [)] [nothing] [sy] ["A9] [ex] ["01]
+\definemathcharacter [91] [nothing] [sy] ["DB] [ex] ["02] % [
+\definemathcharacter [93] [nothing] [sy] ["DD] [ex] ["03] % ]
+\definemathcharacter [/] [nothing] [mi] ["3D] [ex] ["0E]
\stopmathcollection
-\startmathcollection[eul]
-
-\definemathsymbol [Gamma] [alpha] [mi] ["00]
-\definemathsymbol [Delta] [alpha] [mi] ["01]
-\definemathsymbol [Theta] [alpha] [mi] ["02]
-\definemathsymbol [Lambda] [alpha] [mi] ["03]
-\definemathsymbol [Xi] [alpha] [mi] ["04]
-\definemathsymbol [Pi] [alpha] [mi] ["05]
-\definemathsymbol [Sigma] [alpha] [mi] ["06]
-\definemathsymbol [Upsilon] [alpha] [mi] ["07]
-\definemathsymbol [Phi] [alpha] [mi] ["08]
-\definemathsymbol [Psi] [alpha] [mi] ["09]
-\definemathsymbol [Omega] [alpha] [mi] ["0A]
-
+\startmathcollection [eul]
+\definemathsymbol [hbar] [nothing] [mi] ["80]
\stopmathcollection
-\startmathcollection[eul]
-
-\definemathsymbol [Relbar] [rel] [mr] ["3D]
-\definemathsymbol [aleph] [ord] [sy] ["40] % ?
-\definemathsymbol [lbrace] [open] [mb] ["66] [ma] ["08]
-\definemathsymbol [rbrace] [close] [mb] ["67] [ma] ["09]
-\definemathsymbol [leq] [rel] [mb] ["14]
-\definemathsymbol [le] [rel] [mb] ["14]
-\definemathsymbol [geq] [rel] [mb] ["15]
-\definemathsymbol [ge] [rel] [mb] ["15]
-\definemathsymbol [Re] [ord] [mb] ["3C]
-\definemathsymbol [Im] [ord] [mb] ["3D]
-\definemathsymbol [vert] [nothing] [mb] ["6A] [ex] ["0C]
-\definemathsymbol [backslash] [nothing] [mb] ["6E] [ex] ["0F]
+%D I used my discretion in substituting Charter here for the CM glyphs
+%D brought in by the eulervm virtual font
+\startmathcollection [eul]
+\definemathsymbol [ddagger] [bin] [mb] ["87]
+\definemathsymbol [dagger] [bin] [mb] ["86]
+\stopmathcollection
+\startmathcollection [eul]
+\definemathsymbol [colon] [punct] [sy] ["BA]
\stopmathcollection
-\startmathcollection[eul]
+%D This is very hackish; it brings in text accents from the
+%D well-matched Bitstream Charter.
+\startmathcollection [eul]
+\definemathsymbol [acute] [accent] [mb] ["B4]
+\definemathsymbol [grave] [accent] [mb] ["1E]
+\definemathsymbol [ddot] [accent] [mb] ["A8]
+\definemathsymbol [tilde] [accent] [mb] ["98]
+\definemathsymbol [bar] [accent] [mb] ["AF]
+\definemathsymbol [breve] [accent] [mb] ["0B]
+\definemathsymbol [check] [accent] [mb] ["10]
+%\definemathsymbol [hat] [accent] [mc] ["5E]
+\definemathsymbol [hat] [accent] [mb] ["88]
+\definemathsymbol [dot] [accent] [mb] ["01]
+\stopmathcollection
-\definemathcommand [varsigma] {\sigma}
-\definemathcommand [varrho] {\rho}
+\startmathcollection [eul]
+\definemathsymbol [lgroup] [open] [sy] ["A8] [ex] ["3A] % ?
+\definemathsymbol [rgroup] [close] [sy] ["A9] [ex] ["3B] % ?
+\stopmathcollection
+\startmathcollection [eul]
+\definemathsymbol [dag] [box] [mb] ["86]
+\definemathsymbol [ddag] [box] [mb] ["87]
+\definemathsymbol [S] [box] [mb] ["A7]
+\definemathsymbol [P] [box] [mb] ["B6]
+%%% originals before substituting Charter characters
+%\definemathsymbol [dag] [box] [sy] ["79]
+%\definemathsymbol [ddag] [box] [sy] ["7A]
+%\definemathsymbol [S] [box] [sy] ["78]
+%\definemathsymbol [P] [box] [sy] ["7B]
\stopmathcollection
-\protect \endinput
+\protect \endinput
diff --git a/tex/context/base/math-lbr.tex b/tex/context/base/math-lbr.tex
index 45bfcba0a..c3c463254 100644
--- a/tex/context/base/math-lbr.tex
+++ b/tex/context/base/math-lbr.tex
@@ -17,6 +17,8 @@
\definemathsymbol [blacktriangleright] [rel] [mi] ["F0]
\definemathsymbol [blacktriangleleft] [rel] [mi] ["F1]
+\definemathsymbol [boxplus] [bin] [sy] ["EA]
+\definemathsymbol [boxminus] [bin] [sy] ["EB]
\definemathsymbol [boxtimes] [bin] [sy] ["EC]
\stopmathcollection
diff --git a/tex/context/base/meta-dum.tex b/tex/context/base/meta-dum.tex
new file mode 100644
index 000000000..01a58c4ba
--- /dev/null
+++ b/tex/context/base/meta-dum.tex
@@ -0,0 +1,113 @@
+%D \module
+%D [ file=meta-dum,
+%D version=2003.03.21,
+%D title=\METAPOST\ Graphics,
+%D subtitle=Dummy (External) Graphics,
+%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.
+
+\unprotect
+
+%D This library overloads the normal external figure
+%D placeholder by a nicer one.
+%D
+%D \startbuffer
+%D \useMPlibrary[dum]
+%D
+%D \startlinecorrection
+%D \useMPgraphic{placeholder}{width=3cm,height=4cm,color=red}
+%D \stoplinecorrection
+%D
+%D \startlinecorrection
+%D \useMPgraphic{placeholder}{width=8cm,height=10cm,color=green}
+%D \stoplinecorrection
+%D
+%D \startlinecorrection
+%D \externalfigure[unknown-a][width=3cm,height=1cm]
+%D \stoplinecorrection
+%D
+%D \startlinecorrection
+%D \externalfigure[unknown-b][width=4cm,height=5cm]
+%D \stoplinecorrection
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+
+% currently preparempvariables is unable to resolve number
+% fractions like reduction
+
+\startuseMPgraphic{placeholder}{width,height,color}
+ numeric w, h, d, r ; color c ; path p ;
+ c := \MPvar{color} ;
+ w := \MPvar{width} ;
+ h := \MPvar{height} ;
+ r := \MPvar{reduction} ;
+ d := max(w,h) ;
+ p := unitsquare xyscaled (w,h) ;
+ fill p withcolor r[.5c,white] ;
+ for i := 1 upto 60 :
+ fill fullcircle
+ scaled (d/5 randomized (d/5))
+ shifted (center p randomized (d))
+ withcolor r[c randomized(.3,.9),white] ;
+ endfor ;
+ clip currentpicture to p ;
+\stopuseMPgraphic
+
+\definepalet
+ [placeholder]
+ [1=red,2=green,3=blue,4=cyan,5=magenta,6=yellow]
+
+\newcounter\figurereplacementcycle
+
+\setupexternalfigures
+ [\c!reductie=0,
+ \c!tekst=\v!ja]
+
+\def\externalfigurereplacement#1#2#3%
+ {\getpaletsize[placeholder]%
+ \doglobal\increment\figurereplacementcycle
+ \ifnum\figurereplacementcycle>\paletsize
+ \globallet\figurereplacementcycle\!!plusone
+ \fi
+ \weightGRAYfalse % monochrome anyway
+ \defineoverlay
+ [\s!dummy]
+ [\useMPgraphic
+ {placeholder}%
+ {width=\figurewidth,
+ height=\figureheight,
+ reduction=\@@efreductie,
+ color=placeholder:\figurereplacementcycle}]%
+ \expanded{\localframed
+ [\??ef]
+ [\c!breedte=\figurewidth,
+ \c!hoogte=\figureheight,
+ \c!kader=\v!uit,
+ \c!strut=\v!nee,
+ \c!achtergrond=\s!dummy,
+ \c!voorgrondkleur=white]}%
+ {\doif\@@eftekst\v!ja
+ {\infofont\stelinterliniein \nohyphens
+ \doifelse{#1}\s!dummy \!!doneafalse\!!doneatrue
+ \doifelse{#2}\s!dummy \!!donebfalse\!!donebtrue
+ \doifelse{#3}\s!unknown\!!donecfalse\!!donectrue
+ \if!!donea
+ name: \expanded{\verbatimstring{#1}}\strut\endgraf
+ \fi
+ \if!!doneb
+ \if!!donea file: \else \if!!donec file: \fi \fi
+ \expanded{\verbatimstring{#2}}\strut\endgraf
+ \fi
+ \if!!donec
+ state: \expanded{\verbatimstring{#3}}\strut\endgraf
+ \fi}}}
+
+\def\dummyfigure{\externalfigure[placeholder]}
+
+\protect \endinput
diff --git a/tex/context/base/meta-ini.tex b/tex/context/base/meta-ini.tex
index 9fcf66cf3..e32ae3bdf 100644
--- a/tex/context/base/meta-ini.tex
+++ b/tex/context/base/meta-ini.tex
@@ -238,7 +238,7 @@
\getvalue{\@@MPG\overlaystamp:#1}%
\elabelgroup}
-\long\def\startuniqueMPgraphic%
+\long\def\startuniqueMPgraphic
{\dodoublegroupempty\dostartuniqueMPgraphic}
\long\def\dostartuniqueMPgraphic#1#2#3\stopuniqueMPgraphic%
@@ -268,7 +268,7 @@
\deallocateMPslot\currentMPgraphic
\elabelgroup}
-\long\def\startuseMPgraphic%
+\long\def\startuseMPgraphic
{\dodoublegroupempty\dostartuseMPgraphic}
\long\def\dostartuseMPgraphic#1#2#3\stopuseMPgraphic%
@@ -276,7 +276,7 @@
\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%
@@ -329,6 +329,36 @@
% todo: each code/page/buffer a var class
+%D \macros
+%D {startuniqueMPpagegraphic,uniqueMPpagegraphic}
+%D
+%D Experimental.
+
+\def\MPpageprefix{\doifoddpageelse oe:}
+
+\def\overlaypagestamp
+ {\MPpageprefix\overlaywidth:\overlayheight:\overlaydepth
+ :\MPcolor\overlaycolor:\MPcolor\overlaylinecolor}
+
+\long\def\startuniqueMPpagegraphic
+ {\dodoublegroupempty\dostartuniqueMPpagegraphic}
+
+\long\def\dostartuniqueMPpagegraphic#1#2#3\stopuniqueMPpagegraphic
+ {\blabelgroup
+ \long\setgvalue{\@@MPG o:#1}{\handleuniqueMPgraphic{o:#1}{#2}{#3}}%
+ \long\setgvalue{\@@MPG e:#1}{\handleuniqueMPgraphic{e:#1}{#2}{#3}}%
+ \elabelgroup}
+
+\unexpanded\def\uniqueMPpagegraphic
+ {\dodoublegroupempty\douniqueMPpagegraphic}
+
+\def\douniqueMPpagegraphic#1#2%
+ {\blabelgroup
+ \let\overlaystamp\overlaypagestamp
+ \setupMPvariables[#1][#2]%
+ \getvalue{\@@MPG\MPpageprefix#1}{}%
+ \elabelgroup}
+
%D One way of defining a stamp is:
%D
%D \starttypen
@@ -436,7 +466,7 @@
%D For the moment, the next one is a private macro:
-\def\processMPbuffer%
+\def\processMPbuffer
{\dosingleempty\doprocessMPbuffer}
\def\doprocessMPbuffer[#1]%
diff --git a/tex/context/base/meta-nav.tex b/tex/context/base/meta-nav.tex
new file mode 100644
index 000000000..5628e6f7b
--- /dev/null
+++ b/tex/context/base/meta-nav.tex
@@ -0,0 +1,65 @@
+%D \module
+%D [ file=meta-nav,
+%D version=2003.03.28,
+%D title=\METAPOST\ Graphics,
+%D subtitle=Navigational Graphics,
+%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.
+
+\unprotect
+
+\startuniqueMPgraphic{navplus}{size,color,type,mode}
+ 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 :
+ 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)
+ xyscaled (4,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 ;
+\stopuniqueMPgraphic
+
+\setupMPvariables
+ [navplus]
+ [size=1ex,
+ color=black,
+ type=1,
+ mode=0]
+
+\definepalet
+ [navplus]
+ [attach=darkred,
+ comment=darkblue]
+
+\definesymbol
+ [comment-normal]
+ [\uniqueMPgraphic{navplus}{type=1,color=navplus:comment}]
+\definesymbol
+ [comment-down]
+ [\uniqueMPgraphic{navplus}{type=1,color=navplus:comment,mode=1}]
+
+\definesymbol
+ [attach-normal]
+ [\uniqueMPgraphic{navplus}{type=2,color=navplus:attach}]
+\definesymbol
+ [attach-down]
+ [\uniqueMPgraphic{navplus}{type=2,color=navplus:attach,mode=1}]
+
+\setupcomment [\c!symbool={comment-normal,comment-down}]
+\setupattachments[\c!symbool={attach-normal,attach-down}]
+
+\protect \endinput
diff --git a/tex/context/base/meta-pag.tex b/tex/context/base/meta-pag.tex
index 6edca4e47..dd1ef6506 100644
--- a/tex/context/base/meta-pag.tex
+++ b/tex/context/base/meta-pag.tex
@@ -32,6 +32,7 @@
InPageBody := \ifinpagebody true \else false \fi ;
def LoadPageState =
OnRightPage := \MPonrightpage ;
+ OnOddPage := \MPonoddpage ;
RealPageNumber := \the\realpageno ;
PageNumber := \the\pageno ;
NOfPages := \lastpage ;
@@ -73,20 +74,24 @@
OuterEdgeWidth := \the\outeredgewidth ;
PageOffset := \the\pageoffset ;
PageDepth := \the\pagedepth ;
+ LayoutColumns := \the\layoutcolumns ;
+ LayoutColumnDistance:= \the\layoutcolumndistance ;
+ LayoutColumnWidth := \the\layoutcolumnwidth ;
enddef ;
\stopuseMPgraphic
\def\MPonrightpage{true}
+\def\MPonoddpage {true}
-\def\freezeMPpagelayout%
- {% the \edef\MPonrightpage{....} alternative is slower
- \doifbothsides
+\def\freezeMPpagelayout
+ {\doifbothsides
\def\MPonrightpage{true}%
\orsideone
\def\MPonrightpage{true}%
\orsidetwo
\def\MPonrightpage{false}%
- \od}
+ \od
+ \edef\MPonoddpage{\doifoddpageelse{true}{false}}}
\iffixedlayoutdimensions
diff --git a/tex/context/base/mult-com.tex b/tex/context/base/mult-com.tex
index 6dc0ab5b9..217e62763 100644
--- a/tex/context/base/mult-com.tex
+++ b/tex/context/base/mult-com.tex
@@ -814,9 +814,6 @@ stelnummerin: stelnummerin setupnumber
setupitemgroups setupitemgroups
setupitemgroups setupitemgroups
-% setupitemgroups: stelopsommingenin setupitemizations
-% stelleaufzaehlungenein nastavvycty
-% impostaelencazioni setareitemization
% startitemize: startopsomming startitemize
% startaufzaehlung startvycet
% iniziaelenco startenumerare
@@ -1695,7 +1692,7 @@ moveformula: verplaatsformule moveformula
geentest: geentest donttest
keintest zadnytest
notest nutesta
- stelcommentaarin: stelcommentaarin setupcomment
+ setupcomment: stelcommentaarin setupcomment
stellekommentarein nastavkomentar
impostacommento seteazacomentariu
commentaar: commentaar comment
@@ -1826,6 +1823,19 @@ definecolumnbreak: definieerkolomovergang definecolumnbreak
% ^ ^ ^ nadenken over \settextvariable vs \setuptextvariable in nl
+%D For downward compatibilities sake:
+
+\startcommands dutch english
+ german czech
+ italian romanian
+
+
+ setupitemgroups: stelopsommingenin setupitemizations
+ stelleaufzaehlungenein nastavvycty
+ impostaelencazioni setareitemization
+
+\stopcommands
+
%D \stopcompressdefinitions
%D There are a lot of variables that users can use in setups
@@ -1991,6 +2001,14 @@ definecolumnset: definieerkolomgroep definecolumnset
stopcolumnset stopcolumnset
terminagruppocolonne stopcolumnset
+startcolumnmakeup: startkolomopmaak startcolumnmakeup
+ startcolumnmakeup startcolumnmakeup
+ startcolumnmakeup startcolumnmakeup
+
+ stopcolumnmakeup: stopkolomopmaak stopcolumnmakeup
+ stopcolumnmakeup stopcolumnmakeup
+ stopcolumnmakeup stopcolumnmakeup
+
usetypescript: gebruiktypescript usetypescript
usetypescript usetypescript
usetypescript usetypescript
diff --git a/tex/context/base/mult-con.tex b/tex/context/base/mult-con.tex
index b5661567b..95b17d7b8 100644
--- a/tex/context/base/mult-con.tex
+++ b/tex/context/base/mult-con.tex
@@ -1078,6 +1078,9 @@ proces: proces process
stap: stap step
schritt krok
passo pas
+ stapel: stapel stack
+ stack stack
+ stack stack % TB GB
start: start start
start start
inizia start
@@ -1394,6 +1397,9 @@ trefwoord: trefwoord keyword
altijd: altijd always
immer vzdy
sempre totdeauna
+ auto: auto auto
+ auto auto
+ auto auto
autointro: autointro autointro
autointro autouvod
autointro autointro
@@ -1880,6 +1886,9 @@ proces: proces process
rek: rek stretch
strecken natahnout
dilata dilatat
+ rugwit: rugwit backspace
+ rumpfspatium zpetnamezera
+ backspace spatiuspate % GB
ruim: ruim broad
breit siroky
ampio broad
@@ -1901,6 +1910,9 @@ proces: proces process
smal: smal narrow
schmall uzky
stretto ingust
+ snijwit: snijwit cutspace
+ cutspace cutspace
+ cutspace cutspace % GB
soepel: soepel tolerant
tolerant tolerantni
tollerante tolerant
@@ -2437,7 +2449,7 @@ geencontrole: geencontrole nocheck
linenote: regelnoot linenote
linenote linenote
linenote linenote
- commentaar: commentaar comment
+ comment: commentaar comment
kommentar komentar
commento comentariu
interactiemenu: interactiemenu interactionmenu
@@ -2603,10 +2615,10 @@ geencontrole: geencontrole nocheck
ZeigeFeld UkazPole
MostraCampo AfiseazaCamp
- FitWidth: FitWidth FitWidth
+ FitWidth: BreedtePassend FitWidth
BreitePassend FitWidth
FitWidth AjustatLatime
- FitHeight: FitHeight FitHeight
+ FitHeight: HoogtePassend FitHeight
HoehePassend FitHeight
FitHeight AjustatInaltime
diff --git a/tex/context/base/mult-sys.tex b/tex/context/base/mult-sys.tex
index 48f95abd8..36113701d 100644
--- a/tex/context/base/mult-sys.tex
+++ b/tex/context/base/mult-sys.tex
@@ -57,6 +57,7 @@
\definesystemconstant {ukenglish} \definesystemconstant {uk}
\definesystemconstant {ukrainian} \definesystemconstant {ua}
\definesystemconstant {usenglish} \definesystemconstant {us}
+\definesystemconstant {greek} \definesystemconstant {gr}
%D For proper \UNICODE\ support we need a few font related
%D constants.
@@ -509,6 +510,7 @@
\definesystemvariable {tl} % TekstLijnen
\definesystemvariable {tm} % TypesynonyM
\definesystemvariable {tp} % TyPen
+\definesystemvariable {tx} % TeXtflow
\definesystemvariable {ts} % TypeScript
\definesystemvariable {tt} % TabulaTe
\definesystemvariable {ty} % TYpe
diff --git a/tex/context/base/page-flt.tex b/tex/context/base/page-flt.tex
index c99e6e119..f3f401ee6 100644
--- a/tex/context/base/page-flt.tex
+++ b/tex/context/base/page-flt.tex
@@ -182,11 +182,11 @@
[\??fl#1][\c!kader=\v!aan]%
{\getmessage\m!floatblocks{12}}}
-% A complication is that we may have to handle a pagebreak
-% first, which in turn may issue a (postponed) float.
-% Therefore we may not trust on variable assignments before
+% A complication is that we may have to handle a pagebreak
+% first, which in turn may issue a (postponed) float.
+% Therefore we may not trust on variable assignments before
% we're realy dealing with the float. Some day I'll root out
-% the global settings.
+% the global settings.
\def\docomplexplaatsblok[#1][#2]% [#3]#4%
{\edef\floattype{#1}%
@@ -200,6 +200,7 @@
\def\dodocomplexplaatsblok[#1][#2][#3]#4%
{\flushnotes
+\flushsidefloats % here !
\ifsomefloatwaiting
% this was \checkwaitingfloats spread all over
\doifinsetelse\v!altijd{#2}
@@ -207,6 +208,7 @@
{\doifcommonelse
{#2}
{\v!links,\v!rechts,\v!binnen,\v!buiten,%
+ \v!rugwit,\v!snijwit,%
\v!inlinker,\v!inrechter,\v!inmarge,%
\v!linkermarge,\v!rechtermarge,\v!linkerrand,\v!rechterrand,%
\v!binnenmarge,\v!buitenmarge,\v!binnenrand,\v!buitenrand,%
@@ -217,7 +219,7 @@
\fi
\ifmargeblokken % waarschijnlijk gebroken ! ! ! !
\doifinset\v!marge{#2}
- {\endgraf
+ {\endgraf
\bgroup\everypar{\egroup\the\everypar}%
\hsize\@@mbbreedte}%
\fi
@@ -229,32 +231,33 @@
\dowithnextboxcontent % better a \the\everyfloattoks
{\setlocalfloathsize
\getvalue{\??fl#1\c!binnen}%
- \fuzzysnappingfalse
+ \fuzzysnappingfalse
\postponefootnotes} % new
{\xdocompletefloat{#1}{#3}{#1}{#2}{#1}{#4}% ** not yet done
% we need to carry over the par because of side floats
- \doifnotinset\v!tekst{#2}{\carryoverpar\endgroup}%
+ \doifnotinset\v!tekst{#2}{\carryoverpar\endgroup}%
+ \global\sidefloatdownshift \zeropoint
+ \global\sidefloatextrashift\zeropoint
\ifparfloat
\doifinset\v!reset{#2}\forgetsidefloats
\doinhibitblank
- \fi}% better move this to side floats
+ \fi}% better move this to side floats
\vbox}
-%\def\xxdocompletefloat#1#2%
-% {\setbox\nextbox\hbox{\signalrightpage\flushnextbox}%
-% \doifrightpageelse{\let\@@extrafloat#1}{\let\@@extrafloat#2}}
-
\def\xxdocompletefloat#1#2%
{\rightorleftpageaction{\let\@@extrafloat#1}{\let\@@extrafloat#2}}
\chardef\textfloatmethod=0 % 0=raw 1=safe (.99) 2=tight (-1pt)
\chardef\sidefloatmethod=1 % 0=raw 1=safe (.99) 2=tight (-1pt)
-\def\presetfloatvariables#1#2#3#4%
+\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}
@@ -262,10 +265,12 @@
\ifbinnenkolommen
\global\parfloatfalse
\fi
- \global\sidefloatshift\zeropoint
+ \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
@@ -286,6 +291,12 @@
{\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}
@@ -304,8 +315,7 @@
\global\nofloatcaptiontrue
\fi \fi}
-
-% documenteren in details
+% documenteren in details
\def\presetmorefloatvariables#1%
{\doifelse\@@bklokaal\v!ja % fout keyword
@@ -336,22 +346,40 @@
\to \everyinsidefloat
%\appendtoks
-% \fuzzysnappingfalse
+% \fuzzysnappingfalse
%\to \everyinsidefloat
-\def\doifrightpagefloatelse % watch out: other default ! ! !
+%\def\doifrightpagefloatelse % watch out: other default ! ! !
+% {\ifdubbelzijdig
+% \ifodd\purenumber\twopassfloatdata\space
+% \@EAEAEA\firstoftwoarguments
+% \else
+% \@EAEAEA\secondoftwoarguments
+% \fi
+% \else
+% \@EA\firstoftwoarguments
+% \fi}
+
+\def\doifrightpagefloatelse
{\ifdubbelzijdig
- \ifodd\purenumber\twopassfloatdata\space
+ \ifenkelzijdig
\@EAEAEA\firstoftwoarguments
- \else
- \@EAEAEA\secondoftwoarguments
+ \else
+ \@EAEAEA\doifoddfloatpageelse
\fi
\else
\@EA\firstoftwoarguments
\fi}
+\def\doifoddfloatpageelse
+ {\ifodd\purenumber\twopassfloatdata\space
+ \@EA\firstoftwoarguments
+ \else
+ \@EA\secondoftwoarguments
+ \fi}
+
\appendtoks
- \let\rightorleftpageaction\doifrightpagefloatelse
+ \let\rightorleftpageaction\doifrightpagefloatelse
\to \everyinsidefloat
\newif\ifextrafloatactions \extrafloatactionstrue
@@ -362,7 +390,9 @@
% watch out: line alone aligns on the line ! ! !
\def\movesidefloat[#1]% (-)line|x=,y=
- {\doifassignmentelse{#1}%
+ {\global\sidefloatdownshift \zeropoint
+ \global\sidefloatextrashift\zeropoint
+ \doifassignmentelse{#1}%
{\bgroup
\getparameters[\??fl][\c!x=\zeropoint,\c!y=\zeropoint,#1]%
\ifgridsnapping
@@ -373,9 +403,9 @@
\fi
\global\sidefloatextrashift\@@flx
\egroup}
- {\movedownsidefloat[#1]}}
+ {\movedownsidefloat[#1]}}
-\def\movedownsidefloat[#1]% already in core
+\def\movedownsidefloat[#1]% already in core
{\bgroup
\cleanupfeatures
\doifinstringelse{:}{#1}
@@ -386,7 +416,7 @@
[##1]%
[ \v!regel=>\docommando+,%
+\v!regel=>\docommando+,%
- -\v!regel=>\docommando-]}
+ -\v!regel=>\docommando-]}%
\def\docommando##1%
{\ifdone\else\global\sidefloatdownshift\zeropoint\donetrue\fi
\global\advance\sidefloatdownshift##1\lineheight}%
@@ -394,7 +424,7 @@
\egroup}
\def\xdocompletefloat#1#2#3#4#5#6%
- {\ifextrafloatactions
+ {\ifextrafloatactions
\let\@@extrafloat\empty
% \sidefloatdownshift will be reset afterwards, and can
% already be set at this point
@@ -406,9 +436,11 @@
\v!buitenmarge=>\xxdocompletefloat\v!rechtermarge\v!linkermarge,
\v!binnenrand=>\xxdocompletefloat\v!linkerrand \v!rechterrand,
\v!buitenrand=>\xxdocompletefloat\v!rechterrand \v!linkerrand,
- ininner=>\xxdocompletefloat\v!inlinker \v!inrechter,
- inouter=>\xxdocompletefloat\v!inrechter \v!inlinker,
- \v!regel=>, % only -n*line is handled (see ***)
+ \v!rugwit=>\xxdocompletefloat\v!rugwit \v!snijwit,
+ \v!snijwit=>\xxdocompletefloat\v!snijwit \v!rugwit,
+ \v!links=>\xxdocompletefloat\v!links \v!links,
+ \v!rechts=>\xxdocompletefloat\v!rechts \v!rechts,
+ \v!regel=>, % only -n*line is handled (see ***)
\s!unknown=>{\movedownsidefloat[\commalistelement]}]%
\ifx\@@extrafloat\empty
\docompletefloat{#1}{#2}{#3}{#4}{#5}{#6}\nextbox
@@ -421,38 +453,13 @@
% pas op, maxbreedte niet instellen als plaats=links/rechts
-% \def\setlocalfloatdimensions#1#2#3#4% experimental / #3 box number #4 prefix
-% {\ifextrafloatactions
-% \doifvaluesomething{\??fl#1\c!minbreedte}
-% {\scratchdimen\getvalue{\??fl#1\c!minbreedte}\relax
-% \ifdim\wd#3<\scratchdimen
-% #4\setbox#3\hbox to \scratchdimen
-% {\doifnotvalue{\??fl#1\c!plaats}\v!links \hss
-% \box#3%
-% \doifnotvalue{\??fl#1\c!plaats}\v!rechts\hss}%
-% \fi}%
-% \doifvaluesomething{\??fl#1\c!maxbreedte}
-% {\scratchdimen\getvalue{\??fl#1\c!maxbreedte}\relax
-% \ifdim\wd#3>\scratchdimen
-% #4\setbox#3\hbox to \scratchdimen
-% {\doifcommonelse{\v!rechts,\v!inrechter,\v!links,\v!inlinker}{#2}
-% {\doifnotcommon{\v!rechts,\v!inrechter}{#2}\hss
-% \box#3%
-% \doifnotcommon{\v!links ,\v!inlinker }{#2}\hss}%
-% {\doifnotvalue{\??fl#1\c!plaats}\v!links\hss
-% \box#3%
-% \doifnotvalue{\??fl#1\c!plaats}\v!rechts\hss}}%
-% \fi}%
-% \fi}
-
-\newdimen\sidefloatextrashift
-
\def\setlocalfloatdimensions#1#2#3#4% experimental / #3 box number #4 prefix
- {\global\sidefloatshift\zeropoint\relax % duplicate
+ {\global\sidefloatshift \zeropoint % duplicate
+ \global\sidefloatmaximum\zeropoint\relax % duplicate
\ifextrafloatactions
\ifdim\sidefloatdownshift=\zeropoint\else
- \global\setbox\floatbox\vbox
- {\vskip\sidefloatdownshift\nointerlineskip\box\floatbox}%
+ #4\setbox#3\vbox
+ {\vskip\sidefloatdownshift\nointerlineskip\box#3}%
\fi
\doifvaluesomething{\??fl#1\c!minbreedte}
{\scratchdimen\getvalue{\??fl#1\c!minbreedte}\relax
@@ -462,34 +469,55 @@
\box#3%
\doifnotvalue{\??fl#1\c!plaats}\v!rechts\hss}%
\fi}%
+ % todo: rand / rug
\doifinset\v!hangend{#2}
{\doifcommonelse{\v!inlinker,\v!linkermarge}{#2}
- {\letvalue{\??fl#1\c!maxbreedte}\linkermargebreedte}%
+ {\letvalue{\??fl#1\c!maxbreedte}\linkermargebreedte}%
{\doifcommon{\v!inrechter,\v!rechtermarge}{#2}
- {\letvalue{\??fl#1\c!maxbreedte}\rechtermargebreedte}}}%
+ {\letvalue{\??fl#1\c!maxbreedte}\rechtermargebreedte}}}%
\doifvaluesomething{\??fl#1\c!maxbreedte}
{\scratchdimen\getvalue{\??fl#1\c!maxbreedte}\relax
\ifdim\wd#3>\scratchdimen
- \doifcommonelse{\v!inrechter,\v!rechtermarge}{#2}
- {\global\sidefloatshift-\scratchdimen
- \global\advance\sidefloatshift-\rechtermargeafstand}
- {\doifcommonelse{\v!inlinker,\v!linkermarge}{#2}
- {\global\sidefloatshift-\scratchdimen
- \global\advance\sidefloatshift-\linkermargeafstand}
- {#4\setbox#3\hbox to \scratchdimen
- {\doifcommonelse{\v!rechts,\v!links}{#2}
- {\doifnotinset\v!rechts{#2}\hss
- \box#3%
- \doifnotinset\v!links{#2}\hss}%
- {\doifnotvalue{\??fl#1\c!plaats}\v!links\hss
- \box#3%
- \doifnotvalue{\??fl#1\c!plaats}\v!rechts\hss}}}}%
+% \doifcommonelse{\v!inrechter,\v!rechtermarge}{#2}
+% {\global\sidefloatshift-\scratchdimen
+% \global\advance\sidefloatshift-\rechtermargeafstand}
+% {\doifcommonelse{\v!inlinker,\v!linkermarge}{#2}
+% {\global\sidefloatshift-\scratchdimen
+% \global\advance\sidefloatshift-\linkermargeafstand}
+% {\doifinsetelse{\v!linkerrand}{#2}
+% {\global\sidefloatshift-\scratchdimen
+% \global\advance\sidefloatshift-\linkerrandafstand
+% \global\advance\sidefloatshift-\linkermargebreedte
+% \global\advance\sidefloatshift-\linkermargeafstand}
+% {\doifinsetelse{\v!rechterrand}{#2}
+% {\global\sidefloatshift-\scratchdimen
+% \global\advance\sidefloatshift-\rechterrandafstand
+% \global\advance\sidefloatshift-\rechtermargebreedte
+% \global\advance\sidefloatshift-\rechtermargeafstand}
+% {#4\setbox#3\hbox to \scratchdimen
+% {\doifcommonelse{\v!rechts,\v!links}{#2}
+% {\doifnotinset\v!rechts{#2}\hss
+% \box#3%
+% \doifnotinset\v!links{#2}\hss}%
+% {\doifnotvalue{\??fl#1\c!plaats}\v!links\hss
+% \box#3%
+% \doifnotvalue{\??fl#1\c!plaats}\v!rechts\hss}}}}}}%
+%
+ \doifcommonelse{\v!inrechter,\v!rechtermarge,\v!rechterrand
+ \v!inlinker,\v!linkermarge,\v!linkerrand}{#2}
+ {\global\sidefloatmaximum\scratchdimen}
+ {#4\setbox#3\hbox to \scratchdimen
+ {\doifcommonelse{\v!rechts,\v!links}{#2}
+ {\doifnotinset\v!rechts{#2}\hss
+ \box#3%
+ \doifnotinset\v!links{#2}\hss}%
+ {\doifnotvalue{\??fl#1\c!plaats}\v!links\hss
+ \box#3%
+ \doifnotvalue{\??fl#1\c!plaats}\v!rechts\hss}}}%
+%
\fi}%
- \advance\sidefloatshift\sidefloatextrashift
- \fi
- \global\sidefloatdownshift \zeropoint
- \global\sidefloatextrashift\zeropoint}
-
+ \fi}
+
\def\docomplexstarttekstblok[#1][#2][#3]%
{\flushnotes
\flushsidefloats % hoort eigenlijk niet hier
@@ -518,8 +546,8 @@
{\presetlocalframed[\??fl#1]%
\stelplaatsblokin
[#1]
- [\c!breedte=15\korpsgrootte,
- \c!hoogte=10\korpsgrootte,
+ [\c!breedte=8\lineheight, % 15\korpsgrootte,
+ \c!hoogte=6\lineheight, % 10\korpsgrootte,
\c!minbreedte=,
\c!maxbreedte=,
\c!maxhoogte=,
@@ -678,7 +706,7 @@
% \else
% \globallet\twopassfloatdata\realpageno % \realfolio
% \fi}
-%
+%
% \def\dosavefloatdata
% {\bgroup
% \edef\dosavefloatdata
@@ -747,17 +775,17 @@
\egroup}
\def\dosavefloatinfo
- {\dofloatinfomessage{>}{2}{\the\totalnoffloats}}
+ {\dofloatinfomessage>2{\the\totalnoffloats}}
\def\dofloatflushedinfo
{\bgroup
\!!counta\totalnoffloats
\advance\!!counta -\savednoffloats
- \dofloatinfomessage{<}{3}{\the\!!counta}%
+ \dofloatinfomessage<3{\the\!!counta}%
\egroup}
\def\doinsertfloatinfo
- {\dofloatinfomessage{<}{4}{\the\totalnoffloats}}
+ {\dofloatinfomessage<4{\the\totalnoffloats}}
\def\dogetfloat
{\ifsomefloatwaiting
@@ -887,7 +915,7 @@
\ifx\somefacefloat\undefined \let\somefacefloat\doplacefloatbox \fi
\ifx\sometextfloat\undefined \let\sometextfloat\doplacefloatbox \fi
-% brr, wordt deze niet overladen in page-one? weg er mee
+% brr, wordt deze niet overladen in page-one? weg er mee
\def\somepagefloat[#1]% links, rechts, midden, hoog, midden, laag
{%\checkwaitingfloats{#1}%
@@ -1199,50 +1227,24 @@
%\stelblokkopjesin[\c!uitlijnen=\v!links]
%\stelblokkopjesin[\c!uitlijnen=\v!rechts]
-% \def\dosetpagfloat#1#2#3#4% \copy wegwerken
-% {\bgroup
-% \setlocalfloathsize
-% \forgetall
-% \postponefootnotes
-% \mindermeldingen
-% \setbox\tempfloatbox\vbox{\borderedfloatbox{#4}}%
-% \def\locatefloat{\doregelplaats\@@flflplaats}%
-% \ifnofloatcaption
-% \dopreparenocaption{#1}{#2}{#3}{#4}
-% \edef\width{\the\wd\floatbox}%
-% \else
-% \setbox\tempcaptionbox\hbox
-% {\footnotesenabledfalse\putcompletecaption{#4}{#2}{#3}{0}}%
-% \doifinsetelse\@@kjkjplaats{\v!hoog,\v!midden,\v!laag}
-% {\dopreparesidecaption{#1}{#2}{#3}{#4}}
-% {\doifelse\@@kjkjbreedte\v!max
-% {\dopreparestackcaptionmax{#1}{#2}{#3}{#4}}
-% {\ifdim\wd\tempcaptionbox>\wd\tempfloatbox % wider caption
-% \doifelse\@@kjkjbreedte\v!passend
-% {\dopreparestackcaptionaut{#1}{#2}{#3}{#4}}
-% {\dopreparestackcaptionwid{#1}{#2}{#3}{#4}}%
-% \else
-% \dopreparestackcaptionmin{#1}{#2}{#3}{#4}%
-% \fi}}%
-% \edef\width{\the\wd\tempfloatbox}%
-% \buildfloatbox
-% \fi
-% \doglobal\addlocalbackgroundtobox\floatbox
-% \postcenterfloatbox\width
-% \egroup}
-
\def\dosetpagfloat#1#2#3#4% \copy wegwerken
{\bgroup
-\setlocalfloathsize
+ \setlocalfloathsize
+\ifnum\floatrotation>0
+ \swapdimens\hsize\vsize
+\fi
\forgetall
\postponefootnotes
\mindermeldingen
\setbox\tempfloatbox\vbox{\borderedfloatbox{#4}}%
- \def\locatefloat{\doregelplaats\@@flflplaats}%
+% \def\locatefloat{\doregelplaats\@@flflplaats}%
+ \def\locatefloat
+ {\chardef\alignstrutmode\zerocount
+ \alignedline\@@flflplaats\v!midden}%
\ifnofloatcaption
\dopreparenocaption{#1}{#2}{#3}{#4}
\edef\width{\the\wd\floatbox}%
-\doglobal\addlocalbackgroundtobox\floatbox
+ \doglobal\addlocalbackgroundtobox\floatbox
\else
\setbox\tempcaptionbox\hbox
{\footnotesenabledfalse\putcompletecaption{#4}{#2}{#3}{0}}%
@@ -1258,14 +1260,17 @@
\dopreparestackcaptionmin{#1}{#2}{#3}{#4}%
\fi}}%
\edef\width{\the\wd\tempfloatbox}%
-%\doglobal
-\addlocalbackgroundtobox\tempfloatbox
-%\doglobal
-\addlocalbackgroundtobox\tempcaptionbox
- \buildfloatbox
+ \addlocalbackgroundtobox\tempfloatbox
+ \addlocalbackgroundtobox\tempcaptionbox
+ \buildfloatbox
\fi
-% \doglobal\addlocalbackgroundtobox\floatbox
+\ifnum\floatrotation>0
+ \global\setbox\floatbox\vbox
+ {\rotate[\c!rotatie=\floatrotation]{\box\floatbox}}%
+ \edef\width{\the\wd\tempfloatbox}%
+\else
\postcenterfloatbox\width
+\fi
\egroup}
\ifx\addlocalbackgroundtobox\undefined
@@ -1664,7 +1669,7 @@
\doifelsevaluenothing{\??fl#4\c!criterium}
{\dogetfloatbox{#1}\empty}
{\ifdim\wd\floatbox>\getvalue{\??fl#4\c!criterium}\relax
- \postcenterfloatbox{\wd\floatbox}% else we get left aligned
+ \postcenterfloatbox{\wd\floatbox}% else we get left aligned
\dogetfloatbox{#1}\v!hier % see details/pascal
\else
\dogetfloatbox{#1}\empty
@@ -1727,10 +1732,10 @@
\xdef\naturalfloatdepth {\the\dp#1}}
\long\def\docompletefloat#1#2#3#4#5#6#7% #7 = box number
- {\flushsidefloats
+ {%\flushsidefloats % moved
\presetfloatvariables{#1}{#4}{#2}{#6}%
\bgroup
- \setnaturalfloatdimensions#7%
+ \setnaturalfloatdimensions#7%
\global\setbox\floatbox\vbox
{\executeifdefined{\??fl#1\c!commando}\firstofoneargument{\box#7}}%
\setnaturalfloatdimensions\floatbox
@@ -1933,7 +1938,7 @@
% \doifsomething\savedtopofpagecolor\startcolormode\savedtopofpagecolor
% \egroup
% \fi\fi}
-%
+%
% \setvalue{\e!start\v!uitstellen}%
% {\doglobal\increment\nofpostponedblocks
% \showmessage\m!layouts3\nofpostponedblocks
@@ -1941,19 +1946,19 @@
% [\e!start\v!uitstellen][\e!stop\v!uitstellen]}
% \startpostponing [pagenumber] [+pageoffset]
-%
+%
% \startpostponing[2]
% PAGE 2 \blank
% \stoppostponing
-%
+%
% \startpostponing[+1]
% PAGE +1 \blank
% \stoppostponing
-%
+%
% \startpostponing[+2]
% PAGE +2 \blank
% \stoppostponing
-%
+%
% \starttext \dorecurse{4}{\input tufte \page} \stoptext
\newtoks \postponedpageblocks
@@ -1983,7 +1988,7 @@
{\haalbuffer[pbuf-\recurselevel]} % mechanism is still
\doflushfloats % new but potential dangerous % suboptimal and needs a
\doglobal\newcounter\nofpostponedblocks % proper analysis
- \global\inuitstellenfalse
+ \global\inuitstellenfalse
\doifsomething\savedtopofpagecolor\startcolormode\savedtopofpagecolor
\egroup
\fi}
@@ -2002,7 +2007,7 @@
\def\nodostartpostponing[#1]%
{\doglobal\increment\nofpostponedpageblocks
\bgroup % a little bit of misusing grouping
- \doifinstring{+}{#1}\advance \realpageno#1\relax % ugly but efficient
+ \doifinstring{+}{#1}\advance \realpageno#1\relax % ugly but efficient
\doglobal\appendetoks\noexpand\getpostponedblock
{\realfolio}{\nofpostponedpageblocks}\to\postponedpageblocks
\egroup
@@ -2148,8 +2153,8 @@
\c!zijvoorwit=\@@bkvoorwit,
\c!zijnawit=\@@bknawit,
\c!zijuitlijnen=\v!normaal,
- \c!tekstmethode=\ifgridsnapping2\else0\fi, % 0=raw 1=safe (.99pg) 2=tight (-1pt)
- \c!zijmethode=\ifgridsnapping2\else1\fi, % 0=raw 1=safe (.99pg) 2=tight (-1pt)
+ \c!tekstmethode=\ifgridsnapping2\else0\fi, % 0=raw 1=safe (.99pg) 2=tight (-1pt)
+ \c!zijmethode=\ifgridsnapping2\else1\fi, % 0=raw 1=safe (.99pg) 2=tight (-1pt)
\c!springvolgendein=\v!nee,
\c!marge=1em,
\c!linkermargeafstand=\zeropoint,
@@ -2211,6 +2216,9 @@
\installfloathandler \v!linkerrand \someinleftedgefloat
\installfloathandler \v!rechterrand \someinrightedgefloat
+\installfloathandler \v!rugwit \somebackspacefloat
+\installfloathandler \v!snijwit \somecutspacefloat
+
\installfloathandler {tblr} \someslotfloat
\installfloathandler {lrtb} \someslotfloat
\installfloathandler {tbrl} \someslotfloat
@@ -2243,6 +2251,9 @@
\def\someinmarginfloat [#1]{\somesidefloat[#1]}
\def\someherefloat [#1]{\someelsefloat[\v!hier,#1]}
+\def\somebackspacefloat [#1]{\somesidefloat[#1]}
+\def\somecutspacefloat [#1]{\somesidefloat[#1]}
+
\def\somefixdfloat {\placesomefixdfloat}
\def\somepagefloat {\placesomepagefloat}
\def\somefacefloat {\placesomefacefloat}
diff --git a/tex/context/base/page-ini.tex b/tex/context/base/page-ini.tex
index 4b59577c3..c71f85cb2 100644
--- a/tex/context/base/page-ini.tex
+++ b/tex/context/base/page-ini.tex
@@ -652,6 +652,8 @@
\def\flushsavedfloats {\OTRcommand\flushsavedfloats}
+\def\synchronizehsize {\OTRcommand\synchronizehsize}
+
\def\gotonextpage {\OTRcommand\gotonextpage }
\def\gotonextpageX {\OTRcommand\gotonextpageX} % will become obsolete
diff --git a/tex/context/base/page-lay.tex b/tex/context/base/page-lay.tex
index 3ea33ee4e..16419e769 100644
--- a/tex/context/base/page-lay.tex
+++ b/tex/context/base/page-lay.tex
@@ -1077,6 +1077,11 @@
\def\inneredgedistance
{\rightorleftpageaction\linkerrandafstand \rechterrandafstand}
+\def\outerspacewidth
+ {\rightorleftpageaction\snijwit\rugwit}
+\def\innerspacewidth
+ {\rightorleftpageaction\rugwit\snijwit}
+
\beginETEX \dimexpr
\def\leftmargintotal {\dimexpr(\linkermargebreedte +\linkermargeafstand )}
diff --git a/tex/context/base/page-mar.tex b/tex/context/base/page-mar.tex
index 3447a9f4d..7ba6c9c72 100644
--- a/tex/context/base/page-mar.tex
+++ b/tex/context/base/page-mar.tex
@@ -72,10 +72,11 @@
\donothing
\doifnumberelse\margetekstnummer
{\ifnum\margetekstnummer>25 % to be translated
- \writestatus\m!systems{potential margin stack overflow (\margetekstnummer)}%
+ \writestatus\m!systems{potential margin stack overflow (\margetekstnummer)}%
\fi}
\donothing
- \processaction
+ % todo
+ \processallactionsinset
[\getvalue{\??im\margetekstnummer\c!uitlijnen}]
[ \v!ja=>\setvalue{\??im\margetekstnummer\c!uitlijnen}{#2},
\v!nee=>\setvalue{\??im\margetekstnummer\c!uitlijnen}{\v!normaal},
@@ -96,11 +97,37 @@
\begstrut#6\endstrut\endgraf
\dostopattributes
\@@imna}%
+ \doif\@@imstapel\v!ja
+ {\setbox0\vbox{\stackeddown\vbox{\box0}}}% new
\ht0\strutht
\box0
\egroup
#5\relax}
+%D The stacker permits constructs like:
+%D
+%D \starttypen
+%D \stelinmargein[stapel=ja]
+%D
+%D \inlinker{test 1}test\break
+%D \inlinker{test 2}test\break
+%D \inlinker{test 1}
+%D \input tufte
+%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 4}
+%D \input tufte
+%D \inlinker{test 1}
+%D \inlinker{test 2\endgraf test 3}
+%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
+
\def\plaatsmargetekstscheider
{\ifnum\margincontent>\zerocount
\bgroup
@@ -169,7 +196,7 @@
\def\doinlinker#1%
{\doplacemargintext
{\linkermargetekstblok{#1}\hskip\leftmargintextdistance}
- \llap\!!zeropoint}
+ \llap\zeropoint}
\def\doinrechter#1%
{\doplacemargintext
@@ -180,7 +207,7 @@
\newif \iftrackingmarginnotes
\newif \ifrightmargin % documenteren
-\definetwopasslist{\s!margin}
+\definetwopasslist\s!margin
\def\domarginreference
{\doglobal\increment\nofmarginnotes\relax
@@ -230,8 +257,8 @@
{\ignorespaces
\bgroup\postponefootnotes % group is (somehow) needed
\doifinsetelse\v!laag{#4}
- {\lowinmargintrue}
- {\lowinmarginfalse}%
+ \lowinmargintrue
+ \lowinmarginfalse
\processaction
[#1]
[ \v!links=>#2{#6},
@@ -393,7 +420,7 @@
{\stelinmargein[#1][]% needed when par start outside group
\doflushmargincontent[][]{#2}}}
-\def\margewoord%
+\def\margewoord
{\dodoubleempty\complexmargewoord}
\def\margetitel{\margewoord}
@@ -435,18 +462,21 @@
\popindentation
\ignorespaces}
-\def\inleftside#1%
+\def\inleftedge#1%
{\inleftmargin
{#1\relax
\hskip\linkermargebreedte
\hskip\linkerrandafstand}}
-\def\inrightside#1%
+\def\inrightedge#1%
{\inrightmargin
{\hskip\rechtermargebreedte
\hskip\rechterrandafstand
#1}}
+\let\inleftside \inleftedge
+\let\inrightside\inrightedge
+
%D We want to keep things efficient and therefore only handle
%D situations like:
%D
@@ -507,6 +537,7 @@
\c!kleur=,
\c!plaats=\v!beide,
\c!uitlijnen=\v!binnen,
+ \c!stapel=\v!nee,
\c!voor=,
\c!na=]
diff --git a/tex/context/base/page-mul.tex b/tex/context/base/page-mul.tex
index 9536114a2..e9ea246a7 100644
--- a/tex/context/base/page-mul.tex
+++ b/tex/context/base/page-mul.tex
@@ -435,8 +435,8 @@
\hangindent\zeropoint
\everypar\emptytoks
\ifdim\pagetotal=\zeropoint \else
- \vbox{\forgetall\strut}%
- \vskip-\openlineheight
+ \verticalstrut
+ \vskip-\struttotal
\fi
\global\savedpagetotal\pagetotal
\global\singlecolumnout\output
@@ -703,8 +703,8 @@
\flushshapebox
\everypar\emptytoks
\parskip\zeropoint % = \forgetall
- \strut\endgraf
- \vskip-\lineheight
+ \verticalstrut
+ \vskip-\struttotal
\vfil}}%
\fi
\ifx\postprocesscolumnbox\undefined \else
@@ -1045,7 +1045,7 @@
%D interface, which acts like:
%D
%D \starttypen
-%D \startcolumns[n=4,balance=no,stretch=no,line=on]
+%D \startcolumns[n=4,balance=no]
%D some text
%D \stopcolumns
%D \stoptypen
@@ -1056,9 +1056,7 @@
%D \starttypen
%D \setupcolumns
%D [n=2,
-%D balance=yes,
-%D stretch=text,
-%D line=off]
+%D balance=yes]
%D \stoptypen
%D
%D In this case, stretching is according to the way it's
@@ -1584,7 +1582,10 @@
\def\dostartsimplecolumns[#1]%
{\bgroup
- \getparameters[\??kl][\c!breedte=\hsize,\c!afstand=1em,\c!n=2,#1]%
+ \getparameters[\??kl]
+ [\c!breedte=\hsize,\c!afstand=1.5\korpsgrootte,%
+ \c!n=2,\c!regels=0,#1]%
+ \let\rigidcolumnlines\@@klregels
\setrigidcolumnhsize\@@klbreedte\@@klafstand\@@kln
\setbox\scratchbox\vbox\bgroup
\forgetall} % \blanko[\v!blokkeer]
diff --git a/tex/context/base/page-new.tex b/tex/context/base/page-new.tex
index 342d5c81d..6bab8a7d6 100644
--- a/tex/context/base/page-new.tex
+++ b/tex/context/base/page-new.tex
@@ -44,7 +44,7 @@
\OTRSEToutput
{\global\setbox1\vbox{\unvbox\normalpagebox}%
\global\setbox3\vbox{\unvbox\footins}}%
- \vbox{\toonstruts\strut}\vskip-\lineheight % makes footnotes flush
+ \verticalstrut\vskip-\struttotal % makes footnotes flush
\eject
\global\collectingcontentfalse
% check for footnotes only
diff --git a/tex/context/base/page-one.tex b/tex/context/base/page-one.tex
index e620d43bf..453b0a72e 100644
--- a/tex/context/base/page-one.tex
+++ b/tex/context/base/page-one.tex
@@ -33,18 +33,59 @@
\def\OTRONEsethsize
{\global\hsize\tekstbreedte}
+% keep (original one)
+%
+% \def\OTRONEsetvsize
+% {\ifdim\vsize=\teksthoogte \else
+% \bgroup
+% \scratchdimen-\vsize
+% \advance\scratchdimen \teksthoogte
+% \global\advance\vsize \scratchdimen
+% \relax \ifdim\pagegoal<\maxdimen
+% \advance\scratchdimen \pagegoal
+% \global\pagegoal\scratchdimen
+% \fi
+% \egroup
+% \fi}
+%
+% no (keep)
+%
+% \def\OTRONEsetvsize
+% {\ifdim\vsize=\teksthoogte \else
+% \bgroup
+% \scratchdimen-\vsize
+% \advance\scratchdimen \teksthoogte
+% \ifgridsnapping
+% \getrawnoflines\scratchdimen
+% \scratchdimen\noflines\openlineheight
+% \ifdim\scratchdimen>\noflinesheight % available afterwards
+% \advance\scratchdimen-\openlineheight
+% \fi
+% \ifdim\scratchdimen<\zeropoint
+% \scratchdimen\zeropoint
+% \fi
+% \fi
+% \global\advance\vsize \scratchdimen
+% \relax \ifdim\pagegoal<\maxdimen
+% \advance\scratchdimen \pagegoal
+% \global\pagegoal\scratchdimen
+% \fi
+% \egroup
+% \fi}
+
\def\OTRONEsetvsize
- {\ifdim\vsize=\teksthoogte \else
- \bgroup
- \scratchdimen-\vsize
- \advance\scratchdimen \teksthoogte
- \global\advance\vsize \scratchdimen
- \relax
- \ifdim\pagegoal<\maxdimen
- \advance\scratchdimen \pagegoal
- \global\pagegoal\scratchdimen
+ {\ifgridsnapping
+ \ifcase\layoutlines
+ \getrawnoflines\teksthoogte
+ \else
+ \noflines\layoutlines
\fi
- \egroup
+ \global\vsize\noflines\openlineheight
+ \else
+ \global\vsize\teksthoogte
+ \fi
+ \ifdim\pagegoal<\maxdimen
+ \global\pagegoal\vsize
\fi}
% \def\OTRONEdopagecontents#1#2% \box<n> \unvbox<n>
@@ -479,16 +520,18 @@
\wd\floatbox\floatwidth
\processfirstactioninset
[#1]
- [ \v!links=>\leftfloat{\box\floatbox},
- \v!rechts=>\rightfloat{\box\floatbox},
- \v!inlinker=>\leftmarginfloat{\box\floatbox},
+ [ \v!links=>\leftfloat {\box\floatbox},
+ \v!rechts=>\rightfloat {\box\floatbox},
+ \v!inlinker=>\leftmarginfloat {\box\floatbox},
\v!inrechter=>\rightmarginfloat{\box\floatbox},
- \v!linkermarge=>\leftmarginfloat{\box\floatbox},
+ \v!linkermarge=>\leftmarginfloat {\box\floatbox},
\v!rechtermarge=>\rightmarginfloat{\box\floatbox},
- \v!linkerrand=>\leftedgefloat{\box\floatbox},
- \v!rechterrand=>\rightedgefloat{\box\floatbox},
+ \v!linkerrand=>\leftedgefloat {\box\floatbox},
+ \v!rechterrand=>\rightedgefloat {\box\floatbox},
+ \v!rugwit=>\backspacefloat {\box\floatbox},
+ \v!snijwit=>\cutspacefloat {\box\floatbox},
\v!inmarge=>{\doinmargenormal\leftmarginfloat
- \rightmarginfloat{\box\floatbox}}]%
+ \rightmarginfloat{\box\floatbox}}]%
\doifinset\v!lang{#1}\flushsidefloatsafterpar
\fi}
diff --git a/tex/context/base/page-set.tex b/tex/context/base/page-set.tex
index ab6e43545..c712d51af 100644
--- a/tex/context/base/page-set.tex
+++ b/tex/context/base/page-set.tex
@@ -23,6 +23,7 @@
% todo : separate footnote placement
% todo : go on on same page with colset
% todo : test page areas per page
+% todo : leftmargin/rightmargin (better than afstand(1))
\unprotect
@@ -184,8 +185,106 @@
\def\OTRSETerasegridcells#1#2#3#4%
{\doOTRSETsetgridcells{\box\voidb@x}{#1}{#2}{#3}{#4}{\box\voidb@x}}
+% \def\OTRSETsetfreecells#1#2% col start
+% {\global\columnfirstcell\ifnum#2=0 1\else#2\fi\relax
+% \ifnum\columnfirstcell>\columnmaxcells
+% \global\columnfreecells\zerocount
+% \global\columnfirstcell\plusone
+% \global\columnlastcell \zerocount
+% \global\somefreecolumncellsfalse
+% %\message{no cells a}%
+% \else
+% \doloop
+% {\ifnum\columnfirstcell>\columnmaxcells\relax
+% \exitloop
+% \else
+% \OTRSETdoifcellelse{#1}\columnfirstcell
+% {\global\advance\columnfirstcell\plusone}
+% {\exitloop}%
+% \fi}%
+% \global\columnlastcell\columnfirstcell
+% \doloop
+% {\ifnum\columnlastcell>\columnmaxcells\relax
+% \exitloop
+% \else
+% \OTRSETdoifcellelse{#1}\columnlastcell
+% {\global\advance\columnlastcell \minusone \exitloop}
+% {\global\advance\columnlastcell \plusone }%
+% \fi}%
+% \ifnum\columnfirstcell>\columnmaxcells
+% \global\columnfreecells\zerocount
+% \global\columnfirstcell\plusone
+% \global\columnlastcell \zerocount
+% \global\somefreecolumncellsfalse
+% %\message{no cells b}%
+% \else
+% \ifnum\columnlastcell>\columnmaxcells
+% \global\columnlastcell\columnmaxcells
+% \fi
+% \global\columnfreecells\columnlastcell
+% \global\advance\columnfreecells -\columnfirstcell
+% \global\advance\columnfreecells \plusone
+% \global\somefreecolumncellstrue
+% %\message{\number\columnfirstcell-\number\columnlastcell=\number\columnfreecells}%
+% \fi
+% \fi}
+
+% \def\OTRSETgetmaxfreecells#1#2% col start
+% {\scratchcounter\zerocount
+% \let\columnmaxfreecells\!!zerocount
+% \let\columnfrmfreecells\!!zerocount
+% \dostepwiserecurse{#2}\columnmaxcells\plusone
+% {\OTRSETdoifcellelse{#1}\recurselevel
+% {\ifnum\columnmaxfreecells<\scratchcounter
+% \edef\columnmaxfreecells{\the\scratchcounter}%
+% \let\columnfrmfreecells\recurselevel
+% \fi
+% \scratchcounter\zerocount}
+% {\advance\scratchcounter\plusone}}}
+
+\def\setupcolumnsetlines
+ {\doquadrupleargument\dosetupcolumnsetlines}
+
+\def\dosetupcolumnsetlines[#1][#2][#3][#4]%
+ {\setevalue{\??mc#1:#2:\number#3}{\number#4}}
+
+\def\currentcolumnmaxcells
+ {\ifundefined{\??mc\OTRSETidentifier:\columnsetpage:\number\mofcolumns}%
+ \columnmaxcells
+ \else\ifnum\csname\??mc\OTRSETidentifier:\columnsetpage:\number\mofcolumns\endcsname=0
+ \columnmaxcells
+ \else
+ \csname\??mc\OTRSETidentifier:\columnsetpage:\number\mofcolumns\endcsname
+ \fi\fi}
+
+% in etex we also support negative numbers
+
+\beginETEX \numexpr
+
+\def\currentcolumnmaxcellstag
+ {\??mc\OTRSETidentifier:\columnsetpage:\number\mofcolumns}
+
+\def\currentcolumnmaxcells
+ {\ifcsname\currentcolumnmaxcellstag\endcsname
+ \ifnum\csname\currentcolumnmaxcellstag\endcsname=0
+ \columnmaxcells
+ \else
+ \number\numexpr(\ifnum\csname\currentcolumnmaxcellstag\endcsname<0
+ \columnmaxcells+\fi\csname\currentcolumnmaxcellstag\endcsname)%
+ \fi
+ \else
+ \columnmaxcells
+ \fi}
+
+\def\doresetcolumnsetlines#1%
+ {\ifundefined{\??mc\OTRSETidentifier:\columnsetpage:\number#1}\else
+ \letgvalue{\??mc\OTRSETidentifier:\columnsetpage:\number#1}\!!zerocount
+ \fi}
+
\def\OTRSETsetfreecells#1#2% col start
{\global\columnfirstcell\ifnum#2=0 1\else#2\fi\relax
+ \pushmacro \columnmaxcells
+ \edef\columnmaxcells{\currentcolumnmaxcells}%
\ifnum\columnfirstcell>\columnmaxcells
\global\columnfreecells\zerocount
\global\columnfirstcell\plusone
@@ -226,12 +325,15 @@
\global\somefreecolumncellstrue
%\message{\number\columnfirstcell-\number\columnlastcell=\number\columnfreecells}%
\fi
- \fi}
+ \fi
+ \popmacro \columnmaxcells}
\def\OTRSETgetmaxfreecells#1#2% col start
{\scratchcounter\zerocount
\let\columnmaxfreecells\!!zerocount
\let\columnfrmfreecells\!!zerocount
+ \pushmacro \columnmaxcells
+ \edef\columnmaxcells{\currentcolumnmaxcells}%
\dostepwiserecurse{#2}\columnmaxcells\plusone
{\OTRSETdoifcellelse{#1}\recurselevel
{\ifnum\columnmaxfreecells<\scratchcounter
@@ -239,7 +341,8 @@
\let\columnfrmfreecells\recurselevel
\fi
\scratchcounter\zerocount}
- {\advance\scratchcounter\plusone}}}
+ {\advance\scratchcounter\plusone}}%
+ \popmacro\columnmaxcells}
\long\def\OTRSETrecurseRL#1%
{\dostepwiserecurse\nofcolumns\plusone\minusone
@@ -256,18 +359,7 @@
{\hbox\bgroup
\dontcomplain
\forgetall % can go once in \flush
- \OTRSETregisterbalancing
- \ifbalancecolumns
- \ifnum\realpageno=\balancingpageno\relax
- \!!heighta \localcolumnmaxcells\lineheight
- \global\let\localcolumnmaxcells\!!zerocount
- \else
- \!!heighta \teksthoogte
- \fi
- \else
- \!!heighta \teksthoogte
- \fi
- %
+ \!!heighta \teksthoogte
% test first !
\hbox to \zetbreedte
{\dostepwiserecurse{#1}{#2}{#3}
@@ -341,6 +433,10 @@
\else
\OTRSETdofinalflush
\OTRSETdofinaloutput
+\ifnum\columnsetpage>0
+ \dorecurse\nofcolumns{\doresetcolumnsetlines\recurselevel}%
+\fi
+\doglobal\increment\columnsetpage
\OTRSETinitializecolumns
%\OTRSETdoflushfloats
\OTRSETstartnextpage
@@ -375,20 +471,6 @@
% \egroup
\fi}
-\newcounter\OTRSETnofbalanced
-
-\def\OTRSETregisterbalancing
- {\ifcase\OTRSETfinish \or
- \global\chardef\OTRSETfinish\plustwo
- \doglobal\increment\OTRSETnofbalanced
- \expanded{\writeutilitycommand
- {\noexpand\twopassentry{\s!colset}{\OTRSETnofbalanced}{\noexpand\realfolio}}}%
- \fi}
-
-\def\OTRSETresetbalancing
- {\doglobal\newcounter\balancingpageno
- \global\chardef\OTRSETfinish\zerocount}
-
\definesystemvariable {mc}
\definesystemvariable {mt}
\definesystemconstant {colset}
@@ -410,16 +492,17 @@
\OTRSETsetfreecells\mofcolumns\columnfirstcell
\ifsomefreecolumncells
\global\vsize\columnfreecells\lineheight
- \global\pagegoal\vsize % niet nodig, tenzij binnen otr
+ \ifinotr % else problems with floats, see extreme
+ \global\pagegoal\vsize % niet nodig, tenzij binnen otr
+ \fi
\synchronizeoutput % fails on example
% \allowbreak % hm
\fi
\synchronizenotes
\fi}
-\def\OTRSETsethsize
- {%\OTRSETassignwidth\OTRSETidentifier\to\localcolumnwidth
- \localcolumnwidth\OTRSETlocalwidth\mofcolumns
+\def\OTRSETsethsize % of course this does not migrate outside the otr
+ {\localcolumnwidth\OTRSETlocalwidth\mofcolumns
\tekstbreedte\localcolumnwidth
\hsize\localcolumnwidth}
@@ -434,9 +517,10 @@
\ifdim\scratchdimen=\tekstbreedte
\egroup
\else
- \egroup \OTRSETsethsize % only if change in width and \column/\break
+ % only if change in width and \column/\break
+ \egroup \OTRSETsethsize
\fi
- \fi }
+ \fi}
\def\OTRSETcheckfreelines
{\OTRSETsetvsize}
@@ -491,7 +575,10 @@
{\OTRSETcolumnhbreak
\ejectinsert
\ejectpage % brrr
- \OTRSETsynchronizehsize} % no \OTRSETsethsize, can be mid smaller (like tabulate)
+ % no \OTRSETsethsize, can be mid smaller (like tabulate)
+ % also, this one should be executed at the outer level
+ % (setting hsize inside otr does not work)
+ \OTRSETsynchronizehsize}
% We need to make sure that we really leave the column; mid
% column we may end up in an empty gap, and we don't want to
@@ -586,7 +673,7 @@
\ht\scratchbox\scratchskip
\fi
\OTRSETsavenotes
- \OTRSEThandleflushedtext0
+ \OTRSEThandleflushedtext0%
\ifdim\lastskipinotr>\zeropoint
%\vskip \lastskipinotr % hm, gets lost anyway
\else
@@ -653,20 +740,7 @@
\setbox\scratchbox\hbox
{\wd0\zeropoint\box0\box2}%
\dp\scratchbox\strutdp
- \donetrue
- \ifbalancecolumns \ifcase\OTRSETfinish \or \or
- % we're in the second balance loop in this column set,
- % so we have to preserve the previous and discard the rest
- \donefalse
- \fi \fi
- \ifdone
- \OTRSEThandleflushedtext1
- \else
- \writestatus
- {columnset}
- {check balancing values of '\OTRSETidentifier', text discarded!}%
- \wait % better wait than get lost, esp with two balances per page
- \fi
+ \OTRSEThandleflushedtext1
\egroup}
\newcount\lastcolumnlastcell
@@ -947,7 +1021,7 @@
\def\OTRSETstoreincolumnslotLRBT#1%
{\OTRSETprepareforcolumnslot3{#1}%
-\OTRSETflushtextsofar
+\OTRSETflushtextsofar
\OTRSETstoreincolumnslotindeed
\mofcolumns\nofcolumns+\currenthcell
\columnmaxcells\plusone-\currentvcell{#1}}
@@ -1041,8 +1115,7 @@
\OTRSETsetvsize}
\def\OTRSETstoreincolumnslotindeed#1#2#3#4#5#6#7#8#9%
- {%\OTRSETflushtextsofar
- \ifnum\preferedcolumn<\mofcolumns
+ {\ifnum\preferedcolumn<\mofcolumns
\let\pofcolumns\mofcolumns
\else
\let\pofcolumns\preferedcolumn
@@ -1152,16 +1225,23 @@
\def\OTRSETdocheckiffloatfits % eigenlijk moet else float anders
{\global\ifnofloatpermitted\roomforfloatfalse\else\roomforfloattrue\fi}
-\def\OTRSETsavebox#1% clean up the skips
+\def\OTRSETunpreparebox#1%
{\ifhbox#1% spans and so
\global\setbox\floatbox\vbox{\box#1}%
\else
\setbox\scratchbox\vbox
{\unvbox#1\unskip\unskip\unskip
\global\setbox\floatbox\lastbox}%
- \fi
+ \fi}
+
+\def\OTRSETsavebox#1% clean up the skips
+ {\OTRSETunpreparebox{#1}%
\dosavefloat}
+\def\OTRSETresavebox#1% clean up the skips
+ {\OTRSETunpreparebox{#1}%
+ \doresavefloat}
+
\def\OTRSETflushfloatbox % nog verder doorvoeren en meer info in marge
{\iftestfloatbox\ruledhbox\fi{\box\floatbox}}
@@ -1178,7 +1258,7 @@
\if!!donea
%\message{[flu]}%
\else
- \doresavefloat
+ \OTRSETresavebox\floatbox
\exitloop
\fi
\else
@@ -1290,21 +1370,19 @@
\def\dodefinecolumnset[#1][#2]%
{\getparameters[\??mc#1]
[\c!richting=\v!rechts,
- \c!n=2,
- \c!breedte=\v!passend,
\c!balanceren=\v!nee,
\c!afstand=1.5\bodyfontsize, % controleren
+ \c!n=2,
\c!nlinks=\getvalue{\??mc#1\c!n},
\c!nrechts=\getvalue{\??mc#1\c!n},
- \c!regels=0,
+ \c!breedte=\v!passend,
+ \c!regels=0,
#2]%
- \redodefinecolumnset[#1]}
-
-\def\redodefinecolumnset[#1]%
- {\dorecurse{\getvalue{\??mc#1\c!nlinks}} % todo
+ \dorecurse{\getvalue{\??mc#1\c!nlinks}} % todo
{\dododefinecolumnset[#1][\recurselevel]}%
\dorecurse{\getvalue{\??mc#1\c!nrechts}} % todo
{\dododefinecolumnset[#1][\recurselevel]}%
+ % redo framed settings
\setupcolumnset[#1][1][\c!afstand=\!!zeropoint]}
\def\dododefinecolumnset[#1][#2]%
@@ -1316,6 +1394,7 @@
\c!kader=\v!uit,
\c!uitlijnen=,
\c!regels=0,% really needed since c!regels is now part of framed
+ \c!breedte=\getvalue{\??mc#1\c!breedte},
\c!afstand=\getvalue{\??mc#1\c!afstand}]}
\def\setupcolumnset
@@ -1365,63 +1444,115 @@
% \v!laatste=>\expanded{\doOTRSETgotocolumn[\the\nofcolumns]},
% \s!default=>\OTRSETdummycolumn]}}
-\def\doOTRSETgotocolumn[#1]% first|last|yes|<number>
- {\doifnumberelse{#1}
- {\ifnum\mofcolumns<#1\relax
- \vfill\eject % \doejectpage\eject
- \doloop
- {\ifnum\mofcolumns<#1\relax
- \OTRSETdummycolumn \else \exitloop
- \fi}%
- \fi}
- {\processallactionsinset
- [#1]
- [ \v!ja=>\OTRSETdummycolumn,
- \v!forceer=>\OTRSETdummycolumn,
- \v!eerste=>{\doOTRSETgotocolumn[1]},
- \v!laatste=>\expanded{\doOTRSETgotocolumn[\the\nofcolumns]},
- \s!default=>\OTRSETdummycolumn]}}
+% \def\doOTRSETgotocolumn[#1]% first|last|yes|<number>
+% {\doifnumberelse{#1}
+% {\ifnum\mofcolumns<#1\relax
+% \vfill\eject % \doejectpage\eject
+% \doloop
+% {\ifnum\mofcolumns<#1\relax
+% \OTRSETdummycolumn \else \exitloop
+% \fi}%
+% \fi}
+% {\processallactionsinset
+% [#1]
+% [ \v!ja=>\OTRSETdummycolumn,
+% \v!forceer=>\OTRSETdummycolumn,
+% \v!eerste=>{\doOTRSETgotocolumn[1]},
+% \v!laatste=>\expanded{\doOTRSETgotocolumn[\the\nofcolumns]},
+% \s!default=>\OTRSETdummycolumn]}}
+
+\def\doOTRSETgotoCOLROW#1% <number>|<number>*<number>
+ {\bgroup % really needed
+ \splitstring#1\at*\to\column\and\row
+ \bgroup
+ \ifx\column\empty\else\expanded{\doOTRSETgotoCOLUMN{\column}}\fi
+ \egroup
+ \bgroup
+ \ifx\row \empty\else\expanded{\doOTRSETgotoROW {\row }}\fi
+ \egroup
+ \egroup}
+
+\def\doOTRSETgotoCOLUMN#1%
+ {\ifnum\mofcolumns=#1\else
+ \vfill\eject % \doejectpage\eject
+ \doloop
+ {\ifnum\mofcolumns=#1\relax
+ \exitloop \else \OTRSETdummycolumn
+ \fi}%
+ \fi}
+
+\def\doOTRSETgotoROW#1%
+ {\ifnum#1>1
+ \scratchcounter\zerocount
+ \currenthcell\mofcolumns
+ \currentvcell#1\advance\currentvcell \minusone
+ \dorecurse\currentvcell
+ {\OTRSETdoifcellelse\mofcolumns\recurselevel\donothing
+ {\advance\scratchcounter\plusone}}
+ \getnoflines\pagetotal
+ \advance\scratchcounter-\noflines
+ \ifnum\scratchcounter>\zerocount
+ \dorecurse\scratchcounter{\line{\strut}}%
+ \fi
+ \fi
+ \OTRSETsetvsize}
+
+\def\doOTRSETgotocolumn[#1]% yes|force|first|last|<number>|<number>*<number>
+ {\processallactionsinset
+ [#1]
+ [ \v!ja=>\OTRSETdummycolumn,
+ \v!nee=>,% not supported
+ \v!forceer=>\OTRSETdummycolumn,
+ \v!eerste=>\expanded{\doOTRSETgotoCOLUMN{1}},
+ \v!laatste=>\expanded{\doOTRSETgotoCOLUMN{\the\nofcolumns}},
+ \s!default=>\OTRSETdummycolumn,
+ \s!unknown=>\expanded{\doOTRSETgotoCOLROW{\commalistelement}}]}
% to be documented and tested, not yet that robust
+% \def\OTRSETgotocell#1#2%
+% {\endgraf
+% \gdef\gotocellcounter{0}%
+% \doloop
+% {\ifnum\mofcolumns<#1\relax
+% \doglobal\increment\gotocellcounter\relax
+% \ifnum\gotocellcounter>#1\relax
+% \line{\strut}\crlf
+% \line{\strut}\crlf
+% \column
+% \writestatus{columnset}{quitting goto cell}%
+% \exitloop
+% \else
+% \column
+% \fi
+% \else
+% \exitloop
+% \fi}%
+% \ifnum\mofcolumns=#1\relax
+% \ifnum#2>1
+% \scratchcounter\zerocount
+% \currenthcell\mofcolumns
+% \currentvcell#2\advance\currentvcell \minusone
+% \dorecurse\currentvcell
+% {\OTRSETdoifcellelse\mofcolumns\recurselevel\donothing
+% {\advance\scratchcounter\plusone}}
+% \getnoflines\pagetotal
+% \advance\scratchcounter-\noflines
+% \ifnum\scratchcounter>\zerocount
+% \dorecurse\scratchcounter{\line{\strut}}%
+% \fi
+% \fi
+% \fi
+% \OTRSETsetvsize}
+
\def\OTRSETgotocell#1#2%
{\endgraf
- \gdef\gotocellcounter{0}%
- \doloop
- {\ifnum\mofcolumns<#1\relax
- \doglobal\increment\gotocellcounter\relax
- \ifnum\gotocellcounter>#1\relax
- \line{\strut}\crlf
- \line{\strut}\crlf
- \column
- \writestatus{columnset}{quitting goto cell}%
- \exitloop
- \else
- \column
- \fi
- \else
- \exitloop
- \fi}%
- \ifnum\mofcolumns=#1\relax
- \ifnum#2>1
- \scratchcounter\zerocount
- \currenthcell\mofcolumns
- \currentvcell#2\advance\currentvcell \minusone
- \dorecurse\currentvcell
- {\OTRSETdoifcellelse\mofcolumns\recurselevel\donothing
- {\advance\scratchcounter\plusone}}
- \getnoflines\pagetotal
- \advance\scratchcounter-\noflines
- \ifnum\scratchcounter>\zerocount
- \dorecurse\scratchcounter{\line{\strut}}%
- \fi
- \fi
- \fi
- \OTRSETsetvsize}
+ \doOTRSETgotocolumnCOLUMN{#1}%
+ \doOTRSETgotocolumnROW {#2}}
\def\OTRSETdummycolumn
- {\vbox{\strut}
- \vskip-\lineheight
+ {\verticalstrut
+ \vskip-\struttotal
\vfill
\eject}
@@ -1434,10 +1565,11 @@
\def\dostartcolumnset[#1][#2]%
{\increment\columnsetlevel\relax
- \OTRSETresetbalancing
\globallet\localcolumnmaxcells\!!zerocount
+ \global\chardef\OTRSETfinish\zerocount
\ifnum\columnsetlevel=\plusone
\bgroup
+ \globallet\columnsetpage\!!plusone
\def\currentcolumnset{#2}%
\binnenkolommentrue % will be different flag
\activateotr{SET}{ONE}% andere naam, activate or so
@@ -1445,42 +1577,18 @@
{\globallet\OTRSETlist\s!default}
{\xdef\OTRSETlist{#1}}%
\OTRSETstartnextpage
- \OTRSETloadbalancing % here
- \OTRSETinitbalancing
\OTRSETassignwidths
\OTRSETsethsize
\else
\bgroup
\fi}
-% \def\stopcolumnset
-% {\relax
-% \ifnum\columnsetlevel=\plusone
-% \par
-% \dostopcolumnset
-% \egroup
-% \global\footnotelimittrue
-% \setvsize
-% \sethsize
-% \ifvoid\OTRfinalpagebox\else
-% % probably balanced
-% \ifdim\ht\OTRfinalpagebox<\teksthoogte
-% \snaptogrid[\v!pagina]\hbox{\box\OTRfinalpagebox}
-% \else
-% \box\OTRfinalpagebox
-% \fi
-% \fi
-% \ifsomefloatwaiting \setvsize \pagina \setvsize \fi
-% \else
-% \egroup
-% \fi
-% \decrement\columnsetlevel\relax}
-
\def\stopcolumnset
{\relax
\ifnum\columnsetlevel=\plusone
+ \endgraf % needed, else wrong vsize in one par case
\global\chardef\OTRSETfinish\plusone
- \pagebreak
+ % no, extra page \pagebreak % (test on pascal toc)
\dostopcolumnset
\egroup
\global\footnotelimittrue
@@ -1495,7 +1603,7 @@
\fi
\fi
\global\chardef\OTRSETfinish\zerocount
- \ifsomefloatwaiting \setvsize \pagina \setvsize \fi
+ \ifsomefloatwaiting \setvsize \pagebreak \setvsize \fi
\else
\egroup
\fi
@@ -1536,115 +1644,47 @@
% \!!countb \savedcolumnmaxcells\relax
% \fi
% % can be an option: absolute versus relative
-% \advance\!!countb\precolumnlines
-% \ifnum\!!countb>\localcolumnmaxcells\relax
-% \xdef\localcolumnmaxcells{\the\!!countb}%
-% \fi
-% \advance\!!countb \plusone
-% \dostepwiserecurse\!!countb\columnmaxcells\plusone
-% {\ifvoid\OTRSETgridcell\!!counta\recurselevel
-% \OTRSETsetgridcell\!!counta\recurselevel\copy\placeholderboxe
-% \fi}}%
+% \ifcase\OTRSETbottombalance
+% \advance\!!countb\precolumnlines
+% \ifnum\!!countb>\localcolumnmaxcells\relax
+% \xdef\localcolumnmaxcells{\the\!!countb}%
+% \fi
+% \advance\!!countb \plusone
+% \dostepwiserecurse\!!countb\columnmaxcells\plusone
+% {\ifvoid\OTRSETgridcell\!!counta\recurselevel
+% \OTRSETsetgridcell\!!counta\recurselevel\copy\placeholderboxe
+% \fi}%
+% \else
+% \globallet\localcolumnmaxcells\columnmaxcells
+% \advance\!!countb-\columnmaxcells
+% \!!countb-\!!countb
+% \advance\!!countb \minusone
+% \ifnum\!!countb>\zerocount
+% \dostepwiserecurse\plusone\!!countb\plusone
+% {\ifvoid\OTRSETgridcell\!!counta\recurselevel
+% \OTRSETsetgridcell\!!counta\recurselevel\copy\placeholderboxe
+% \fi}%
+% \fi
+% \fi}%
% \OTRSETsetvsize % ! ! !
% \fi
% \fi
% \fi}
-
-\def\OTRSETinitbalancing
- {\ifbalancecolumns
- \let\savedcolumnmaxcells\columnmaxcells
- \ifnum\realpageno=\balancingpageno\relax
- \ifnum\mofcolumns=\plusone
- \dorecurse\nofcolumns
- {\!!counta\recurselevel\relax
- \!!countb\getvalue{\??mc\OTRSETidentifier\number\!!counta\c!regels}\relax
- \ifcase\!!countb
- \!!countb\getvalue{\??mc\OTRSETidentifier\c!regels}\relax
- \fi
- \ifcase\!!countb
- \!!countb \savedcolumnmaxcells\relax
- \fi
- % can be an option: absolute versus relative
- \ifcase\OTRSETbottombalance
- \advance\!!countb\precolumnlines
- \ifnum\!!countb>\localcolumnmaxcells\relax
- \xdef\localcolumnmaxcells{\the\!!countb}%
- \fi
- \advance\!!countb \plusone
- \dostepwiserecurse\!!countb\columnmaxcells\plusone
- {\ifvoid\OTRSETgridcell\!!counta\recurselevel
- \OTRSETsetgridcell\!!counta\recurselevel\copy\placeholderboxe
- \fi}%
- \else
- \globallet\localcolumnmaxcells\columnmaxcells
- \advance\!!countb-\columnmaxcells
- \!!countb-\!!countb
- \advance\!!countb \minusone
- \ifnum\!!countb>\zerocount
- \dostepwiserecurse\plusone\!!countb\plusone
- {\ifvoid\OTRSETgridcell\!!counta\recurselevel
- \OTRSETsetgridcell\!!counta\recurselevel\copy\placeholderboxe
- \fi}%
- \fi
- \fi}%
- \OTRSETsetvsize % ! ! !
- \fi
- \fi
- \fi}
-
-\def\OTRSETpresetbalancing
- {\doifvaluesomething{\??mc\OTRSETidentifier\c!regels}%
- {\getcommacommandsize[\csname\??mc\OTRSETidentifier\c!regels\endcsname]%
- \ifnum\commalistsize>\plusone
- \scratchcounter\zerocount
- \def\docommando##1%
- {\advance\scratchcounter\plusone
- \setvalue{\??mc\OTRSETidentifier\the\scratchcounter\c!regels}{##1}}%
- \processcommacommand
- [\csname\??mc\OTRSETidentifier\c!regels\endcsname]\docommando
- \setvalue{\??mc\OTRSETidentifier\c!regels}{0}%
- \fi}}
-
-\def\OTRSETloadbalancing
- {\gettwopassdata\s!colset
- \iftwopassdatafound
- \OTRSETpresetbalancing
- \global\let\balancingpageno\twopassdata
- \else
- \doglobal\newcounter\balancingpageno
- \fi
- \global\balancingcolumnsfalse} % not really used yet
-
-%\def\OTRSETnobalance
-% {\iflastcolumnfootnotes % testen ! optie
-% % inhibit flush of floats !
-% \dostepwiserecurse{\mofcolumns}{\nofcolumns}{1}
-% {\vskip-\lineheight\vbox{\strut}\vfill\eject}%
-% \else
-% \ifdim\pagetotal>\zeropoint
-% \vfill \eject \OTRSETdofinalflush
-% \fi
-% \fi}
-
-% \def\OTRSETnobalance
-% {\iflastcolumnfootnotes % testen ! optie
-% % inhibit flush of floats !
-% \dostepwiserecurse\mofcolumns\nofcolumns\plusone
-% {\vskip-\lineheight\vbox{\strut}\vfill\eject}%
-% \else
-% \ifdim\pagetotal>\zeropoint
-% \ifnum\mofcolumns=\nofcolumns
-% \OTRSETflushfinalfootnotes
-% \vfill \eject
-% \else
-% \vfill \eject
-% \OTRSETdofinalflush
-% \OTRSETdofinaloutput
-% \fi
-% \fi
-% \fi}
-%
-% no, this one looses empty 1page/1column with area (example **)
+%
+% \def\OTRSETpresetbalancing
+% {\doifvaluesomething{\??mc\OTRSETidentifier\c!regels}%
+% {\getcommacommandsize[\csname\??mc\OTRSETidentifier\c!regels\endcsname]%
+% \ifnum\commalistsize>\plusone
+% \scratchcounter\zerocount
+% \def\docommando##1%
+% {\advance\scratchcounter\plusone
+% \setvalue{\??mc\OTRSETidentifier\the\scratchcounter\c!regels}{##1}}%
+% \processcommacommand
+% [\csname\??mc\OTRSETidentifier\c!regels\endcsname]\docommando
+% \setvalue{\??mc\OTRSETidentifier\c!regels}{0}%
+% \fi}}
+
+% don't loose empty 1page/1column with area (example **)
%
% \definecolumntextarea[title][x=1,y=4,nx=2,ny=7,state=start]
% \setupcolumntextareatext[title][\vtop to 5cm{a\\b\\b\\d}]
@@ -1653,22 +1693,36 @@
% \startcolumnset \dorecurse{1}{\input tufte \par} \stopcolumnset
% \stoptext
+% better:
+
+\def\definecolumnsetarea {\definecolumntextarea}
+\def\setupcolumnsetarea {\setupcolumntextarea}
+\def\setupcolumnsetareatext{\setupcolumntextareatext}
+
+% so this will be changed
+
\def\OTRSETnobalance
{\iflastcolumnfootnotes % testen ! optie
% inhibit flush of floats !
+ % todo: nothing if no footnotes, else empty page
\dostepwiserecurse\mofcolumns\nofcolumns\plusone
- {\vskip-\lineheight\vbox{\strut}\vfill\eject}%
- \else
- % \ifdim\pagetotal>\zeropoint no, see example **
+ {\vskip-\struttotal\verticalstrut\vfill\eject}%
+ \else
+ \ifdim\pagetotal>\zeropoint % no, see example **
\ifnum\mofcolumns=\nofcolumns
\OTRSETflushfinalfootnotes
\else
- % probably todo
+ % probably todo
\fi
- \vfill \eject
- \OTRSETdofinalflush
- \OTRSETdofinaloutput
- % \fi
+ \vfill
+ \eject
+ % brr, may result in empty page after nicely fit text
+ % or if left, then lost of first column only text
+ \ifnum\mofcolumns>1
+ \OTRSETdofinalflush
+ \OTRSETdofinaloutput
+ \fi
+ \fi
\fi}
\def\OTRSETstartnextpage
@@ -1688,7 +1742,7 @@
\OTRSETcheckinsert
\OTRSETcheckgrid
\OTRSETsetvsize
- \OTRSETsethsize % or local ?
+ \OTRSETsethsize % or local ?
\OTRSETsetplaceholders
\OTRSEThandlepreposttext
\initializecolumntextareas % name !
@@ -2023,7 +2077,7 @@
\blanko[\@@bknawit]}%
\global\advance\topinserted \ht\scratchbox\relax
\ifdim\topinserted>\vsize % was \teksthoogte\relax
- \doresavefloat
+ \OTRSETresavebox\floatbox
\noffloatinserts\noftopfloats\relax
\global\advance\topinserted -\ht\scratchbox
\let\OTRSETdodosettopinserts\relax % to be tested
@@ -2071,7 +2125,7 @@
\fi
\dofloatflushedinfo
\else
- \doresavefloat
+ \OTRSETresavebox\floatbox
\noffloatinserts\nofbotfloats\relax
\fi
\global\nofloatpermittedtrue % vgl topfloats s!
@@ -2125,13 +2179,13 @@
\def\dodefinecolumntextarea[#1][#2][#3]% y=0 is mogelijke en handig !
{\ifthirdargument
- \doifelse{#2}\v!beide
- {\definecolumntextarea[#1][\v!links ][#3]%
- \definecolumntextarea[#1][\v!rechts][#3]}
+ \doifinsetelse{#2}{\v!beide,\v!vast}
+ {\definecolumntextarea[#1][\v!links ][\c!type=#2,#3]%
+ \definecolumntextarea[#1][\v!rechts][\c!type=#2,#3]}
{\doifelse{#2}\v!volgende
- {\doifoddpageelse
- {\definecolumntextarea[#1][\v!rechts][#3]}
- {\definecolumntextarea[#1][\v!links][#3]}}
+ {\doifoddpageelse
+ {\definecolumntextarea[#1][\v!rechts][\c!type=#2,#3]}
+ {\definecolumntextarea[#1][\v!links ][\c!type=#2,#3]}}
{\presetlocalframed
[\??mt#1#2]%
\processaction[#2] % \doglobal voorkomt stack build up
@@ -2140,7 +2194,7 @@
\getparameters[\??mt#1#2]
[\c!x=1,\c!y=1,\c!nx=1,\c!ny=1,\c!clipoffset=2\lineheight,
\c!offset=\v!overlay,\c!strut=\v!nee,\c!kader=\v!uit,
- \c!status=\v!stop,#3]}}%
+ \c!type=#2,\c!pagina=1,\c!status=\v!stop,#3]}}%
\else
\definecolumntextarea[#1][\v!volgende][#2]%
\fi}
@@ -2162,6 +2216,19 @@
\setupcolumntextarea[#1][\v!volgende][#2]%
\fi}
+\def\docheckcolumnsetareapage#1#2%
+ {\ifnum\getvalue{\??mt#1\c!pagina}>\plusone
+ \doifelsevalue{\??mt#1\c!type}\v!vast
+ {\ifnum\columnsetpage=\getvalue{\??mt#1\c!pagina}\relax
+ \donetrue\else\donefalse
+ \fi}
+ {\ifnum\columnsetpage<\getvalue{\??mt#1\c!pagina}\relax
+ \donefalse\else\donetrue
+ \fi}%
+ \else
+ \donetrue
+ \fi}
+
\def\initializecolumntextareas
{\ifodd\realpageno
\doinitializecolumntextareas\columnrightareas\v!rechts
@@ -2169,12 +2236,26 @@
\doinitializecolumntextareas\columnleftareas\v!links
\fi}
+%\def\doinitializecolumntextareas#1#2%
+% {\def\docommando##1%
+% {\doifelsevalue{\??mt##1#2\c!status}\v!start
+% {\dodoinitializecolumntextareas{##1}{#2}}
+% {\doifvalue{\??mt##1#2\c!status}\v!herhaal
+% {\dodoinitializecolumntextareas{##1}{#2}}}}%
+% \processcommacommand[#1]\docommando}
+
\def\doinitializecolumntextareas#1#2%
{\def\docommando##1%
- {\doifelsevalue{\??mt##1#2\c!status}\v!start
- {\dodoinitializecolumntextareas{##1}{#2}}
- {\doifvalue{\??mt##1#2\c!status}\v!herhaal
- {\dodoinitializecolumntextareas{##1}{#2}}}}%
+ {\docheckcolumnsetareapage{##1#2}\plusone
+ \ifdone
+ \donefalse
+ \processaction
+ [\getvalue{\??mt##1#2\c!status}]
+ [ \v!start=>\donetrue,
+ \v!herhaal=>\donetrue,
+ \s!unknown=>\doperformtest\commalistelement\donetrue\donefalse]%
+ \ifdone\dodoinitializecolumntextareas{##1}{#2}\fi
+ \fi}%
\processcommacommand[#1]\docommando}
\def\dodoinitializecolumntextareas#1#2%
@@ -2191,59 +2272,41 @@
\doplacecolumntextareas\columnleftareas\v!links
\fi}
+%\def\doplacecolumntextareas#1#2% global ?
+% {\bgroup
+% \forgetall
+% \def\docommando##1%
+% {\doifelsevalue{\??mt##1#2\c!status}\v!start
+% {\doglobal\removefromcommalist{##1}#1%
+% \dodoplacecolumntextareas{##1}{#2}}
+% {\doifvalue{\??mt##1#2\c!status}\v!herhaal
+% {\dodoplacecolumntextareas{##1}{#2}}}}%
+% \processcommacommand[#1]\docommando
+% \egroup}
+
\def\doplacecolumntextareas#1#2% global ?
{\bgroup
\forgetall
\def\docommando##1%
- {\doifelsevalue{\??mt##1#2\c!status}\v!start
- {\doglobal\removefromcommalist{##1}#1%
- \dodoplacecolumntextareas{##1}{#2}}
- {\doifvalue{\??mt##1#2\c!status}\v!herhaal
- {\dodoplacecolumntextareas{##1}{#2}}}}%
+ {\docheckcolumnsetareapage{##1#2}\zerocount
+ \ifdone
+ \donefalse
+ \processaction
+ [\getvalue{\??mt##1#2\c!status}]
+ [ \v!start=>\donetrue\doglobal\removefromcommalist{##1}#1,
+ \v!herhaal=>\donetrue,
+ \s!unknown=>\doperformtest\commalistelement\donetrue\donefalse]%
+ \ifdone
+ \dodoplacecolumntextareas{##1}{#2}
+ \else
+ \doglobal\removefromcommalist{##1}#1%
+ \fi
+ \fi}%
\processcommacommand[#1]\docommando
\egroup}
\def\columntextlastbackspace{\rugwit}
-% \def\dodoplacecolumntextareas#1#2%
-% {\!!counta\getvalue{\??mt#1#2\c!x}%
-% \!!countb\getvalue{\??mt#1#2\c!nx}%
-% \docalculatecolumnsetspan
-% \!!heighta\getvalue{\??mt#1#2\c!ny}\lineheight
-% % to do: met/zonder ht/dp
-% \ifnum\getvalue{\??mt#1#2\c!y}=\zerocount
-% \advance\!!heighta -\lineheight
-% \advance\!!heighta \topskip
-% \fi
-% \advance\!!heighta -\lineheight % option
-% \setbox\scratchbox\vbox
-% {\donetrue\localframed
-% [\??mt#1#2]
-% [\c!breedte=\!!widtha,\c!hoogte=\!!heighta,\c!regels=]
-% {\getvalue{\??mt#1#2}}}%
-% \!!counta\getvalue{\??mt#1#2\c!x}%
-% \!!countb\getvalue{\??mt#1#2\c!y}%
-% \advance\!!countb \getvalue{\??mt#1#2\c!ny}%
-% \advance\!!countb \minusone
-% \OTRSETsetgridcell
-% \!!counta\!!countb
-% \hbox{\clip
-% [\c!breedte=\!!widthb,\c!hoogte=\!!heighta]%
-% {\copy\scratchbox}}%
-% \ifcase\!!countc\else
-% \advance\!!counta \getvalue{\??mt#1#2\c!nx}%
-% \advance\!!counta -\!!countc
-% \advance\!!widtha -\!!widthb
-% \OTRSETsetgridcell
-% \!!counta\!!countb
-% \hbox
-% {\hskip-\namedlayoutparameter\v!oneven\c!rugwit
-% \clip
-% [\c!breedte=\!!widtha,\c!hoogte=\!!heighta,
-% \c!hoffset=\!!widthb]
-% {\copy\scratchbox}}%
-% \fi}
-
% beware, we have clipping offsets of 2\lineheight by default
\def\columntextareaparameter#1%
@@ -2255,62 +2318,65 @@
\!!countb\columntextareaparameter\c!nx
\docalculatecolumnsetspan
\!!heighta\columntextareaparameter\c!ny\lineheight
- % to do: met/zonder ht/dp
-% wrong
-% \ifnum\columntextareaparameter\c!y=\zerocount
-% \advance\!!heighta -\lineheight
-% \advance\!!heighta \topskip
-% \fi
-% \advance\!!heighta -\lineheight % option
-%
+ % wrong
+ % \ifnum\columntextareaparameter\c!y=\zerocount
+ % \advance\!!heighta -\lineheight
+ % \advance\!!heighta \topskip
+ % \fi
+ % \advance\!!heighta -\lineheight % option
\ifnum\columntextareaparameter\c!y=\plusone
\advance\!!heighta -\lineheight
\advance\!!heighta \topskip
\fi
-%
+ %
\setbox\scratchbox\vbox
{\donetrue\localframed
[\??mt\currentcolumntestarea]
- [\c!breedte=\!!widtha,\c!hoogte=\!!heighta,\c!regels=]
+ [\c!plaats=,% new (*)
+ \c!breedte=\!!widtha,\c!hoogte=\!!heighta,\c!regels=]
{\columntextareaparameter\empty}}%
\!!counta\columntextareaparameter\c!x
\!!countb\columntextareaparameter\c!y
\advance\!!countb \columntextareaparameter\c!ny
\advance\!!countb \minusone
- \OTRSETsetgridcell
- \!!counta\!!countb
- \hbox
- {\ifcase\!!countc
- \copy\scratchbox % \box
- \else
- \clip
- [%\c!bovenoffset=\columntextareaparameter\c!clipoffset,%
- %\c!onderoffset=\columntextareaparameter\c!clipoffset,%
- %\c!linkeroffset=\columntextareaparameter\c!clipoffset,%
-\c!offset=\columntextareaparameter\c!clipoffset,%
-\c!rechteroffset=\zeropoint,
- \c!breedte=\!!widthb,%
- \c!hoogte=\!!heighta]%
- {\copy\scratchbox}%
- \fi}%
+ % new (*)
+ \doif{\columntextareaparameter\c!plaats}\v!diepte
+ {\setbox\scratchbox\hbox{\lower\strutdepth\box\scratchbox}%
+ \dp\scratchbox\zeropoint
+ \ht\scratchbox\!!heighta}%
+ %
+ \setbox0\hbox
+ {\ifcase\!!countc
+ \copy\scratchbox % \box
+ \else
+ \clip
+ [%\c!bovenoffset=\columntextareaparameter\c!clipoffset,%
+ %\c!onderoffset=\columntextareaparameter\c!clipoffset,%
+ %\c!linkeroffset=\columntextareaparameter\c!clipoffset,%
+ \c!offset=\columntextareaparameter\c!clipoffset,%
+ \c!rechteroffset=\zeropoint,%
+ \c!breedte=\!!widthb,%
+ \c!hoogte=\!!heighta]%
+ {\copy\scratchbox}%
+ \fi}%
+ \OTRSETsetgridcell\!!counta\!!countb\box0
\ifcase\!!countc\else
\advance\!!counta \columntextareaparameter\c!nx
\advance\!!counta -\!!countc
\advance\!!widtha -\!!widthb
- \OTRSETsetgridcell
- \!!counta\!!countb
- \hbox
- {\hskip-\namedlayoutparameter\v!oneven\c!rugwit
- \clip
- [%\c!bovenoffset=\columntextareaparameter\c!clipoffset,%
- %\c!onderoffset=\columntextareaparameter\c!clipoffset,%
- %\c!rechteroffset=\columntextareaparameter\c!clipoffset,%
-\c!offset=\columntextareaparameter\c!clipoffset,%
-\c!linkeroffset=\zeropoint,
- \c!breedte=\!!widtha,%
- \c!hoogte=\!!heighta,%
- \c!hoffset=\!!widthb]%
- {\copy\scratchbox}}%
+ \setbox0\hbox
+ {\hskip-\namedlayoutparameter\v!oneven\c!rugwit
+ \clip
+ [%\c!bovenoffset=\columntextareaparameter\c!clipoffset,%
+ %\c!onderoffset=\columntextareaparameter\c!clipoffset,%
+ %\c!rechteroffset=\columntextareaparameter\c!clipoffset,%
+ \c!offset=\columntextareaparameter\c!clipoffset,%
+ \c!linkeroffset=\zeropoint,%
+ \c!breedte=\!!widtha,%
+ \c!hoogte=\!!heighta,%
+ \c!hoffset=\!!widthb]%
+ {\copy\scratchbox}}%
+ \OTRSETsetgridcell\!!counta\!!countb\box0%
\fi}
\def\setupcolumntextareatext
@@ -2392,15 +2458,17 @@
% \definecolumnspan[][#1]%
}%\fi}
+\definecolumnsetspan[\s!default]
+
\def\setupcolumnsetspan
{\dodoubleempty\dosetupcolumnsetspan}
\def\dosetupcolumnsetspan[#1][#2]%
- {%\ifsecondargument
+ {\ifsecondargument
\setupframedtexts[cs:#1][#2]%
- %\else
- % \setupcolumnsetspan[][#1]%
- }%\fi}
+ \else
+ \setupcolumnsetspan[\s!default][#1]%
+ \fi}
\def\startcolumnsetspan
{\dotripleempty\dostartcolumnsetspan}
@@ -2433,7 +2501,7 @@
\hsize\columnsetspanhsize
\setbox\scratchbox\vbox\bgroup
\dostartframedtext[cs:#1][\v!geen]% geen nils placement
- \vskip-\lineheight\par\strut\par
+ \vskip-\struttotal\par\verticalstrut\par
\framedtextparameter{cs:#1}\c!voor
\def\stopcolumnsetspan{\dostopcolumnsetspan{#1}}}
@@ -2441,9 +2509,9 @@
\def\dostopcolumnsetspan#1%
{\par
- \vbox{\strut}
- \kern-2\lineheight
- \vbox{\strut}
+ \verticalstrut
+ \kern-2\struttotal
+ \verticalstrut
\doifsomething{\framedtextparameter{cs:#1}\c!na}
{\framedtextparameter{cs:#1}\c!na
\kern\zeropoint}% otherwise blanks disappear, better be a switch
@@ -2452,9 +2520,18 @@
% frozen keeps grid snapping okay
\setbox\scratchbox\frozenhbox to \hsize
{\dontcomplain
- \doregelplaats{\framedtextparameter{cs:#1}\c!plaats}%
+ \alignedline{\framedtextparameter{cs:#1}\c!plaats}\v!midden
{\lower\strutdepth\box\scratchbox}}%
\dp\scratchbox\zeropoint % else wrong snap insidefloat
+%
+% to be tested first:
+%
+% \setbox\scratchbox\frozenhbox to \hsize
+% {\dontcomplain
+% \chardef\alignstrutmode\zerocount
+% \alignedline{\framedtextparameter{cs:#1}\c!plaats}\v!midden
+% {\box\scratchbox}}%
+%
\ifinsidefloat
\box\scratchbox
\else
@@ -2468,7 +2545,7 @@
% todo : \v!hier -> here enzovoorts
\OTRSETstoreincolumnslot\floatmethod\scratchbox
% watch out: no \dochecknextindentation{tag}
- \checknextindentation[\framedtextparameter{cs:#1}\springvolgendein]
+ \checknextindentation[\framedtextparameter{cs:#1}\c!springvolgendein]
\fi
\egroup
\endgraf}
diff --git a/tex/context/base/page-sid.tex b/tex/context/base/page-sid.tex
index 521b8b968..a85e49ee9 100644
--- a/tex/context/base/page-sid.tex
+++ b/tex/context/base/page-sid.tex
@@ -2,7 +2,7 @@
%D [ file=page-sid,
%D version=2000.10.20,
%D title=\CONTEXT\ OTR Macros,
-%D subtitle=Side Floats,
+%D subtitle=Side Floats,
%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 OTR Macros / Side Floats}
+\writestatus{loading}{Context OTR Macros / Side Floats}
-\unprotect
+\unprotect
-% These macro deal with side floats. We started with Daniel
-% Comenetz macros as published in TUGBoat Volume 14 (1993),
-% No.\ 1: Anchored Figures at Either Margin. I extended and
-% patched the macros to suite our needs which results in a
-% messy module. Therefore, this module badly needs an update
-% because it's now a mixture of old and new macros.
+% These macro deal with side floats. We started with Daniel
+% Comenetz macros as published in TUGBoat Volume 14 (1993),
+% No.\ 1: Anchored Figures at Either Margin. I extended and
+% patched the macros to suite our needs which results in a
+% messy module. Therefore, this module badly needs an update
+% because it's now a mixture of old and new macros.
% afhankelijke variabelen
%
@@ -47,23 +47,160 @@
\newdimen\sidefloatwidth
\newdimen\sidefloathsize
\newdimen\sidefloatshift
+\newdimen\sidefloatextrashift
\newdimen\sidefloatvsize \def\nofloatvsize{-1pt }
\newdimen\sidefloatprogress
\newbox\floatbottom
-\newif\ifrightfloat
-\newif\ifmarginfloat
-\newif\ifedgefloat
+% 1 = backspace
+% 2 = leftedge
+% 3 = leftmargin
+% 4 = leftside
+% 5 = rightside
+% 6 = rightmargin
+% 7 = rightedge
+% 8 = cutspace
+
+\chardef\sidefloattype\zerocount
+
+\def\backspacefloat {\global\chardef\sidefloattype1 \putsidefloat}
+\def\leftedgefloat {\global\chardef\sidefloattype2 \putsidefloat}
+\def\leftmarginfloat {\global\chardef\sidefloattype3 \putsidefloat}
+\def\leftfloat {\global\chardef\sidefloattype4 \putsidefloat}
+\def\rightfloat {\global\chardef\sidefloattype5 \putsidefloat}
+\def\rightmarginfloat {\global\chardef\sidefloattype6 \putsidefloat}
+\def\rightedgefloat {\global\chardef\sidefloattype7 \putsidefloat}
+\def\cutspacefloat {\global\chardef\sidefloattype8 \putsidefloat}
+
\newif\ifroomforfloat
\newif\iffloatshort
\newif\iffloatflag
\newif\iffloatrighteqo
\newif\iffloatlefteqo
-% eq is still crap
+\newdimen\sidefloatleftskip
+\newdimen\sidefloatrightskip
+\newdimen\sidefloatmaximum
+
+% \def\setsidefloatskips
+% {\global\sidefloatrightskip\zeropoint
+% \global\sidefloatleftskip \zeropoint
+% \rightorleftpageaction\donefalse\donetrue
+% \ifdone
+% \ifcase\sidefloattype
+% \or % backspace
+% \global \sidefloatleftskip \snijwit
+% \or % leftedge
+% \global \sidefloatleftskip \rechtermargeafstand
+% \global\advance\sidefloatleftskip \rechtermargebreedte
+% \global\advance\sidefloatleftskip \rechterrandafstand
+% \or % leftmargin
+% \global \sidefloatleftskip \rechtermargeafstand
+% \or % leftside
+% \or % rightside
+% \or % rightmargin
+% \global \sidefloatrightskip\linkermargeafstand
+% \or % rightedge
+% \global \sidefloatrightskip\linkermargeafstand
+% \global\advance\sidefloatrightskip\linkermargebreedte
+% \global\advance\sidefloatrightskip\linkerrandafstand
+% \or % cutspace
+% \global \sidefloatrightskip\rugwit
+% \fi
+% \else
+% \ifcase\sidefloattype
+% \or % backspace
+% \global \sidefloatleftskip \rugwit
+% \or % leftedge
+% \global \sidefloatleftskip \linkermargeafstand
+% \global\advance\sidefloatleftskip \linkermargebreedte
+% \global\advance\sidefloatleftskip \linkerrandafstand
+% \or % leftmargin
+% \global \sidefloatleftskip \linkermargeafstand
+% \or % leftside
+% \or % rightside
+% \or % rightmargin
+% \global \sidefloatrightskip\rechtermargeafstand
+% \or % rightedge
+% \global \sidefloatrightskip\rechtermargeafstand
+% \global\advance\sidefloatrightskip\rechtermargebreedte
+% \global\advance\sidefloatrightskip\rechterrandafstand
+% \or % cutspace
+% \global \sidefloatrightskip\snijwit
+% \fi
+% \fi
+% \ifdim\sidefloatrightskip>\zeropoint
+% \doglobal\advance\sidefloatrightskip\rightskip
+% \fi
+% \ifdim\sidefloatleftskip>\zeropoint
+% \doglobal\advance\sidefloatleftskip\leftskip
+% \fi}
+
+\def\checksidefloatshift
+ {\ifdim\sidefloatmaximum>\zeropoint
+ \ifcase\sidefloattype
+ % invalid
+ \or
+ % backspace
+ \or
+ \global\sidefloatshift-\sidefloatmaximum
+ \global\advance\sidefloatshift-\rightorleftpageaction \linkerrandafstand \rechterrandafstand
+ \global\advance\sidefloatshift-\rightorleftpageaction \linkermargebreedte \rechtermargebreedte
+ \global\advance\sidefloatshift-\rightorleftpageaction \linkermargeafstand \rechtermargeafstand
+ \or
+ \global\sidefloatshift-\sidefloatmaximum
+ \global\advance\sidefloatshift-\rightorleftpageaction \linkermargeafstand \rechtermargeafstand
+ \or
+ % left
+ \or
+ % right
+ \or
+ \global\sidefloatshift-\sidefloatmaximum
+ \global\advance\sidefloatshift-\rightorleftpageaction \linkermargeafstand \rechtermargeafstand
+ \or
+ \global\sidefloatshift-\sidefloatmaximum
+ \global\advance\sidefloatshift-\rightorleftpageaction \linkerrandafstand \rechterrandafstand
+ \global\advance\sidefloatshift-\rightorleftpageaction \linkermargebreedte \rechtermargebreedte
+ \global\advance\sidefloatshift-\rightorleftpageaction \linkermargeafstand \rechtermargeafstand
+ \or
+ % cutspace
+ \fi
+ \fi}
+
+\def\setsidefloatskips
+ {\global\sidefloatrightskip\zeropoint
+ \global\sidefloatleftskip \zeropoint
+ \ifcase\sidefloattype
+ \or % backspace
+ \global \sidefloatleftskip \rightorleftpageaction \rugwit \snijwit
+ \or % leftedge
+ \global \sidefloatleftskip \rightorleftpageaction \linkermargeafstand\rechtermargeafstand
+ \global\advance\sidefloatleftskip \rightorleftpageaction \linkermargebreedte\rechtermargebreedte
+ \global\advance\sidefloatleftskip \rightorleftpageaction \linkerrandafstand\rechterrandafstand
+ \or % leftmargin
+ \global \sidefloatleftskip \rightorleftpageaction \linkermargeafstand\rechtermargeafstand
+ \or % leftside
+ \or % rightside
+ \or % rightmargin
+ \global \sidefloatrightskip\rightorleftpageaction \rechtermargeafstand\linkermargeafstand
+ \or % rightedge
+ \global \sidefloatrightskip\rightorleftpageaction \rechtermargeafstand\linkermargeafstand
+ \global\advance\sidefloatrightskip\rightorleftpageaction \rechtermargebreedte\linkermargebreedte
+ \global\advance\sidefloatrightskip\rightorleftpageaction \rechterrandafstand\linkerrandafstand
+ \or % cutspace
+ \global \sidefloatrightskip\rightorleftpageaction \snijwit\rugwit
+ \fi
+ \ifdim\sidefloatrightskip>\zeropoint
+ \doglobal\advance\sidefloatrightskip\rightskip
+ \fi
+ \ifdim\sidefloatleftskip>\zeropoint
+ \doglobal\advance\sidefloatleftskip\leftskip
+ \fi}
-\ifx\normalleqno\undefined
+% eq is still crap
+
+\ifx\normalleqno\undefined
\let\floatrighteqo=\eqno
\let\floatleftleqo=\leqno
@@ -73,7 +210,7 @@
\let\floatrighteqo=\normaleqno
\let\floatleftleqo=\normalleqno
-\fi
+\fi
% Watch it even more! In inner, gaat't mis omdat daar
% pagetotal enz niet zijn aangepast. Inner kan overigens niet
@@ -111,7 +248,7 @@
% % so far for option
% \kern\!!heighta
% \fi
-% % == \forgetsidefloats
+% % == \forgetsidefloats
% \global\sidefloatvsize\nofloatvsize
% \global\floatshortfalse
% \global\floatflagfalse}
@@ -139,7 +276,7 @@
% \kern\!!heighta
% \fi
% \fi
-% % == \forgetsidefloats
+% % == \forgetsidefloats
% \global\sidefloatvsize\nofloatvsize
% \global\floatshortfalse
% \global\floatflagfalse}
@@ -154,11 +291,11 @@
\global\advance\sidefloatvsize -\sidefloatbottomskip
\ifdim\!!heighta>\zeropoint
\bgroup
- \let\flushsidefloats\relax
- \forgetall
+ \let\flushsidefloats\relax
+ \forgetall
\doloop
{\strut
- \iftracesidefloats
+ \iftracesidefloats
\color[darkgray]%
{\baselinerulefalse
\boxrulewidth.5\s!pt
@@ -167,25 +304,25 @@
\par
\!!heighta\sidefloatvsize
\advance\!!heighta -\pagetotal
- \ifdim\!!heighta>\zeropoint
+ \ifdim\!!heighta>\zeropoint
\ifnum\recurselevel>\plushundred
\exitloop
- \fi
+ \fi
\else
\exitloop
\fi}%
\egroup
\ifdim\parskip>\zeropoint
\ifdim\sidefloatbottomskip>\parskip
- \geenwitruimte
+ \geenwitruimte
\vskip\sidefloatbottomskip
- \fi
+ \fi
\fi
\else\ifdim\sidefloatbottomskip>\parskip
\vskip\sidefloatbottomskip
\fi\fi
\fi
- % == \forgetsidefloats
+ % == \forgetsidefloats
\global\sidefloatvsize\nofloatvsize
\global\floatshortfalse
\global\floatflagfalse}
@@ -257,23 +394,23 @@
\global\holdinginserts\zerocount
\global\floatshortfalse
\else
- \finalsidefloatoutput % new
+ \finalsidefloatoutput % new
\global\sidefloatvsize\nofloatvsize
\poppenalties
\fi}
-\def\finalsidefloatoutput% new
+\def\finalsidefloatoutput% new
{\finaloutput\unvbox\normalpagebox}
\def\restoreleftindent
- {\ifrightfloat \else
- \parskip\zeropoint % here ?
- \ifdim\sidefloatwidth>\zeropoint % new, see prikkels
+ {\relax \ifnum\sidefloattype>4 \else
+ \parskip\zeropoint % here ?
+ \ifdim\sidefloatwidth>\zeropoint % new, see prikkels
\noindent
\vadjust{\penalty\minusone}%
\hskip\sidefloatwidth
%\else
- % we have a margin or edge float
+ % we have a margin or edge float
\fi
\fi}
@@ -293,102 +430,101 @@
\fi
\floatrighteqo}
-\fi
+\fi
-\def\leftmarginfloat#1%
- {\global\rightfloatfalse\marginfloattrue\edgefloatfalse\putsidefloat{#1}}
-
-\def\rightmarginfloat#1%
- {\global\rightfloattrue\marginfloattrue\edgefloatfalse\putsidefloat{#1}}
-
-\def\leftedgefloat#1%
- {\global\rightfloatfalse\marginfloatfalse\edgefloattrue\putsidefloat{#1}}
-
-\def\rightedgefloat#1%
- {\global\rightfloattrue\marginfloatfalse\edgefloattrue\putsidefloat{#1}}
-
-\def\leftfloat#1%
- {\global\rightfloatfalse\edgefloatfalse\marginfloatfalse\putsidefloat{#1}}
-
-\def\rightfloat#1%
- {\global\rightfloattrue\marginfloatfalse\edgefloatfalse\putsidefloat{#1}}
-
-% \def\putsidefloat#1% crap macro
-% {\par
-% \witruimte
-% % moved here dec 2001
-% {\everypar\emptytoks\forgetall\vbox{\strut}\vskip-\lineheight}% moved
-% %
-% \previoussidefloat
-% \stallsidefloat
-% \setbox\floatbox\hbox{\vbox % pretty ugly, will be rewritten
-% {\vskip
-% \sidefloatdownshift
-% \vskip
-% \ifmarginfloat
-% -\sidefloattopskip
-% \else\ifedgefloat
-% -\sidefloattopskip
-% \else
-% +\sidefloattopoffset
-% \fi\fi
-% #1}}
-% \global\sidefloatdownshift\zeropoint
-% \measuresidefloat
-% \ifroomforfloat
-% \else
-% \tosssidefloat
-% \measuresidefloat
-% \stallsidefloat
-% \fi
-% \setsidefloat}
-
-\def\putsidefloat#1% crap macro
+\def\putsidefloat#1% grid (4) is rather experimental
{\par
\witruimte
- % moved here dec 2001
- {\everypar\emptytoks\forgetall\vbox{\strut}\vskip-\lineheight}% moved
- \ifdim\sidefloatshift=\zeropoint\else
- \global \marginfloatfalse
- \global \edgefloatfalse
- \fi
- \ifcase\sidefloatalign \else
- \global\sidefloattopskip\zeropoint
+ % 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
- \ifrightfloat\else\hskip\sidefloatshift\fi
- \scratchdimen
- \ifmarginfloat
- \sidefloattopskip
- \else\ifedgefloat
- \sidefloattopskip
- \else
- \zeropoint
- \fi\fi
- % the top of the box is at the previous baseline
- \ifcase\sidefloatalign
- % normal
- \advance\scratchdimen\strutdepth % == \sidefloattopoffset
- \or % height
- \advance\scratchdimen\strutdepth % == \sidefloattopoffset
- \or % line
- \or % depth
- \advance\scratchdimen\lineheight
- \advance\scratchdimen\strutdepth
- \or % grid
- % experimental, see cont-loc
+ %\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
- \vbox{\vskip\scratchdimen\nointerlineskip#1}%
- \ifrightfloat\kern\sidefloatshift\fi
- % no \hskip, but \kern here
- \ifmarginfloat\else\ifrightfloat\kern\sidefloatrightshift\fi\fi}%
- \ifmarginfloat
- \global\sidefloattopskip\zeropoint
- \else\ifedgefloat
- \global\sidefloattopskip\zeropoint
+ \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
+ \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
@@ -413,59 +549,20 @@
\newdimen\sidefloatpagetotal
-% \def\measuresidefloat
-% {\global\floatflagtrue
-% \global\sidefloatpagetotal \pagetotal % global
-% \ifmarginfloat
-% \global \sidefloatwidth \zeropoint
-% \else\ifedgefloat
-% \global \sidefloatwidth \zeropoint
-% \else
-% \global \sidefloatwidth \wd\floatbox
-% \global\advance\sidefloatwidth \floatsideskip
-% \fi\fi
-% \ifdim\sidefloatwidth<\zeropoint
-% \global\sidefloatwidth\zeropoint
-% \fi
-% \global \sidefloathsize \hsize
-% \global\advance\sidefloathsize -\sidefloatwidth
-% \global \sidefloatheight \ht\floatbox
-% \global\advance\sidefloatheight \dp\floatbox
-% \global\advance\sidefloatheight \sidefloattopskip
-% \global \sidefloatvsize \sidefloatheight
-% \global\advance\sidefloatvsize \sidefloatpagetotal
-% \dimen0=\sidefloatvsize
-% \ifdim\dimen0>.99\pagegoal \relax
-% \roomforfloatfalse
-% \else
-% \dimen0=\pagegoal
-% \advance\dimen0 -\sidefloatvsize
-% \ifdim\dimen0<\sidefloatbottomskip
-% \global\advance\sidefloatvsize \dimen0
-% \global\floatshorttrue
-% \pushpenalties
-% \global\holdinginserts\plusone
-% \else
-% \global\advance\sidefloatvsize \sidefloatbottomskip
-% \global\floatshortfalse
-% \fi
-% \roomforfloattrue
-% \fi}
-
\def\measuresidefloat
{\global\floatflagtrue
- \global\sidefloatpagetotal \pagetotal % global
- \ifmarginfloat
+ \global\sidefloatpagetotal \pagetotal % global
+ \ifnum\sidefloattype<4
\global \sidefloatwidth \zeropoint
- \else\ifedgefloat
+ \else\ifnum\sidefloattype>5
\global \sidefloatwidth \zeropoint
\else
\global \sidefloatwidth \wd\floatbox
- \global\advance\sidefloatwidth \floatsideskip
+ \global\advance\sidefloatwidth \floatsideskip
\fi\fi
\ifdim\sidefloatwidth<\zeropoint
- \global\sidefloatwidth\zeropoint
- \fi
+ \global\sidefloatwidth\zeropoint
+ \fi
\global \sidefloathsize \hsize
\global\advance\sidefloathsize -\sidefloatwidth
\global \sidefloatheight \ht\floatbox
@@ -473,17 +570,17 @@
\global\advance\sidefloatheight \sidefloattopskip
\global \sidefloatvsize \sidefloatheight
\global\advance\sidefloatvsize \sidefloatpagetotal
- \dimen0\sidefloatvsize
- \dimen2\pagegoal
+ \dimen0\sidefloatvsize
+ \dimen2\pagegoal
\relax
\ifcase\sidefloatmethod
- % method 0 : raw
- \or
- % method 1 : safe
- \dimen2 .99\pagegoal
+ % method 0 : raw
\or
- % method 2 : tight
- \advance\dimen0 -\!!onepoint
+ % method 1 : safe
+ \dimen2 .99\pagegoal
+ \or
+ % method 2 : tight
+ \advance\dimen0 -\!!onepoint
\fi
\relax % really needed ! ! ! !
\ifdim\dimen0>\dimen2
@@ -502,131 +599,65 @@
\fi
\roomforfloattrue
\fi}
-
-% \def\setsidefloat% nilling everypar saves time and redudant pos's
-% {% removed here dec 2001
-% %{\everypar\emptytoks\forgetall\vbox{\strut}\vskip-\lineheight}%
-% %
-% \kern\sidefloattopskip
-% \edef\presidefloatdepth{\the\prevdepth}%
-% \nointerlineskip
-% \bgroup
-% \everypar\emptytoks
-% \parskip\zeropoint
-% \logsidefloat
-% \ifrightfloat
-% \hfill
-% \ifmarginfloat
-% % \rlap{\hskip\rechtermargeafstand\hskip\rightskip\unhbox\floatbox}%
-% \rlap{\tbox{\hskip\rechtermargeafstand\hskip\rightskip\unhbox\floatbox}}%
-% \else\ifedgefloat
-% \rlap{\tbox{\hskip\rechtermargeafstand\hskip\rechtermargebreedte
-% \hskip\rechterrandafstand\hskip\rightskip\unhbox\floatbox}}%
-% \else
-% \unhbox\floatbox
-% \fi\fi
-% \else
-% \noindent
-% \ifmarginfloat
-% % \llap{\unhbox\floatbox\hskip\leftskip\hskip\linkermargeafstand}%
-% \llap{\tbox{\unhbox\floatbox\hskip\leftskip\hskip\linkermargeafstand}}%
-% \else\ifedgefloat
-% \llap{\tbox{\unhbox\floatbox\hskip\leftskip\hskip\linkermargeafstand
-% \hskip\linkermargebreedte\hskip\linkerrandafstand}}%
-% \else
-% \unhbox\floatbox
-% \fi\fi
-% \hfill
-% \fi
-% \egroup
-% \par
-% \kern-\sidefloatheight
-% \penalty10001 % oeps, this will change
-% \normalbaselines
-% \prevdepth\presidefloatdepth
-% %\noindent
-% \resetsidefloatparagraph
-% \ignorespaces}
-
-\def\setsidefloat% nilling everypar saves time and redudant pos's
- {% removed here dec 2001
- % {\everypar\emptytoks\forgetall\vbox{\strut}\vskip-\lineheight}%
- \ifmarginfloat \else \ifedgefloat \else
- \kern\sidefloattopskip
- \fi \fi
+
+\def\setsidefloat% nilling everypar saves time and redudant pos's
+ {% removed here dec 2001
+ % {\everypar\emptytoks\forgetall\verticalstrut\vskip-\struttotal}%
+ \ifnum\sidefloattype=4 \kern\sidefloattopskip \fi
+ \ifnum\sidefloattype=5 \kern\sidefloattopskip \fi
\edef\presidefloatdepth{\the\prevdepth}%
\nointerlineskip
\bgroup
\everypar\emptytoks
\parskip\zeropoint
+ %\checksidefloatshift
+ \setsidefloatskips
\logsidefloat
- \ifrightfloat
- \hfill
- \ifmarginfloat
- \rlap{\hskip\rechtermargeafstand\hskip\rightskip\unhbox\floatbox}%
- \else\ifedgefloat
- \rlap{\hskip\rechtermargeafstand\hskip\rechtermargebreedte
- \hskip\rechterrandafstand\hskip\rightskip\unhbox\floatbox}%
- \else
- \unhbox\floatbox
- \fi\fi
- \else
- \noindent
- \ifmarginfloat
- \llap{\unhbox\floatbox\hskip\leftskip\hskip\linkermargeafstand}%
- \else\ifedgefloat
- \llap{\unhbox\floatbox\hskip\leftskip\hskip\linkermargeafstand
- \hskip\linkermargebreedte\hskip\linkerrandafstand}%
- \else
- \unhbox\floatbox
- \fi\fi
- \hfill
+ \relax
+ \ifcase\sidefloattype
+ % invalid
+ \or % backspace
+ \noindent\llap{\rlap{\box\floatbox}\hskip\sidefloatleftskip}\hfill
+ \or % leftedge
+ \noindent\llap{\box\floatbox\hskip\sidefloatleftskip}\hfill
+ \or % leftmargin
+ \noindent\llap{\box\floatbox\hskip\sidefloatleftskip}\hfill
+ \or % leftside
+ \noindent\box\floatbox\hfill
+ \or % rightside
+ \hfill\box\floatbox
+ \or % rightmargin
+ \hfill\rlap{\hskip\sidefloatrightskip\box\floatbox}%
+ \or % rightedge
+ \hfill\rlap{\hskip\sidefloatrightskip\box\floatbox}%
+ \or % cutspace
+ \hfill\rlap{\hskip\sidefloatrightskip\llap{\box\floatbox}}%
\fi
\egroup
\par
\kern-\sidefloatheight
- \penalty10001 % oeps, this will change
+ \penalty10001 % oeps, this will change
\normalbaselines
\prevdepth\presidefloatdepth
% \noindent
\resetsidefloatparagraph
- \ignorespaces} % not really needed
+ \ignorespaces} % not really needed
\newcount\sidefloatparagraph
\def\iffirstsidefloatparagraph
- {\ifnum\sidefloatparagraph=1 }
-
-% \def\setsidefloatparagraph
-% {%\advance\sidefloatprogress \sidefloatbottomskip
-% %\!!counta\sidefloatprogress
-%\scratchdimen\sidefloatprogress
-%\advance\scratchdimen \strutht
-%\!!counta\scratchdimen
-% \divide\!!counta \baselineskip
-% \ifnum\!!counta>0
-% \hangindent \ifrightfloat-\fi\sidefloatwidth
-% \hangafter-\!!counta
-% \fi
-% \global\advance\sidefloatparagraph \plusone
-% \iftracesidefloats
-% \hskip-\sidefloatwidth
-% \color[darkgray]%
-% {\vrule\!!height.5\s!pt\!!depth.5\s!pt\!!width\sidefloatwidth
-% %\hskip-.25\bodyfontsize\showstruts\strut\hskip.25\bodyfontsize}%
-% \llap{\showstruts\strut\hskip.25\bodyfontsize}}%
-% \fi}
+ {\ifcase\sidefloatparagraph\or}
\def\setsidefloatparagraph
{%\advance\sidefloatprogress \sidefloatbottomskip
%\!!counta\sidefloatprogress
-\scratchdimen\sidefloatprogress
-\advance\scratchdimen \strutht
-\advance\scratchdimen -10sp % new, needed in prikkels, prevent rounding errors
-\!!counta\scratchdimen
+ \scratchdimen\sidefloatprogress
+ \advance\scratchdimen \strutht
+ \advance\scratchdimen -10sp % new, needed in prikkels, prevent rounding errors
+ \!!counta\scratchdimen
\divide\!!counta \baselineskip
\ifnum\!!counta>0
- \hangindent \ifrightfloat-\fi\sidefloatwidth
+ \hangindent \ifnum\sidefloattype>4 -\fi\sidefloatwidth
\hangafter-\!!counta
\fi
\global\advance\sidefloatparagraph \plusone
@@ -682,4 +713,4 @@
\kern-\!!counta\baselineskip
\penalty\zerocount }
-\protect \endinput
+\protect \endinput
diff --git a/tex/context/base/s-mag-01.tex b/tex/context/base/s-mag-01.tex
index 0cc33c83d..615dad5db 100644
--- a/tex/context/base/s-mag-01.tex
+++ b/tex/context/base/s-mag-01.tex
@@ -174,7 +174,7 @@
[state=start]
\usetypescript
- [palatino][\defaultencoding] % [texnansi]
+ [palatino][\defaultencoding]
\setupbodyfont
[palatino,10pt]
diff --git a/tex/context/base/s-map-01.tex b/tex/context/base/s-map-01.tex
index 0edf5aa5d..4410a5f9d 100644
--- a/tex/context/base/s-map-01.tex
+++ b/tex/context/base/s-map-01.tex
@@ -616,10 +616,10 @@
\ss\tf
\ignorespaces}
-\def\stopWhatever%
+\def\stopWhatever
{\par
\egroup
- \vbox{\strut}
+ \verticalstrut
\noindentation}
%D Tot zover de twee||koloms instelingen.
diff --git a/tex/context/base/setupb.tex b/tex/context/base/setupb.tex
index d42d1e788..8ebbfccb4 100644
--- a/tex/context/base/setupb.tex
+++ b/tex/context/base/setupb.tex
@@ -4664,6 +4664,10 @@
[\c!afstand]
[\c!dimension!]
[]
+ \variable
+ [\c!stapel]
+ [\v!ja,\v!nee]
+ [\v!nee]
\inheritvariables
[\y!setupframed]
[]
@@ -4968,7 +4972,7 @@
\command
[\y!stelkopin]
\type
- [\c!val!\c!vars!]
+ [\c!vals!\c!vars!]
\value
[\c!section!]
[]
@@ -8361,7 +8365,7 @@
\startsetup
\command
- [\y!stelcommentaarin]
+ [\y!setupcomment]
\type
[\c!vars!]
\variable
@@ -8402,14 +8406,14 @@
\startsetup
\command
- [\e!start\v!commentaar]
+ [\e!start\v!comment]
\type
[\c!opt!\c!val!\c!opt!\c!vars!\c!stp!]
\value
[\c!identifier!]
[]
\inheritvariables
- [\y!stelcommentaarin]
+ [\y!setupcomment]
[]
\stopsetup
@@ -8422,7 +8426,7 @@
[\c!identifier!]
[]
\inheritvariables
- [\y!stelcommentaarin]
+ [\y!setupcomment]
[]
\stopsetup
diff --git a/tex/context/base/setupe.tex b/tex/context/base/setupe.tex
index 43f291253..e7166b2bc 100644
--- a/tex/context/base/setupe.tex
+++ b/tex/context/base/setupe.tex
@@ -142,9 +142,9 @@
\def\c!repeat! {}
\def\c!tex! #1{\addtypespec{command}{#1}\doanother{tex}}
-\def\c!or! #1#2{\doline{\space\space\space\space<choice>}%
+\def\c!or! #1#2{\doline{\space\space\space\space<cd:choice>}%
#1#2%
- \doline{\space\space\space\space</choice>}}
+ \doline{\space\space\space\space</cd:choice>}}
% wrapper
@@ -163,8 +163,11 @@
\bgroup \catcode`\<=\@@other
-\unexpanded\gdef\dostring#1#2#3{\immediate\write\scratchwrite{#1<#2cd:#3>}}
- \gdef\doline #1{\immediate\write\scratchwrite{#1}}
+\unexpanded\gdef\dostring#1#2#3%
+ {\immediate\write\scratchwrite{#1<#2cd:#3>}} % todo
+
+\gdef\doline#1%
+ {\immediate\write\scratchwrite{#1}}
\egroup
diff --git a/tex/context/base/spec-def.tex b/tex/context/base/spec-def.tex
index 98b1fbd56..fa7b79b0e 100644
--- a/tex/context/base/spec-def.tex
+++ b/tex/context/base/spec-def.tex
@@ -888,7 +888,16 @@
\installspecial [\dostarttransparency] [or] [2]
\installspecial [\dostoptransparency] [or] [0]
-%D Some suitable special collections are defined below.
+%D \macros
+%D {doattachfile}
+%D
+%D \starttypen
+%D \doattachfile{title}{width}{height}{color}{symbol}{file}
+%D \stoptypen
+
+\installspecial [\doattachfile] [or] [6]
+
+%D We define a couple of backends:
\defineoutput [dvipsone] [dvi,ps,yy]
\defineoutput [dviwindo] [dvi,ps,yy,win]
diff --git a/tex/context/base/spec-fdf.tex b/tex/context/base/spec-fdf.tex
index 2126d6cc6..bd82f28bb 100644
--- a/tex/context/base/spec-fdf.tex
+++ b/tex/context/base/spec-fdf.tex
@@ -11,6 +11,9 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+%D We need to check if we can use \type {\driverreferenced}
+%D object in more places.
+
%D Initialization of fields is tricky. If a field has no
%D value, it is kind of not there. If ResetForm is used, the
%D default is assigned, but pushbuttons are spoiled. Adding a
@@ -447,7 +450,7 @@
\let\PDFopenpageaction \empty
\let\PDFclosepageaction\empty
-\def\doPDFsetupopenpageaction%
+\def\doPDFsetupopenpageaction
{\global\let\PDFopenpageaction\lastPDFaction}
\def\doPDFsetupclosepageaction
@@ -866,6 +869,40 @@
\ifx\pdf@@actions\empty\else/A << \pdf@@actions >>\fi}}%
\egroup}
+%D \macros
+%D {doPDFattachfile}
+
+\def\doPDFfilestreamobject class #1 name #2 file #3%
+ {}
+
+\def\doPDFattachfile#1#2#3#4#5#6%
+ {\bgroup % title width height color symbol file
+ \presetPDFsymbolappearance{#4}{#5}% sets width/height
+ \edef\PDFfile{#6}\convertcommand\PDFfile\to\PDFfile
+ \setbox\scratchbox\vbox to #3
+ {\vfill
+ \doifnotflagged{a:\PDFfile}%
+ {\doPDFfilestreamobject class PDFEF name {\PDFfile} file {#6}%
+ \doglobal\setflag{a:\PDFfile}}%
+ \doPDFgetobjectreference{PDFEF}\PDFfile\PDFobjectreference
+ \doPDFannotation width {\width} height {\height} data
+ {/Subtype /FileAttachment
+ /FS \PDFobjectreference\space
+ /Contents (#1)
+ \PDFsymbol
+ \PDFattributes}%
+ \vskip#3%
+ \vskip-\height}%
+ \smashbox\scratchbox
+ \wd\scratchbox\width
+ \ht\scratchbox\height
+ \box\scratchbox
+ \egroup}
+
+\definespecial \doattachfile {\doPDFattachfile}
+
+% todo
+
%D \macros
%D {doPDFinsertbookmark}
%D
@@ -1099,7 +1136,7 @@
% \ifx\FDFactions\empty\else
% \xdef\FDFactions{/AA << \FDFactions >>}% since 1.3 no longer inherited
% \fi}
-%% \setFDFaction A#2}% mouseup % changed for version 5
+%% {\setFDFaction A#2}% mouseup % changed for version 5
\def\setFDFactions[#1,#2,#3,#4,#5,#6,#7,#8,%
{\global\let\FDFactions\empty
@@ -1230,8 +1267,7 @@
\writestatus{FDF}{second run needed for field list (#1)}%
\fi
\doPDFgetobjectreference{FDF}{#1}\PDFobjectreference
- \xdef\FDFcollection%
- {\FDFcollection\space\PDFobjectreference}%
+ \xdef\FDFcollection{\FDFcollection\space\PDFobjectreference}%
\fi}
\prependtoksonce \flushFDFnames \to \everylastshipout % test \everybye
@@ -2022,101 +2058,93 @@
%D An example its use is the next special, one that deals with
%D text annotations.
-\def\PDFcommentNew {/Insert}
-\def\PDFcommentBalloon {/Comment}
-\def\PDFcommentAddition {/NewParagraph}
-\def\PDFcommentHelp {/Help}
-\def\PDFcommentParagraph {/Paragraph}
-\def\PDFcommentKey {/Key }
-
-\long\def\doPDFinsertcomment#1#2#3#4#5#6#7#8%
- {\bgroup % title width height color open symbol collect data
- \doifelsenothing{#1}
- {\let\PDFidentifier\empty}
- {\def\PDFidentifier{/T (#1)}}%
- \doifelsenothing{#4}
- {\let\PDFattributes\empty}
- {\def\PDFattributes{/C \FDFcolor{#4}}}%
- \doifundefinedelse{PDFcomment#6}
- {\let\PDFcomment\empty}
- {\def\PDFcomment{/Name \getvalue{PDFcomment#6} }}%
- \sanitizePDFencoding#8\to\PDFdata
- \setbox\scratchbox=\vbox to #3
- {\vfill
- \doPDFannotation width #2 height #3 data
- {/Subtype /Text
- \ifcase#5 \else/Open true\fi
- /Contents \ifPDFunicode <\PDFdata> \else(\PDFdata) \fi
- \PDFcomment
- \PDFidentifier
- \PDFattributes}}%
- \wd\scratchbox\zeropoint
- \ht\scratchbox\zeropoint
- \dp\scratchbox\zeropoint
- \box\scratchbox
- \egroup}
-
-\startmode[atpragma]
-
-% todo: scale annot relative to paper width to get
-% dimensions honored
+% starting point (keep this)
+%
+% \long\def\doPDFinsertcomment#1#2#3#4#5#6#7#8%
+% {\bgroup % title width height color open symbol collect data
+% \doifelsenothing{#1}
+% {\let\PDFidentifier\empty}
+% {\def\PDFidentifier{/T (#1)}}%
+% \doifelsenothing{#4}
+% {\let\PDFattributes\empty}
+% {\def\PDFattributes{/C \FDFcolor{#4}}}%
+% \doifundefinedelse{PDFsymbol#6}
+% {\let\PDFsymbol\empty}
+% {\def\PDFsymbol{/Name \getvalue{PDFsymbol#6} }}%
+% \sanitizePDFencoding#8\to\PDFdata
+% \setbox\scratchbox\vbox to #3
+% {\vfill
+% \doPDFannotation width #2 height #3 data
+% {/Subtype /Text
+% \ifcase#5 \else/Open true\fi
+% /Contents \ifPDFunicode <\PDFdata> \else(\PDFdata) \fi
+% \PDFsymbol
+% \PDFidentifier
+% \PDFattributes}}%
+% \wd\scratchbox\zeropoint
+% \ht\scratchbox\zeropoint
+% \dp\scratchbox\zeropoint
+% \box\scratchbox
+% \egroup}
\newcounter\nofFDFcomments
-\newif\ifPDFpopupcomments \PDFpopupcommentstrue
-
-\newbox\PDFcommentbox
+\newif\ifPDFpopupcomments \PDFpopupcommentstrue
\def\doPDFflushcomments
- {\box\PDFcommentbox}
+ {\box\PDFsymbolbox}
\long\def\doPDFinsertcomment#1#2#3#4#5#6#7#8%
{\bgroup % title width height color open symbol collect data
+ \presetPDFsymbolappearance{#4}{#6}% sets width/height
\doifelsenothing{#1}
{\let\PDFidentifier\empty}
{\def\PDFidentifier{/T (#1)}}%
- \doifelsenothing{#4}
- {\let\PDFattributes\empty}
- {\def\PDFattributes{/C \FDFcolor{#4}}}%
- \def\width {18pt}%
- \def\height{24pt}%
- \doifundefinedelse{PDFcomment#6}
- {\doifelsenothing{#6}
- {\let\PDFcomment\empty}
- {\presetPDFcommentappearance{#6}}}
- {\def\PDFcomment{/Name \getvalue{PDFcomment#6} }}%
\sanitizePDFencoding#8\to\PDFdata
- \setbox\scratchbox=\vbox to #3
+ \setbox\scratchbox\vbox to #3
{\vfill
\ifPDFpopupcomments
\doglobal\increment\nofFDFcomments
\doifobjectreferencefoundelse{FDF}{c:\nofFDFcomments}
{\doPDFgetobjectreference{FDF}{c:\nofFDFcomments}\PDFobjectreference
\donetrue}
- {\donefalse}%
+ \donefalse
\ifdone
\setbox\scratchbox\hbox
- {\doPDFannotation width #2 height #3 data % text window
+ % pdftex (efficient)
+ % {\doPDFannotation
+ % generic (less efficient)
+ {\doPDFannotationobject class FDF name {c::\nofFDFcomments}
+ % argument (common)
+ width #2 height #3 data % text window
{/Subtype /Popup
/Parent \PDFobjectreference}}%
\ifcase#7\relax
\vbox to \height{\forgetall\vskip#3\box\scratchbox\vss}%
\else % incredible trial and error hack
- \global\setbox\PDFcommentbox\vbox
+ \global\setbox\PDFsymbolbox\vbox
{\hsize#2%
\forgetall
- \vsmash{\box\PDFcommentbox}
+ \vsmash{\box\PDFsymbolbox}
\box\scratchbox}%
\fi
\fi
+ % generic
+ \doifobjectreferencefoundelse{FDF}{c::\nofFDFcomments}
+ {\doPDFgetobjectreference{FDF}{c::\nofFDFcomments}\PDFobjectreference
+ \donetrue}
+ \donefalse
\doPDFannotationobject class FDF name {c:\nofFDFcomments}
width {\width} height {\height} data
{/Subtype /Text
\ifcase#5 \else/Open true\fi
- \ifdone /Popup \the\pdflastannot\space 0 R\fi
+ % pdftex (efficient)
+ % \ifdone /Popup \the\pdflastannot\space 0 R\fi
+ % generic (less efficient)
+ \ifdone /Popup \PDFobjectreference\fi
/Contents \ifPDFunicode <\PDFdata> \else(\PDFdata) \fi
- \PDFcomment
\PDFidentifier
+ \PDFsymbol
\PDFattributes}%
\vskip#3%
\vskip-\height
@@ -2125,42 +2153,65 @@
{/Subtype /Text
\ifcase#5 \else/Open true\fi
/Contents \ifPDFunicode <\PDFdata> \else(\PDFdata) \fi
- \PDFcomment
+ \PDFsymbol
\PDFidentifier
\PDFattributes}%
\fi}%
- \wd\scratchbox\zeropoint
- \ht\scratchbox\zeropoint
- \dp\scratchbox\zeropoint
+ \smashbox\scratchbox
\box\scratchbox
\egroup}
-\def\presetPDFcommentappearance#1%
- {\getfromcommacommand[#1][1]\let\PDFcommentnormalsymbol\commalistelement
- \getfromcommacommand[#1][2]\let\PDFcommentdownsymbol \commalistelement
- \doifsymboldefinedelse\PDFcommentnormalsymbol
- {\doifsymboldefinedelse\PDFcommentdownsymbol
- {\dopresetPDFcommentappearance
- \PDFcommentnormalsymbol\PDFcommentdownsymbol}
- {\dopresetPDFcommentappearance
- \PDFcommentnormalsymbol\PDFcommentnormalsymbol}}
- {\doifsymboldefinedelse\PDFcommentdownsymbol
- {\dopresetPDFcommentappearance
- \PDFcommentdownsymbol\PDFcommentdownsymbol}
- {\let\PDFcomment\empty}}}
-
-\def\dopresetPDFcommentappearance#1#2%
+% symbols with a reasonable default of 18/24 pt
+
+\newbox\PDFsymbolbox
+
+\def\PDFsymbolNew {/Insert}
+\def\PDFsymbolBalloon {/Comment}
+\def\PDFsymbolAddition {/NewParagraph}
+\def\PDFsymbolHelp {/Help}
+\def\PDFsymbolParagraph {/Paragraph}
+\def\PDFsymbolKey {/Key }
+
+\def\PDFsymbolGraph {/Graph}
+\def\PDFsymbolPaperclip {/Paperclip}
+\def\PDFsymbolAttachment{/Attachment}
+\def\PDFsymbolTag {/Tag}
+
+\def\presetPDFsymbolappearance#1#2%
+ {\doifelsenothing{#1}
+ {\let\PDFattributes\empty}
+ {\def\PDFattributes{/C \FDFcolor{#1}}}%
+ \def\width {18pt}%
+ \def\height{24pt}%
+ \doifelsenothing{#2}
+ {\let\PDFsymbol\empty}
+ {\ifundefined{PDFsymbol#2}%
+ \getfromcommacommand[#2][1]\let\PDFsymbolnormalsymbol\commalistelement
+ \getfromcommacommand[#2][2]\let\PDFsymboldownsymbol \commalistelement
+ \doifsymboldefinedelse\PDFsymbolnormalsymbol
+ {\doifsymboldefinedelse\PDFsymboldownsymbol
+ {\dopresetPDFsymbolappearance
+ \PDFsymbolnormalsymbol\PDFsymboldownsymbol}
+ {\dopresetPDFsymbolappearance
+ \PDFsymbolnormalsymbol\PDFsymbolnormalsymbol}}
+ {\doifsymboldefinedelse\PDFsymboldownsymbol
+ {\dopresetPDFsymbolappearance
+ \PDFsymboldownsymbol\PDFsymboldownsymbol}
+ {\let\PDFsymbol\empty}}%
+ \else
+ \def\PDFsymbol{/Name \getvalue{PDFsymbol#2} }%
+ \fi}}
+
+\def\dopresetPDFsymbolappearance#1#2%
{\dopresetfieldsymbol{#1}%
\dopresetfieldsymbol{#2}%
\setbox\scratchbox\hbox{\symbol[#1]}%
\edef\width {\the\wd\scratchbox}%
\edef\height{\the\ht\scratchbox}%
- \doPDFgetobjectreference{SYM}{#1}\FDFcommentNappearance
- \doPDFgetobjectreference{SYM}{#2}\FDFcommentDappearance
- \edef\PDFcomment
- {/AP <</N \FDFcommentNappearance /D \FDFcommentDappearance>>}}
-
-\stopmode
+ \doPDFgetobjectreference{SYM}{#1}\FDFsymbolNappearance
+ \doPDFgetobjectreference{SYM}{#2}\FDFsymbolDappearance
+ \edef\PDFsymbol
+ {/AP <</N \FDFsymbolNappearance /D \FDFsymbolDappearance>>}}
%D Hooked into \CONTEXT, this special supports
%D
diff --git a/tex/context/base/spec-tpd.tex b/tex/context/base/spec-tpd.tex
index b7ff66081..6ff4f802e 100644
--- a/tex/context/base/spec-tpd.tex
+++ b/tex/context/base/spec-tpd.tex
@@ -210,8 +210,8 @@
\definefileinsertion{tpd}{mps}#1#2#3#4#5#6#7#8#9%
{\hbox
{%\convertMPcolors{#1}% plugged in supp-mpe
- \scratchdimen=#3pt \PointsToReal{.01\scratchdimen}\xscale
- \scratchdimen=#4pt \PointsToReal{.01\scratchdimen}\yscale
+ \scratchdimen#3\s!pt \PointsToReal{.01\scratchdimen}\xscale
+ \scratchdimen#4\s!pt \PointsToReal{.01\scratchdimen}\yscale
\convertMPtoPDF{#1}\xscale\yscale
\global\let\PDFimagereference\empty}}
@@ -261,7 +261,7 @@
\def\checkpdfimagepagenumber#1%
{\let\pdfimagepagenumber\empty
\getfromcommacommand[#1][1]%
- \doifnumberelse{\commalistelement}
+ \doifnumberelse\commalistelement
{\ifcase\commalistelement\else
\edef\pdfimagepagenumber{page \commalistelement}%
%\message{(pdf image \pdfimagepagenumber)}%
@@ -349,7 +349,7 @@
\else\ifx\PDFfigurereference\empty
\donetrue
\else
- \doifinstringelse{\filesuffix}{\c!png,\c!jpg}\donetrue\donefalse
+ \doifinstringelse\filesuffix{\c!png,\c!jpg}\donetrue\donefalse
\fi\fi}
{\donefalse}%
\ifdone
@@ -360,13 +360,13 @@
\xdef\PDFimagereference{\the\pdflastximage}%
\xdef\nofinsertpages{\the\pdflastximagepages}%
\pdfrefximage\pdflastximage}%
- #6=\wd\foundexternalfigure
- #7=\ht\foundexternalfigure
+ #6\wd\foundexternalfigure
+ #7\ht\foundexternalfigure
\global\let\PDFfigurereference\empty
\global\let\PDFimageattributes\empty
\else
- #6=\zeropoint
- #7=\zeropoint
+ #6\zeropoint
+ #7\zeropoint
\fi
\else
#1{#2}{#3}{#4}{#5}{#6}{#7}% \normaldogetfiguresize...
@@ -376,14 +376,14 @@
\def\dogetTPDfiguresize#1#2#3#4#5#6#7%
{\ifmeasureTPDfiguresize
- #4=\zeropoint
- #5=\zeropoint
+ #4\zeropoint
+ #5\zeropoint
\doifvalidpdfimagefileelse{#2}
- {\global\setbox\foundexternalfigure=\vbox{\pdfimage{#2}}%
- #6=\wd\foundexternalfigure
- #7=\ht\foundexternalfigure}
- {#6=\zeropoint
- #7=\zeropoint}%
+ {\global\setbox\foundexternalfigure\vbox{\pdfimage{#2}}%
+ #6\wd\foundexternalfigure
+ #7\ht\foundexternalfigure}
+ {#6\zeropoint
+ #7\zeropoint}%
\else
#1{#2}{#3}{#4}{#5}{#6}{#7}% \normaldogetfiguresize...
\fi}
@@ -429,8 +429,7 @@
%D Drawing frames with round corners is inherited from the
%D main module.
-\definespecial\doovalbox%
- {\doPDFovalbox}
+\definespecial\doovalbox {\doPDFovalbox}
%D \macros
%D {dostartgraymode,dostopgraymode,
@@ -443,25 +442,25 @@
%D
%D These are implemented in the main \PDF\ module.
-\definespecial\dostartgraymode {\doPDFstartgraymode}
-\definespecial\dostopgraymode {\doPDFstopgraymode}
-\definespecial\dostartrgbcolormode {\doPDFstartrgbcolormode}
-\definespecial\dostartcmykcolormode {\doPDFstartcmykcolormode}
-\definespecial\dostartgraycolormode {\doPDFstartgraycolormode}
-\definespecial\dostartspotcolormode {\doPDFstartspotcolormode}
-\definespecial\dostopcolormode {\doPDFstopcolormode}
-\definespecial\dostartrotation {\doPDFstartrotation}
-\definespecial\dostoprotation {\doPDFstoprotation}
-\definespecial\dostartscaling {\doPDFstartscaling}
-\definespecial\dostopscaling {\doPDFstopscaling}
-\definespecial\dostartmirroring {\doPDFstartmirroring}
-\definespecial\dostopmirroring {\doPDFstopmirroring}
-\definespecial\dostartnegative {\doPDFstartnegative}
-\definespecial\dostopnegative {\doPDFstopnegative}
-
-\definespecial\doregistercmykspotcolor {\doPDFregistercmykspotcolor}
-\definespecial\doregisterrgbspotcolor {\doPDFregisterrgbspotcolor}
-\definespecial\doregistergrayspotcolor {\doPDFregistergrayspotcolor}
+\definespecial\dostartgraymode {\doPDFstartgraymode}
+\definespecial\dostopgraymode {\doPDFstopgraymode}
+\definespecial\dostartrgbcolormode {\doPDFstartrgbcolormode}
+\definespecial\dostartcmykcolormode{\doPDFstartcmykcolormode}
+\definespecial\dostartgraycolormode{\doPDFstartgraycolormode}
+\definespecial\dostartspotcolormode{\doPDFstartspotcolormode}
+\definespecial\dostopcolormode {\doPDFstopcolormode}
+\definespecial\dostartrotation {\doPDFstartrotation}
+\definespecial\dostoprotation {\doPDFstoprotation}
+\definespecial\dostartscaling {\doPDFstartscaling}
+\definespecial\dostopscaling {\doPDFstopscaling}
+\definespecial\dostartmirroring {\doPDFstartmirroring}
+\definespecial\dostopmirroring {\doPDFstopmirroring}
+\definespecial\dostartnegative {\doPDFstartnegative}
+\definespecial\dostopnegative {\doPDFstopnegative}
+
+\definespecial\doregistercmykspotcolor{\doPDFregistercmykspotcolor}
+\definespecial\doregisterrgbspotcolor {\doPDFregisterrgbspotcolor}
+\definespecial\doregistergrayspotcolor{\doPDFregistergrayspotcolor}
\def\doPDFregistersomespotcolor#1#2#3#4%
{\immediate \pdfobj stream attr
@@ -478,8 +477,8 @@
%D For transparency, we need to implement a couple of
%D auxiliary macros. If needed, we will generalize tham later.
-\definespecial\dostarttransparency {\doPDFstarttransparency}
-\definespecial\dostoptransparency {\doPDFstoptransparency}
+\definespecial\dostarttransparency{\doPDFstarttransparency}
+\definespecial\dostoptransparency {\doPDFstoptransparency}
\PDFtransparencysupportedtrue
@@ -526,7 +525,7 @@
\definespecial\dostartclipping#1#2#3%
{\PointsToBigPoints{#2}\width
\PointsToBigPoints{#3}\height
- \grabMPclippath{#1}{1}{\width}{\height}
+ \grabMPclippath{#1}{1}\width\height
{0 0 m \width\space 0 l \width \height l 0 \height l}%
\pdfliteral
{q 0 w \MPclippath\space W n}}
@@ -541,8 +540,8 @@
%D Nothing special is needed to enable \PDF\ commands and
%D interaction. We stick with a message.
-\definespecial\dosetupinteraction%
- {\showmessage{\m!interactions}{21}{pdftex}}
+\definespecial\dosetupinteraction
+ {\showmessage\m!interactions{21}{pdftex}}
\definespecial\dosetupopenaction {\doPDFsetupopenaction}
\definespecial\dosetupcloseaction{\doPDFsetupcloseaction}
@@ -666,7 +665,7 @@
\definespecial\dobeginofprofile#1#2#3#4%
{\setPDFdestination{#1}%
- \doifsomething{\PDFdestination}
+ \doifsomething\PDFdestination
{\pdfthread
width #2 height #3
attr {/Title (\PDFdestination)} % can be omitted
@@ -766,12 +765,12 @@
\definespecial\dostartobject#1#2#3#4#5%
{\bgroup
\setbox\nextbox\vbox\bgroup
- \def\dodostopobject%
+ \def\dodostopobject
{\egroup
\pdfform\nextbox
\dosetobjectreference{#1}{#2}{\the\pdflastform}}}
- \definespecial\dostopobject%
+ \definespecial\dostopobject
{\dodostopobject
\egroup}
@@ -1124,6 +1123,13 @@
\appendtoPDFdocumentextgstates{/GSpositive \the\pdflastobj\space0 R}%
\global\let\initializePDFnegative\relax}
+%D File embedding:
+
+\def\doPDFfilestreamobject class #1 name #2 file #3%
+ {\immediate\pdfobj stream file{#3}%
+ \doPDFdictionaryobject class {#1} name {#2} data
+ {/Type /Filespec /F (#3) /EF <</F \the\pdflastobj\space0 R>>}}
+
% %D We can set \METAPOST\ prologues to~2:
\def\MPprologues{2}
diff --git a/tex/context/base/supp-box.tex b/tex/context/base/supp-box.tex
index fd497fe5e..66deb63a3 100644
--- a/tex/context/base/supp-box.tex
+++ b/tex/context/base/supp-box.tex
@@ -785,8 +785,8 @@
\else
% give the previous line a normal depth
\donetrue
- {\everypar\emptytoks\normalvbox{\strut}}\nobreak
- \kern-\lineheight % geen \vskip
+ {\forgeteverypar\verticalstrut}\nobreak
+ \kern-\struttotal % geen \vskip
\kern-\parskip
% \vskip-\strutdp
\fi\fi\fi
@@ -1475,7 +1475,7 @@
\normalhbox}
%D \macros
-%D {setrigidcolumnhsize,rigidcolumnbalance}
+%D {setrigidcolumnhsize,rigidcolumnbalance,rigidcolumnlines}
%D
%D These macros are copied from the \TEX book, page~397, and
%D extended by a macro that sets the \type{\hsize}.
@@ -1500,7 +1500,7 @@
\def\setrigidcolumnhsize#1#2#3%
{\xdef\savedrigidhsize{\the\hsize}%
\hsize#1\relax
- \global\chardef\rigidcolumns=#3\relax
+ \global\chardef\rigidcolumns#3\relax
\scratchdimen -#2\relax
\multiply\scratchdimen #3\relax
\advance\scratchdimen #2\relax
@@ -1509,6 +1509,8 @@
\newbox\rigidcolumnbox
+\let\rigidcolumnlines\!!zerocount
+
\def\rigidcolumnbalance#1%
{\ifnum\rigidcolumns=1 % tzt ook h/d correctie
\ifinner\ifhmode\box\else\unvbox\fi\else\unvbox\fi#1\relax
@@ -1520,9 +1522,13 @@
{\line{}\goodbreak\unvbox#1\removebottomthings}%
\splittopskip\openstrutheight
\setbox\scratchbox\vsplit\rigidcolumnbox to \zeropoint
- \scratchdimen\ht\rigidcolumnbox
- \divide\scratchdimen \rigidcolumns
- \getnoflines\scratchdimen
+ \ifcase\rigidcolumnlines\relax
+ \scratchdimen\ht\rigidcolumnbox
+ \divide\scratchdimen \rigidcolumns
+ \getnoflines\scratchdimen
+ \else
+ \noflines\rigidcolumnlines % to be sure
+ \fi
\scratchdimen\noflines\lineheight
\setbox\scratchbox\normalhbox to \savedrigidhsize
{\dorecurse\rigidcolumns
diff --git a/tex/context/base/supp-emp.tex b/tex/context/base/supp-emp.tex
index 0a59a1970..5d9a22e2a 100644
--- a/tex/context/base/supp-emp.tex
+++ b/tex/context/base/supp-emp.tex
@@ -96,7 +96,7 @@
%D for the next line segment. So, at each point specified by
%D \type {\EMlineto} we need to know the coordinates.
-\def\EMmoveto%
+\def\EMmoveto
{\EMgetposition\EMlastmovex\EMlastmovey}
%D The primitives \type {\pdflastxpos} and \type
@@ -112,13 +112,13 @@
\def\EMlinewd{.4}
-\def\EMlineto%
+\def\EMlineto
{\bgroup
\EMgetposition\EMlastlinex\EMlastliney
- \count0=\EMlastmovex \advance\count0 by -\EMlastlinex
- \count2=\EMlastmovey \advance\count2 by -\EMlastliney
- \divide\count0 by 65536
- \divide\count2 by 65536
+ \count0=\EMlastmovex \advance\count0 -\EMlastlinex
+ \count2=\EMlastmovey \advance\count2 -\EMlastliney
+ \divide\count0 65536
+ \divide\count2 65536
\pdfliteral{\EMlinewd\space w 0 0 m \the\count0 \space\the\count2 \space l S}%
\global\let\EMlastmovex\EMlastlinex
\global\let\EMlastmovey\EMlastliney
@@ -127,7 +127,7 @@
%D We need a fresh start, so we first set the current position
%D to zero.
-\def\resetEMspecials%
+\def\resetEMspecials
{\gdef\EMlastmovex{0}\gdef\EMlastmovey{0}}
%D Next comes the macro that keeps track of the position. The
@@ -162,7 +162,7 @@
\def\EMgetposition#1#2%
{\bgroup
\pdfsavepos
- \global\advance\EMcounter by 1
+ \global\advance\EMcounter 1
\expandafter\write\expandafter\EMfile\expandafter
{\expandafter\noexpand\expandafter\EMsetpos\number\EMcounter
\space\number\pdflastxpos\space\number\pdflastypos}%
@@ -193,7 +193,7 @@
\closein\scratchread
\immediate\openout\EMfile=\EMfilename\relax}
-\def\stopEMspecials%
+\def\stopEMspecials
{\closeout\EMfile}
%D Just to be sure, we test if \type {\scratchread} is defined,
@@ -266,7 +266,7 @@
\ifx\dosetpositionpt\undefined \else % context part
-\edef\EMlinewd{\the\linewidth}
+% \edef\EMlinewd{\expandafter\withoutpt\the\linewidth}
%D A few pages ago, we mentioned that \CONTEXT\ has built||in
%D position tracking. This means that when we want to implement
@@ -281,7 +281,7 @@
\newskip \EMlastmovex \newskip \EMlastmovey
\newskip \EMlastlinex \newskip \EMlastliney
-\def\resetEMspecials%
+\def\resetEMspecials
{\global\EMlastmovex=0pt \global\EMlastmovey=\EMlastmovex}
\resetEMspecials \appendtoks\resetEMspecials\to\everyshipout
@@ -300,10 +300,10 @@
\global#1=\POSx\EMvariable
\global#2=\POSy\EMvariable}
-\def\EMmoveto%
+\def\EMmoveto
{\EMgetposition\EMlastmovex\EMlastmovey}
-\def\EMlineto%
+\def\EMlineto
{\EMgetposition\EMlastlinex\EMlastliney
\global\advance\EMlastmovex -\EMlastlinex
\global\advance\EMlastmovey -\EMlastliney
@@ -364,7 +364,7 @@
{\bgroup % context alone, but it's a hack anyway
\dimen0=#1\relax
\count0=\dimen0
- \divide\count0 by 65536
+ \divide\count0 65536
\ifcase\pdfoutput
\special{em:linewidth \the\dimen0}%
\fi
diff --git a/tex/context/base/supp-fun.tex b/tex/context/base/supp-fun.tex
index 6f324be6b..547ad1365 100644
--- a/tex/context/base/supp-fun.tex
+++ b/tex/context/base/supp-fun.tex
@@ -646,8 +646,6 @@
\egroup
\expandafter\font\expandafter#2\fontname\font\relax}
-
-
%D Afterwards, we have access to the calculated size by:
\let\TheNormalizedFontSize\!!zeropoint
@@ -777,5 +775,38 @@
\writestatus{\strippedcsname\FittingText}{height: \the\!!heighta}%
\unvbox\scratchbox
\egroup}
+
+%D New:
+
+% \font width gap font spec text
+
+\def\NormalizeFontWidthSpread#1#2#3#4#5#6%
+ {\global\setfalse\NFSpread
+ \scratchdimen#3%
+ \scratchdimen-.5\scratchdimen
+ \advance\scratchdimen#2\relax
+ \NormalizeFontWidth
+ #1%
+ {\def\+{\global\settrue\NFSpread\gobbleuntil\relax}%
+ \def\\{\gobbleuntil\relax}% newline
+ \stelspatieringin
+ #6\relax}%
+ {\scratchdimen}%
+ {#4}%
+ \ifconditional\NFSpread
+ % de gap valt in de binding
+ \else
+ \definefont[\strippedcsname#1][#4 #5]%
+ \fi}
+
+\def\SpreadGapText#1#2%
+% {{\def\+{\blackrule[\c!breedte=#1]}#2}}
+ {{\def\+{\kern#1}#2}}
+
+\def\GapText#1#2#3#4#5% width distance font spec title
+ {\bgroup
+ \NormalizeFontWidthSpread\DummyFont{#1}{#2}{#3}{#4}{#5}%
+ \DummyFont\stelspatieringin\SpreadGapText{#2}{#5}\endgraf
+ \egroup}
\protect \endinput
diff --git a/tex/context/base/supp-mps.tex b/tex/context/base/supp-mps.tex
index 483084c3c..5ce98814a 100644
--- a/tex/context/base/supp-mps.tex
+++ b/tex/context/base/supp-mps.tex
@@ -699,16 +699,16 @@
%D More save is to use a number for {MP}{#1} which permits
%D redefinition.
-\newcounter\MPobjectcounter
+\newcount\MPobjectcounter
\def\douseMPbox#1%
- {\doglobal\increment\MPobjectcounter
- \setobject{MP}{\MPobjectcounter}\vbox
+ {\global\advance\MPobjectcounter\plusone
+ \setobject{MP}{\number\MPobjectcounter}\vbox
{\forgetall
\loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{}%
\deallocateMPslot\currentMPgraphic
\placeMPgraphic}%
- \setxvalue{#1}{\noexpand\getobject{MP}{\MPobjectcounter}}}
+ \setxvalue{#1}{\noexpand\getobject{MP}{\number\MPobjectcounter}}}
\def\nouseMPbox#1%
{\setxvalue{#1}%
diff --git a/tex/context/base/supp-num.tex b/tex/context/base/supp-num.tex
index 610c5b6b7..afd733ed8 100644
--- a/tex/context/base/supp-num.tex
+++ b/tex/context/base/supp-num.tex
@@ -201,7 +201,7 @@
\ifcase\powerdigits\else\digitpowerseparator^{\savedpowerdigits}\fi}
\def\doscandigit#1%
- {\ifcase\skipdigit\hbox\else\hphantom\fi\bgroup
+ {\ifcase\skipdigit\@EA\hbox\else\@EA\hphantom\fi\bgroup
\mathematics % brr, needed because of stored punctuation
{\ifnum\digitinputmode=#1\relax
\ifcase\digitoutputmode
diff --git a/tex/context/base/supp-pdf.tex b/tex/context/base/supp-pdf.tex
index 59fc9c75b..5999e86da 100644
--- a/tex/context/base/supp-pdf.tex
+++ b/tex/context/base/supp-pdf.tex
@@ -210,8 +210,8 @@
\ScaledPointsToBigPoints{\number\dimen0}\PDFyoffset
\dimen0=#4\dimen0=#6\dimen0
\xdef\PDFheight{\the\dimen0}%
- \global\let\PDFxoffset=\PDFxoffset
- \global\let\PDFyoffset=\PDFyoffset}
+ \global\let\PDFxoffset\PDFxoffset
+ \global\let\PDFyoffset\PDFyoffset}
\def\setPDFmediabox#1[#2 #3 #4 #5]#6\done%
{\dimen2=#2bp\dimen2=-\dimen2
@@ -1791,7 +1791,7 @@
% strange rounding/clip in pdftex/viewer
%
-% \def\finishMPgraphic%
+% \def\finishMPgraphic
% {\stopMPresources
% \egroup
% \ifx\pdftexversion\undefined\else\ifnum\pdftexversion<14 % for the moment
diff --git a/tex/context/base/syst-gen.tex b/tex/context/base/syst-gen.tex
index 895a191e1..efe4ddf85 100644
--- a/tex/context/base/syst-gen.tex
+++ b/tex/context/base/syst-gen.tex
@@ -332,12 +332,17 @@
%D define some shortcuts to the local scatchregisters~0, 2, 4,
%D 6 and~8.
-\newcount\!!counta \toksdef\!!toksa=0 \dimendef\!!dimena=0 \chardef\!!boxa=0
-\newcount\!!countb \toksdef\!!toksb=2 \dimendef\!!dimenb=2 \chardef\!!boxb=2
-\newcount\!!countc \toksdef\!!toksc=4 \dimendef\!!dimenc=4 \chardef\!!boxc=4
-\newcount\!!countd \toksdef\!!toksd=6 \dimendef\!!dimend=6 \chardef\!!boxd=6
-\newcount\!!counte \toksdef\!!tokse=8 \dimendef\!!dimene=8 \chardef\!!boxe=8
-\newcount\!!countf
+\newcount\!!counta \toksdef\!!toksa=0 \dimendef\!!dimena= 0 \chardef\!!boxa=0
+\newcount\!!countb \toksdef\!!toksb=2 \dimendef\!!dimenb= 2 \chardef\!!boxb=2
+\newcount\!!countc \toksdef\!!toksc=4 \dimendef\!!dimenc= 4 \chardef\!!boxc=4
+\newcount\!!countd \toksdef\!!toksd=6 \dimendef\!!dimend= 6 \chardef\!!boxd=6
+\newcount\!!counte \toksdef\!!tokse=8 \dimendef\!!dimene= 8 \chardef\!!boxe=8
+\newcount\!!countf \dimendef\!!dimenf=10
+ \dimendef\!!dimeng=12
+ \dimendef\!!dimenh=14
+ \dimendef\!!dimeni=16
+ \dimendef\!!dimenj=18
+
\let\!!stringa=\empty \let\!!stringb=\empty \let\!!stringc=\empty
\let\!!stringd=\empty \let\!!stringe=\empty \let\!!stringf=\empty
@@ -346,8 +351,8 @@
\newdimen\!!widthb \newdimen\!!heightb \newdimen\!!depthb
\newdimen\!!widthc \newdimen\!!heightc \newdimen\!!depthc
-\newif\if!!donea \newif\if!!doneb
-\newif\if!!donec \newif\if!!doned
+\newif\if!!donea \newif\if!!doneb \newif\if!!donec
+\newif\if!!doned \newif\if!!donee \newif\if!!donef
\ifx \z@\undefined \else \let\zeropoint\z@ \fi
\ifx \@ne\undefined \else \let\plusone \@ne \fi
diff --git a/tex/context/base/type-buy.tex b/tex/context/base/type-buy.tex
index 3610bd861..148c193f6 100644
--- a/tex/context/base/type-buy.tex
+++ b/tex/context/base/type-buy.tex
@@ -322,4 +322,48 @@
\stoptypescript
+% utopia (already in other files)
+%
+% \starttypescript [map] [ec,8r,texnansi]
+% \loadmapfile [\typefaceencoding-adobe-utopia]
+% \stoptypescript
+%
+% \starttypescript [serif] [utopia] [name]
+%
+% \definefontsynonym [Serif] [Utopia-Regular]
+% \definefontsynonym [SerifItalic] [Utopia-Italic]
+% \definefontsynonym [SerifSlanted] [Utopia-Slanted]
+% \definefontsynonym [SerifBold] [Utopia-Bold]
+% \definefontsynonym [SerifBoldItalic] [Utopia-BoldItalic]
+% \definefontsynonym [SerifBoldSlanted][Utopia-BoldSlanted]
+%
+% \stoptypescript
+%
+% \starttypescript [serif] [utopia] [texnansi]
+%
+% \definefontsynonym [Utopia-Regular] [texnansi-utrg] [encoding=texnansi]
+% \definefontsynonym [Utopia-Italic] [texnansi-uti] [encoding=texnansi]
+% \definefontsynonym [Utopia-Slanted] [texnansi-uti] [encoding=texnansi]
+% \definefontsynonym [Utopia-Bold] [texnansi-utb] [encoding=texnansi]
+% \definefontsynonym [Utopia-BoldItalic] [texnansi-utbi] [encoding=texnansi]
+% \definefontsynonym [Utopia-BoldSlanted] [texnansi-utbi] [encoding=texnansi]
+%
+% \stoptypescript
+
+% kabel
+
+ \starttypescript [map] [ec,8r,texnansi]
+ \loadmapfile [\typefaceencoding-itc-kabel]
+ \stoptypescript
+
+ \starttypescript [sans] [kabel] [texnansi]
+
+ \definefontsynonym [ItcKabel-Bold] [texnansi-kbb] [encoding=texnansi]
+ \definefontsynonym [ItcKabel-Demi] [texnansi-kbd] [encoding=texnansi]
+ \definefontsynonym [ItcKabel-Medium] [texnansi-kbm] [encoding=texnansi]
+ \definefontsynonym [ItcKabel-Ultra] [texnansi-kbu] [encoding=texnansi]
+ \definefontsynonym [ItcKabel-Book] [texnansi-kbw] [encoding=texnansi]
+
+ \stoptypescript
+
\endinput
diff --git a/tex/context/base/type-enc.tex b/tex/context/base/type-enc.tex
index e2d0d4a14..39527d646 100644
--- a/tex/context/base/type-enc.tex
+++ b/tex/context/base/type-enc.tex
@@ -18,70 +18,94 @@
% Free fonts.
-% Computer Modern Roman (AMS)
-
-\starttypescript [all] [computer-modern] [lm]
-
- % the encoding vector is not yet okay !
-
- \definefontsynonym [cmb10] [lmb10] [encoding=texnansi]
- \definefontsynonym [cmbx10] [lmbx10] [encoding=texnansi]
- \definefontsynonym [cmbx12] [lmbx12] [encoding=texnansi]
- \definefontsynonym [cmbx5] [lmbx5] [encoding=texnansi]
- \definefontsynonym [cmbx6] [lmbx6] [encoding=texnansi]
- \definefontsynonym [cmbx7] [lmbx7] [encoding=texnansi]
- \definefontsynonym [cmbx8] [lmbx8] [encoding=texnansi]
- \definefontsynonym [cmbx9] [lmbx9] [encoding=texnansi]
- \definefontsynonym [cmbxsl10] [lmbxsl10] [encoding=texnansi]
- \definefontsynonym [cmbxti10] [lmbxti10] [encoding=texnansi]
- \definefontsynonym [cmcsc10] [lmcsc10] [encoding=texnansi]
- \definefontsynonym [cmitt10] [lmitt10] [encoding=texnansi]
- \definefontsynonym [cmr10] [lmr10] [encoding=texnansi]
- \definefontsynonym [cmr12] [lmr12] [encoding=texnansi]
- \definefontsynonym [cmr17] [lmr17] [encoding=texnansi]
- \definefontsynonym [cmr5] [lmr5] [encoding=texnansi]
- \definefontsynonym [cmr6] [lmr6] [encoding=texnansi]
- \definefontsynonym [cmr7] [lmr7] [encoding=texnansi]
- \definefontsynonym [cmr8] [lmr8] [encoding=texnansi]
- \definefontsynonym [cmr9] [lmr9] [encoding=texnansi]
- \definefontsynonym [cmsl10] [lmsl10] [encoding=texnansi]
- \definefontsynonym [cmsl12] [lmsl12] [encoding=texnansi]
- \definefontsynonym [cmsl8] [lmsl8] [encoding=texnansi]
- \definefontsynonym [cmsl9] [lmsl9] [encoding=texnansi]
- \definefontsynonym [cmsltt10] [lmsltt10] [encoding=texnansi]
- \definefontsynonym [cmss10] [lmss10] [encoding=texnansi]
- \definefontsynonym [cmss12] [lmss12] [encoding=texnansi]
- \definefontsynonym [cmss17] [lmss17] [encoding=texnansi]
- \definefontsynonym [cmss8] [lmss8] [encoding=texnansi]
- \definefontsynonym [cmss9] [lmss9] [encoding=texnansi]
- \definefontsynonym [cmssbx10] [lmssbx10] [encoding=texnansi]
- \definefontsynonym [cmssdc10] [lmssdc10] [encoding=texnansi]
- \definefontsynonym [cmssi10] [lmssi10] [encoding=texnansi]
- \definefontsynonym [cmssi12] [lmssi12] [encoding=texnansi]
- \definefontsynonym [cmssi17] [lmssi17] [encoding=texnansi]
- \definefontsynonym [cmssi8] [lmssi8] [encoding=texnansi]
- \definefontsynonym [cmssi9] [lmssi9] [encoding=texnansi]
- \definefontsynonym [cmtcsc10] [lmtcsc10] [encoding=texnansi]
- \definefontsynonym [cmti10] [lmti10] [encoding=texnansi]
- \definefontsynonym [cmti12] [lmti12] [encoding=texnansi]
- \definefontsynonym [cmti7] [lmti7] [encoding=texnansi]
- \definefontsynonym [cmti8] [lmti8] [encoding=texnansi]
- \definefontsynonym [cmti9] [lmti9] [encoding=texnansi]
- \definefontsynonym [cmtt10] [lmtt10] [encoding=texnansi]
- \definefontsynonym [cmtt12] [lmtt12] [encoding=texnansi]
- \definefontsynonym [cmtt8] [lmtt8] [encoding=texnansi]
- \definefontsynonym [cmtt9] [lmtt9] [encoding=texnansi]
-
- \definefontsynonym [cmbsl10] [lmbsl10] [encoding=texnansi]
- \definefontsynonym [cmssbi10] [lmssbi10] [encoding=texnansi]
- \definefontsynonym [cmssdi10] [lmssdi10] [encoding=texnansi]
- \definefontsynonym [cmssq8] [lmssq8] [encoding=texnansi]
- \definefontsynonym [cmssqb8] [lmssqb8] [encoding=texnansi]
- \definefontsynonym [cmssqbi8] [lmssqbi8] [encoding=texnansi]
- \definefontsynonym [cmssqi8] [lmssqi8] [encoding=texnansi]
+% Computer Modern Roman (AMS/BJ)
+
+\starttypescript [all] [computer-modern] [lm] % will be ec
+
+ % map
+
+ \loadmapfile[lm_ec.map]
+
+ % Regular
+
+ \definefontsynonym [cmr5] [lmr5_ec] [encoding=ec]
+ \definefontsynonym [cmr6] [lmr6_ec] [encoding=ec]
+ \definefontsynonym [cmr7] [lmr7_ec] [encoding=ec]
+ \definefontsynonym [cmr8] [lmr8_ec] [encoding=ec]
+ \definefontsynonym [cmr9] [lmr9_ec] [encoding=ec]
+ \definefontsynonym [cmr10] [lmr10_ec] [encoding=ec]
+ \definefontsynonym [cmr12] [lmr12_ec] [encoding=ec]
+ \definefontsynonym [cmr17] [lmr17_ec] [encoding=ec]
+
+ \definefontsynonym [cmbx5] [lmbx5_ec] [encoding=ec]
+ \definefontsynonym [cmbx6] [lmbx6_ec] [encoding=ec]
+ \definefontsynonym [cmbx7] [lmbx7_ec] [encoding=ec]
+ \definefontsynonym [cmbx8] [lmbx8_ec] [encoding=ec]
+ \definefontsynonym [cmbx9] [lmbx9_ec] [encoding=ec]
+ \definefontsynonym [cmbx10] [lmbx10_ec] [encoding=ec]
+ \definefontsynonym [cmbx12] [lmbx12_ec] [encoding=ec]
+
+ \definefontsynonym [cmsl10] [lmro10_ec] [encoding=ec]
+ \definefontsynonym [cmsl12] [lmro12_ec] [encoding=ec]
+ \definefontsynonym [cmsl8] [lmro8_ec] [encoding=ec]
+ \definefontsynonym [cmsl9] [lmro9_ec] [encoding=ec]
+
+ \definefontsynonym [cmti7] [lmri7_ec] [encoding=ec]
+ \definefontsynonym [cmti8] [lmri8_ec] [encoding=ec]
+ \definefontsynonym [cmti9] [lmri9_ec] [encoding=ec]
+ \definefontsynonym [cmti10] [lmri10_ec] [encoding=ec]
+ \definefontsynonym [cmti12] [lmri12_ec] [encoding=ec]
+
+ \definefontsynonym [cmb10] [lmb10_ec] [encoding=ec]
+ \definefontsynonym [cmbsl10] [lmbo10_ec] [encoding=ec]
+ \definefontsynonym [cmbxsl10] [lmbxo10_ec] [encoding=ec]
+ \definefontsynonym [cmbxti10] [lmbxi10_ec] [encoding=ec]
+
+ \definefontsynonym [cmcsc10] [lmcsc10_ec] [encoding=ec]
+ \definefontsynonym [cmcscsl10][lmcsco10_ec] [encoding=ec]
+
+ % Mono
+
+ \definefontsynonym [cmtt8] [lmtt8_ec] [encoding=ec]
+ \definefontsynonym [cmtt9] [lmtt9_ec] [encoding=ec]
+ \definefontsynonym [cmtt10] [lmtt10_ec] [encoding=ec]
+ \definefontsynonym [cmtt12] [lmtt12_ec] [encoding=ec]
+
+ \definefontsynonym [cmitt10] [lmtti10_ec] [encoding=ec]
+ \definefontsynonym [cmsltt10] [lmtto10_ec] [encoding=ec]
+
+ \definefontsynonym [cmvtt10] [lmvtt10_ec] [encoding=ec]
+ \definefontsynonym [cmvtti10] [lmvtto_ec] [encoding=ec]
+
+ \definefontsynonym [cmcsc10] [lmcsc10_ec] [encoding=ec]
+
+ % Sans
+
+ \definefontsynonym [cmss8] [lmss8_ec] [encoding=ec]
+ \definefontsynonym [cmss9] [lmss9_ec] [encoding=ec]
+ \definefontsynonym [cmss10] [lmss10_ec] [encoding=ec]
+ \definefontsynonym [cmss12] [lmss12_ec] [encoding=ec]
+ \definefontsynonym [cmss17] [lmss17_ec] [encoding=ec]
+
+ \definefontsynonym [cmssi10] [lmsso10_ec] [encoding=ec]
+ \definefontsynonym [cmssi12] [lmsso12_ec] [encoding=ec]
+ \definefontsynonym [cmssi17] [lmsso17_ec] [encoding=ec]
+ \definefontsynonym [cmssi8] [lmsso8_ec] [encoding=ec]
+ \definefontsynonym [cmssi9] [lmsso9_ec] [encoding=ec]
+
+ \definefontsynonym [cmssq8] [lmssq8_ec] [encoding=ec]
+ \definefontsynonym [cmssqb8] [lmssqbx8_ec] [encoding=ec]
+ \definefontsynonym [cmssqbi8] [lmssqbo8_ec] [encoding=ec]
+ \definefontsynonym [cmssqi8] [lmssqo8_ec] [encoding=ec]
+
+ \definefontsynonym [cmssbx10] [lmssbx10_ec] [encoding=ec]
+ \definefontsynonym [cmssdc10] [lmssdc10_ec] [encoding=ec]
+ \definefontsynonym [cmssbi10] [lmssbo10_ec] [encoding=ec]
+ \definefontsynonym [cmssdi10] [lmssdo10_ec] [encoding=ec]
+
\stoptypescript
-\starttypescript [all] [computer-modern] [ec]
+\starttypescript [all] [computer-modern] [ec] % will become ae
\definefontsynonym [cmb10] [aeb10] [encoding=ec,handling=glm]
\definefontsynonym [cmbx10] [aebx10] [encoding=ec,handling=glm]
\definefontsynonym [cmbx12] [aebx12] [encoding=ec,handling=glm]
diff --git a/tex/context/base/unic-ini.tex b/tex/context/base/unic-ini.tex
index 68ddd4d48..77e8fb5c1 100644
--- a/tex/context/base/unic-ini.tex
+++ b/tex/context/base/unic-ini.tex
@@ -239,7 +239,8 @@
%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 otherwise\NC \NC \NC \star\NC \NC \TraceUnic8\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
@@ -256,7 +257,8 @@
\expandafter\utfunihashchar \or
\expandafter\utfunihashsplit \or
\expandafter\utfunihashboth \or
- \@EA\string\@EA\unicodechar \else
+ \@EA\string\@EA\unicodechar \or
+ \expandafter\utfunientity \else
\expandafter\utfunihash
\fi}
@@ -298,6 +300,9 @@
\def\utfuniboth #1%
{{\tttf U\low{\unicodenumber{#1\relax}->\unicodepair{#1}}}}
+\def\utfunientity #1%
+ {{\tttf\&\#\unicodehexnumber{#1};}}
+
%D The character itself is accessed and typeset by:
%D
%D \starttypen
@@ -523,9 +528,13 @@
\@EA\utfunifontglyph
\fi}
+\def\utfunihushcommand
+ {\@EAEAEA\string\utfunihashglyph}
+
\def\utfunihashcommand
{\ifcase\utfunihashmode
- \@EA\utfunihashcommand
+ % \@EA\@EAEAEA\@EA\string\@EA\utfunihashglyph
+ \@EA\utfunihushcommand
\else
\@EA\utfunifontcommand
\fi}
diff --git a/tex/context/base/x-res-04.tex b/tex/context/base/x-res-04.tex
index 37bb6a5b4..578be1a7e 100644
--- a/tex/context/base/x-res-04.tex
+++ b/tex/context/base/x-res-04.tex
@@ -176,14 +176,14 @@
\stopXMLmapping
\def\getfigurefilename#1#2%
- {\ifnum\figurebasemode=2 \loadfigurebase{#1} \fi
+ {\ifnum\figurebasemode=\plustwo \loadfigurebase{#1} \fi
\startnointerference
\traceXMLelementsfalse
+ \resetfigurefilebase
+ \doglobal\newcounter\figurefilepage
\autoXMLnamespace[rl]
\startXMLmapping[rl:find]
- \resetfigurefilebase
\xdef\figurefilebase{#1}
- \doglobal\newcounter\figurefilepage
\def\askedlabel{#2}
\doifelseXMLelement{rl:rl:\askedlabel}
{\enableXMLelements\flushXMLelement{rl:rl:\askedlabel}}
@@ -191,12 +191,13 @@
\stopXMLmapping
\stopnointerference}
-% todo: niet toegekendede naam doorgeven aan calculate en pad
+% todo: niet toegekende naam doorgeven aan calculate en pad
% in padstring
\def\dogetfigurefilename#1%
{\ifx\figurefilename\empty
\bgroup
+ \doglobal\newcounter\figurefilepage
\globalletempty\figurefilelabel
\globalletempty\figurefileoriginal
\globalletempty\figurefilefile
diff --git a/tex/context/base/x-res-09.tex b/tex/context/base/x-res-09.tex
index cfe56a5c8..12ee02a6f 100644
--- a/tex/context/base/x-res-09.tex
+++ b/tex/context/base/x-res-09.tex
@@ -22,8 +22,10 @@
{\setups[rl:usage]%
\egroup}
+\defineXMLsave [rl:base] % base
\defineXMLsave [rl:type] % figure
\defineXMLsave [rl:state] % found|missing
+\defineXMLsave [rl:label] % label
\defineXMLsave [rl:file] % filename
\defineXMLsave [rl:suffix] % filesuffix
\defineXMLsave [rl:comment] % text
@@ -46,10 +48,11 @@
\startsetups[rl:usage]
\starttabulate[|lw(4.5em)|p|]
+ \XMLrlentry {base} {rl:base} {0}
\XMLrlentry {type} {rl:type} {0}
\XMLrlentry {state} {rl:state} {0}
\XMLrlentry {file} {rl:file} {0}
- \XMLrlentry {name} {rl:name} {0}
+ \XMLrlentry {label} {rl:label} {0}
\XMLrlentry {suffix} {rl:suffix} {0}
\XMLrlentry {page} {rl:page} {0}
\XMLrlentry {width} {rl:width} {1}
diff --git a/tex/context/base/x-sch-01.tex b/tex/context/base/x-sch-01.tex
index f704f8e73..d954b1730 100644
--- a/tex/context/base/x-sch-01.tex
+++ b/tex/context/base/x-sch-01.tex
@@ -59,7 +59,7 @@
\usetypescript
[palatino]
- [texnansi]
+ [\defaultencoding]
\setupbodyfont
[palatino,10pt]
diff --git a/tex/context/base/x-xml-01.tex b/tex/context/base/x-xml-01.tex
index b53101b78..570641c5e 100644
--- a/tex/context/base/x-xml-01.tex
+++ b/tex/context/base/x-xml-01.tex
@@ -48,12 +48,20 @@
%
% so:
-\definedfont [Mono at 1pt]
+\setupbodyfont
+ [tt,10pt]
+
+\setuptolerance
+ [verytolerant]
+
+\setupalign
+ [broad,right]
\setuplayout
[backspace=0cm,
topspace=0cm,
- width=40em,
+ width=middle,
+% width=40em,
height=middle,
header=0cm,
footer=0cm]
diff --git a/tex/context/base/xtag-pre.tex b/tex/context/base/xtag-pre.tex
index efe505656..f6d6e7ec6 100644
--- a/tex/context/base/xtag-pre.tex
+++ b/tex/context/base/xtag-pre.tex
@@ -101,6 +101,8 @@
\fetchruntimecommand\showXMLwrd {\f!xtagprefix\s!run}
\fetchruntimecommand\showXMLemp {\f!xtagprefix\s!run}
+\fetchruntimecommand\showXMLbreak {\f!xtagprefix\s!run}
+
%D By default, we will ignore escape commands, preceded by
%D \type {<!} and ending in (presumably) a \type {>}.
diff --git a/tex/context/base/xtag-run.tex b/tex/context/base/xtag-run.tex
index b8ba2b36e..1648ed063 100644
--- a/tex/context/base/xtag-run.tex
+++ b/tex/context/base/xtag-run.tex
@@ -100,10 +100,13 @@
\ifcase\@XMLnofelements\else\@@xftussen\fi
\fi
\fi
- \hangindent2em
+ % no, too fragile: \hangindent2em
+\ifcase\kindofXMLelement\or\or
+ \getvalue{\@@XMLshow::\currentXMLelement}\relax
+\fi
\indent
\bgroup
- \localcolortrue
+ % \localcolortrue
\advance\XMLlevel \minusone
\DoMod\XMLlevel by\XMLprettycycle to\scratchcounter
\advance\scratchcounter \plusone
@@ -122,14 +125,17 @@
\string>%
\stopcolor
\egroup
+\ifcase\kindofXMLelement\or
+ \getvalue{\@@XMLshow::\currentXMLelement}\relax
+\fi
\ifnum\XMLlevel<\@@xfniveau\relax
\ifnum\kindofXMLelement=1\else
\doglobal\increment\@XMLnofelements\relax
\ifcase\@XMLnofelements\else\@@xftussen\fi
\fi
\fi
- \ifXMLunspacepretty\ignorespaces\fi}
-
+ \ifXMLunspacepretty\ignorespaces\fi}
+
\gdef\nextXMLtext{\blank\@XMLlevel+\@XMLelement1\par}
\gdef\prevXMLtext{\par\@XMLelement0\par\@XMLlevel-\blank}
\gdef\nextXMLpara{\nextXMLline\par}
@@ -187,6 +193,10 @@
\gdef\showXMLemp[#1]%
{\setXMLshow\defineXMLsingular\someXMLword\relax[#1]}
+\gdef\showXMLbreak[#1]%
+ {\def\docommando##1{\setvalue{\@@XMLshow::##1}{\hskip\zeropoint}}%
+ \processcommalist[#1]\docommando}
+
\gdef\doautoshowXMLelement
{\ifcase\kindofXMLelement
\or \nextXMLpara \or \prevXMLpara \or \someXMLline
@@ -212,6 +222,8 @@
\ifautoXMLshow \let\executeXMLelement\autoshowXMLelement \fi
\let\executeXMLentity\@XMLentity
\enableXML\verbatimXML
+\enableregime[utf]%
+\chardef\utfunicodetracer8
\readfile{\truefilename{#1}}\donothing\donothing\endgraf
\removelastskip % really needed
\stopopelkaar
diff --git a/tex/latex/context/m-ch-de.sty b/tex/latex/context/m-ch-de.sty
index d52078728..5988d7a53 100644
--- a/tex/latex/context/m-ch-de.sty
+++ b/tex/latex/context/m-ch-de.sty
@@ -1 +1 @@
-\input m-ch-de.tex \relax \endinput
+\input m-ch-de.tex \relax \endinput
diff --git a/tex/latex/context/m-ch-en.sty b/tex/latex/context/m-ch-en.sty
index ba5a5e16c..f22512d05 100644
--- a/tex/latex/context/m-ch-en.sty
+++ b/tex/latex/context/m-ch-en.sty
@@ -1 +1 @@
-\input m-ch-en.tex \relax \endinput
+\input m-ch-en.tex \relax \endinput
diff --git a/tex/latex/context/m-ch-nl.sty b/tex/latex/context/m-ch-nl.sty
index 492f5efd3..29c40be30 100644
--- a/tex/latex/context/m-ch-nl.sty
+++ b/tex/latex/context/m-ch-nl.sty
@@ -1 +1 @@
-\input m-ch-nl.tex \relax \endinput
+\input m-ch-nl.tex \relax \endinput
diff --git a/tex/latex/context/m-metapo.sty b/tex/latex/context/m-metapo.sty
index 1df781eae..c1d9f3a9f 100644
--- a/tex/latex/context/m-metapo.sty
+++ b/tex/latex/context/m-metapo.sty
@@ -1 +1 @@
-\input m-metapo.tex \relax \endinput
+\input m-metapo.tex \relax \endinput
diff --git a/tex/latex/context/m-pictex.sty b/tex/latex/context/m-pictex.sty
index da9c18ed7..be5dd8504 100644
--- a/tex/latex/context/m-pictex.sty
+++ b/tex/latex/context/m-pictex.sty
@@ -1 +1 @@
-\input m-pictex.tex \relax \endinput
+\input m-pictex.tex \relax \endinput